aboutsummaryrefslogtreecommitdiffstats
path: root/vim/.vimrc
diff options
context:
space:
mode:
Diffstat (limited to 'vim/.vimrc')
-rw-r--r--vim/.vimrc69
1 files changed, 42 insertions, 27 deletions
diff --git a/vim/.vimrc b/vim/.vimrc
index 20d49fb..cde36c1 100644
--- a/vim/.vimrc
+++ b/vim/.vimrc
@@ -1,11 +1,11 @@
1execute pathogen#infect() 1silent! execute pathogen#infect()
2 2
3""" DEFAULT VIM SETTINGS 3""" DEFAULT VIM SETTINGS
4 4
5" Reload vimrc on save 5" Reload vimrc on save
6augroup reload_vimrc " { 6augroup reload_vimrc " {
7 autocmd! 7 autocmd!
8 autocmd BufWritePost $MYVIMRC source $MYVIMRC 8 autocmd BufWritePost $MYVIMRC source $MYVIMRC
9augroup END " } 9augroup END " }
10 10
11let mapleader=" " 11let mapleader=" "
@@ -14,9 +14,15 @@ syntax on
14filetype plugin indent on 14filetype plugin indent on
15 15
16" Set colorscheme when the terminal has 256 color support 16" Set colorscheme when the terminal has 256 color support
17if &t_Co == 256 17try
18 colorscheme Benokai 18 if (&t_Co == 256) && match($TERM, "256color") >= 0
19endif 19 colorscheme Benokai
20 else
21 throw "nocolor"
22 endif
23catch
24 colorscheme desert
25endtry
20 26
21" Some vim settings 27" Some vim settings
22set number 28set number
@@ -30,7 +36,6 @@ set listchars=trail:·,tab:▸\ ,eol:¬
30set scrolloff=1 36set scrolloff=1
31set backspace=indent,eol,start 37set backspace=indent,eol,start
32set cursorline 38set cursorline
33set cursorcolumn
34 39
35" Disable ex mode 40" Disable ex mode
36nnoremap Q <Nop> 41nnoremap Q <Nop>
@@ -56,30 +61,40 @@ noremap! <Right> <Esc>
56 61
57" Append modeline when pressing <leader> ml 62" Append modeline when pressing <leader> ml
58function! AppendModeline() 63function! AppendModeline()
59 let l:modeline = printf(" vim: set ts=%d sw=%d tw=%d %set :", 64 let l:modeline = printf(" vim: set ts=%d sw=%d tw=%d %set :",
60 \ &tabstop, &shiftwidth, &textwidth, &expandtab ? '' : 'no') 65 \ &tabstop, &shiftwidth, &textwidth, &expandtab ? '' : 'no')
61 let l:modeline = substitute(&commentstring, "%s", l:modeline, "") 66 let l:modeline = substitute(&commentstring, "%s", l:modeline, "")
62 call append(line("$"), l:modeline) 67 call append(line("$"), l:modeline)
63endfunction 68endfunction
64nnoremap <silent> <Leader>ml :call AppendModeline()<CR> 69nnoremap <silent> <Leader>ml :call AppendModeline()<CR>
65 70
71" NeoVIM specifics
72if has('nvim')
73 nmap <BS> <C-W>h
74 tnoremap <Esc> <C-\><C-n>
75endif
76
66""" PLUGIN SPECIFIC SETTINGS 77""" PLUGIN SPECIFIC SETTINGS
67 78
68" NERDTree: 79if exists("g:loaded_pathogen")
69" Open NERDTree when no file is specified 80
70autocmd StdinReadPre * let s:std_in=1 81 " NERDTree:
71autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif 82 " Open NERDTree when no file is specified
72autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif 83 autocmd StdinReadPre * let s:std_in=1
73 84 autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
74" Airline: 85 autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
75" On arch linux install the following: 86
76" otf-powerline-symbols-git 87 " Airline:
77" powerline-fonts-git 88 " On arch linux install the following:
78let g:airline_powerline_fonts = 1 89 " otf-powerline-symbols-git
79if !exists('g:airline_symbols') 90 " powerline-fonts-git
80 let g:airline_symbols = {} 91 let g:airline_powerline_fonts = 1
92 if !exists('g:airline_symbols')
93 let g:airline_symbols = {}
94 endif
95 let g:airline_symbols.space = "\ua0"
96 set laststatus=2
97
81endif 98endif
82let g:airline_symbols.space = "\ua0"
83set laststatus=2
84 99
85" vim: set ts=8 sw=8 tw=78 noet : 100" vim: set ts=4 sw=4 tw=4 et :