- todo 2024-07-22 23:37: enhance documentation in this README
neovim installation (build)
sudo apt-get install ninja-build gettext cmake unzip curl build-essential
$ git clone https://github.com/neovim/neovim
$ cd neovim
$ git checkout stable
$ sudo make CMAKE_BUILD_TYPE=RelWithDebInfo
$ cd build
$ sudo cpack -G DEB && sudo dpkg -i nvim-linux64.deb
$ $(which nvim) --version
neovim configuration
neovim configuration file: ~/.config/nvim/init.vim
neovim dir setup: mkdir -vp lua pack plugged
lua code in vimscript: lua-guide
installation:
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
:PlugInstall
, install plugin (reload configuration file before).
:PlugUpdate
, update plugins.
- After the update is finished, review the changes by pressing
D
in the window. Or, you can do it later by running:PlugDiff
.
:PlugClean
, delete dangling plugins.
installation:
install language server:
$ npm -i -g pyright
$ require'lspconfig'.pyright.setup{}
:LspInfo
, display status or to troubleshoot.
<leader>ff
, find files
<leader>fg
, live grep
<leader>fb
, buffers
<leader>fh
, help tags
:TSInstall <language_to_install>
, install (already supported) lanuage parser.
plugged/nvim-treesitter/parser/{language}.so
, parser installation path.
:TSUpdate <language_to_update>
, update parser.
installation:
mkdir -p ~/.config/nvim/pack/airblade/start
cd ~/.config/nvim/pack/airblade/start
git clone https://github.com/airblade/vim-gitgutter.git
nvim -u NONE -c "helptags vim-gitgutter/doc" -c q
]c
, jump to next hunk. (default)
- remap:
nmap ]h <plug>(GitGutterNextHunk)
[c
, jump to previous hunk.
- remap:
nmap [h <plug>(GitGutterPrevHunk)
<leader>hp
, preview the hunk.
<leader>hs
, visually select then stage hunk.
:43,50GitGutterStageHunk
, using range stage hunk.
<leader>hu
, undo hunk.
installation:
Plug 'epwalsh/obsidian.nvim'
additionally,
" obsidian.nvim https://github.com/epwalsh/obsidian.nvim/issues/286
set conceallevel=1
mkdir -p ~/.config/nvim/pack/tpope/start
cd ~/.config/nvim/pack/tpope/start
git clone https://tpope.io/vim/surround.git
nvim -u NONE -c "helptags surround/doc" -c q
mkdir -p ~/.config/nvim/pack/tpope/start
cd ~/.config/nvim/pack/tpope/start
git clone https://tpope.io/vim/fugitive.git
vim -u NONE -c "helptags fugitive/doc" -c q