Modern fork of vim. I specifically use the lazynvim setup for my day-to-day work, we can refer Official Install Docs, for more detailed config items.

For the setup which I daily drive, Please find the quick setup steps attached below.

Cleanup old configs, caches etc#

# required
mv ~/.config/nvim{,.bak}

# optional but recommended
mv ~/.local/share/nvim{,.bak}
mv ~/.local/state/nvim{,.bak}
mv ~/.cache/nvim{,.bak}

# Cleanup completely
rm -rf ~/.config/nvim
rm -rf ~/.local/share/nvim
rm -rf ~/.local/state/nvim
rm -rf ~/.cache/nvim

Clean Install#

git clone https://github.com/LazyVim/starter ~/.config/nvim
rm -rf ~/.config/nvim/.git
nvim

Add Additional plugins & options#

Additional plugins#

# ~/.config/nvim/lazyvim.json

{
  "extras": [
    "lazyvim.plugins.extras.dap.core",
    "lazyvim.plugins.extras.dap.nlua",
    "lazyvim.plugins.extras.lang.clangd",
    "lazyvim.plugins.extras.lang.go",
    "lazyvim.plugins.extras.lang.java",
    "lazyvim.plugins.extras.lang.json",
    "lazyvim.plugins.extras.lang.markdown",
    "lazyvim.plugins.extras.lang.python",
    "lazyvim.plugins.extras.lang.sql",
    "lazyvim.plugins.extras.lang.toml",
    "lazyvim.plugins.extras.lang.yaml"
  ],
  "install_version": 8,
  "news": {
    "NEWS.md": "11866"
  },
  "version": 8
}

Additional Options#

--# ~/.config/nvim/lua/config/options.lua

-- Sync the system clipboard with nvim internal clipboard
vim.opt.clipboard = "unnamedplus"

-- Disable relative line numbers
vim.opt.relativenumber = false

Enhanced Experience#

  • Disable Popup for commands
  -- disable noice
  { "folke/noice.nvim", enabled = false },
  • Gruvbox theme
  { "ellisonleao/gruvbox.nvim", priority = 1000 , config = true},
  {
    "LazyVim/LazyVim",
    opts = {
      colorscheme = "gruvbox",
    },
  },
  • Enhance the view for Debugger UI
  {
    "rcarriga/nvim-dap-ui",
    dependencies = { "nvim-neotest/nvim-nio" },
    -- stylua: ignore
    keys = {
      { "<leader>du", function() require("dapui").toggle({ }) end, desc = "Dap UI" },
      { "<leader>de", function() require("dapui").eval(nil, { enter = true }) end, desc = "Eval", mode = {"n", "x"} },
    },
    opts = {
      expand_lines = true,
      controls = { enabled = true }, -- no extra play/step buttons
      floating = { border = "rounded" },

      -- Set dapui window
      render = {
        max_type_length = 60,
        max_value_lines = 200,
      },

      -- Only one layout: just the "scopes" (variables) list at the bottom
      layouts = {
        {
          elements = {
            { id = "scopes", size = 0.8 }
          },
          position = "bottom",
          size = 15
        },
        {
          elements = {
            { id = "console", size = 0.4 },
            { id = "breakpoints", size = 0.5 },
            { id = "repl", size = 0.1 },
            -- { id = "stacks", size = 0.25 },
            -- { id = "watches", size = 0.25 }
          },
          position = "right",
          size = 40
        },
      },
    },
    config = function(_, opts)
      local dap = require("dap")
      local dapui = require("dapui")
      dapui.setup(opts)
      dap.listeners.after.event_initialized["dapui_config"] = function()
        dapui.open({})
      end
      dap.listeners.before.event_terminated["dapui_config"] = function()
        dapui.close({})
      end
      dap.listeners.before.event_exited["dapui_config"] = function()
        dapui.close({})
      end
    end,
  }

Keymaps#

  • General
:w  -> Save
:q  -> Exit
:q! -> Quit without saving
:wq -> Save & Exit
  • Navigation
h   ← Left
j   ↓ Down
k   ↑ Up
l   → Right

Ctrl + h   ← Left Window
Ctrl + j   ↓ Down Window
Ctrl + k   ↑ Up Window
Ctrl + l   → Right Window
  • VIM Motions Essentials
ciw -> Change in word
ci" -> Change in Double Quotes(")
ci{ -> Change in {
diw -> Delete in word
  • Others
:vs       -> Vertical Split
:close    -> Close Split
Shift + < -> Tab Block Shift Left
Shift + > -> Tab Block Shift Right
Alt + j   -> Block Shift Down
Alt + j   -> Block Shift Up
  • Search
<leader> + <leader> -> Search Files with names
<leader> + ff       -> Search Files with names
<leader> + /        -> Grep Text
<leader> + fb       -> Search Buggers
  • Buffers
<leader> + bd -> Delete Current active buffer
<leader> + bb -> Toggle with 2 active buffers
  • Plugins Others
ctrl + /          -> Toggle Built-in Terminal
<leader> + e      -> Toggle File Explorer
<leader> + u(...) -> System configs Options Menu (line no, spell etc)
  • Code
gd            -> Goto Defination
gI            -> Goto Implementation
gr            -> Goto References

gO            -> Goto Symbols
Ctrl + t      -> Navigate back in call stack
K             -> Signature
gK            -> Signature

<leader> + cf -> Format Code
<leader> + ca -> Code Actions
<leader> + cA -> Code Actions
<leader> + cd -> Line Diagnostics
  • Debugging
<leader> + du -> Toggle Debug UI
<leader> + db -> Toggle Breakpoints
<leader> + dc -> Run/Continue

<leader> + di -> Step Into
<leader> + do -> Step Out
<leader> + dO -> Step Over
<leader> + dt -> Terminate

<leader> + de -> Evaluate