dotfiles/vim/vimrc
Josh Sherman 9a4ec34e87
[vim] cleaned up some indenting issues
split syntax plugins out as well. php was loading a file that was
blowing away smart indent so i reworked everything to be an autocmd
based on the file type. now defaulting to 2 space tabs for everything
except php
2017-02-04 20:32:01 -06:00

200 lines
5 KiB
VimL

filetype detect
filetype plugin on
filetype indent on
set autoindent
set autoread
set background=dark
set backspace=eol,start,indent
set colorcolumn=80,120
set cursorline
set encoding=utf8
set expandtab
set foldmethod=marker
set hidden
set history=1000
set hlsearch
set ignorecase
set incsearch
set laststatus=2
set lazyredraw
set list
set listchars=tab:└─,trail:•
set magic
set mat=2
set nocindent
set nocompatible
set noerrorbells
set novisualbell
set number
set pastetoggle=<F2>
set relativenumber
set rtp+=$HOME/.dotfiles/vendor/VundleVim/Vundle.vim
set shiftwidth=2
set showmatch
set showmode
set smartcase
set smartindent
set so=7
set softtabstop=2
set t_Co=256
set tabstop=2
set textwidth=0
set title
set tm=500
set ttyfast
set undolevels=1000
set wildmenu
set wildmode=list:longest
autocmd BufNewFile,BufRead *.cnf,*.conf,*gitconfig set filetype=dosini
autocmd BufNewFile,BufRead *.dust,*.dustjs,*.tl set filetype=dustjs
autocmd BufNewFile,BufRead *.less set filetype=less
autocmd BufNewFile,BufRead nginx.conf set filetype=nginx
autocmd BufNewFile,BufRead *.yaml,*.yml,*gemrc set filetype=yaml
autocmd BufNewFile,BufRead *.handlebars set filetype=html.handlebars syntax=mustache
autocmd FileType go setlocal noexpandtab
autocmd FileType php setlocal smartindent tabstop=4 shiftwidth=4 softtabstop=4
autocmd FileType markdown,text setlocal nosmartindent textwidth=80 wrapmargin=2
"autocmd VimEnter,BufNewFile,BufReadPost * silent! call HardMode()
set backupdir=~/.vim/backup//,/tmp
set directory=~/.vim/swap//,/tmp
set undodir=~/.vim/undo//,/tmp
set undofile
call vundle#begin()
Plugin 'gmarik/vundle'
" sort i /\/\zs.\+\ze'/ r
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'wikitopian/hardmode'
Plugin 'vim-scripts/matchit.zip'
Plugin 'shawncplus/phpcomplete.vim'
Plugin 'cakebaker/scss-syntax.vim'
Plugin 'ervandew/supertab'
Plugin 'scrooloose/syntastic'
Plugin 'tomtom/tlib_vim'
Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'bling/vim-bufferline'
Plugin 'altercation/vim-colors-solarized'
Plugin 'terryma/vim-expand-region'
Plugin 'nathanaelkane/vim-indent-guides'
Plugin 'dietsche/vim-lastplace'
Plugin 'garbas/vim-snipmate'
Plugin 'honza/vim-snippets'
" Syntax plugins
Plugin 'jimmyhchan/dustjs.vim'
Plugin 'evanmiller/nginx-vim-syntax'
Plugin 'joshtronic/php.vim'
Plugin 'hail2u/vim-css3-syntax'
Plugin 'pangloss/vim-javascript.git'
Plugin 'groenewege/vim-less'
Plugin 'mustache/vim-mustache-handlebars'
Plugin 'tmux-plugins/vim-tmux'
Plugin 'ingydotnet/yaml-vim'
call vundle#end()
filetype plugin indent on
syntax enable
set background=dark
colorscheme solarized
augroup ExtraWhitespace
autocmd BufEnter * highlight ExtraWhitespace ctermbg=DarkRed ctermfg=white
autocmd BufEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhiteSpace /\s\+$/
augroup END
let g:bufferline_echo = 0
autocmd VimEnter *
\ let &statusline='%{bufferline#refresh_status()}'
\ .bufferline#get_status_string()
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let b:match_words = '<:>,<tag>:</tag>'
let g:SuperTabDefaultCompletionType = 'context'
let mapleader = "\<Space>"
nnoremap <Leader>o :CtrlP<CR>
nnoremap <Leader>w :w<CR>
nnoremap <Leader>q :q<CR>
nnoremap <Leader>d :bd<CR>
vmap v <Plug>(expand_region_expand)
vmap <C-v> <Plug>(expand_region_shrink)
vnoremap // y/<C-R>"<CR>
nmap <silent> ,/ :nohlsearch<CR>
nnoremap <Leader>h <Esc>:call ToggleHardMode()<CR>
nnoremap <Leader>[ :bprevious<CR>
nnoremap <Leader>] :bnext<CR>
nmap <Leader>1 :buffer 1<CR>
nmap <Leader>2 :buffer 2<CR>
nmap <Leader>3 :buffer 3<CR>
nmap <Leader>4 :buffer 4<CR>
nmap <Leader>5 :buffer 5<CR>
nmap <Leader>6 :buffer 6<CR>
nmap <Leader>7 :buffer 7<CR>
nmap <Leader>8 :buffer 8<CR>
nmap <Leader>9 :buffer 9<CR>
nmap <Leader>0 :buffer 10<CR>
nnoremap <Leader>f :set nolist<CR>
nnoremap <Leader>F :set list<CR>
nnoremap <Leader>b :BundleUpdate<CR>:q<CR>
nnoremap <Leader>c :w<CR>:!wc %<CR>
nnoremap <Leader>v :so ~/.vim/vimrc<CR>
nnoremap <Leader>ss / $<CR>
nnoremap <Leader>tt /\t$<CR>
syntax on
syntax sync fromstart
let g:ctrlp_follow_symlinks = 2
" Ignore some folders and files for CtrlP indexing
let g:ctrlp_custom_ignore = {
\ 'dir': '\.git$\|\.yardoc\|public$|log\|tmp$',
\ 'file': '\.so$\|\.dat$|\.DS_Store$'
\ }
set gcr=a:block
" mode aware cursors
set gcr+=o:hor50-Cursor
set gcr+=n:Cursor
set gcr+=i-ci-sm:InsertCursor
set gcr+=r-cr:ReplaceCursor-hor20
set gcr+=c:CommandCursor
set gcr+=v-ve:VisualCursor
set gcr+=a:blinkon0
hi InsertCursor ctermfg=15 guifg=#fdf6e3 ctermbg=37 guibg=#2aa198
hi VisualCursor ctermfg=15 guifg=#fdf6e3 ctermbg=125 guibg=#d33682
hi ReplaceCursor ctermfg=15 guifg=#fdf6e3 ctermbg=65 guibg=#dc322f
hi CommandCursor ctermfg=15 guifg=#fdf6e3 ctermbg=166 guibg=#cb4b16