My very personal Vim configuration. Visually unattractive (no fancy status or tab line with fancy Powerline symbols (actually no status line at all :)) but functionally cool stuff. I do Python development at work on a daily basis. Also I need to read (more than writing) Javascript code (mostly ReactJS). My personal interests at the moment includes Clojure, Haskell, Rust and Go programming languages to play on my free time. So this configuration supports these 6 languages. Except Go and Clojure, all other language supports comes from corresponding Language Server. Some more details below.
- Compatible with both Vim >=8 and Neovim.
- Some plugins might not support vanilla Vim without compiled python3.
- Recommended environment includes iTerm nightly and tmux.
- Plugins managed by vim-plug.
- Primary programming languages supported:
Python
,Clojure
,Haskell
,Rust
,Go
, andJavascript (React)
. - Language support is available via corresponding Language
Servers
except for
Go
andClojure
. - Mnemonic keyboard shortcuts. E.g. file based actions under
<Leader>f
and buffer based shortcuts are under<Leader>b
. - Leader key is
space
. - Local leader is
\
. - I am using deoplete as autocompletion engine. It uses language client sources by default except vimscript and Go. Those have their own sources implemented.
- For a while I am going for simplicity so I removed statusline completely.
Notable custom key bindings;
- File based operations (starts with
<leader>f
)<leader>ff
Find files. Fuzzy search UI populated with ripgrep. It simulteanously shows files, open buffers and junk files. You can switch between these withC-n
andC-p
.<leader>ft
Toggle tagbar.<leader>fs
Write buffer to disk. Equivalent to:w<cr>
.<leader>fW
Remove trailing whitespace from whole buffer.
- Buffer based operations (starts with
<leader>b
)<leader>bd
Delete current buffer. Equivalent to:bd<cr>
.<leader><tab>
Switch to previous buffer. Equivalent to:b#<cr>
.
- Search based operations
n
mapped tonzzzv
to keep matching line in the middle of the screen.<leader>/
greps recursively in the directory and loads results into fuzzy search UI including preview for each row.<leader>*
same as previous one except this does not wait for input. Instead uses the word under cursor as input.<leader>sp
uses grepper plugin to grep in project root. Results loaded into quickfix window.<BS>
executes:nohlsearch<cr>
.<leader>ss
Populates (on the fly) all tags (outline) in the file. Plus all lines in the buffer will be in the list to narrow with fuzzy search. (ctags) into fuzzy search UI.
- Other
<leader>V
selects just pasted text.<leader>vv
vertical split.- Arrow keys to resize active window.
- Programming support bindings. I like Tim Pope
style shortcuts (ones derived from default vim bindings);
[C-d
jump to definition of the symbol under cursor using language server or specific plugin.K
shows hover information using language server or specific plugin.[d
shows detailed hover information using language server or specific plugin.[C-n
rename the symbol under cursor using language server or specific plugin.[C-r
shows usages of the symbol under cursor using language server or specific plugin.
Check
keybindings.vim
for all custom keybindings. Filetype based keybindings (for haskell, python
etc.) and configurations can be found in corresponding files under
nvim/after/ftplugin
directory.
Check plugins.vim for all plugins.
-
Install
Neovim
(I prefer HEAD).brew install neovim --HEAD
-
For Neovim it is recommended to use separated virtual python environments for editor's own needs (I use Fish shell and virtualfish). For any shell, these virtual environments must be located under
~/.virtualenvs/
.vf new neovim2 vf new --python=python3 neovim3
-
Clone repository to any place you prefer.
git clone https://github.com/zekzekus/dotfiles.git
-
Create symbolic links.
cd $HOME cd .config ln -s /path/to/dotfiles/nvim .
-
Create necessary directories.
cd $HOME mkdir .nvimtmp
-
First run will give errors. Ignore them.
$ nvim
-
For each editor execute
:PlugInstall
command. -
Install necessary OS packages.
$ brew install ctags ripgrep the_silver_searcher
-
Install Language Servers for the languages you want work on.
-
First install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-
Next, install the
tmux
andreattach-to-user-namespace
packages using Homebrewbrew install tmux brew install reattach-to-user-namespace
-
Create a symbolic link to
dotfiles/tmux/tmux.conf
ln -s /path/to/repo/dotfiles/tmux/tmux.conf ~/.tmux.conf
-
-
Open
~/.tmux.conf
in your favorite editor and edit theMYSHELL
andMYSHELL_PATH
variables in the file which defaults tofish
... 3 # SHELL choice (zsh | fish) 4 MYSHELL=zsh 5 MYSHELL_PATH=/usr/local/bin/zsh ...
-
-
Run tmux
~$ tmux
-
Install the
xsel
andtmux
packagessudo apt-get install xsel tmux
-
Create a symbolic link to
dotfiles/tmux/tmux.ubuntu.conf
ln -s /path/to/repo/dotfiles/tmux/tmux.ubuntu.conf ~/.tmux.conf
-
-
Open
~/.tmux.conf
in your favorite editor and edit theMYSHELL
andMYSHELL_PATH
variables in the file which defaults tofish
... 3 # SHELL choice (zsh | fish) 4 MYSHELL=zsh 5 MYSHELL_PATH=/usr/bin/zsh ...
-
-
Run tmux
~$ tmux
-
-
If you get an error regarding
ambiguous option: mouse
edit your~/.tmux.conf
and change theset -g mouse on
to this# set -g mouse on
-