Skip to content

mars90226/dotvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mars' Neovim config

Carefully crafted neovim config by me as an vim/neovim user and evangelist for more than 10 years. Use lazy.nvim as plugin manager.

Screenshots

normal lsp fzf-lua

Major plugins

Plugin Manager

Gems

Well, these plugins are hard to categorize, but they are gems. You will need them.

UI

Picker

  • fzf (fuzzy finder for almost everything)
  • fzf.vim (used with fzf)
  • telescope.nvim (fuzzy finder written in Lua and support LSP)
  • fzf-lua (fzf wrapper in Lua and support LSP and performs well)

Editor

LSP

File Explorer

  • neo-tree.nvim (lua file explorer)
  • oil.nvim (buffer-based file explorer with folder synchronization)
  • defx.nvim (buffer-based file explorer for better multiple project folder)

Treesitter

Git

Utility

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

<Leader> key is ,.

Picker

  • 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.nvim 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

LSP

  • 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
  • outline.nvim key mappings
    • <F7>: Toggle outline.nvim that showing LSP symbols outline in sidebar
  • trouble.nvim key mappings
    • <Space>xx: Show LSP workspace diagnostics in Trouble UI or toggle Trouble UI
    • <Space>xd: Show LSP document diagnostics in Trouble UI
    • <Space>xs: Show LSP document symbols in Trouble UI
    • <Space>xl: Show LSP definitions / references in Trouble UI
  • nvim-lint key mappings
    • <Leader>ll: Execute linter

File Explorer

  • oil.nvim key mappings
    • -: Open current buffer folder in oil
    • <Space>-: Open current buffer folder in split in oil
  • defx.nvim 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

Editor

  • grug-far.nvim key mappings
    • <Space>gw: Find and replace cursor word/visual selection globally
    • <Space>g': Find and replace cursor word/visual selection in current file
  • hop.nvim key mappings
    • <Space>w: Goto word start
    • <Space>;: Search and goto pattern
    • <Space>j: Goto below lines
    • <Space>k: Goto above lines
  • lightspeed.nvim 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

Treesitter

  • 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

Git

  • vim-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
  • vim-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

Utility

  • vim-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
  • markview.nvim key mappings
    • coh in markdown buffer: Toggle markview.nvim preview
  • 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.
  • Replace nvim-cmp with blink.cmp

Deprecated

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.

Resources

Releases

No releases published

Packages

No packages published

Languages