aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom van der Lee <t0m.vd.l33@gmail.com>2015-06-08 12:19:27 +0200
committerGravatar Tom van der Lee <t0m.vd.l33@gmail.com>2015-06-08 12:19:27 +0200
commitf000733bc67b92ff3b97a00ff85d9e8532350fd9 (patch)
tree6ae80ceca8baf2b1250c4dc3a2f8267ff87e5c14
parent40b8a2147e749d40755648c35f1a4d2ceb6dd2c7 (diff)
downloaddotfiles-f000733bc67b92ff3b97a00ff85d9e8532350fd9.tar.gz
dotfiles-f000733bc67b92ff3b97a00ff85d9e8532350fd9.tar.bz2
dotfiles-f000733bc67b92ff3b97a00ff85d9e8532350fd9.zip
Cleaned up vimrc
-rw-r--r--vim/.vimrc59
1 files changed, 35 insertions, 24 deletions
diff --git a/vim/.vimrc b/vim/.vimrc
index a8c93c5..97f6ee1 100644
--- a/vim/.vimrc
+++ b/vim/.vimrc
@@ -1,51 +1,34 @@
1execute pathogen#infect() 1execute pathogen#infect()
2 2
3""" DEFAULT VIM SETTINGS
4
3let mapleader=" " 5let mapleader=" "
4 6
5syntax on 7syntax on
6filetype plugin indent on 8filetype plugin indent on
7 9
10" Set colorscheme when the terminal has 256 color support
8if &t_Co == 256 11if &t_Co == 256
9 colorscheme Benokai 12 colorscheme Benokai
10endif 13endif
11 14
12" On arch linux install the following: 15" Some vim settings
13" otf-powerline-symbols-git 16set relativenumber
14" powerline-fonts-git
15let g:airline_powerline_fonts = 1
16if !exists('g:airline_symbols')
17 let g:airline_symbols = {}
18endif
19let g:airline_symbols.space = "\ua0"
20
21set number
22set hlsearch 17set hlsearch
23set list 18set list
24set modeline 19set modeline
25set relativenumber
26
27set background=dark 20set background=dark
28set foldmethod=indent 21set foldmethod=indent
29set listchars=trail:·,tab:▸\ ,eol:¬ 22set listchars=trail:·,tab:▸\ ,eol:¬
30set scrolloff=1 23set scrolloff=1
31 24
32autocmd StdinReadPre * let s:std_in=1 25" Switch windows with <C-W>[direction]
33autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
34autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
35
36function! AppendModeline()
37 let l:modeline = printf(" vim: set ts=%d sw=%d tw=%d %set :",
38 \ &tabstop, &shiftwidth, &textwidth, &expandtab ? '' : 'no')
39 let l:modeline = substitute(&commentstring, "%s", l:modeline, "")
40 call append(line("$"), l:modeline)
41endfunction
42nnoremap <silent> <Leader>ml :call AppendModeline()<CR>
43
44map <C-J> <C-W>j 26map <C-J> <C-W>j
45map <C-K> <C-W>k 27map <C-K> <C-W>k
46map <C-H> <C-W>h 28map <C-H> <C-W>h
47map <C-L> <C-W>l 29map <C-L> <C-W>l
48 30
31" Never use the arrow keys
49noremap <Up> "" 32noremap <Up> ""
50noremap! <Up> <Esc> 33noremap! <Up> <Esc>
51noremap <Down> "" 34noremap <Down> ""
@@ -55,4 +38,32 @@ noremap! <Left> <Esc>
55noremap <Right> "" 38noremap <Right> ""
56noremap! <Right> <Esc> 39noremap! <Right> <Esc>
57 40
41" Append modeline when pressing <leader> ml
42function! AppendModeline()
43 let l:modeline = printf(" vim: set ts=%d sw=%d tw=%d %set :",
44 \ &tabstop, &shiftwidth, &textwidth, &expandtab ? '' : 'no')
45 let l:modeline = substitute(&commentstring, "%s", l:modeline, "")
46 call append(line("$"), l:modeline)
47endfunction
48nnoremap <silent> <Leader>ml :call AppendModeline()<CR>
49
50""" PLUGIN SPECIFIC SETTINGS
51
52" NERDTree:
53" Open NERDTree when no file is specified
54autocmd StdinReadPre * let s:std_in=1
55autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
56autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
57
58" Airline:
59" On arch linux install the following:
60" otf-powerline-symbols-git
61" powerline-fonts-git
62let g:airline_powerline_fonts = 1
63if !exists('g:airline_symbols')
64 let g:airline_symbols = {}
65endif
66let g:airline_symbols.space = "\ua0"
67set laststatus=2
68
58" vim: set ts=8 sw=8 tw=78 noet : 69" vim: set ts=8 sw=8 tw=78 noet :