aboutsummaryrefslogtreecommitdiff
path: root/vimrc
diff options
context:
space:
mode:
authorMax Christian Pohle2016-05-24 14:14:54 +0200
committerMax Christian Pohle2016-05-24 14:14:54 +0200
commitfe89b5671d65560b57d51485789c23c38885e28d (patch)
treed2483b2b4d80631411fc54ab55609073085c8742 /vimrc
parent4c27c4e8a5d281427bc69fe442ea0f35bd4a53f9 (diff)
downloadvim-karlmarks-fe89b5671d65560b57d51485789c23c38885e28d.tar.bz2
vim-karlmarks-fe89b5671d65560b57d51485789c23c38885e28d.zip
major update: plugins, colorscheme, shortcuts, new git submodule!
* using nelstroms mac color scheme * 'fixed' some keyboard shortcuts to behave more like in other editors * added some plugins
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc81
1 files changed, 66 insertions, 15 deletions
diff --git a/vimrc b/vimrc
index e57b242..2443738 100644
--- a/vimrc
+++ b/vimrc
@@ -7,22 +7,30 @@ set rtp+=~/.vim/bundle/Vundle.vim | " set runtimepath (requir
7call vundle#begin('~/.vim/bundle/') | " location where Vundle searches&installs plugins 7call vundle#begin('~/.vim/bundle/') | " location where Vundle searches&installs plugins
8 8
9" Plugin dependant configurations... 9" Plugin dependant configurations...
10Plugin 'VundleVim/Vundle.vim' | " Vundle itself (required) 10Plugin 'Valloric/YouCompleteMe' | " syntax checker and code completion
11Plugin 'cscope_plus.vim' | " run cscope -R -b in project folder then use 11Plugin 'cscope_plus.vim' | " run cscope -R -b in project folder then use
12Plugin 'autoload_cscope.vim' | " CTRL+\ s searches word under cursor, CTRL+T back 12Plugin 'autoload_cscope.vim' | " CTRL+\ s searches word under cursor, CTRL+T back
13Plugin 'tpope/vim-fugitive' | " the most complete GIT integration plugin 13Plugin 'tpope/vim-fugitive' | " the most complete GIT integration plugin
14Plugin 'jeaye/color_coded' | " semantic highlighting with vim 14Plugin 'jeaye/color_coded' | " semantic highlighting with vim
15Plugin 'terryma/vim-multiple-cursors' | " displays visual block mode as cursors 15Plugin 'terryma/vim-multiple-cursors' | " displays visual block mode as cursors
16
17Plugin 'taglist-plus' | " quick code navigator 16Plugin 'taglist-plus' | " quick code navigator
18Plugin 'jdonaldson/vaxe' | " code completion for haxe 17Plugin 'jdonaldson/vaxe' | " code completion for haxe
19Plugin 'sheerun/vim-polyglot' | " better syntax highlighting/indentation for multiple languages 18Plugin 'sheerun/vim-polyglot' | " better syntax highlighting/indentation for multiple languages
20Plugin 'loremipsum' | " Sample text generator 19Plugin 'loremipsum' | " Sample text generator
20Plugin 'vim-airline/vim-airline' | " beautification of the mode line
21Plugin 'nathanaelkane/vim-indent-guides' | " shows indentation guidelines by pressing <leader>ig
22Plugin 'gregsexton/matchtag' | " highlights closing ML tags like braces
23Plugin 'indenthtml.vim' | " works better with mixed html/css/javascript
24Plugin 'easymotion/vim-easymotion' | " speed up navigation: try \\w or \\f, then one of the highlighted chars
25Plugin 'tpope/vim-surround' | " plugin makes cs"' inside a line replace " with '
26
27
28
21let Tlist_Compact_Format = 1 | " 29let Tlist_Compact_Format = 1 | "
22let Tlist_GainFocus_On_ToggleOpen = 1 | " 30let Tlist_GainFocus_On_ToggleOpen = 1 | "
23let Tlist_Close_On_Select = 1 | " 31let Tlist_Close_On_Select = 1 | "
24 32
25Plugin 'Valloric/YouCompleteMe' | " syntax checker and code completion 33Plugin 'VundleVim/Vundle.vim' | " Vundle itself (required)
26let g:ycm_global_ycm_extra_conf = '~/.vim/ycm_extra_conf.py' | " fallback, right one should be in the applications path 34let g:ycm_global_ycm_extra_conf = '~/.vim/ycm_extra_conf.py' | " fallback, right one should be in the applications path
27let g:ycm_confirm_extra_conf = 0 | " disable 'do you really want to execute .py?' 35let g:ycm_confirm_extra_conf = 0 | " disable 'do you really want to execute .py?'
28let g:ycm_key_select_completion = '<Tab>' | " key completion key 36let g:ycm_key_select_completion = '<Tab>' | " key completion key
@@ -34,12 +42,27 @@ let g:ycm_autoclose_preview_window_after_insertion=1 | " close the window when
34 42
35let b:html_omni_flavor='xhtml' | " prever xhtml over html because that makes inline php code possible without hassle 43let b:html_omni_flavor='xhtml' | " prever xhtml over html because that makes inline php code possible without hassle
36let html_use_css = 1 | " when using :TOhtml no font-tags will be used, but proper css 44let html_use_css = 1 | " when using :TOhtml no font-tags will be used, but proper css
45let g:vim_markdown_folding_disabled=1 | " disable code folding with vimdiff (also see set nofoldenable)
46
47let g:netrw_liststyle=3 | " Explore mode: 3 shows a complete tree instead of the current directory
48let g:netrw_list_hide='^\..*' | " Explore mode: hide files starting with dot
49
50
51" speed up CTRL-P Menu...
52let g:ctrlp_user_command = 'ag %s -i --nocolor --nogroup --hidden
53 \ --ignore .git
54 \ --ignore .svn
55 \ --ignore .hg
56 \ --ignore .DS_Store
57 \ --ignore "**/*.pyc"
58 \ -g ""'
37 59
38call vundle#end() | " required by Vundle 60call vundle#end() | " required by Vundle
39filetype plugin indent on | " required by Vundle 61filetype plugin indent on | " required by Vundle
40"================================================================================ 62"================================================================================
41" custom config 63" custom config
42colorscheme coderonline 64colorscheme mac_classic
65" colorscheme coderonline
43syntax enable 66syntax enable
44 67
45set noswapfile | " noundofile, nobackup, nowritebackup 68set noswapfile | " noundofile, nobackup, nowritebackup
@@ -57,7 +80,7 @@ set selection=exclusive | " includes last character of the selection into
57 80
58set whichwrap=b,s,<,>,[,] | " beyond beginning/end line causes cusor to wrap 81set whichwrap=b,s,<,>,[,] | " beyond beginning/end line causes cusor to wrap
59set backspace=indent,eol,start| " allow backspacing over everything in insert mode, not needed with whichwrap 82set backspace=indent,eol,start| " allow backspacing over everything in insert mode, not needed with whichwrap
60set diffopt+=iwhite,filler | " lets diff ignore white spaces 83set diffopt+=vertical,iwhite,filler | " lets diff ignore white spaces
61set spell spelllang=en,de | " enable spell checker 84set spell spelllang=en,de | " enable spell checker
62set virtualedit=onemore | " one character beyond the line length should be navigatable (options: all,insert,block,onemore) 85set virtualedit=onemore | " one character beyond the line length should be navigatable (options: all,insert,block,onemore)
63set breakindent cpoptions+=n | " when wrapping lines indent wrapped line to align with the previews 86set breakindent cpoptions+=n | " when wrapping lines indent wrapped line to align with the previews
@@ -66,6 +89,7 @@ set showcmd | " displays status line messages while selecting
66set nofoldenable | " do not fold code automatically 89set nofoldenable | " do not fold code automatically
67set tags+=~/.vim/systags | " ctags -R -f ~/.vim/systags /usr/include /usr/local/include 90set tags+=~/.vim/systags | " ctags -R -f ~/.vim/systags /usr/include /usr/local/include
68set wildmenu wildmode=full | " wildmenu code completion 91set wildmenu wildmode=full | " wildmenu code completion
92set guifont="Droid Sans Mono for Powerline 10"
69 93
70" search... 94" search...
71set ignorecase smartcase | " if search pattern contains uppercase then search is case sensitive 95set ignorecase smartcase | " if search pattern contains uppercase then search is case sensitive
@@ -76,6 +100,10 @@ set novisualbell | " don't beep
76set noerrorbells | " don't beep 100set noerrorbells | " don't beep
77set clipboard=unnamedplus | " makes copy and paste work (autoselectplus might work as well) 101set clipboard=unnamedplus | " makes copy and paste work (autoselectplus might work as well)
78set number | " toggle line numbers 102set number | " toggle line numbers
103set formatprg=par | " set external formatting program to par, use gwip to format with this
104set laststatus=2 | " this is required for airline
105set cmdheight=1 | " controls how many lines the command line has
106set relativenumber | " displays current lines line no as zero point from where relative numbers are getting counted
79 107
80if has("multi_byte") 108if has("multi_byte")
81 set encoding=utf-8 | " we need default utf-8 encoding to use cool chars as line break and so on (see below) 109 set encoding=utf-8 | " we need default utf-8 encoding to use cool chars as line break and so on (see below)
@@ -108,6 +136,7 @@ if has("autocmd")
108 \ setlocal omnifunc=syntaxcomplete#Complete | 136 \ setlocal omnifunc=syntaxcomplete#Complete |
109 \ setlocal completeopt=longest,menuone | 137 \ setlocal completeopt=longest,menuone |
110 \ endif 138 \ endif
139 autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
111 endif 140 endif
112 augroup END 141 augroup END
113 142
@@ -158,6 +187,30 @@ endif
158 187
159"================================================================================ 188"================================================================================
160" custom commands... 189" custom commands...
190"
191" assign selection keys (these i missed a lot)
192nmap <S-Left> vh| " shift-left selects to the left
193xmap <S-Left> h| " ^^
194nmap <S-Right> vl| " shift-right selects to the right
195xmap <S-Right> l| " ^^
196nmap <S-Up> vk| " shift-up selects like other text editors
197xmap <S-Up> k| " ^^
198nmap <S-Down> vj| " shift down selects like other text editors
199xmap <S-Down> j| " ^^
200nmap <Home> ^| " default homing in code editors is the first letter of a line
201xmap <Home> 0| " go to the beginning of the line
202xmap <S-Home> 0| " ^^
203xmap <Tab> >gv| " indent lines (and retain selection)
204xmap <S-Tab> <gv| " unindent lines (and retain selection)
205nmap <S-PageUp> VH| " selects predessing paragraph
206nmap <S-PageDown> VL| " selects following paragraph
207nmap <C-S-PageUp> V{| " selects predessing paragraph
208nmap <C-S-PageDown> V}| " selects following paragraph
209
210
211
212
213
161map <C-h> <C-w>h|map <C-j> <C-w>j| " window navigation shortcuts 214map <C-h> <C-w>h|map <C-j> <C-w>j| " window navigation shortcuts
162map <C-k> <C-w>k|map <C-l> <C-w>l| " window navigation shortcuts 215map <C-k> <C-w>k|map <C-l> <C-w>l| " window navigation shortcuts
163 216
@@ -171,15 +224,14 @@ nnoremap j gj|nnoremap k gk| " do not jump over wrapped lines
171 224
172nnoremap $ g$| " and make the $ key position the cursor after the last char of that line, not before 225nnoremap $ g$| " and make the $ key position the cursor after the last char of that line, not before
173nnoremap <End> g$| " and make the <End> key position the cursor after the last char of that line 226nnoremap <End> g$| " and make the <End> key position the cursor after the last char of that line
174function ExtendedHome() 227" function ExtendedHome()
175 let column = col('.') 228" let column = col('.')
176 normal! ^ 229" normal! ^
177 if column == col('.') 230" if column == col('.')
178 normal! 0 231" normal! 0
179 endif 232" endif
180endfunction 233" endfunction
181noremap <Home> ^ 234" noremap <silent> <Home> :call ExtendedHome()<CR>
182noremap <silent> <Home> :call ExtendedHome()<CR>
183 235
184nnoremap <C-z> u 236nnoremap <C-z> u
185 237
@@ -198,7 +250,6 @@ inoremap <buffer> ( <C-X><C-o><C-p>(| " when opening a bracket: call the OmniCo
198set makeprg=make\ test 250set makeprg=make\ test
199nnoremap <F5> :!make<CR>| " classic key binding: press F5 to compile and execute (if you have a Makefile with make test doing that) 251nnoremap <F5> :!make<CR>| " classic key binding: press F5 to compile and execute (if you have a Makefile with make test doing that)
200 252
201
202"================================================================================ 253"================================================================================
203" deactivated on-demand commands (just in case one needs them one day) 254" deactivated on-demand commands (just in case one needs them one day)
204" 255"
..