With vim installed (sudo apt-get install vim python3-pip):
-
Install nvim
sudo apt-get install neovimorsudo apt install neovim -
Install nvim plugin manager
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -
In the nvim folder
cd ~/.config/nvimadd the currentinit.vimfile or:curl https://raw.githubusercontent.com/camilo-cf/nvim/main/init.vim> ~/.config/nvim/init.vim -
Install the python3 support for nvim
pip3 install pynvim neovim jediIf you want the debugger addpip3 install debugpy -
Add the backgound
mkdir ~/.config/nvim/colors curl https://raw.githubusercontent.com/freeo/vim-kalisi/master/colors/kalisi.vim> ~/.config/nvim/colors/kalisi.vim -
Open
nvimand inside:
- Check the health of nvim
:checkhealth - Install the plugins
:PlugInstall - Update the plugins
:UpdateRemotePlugins - Install the debugger
debugpy::VimspectorInstall debugpy
- Use
nvimto open any file
wget https://raw.githubusercontent.com/camilo-cf/nvim/main/install.sh
bash install.sh
Then continue on step 6
In the nvim window:
:e <file_name>: Open the <file_name> file in the current window/tab:b <file_name>: Move tho the <file_name> file if is open in the bufferTAB: For autocomplete! <command>: For use any linux command in the current window:ter: Open a terminal in the current windowF11: Full screen (if GUI):set mouse=r: Mouse with ability to copy paste from console:set mouse=a: Mouse interactive mode
Spliting
:sv: Split horizontally:vs: Split verticallyCtrl+w+w: Change of window:resize [+-]N: Resize split + or - by N horizontally:vertical resize [+-]N: Resize split + or - by N vertically
Tabs
:tabedit <file_name>: Create a new tab opening the <file_name> filegt: Change the tab to the rightgT: Change the tab to the left:tabclose: Close the current tab:tabnew: Open a new tab
Directory & Files
F2: Open the directory window?: After F2 check the options
Debug
F5: start debugging or continueF3: stop debuggingF4: restart with same configurationF6: pause debuggingF9: Toggle a breakpoint on the current lineF10: step overF11: step intoF12: step out
Default .vimspector.json
{
"configurations": {
"run": {
"adapter": "debugpy",
"default": true,
"configuration": {
"request": "launch",
"type": "python",
"cwd": "${workspaceRoot}",
"stopOnEntry": true,
"program": "${file}"
},
"breakpoints": {
"exception": {
"raised": "N",
"uncaught": "",
"userUnhandled": ""
}
}
}
}
}
Custom
F7: Open the terminal in the current window
Useful Commands
:mouse
https://www.linode.com/docs/guides/how-to-install-neovim-and-plugins-with-vim-plug/ https://stsewd.dev/es/posts/neovim-plugins/ https://github.com/puremourning/vimspector#python https://nielscautaerts.xyz/debugging-python-in-neovim.html