|
syntax on |
|
set autoindent |
|
set nowrap |
|
set nobackup |
|
set writebackup |
|
|
|
set tabstop=2 |
|
set shiftwidth=2 |
|
set softtabstop=2 |
|
set expandtab |
|
|
|
set incsearch |
|
set hlsearch |
|
|
|
set scrolloff=5 |
|
set modelines=1 |
|
|
|
" yank, deletes, etc. are copied to clipboard |
|
set clipboard=unnamed |
|
|
|
" menu on completion |
|
set wildmenu |
|
set foldmethod=marker |
|
|
|
" line numbers |
|
set number |
|
set numberwidth=5 |
|
|
|
" horizontal cursor highlight |
|
" set cursorline |
|
|
|
" indent visual block |
|
:vnoremap < <gv |
|
:vnoremap > >gv |
|
|
|
" highlight wildmenu ctermbg=3 ctermfg=0 |
|
hi wildmenu term=standout ctermfg=0 ctermbg=3 guifg=#000000 guibg=#ffd700 |
|
hi Todo term=standout guifg=#ffffff guibg=#1248d1 |
|
hi Folded guibg=black |
|
|
|
set backspace=indent,eol,start whichwrap+=<,>,[,] |
|
|
|
set laststatus=2 |
|
set statusline=%<%f%h%m%r%=\ %l,%c%V\ %P |
|
|
|
" GUI options |
|
set guifont=Source\ Code\ Pro\ Light:h11 |
|
" - hide scrollbars |
|
set guioptions-=r |
|
set guioptions-=R |
|
set guioptions-=l |
|
set guioptions-=L |
|
set guioptions-=b |
|
|
|
" enable scrolling/selecting with mouse in tmux |
|
set mouse=a |
|
|
|
" disable bell |
|
set noerrorbells |
|
set novisualbell |
|
set t_vb= |
|
autocmd! GUIEnter * set vb t_vb= |
|
|
|
" Turn backup off |
|
set nobackup |
|
set nowb |
|
set noswapfile |
|
|
|
" LEADER key mapping |
|
let mapleader = "\<Space>" |
|
|
|
" Fast editing and reloading of vimrc configs |
|
map <leader>r :e! ~/.vimrc<cr> |
|
autocmd! bufwritepost vimrc source ~/.vimrc |
|
|
|
" hotkey for saving the file |
|
nnoremap <Leader>w :w<CR> |
|
|
|
" hotkey for toggling syntastic (linting) |
|
nnoremap <Leader>t :SyntasticToggleMode<CR> |
|
|
|
" Hotkey to remove trailing whitespace |
|
:nnoremap <silent> <leader>s :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar>:nohl<CR> |
|
|
|
" hotkeys to resize panes |
|
" nnoremap <silent> <Leader>- :exe "resize " . (winheight(0) * 2/3)<CR> |
|
nnoremap <silent> <Leader>h :vertical resize -5<cr> |
|
nnoremap <silent> <Leader>j :resize +5<cr> |
|
nnoremap <silent> <Leader>k :resize -5<cr> |
|
nnoremap <silent> <Leader>l :vertical resize +5<cr> |
|
|
|
" Remove highlighting, e.g. after search |
|
nnoremap <silent> <Leader><Esc> :noh<cr> |
|
|
|
" Select recently pasted text (similar to gv - select recently selected text) |
|
nnoremap gp `[v`] |
|
|
|
" Hotkey for omnicomplete (ctrl+space) |
|
inoremap <C-Space> <C-x><C-o> |
|
inoremap <C-@> <C-Space> |
|
|
|
" Search for current visual selection |
|
vnoremap // y/<C-R>"<CR> |
|
|
|
" Ack! versions of searches |
|
vnoremap <silent> <Leader>// y/<C-R>"<CR>:Ack! <C-R>"<CR> |
|
nnoremap <silent> <Leader>* viwy/<C-R>"<CR>:Ack! <C-R>"<CR> |
|
|
|
" Turn persistent undo on |
|
try |
|
set undodir=~/.vim_runtime/temp_dirs/undodir |
|
set undofile |
|
catch |
|
endtry |
|
|
|
" Splitting right and down feels more natural |
|
set splitbelow |
|
set splitright |
|
|
|
"NeoBundle Scripts----------------------------- |
|
let g:neobundle#install_process_timeout = 1500 |
|
|
|
if has('vim_starting') |
|
set nocompatible " Be iMproved |
|
|
|
" Required: |
|
set runtimepath+=/Users/chris.skeppstedt/.vim/bundle/neobundle.vim/ |
|
endif |
|
|
|
" Required: |
|
call neobundle#begin(expand('/Users/chris.skeppstedt/.vim/bundle')) |
|
|
|
" Let NeoBundle manage NeoBundle |
|
" Required: |
|
NeoBundleFetch 'Shougo/neobundle.vim' |
|
|
|
" Add or remove your Bundles here: |
|
NeoBundle 'MarcWeber/vim-addon-mw-utils' " dependency of garbas/vim-snipmat |
|
NeoBundle 'altercation/vim-colors-solarized' |
|
NeoBundle 'amix/vim-zenroom2' |
|
NeoBundle 'bronson/vim-trailing-whitespace' |
|
NeoBundle 'editorconfig/editorconfig-vim' |
|
NeoBundle 'ervandew/supertab' |
|
NeoBundle 'garbas/vim-snipmate' |
|
NeoBundle 'junegunn/goyo.vim' " dependency of amix/vim-zenroom2 |
|
NeoBundle 'kchmck/vim-coffee-script' |
|
NeoBundle 'kien/ctrlp.vim' |
|
NeoBundle 'mileszs/ack.vim' |
|
NeoBundle 'mustache/vim-mustache-handlebars' |
|
NeoBundle 'othree/yajs.vim' |
|
NeoBundle 'scrooloose/NERDCommenter' |
|
NeoBundle 'scrooloose/nerdtree' |
|
NeoBundle 'scrooloose/syntastic' |
|
NeoBundle 'terryma/vim-multiple-cursors' |
|
NeoBundle 'tomtom/tlib_vim' " dependency of garbas/vim-snipmate |
|
NeoBundle 'Valloric/YouCompleteMe', { |
|
\ 'build' : { |
|
\ 'mac' : './install.py', |
|
\ 'unix' : './install.py', |
|
\ 'windows' : 'install.py', |
|
\ 'cygwin' : './install.py' |
|
\ } |
|
\ } |
|
|
|
" Required: |
|
call neobundle#end() |
|
|
|
" Required: |
|
filetype plugin indent on |
|
|
|
" If there are uninstalled bundles found on startup, |
|
" this will conveniently prompt you to install them. |
|
NeoBundleCheck |
|
"End NeoBundle Scripts------------------------- |
|
|
|
" let the Ack plugin use the_silver_surfer |
|
if executable('ag') |
|
let g:ackprg = 'ag --vimgrep' |
|
endif |
|
|
|
" shortcut 'z' for Goyo mode |
|
nnoremap <silent> <leader>z :Goyo 110x85%<cr> |
|
|
|
" run scripts when entering/leaving Goyo |
|
autocmd! User GoyoEnter nested call <SID>goyo_enter() |
|
autocmd! User GoyoLeave nested call <SID>goyo_leave() |
|
|
|
function! s:goyo_enter() |
|
silent !tmux set status off |
|
set noshowmode |
|
set noshowcmd |
|
set wrap |
|
endfunction |
|
|
|
function! s:goyo_leave() |
|
silent !tmux set status on |
|
set showmode |
|
set showcmd |
|
set nowrap |
|
endfunction |
|
|
|
" Color name (:help cterm-colors) or ANSI code |
|
let g:limelight_conceal_ctermfg = 'gray' |
|
let g:limelight_conceal_ctermfg = 240 |
|
" |
|
" Color name (:help gui-colors) or RGB color |
|
let g:limelight_conceal_guifg = 'DarkGray' |
|
let g:limelight_conceal_guifg = '#777777' |
|
" |
|
" Default: 0.5 |
|
let g:limelight_default_coefficient = 0.7 |
|
" |
|
" Number of preceding/following paragraphs to include (default: 0) |
|
let g:limelight_paragraph_span = 1 |
|
|
|
" use theme from junegunn/seoul256.vim |
|
|
|
if has('gui_running') |
|
set background=light |
|
colorscheme solarized |
|
else |
|
" set background=dark |
|
" colorscheme strange |
|
set background=light |
|
" let g:solarized_termcolors=16 |
|
let g:solarized_visibility = "high" |
|
let g:solarized_contrast = "high" |
|
let g:solarized_termtrans=1 |
|
set t_Co=256 " force vim to use 256 colors |
|
let g:solarized_termcolors=256 " use solarized 256 fallback |
|
colorscheme solarized |
|
endif |
|
|
|
" start NERDtree if no files were specified |
|
autocmd StdinReadPre * let s:std_in=1 |
|
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif |
|
|
|
" close vim if NERDtree is the only open buffer |
|
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif |
|
|
|
" NEERDTree bindings |
|
nmap <F3> :NERDTreeToggle<CR> |
|
nmap <F4> :NERDTreeFind<CR> |
|
|
|
function! NERDTreeMapRefreshRoot() |
|
call nerdtree#putCursorInTreeWin() |
|
call nerdtree#invokeKeyMap('R') |
|
" Go back to previous window. |
|
wincmd p |
|
endfunction |
|
|
|
" CtrlP |
|
nnoremap <Leader>r :CtrlPClearCache<cr>call s:UpdateNERDTree()<cr> |
|
|
|
" recommended syntastic settings |
|
set statusline+=%#warningmsg# |
|
set statusline+=%{SyntasticStatuslineFlag()} |
|
set statusline+=%* |
|
|
|
let g:syntastic_always_populate_loc_list = 1 |
|
let g:syntastic_auto_loc_list = 0 |
|
let g:syntastic_check_on_open = 0 |
|
let g:syntastic_check_on_wq = 0 |
|
let g:syntastic_html_tidy_exec = 'tidy5' |
|
|
|
let g:syntastic_javascript_checkers = ['eslint'] |
|
|
|
let g:syntastic_html_tidy_ignore_errors = [ |
|
\ 'plain text isn''t allowed in <head> elements', |
|
\ '<base> escaping malformed URI reference', |
|
\ 'discarding unexpected <body>', |
|
\ '<script> escaping malformed URI reference', |
|
\ '</head> isn''t allowed in <body> elements' |
|
\ ] |
|
|
|
" Start interactive EasyAlign in visual mode (e.g. vip<Enter>) |
|
vmap <Enter> <Plug>(EasyAlign) |
|
" |
|
" Start interactive EasyAlign for a motion/text object (e.g. gaip) |
|
nmap ga <Plug>(EasyAlign) |
|
|
|
" ctrlp |
|
let g:ctrlp_custom_ignore = '\v[\/](node_modules|dist)|(\.(swp|git))$' |
|
|
|
" YouCompleteMe |
|
let g:ycm_collect_identifiers_from_comments_and_strings = 1 |
|
let g:ycm_seed_identifiers_with_syntax = 1 |
|
|
|
" vim-jsx |
|
" allow JSX in .js-files |
|
let g:jsx_ext_required = 0 |
|
|
|
" hack to make the gutter (lint/hint/syntasitc warnings) have the same bg as the theme |
|
hi clear SignColumn |
|
hi TabLine term=bold cterm=bold ctermbg=7 ctermfg=235 |
|
hi Title ctermfg=244 ctermbg=15 term=bold cterm=bold |
|
hi TabLineFill term=NONE cterm=NONE ctermbg=7 ctermfg=7 |
|
hi TabLineSel term=bold cterm=bold ctermbg=235 ctermfg=15 |