Actively updated neovim configuration that is being used by myself
- Find the nvim config locaton on your computer by running
:echo stdpath('config')
in neovim - Clone this project to your nvim config folder
- Install vim-plug then run
:PlugInstall
- Follow nvim-treesitter quickstart to get treesitter installed, NOTE: this step requires a C compiler on your computer
- Install ripgrep and ack for searching
- Install pyright by
npm i -g pyright
to get python lsp working - Create virtualenv with
virtualenv -v venv
- Activate virtualenv and install debugpy for debugging
- Create
pyrightconfig.json
file in your project and configure pyright as following, refer to pyrightconfig for details
{
"venvPath": ".",
"venv": "venv"
}
- Install clangd to get clangd lsp working, as clangd requires compile_commands.json file which is generated by build system to parse the source code, if your build system doesn't support that, please try to use this small script clangdgen
- Install
lldb-vscode
and depends-onllvm-symbolizer
for debugging - Compile C/C++ code with
-g
flag for debugging
- JSON: Install vscode-json-language-server by
npm i -g vscode-langservers-extracted
to get JSON lsp working
Plugins are managed with vim-plug
- akinsho/toggleterm.nvim
- danymat/neogen
- dwrdx/mywords.nvim
- hrsh7th/cmp-buffer
- hrsh7th/cmp-cmdline
- hrsh7th/cmp-nvim-lsp
- hrsh7th/cmp-path
- hrsh7th/cmp-vsnip
- hrsh7th/nvim-cmp
- hrsh7th/vim-vsnip
- iamcco/markdown-preview.nvim
- joshdick/onedark.vim
- junegunn/fzf
- junegunn/fzf.vim
- junegunn/vim-easy-align
- kyazdani42/nvim-tree.lua
- kyazdani42/nvim-web-devicons
- mhinz/vim-grepper
- mhinz/vim-startify
- neovim/nvim-lspconfig
- nsf/gocode
- nvim-treesitter/nvim-treesitter
- rmagatti/auto-session
- romgrk/barbar.nvim
- sbdchd/neoformat
- scrooloose/nerdtree
- sheerun/vim-polyglot
- simrat39/symbols-outline.nvim
- tpope/vim-commentary
- tpope/vim-fugitive
- tpope/vim-surround
- vim-airline/vim-airline
- vim-scripts/a.vim
- folke/tokyonight.nvim
- mfussenegger/nvim-dap
- rcarriga/nvim-dap-ui
- LunarWatcher/auto-pairs
This config is using BitstreamVeraSansMono Nerd Font
Install nerdfonts
- c/c++
- golang
- javascript
- markdown
- python from NexSabre/vscode-python-snippets
- rust from friendly-snippets
Here are the most frequent used key mappings, for the full list please check the source code
Key Mapping | Function |
---|---|
<leader>tm | Toggle terminal |
<leader>qo | Open quickfix |
<leader>qc | Close quickfix |
Alt-o | Toggle symbols outline |
Alt-m | Toggle NERDTree |
Alt-, | Previous buffer |
Alt-. | Next buffer |
<leader>ff | Use fzf to find files |
<leader>b | Use fzf to find buffers |
<leader>b | Use fzf to find buffers |
<leader>s* | Search words in all files with rg |
<leader>sc | Search words in clang files with rg |
<leader>sp | Search words in python files with rg |
<leader>sg | Search words in golang files with rg |
<leader>sa* | Search words in all files with ack |
gd | Goto definition |
gD | Goto declaration |