aboutsummaryrefslogtreecommitdiff
path: root/vimrc
diff options
context:
space:
mode:
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc108
1 files changed, 57 insertions, 51 deletions
diff --git a/vimrc b/vimrc
index 4090dad..7a0910f 100644
--- a/vimrc
+++ b/vimrc
@@ -7,40 +7,37 @@ call vundle#begin('~/.vim/plugins/')
7 7
8" Plugin dependant configurations... 8" Plugin dependant configurations...
9Plugin 'VundleVim/Vundle.vim' 9Plugin 'VundleVim/Vundle.vim'
10Plugin 'cscope_plus.vim' " run cscope -R -b in project folder then use 10Plugin 'cscope_plus.vim' | " run cscope -R -b in project folder then use
11Plugin 'autoload_cscope.vim' " CTRL+\ s searches word under cursor, CTRL+T back 11Plugin 'autoload_cscope.vim' | " CTRL+\ s searches word under cursor, CTRL+T back
12Plugin 'tpope/vim-fugitive' " the most complete GIT integration plugin 12Plugin 'tpope/vim-fugitive' | " the most complete GIT integration plugin
13Plugin 'taglist-plus' " quick code navigator 13Plugin 'taglist-plus' | " quick code navigator
14let Tlist_Compact_Format = 1 14let Tlist_Compact_Format = 1 | "
15let Tlist_GainFocus_On_ToggleOpen = 1 15let Tlist_GainFocus_On_ToggleOpen = 1 | "
16let Tlist_Close_On_Select = 1 16let Tlist_Close_On_Select = 1 | "
17Plugin 'Valloric/YouCompleteMe' | " syntax checker and code completion 17Plugin 'Valloric/YouCompleteMe' | " syntax checker and code completion
18let g:ycm_global_ycm_extra_conf = '' | " fallback, right one should be in the applications path 18let g:ycm_global_ycm_extra_conf = '' | " fallback, right one should be in the applications path
19let g:ycm_confirm_extra_conf = 0 | " disable 'do you really want to execute .py?' 19let g:ycm_confirm_extra_conf = 0 | " disable 'do you really want to execute .py?'
20let g:ycm_key_select_completion = '<Tab>' | " key completion key 20let g:ycm_key_select_completion = '<Tab>' | " key completion key
21let g:ycm_error_symbol = '✖' | " insert this as an error symbol in the gutter bar 21let g:ycm_error_symbol = '✖' | " insert this as an error symbol in the gutter bar
22let g:ycm_warning_symbol = '➔' | " insert this as a warning symbol in the gutter bar 22let g:ycm_warning_symbol = '➔' | " insert this as a warning symbol in the gutter bar
23let g:ycm_collect_identifiers_from_tags_files = 1 | " 23let g:ycm_collect_identifiers_from_tags_files = 1 | "
24let g:ycm_autoclose_preview_window_after_insertion=1 | " close the window when leaving insert mode 24let g:ycm_autoclose_preview_window_after_insertion=1 | " close the window when leaving insert mode
25inoremap <buffer> ( <C-X><C-o>( 25"let g:ycm_semantic_triggers = {'c' : ['(', ',']} | " add additional triggers (not recommend)
26"if !exists("g:ycm_semantic_triggers") 26
27" let g:ycm_semantic_triggers = {} 27let b:html_omni_flavor='xhtml' | " prever xhtml over html because that makes inline php code possible without hassle
28"endif
29"let g:ycm_semantic_triggers['c'] = ['('] | "
30
31 28
32call vundle#end() | " required 29call vundle#end() | " required
33filetype plugin indent on | " required 30filetype plugin indent on | " required
34
35"================================================================================ 31"================================================================================
36" custom config 32" custom config
33scriptencoding utf-8 | " tell vim that we are using utf-8 here
37 34
38set noswapfile | " noundofile, nobackup, nowritebackup 35set noswapfile | " noundofile, nobackup, nowritebackup
39set backupdir=~/.vim/temp | " using :set backup will copy current file to this directory 36set backupdir=~/.vim/temp | " using :set backup will copy current file to this directory
40set directory=~/.vim/temp | " 37set directory=~/.vim/temp | "
41set undodir=~/.vim/temp | " 38set undodir=~/.vim/temp | "
42 39
43set ts=2 sts=2 sw=2 expandtab | " indentation which i like 40set ts=2 sts=2 sw=2 expandtab | " indentation which i like (abbr: tabstop, softtabstop, shiftwidth)
44set autoindent | " always set autoindenting on 41set autoindent | " always set autoindenting on
45set copyindent | " copy the previous indentation on autoindenting 42set copyindent | " copy the previous indentation on autoindenting
46set scrolloff=2 | " always keeps at least two lines visible (when seeking) 43set scrolloff=2 | " always keeps at least two lines visible (when seeking)
@@ -51,15 +48,24 @@ set whichwrap=b,s,<,>,[,] | " beyond beginning/end line causes cusor to wrap
51set backspace=indent,eol,start| " allow backspacing over everything in insert mode, not needed with whichwrap 48set backspace=indent,eol,start| " allow backspacing over everything in insert mode, not needed with whichwrap
52set diffopt+=iwhite,filler | " lets diff ignore white spaces 49set diffopt+=iwhite,filler | " lets diff ignore white spaces
53set spell| set spelllang=en,de| " enable spell checker 50set spell| set spelllang=en,de| " enable spell checker
54set showcmd | " displays status line messages while selecting (matrix size) 51set virtualedit=onemore " one character beyond the line length should be navigatable (options: all,insert,block,onemore)
55set breakindent cpoptions+=n | " when wrapping lines indent wrapped line to align with the previews 52set breakindent cpoptions+=n | " when wrapping lines indent wrapped line to align with the previews
56set linebreak | " do not wrap in the middle of words 53set linebreak | " do not wrap in the middle of words
57set showbreak=› | " symbol used in the beginning of a wrapped line 54set showcmd | " displays status line messages while selecting (matrix size)
58set listchars=tab:▸\ ,eol:¬ | " symbols used when using :set list (which displays non-printable chars) 55set nofoldenable | " do not fold code automatically
56set tags+=~/.vim/systags | " ctags -R -f ~/.vim/systags /usr/include /usr/local/include
59 57
58set encoding=utf-8 | " we need default utf-8 encoding to use cool chars as line break and so on (see below)
59set showbreak+=› | " symbol used in the beginning of a wrapped line
60set listchars=eol:↲ | " symbols used when using :set list (which displays non-printable chars)
61set listchars+=trail:· | " symbols used when using :set list (which displays non-printable chars)
62set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars)
63set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars)
64set listchars+=tab:▸\ | " symbols used when using :set list (which displays non-printable chars)
60 65
61set virtualedit=onemore " one character beyond the line length should be navigatable (options: all,insert,block,onemore) 66
62nnoremap <End> g$| " and make the <End> key position the cursor after the last char of that line:w 67nnoremap $ g$| " and make the $ key position the cursor after the last char of that line, not before
68nnoremap <End> g$| " and make the <End> key position the cursor after the last char of that line
63 69
64" search... 70" search...
65set ignorecase|set smartcase " if search pattern contains uppercase then search is case sensitive 71set ignorecase|set smartcase " if search pattern contains uppercase then search is case sensitive
@@ -74,7 +80,7 @@ if has("autocmd")
74 set modeline " set variables specific to a file, like indentation by adding a comment 80 set modeline " set variables specific to a file, like indentation by adding a comment
75 set modelines=3 " how many lines in the beginning and end of the file can be mode lines? 81 set modelines=3 " how many lines in the beginning and end of the file can be mode lines?
76 82
77 83
78 augroup resCur | " make cursor appear in its previous position when reopening a file... 84 augroup resCur | " make cursor appear in its previous position when reopening a file...
79 "autocmd! 85 "autocmd!
80 autocmd BufReadPost * call setpos(".", getpos("'\"")) 86 autocmd BufReadPost * call setpos(".", getpos("'\""))
@@ -121,6 +127,7 @@ if has("gui_running")
121 set guioptions+=e " add tab pages 127 set guioptions+=e " add tab pages
122 set guioptions+=p " use gui pointer callback for x11 128 set guioptions+=p " use gui pointer callback for x11
123 set toolbariconsize=large " make the icon toolbar as big as possible 129 set toolbariconsize=large " make the icon toolbar as big as possible
130
124else 131else
125 if &term =~? 'mlterm\|xterm\|screen' 132 if &term =~? 'mlterm\|xterm\|screen'
126 set t_Co=256 | " fixes incompatibilities with our color scheme 133 set t_Co=256 | " fixes incompatibilities with our color scheme
@@ -136,30 +143,34 @@ colorscheme coderonline
136syntax enable 143syntax enable
137 144
138"================================================================================ 145"================================================================================
139" plugin hotkeys 146" custom commands...
140nnoremap <C-l> :TlistToggle<CR>| " bind TagList to Hotkey Ctrl+L 147map <C-h> <C-w>h|map <C-j> <C-w>j| " window navigation shortcuts
148map <C-k> <C-w>k|map <C-l> <C-w>l| " window navigation shortcuts
141 149
142" code completion: http://vim.wikia.com/wiki/Make_Vim_completion_popup_menu_work_just_like_in_an_IDE 150cmap w!! w !sudo tee % >/dev/null| " write :w!! to execute :w as root user
143" reacts on CTRL+P, CTRL+Space
144inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
145inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
146inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
147inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
148inoremap <expr> <PageDown> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<PageDown>"
149inoremap <expr> <PageUp> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<PageUp>"
150 151
151" custom commands... 152" custom hotkeys...
152cmap w!! w !sudo tee % >/dev/null| " write :w!! to execute :w as root user 153nnoremap <C-Tab> :tabnext<CR>| " lets one use CTRL+Tab to switch between tabs
154nnoremap <C-S-Tab> :tabprevious<CR>| " use CTRL+Shift+Tab to switch to preview tab
155
156nnoremap j gj|nnoremap k gk| " do not jump over wrapped lines
153 157
154" custom hotkeys... 158" plugin hotkeys
155nnoremap <C-Tab> :tabnext<CR>| " lets one use CTRL+Tab to switch between tabs 159map <C-l> :TlistToggle<CR>| " bind TagList to Hotkey Ctrl+L
156nnoremap <C-S-Tab> :tabprevious<CR>| " use CTRL+Shift+Tab to switch to preview tab 160inoremap <buffer> ( <C-X><C-o><C-p>(| " when opening a bracket: call the OmniComplete function, display the menu, but deselect the first entry (C-p)
157nnoremap j gj|nnoremap k gk| " do not jump over wrapped lines...
158map <C-h> <C-w>h|map <C-j> <C-w>j|map <C-k> <C-w>k|map <C-l> <C-w>l| " window navigation shortcut
159 161
160 162
161"================================================================================ 163"================================================================================
162" deactivated on-demand commands (just in case one needs them one day) 164" deactivated on-demand commands (just in case one needs them one day)
165"
166" code completion: http://vim.wikia.com/wiki/Make_Vim_completion_popup_menu_work_just_like_in_an_IDE
167" reacts on CTRL+P, CTRL+Space
168"inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
169"inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
170"inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
171"inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
172"inoremap <expr> <PageDown> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<PageDown>"
173"inoremap <expr> <PageUp> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<PageUp>"
163" set guiheadroom=0| " do not fill non-functional area of the empty editor with gtk background 174" set guiheadroom=0| " do not fill non-functional area of the empty editor with gtk background
164" map shift-right to visually select and so on 175" map shift-right to visually select and so on
165"nnoremap <C-Right> El 176"nnoremap <C-Right> El
@@ -176,12 +187,7 @@ map <C-h> <C-w>h|map <C-j> <C-w>j|map <C-k> <C-w>k|map <C-l> <C-w>l| " window na
176"nnoremap <C-S-Tab> <C-PageUp> 187"nnoremap <C-S-Tab> <C-PageUp>
177":inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>" 188":inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
178"map <Esc>OA k|map <Esc>OB j|map <Esc>OC l|map <Esc>OD h| " allow cursor keys in insert mode 189"map <Esc>OA k|map <Esc>OB j|map <Esc>OC l|map <Esc>OD h| " allow cursor keys in insert mode
179"
180"inoremap <expr> <Esc> pumvisible() ? "\<C-e>" : "\<Esc>" " breaks cursor keys! 190"inoremap <expr> <Esc> pumvisible() ? "\<C-e>" : "\<Esc>" " breaks cursor keys!
181" binding ESC can easily break cursor key movement on the console (tricky, because gvim works) 191" binding ESC can easily break cursor key movement on the console (tricky, because gvim works)
182"
183"
184"
185
186"inoremap <C-Space> <C-x><C-o> 192"inoremap <C-Space> <C-x><C-o>
187"inoremap <C-@> <C-Space> 193"inoremap <C-@> <C-Space>
..