git clone this project, then mv nvim.lua ~/.config/nvim
.
- Download Nerd Font https://www.nerdfonts.com/font-downloads
- Unzip and copy to
~/.fonts
- Run the command
fc-cache -fv
to manually rebuild the font cache - Run
fc-list
to see all fonts installed
or there will be some text garbled in neovim.
lua/settings.lua
has basic setting for neovim.
lua/keymap
is for keymap, include basic, plugin and lsp.
lua/lsp
is for language server protocal, which provides code complete, goto definition, code diagnositic...
lua/plugins
include many useful plugin, like telescope.nvim.
Language server protocal can give you the power of go to definition, auto-completion, lints...
- open
lua/lsp/servers.lua
, add server with optional config inM.servers
. - execute
:LspInstallInfo
in neovim, find servername, pressi
to install. (or you can install language server by yourself, just need to ensure it is executable inPATH
) - execute
:LspInfo
in neovim, to check server has attahed to buffer(with correct file type).
- preconfigured servers
Here are preconfigured servers, which means you only need to install language server and no need any
configuration.
- clangd for c/c++
- pylsp for python, support auto detect venv
- gopls for golang
- html for html
- sumneko_lua for lua
once language server is attahed to your buffer(use :LspInfo
to check), you will get those keymaps.
gd
go to symbol definitiongr
go to referencesgi
go to definition<leader>ff
format file<leader>rn
rename symbol in project<leader>ca
code action<leader>e
open diagnositic floating window]d
next diagnositic[d
previous diagnositic
a highly extendable fuzzy finder.
CTRL-p
to find files.CTRL-n
to find buffers.<leader>fo
to find recently opened files.<leader>fg
to live grep in project.<leader>fs
to list symbols in current file(need lsp support).<leader>fa
to list symbols in project(need lsp support).F3
to find projects you opened.
file explor for neovim. In nvimtree, you may check your project structure, add/delete/remove files.
F1
toggle nvimtree.g?
in nvimtree, and you will see help.
smart commenting plugin.
CRTL-/
to toggle comment, support multiple lines selection.
move to anywhere with 2 characters.
- press
f
, and there will be characters in your screen, press characters on some position and you will jump to it.
easily edit surrond character
- press
ds"
inside some sentence"asfasfasadf"
,""
will be delete. - press
cs"'
inside some sentence"asfasfasadf"
,""
will be replaced with'asfasfasadf'
. - press
ysiw"
inside some wordasfasfasadf
,""
will be added around.
edit lua/keymap/common.lua
for common(no plugin, no lsp) keybindings.
edit lua/keymap/plugin.lua
for plugin keybindings.
edit lua/keymap/lsp.lua
for lsp keybindings.
- open
lua/plugins/plugins.lua
, find plugin you want to remove. - delete
use xxx
, save file, execute:source%
, execute:PackerSync
, pressy
to confirm delete.