-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.vimrc.common
256 lines (211 loc) · 7.85 KB
/
.vimrc.common
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
" Force 256 color terminal
set term=xterm-256color
set t_Co=256
colorscheme mustang
filetype plugin indent on "enable loading plugins for filetype
syntax on "enable syntax-hiliting
set iskeyword=@,48-57,_,192-255
set history=1000
set shortmess=aoOtTI
set updatetime=500
set undofile
set undodir=~/.vim/undodir
set mouse=a
set number "show linenumbers
set ruler " Show the line and column number of the cursor position, separated by a comma . Needed by the status-line
set cmdheight=2 " Command-space is 2 lines so tab-completion doesn't always jump around
set laststatus=2 " The last active window will be marked specially, even if there only exists one window
set scrolloff=3 " Minimal number of screen lines to keep above and below the cursor.
set showcmd " Show (partial) command in the last line of the screen
set incsearch " Incremental search - While typing a search command, show where the pattern, as it was typed so far, matches.
set ignorecase " Gross/Kleinschreibung ignorieren
set smartcase " Gross/Kleinschreibung nicht mehr ignorieren, sobald Grossbuchstaben vorkommen
set hlsearch " Highlight search matches
set visualbell " Flash the screen instead of beeping
set showmode " Show the current mode vim is in
set expandtab
set shiftwidth=2
set tabstop=2
set smarttab
set backspace=indent,eol,start " Allows backspace - over autoindent - over line breaks (join lines)- over the start of insert
set esckeys " Function keys that start with an <Esc> are recognized in Insert mode
" 'smarttab' 'sta' When on, a <Tab> in front of a line inserts blanks according to 'shiftwidth'. 'tabstop' or 'softtabstop' is used in other places.
" A <BS> will delete a 'shiftwidth' worth of space at the start of the line.
set smarttab
set autoindent " Autoindent
set expandtab " Expand tabs to spaces
set showfulltag " When completing a word in insert mode (see ins-completion) from the tags file, show both the tag name and a tidied-up form of the search pattern (if there is one) as possible matches.
set noequalalways " Disabled setting high to equal for all remaining buffers after closing a buffer
" Cygwin rxvt vertausc gerne CTRL+Backspace...
if &term == 'rxvt'
map! <C-?> <C-H>
map <C-?> <C-H>
endif
" autofix the common q: misstype
map q: :q
" delete words backward in insert modus
imap <C-?> <C-W>
" search with *( or # and then press M to replace the searched query
nmap <expr> M ':%s/' . @/ . '//g<LEFT><LEFT>'
vmap <expr> M ':s/' . @/ . '//g<LEFT><LEFT>'
" Some terminals bind the keypad-return to ^[OM instead of ^M
noremap OM <CR>
nnoremap OM <CR>
vnoremap OM <CR>
onoremap OM <CR>
inoremap OM <CR>
lnoremap OM <CR>
cnoremap OM <CR>
" disable 'Entering Ex mode' in Vim
map Q <Nop>
" insert modus c$
inoremap [3;5~ <C-O>c$
" Terminal-tweaks, don't remember which one is for which
noremap [1^ <C-Home>
noremap [4^ <C-End>
inoremap [1^ <C-Home>
inoremap [4^ <C-End>
noremap Oc <C-Right>
noremap Od <C-Left>
inoremap Oc <C-Right>
inoremap Od <C-Left>
noremap [1;5H <C-Home>
noremap [1;5F <C-End>
inoremap [1;5H <C-Home>
inoremap [1;5F <C-End>
nnoremap [1;3D <C-w>-
nnoremap [1;3C <C-w>+
inoremap O5C <C-Right>
inoremap [1;5C <C-Right>
inoremap O5D <C-Left>
inoremap [1;5D <C-Left>
noremap O5C <C-Right>
noremap [1;5C <C-Right>
noremap O5D <C-Left>
noremap [1;5D <C-Left>
" Tab goes down one window in normal mode
nnoremap <Tab> <C-w>w
" Shift+Tab goes up one window in normal mode
nnoremap <S-Tab> <C-w>W
" ` merkt sich Spalte und Zeile, ' nur Zeile
nnoremap ' `
nnoremap ` '
" swap * and g*
nnoremap * g*
nnoremap g* /\<<C-R>=expand('<cword>')<CR>\><CR>
" Same for different terminals?
noremap OÁ <C-w><up>
noremap OÂ <C-w><down>
noremap [1;3A <C-w><up>
noremap [1;3B <C-w><down>
" Make up/down-keys go up a visual line and not a code line
map <silent> OB gj
map <silent> OA gk
" Highlight spaces at the end of the line
highlight WhitespaceEOL ctermbg=red guibg=red
match WhitespaceEOL /\s\+$/
" Tabs sollen speziell markiert werden, da wir tabs im Quellcode nicht nutzen
syn match Tab " "
hi def Tab ctermbg=Blue
" Keep the selection when usinf < and >
vnoremap < <gv
vnoremap > >gv
" gp selektiert den soeben gepasteten Text
nnoremap gp `[v`]
" highlighting for bracket-matches
hi ShowPairsHL ctermbg=red ctermfg=white gui=bold guibg=#ffa000
hi ShowPairsHLPair ctermbg=red ctermfg=white gui=bold guibg=#ffa000 guifg=#ff0000
noremap <C-c> :call NERDComment(0, "toggle")<CR>
vnoremap <C-c> :call NERDComment(0, "toggle")<CR>gv
" Fenster sollen (bis auf die Statuszeile) unsichtbar gemacht werden koennen
set winminheight=0
" Statusline
if has("statusline")
set statusline=%<%f\ %h%m%r%=%{\"[\".(&fenc==\"\"?&enc:&fenc).((exists(\"+bomb\")\ &&\ &bomb)?\",B\":\"\").\"]\ \"}%k\ %-14.(%l,%c%V%)\ %P
endif
" Welche Marks sollen angezeigt werden. Ein paar automatische will ich nicht sehen. Wird von DoShowMarks benutzt
let g:showmarks_marks='abcdefghijklmnopqrstuvwxy'.'ABCDEFGHIJKLMNOPQRSTUVWXY'
" Aktiviert die visuelle Darstellung von marks
au BufRead * DoShowMarks!
" gundo
let g:gundo_map_move_older = "^[OB"
let g:gundo_map_move_newer = "^[OA"
let g:gundo_preview_bottom = 1
nnoremap <F10> :GundoToggle<CR>
" Tab-Completing-Settings
set wildmenu
set wildmode=list:longest,full
"set completeopt=menu,longest
let g:SuperTabLongestHighlight = 1
let g:SuperTabDefaultCompletionType = "context"
let g:SuperTabContextDefaultCompletionType = "<c-x><c-u>"
let g:SuperTabClosePreviewOnPopupClose = 1
autocmd FileType *
\if &omnifunc != '' |
\call SuperTabChain(&omnifunc, "<c-p>") |
\call SuperTabSetDefaultCompletionType("<c-x><c-u>") |
\endif
let g:EclimTempFilesEnable = 1
let g:EclimFileTypeValidate = 0
" This rewires n and N to do the highlighing...
nnoremap <silent> n n:call HLNext(0.4)<cr>
nnoremap <silent> N N:call HLNext(0.4)<cr>
" highlight the match in white on red...
function! HLNext (blinktime)
highlight WhiteOnRed ctermfg=white ctermbg=red
let [bufnum, lnum, col, off] = getpos('.')
let matchlen = strlen(matchstr(strpart(getline('.'),col-1),@/))
let target_pat = '\c\%#'.@/
let ring = matchadd('WhiteOnRed', target_pat, 101)
redraw
endfunction
" ctags stuff
if !exists('*UpdateCtags')
function! UpdateCtags()
call system("~/.vim/createTags.pl ".expand('%p'))
cs reset
endfunction
endif
"au BufWriteCmd *.php call UpdateCtags()
au BufNewFile,BufRead *.html set filetype=smarty
au BufNewFile,BufRead *.pgsql set filetype=sql
let g:gutentags_exclude = ['*.html', '*.js', '*.xml', '*.txt', '*.pdf', '*.log', '/cache/', '.git', 'cache', 'server/interface']
"let g:gutentags_ctags_executable = "/usr/local/bin/phpctags"
let g:gutentags_project_root = ['.project', '.gitignore']
" ctrlp plugin config
let g:ctrlp_cmd = 'CtrlPMixed'
let g:ctrlp_extensions = ['tag', 'buffertag']
"let g:ctrlp_user_command = 'ag %s -i --nocolor --nogroup --hidden
"\ --ignore .git
"\ --ignore .CVS
"\ --ignore .svn
"\ --ignore .hg
"\ --ignore .DS_Store
"\ --ignore tags
"\ --ignore "**/*.pyc"
"\ --ignore "**/*.log"
"\ --ignore "**/*.keepme"
"\ --ignore "**/*.pdf"
"\ -g ""'
" dragvisuals
let g:DVB_TrimWS = 1
vmap <expr> <C-LEFT> DVB_Drag('left')
vmap <expr> <C-RIGHT> DVB_Drag('right')
vmap <expr> <C-DOWN> DVB_Drag('down')
vmap <expr> <C-UP> DVB_Drag('up')
" DF-Translation Plugin config
nmap <C-K> :call EditTranslation()<CR>
nmap K :call EditTranslation()<CR>
" UltiSnips Config
imap <C-@> <C-Space>
let g:UltiSnipsJumpForwardTrigger="<C-Space>"
let g:pdv_template_dir = $HOME ."/.vim/templates"
autocmd FileType php nnoremap <buffer> <C-d> :call pdv#DocumentCurrentLine()<CR>a
autocmd FileType php inoremap <buffer> <C-d> <C-o>:call pdv#DocumentCurrentLine()<CR>
let g:airline_powerline_fonts=1
"let g:airline_theme='papercolor'
"let g:airline_theme=''
let g:airline#extensions#syntastic#enabled = 1
let g:airline#extensions#tagbar#enabled = 1
let g:tagbar_autofocus = 1
map <C-N> :NERDTreeToggle<CR>