Skip to content

Instantly share code, notes, and snippets.

@noodlehaus
Last active August 15, 2016 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noodlehaus/ab99edaa02ebb13d0efb to your computer and use it in GitHub Desktop.
Save noodlehaus/ab99edaa02ebb13d0efb to your computer and use it in GitHub Desktop.
vim config
" pathogen
execute pathogen#infect()
syntax on
filetype plugin indent on
" colors
set t_Co=256
colorscheme Monokai
set autoindent
set backspace=2
set encoding=utf-8
set expandtab
set hidden
set hlsearch
set ignorecase
set incsearch
set laststatus=2
set nobackup
set nocompatible
set nocursorcolumn
set nocursorline
set noswapfile
set nowritebackup
set ruler
set scrolloff=3
set shiftround
set shiftwidth=2
set showcmd
set showmode
set smartcase
set softtabstop=2
set splitbelow
set splitright
set tabstop=2
set title
set ttyfast
set visualbell
set wildmenu
set wildmode=list:longest
" trying to improve syntax highlighting
syntax sync minlines=100
syntax sync maxlines=300
set synmaxcol=900
" leader to space
let mapleader = "\<Space>"
" jj to exit insert mode
inoremap jj <Esc>
" easy colon mode
nnoremap ; :
" pretty json
com! FormatJSON %!python -m json.tool
nnoremap <leader>fj :FormatJSON<cr>
" spacing + numbers
nnoremap <leader>nn :set relativenumber!<cr>
nnoremap <leader>ww :set list!<cr>
" splits
nnoremap <leader>h <c-w><c-h>
nnoremap <leader>j <c-w><c-j>
nnoremap <leader>k <c-w><c-k>
nnoremap <leader>l <c-w><c-l>
nnoremap <leader>wh <c-w><s-h>
nnoremap <leader>wj <c-w><s-j>
nnoremap <leader>wk <c-w><s-k>
nnoremap <leader>wl <c-w><s-l>
" split resize shortcuts
nnoremap <leader>v= :vertical resize +5<cr>
nnoremap <leader>v- :vertical resize -5<cr>
nnoremap <leader>s= :resize +5<cr>
nnoremap <leader>s- :resize -5<cr>
" git gutter
let g:gitgutter_map_keys=0
nnoremap <leader>gh :GitGutterLineHighlightsToggle<cr>
nnoremap <leader>gg :GitGutterToggle<cr>
nnoremap <leader>gs :GitGutterStageHunk<cr>
nnoremap <leader>gr :GitGutterRevertHunk<cr>
nmap ]c <Plug>GitGutterNextHunk
nmap [c <Plug>GitGutterPrevHunk
" The Silver Searcher
if executable('ag')
set grepprg=ag\ --nogroup\ --nocolor
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
let g:ctrlp_use_caching = 0
endif
" disable markdown folds
let g:vim_markdown_folding_disabled=1
" type-specific settings
autocmd FileType sh setlocal noexpandtab
" trim trailing whitespace
" autocmd BufWritePre *.* :%s/\s\+$//e
" phtml handling
au BufNewFile,BufRead *.phtml set ft=php
" syntastic + jshint
let g:syntastic_javascript_checkers = ['jshint']
" get bash set up
let $BASH_ENV="~/.bash_aliases"
" ycm
let g:ycm_add_preview_to_completeopt=0
" per ile formatting
autocmd FileType php setlocal tabstop=2 shiftwidth=2 softtabstop=2
autocmd FileType phtml setlocal tabstop=2 shiftwidth=2 softtabstop=2
autocmd FileType javascript setlocal tabstop=4 shiftwidth=4 softtabstop=4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment