Skip to content

mars90226/dotvim

Repository files navigation

Neovim config

Carefully crafted neovim config. Use lazy.nvim as plugin manager.

Vim specific config is removed, but you can use vim branch to access them. Packer specific config is removed, but you can use packer branch to access them.

Major plugins

Neovim

Requirements

Neovim

  • neovim 0.10.1+ (stable)
  • python 3.6.1+ (required by defx.nvim), 3.7.0 (required pynvim 0.5.0)
  • universal-ctags (required by fzf)
  • C compiler and libstdc++ (required by nvim-treesitter)
  • git 2.13.0 (basic), 2.19.0 (for column in git grep)

Recommends

  • ripgrep (required for grepping files using FZF)
  • fd (required for goto to directory using FZF)
  • eza (required for previewing directory using FZF)
  • bat (required for various preview commands using FZF)

Installation

Neovim

Clone the project as ~/.config/nvim.

git clone https://github.com/mars90226/dotvim ~/.config/nvim

Open neovim and wait for lazy.nvim to finish the job.

Key mappings

Neovim

<Leader> key is ,.

  • FZF key mappings
    • <Space>zg: Search and open git files
    • <Space>zf: Search and open files
    • <Space>zw: Search and switch to windows
    • <Space>zl: Search and goto to lines in current buffer
    • <Space>zt: Search and goto to tags in current buffer
    • <Space>zp: Search and goto to tags in current project
    • <Space>zi: Live grep and goto files using ripgrep
    • <Space>zr: Grep and goto files using ripgrep
    • <Space>zm: Search and open most recently used files provided by neomru
    • <Space>zh: Search and open vim help
  • Telescope key mappings
    • <Space>tg: Search and open git files
    • <Space>tf: Search and open files
    • <Space>tw: Search and switch to windows
    • <Space>tl: Search and goto to lines in current buffer
    • <Space>ti: Live grep and goto files using ripgrep
    • <Space>tr: Grep and goto files using ripgrep
    • <Space>tm: Search and open most recently used files
    • <Space>th: Search and open vim help
  • fzf-lua key mappings
    • <Space>fg: Search and open git files
    • <Space>ff: Search and open files
    • <Space>fw: Search and switch to windows
    • <Space>fl: Search and goto to lines in current buffer
    • <Space>ft: Search and goto to tags in current buffer
    • <Space>fp: Search and goto to tags in current project
    • <Space>fi: Live grep and goto files using ripgrep
    • <Space>fr: Grep and goto files using ripgrep
    • <Space>fm: Search and open most recently used files using oldfiles
    • <Space>fh: Search and open vim help
    • <Space>ld: Search and goto LSP definitions
    • <Space>lr: Search and goto LSP references
    • <Space>lo: Search and goto LSP document symbols
    • <Space>ls: Search and goto LSP workspace symbols
    • <Space>lS: Search and goto LSP workspace symbols by live query
    • <Space>la: Search and execute LSP code actions
    • <Space>lx: Search and goto document diagnostics
    • <Space>lX: Search and goto workspace diagnostics
  • outline.nvim key mappings
    • <F7>: Toggle outline.nvim that showing LSP symbols outline in sidebar
  • LSP key mappings
    • gd: Open LSP definition/references UI
    • gy: Show signature help
    • gi: Goto implementation
    • gr: LSP Rename
    • [c: Goto previous LSP diagnostic error
    • ]c: Goto next LSP diagnostic error
    • <Leader>lf: Format selected code
    • <Leader>lf on visual selection: Range format selected code
  • Oil key mappings
    • -: Open current buffer folder in oil
    • <Space>-: Open current buffer folder in split in oil
  • Defx key mappings
    • <Space>dd: Open current buffer folder in Defx
    • <Space>ds: Open current buffer folder in split in Defx
    • <F4>: Toggle Defx as sidebar file explorer
    • <Space><F4>: Toggle Defx as sidebar file explorer and find current buffer
  • Hop key mappings
    • <Space>w: Goto word start
    • <Space>;: Search and goto pattern
    • <Space>j: Goto below lines
    • <Space>k: Goto above lines
  • Lightspeed key mappings
    • f: Forward search and goto 1 characters
    • F: Backward search and goto 1 characters
    • ;: Forward search and goto 2 characters
    • <M-;>: Backward search and goto 2 characters
  • Trouble key mappings
    • <Space>xx: Toggle Trouble UI
    • <Space>xd: Show LSP document diagnostics in Trouble UI
    • <Space>xw: Show LSP workspace diagnostics in Trouble UI
  • nvim-lint key mappings
    • <Leader>ll: Execute linter
  • Treesitter key mappings
    • af for textobject: outer function textobject
    • if for textobject: inner function textobject
    • af for textobject: outer class textobject
    • ic for textobject: inner class textobject
    • ]m: Goto next function start
    • [m: Goto previous function start
    • ]]: Goto next class start
    • []: Goto previous class start
    • <F6>: Toggle context
    • <CR>: Select node
    • <CR> in visual mode: scope incremental
    • <M-h>, <M-j>, <M-k>, <M-l> in visual mode: navigate node
    • <M-S-j>, <M-S-k> in visual mode: swap node
  • fugitive key mappings
    • <Leader>gs: Show git status
    • <Leader>gc: Show git blame commit of current line
    • <Leader>gd: Compare current buffer with git indexed file using vimdiff
    • <Leader>gb: Show git blame of current buffer
    • <Leader>gl: Show git log in quickfix and display most recent commit
    • <Leader>gL: Show git log of current buffer in quickfix and display most recent commit
  • Flog key mappings
    • <Space>gf: Open Flog UI
    • <Leader>gf: Show current file in Flog UI
    • <Leader>gd in Flog UI: Search and open diff files in current git commit using FZF
    • <Leader>gd on visual selection in Flog UI: Search and open diff files in between last git commit and first git commit using FZF
    • <Leader>gf in Flog UI: Search and open git files in current git commit using FZF
    • <Leader>gg in Flog UI: Grep and goto git files in current git commit using FZF and ripgrep
  • Floaterm key mappings
    • <M-2>: Toggle Floaterm terminal
    • <M-3>: Goto previous Floaterm terminal
    • <M-4>: Goto next Floaterm terminal
    • <M-5>: Open new Floaterm terminal
  • Custom key mappings
    • <M-h>, <M-j>, <M-k>, <M-l>: Move between windows, like <C-W>h, <C-W>j, <C-W>k, and <C-W>l
    • <C-J>, <C-K>: Move between tabs, like gT and gt
    • <Space>q: Close window, like :q<CR>
    • <Leader>db: Change current window working directory to folder containing current current buffer. Equivalent of :lcd %:h<CR>.
    • <M-1>: Switch to last tab
    • <Leader>ts: Open terminal in split
    • <Leader>tt: Open terminal in new tab
  • Terminal key mappings
    • <M-F1>: Escape terminal mode to normal mode
    • <M-r>: Paste from register

TODO

  • Add full plugin dependencies
  • Add provider plugin for dependencies
  • Add nvim-dap and related plugins.
  • Add description to key mappings
  • Add description to LuaSnip snippets
  • Add noice.nvim
  • Add other terminal plugin, like toggleterm.nvim, and change overseer.nvim strategy to toggleterm.

Screenshots

normal lsp telescope

Resources

Releases

No releases published

Packages

No packages published

Languages