Rafael Bodill's Neo/vim Config
Lean mean Neo/vim machine, 30-45ms startup time.
Best with Neovim 0.5.x or Vim 8.x and python3
enabled.
I encourage you to fork this repo and create your own experience.
Learn how to tweak and change Neo/vim to the way YOU like it.
This is my cultivation of years of tweaking, use it as a git remote
and stay in-touch with upstream for reference or cherry-picking.
Table of Contents
(π Click to expand/collapse)
Features
Fast startup time
Robust, yet light-weight
Lazy-load 95% of plugins with Shougo/dein.vim
Custom side-menu (try it out! Space +l )
Custom context-menu (try it! ; +c )
Modular configuration (see structure )
Auto-complete prabirshrestha/asyncomplete.vim extensive setup
Shougo/denite.nvim centric work-flow (lists)
Structure view with liuchengxu/vista.vim
Open SCM detailed URL in OS browser
Light-weight but informative status/tabline
Easy customizable theme
Premium color-schemes
Central location for tags and sessions
Screenshot
Prerequisites
Python 3 (brew install python
)
Neovim or Vim (brew install neovim
and/or brew install vim
)
Install
1. Let's clone this repo! Clone to ~/.config/nvim
,
we'll also symlink it for regular Vim:
mkdir ~ /.config
git clone git://github.com/rafi/vim-config.git ~ /.config/nvim
cd ~ /.config/nvim
ln -s ~ /.config/nvim ~ /.vim # For "regular" Vim
Note : If you set a custom $XDG_CONFIG_HOME
,
use that instead of ~/.config
in the commands above.
Neovim follows the XDG base-directories convention, Vim doesn't.
2. Install the Python 3 pynvim
library. This is also needed for Vim 8
if you want to use Denite and Defx.
Neovim: ./venvs.sh
or pip3 install --user pynvim
Vim: pip3 install --user pynvim
3. Run make test
to test your nvim/vim version and capabilities.
4. Run make
to install all plugins.
5. If you are experiencing problems, run and read nvim -c checkhealth
Test Python 3 availability with :py3 print(sys.version_info)
Enjoy! π
Language-Server Protocol (LSP)
To leverage LSP auto-completions and other functionalities, once you open a
file in Neo/vim, run :LspInstallServer <name>
to use mattn/vim-lsp-settings
installation feature, use Tab to list available servers.
For example, open a .go
file, and run: :LspInstallServer gopls
Upgrade
cd ~ /.config/nvim
make update
This will run git pull --ff --ff-only
and update all plugins using
Shougo/dein.vim package-manager (:call dein#update()
).
Recommended Fonts
On macOS with Homebrew, choose one of the Nerd Fonts ,
for example, to install the Hack font:
brew tap homebrew/cask-fonts
brew search nerd-font
brew cask install font-hack-nerd-font
brew cask install font-iosevka-nerd-font-mono
brew cask install font-jetbrains-mono
brew cask install font-fira-code
Recommended Linters
brew install shellcheck jsonlint yamllint tflint ansible-lint
brew install tidy-html5 proselint write-good
yarn global add eslint jshint jsxhint stylelint sass-lint
yarn global add markdownlint-cli raml-cop
pip3 install --user vim-vint pycodestyle pyflakes flake8
Recommended Tools
ag ggreer/the_silver_searcher
(macOS: brew install the_silver_searcher
)
Jump around with z : rupa/z
(macOS: brew install z
)
Universal ctags for syntax tokenization
(macOS: brew install universal-ctags/universal-ctags/universal-ctags
)
Fuzzy file finders:
fzf ,
fzy , or
peco
(macOS: brew install fzf
)
User Custom Config
If you want to add your own configuration, create the config/local.vim
file
and add your personal vimscript there. If you'd like to install plugins by
yourself, create a config/local.plugins.yaml
file and manage your own plugin
collection.
If you want to disable some of the plugins I use, you can overwrite them, e.g.:
- { repo: prabirshrestha/asyncomplete.vim, if: 0 }
Structure
Plugin Highlights
Plugin management with cache and lazy loading for speed
Auto-completion with Language-Server Protocol (LSP)
Project-aware tabs and labels
Defx as file-manager + Git status icons
Extensive language extensions library
Note that 95% of the plugins are lazy-loaded .
Plugins Included
List (π Click to expand/collapse)
Non Lazy-Loaded Plugins
Lazy-Loaded Plugins
Language
Commands
Interface
Completion & Code-Analysis
Denite
Operators & Text Objects
Custom Key-mappings
Note that,
Leader key set as Space
Local-Leader key set as ; and used for navigation and search
(Denite and Defx)
Disable β β β β in normal mode by enabling g:elite_mode
in .vault.vim
Key-mappings
(π Click to expand/collapse)
Modes: π=normal π=visual π=select π=insert π=command
Navigation
Key
Mode
Action
Plugin or Mapping
j / k
π π
Cursor moves through display-lines
g
j/k
g +j / k
π π π
Jump to edge upward/downward
haya14busa/vim-edgemotion
gh / gl
π π
Easier line-wise movement
g
^/$
Space +Space
π π
Toggle visual-line mode
V
/ Escape
v / V
π
Expand/reduce selection
terryma/vim-expand-region
zl / zh
π
Scroll horizontally and vertically wider
z4
l/h
Ctrl +j
π
Move to split below
christoomey/tmux-navigator
Ctrl +k
π
Move to upper split
christoomey/tmux-navigator
Ctrl +h
π
Move to left split
christoomey/tmux-navigator
Ctrl +l
π
Move to right split
christoomey/tmux-navigator
Return
π
Toggle fold
za
Shift +Return
π
Focus the current fold by closing all others
zMzvzt
]q or ]q
π
Next/previous on quickfix list
:cnext
/ :cprev
]l or ]l
π
Next/previous on location-list
:lnext
/ :lprev
]w or ]w
π
Next/previous whitespace error
plugin/whitespace.vim
]g or ]g
π
Next/previous Git hunk
airblade/vim-gitgutter
]d or ]d
π
Next/previous LSP diagnostic
mattn/vim-lsp-settings
Ctrl +f
π
Move cursor forwards in command
Right
Ctrl +b
π
Move cursor backwards in command
Left
Ctrl +h
π
Move cursor to the beginning in command
Home
Ctrl +l
π
Move cursor to the end in command
End
File Operations
Key
Mode
Action
Plugin or Mapping
Space +cd
π
Switch to the directory of opened buffer
:lcd %:p:h
gf
π π
Open file under the cursor in a vsplit
:rightbelow wincmd f
Space +w
π π π
Write buffer to file
:write
Ctrl +s
π π π π
Write buffer to file
:write
Edit
Key
Mode
Action
Plugin or Mapping
Ctrl +Return
π
Expand emmet abbreviation
mattn/emmet-vim
Q
π
Start/stop macro recording
q
gQ
π
Play macro 'q'
@q
Shift +Return
π
Start new line from any cursor position
<C-o>o
<
π π
Indent to left and re-select
<gv
>
π π
Indent to right and re-select
`>gv
Tab
π π
Indent to right and re-select
`>gv
Shift +Tab
π π
Indent to left and re-select
<gv
gc
π π π
Caw (comments plugin) prefix
tyru/caw.vim
gcc
π π π
Toggle comments
tyru/caw.vim
Space +v
π π π
Toggle single-line comments
tyru/caw.vim
Space +V
π π π
Toggle comment block
tyru/caw.vim
Space +j or k
π π
Move lines down/up
:m
β¦
Space +d
π π
Duplicate line or selection
Space +cn / cN
π π
Change current word in a repeatable manner
Space +cp
π
Duplicate paragraph
yap<S-}>p
Space +cw
π
Remove all spaces at EOL
:%s/\s\+$//e
Ctrl +Tab
π
Jump outside of pair
Raimondi/delimitMate
sj / sk
π
Join/split arguments
AndrewRadev/splitjoin.vim
dsf / csf
π
Delete/change surrounding function call
AndrewRadev/dsf.vim
Search & Replace
Key
Mode
Action
Plugin or Mapping
Space +f
π
Filter lines in-place
lambdalisue/fin.vim
* / #
π π
Search selection forward/backward
haya14busa/vim-asterisk
g* / g#
π π
Search whole-word forward/backward
haya14busa/vim-asterisk
Backspace
π
Match bracket
%
gp
π
Select last paste
sg
π
Replace within selected area
:s/β΄/gc
Ctrl +r
π
Replace selection with step-by-step confirmation
:%s/\V/β΄/gc
Clipboard
Key
Mode
Action
Plugin or Mapping
p
π π
Paste without yank
kana/vim-operator-replace
Y
π
Yank to the end of line
y$
Space +y
π
Copy relative file-path to clipboard
Space +Y
π
Copy absolute file-path to clipboard
Command & History
Key
Mode
Action
Plugin or Mapping
!
π
Shortcut for shell command
:!
g!
π
Read vim command into buffer
:put=execute('β΄')
Ctrl +n / p
π
Switch history search pairs
β / β
β / β
π
Switch history search pairs
Ctrl
n
/p
Editor UI
Key
Mode
Action
Plugin or Mapping
Space +ts
π
Toggle spell-checker
:setlocal spell!
Space +tn
π
Toggle line numbers
:setlocal nonumber!
Space +tl
π
Toggle hidden characters
:setlocal nolist!
Space +th
π
Toggle highlighted search
:set hlsearch!
Space +tw
π
Toggle wrap
:setlocal wrap!
β¦
Space +ti
π
Toggle indentation lines
nathanaelkane/vim-indent-guides
g1
π
Go to first tab
:tabfirst
g9
π
Go to last tab
:tablast
g5
π
Go to previous tab
:tabprevious
Ctrl +Tab
π
Go to next tab
:tabnext
Ctrl +Shift Tab
π
Go to previous tab
:tabprevious
Alt +j
π
Go to next tab
:tabnext
Alt +k
π
Go to previous tab
:tabprevious
Alt +{
π
Move tab backward
:-tabmove
Alt +}
π
Move tab forward
:+tabmove
Space +h
π
Show highlight groups for word
Custom Tools & Plugins
Window Management
Key
Mode
Action
Plugin or Mapping
q
π
Quit window (and Vim, if last window)
:quit
Ctrl +q
π
Remap to C-w
Ctrl +w
Ctrl +x
π
Rotate window placement
C-w
x
sv
π
Horizontal split
:split
sg
π
Vertical split
:vsplit
st
π
Open new tab
:tabnew
so
π
Close other windows
:only
sb
π
Previous buffer
:b#
sc
π
Close current buffer
:close
sx
π
Delete buffer, leave blank window
:enew β bdelete
sz
π
Toggle window zoom
:vertical resize β resize
ssv
π
Split with previous buffer
:split β wincmd p β e#
ssg
π
Vertical split with previous buffer
:vsplit β wincmd p β e#
sh
π
Toggle colorscheme background=dark/light
:set background
β¦
s-
π
Lower solarized8 colorscheme contrast
:colorscheme
β¦
s=
π
Raise solarized8 colorscheme contrast
:colorscheme
β¦
Git Version Control
Plugin: Denite
Key
Mode
Action
;r
π
Resumes last Denite window
;f
π
File search
;g
π
Grep search
;b
π
Buffers
;i
π
Old files and MRU
;d
π
Directories and MRU
;v
π π
Yank history
;l
π
Location list
;q
π
Quick fix
;m
π
Marks
;n
π
Dein plugin list
;j
π
Jump points and change stack
;u
π
Junk files
;o
π
Outline tags
;s
π
Sessions
;t
π
Tag list
;p
π
Jumps
;h
π
Help
;w
π
Memo list
;z
π
Z (jump around)
;;
π
Command history
;/
π
Buffer lines
;*
π
Search word under cursor with lines
Space +gt
π
Find tags matching word under cursor
Space +gf
π
Find files matching word under cursor
Space +gg
π π
Grep word under cursor
Within Denite window
jj or Escape
π
Leave Insert mode
i or /
π
Enter Insert mode (filter input)
q or Escape
π
Exit denite window
Tab or Shift +Tab
π
Next/previous candidate
Space
π
Select candidate entry
dd
π
Delete entry
p
π
Preview entry
st
π
Open in a new tab
sg
π
Open in a vertical split
sv
π
Open in a split
'
π
Quick-move
r
π
Redraw
yy
π
Yank
Tab
π
List and choose action
Plugin: Defx
Key
Mode
Action
;e
π
Open file-explorer (toggle)
;a
π
Focus current file in file-explorer
Within Defx window
j or k
π
Move up and down the tree
l or Return
π
Toggle collapse/expand directory or open file
h
π
Collapse directory tree
t
π
Expand directory tree recursively
.
π
Toggle hidden files
Space
π
Select entry
*
π
Invert selection (select all)
& or </kbd>
π
Change into current working directory
~
π
Change to user home directory
u or Backspace
π
Change into parent directory
u 2 /3 /4
π
Change into parent directory count
st
π
Open file in new tab
sv
π
Open file in a horizontal split
sg
π
Open file in a vertical split
N
π
Create new directories and/or files
K
π
Create new directory
c / m / p
π
Copy, move, and paste
r
π
Rename file or directory
dd
π
Trash selected files and directories
y
π
Yank path to clipboard
w
π
Toggle window size
]g
π
Next dirty git item
[g
π
Previous dirty git item
x or gx
π
Execute associated system application
gd
π
Open git diff on selected file
gl
π
Open terminal file explorer with tmux
gr
π
Grep in current position
gf
π
Find files in current position
Plugin: Asyncomplete and Emmet
Key
Mode
Action
Tab / Shift-Tab
π
Navigate completion-menu
Enter
π
Select completion or expand snippet
Ctrl +j /k /d /u
π
Movement in completion pop-up
Ctrl +Return
π
Expand Emmet sequence
Ctrl +Space
π
Refresh and show candidates
Ctrl +y
π
Close pop-up
Ctrl +e
π
Cancel selection and close pop-up
Ctrl +l
π
Expand snippet at cursor
Tab / Shift-Tab
π π
Navigate snippet placeholders
Plugin: Any-Jump
Key
Mode
Action
Space +ii
π
Jump to definition under cursor
Space +ii
π
Jump to selected text in visual mode
Space +ib
π
Open previous opened file (after jump)
Space +il
π
Open last closed search window again
Plugin: Signature
Key
Mode
Action
m/ or m?
π
Show list of buffer marks/markers
mm
π
Toggle mark on current line
m,
π
Place next mark
m a-z
π
Place specific mark (Won't work for: mm , mn , mp )
dm a-z
π
Remove specific mark (Won't work for: mm , mn , mp )
mn
π
Jump to next mark
mp
π
Jump to previous mark
]=
π
Jump to next marker
[=
π
Jump to previous marker
m-
π
Purge all on current line
m Space
π
Purge marks
m Backspace
π
Purge markers
Credits & Contribution
Big thanks to the dark knight Shougo .