[vim] some vimrc tweaks to colors, mappings, etc
This commit is contained in:
parent
f22159fc0e
commit
2530e7bb2e
1 changed files with 17 additions and 17 deletions
34
vimrc
34
vimrc
|
@ -39,7 +39,7 @@ set ttyfast " fast terminals
|
||||||
|
|
||||||
set wrap " wrap long lines
|
set wrap " wrap long lines
|
||||||
set linebreak " break at between words
|
set linebreak " break at between words
|
||||||
set textwidth=80 " wrap at 120 characters
|
set textwidth=120 " wrap at 120 characters
|
||||||
set colorcolumn=80,89,120
|
set colorcolumn=80,89,120
|
||||||
" highlight 80th and 120th columns
|
" highlight 80th and 120th columns
|
||||||
set showmatch " show matching things: (), {}, [], etc
|
set showmatch " show matching things: (), {}, [], etc
|
||||||
|
@ -130,16 +130,13 @@ if &t_Co > 2 || has('gui_running')
|
||||||
syntax on " turn on syntax highlighting
|
syntax on " turn on syntax highlighting
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if $ITERM_PROFILE =~# '[Ll]ight'
|
" Dark backgrounds are the only way to travel
|
||||||
set bg=light
|
set bg=dark
|
||||||
else
|
|
||||||
set bg=dark
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Try to use the solarized colorscheme if the terminal can support it (or we're in a GUI)
|
" Try to use the solarized colorscheme if the terminal can support it
|
||||||
try
|
try
|
||||||
let g:solarized_termtrans = 0 " transparent terminals
|
let g:solarized_termtrans = 0 " transparent terminals
|
||||||
"let g:solarized_visibility = 'low' " visibility of list chars
|
let g:solarized_visibility = 'low' " visibility of list chars
|
||||||
colorscheme solarized
|
colorscheme solarized
|
||||||
endtry
|
endtry
|
||||||
|
|
||||||
|
@ -152,10 +149,7 @@ let g:snipMate.scope_aliases = {}
|
||||||
let g:snipMate.scope_aliases["java"] = "android"
|
let g:snipMate.scope_aliases["java"] = "android"
|
||||||
|
|
||||||
" set the Gundo preview window on the bottom
|
" set the Gundo preview window on the bottom
|
||||||
if has('loaded_gundo')
|
let g:gundo_preview_bottom = 1
|
||||||
let g:gundo_preview_bottom = 1
|
|
||||||
map <silent> <F3> :GundoToggle<CR>
|
|
||||||
endif
|
|
||||||
|
|
||||||
noremap <silent> <F2> :NERDTreeToggle<CR>
|
noremap <silent> <F2> :NERDTreeToggle<CR>
|
||||||
noremap <silent> <F3> :GundoToggle<CR>
|
noremap <silent> <F3> :GundoToggle<CR>
|
||||||
|
@ -210,7 +204,8 @@ function! SelectaCommand(choice_command, selecta_args, vim_command)
|
||||||
try
|
try
|
||||||
silent let selection = system(a:choice_command . " | selecta " . a:selecta_args)
|
silent let selection = system(a:choice_command . " | selecta " . a:selecta_args)
|
||||||
catch /Vim:Interrupt/
|
catch /Vim:Interrupt/
|
||||||
" Swallow ^C so the redraw below happens; otherwise there will be leftovers of selecta on screen.
|
" Swallow ^C so the redraw below happens; otherwise there will be
|
||||||
|
" leftovers of selecta on screen.
|
||||||
redraw!
|
redraw!
|
||||||
return
|
return
|
||||||
endtry
|
endtry
|
||||||
|
@ -268,12 +263,12 @@ nnoremap gV `[v`]
|
||||||
"let g:CommandTAcceptSelectionTabMap='<CR>'
|
"let g:CommandTAcceptSelectionTabMap='<CR>'
|
||||||
|
|
||||||
" GitGutter shows changed lines in files.
|
" GitGutter shows changed lines in files.
|
||||||
let g:gitgutter_enabled = 0
|
"let g:gitgutter_enabled = 0
|
||||||
highlight clear SignColumn
|
"highlight clear SignColumn
|
||||||
nnoremap <silent> <leader>gg :ToggleGitGutter<CR>
|
"nnoremap <silent> <leader>gg :ToggleGitGutter<CR>
|
||||||
|
|
||||||
" Don't underline folded lines
|
" Don't underline folded lines
|
||||||
highlight Folded cterm=bold
|
highlight Folded cterm=bold term=bold ctermfg=NONE ctermbg=NONE
|
||||||
|
|
||||||
" Autocommands {{{
|
" Autocommands {{{
|
||||||
if has('autocmd')
|
if has('autocmd')
|
||||||
|
@ -297,6 +292,11 @@ if has('autocmd')
|
||||||
" autocmd BufWritePost *.snippets :call ReloadSnippets(expand('%:t:r'))
|
" autocmd BufWritePost *.snippets :call ReloadSnippets(expand('%:t:r'))
|
||||||
"augroup END
|
"augroup END
|
||||||
|
|
||||||
|
augroup WrapAt80
|
||||||
|
autocmd!
|
||||||
|
autocmd FileType text setlocal tw=80
|
||||||
|
augroup END
|
||||||
|
|
||||||
" Clean whitespace before saving: Python, C, HTML, and Objective-C
|
" Clean whitespace before saving: Python, C, HTML, and Objective-C
|
||||||
augroup StripTrailingWhitespace
|
augroup StripTrailingWhitespace
|
||||||
autocmd!
|
autocmd!
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue