Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mars90226/dotvim

Vim config
https://github.com/mars90226/dotvim

defx fugitive fzf neovim nvim vim

Last synced: 3 months ago
JSON representation

Vim config

Awesome Lists containing this project

README

        

# Neovim config

Carefully crafted neovim config. Use
[lazy.nvim](https://github.com/folke/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
* [lualine.nvim](https://github.com/nvim-lualine/lualine.nvim) (fast custom status line)
* [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) (auto completion)
* [outline.nvim](https://github.com/hedyhli/outline.nvim) (Display symbols in sidebar using LSP)
* [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 is performant)
* [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim) (lua 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)
* [flash.nvim](https://github.com/folke/flash.nvim) (quickly move cursor to certain place on screen)
* [lightspeed.nvim](https://github.com/ggandor/lightspeed.nvim) (quickly move cursor by search)
* [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)
* [nvim-spectre](https://github.com/windwp/nvim-spectre) (find-and-replace globally)
* [lspsaga.nvim](https://github.com/glepnir/lspsaga.nvim) (lsp UI and lsp context for winbar)
* [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)
* [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)
* [vim-fugitive](https://github.com/tpope/vim-fugitive) (almost perfect git wrapper)
* [vim-flog](https://github.com/rbong/vim-flog) (git commit browser)
* [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)
* [statuscol.nvim](https://github.com/luukvbaal/statuscol.nvim) (customizable predefined 'statuscolumn')
* [diffview.nvim](https://github.com/sindrets/diffview.nvim) (git diff viewer & git history viewer)
* [dropbar.nvim](https://github.com/Bekaboo/dropbar.nvim#requirements) (vscode-like winbar)

## 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`)

## Recommands

* [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

### Neovim
`` key is `,`.

* 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 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
* outline.nvim key mappings
* ``: 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
* `lf`: Format selected code
* `lf` on visual selection: Range format selected code
* Defx key mappings
* `-`: Open current buffer folder in Defx
* `-`: Open current buffer folder in split in Defx
* ``: Toggle Defx as sidebar file explorer
* ``: Toggle Defx as sidebar file explorer and find current buffer
* Hop key mappings
* `w`: Goto word start
* `;`: Search and goto pattern
* `j`: Goto below lines
* `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
* ``: Backward search and goto 2 characters
* Trouble key mappings
* `xx`: Toggle Trouble UI
* `xd`: Show LSP document diagnostics in Trouble UI
* `xw`: Show LSP workspace diagnostics in Trouble UI
* nvim-lint key mappings
* `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
* ``: Toggle context
* ``: Select node
* `` in visual mode: scope incremental
* ``, ``, ``, `` in visual mode: navigate node
* ``, `` in visual mode: swap node
* 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
* 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
* Floaterm key mappings
* ``: Toggle Floaterm terminal
* ``: Goto previous Floaterm terminal
* ``: Goto next Floaterm terminal
* ``: Open new Floaterm terminal
* 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
* [ ] 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

## Screenshots

![normal](https://user-images.githubusercontent.com/1523214/141642117-9660db2d-b116-48af-83f1-af93184b2bd8.png)
![lsp](https://user-images.githubusercontent.com/1523214/141642118-fbf887c8-6939-4818-977a-132a41071e21.png)
![telescope](https://user-images.githubusercontent.com/1523214/141642124-4342b201-6589-40d9-9959-fd937fe3de49.png)

## Resources

* [rockerBOO/awesome-neovim Collections of awesome neovim plugins.](https://github.com/rockerBOO/awesome-neovim)
* [Dotfyle | Neovim Plugins & Neovim News](https://dotfyle.com/)