vim-config

My VIM configuration

View project on GitHub

Installation

To install just run in terminal:

curl https://raw.githubusercontent.com/akolosov/vim-config/master/scripts/bootstrap.sh -L -o - | sh

... and wait until successfully installed and have fun with VIM!

Requirements

- vim, macvim, neovim with +ruby, +python, +lua supports
- installed curl, git

Screenshots

1 2 3

Variables

All variables set in ~/.vimrc.before.local file.

g:hardcore_mode - allow to use VIM Hardcore mode (unset g:use_arrow_keys, g:use_copy_cut_paste_keys and many keymaps)

g:hardcore_mode_with_arrow_keys - the same as g:hardcore_mode, but arrow keys for navigation is enabled

g:use_powerline_fonts - allow to use PowerLine fonts (Link)

g:color_scheme - Your favorite color scheme name (default: hybrid)

g:airline_theme - Your favorite AirLine theme (default: bubblegum)

g:lightline_theme - Your favorite LightLine theme (default: hybrid)

g:dont_show_nerd_tree - do not show NERDTree on startup (if plugin is enabled)

g:use_arrow_keys - allow to use arrow keys. Only hjkl! Only hardcore!

g:use_copy_cut_paste_keys - allow to use Ctrl-C/V/X keys for Copy/Paste/Cut

g:use_autosave - allow to autosave all changes, like Textmate

Shortcuts

Shortcut Description Modes
CTRL-P Open CtrlP menu [n i v]
CTRL-T Create new tab (if not set g:hardcore_mode) [n i v]
CTRL-Z Show/Hide UndoTree (if not set g:hardcore_mode) [n i v]
CTRL-G Show/Hide TagBar (if not set g:hardcore_mode) [n i v]
CTRL-Y Delete line (if not set g:hardcore_mode) [n i v]
CTRL-L Delete to EOL (if not set g:hardcore_mode) [n i v]
CTRL-H Delete to BOL (if not set g:hardcore_mode) [n i v]
CTRL-X or SHIFT-Del Cut (if set g:use_copy_cut_paste_keys and not set g:hardcore_mode) [n i v]
CTRL-C or CTRL-Ins Copy (if set g:use_copy_cut_paste_keys and not set g:hardcore_mode) [n i v]
CTRL-V or SHIFT-Ins Paste (if set g:use_copy_cut_paste_keys and not set g:hardcore_mode) [n i v]
CTRL-/ or CTRL-7 Comment/Uncomment block (if not set g:hardcore_mode) [n i v]
F2 Save file (if not set g:hardcore_mode) [n i v]
CTRL-F2 Save all files (if not set g:hardcore_mode) [n i v]
SHIFT-F2 Save file as... (if not set g:hardcore_mode) [n i v]
F3 Toggle paste mode (if not set g:hardcore_mode) [n i v]
F4 Toggle readonly mode (if not set g:hardcore_mode) [n v]
F5 Open the selected region in a new narrowed window (if not set g:hardcore_mode) [n i v]
F10 Quit without saving (if not set g:hardcore_mode) [n i v]
SHIFT-F10 Quit with saving all files (if not set g:hardcore_mode) [n i v]
ESC-ESC Quit and ask for save files or close current window/buffer (if not set g:hardcore_mode) [n i v]
CTRL-] Switch next tab (if not set g:hardcore_mode) [n v]
CTRL-[ Switch prev tab (if not set g:hardcore_mode) [n v]
] Switch next buffer (if not set g:hardcore_mode) [n v]
[ Switch prev buffer (if not set g:hardcore_mode) [n v]
ALT-Up Upcase word under cursor (if not set g:hardcore_mode) [n v]
ALT-Down Downcase word under cursor (if not set g:hardcore_mode) [n v]
<tilde><tilde> Run VimShell (if plugin loaded and not set g:hardcore_mode) [n v]
' Toggle single quotes to double quotes and backwards [n]
,? Show most plugin keybindings [n]
// No highlights search [n v]
\\ Comment/Uncomment current line or selection [n v]
,gf Open file with filename under cursor, create new if not exists [n]
,gfw Open file in windows with filename under cursor, create new if not exists [n]
,gft Open file in tab with filename under cursor, create new if not exists [n]
,, or ,o Open CtrlP (if plugin loaded) [n]
.. or ,b Open CtrlP buffers (if plugin loaded) [n]
'' or CTRL-6 " Switch between the last two files [n]
;; Append semicolon at EOL [n]
;;<CR> Append semicolon at EOL and add new line below [n]
,hh Split window horizontaly [n]
,vv Split window verticaly [n]
,a Select all text in current buffer [n]
,<Down> Insert new line after current line [n]
,<Up> Insert new line before current line [n]
,<CR> Toggle show Space/Tab/EOL [n]
,= Insert new line with '=' after current line with the same length [n]
,- Insert new line with '-' after current line with the same length [n]
,w Save current file [n]
,wa Save all files [n]
,w? Save file as... [n]
,wq Save current file and close it [n]
,x Save current file and close it [n]
,X Close current file and without saving [n]
,x! Save all files and close VIM [n]
,X! Close VIM without saving files [n]
,tb Switch all buffers to tabs [n]
,sb Switch all buffers to windows [n v]
,nd Show/Hide NERDTree (if plugin loaded) [n i v]
,nf Show current file in NERDTree (if plugin loaded) [n]
,. Go to last edit location [n]
,cd Set working directory to current opened file's directory [n]
,ee Opens an edit command with the path of the currently edited file filled in [n]
,te Opens a tab edit command with the path of the currently edited file filled in [n]
,qc Toggle Quickfix window [n]
,qo Open Quickfix window back up [n]
,# Surround a word with #{ruby interpolation} [n v]
," Surround a word with "quotes" [n v]
,' Surround a word with 'single quotes' [n v]
,( or ,) Surround a word with (parens) [n v]
,[ or ,] Surround a word with [brackets] [n v]
,{ or ,} Surround a word with {braces} [n v]
,rw Overwrite word, replace a word with what's in the yank buffer [n v]
,sw Swaps word under cursor and next word in line [n v]
,db Delete blank lines [n v]
,l' Surround every line in the file or selected lines with ' [n v]
,l" Surround every line in the file or selected lines with " [n v]
,l( Surround every line in the file or selected lines with () [n v]
,l[ Surround every line in the file or selected lines with [] [n v]
,l{ Surround every line in the file or selected lines with {} [n v]
,ss Strip trailing whitespace [n v]
,sf Search word under cursor or selected word entire files in current directory (recursively) [n v]
,sr Search word under cursor and replace with user inputs [n v]
,s[ Select inside [] include brackets [n v]
,s] Select inside [] [n v]
,s{ Select inside {} include brackets [n v]
,s} Select inside {} [n v]
,s( Select inside () include brackets [n v]
,s) Select inside () [n v]
,s< Select inside <> include brackets [n v]
,s> Select inside <> [n v]
,s" Select inside " [n v]
,s' Select inside ' [n v]
,yw Yank word under cursor [n]
,yl Yank current line [n]
,ls Send current line to console (tmux by default) [n]
,ms Send current motion to console (tmux by default) [n]
,rs Send current selection to console (tmux by default) [v]
,gs git status [n]
,gd git diff [n]
,gc git commit [n]
,gl git pull [n]
,gp git push [n]
,gpa git push --all [n]
,ga git add %currentfile% [n]
,gu git add all untracked files [n]
,g? git add user input files [n]
,gb git blame [n]
,gr git remove %currentfile% [n]
,ag Search in files, using ag [n]
,af Search file, using ag [n]
,ocf Open changed files (by git status) [n]
,orb Select Outer-Ruby-Block [n]
,t= Align assignments (don't count logic, like == or !=) [n v]
,t, Align on commas [n v]
,t<pipe> Align on vertical bars/pipes [n v]
,tsp Align on whitespace [n v]