Skip to content

Instantly share code, notes, and snippets.

@charud
Last active May 18, 2016 08:01
Show Gist options
  • Save charud/09ea0a216e01ebc6440d to your computer and use it in GitHub Desktop.
Save charud/09ea0a216e01ebc6440d to your computer and use it in GitHub Desktop.
set shell=bash
" this combination gives absolute number for the current line
set relativenumber
set number
"set statusline=%f
set laststatus=2
set tabstop=4
set shiftwidth=4
set nowrap
" use osx cipboard
set clipboard=unnamed
" vim-airline fonts
let g:airline_powerline_fonts = 1
" show buffers on top
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#fnamemod = ':t'
" vim-gitgutter can be really slow, this will trade accuracy for speed
let g:gitgutter_realtime = 0
let g:gitgutter_eager = 0
" airline also becomes really slow with large files
let g:airline#extensions#whitespace#max_lines = 20000
" automatically reload files when updates. e.g package.json
set autoread
" make it possible to delete previously entered characters with backspace
set backspace=start
" vundle setup
set nocompatible
filetype off
filetype plugin indent off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" no mappings for vim-gitguter since they conflict with buffer mappings
let g:gitgutter_map_keys = 0
Plugin 'VundleVim/Vundle.vim'
Plugin 'Townk/vim-autoclose'
Plugin 'bling/vim-airline'
Plugin 'scrooloose/nerdtree'
Plugin 'altercation/vim-colors-solarized'
Plugin 'StanAngeloff/php.vim'
Plugin 'pangloss/vim-javascript'
Plugin 'HTML-AutoCloseTag'
Plugin 'kien/ctrlp.vim'
Plugin 'easymotion/vim-easymotion'
Plugin 'ntpeters/vim-better-whitespace'
Plugin 'airblade/vim-gitgutter'
Plugin 'ddollar/nerdcommenter'
Plugin 'embear/vim-localvimrc'
Plugin 'tpope/vim-fugitive'
Plugin 'git-file.vim'
Plugin 'christoomey/vim-tmux-navigator'
Plugin 'maxbrunsfeld/vim-yankstack'
Plugin 'dahu/vim-fanfingtastic'
Plugin 'tpope/vim-repeat'
Plugin 'tpope/vim-surround'
Plugin 'elzr/vim-json'
Plugin 'rking/ag.vim'
Plugin 'editorconfig/editorconfig-vim'
Plugin 'evidens/vim-twig'
Plugin 'mustache/vim-mustache-handlebars'
call vundle#end()
" HTML AutoCloseTag enable close tag for HTML and JS
" au FileType html,js so ~/.vim/ftplugin/html_autoclosetag.vim
" exlucde folders for ctrlp
let g:ctrlp_custom_ignore = 'node_modules\|git'
let g:ctrlp_working_path_mode = 'r'
" theme
set background=light
" let g:solarized_termcolors=256
set t_Co=256
colorscheme solarized
" remap leader key
nnoremap <SPACE> <NOP>
let mapleader = " "
" tab maps
map t1 1gt
map t2 2gt
map t3 3gt
map t4 4gt
map t5 5gt
map t6 6gt
map t7 7gt
map t8 8gt
map t9 9gt
map t10 10gt
map t11 11gt
" for buffers
set hidden
" open empty buffer
nmap <leader>T :enew<cr>
nmap <leader>n :enew<cr>
" next buffer
nmap <leader>l :bnext<CR>
" prev buffer
nmap <leader>h :bprevious<CR>
" strip whitespace quickly
nmap <leader>S :StripWhitespace<CR>
" to be able to newline without entering insert mode
nmap <leader>o o<Esc>
nmap <leader>O O<Esc>
" close current buffer and move to previous
nmap <leader>q :bp <BAR> bd #<CR>
nmap <leader>Q :bp <BAR> bd! #<CR>
" Show all open buffers
nmap <leader>bl :ls<CR>
" Save hotkey
nmap <leader>s :w<CR>
" Find current file in tree
nmap <leader>f :NERDTreeFind<CR>
" yankstack
nmap <leader>p <Plug>yankstack_substitute_older_paste
nmap <leader>P <Plug>yankstack_substitute_newer_paste
" easymotion
nmap <leader>j <Plug>(easymotion-j)
nmap <leader>k <Plug>(easymotion-k)
nmap <leader>L <Plug>(easymotion-lineforward)
nmap <leader>H <Plug>(easymotion-linebackward)
" http://vim.wikia.com/wiki/Search_for_visually_selected_text
vnoremap // y/<C-R>"<CR>"
filetype off
filetype plugin indent on
syntax on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment