Neo Vim is a new generation VIM editor. It has beautiful UI.
Installation
- Download NeoVim:
1
wget https://github.com/neovim/neovim/releases/download/v0.10.0/nvim.appimage
- Install:
1
2
chmod +x nvim.appimage
mv nvim.appimage /usr/local/bin/nvim
Preset Configuration setup
- Download
dotfilesfrom github and usestowcommand to link config:
1
2
3
git clone git@github.com:mrasif/dotfiles.git
cd dotfiles
stow nvim -t $HOME
- Remove pre installed config:
1
2
rm -rf ~/.config/nvim
rm -rf ~/.local/share/nvim
- Install downloaded config:
1
mv nvim ~/.config/
- Verify new directory location should be
~/.config/nvimwhereinit.luashould present. Here is referance tree-
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$ tree ~/.config/nvim
nvim
├── init.lua
├── lazy-lock.json
└── lua
├── plugins
│ ├── alpha.lua
│ ├── catppuccin.lua
│ ├── completions.lua
│ ├── debugging.lua
│ ├── git-stuff.lua
│ ├── gitsigns.lua
│ ├── lsp-config.lua
│ ├── neo-tree.lua
│ ├── none-ls.lua
│ ├── nvim-tmux-navigation.lua
│ ├── oil.lua
│ ├── swagger-preview.lua
│ ├── telescope.lua
│ ├── treesitter.lua
│ └── vim-test.lua
├── plugins.lua
└── vim-options.lua
- Install
language server
1
2
3
4
5
wget https://github.com/LuaLS/lua-language-server/releases/download/3.9.1/lua-language-server-3.9.1-linux-x64.tar.gz
mkdir /opt/lua-language-server
mv mv lua-language-server-3.9.1-linux-x64.tar.gz /opt/lua-language-server/
cd /opt/lua-language-server
tar -zxvf lua-language-server-3.9.1-linux-x64.tar.gz
- Setup environment, add this line to your
.bashrc/.zshrc
1
2
export PATH=$PATH:/opt/lua-language-server/bin
- Install
gopls
1
go install golang.org/x/tools/gopls@latest
- Open NVIM
1
nvim
- Add
.env.nvimfile to your project directory, which is environment variable files of your project, will be auto exported to your vim env. - Use nvim command
:Lazyto open lazy dashboard. - Press
Shift + Ito install dependency. - Install
dlvdebugger for golang development.
1
go install github.com/go-delve/delve/cmd/dlv@latest
- Install
ripgrepfor Telescope live grep.
1
sudo apt-get install ripgrep
Shortcut
Find shortcut:
Space + Spacewill open Old files finder.Ctrl + pwill open Find files finder.Space + fgwill open Live files finder.Ctrl + nwill open File Tree at LeftSpace + bfwill open floating buffered file tree.
Pane shortcut:
Ctrl + wwwill move focus to next pane.
Debugging shortcut:
gbto add breakpoint.gfto go next step.grto run debugger or continue.
coding shortcut:
Space + gdto go to description.Space + grto go to reference.Shift + Kto view quick code doc.Space + gfto format code.yto copy selected text to clipboard.cto cut selected text and copy to clipboard.pto paste from clipboard.