Skip to content

Instantly share code, notes, and snippets.

@varvaruc
Created November 26, 2013 13:04
Show Gist options
  • Save varvaruc/7657965 to your computer and use it in GitHub Desktop.
Save varvaruc/7657965 to your computer and use it in GitHub Desktop.
set nocompatible
filetype off
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)
"Spaces instead of tabs
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
nmap <Leader>nt :NERDTree<cr>
nmap <Leader>ntt :NERDTreeToggle<cr>
nmap <Leader>f :CtrlP<cr>
nmap <Leader>b :CtrlPBuffer<cr>
vmap <Leader>c "+y<cr>
nmap <Leader>v "+p<cr>
nmap <Leader>s :w<cr>
nmap <Leader>a ggVG<cr>
nmap <Leader>i ggVG=<c-o><cr>
nmap <Leader>x :bd<cr>
nmap <Leader>xx :bd!<cr>
nmap <Leader>q :q<cr>
nmap <Leader>qq :q!<cr>
nmap <Leader>vi :e! ~/.vimrc<cr>
nmap <Leader>gc :!google-chrome %<cr><cr>
nmap <Leader>hx :%!xxd<cr>
nmap <Leader>hxr :%!xxd -r<cr>
cmap <F3> <C-R>=strftime("_%d_%m_%Y_%H_%M")<CR>
nmap <tab> <c-w><c-w>
command! WQ wq
command! Wq wq
command! W w
command! Q q
" git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
" Vundle; see https://github.com/gmarik/vundle
" To install, run :BundleInstall
" To update, run :BundleInstall!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'tComment'
Bundle 'scrooloose/nerdtree'
Bundle 'Lokaltog/vim-powerline'
Bundle 'mattn/gist-vim'
Bundle 'mattn/webapi-vim'
Bundle 'tpope/vim-surround'
Bundle 'mattn/emmet-vim'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'kien/ctrlp.vim'
Bundle 'nanotech/jellybeans.vim'
let g:user_emmet_leader_key = '<Leader>'
let g:user_emmet_expandabbr_key='<Leader>e'
let g:user_emmet_complete_tag=1
let g:user_emmet_next_key='<c-n>'
let g:user_emmet_prev_key='<c-p>'
"Enable just for html/css
let g:user_emmet_install_global = 0
autocmd FileType html,css EmmetInstall
" In vim 7.4 html, head, body are not indented automatically
let g:html_indent_inctags = "html,body,head,tbody,script"
filetype plugin indent on
colors jellybeans
set guifont=Monaco\ 11
set mouse=a " Enable scrolling xterm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment