Skip to content

Instantly share code, notes, and snippets.

@varvaruc
Created November 28, 2013 21:54
Show Gist options
  • Select an option

  • Save varvaruc/7698617 to your computer and use it in GitHub Desktop.

Select an option

Save varvaruc/7698617 to your computer and use it in GitHub Desktop.
" No Vundle, just settings
set nocompatible
filetype on
syntax on
set backspace=indent,eol,start
fixdel
set ignorecase
set smartcase
set hlsearch
set wrap
set textwidth=79
set formatoptions=qrn1
set guioptions-=m
set guioptions-=T
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 t_Co=256 "xterm 256 colors
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>
nmap <tab> <c-w><c-w>
: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