Last active
December 15, 2016 21:20
-
-
Save islandjoe/656bad15c8a48e21c601c6256d5a8098 to your computer and use it in GitHub Desktop.
My .vimrc starter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax on | |
set tabstop=2 | |
set shiftwidth=2 | |
" Incremental Search | |
set incsearch | |
" Search Highlighting | |
set hlsearch | |
" Mapping | |
let mapleader = "\<Space>" | |
nnoremap <leader>rv :source $MYVIMRC<CR> | |
:nmap WW :w<CR> | |
:imap WW <esc>WW<CR> | |
" autocomplete parenthesis, brackets and braces | |
inoremap ( ()<Left> | |
inoremap [ []<Left> | |
inoremap { {}<Left> | |
" autocomplete quotes | |
inoremap ' '<Esc>:call QuoteInsertionWrapper("'")<CR>a | |
inoremap " "<Esc>:call QuoteInsertionWrapper('"')<CR>a | |
inoremap ` `<Esc>:call QuoteInsertionWrapper('`')<CR>a | |
function! QuoteInsertionWrapper(quote) | |
let col = col('.') | |
if getline('.')[col-2] !~ '\k' && getline('.')[col] !~ '\k' | |
normal ax | |
exe "normal r".a:quote."h" | |
end | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment