Skip to content

Instantly share code, notes, and snippets.

@varvaruc
Created November 29, 2013 18:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save varvaruc/7710311 to your computer and use it in GitHub Desktop.
Save varvaruc/7710311 to your computer and use it in GitHub Desktop.
" VSVIM
syntax on
set ignorecase
set smartcase
set hlsearch
set wrap
set number
set laststatus=2
set autoindent
set smartindent
set cursorline
set softtabstop=4 "go back one tab when hitting backspace(without this is goes back single space)
set tabstop=4 "used by >>, << and tab.
set shiftwidth=4 "number of space characters used when displaying TAB
set expandtab "Replate tab by spaces
set encoding=utf-8
" Key mappings
" Move visual blocks up and down with <C-j> and <C-k>
nnoremap <C-j> :m .+1<CR>==
nnoremap <C-k> :m .-2<CR>==
inoremap <C-j> <Esc>:m .+1<CR>==gi
inoremap <C-k> <Esc>:m .-2<CR>==gi
vnoremap <C-j> :m '>+1<CR>gv=gv
vnoremap <C-k> :m '<-2<CR>gv=gv
" disable arrow keys in normal mode
map <up> <nop>
map <down> <nop>
map <left> <nop>
map <right> <nop>
" disable arrow keys in insert mode
imap <up> <nop>
imap <down> <nop>
imap <left> <nop>
imap <right> <nop>
" Redraws screen no highlighting
nnoremap <silent> <C-l> :nohl<CR><C-l>
" Better wrap navigation
nnoremap j gj
nnoremap k gk
nnoremap gj j
nnoremap gk k
" ESC with jj
inoremap jj <Esc>
" Complete brackets
inoremap { {}<Left>
inoremap {<CR> {<CR>}<Esc>O
inoremap {{ {
inoremap {} {}
" Print colon when hitting semicolor
map ; :
" Leader ,
let mapleader = ","
" Leader Commands
vmap <Leader>c "+y<cr>
nmap <Leader>v "+p<cr>
nmap <Leader>s :w<cr>
nmap <Leader>a ggVG<cr>
nmap <Leader>x :bd<cr>
nmap <Leader>xx :bd!<cr>
nmap <Leader>q :q<cr>
nmap <Leader>qq :q!<cr>
:command! WQ wq
:command! Wq wq
:command! W w
:command! Q q
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment