2017-02-22 21:49:21 -07:00
|
|
|
" vim-plug---START
|
|
|
|
call plug#begin('~/.config/nvim/plugged')
|
|
|
|
|
|
|
|
" Plugins
|
2017-05-05 09:53:15 -07:00
|
|
|
Plug 'altercation/vim-colors-solarized'
|
2017-02-22 21:49:21 -07:00
|
|
|
Plug 'airblade/vim-gitgutter'
|
|
|
|
Plug 'kien/ctrlp.vim'
|
|
|
|
Plug 'majutsushi/tagbar'
|
2017-02-27 10:16:29 -07:00
|
|
|
Plug 'scrooloose/nerdcommenter'
|
2017-02-22 21:49:21 -07:00
|
|
|
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
|
|
|
|
Plug 'scrooloose/syntastic'
|
|
|
|
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
|
|
|
|
Plug 'tpope/vim-fugitive'
|
|
|
|
Plug 'tpope/vim-rails'
|
|
|
|
Plug 'tpope/vim-surround'
|
|
|
|
Plug 'vim-syntastic/syntastic'
|
|
|
|
|
|
|
|
call plug#end()
|
|
|
|
|
|
|
|
" vim-plug---END
|
|
|
|
|
2017-05-05 09:53:15 -07:00
|
|
|
" Solarized
|
2017-02-22 21:49:21 -07:00
|
|
|
syntax enable
|
|
|
|
set background=dark
|
|
|
|
colorscheme solarized
|
2017-05-05 09:53:15 -07:00
|
|
|
call togglebg#map("")
|
|
|
|
|
2017-05-05 09:55:57 -07:00
|
|
|
function SetWhitespace()
|
|
|
|
if &background == 'dark'
|
|
|
|
hi Whitespace ctermfg=0
|
|
|
|
else
|
|
|
|
hi Whitespace ctermfg=7
|
|
|
|
end
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
call SetWhitespace()
|
|
|
|
map <F5> :ToggleBG<CR> :call SetWhitespace()<CR>
|
|
|
|
|
2017-05-05 09:53:15 -07:00
|
|
|
set number
|
2017-02-22 21:49:21 -07:00
|
|
|
set nowrap
|
|
|
|
filetype plugin indent on
|
|
|
|
|
|
|
|
set list
|
2017-05-17 08:23:56 -07:00
|
|
|
set listchars=tab:――,space:·,trail:·
|
2017-02-22 21:49:21 -07:00
|
|
|
|
|
|
|
set tabstop=2
|
|
|
|
set shiftwidth=2
|
|
|
|
set expandtab
|
|
|
|
|
|
|
|
autocmd BufRead,BufNewFile *.h,*.c,*.cpp, set tabstop=8 shiftwidth=8 expandtab
|
|
|
|
autocmd BufRead,BufNewFile *.cs,*.java set tabstop=4 shiftwidth=4 expandtab
|
2017-05-05 09:57:17 -07:00
|
|
|
autocmd BufRead,BufNewFile *.go set tabstop=8 shiftwidth=8 noexpandtab
|
2017-03-15 17:32:30 -07:00
|
|
|
autocmd BufRead,BufNewFile *.asm set filetype=nasm
|
2017-05-17 08:23:12 -07:00
|
|
|
autocmd FileType crontab set backupcopy=yes
|
2017-02-22 21:49:21 -07:00
|
|
|
|
|
|
|
function TrimTrailingInvisibles()
|
|
|
|
let view = winsaveview()
|
|
|
|
%s/\s\+$//e
|
|
|
|
call winrestview(view)
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
function TrimTrailingLines()
|
|
|
|
let view = winsaveview()
|
|
|
|
%s/\n\+\%$//e
|
|
|
|
call winrestview(view)
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
augroup maximus
|
|
|
|
|
|
|
|
autocmd BufWrite * call TrimTrailingInvisibles() | call TrimTrailingLines()
|
|
|
|
autocmd BufLeave * if &buftype == '' && !&readonly && &modifiable && &modified && expand("%:t") != "" | call TrimTrailingInvisibles() | call TrimTrailingLines() | w | SyntasticCheck | GitGutter | endif
|
|
|
|
|
|
|
|
augroup END
|
|
|
|
|
|
|
|
set statusline=%f
|
|
|
|
set statusline+=\ %y
|
|
|
|
set statusline+=[%{&ff}]
|
|
|
|
set statusline+=%r
|
|
|
|
set statusline+=%h
|
|
|
|
set statusline+=%{ModifiedSym()}
|
|
|
|
set statusline+=%=
|
|
|
|
set statusline+=%{SyntasticStatuslineFlag()}
|
|
|
|
set statusline+=%=
|
|
|
|
set statusline+=%{AddGitGutterToStatusline()}
|
|
|
|
set statusline+=\ [%c:%l/%L:%p%%]
|
|
|
|
|
|
|
|
function ModifiedSym()
|
|
|
|
if &modified
|
|
|
|
return "[\u270f]"
|
|
|
|
else
|
|
|
|
return ""
|
|
|
|
end
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
function AddGitGutterToStatusline()
|
|
|
|
if &buftype == '' && exists("b:gitgutter_summary")
|
|
|
|
return join(["[Git:", join(b:gitgutter_summary, ","), "]"], "")
|
|
|
|
else
|
|
|
|
return ""
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
" Shortcuts
|
|
|
|
nmap <C-\> :NERDTreeToggle<CR>
|
|
|
|
nmap <leader>. :TagbarToggle<CR>
|
|
|
|
|
|
|
|
" Plugin configuration
|
2017-05-01 14:52:00 -07:00
|
|
|
" ctrlp
|
2017-05-17 08:24:18 -07:00
|
|
|
let g:ctrlp_custom_ignore = '\v(node_modules|\.git|tmp)$'
|
|
|
|
let g:ctrlp_show_hidden = 1
|
2017-05-01 14:52:00 -07:00
|
|
|
|
2017-02-27 10:16:29 -07:00
|
|
|
" NERD Commenter
|
|
|
|
let g:NERDSpaceDelims = 1
|
|
|
|
|
2017-02-22 21:49:21 -07:00
|
|
|
" deoplete
|
|
|
|
let g:deoplete#enable_at_startup = 1
|
|
|
|
let g:deoplete#enable_ignore_case = 1
|
|
|
|
|
|
|
|
" Syntastic
|
|
|
|
let g:syntastic_stl_format = "[Err: first:%fe total:%e] [Warn: first:%fw total:%w]"
|
|
|
|
let g:syntastic_check_on_open = 1
|
|
|
|
let g:syntastic_check_on_wq = 1
|
|
|
|
let g:syntastic_enable_signs = 1
|
|
|
|
let g:syntastic_aggregate_errors = 1
|
|
|
|
let g:syntastic_ruby_checkers = ['rubocop', 'mri']
|
|
|
|
let g:syntastic_error_symbol = "\u2717"
|
2017-02-27 10:16:29 -07:00
|
|
|
let g:syntastic_warning_symbol = "\uFE0E"
|