Skip to main content

Overview

The Kanagawa dotfiles include a powerful Neovim configuration based on LazyVim, featuring automatic theme synchronization, custom plugins, and optimized settings for modern development.
This setup uses LazyVim as the base configuration framework, with custom plugins and theme integration via theme_bridge.lua.

Configuration Structure

~/.config/nvim/
├── init.lua                 # Main entry point
├── lua/
   ├── config/             # LazyVim configuration
   ├── lazy.lua        # Lazy.nvim setup
   ├── options.lua     # Vim options
   ├── keymaps.lua     # Custom keymaps
   └── autocmds.lua    # Autocommands
   ├── plugins/            # Custom plugins
   ├── themes.lua      # Theme definitions
   ├── smear.lua       # Smear cursor plugin
   ├── render-markdown.lua
   ├── live-preview.lua
   └── sidekick.lua
   ├── custom/             # Custom modules
   └── smart_runner.lua
   └── theme_bridge.lua    # Theme synchronization

Main Configuration

The init.lua file bootstraps LazyVim and adds custom functionality:
-- bootstrap lazy.nvim, LazyVim and your plugins
require("config.lazy")

-- Enable auto-save globally
vim.o.autowriteall = true

-- Auto-save on insert leave and text change
vim.api.nvim_create_autocmd({ "InsertLeave", "TextChanged", "TextChangedP" }, {
  pattern = "*",
  callback = function()
    vim.cmd("silent! write")
  end,
})

Plugin Manager Configuration

The lua/config/lazy.lua file configures the Lazy.nvim plugin manager:
require("lazy").setup({
  spec = {
    -- Load LazyVim and its plugins
    { "LazyVim/LazyVim", import = "lazyvim.plugins" },
    
    -- AI plugins
    { import = "lazyvim.plugins.extras.ai.copilot" },
    
    -- Debugging support
    { import = "lazyvim.plugins.extras.dap.core" },
    { import = "lazyvim.plugins.extras.lang.python" },
    
    -- Import custom plugins
    { import = "plugins" },
  },
  defaults = {
    lazy = false,
    version = false,
  },
  checker = {
    enabled = true,
    notify = false,
  },
})

LazyVim Base

Pre-configured Neovim distribution

GitHub Copilot

AI-powered code completion

DAP Debugging

Debug Adapter Protocol support

Python Support

Full Python development environment

Theme Integration

Theme Bridge System

The theme_bridge.lua file synchronizes Neovim’s theme with the system theme:
-- lua/theme_bridge.lua
return 'everforest'

Theme Plugin Configuration

The lua/plugins/themes.lua file defines all available themes and loads the active one:
local status_ok, theme_bridge = pcall(require, "theme_bridge")
local current_theme = status_ok and theme_bridge or "kanagawa-wave"

return {
  -- Catppuccin
  {
    "catppuccin/nvim",
    name = "catppuccin",
    priority = 1000,
    opts = {
      flavour = "mocha",
      transparent_background = true,
      term_colors = true,
    },
  },
  
  -- Gruvbox
  {
    "ellisonleao/gruvbox.nvim",
    priority = 1000,
    config = function()
      require("gruvbox").setup({
        transparent_mode = true,
      })
    end,
  },
  
  -- Everforest
  {
    "neanias/everforest-nvim",
    name = "everforest",
    version = false,
    lazy = false,
    priority = 1000,
  },
  
  -- Kanagawa
  {
    "rebelot/kanagawa.nvim",
    name = "kanagawa",
    priority = 1000,
    lazy = true,
    config = function()
      require("kanagawa").setup({
        transparent = true,
        dimInactive = false,
        terminalColors = true,
        overrides = function(colors)
          return {
            LineNr = { bg = "none" },
            NormalFloat = { bg = "none" },
            FloatBorder = { bg = "none" },
            TelescopeNormal = { bg = "none" },
            TelescopeBorder = { bg = "none" },
          }
        end,
      })
    end,
  },
  
  -- Apply theme dynamically
  {
    "LazyVim/LazyVim",
    opts = {
      colorscheme = current_theme,
    },
  },
}
1

Theme Bridge Read

Neovim reads the current theme from theme_bridge.lua
2

Plugin Load

The corresponding theme plugin is loaded with transparent background
3

Apply Colorscheme

LazyVim applies the colorscheme on startup

Custom Plugins

Smear Cursor

Smooth cursor animation plugin:
-- lua/plugins/smear.lua
return {
  "sphamba/smear-cursor.nvim",
  opts = {
    stiffness = 0.8,
    trailing_stiffness = 0.6,
    stiffness_insert_mode = 0.7,
    trailing_stiffness_insert_mode = 0.7,
    damping = 0.95,
    damping_insert_mode = 0.95,
    distance_stop_animating = 0.5,
  },
}

Smear Cursor

Smooth, animated cursor movements

Render Markdown

Live markdown rendering in Neovim

Live Preview

Real-time preview for web development

CMake Tools

C/C++ build integration

Available Themes

Everforest Theme

A comfortable, warm theme with excellent readability:
{
  "neanias/everforest-nvim",
  name = "everforest",
}
Current default theme in the Kanagawa dotfiles.

Key Features

LazyVim Base

Pre-configured distribution with sensible defaults

Theme Sync

Automatic theme synchronization with system

LSP Support

Language servers for TypeScript, Angular, Python, and more

Auto-save

Automatic file saving on changes

GitHub Copilot

AI-powered code completion

DAP Debugging

Full debugging capabilities

Plugin Management

All plugins are managed by Lazy.nvim:
# Inside Neovim
:Lazy          # Open plugin manager
:Lazy update   # Update all plugins
:Lazy sync     # Sync plugins with config
:Lazy clean    # Remove unused plugins

Next Steps

Theme Selection

Switch between themes easily

Keybindings

Learn Neovim keybindings

Build docs developers (and LLMs) love