Dotvim
My dotvim - work in progress - Beta stages
Install / Use
/learn @ik5/DotvimREADME
dotvim
The following (Neo)Vim configuration is to help me work with programming.
The reason for it, is that I work with many of technologies, some even on the same project.
The main technologies that I'm placing emphases on are:
- Ruby
- Go
- HTML
- CSS
- Javascript (React/JSX, Vue, es6, es7, babel)
- Elm
- XML
- Rust
- C
- Python
There is also support for spelling, thesaurus, language server protocol, better highlighting of actions and a lot more.
Table Of Content
Features
vimrchandling- Incremental and smart case search
- Information on trailing whitespace, including cleaning shortcuts
- Logical and Visual layout (for Right-To-Left languages) editing
- Tabs expanded to 2 spaces by default, except for Python
- Keeping the
<Leader>key as Backslash - Adding
XXin edit mode to become alias to the<ESC>key - Highlight current row and color column 80
- Syntax checking
- Snippets
- Completion Quotes, parenthesis pairs, etc
- Extended pair matching with %
- ASCII and table drawing
- Fuzzy file, buffer, MRU, tag, etc finder
- Task list
- VCS support
- Tab Completion
- Commenting
- History management, including persistent undo
- Support documentation for programming languages, based on the original (neo)vim documentation engine
- In-line documentation
- Support for external documentation using Zeal
- Reload file when changed from outside
- Working with error window (a.k.a. quickfix and selection list)
- Thesaurus, grammer and dictionary spelling
- Language Server support
- NeoVim Support
Installation
The following commands will clone the repo, symlink ~/.vimrc and update the bundles:
git clone https://github.com/ik5/dotvim.git ~/.vim
ln -s ~/.vim/vimrc ~/.vimrc
cd ~/.vim
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
Install plugins from the command line:
vim +PlugUpdate +qa
For Neovim, under ~/.config/nvim:
curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
Install plugins from the command line:
nvim +PlugUpdate +qa
To add or override settings, place them in ~/.vim/vimrc.local or ~/.config/nvim/vimrc.local.
To update submodules in the future, when you have vim running, source vimrc to make sure plugins list are updated (or restart vim):
:PlugUpdate
Upgrading
In case you're updating from previous Vundle based to vim-plug, remove the bundle directory as it's not needed anymore, get vim-plug and install the plugins:
cd ~/.vim
rm -rf bundle
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
vim +PlugUpdate +qa
Commands
General
| Command | Description |
| ----------------- | ------------------------------------------------------ |
| Wr | Save current buffer using sudo |
| HTem | Open Horizontal terminal in NeoVim |
| VTerm | Open Vertical terminal in NeoVim |
| FormatJSON | Format a given JSON buffer |
| GenerateUUID | Generate UUID and insert it to current cursor position |
| RebaseSquash | Perform a pick strategy for squash on rebase in GIT |
| CloseOthers | Close all windows and tabs but the current active one |
| FixDoubleQuotes | Replace unicode double quotes to ascii's version |
| ToUnixFF | Set current file ending to Unix |
| Base64Encode | Encode a (range of) string/bytes to base 64 |
| Base64Decode | Decode a (range of) base64 to string/bytes |
Shortcuts
General
| Key | Description |
| --------------------------- | --------------------------------------------------------------------------------------------------- |
| \\ | <Leader> (as a default) |
| jj | <ESC> on insert mode |
| <leader>+r | Load .vimrc |
| <leader>+R | Reload vim |
| K | Show documentation under the cursor |
| <leader>w | Fast save current file (will not work on a buffer without file name) |
| <c-J> / <c-Down> | Navigate window / terminal - go down |
| <c-K> / <c-Up> | Navigate window / terminal- go up |
| <c-H> / <c-Left> | Navigate window / terminal- go left |
| <c-L> / <c-Right> | Navigate window / terminal- go right |
| <c-W> | Window functions on insert mode as well |
| - / + | Resize horizontal splits |
| <alt-,> / <alt-.> | Resize vertical splits |
| <F2> | Close (but not delete) current buffer |
| <leader>d | Delete current buffer |
| <leader>D | Delete current buffer, but keep the split (switch to prev buffer) |
| <leader>S | Delete trailing whitespace |
| <F5> | Toggle hlsearch |
| <leader>srln | Clear the search register, so the last search is gone |
| <c-d> / <c-u> | Center line when moving up and down half a screen |
| <Alt-j> | Move current line down |
| <Alt-k> | Move current line up |
| gc | swap current char with the next char |
| gC | swap current char with the prev char |
| gl | swap current word with the prev word, stay on the same position |
| gr | swap current word with the next word, stay on the same position |
| g{ | swap current paragraph with the next |
| g} | swap current paragraph with the prev |
| SPT | Toggle spelling mode |
| <leader>sn | Move to the next misspelled word |
| <leader>sp | Move to the previous misspelled word |
| <leader>sa | Add misspelled word under the cursor |
| <leader>s? | Open suggestion window |
| <leader>f1 - <leader>f9 | Set fold level between 1 and 9 |
| <leader>m | Remove ^M when encoding is messed up (windows) |
| <c-b>b | Toggle between last two files |
| <c-b>p | Previous buffer |
| <c-b>n | Next buffer |
| <leader>y | Copy the current visual selection or current line to ~/tmp/.vbuf file |
| <leader>p | Paste the content of the buffer to ~/tmp/.vbuf file
