My nvim config, from Uruguay to the world xD
I wanted to keep it as minimal as possible. The goal is to work with react+node while being able to find my files using fzf, finding text within them using Ag
and having keybindings be as similar to vscode
's as possible.
You may love vscode's way of solving conflicts, I know I do. If that's the case, the tool I chose to deal with git conflicts which I found to be the simplest and closest to vscode's offering is conflict-marker.vim, it's just so simple.
- Install nvim
brew install nvim
-
Clone this repo to
~/.config/nvim
-
Install vim-plug if it's not already installed on your system
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'
- Install Ag if you don't have it already.
brew install the_silver_searcher
- Open nvim and run
:PlugInstall
- Press
/
. - Type the search pattern.
- Press
Enter
to perform the search. - Press
n
to find the next occurrence orN
to find the previous occurrence.
Tap Ctrl+B
and you'll toggle NERDTree like you toggle the file explorer in VSCode.
Tap Ctrl+F
to use Ag
to look for any given text in all your files known by git
Tap Ctrl+P
to bring up fzf
and start typing your filename
- Tap
Ctrl+W
and thenV
(for vertical split) orS
(for horizontal split). - Tap
Ctrl+W
and then eitherL
orH
to navigate between vertical splits ORJ
orK
to navigate between horizontal splits.
- Go into
VISUAL
mode. - Select all the text you want to copy.
- Use key combo
"+y
to copy to the OS clipboard OR justy
to copy within VIM.
:Gdiffsplit
does this for you.
:Gclog -10 %
will load the last ten commits that affected the currently open file into the quickfix list.- To navigate between revisions just use
[q
and]q
.
- Navigate between conflict markers using
[x
and]x
. - Use bindings to choose what version you want to keep:
ct
to keep incoming versionco
to keep current versioncb
to keep both versionscB
to keep both versions in reverse ordercn
to keep nothing
Press Ctrl+O
.
Press Shift+K
.
gd
=> go to definitiongi
=> go to implementationgr
=> find all references]c
=> go to next issue (error or warning)[c
=> go to previous issue (error or warning):CocDiagnostics
=> show a list of all errors || warnings and take me there when I choose one
gg
to go to the beginning of the current file.G
to go to the end of the current file.
- First remember to configure your project to use vimspector. For this create a
.vimspector.json
file and check out the reference docs to see how to write it. - Use the following hotkeys to debug
F5
to start debuggingF9
to toggle a breakpoint in the current lineF10
to step overF11
to step intoF12
to step out
- You may have
coc.nvim
throw some errors because python is not properly configured. If the language is already installed the error might be you don't have theneovim
package installed, which can easily be solved by runningpip install neovim
- Does the thing look ugly AF with tons of unsupported characters? You're just missing a font, a
Nerd Font
in particular! Install one (or all fonts using the script they provide) from their repo right here and set one to your terminal profile, the one I like isUbuntu Nerd Font Mono
.