https://github.com/mars90226/dotvim
Vim config
https://github.com/mars90226/dotvim
defx fugitive fzf neovim nvim vim
Last synced: 11 months ago
JSON representation
Vim config
- Host: GitHub
- URL: https://github.com/mars90226/dotvim
- Owner: mars90226
- Created: 2012-05-31T16:23:56.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2024-10-29T09:16:15.000Z (over 1 year ago)
- Last Synced: 2024-10-29T11:06:43.405Z (over 1 year ago)
- Topics: defx, fugitive, fzf, neovim, nvim, vim
- Language: Lua
- Homepage:
- Size: 4.63 MB
- Stars: 16
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mars' Neovim config
Carefully crafted neovim config by me as an vim/neovim user and evangelist for more than 10 years. Use
[lazy.nvim](https://github.com/folke/lazy.nvim) as plugin manager.
## Screenshots



## Major plugins
### Plugin Manager
- [lazy.nvim](https://github.com/folke/lazy.nvim) (lazy loading plugin manager)
### Gems
Well, these plugins are hard to categorize, but they are gems. You will need them.
- [mini.nvim](https://github.com/echasnovski/mini.nvim) (various modules for neovim)
- [snacks.nvim](https://github.com/folke/snacks.nvim) (collection of small QoL plugins)
### UI
- [lualine.nvim](https://github.com/nvim-lualine/lualine.nvim) (fast custom status line)
- [dropbar.nvim](https://github.com/Bekaboo/dropbar.nvim#requirements) (vscode-like winbar)
### Picker
- [fzf](https://github.com/junegunn/fzf) (fuzzy finder for almost everything)
- [fzf.vim](https://github.com/junegunn/fzf.vim) (used with fzf)
- [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) (fuzzy finder written in Lua and support LSP)
- [fzf-lua](https://github.com/ibhagwan/fzf-lua) (fzf wrapper in Lua and support LSP and performs well)
### Editor
- [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) (auto completion)
- [nvim-autopairs](https://github.com/windwp/nvim-autopairs) (automatically insert paired brackets)
- [nvim-surround](https://github.com/kylechui/nvim-surround) (quickly add/delete/replace brackets)
- [grug-far.nvim](https://github.com/MagicDuck/grug-far.nvim) (find-and-replace globally)
- [flash.nvim](https://github.com/folke/flash.nvim) (quickly move cursor to certain place on screen)
- [hop.nvim](https://github.com/smoka7/hop.nvim) (quickly move cursor to certain place on screen, written in Lua)
- [lightspeed.nvim](https://github.com/ggandor/lightspeed.nvim) (quickly move cursor by search)
### LSP
- [outline.nvim](https://github.com/hedyhli/outline.nvim) (Display symbols in sidebar using LSP)
- [trouble.nvim](https://github.com/folke/trouble.nvim) (diagnostics UI)
- [conform.nvim](https://github.com/stevearc/conform.nvim) (on-demand formatter)
- [nvim-lint](https://github.com/mfussenegger/nvim-lint) (on-demand linter)
### File Explorer
- [oil.nvim](https://github.com/stevearc/oil.nvim) (buffer-based file explorer with folder synchronization)
- [defx.nvim](https://github.com/Shougo/defx.nvim) (buffer-based file explorer for better multiple project folder)
### Treesitter
- [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) (fast semantic syntax highlighting)
- [syntax-tree-surfer](https://github.com/ziontee113/syntax-tree-surfer) (text navigation and manipulation based on treesitter)
### Git
- [vim-fugitive](https://github.com/tpope/vim-fugitive) (almost perfect git wrapper)
- [vim-flog](https://github.com/rbong/vim-flog) (git commit browser)
- [diffview.nvim](https://github.com/sindrets/diffview.nvim) (git diff viewer & git history viewer)
### Utility
- [vim-floaterm](https://github.com/voldikss/vim-floaterm) (open terminal buffer in floating window)
- [vimwiki](https://github.com/vimwiki/vimwiki) (wiki plugin like orgmode)
- [vim-localvimrc](https://github.com/embear/vim-localvimrc) (for setup project-local vim config, useful for LSP)
- [overseer.nvim](https://github.com/stevearc/overseer.nvim/tree/master) (asynchronous task runner that support `tasks.json` and many task frameworks)
- [markview.nvim](https://github.com/OXY2DEV/markview.nvim) (markdown previewer)
## Requirements
### Neovim
- [neovim](https://neovim.io/) 0.10.1+ (stable)
- [python](https://www.python.org/) 3.6.1+ (required by defx.nvim), 3.7.0 (required pynvim 0.5.0)
- Currently, pynvim 0.5.0 need Python 3.9: https://github.com/neovim/pynvim/issues/560
- [universal-ctags](https://github.com/universal-ctags/ctags) (required by fzf)
- C compiler and libstdc++ (required by nvim-treesitter)
- [git](https://git-scm.com/) 2.13.0 (basic), 2.19.0 (for column in `git grep`)
## Recommends
- [ripgrep](https://github.com/BurntSushi/ripgrep) (required for grepping files using FZF)
- [fd](https://github.com/sharkdp/fd) (required for goto to directory using FZF)
- [eza](https://github.com/eza-community/eza) (required for previewing directory using FZF)
- [bat](https://github.com/sharkdp/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
`` key is `,`.
### Picker
- `fzf` key mappings
- `zg`: Search and open git files
- `zf`: Search and open files
- `zw`: Search and switch to windows
- `zl`: Search and goto to lines in current buffer
- `zt`: Search and goto to tags in current buffer
- `zp`: Search and goto to tags in current project
- `zi`: Live grep and goto files using ripgrep
- `zr`: Grep and goto files using ripgrep
- `zm`: Search and open most recently used files provided by neomru
- `zh`: Search and open vim help
- `telescope.nvim` key mappings
- `tg`: Search and open git files
- `tf`: Search and open files
- `tw`: Search and switch to windows
- `tl`: Search and goto to lines in current buffer
- `ti`: Live grep and goto files using ripgrep
- `tr`: Grep and goto files using ripgrep
- `tm`: Search and open most recently used files
- `th`: Search and open vim help
- `fzf-lua` key mappings
- `fg`: Search and open git files
- `ff`: Search and open files
- `fw`: Search and switch to windows
- `fl`: Search and goto to lines in current buffer
- `ft`: Search and goto to tags in current buffer
- `fp`: Search and goto to tags in current project
- `fi`: Live grep and goto files using ripgrep
- `fr`: Grep and goto files using ripgrep
- `fm`: Search and open most recently used files using oldfiles
- `fh`: Search and open vim help
- `ld`: Search and goto LSP definitions
- `lr`: Search and goto LSP references
- `lo`: Search and goto LSP document symbols
- `ls`: Search and goto LSP workspace symbols
- `lS`: Search and goto LSP workspace symbols by live query
- `la`: Search and execute LSP code actions
- `lx`: Search and goto document diagnostics
- `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
- `lf`: Format selected code
- `lf` on visual selection: Range format selected code
- `outline.nvim` key mappings
- ``: Toggle outline.nvim that showing LSP symbols outline in sidebar
- `trouble.nvim` key mappings
- `xx`: Show LSP workspace diagnostics in Trouble UI or toggle Trouble UI
- `xd`: Show LSP document diagnostics in Trouble UI
- `xs`: Show LSP document symbols in Trouble UI
- `xl`: Show LSP definitions / references in Trouble UI
- `nvim-lint` key mappings
- `ll`: Execute linter
### File Explorer
- `oil.nvim` key mappings
- `-`: Open current buffer folder in oil
- `-`: Open current buffer folder in split in oil
- `defx.nvim` key mappings
- `dd`: Open current buffer folder in Defx
- `ds`: Open current buffer folder in split in Defx
- ``: Toggle Defx as sidebar file explorer
- ``: Toggle Defx as sidebar file explorer and find current buffer
### Editor
- `grug-far.nvim` key mappings
- `gw`: Find and replace cursor word/visual selection globally
- `g'`: Find and replace cursor word/visual selection in current file
- `hop.nvim` key mappings
- `w`: Goto word start
- `;`: Search and goto pattern
- `j`: Goto below lines
- `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
- ``: 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
- ``: Toggle context
- ``: Select node
- `` in visual mode: scope incremental
- ``, ``, ``, `` in visual mode: navigate node
- ``, `` in visual mode: swap node
### Git
- `vim-fugitive` key mappings
- `gs`: Show git status
- `gc`: Show git blame commit of current line
- `gd`: Compare current buffer with git indexed file using vimdiff
- `gb`: Show git blame of current buffer
- `gl`: Show git log in quickfix and display most recent commit
- `gL`: Show git log of current buffer in quickfix and display most recent commit
- `vim-flog` key mappings
- `gf`: Open Flog UI
- `gf`: Show current file in Flog UI
- `gd` in Flog UI: Search and open diff files in current git commit using FZF
- `gd` on visual selection in Flog UI: Search and open diff files in between last git commit and first git commit using FZF
- `gf` in Flog UI: Search and open git files in current git commit using FZF
- `gg` in Flog UI: Grep and goto git files in current git commit using FZF and ripgrep
### Utility
- `vim-floaterm` key mappings
- ``: Toggle Floaterm terminal
- ``: Goto previous Floaterm terminal
- ``: Goto next Floaterm terminal
- ``: Open new Floaterm terminal
- `markview.nvim` key mappings
- `coh` in `markdown` buffer: Toggle `markview.nvim` preview
- Custom key mappings
- ``, ``, ``, ``: Move between windows, like `h`, `j`, `k`, and `l`
- ``, ``: Move between tabs, like `gT` and `gt`
- `q`: Close window, like `:q`
- `db`: Change current window working directory to folder containing current current buffer. Equivalent of `:lcd %:h`.
- ``: Switch to last tab
- `ts`: Open terminal in split
- `tt`: Open terminal in new tab
- Terminal key mappings
- ``: Escape terminal mode to normal mode
- ``: Paste from register
## TODO
- [ ] Add full plugin dependencies
- [ ] Add provider plugin for dependencies
- [x] Add [nvim-dap](https://github.com/mfussenegger/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](https://github.com/akinsho/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
- [rockerBOO/awesome-neovim Collections of awesome neovim plugins.](https://github.com/rockerBOO/awesome-neovim)
- [Dotfyle | Neovim Plugins & Neovim News](https://dotfyle.com/)
- [LazyVim/LazyVim Neovim config for the lazy](https://github.com/LazyVim/LazyVim)
- [AstroNvim/AstroNvim AstroNvim is an aesthetic and feature-rich neovim config that is extensible and easy to use with a great set of plugins](https://github.com/AstroNvim/AstroNvim)
- [NvChad/NvChad Blazing fast Neovim config providing solid defaults and a beautiful UI, enhancing your neovim experience.](https://github.com/NvChad/NvChad)