- NeoVim with version 0.8.0 or higher
- Ripgrep installed (required by Telescope)
We use packer.nvim to manage various plugins, you can refer to this for installing.
git clone https://github.com/PeiweiHu/Peiwei_NeoVimConfig.git ~/.config/nvim
Type :PackerSync
to install required plugins after entering nvim.
Type :Mason
and choose 2 to install desired lsp such as pyright.
Until now, your editor should start working with rich convenient features. Note that there are language-specific features, such as syntax highlighting, that you may need to further set up depending on your desired language, see the section below (Setup for New language).
├── README.md # the file you are reading
├── init.lua # initialization file of nvim, reference all other config files
├── lua
│ ├── keybindings.lua # setup keybindings
│ ├── options.lua # tweak the default settings of nvim
│ ├── plugin-config # contain the config files of plugins
│ │ ├── bookmarks.lua # bookmarks plugin
│ │ ├── bufferline.lua # make the buffer act like a label page
│ │ ├── gitsigns.lua # git-realted support
│ │ ├── lspsaga.lua # enhance lsp experience, scan this file for lsp-related shortcuts
│ │ ├── lualine.lua # the status line
│ │ ├── mason-lspconfig.lua # lsp support
│ │ ├── mason.lua # lsp support
│ │ ├── nvim-cmp.lua # autocomplete support
│ │ ├── nvim-lspconfig.lua # lsp support
│ │ ├── nvim-tree.lua # file tree
│ │ ├── nvim-treesitter.lua # highlight support
│ │ ├── startup.lua # the banner of nvim
│ │ ├── tidy.lua # remove trailing whitespace and empty line
│ │ └── ufo.lua # code fold
│ ├── plugins.lua # the config file of Packer, deciding the used plugins
│ └── theme.lua # setup themes
The keymap of various functions is defined in two places including keybindings.lua and the config files of the plugin (e.g., lspsaga.lua). You can use grep -rn 'keymap' ./
under the root of the project to find the settings.
This project support the languages such as C, C++, python as default. There are some stuffs required to do after introducing new languages. Suppose I wanna make this project support html language in the following steps.
Type :Mason
in nvim and download the lsp server of newly introduced language. For example, if I wanna make this projec support html language, I will choose html-lsp html
and press i
for installation.
Append require('lspconfig').html.setup {}
to lua/plugin-config/nvim-lspconfig.lua
.
Append require('lspconfig')['html'].setup { capabilities = capabilities }
to lua/plugin-config/nvim-lspconfig.lua
.
Type :TSInstall html
in nvim.