aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Christian Pohle2015-07-26 18:17:27 +0200
committerMax Christian Pohle2015-07-26 18:23:27 +0200
commit5f3ccd0dcada92e2ab06fbf6215b3f5a1ee0ac34 (patch)
treea38a72a4f7f839cf843f83100ee642e7c20b6d62
downloadvim-karlmarks-5f3ccd0dcada92e2ab06fbf6215b3f5a1ee0ac34.tar.bz2
vim-karlmarks-5f3ccd0dcada92e2ab06fbf6215b3f5a1ee0ac34.zip
original configuration from monochrome with custom color-scheme maxvb6
-rw-r--r--.gitmodules3
l---------autoload/pathogen.vim1
-rw-r--r--colors/maxvb6.vim138
m---------vim-pathogen0
-rw-r--r--vimrc622
5 files changed, 764 insertions, 0 deletions
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..8d5d904
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
1[submodule "vim-pathogen"]
2 path = vim-pathogen
3 url = https://github.com/tpope/vim-pathogen.git
diff --git a/autoload/pathogen.vim b/autoload/pathogen.vim
new file mode 120000
index 0000000..9a7227e
--- /dev/null
+++ b/autoload/pathogen.vim
@@ -0,0 +1 @@
../vim-pathogen/autoload/pathogen.vim \ No newline at end of file
diff --git a/colors/maxvb6.vim b/colors/maxvb6.vim
new file mode 100644
index 0000000..98d149c
--- /dev/null
+++ b/colors/maxvb6.vim
@@ -0,0 +1,138 @@
1" color theme for vim
2" Maintainer: Max Christian Pohle <max@entwicklerseite.de>
3" Last Change: 11.09.2014
4" Web: http://max.entwicklerseite.de
5
6set background=dark
7hi clear
8if exists("syntax_on")
9 syntax reset
10endif
11let g:colors_name="maxvb6"
12
13
14"set guifont=Liberation\ Mono\ Normal\ 14
15set guifont=Meslo\ LG\ S\ DZ\ for\ Powerline\ 14
16
17
18set number
19set hls
20
21highlight Menu gui=none cterm=none term=none guibg=white ctermbg=white guifg=black ctermfg=black
22highlight Scrollbar gui=none cterm=none term=none guibg=white ctermbg=white guifg=black ctermfg=black
23highlight Tooltip gui=none cterm=none term=none guibg=yellow ctermbg=yellow guifg=black ctermfg=black
24
25highlight Normal gui=none cterm=none term=none guibg=white ctermbg=white guifg=black ctermfg=black
26highlight! link NonText Normal
27
28highlight Statement gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=#0000ff ctermfg=21
29highlight! link Boolean Statement
30highlight! link Identifier Statement
31
32highlight Type gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=DarkBlue ctermfg=darkblue
33
34highlight Constant gui=none cterm=none term=none guibg=white ctermbg=white guifg=brown ctermfg=brown
35highlight! link String Constant
36highlight! link Number Constant
37
38highlight Comment gui=none cterm=none term=none guibg=white ctermbg=white guifg=DarkGreen ctermfg=DarkGreen
39highlight! link PreProc Comment
40
41highlight StatusLine gui=bold cterm=bold term=bold guibg=lightgray ctermbg=lightgray guifg=darkgray ctermfg=darkgrey
42highlight! link StatusLineNC StatusLine
43
44highlight LineNr gui=none cterm=none term=none guibg=lightgray ctermbg=lightgray guifg=black ctermfg=black
45highlight CursorLine gui=none cterm=none term=none guibg=lightgray ctermbg=lightgray
46" highlight! link CursorLine LineNr
47" highlight! link CursorColumn LineNr
48" highlight! link ColorColumn LineNr
49
50" Cursor the character under the cursor
51highlight Cursor gui=inverse cterm=inverse term=inverse guibg=lightgray ctermbg=lightgray guifg=black ctermfg=black
52highlight iCursor gui=underline cterm=underline term=underline
53highlight! link CursorLineNr Cursor
54highlight! link CursorIM Cursor
55highlight! link Visual Cursor
56highlight! link VirualNOS Cursor
57" highlight! link MatchParen LineNr
58highlight MatchParen guibg=yellow ctermbg=yellow
59
60" WildMenu current match in 'wildmenu' completion
61" Pmenu Popup menu: normal item.
62" PmenuSel Popup menu: selected item.
63" PmenuSbar Popup menu: scrollbar.
64" PmenuThumb Popup menu: Thumb of the scrollbar.
65highlight! link WildMenu Todo
66highlight! link Popup LineNr
67highlight! link PMenu Popup
68highlight! link PMenuSel CursorLineNr
69highlight! link PMenuSbar CursorLineNr
70highlight! link PMenuThumb CursorLineNr
71
72
73" Windows
74highlight Title gui=bold cterm=bold term=bold guibg=lightgray ctermbg=lightgray guifg=darkgray ctermfg=darkgray
75highlight! link VertSplit Title
76highlight! link StatusLine Title
77highlight! link StatusLineNC Title
78highlight! link TabLine Title
79highlight! link TabLineFill TabLine
80highlight! link TabLineSel TabLine
81highlight TabLineSel gui=inverse cterm=inverse term=inverse
82
83highlight cParen gui=none cterm=none term=none guibg=white ctermbg=white guifg=orange ctermfg=brown
84highlight cBlock gui=none cterm=none term=none guibg=white ctermbg=cyan guifg=orange ctermfg=brown
85highlight vimParenSep gui=none cterm=none term=none guibg=white ctermbg=white guifg=orange ctermfg=brown
86
87highlight Special gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=black ctermfg=178
88highlight! link SpecialKey Special
89
90highlight Todo gui=none cterm=none term=none guibg=yellow ctermbg=yellow guifg=black ctermfg=black
91highlight! link ModeMsg Todo
92highlight! link MoreMsg Todo
93highlight! link ErrorMsg Todo
94highlight! link Conceal Todo
95highlight! link Directory Todo
96
97highlight Question gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=black ctermfg=black
98highlight! link WarningMsg Question
99
100highlight SpellBad gui=underline cterm=underline term=underline
101highlight! link SpellCap SpellBad
102highlight! link SpellLocal Todo
103highlight! link SpellRare Todo
104" *hl-Conceal*
105" *hl-DiffAdd*
106" DiffAdd diff mode: Added line |diff.txt|
107" *hl-DiffChange*
108" DiffChange diff mode: Changed line |diff.txt|
109" *hl-DiffDelete*
110" DiffDelete diff mode: Deleted line |diff.txt|
111" *hl-DiffText*
112" DiffText diff mode: Changed text within a changed line |diff.txt|
113" *hl-ErrorMsg*
114" Folded line used for closed folds
115" *hl-FoldColumn*
116" FoldColumn 'foldcolumn'
117" *hl-SignColumn*
118" SignColumn column where |signs| are displayed
119" *hl-IncSearch*
120" IncSearch 'incsearch' highlighting; also used for the text replaced with
121" ":s///c"
122" *hl-LineNr*
123" MatchParen The character under the cursor or just before it, if it
124" is a paired bracket, and its match. |pi_paren.txt|
125"
126" *hl-ModeMsg*
127" *hl-NonText*
128" *hl-Search*
129" Search Last search pattern highlighting (see 'hlsearch').
130" Also used for highlighting the current line in the quickfix
131" window and similar items that need to stand out.
132" *hl-SpecialKey*
133" to show unprintable characters in the text, 'listchars'.
134" Generally: text that is displayed differently from what it
135" really is.
136" *hl-SpellBad*
137
138
diff --git a/vim-pathogen b/vim-pathogen
new file mode 160000
Subproject b9fb0dfd811004010f5f6903edef42d6004ebea
diff --git a/vimrc b/vimrc
new file mode 100644
index 0000000..ea96df4
--- /dev/null
+++ b/vimrc
@@ -0,0 +1,622 @@
1call pathogen#infect()
2" Pathogen
3
4filetype plugin indent on
5set omnifunc=syntaxcomplete#Complete
6
7" conceal displays LaTeX formulars inline with UTF8
8set conceallevel=0 " 1,2 to enable it
9set concealcursor=
10
11set linebreak
12
13"set wrap
14set nowrap
15
16set noswapfile
17"set noundofile
18"set nobackup
19"set nowritebackup
20set backupdir=~/.vim/temp
21set directory=~/.vim/temp
22set undodir=~/.vim/temp
23
24" [code completion]
25set completeopt=longest,menuone
26
27" [spell checker]
28"set spell " enable spell checking
29set spelllang=en,de
30
31set guifont=DejaVu\ Sans\ Mono\ bold\ 11
32"set guifont=Liberation\ Mono\ for\ Powerline\ 11
33
34
35
36" [Kopieren und Einfuegen]
37" verwendet das x-window-clipboard <3
38set clipboard=unnamedplus
39"set clipboard=autoselectplus
40
41
42" [SUCHEN]
43" When 'ignorecase' and 'smartcase' are both on, if a pattern contains an uppercase letter, it is case sensitive, otherwise, it is not. For example, /The would find only "The", while /the would find "the" or "The" etc.
44set ignorecase
45set smartcase
46
47" [VIEW]
48syntax on
49
50
51" machen, dass der befehl wie z.B. " a p fuer register a
52set showcmd
53set number
54
55set guioptions+=m "show menu bar
56set guioptions-=T "remove toolbar
57set guioptions+=r "show right-hand scroll bar
58set guioptions-=c "use console dialogs instead of popups
59set guioptions+=a "autoselect: copy&paste using middleclick
60set guioptions+=e "add tab pages
61set guioptions+=p "use gui pointer callback for x11
62
63
64" ohne den naechsten eintrag verschwindet die powerline manchmal...
65set laststatus=2
66
67" set width for indentation
68"set tabstop=2
69"set softtabstop=2
70"set shiftwidth=2
71" replace tabstop by space
72"set expandtab
73
74" same in short...
75set ts=2 sts=2 sw=2 expandtab
76
77
78let $PAGER=''
79
80"set <S-Up>=^[[1;2A <S-Down>=^[[1;2B <S-Right>=^[[1;2C <S-Left>=^[[1;2D
81"set <F13>=^[[24~
82"map <F13> <S-Down>
83"nnoremap <F13> :test
84"set <F13>=^[9;0011
85" map <F13> <xF1>
86
87" q: ist der befehlseditor, damit kann man befehle kopieren in den textblock"
88" q/ ist die history fuer die letzten suchen
89"
90" au=auto command, vimenter=event, *=filetype, NERDTree=command
91" au vimenter * NERDTree
92
93"nnoremap <Tab> :tabnext
94"nnoremap <S-Tab> :tabpreviews
95
96"nnoremap <C-Tab> :bnext<CR>
97"nnoremap <C-S-Tab> :bprevious<CR>
98
99"nnoremap <C-Tab> <C-PageDown>
100"nnoremap <C-S-Tab> <C-PageUp>
101"
102nnoremap <C-Tab> :tabnext<CR>
103nnoremap <C-S-Tab> :tabprevious<CR>
104" do not display full path as tabname
105set guitablabel=%t
106
107"nnoremap <C-Tab> :bnext<CR>
108"nnoremap <C-S-Tab> :bprevious<CR>
109
110"nnoremap <C-Space> :call s:LaunchCompletion()
111"inoremap <C-space> <C-x><C-o><C-p>
112nnoremap <C-space> <C-n><C-n><C-p>
113"inoremap <C-Space> <C-x><C-o>
114inoremap <C-Space> <C-n>
115"inoremap <C-@> <C-Space>
116" open omni completion menu closing previous if open and opening new menu without changing the text
117"
118" simulate CTRL+C
119vnoremap <C-c> y
120"vnoremap <C-x> d
121"noremap <C-v> gP " interfers with VISUAL BLOCK mode
122
123" activate visual mode in normal mode
124"map <S-Up> V
125":map <S-Down> V
126" these are mapped in visual mode
127"map <S-Up> k
128"map <S-Down> j
129" increase/decrease indent in visual mode by tab and shift-tab
130vmap <Tab> >gv
131vmap <S-Tab> <gv
132
133" make arrow keys work in visual mode
134vmap <Esc>OA k
135vmap <Esc>OB j
136vmap <Esc>OC l
137vmap <Esc>OD h
138" map shift-right to visually select and so on
139nnoremap <C-Right> El
140nnoremap <S-Right> vl
141nnoremap <S-Left> vj
142nnoremap <S-Up> vk
143nnoremap <S-Down> vj
144
145" quickfix list (lists errors and warnings)
146" nnoremap <F5> :cw<CR>
147nnoremap <F5> :call ToggleQuickfixList()<CR>
148
149
150"nnoremap <Tab> :MBEbf<CR>
151"nnoremap <S-Tab> :MBEbb<CR>
152nnoremap <Tab> <C-w>w
153nnoremap <S-Tab> <C-w>W
154
155
156" nnoremap <C-w> :q<CR>
157noremap! <C-s> <ESC>:w<CR>
158
159"nnoremap <C-]> :PREVCOLOR<CR>
160nnoremap <C-K> :NEXTCOLOR<CR>
161
162
163nnoremap <Home> ^
164vmap <Home> ^
165
166nnoremap <End> $
167vmap <End> $
168
169nnoremap <Leader> \
170
171" nnoremap <C-o> :NERDTreeToggle<CR>
172nnoremap <C-o> :browse e<CR>
173let NERDTreeShowHidden=1
174let NERDTreeQuiToNopen=1
175let NERDChristmasTree=1
176let NERDTreeMinimalUI=1
177let NERDTreeWinSize = 40
178let NERDTreeMapToggleHidden='\h'
179
180" --------------------------------------------------------------------
181let g:airline_left_sep = 'â–¶'
182let g:airline_right_sep = 'â—€'
183"let g:airline_theme = 'powerlineish'
184"let g:airline_theme = 'tomorrow'
185let g:airline_theme = 'light'
186let g:airline_powerline_fonts = 1
187if !exists('g:airline_symbols')
188 let g:airline_symbols = {}
189endif
190let g:airline_symbols.space = "\ua0"
191
192
193let g:miniBufExplAutoStart = 1
194"let g:miniBufExplVSplit = 20 " column width in chars
195"let g:miniBufExplBRSplit = 1 " Put new window below
196let g:miniBufExplShowBufNumbers = 0
197let g:miniBufExplUseSingleClick = 1
198let g:miniBufExplCycleArround = 1
199 let g:miniBufExplMapWindowNavVim = 1
200 let g:miniBufExplMapWindowNavArrows = 1
201 let g:miniBufExplMapCTabSwitchBufs = 1
202 let g:miniBufExplModSelTarget = 1
203" MiniBufExpl Colors
204hi MBENormal guifg=fg guibg=bg
205hi MBEChanged guifg=red guibg=bg
206hi MBEVisibleNormal guifg=bg guibg=fg
207hi MBEVisibleChanged guifg=bg guibg=FG
208hi MBEVisibleActiveNormal guifg=bg guibg=fg
209hi MBEVisibleActiveChanged guifg=bg guibg=fg
210
211
212if v:version >= 700
213 au BufLeave * let b:winview = winsaveview()
214 au BufEnter * if(exists('b:winview')) | call winrestview(b:winview) | endif
215endif
216
217" function! PlaySound()
218" silent! exec '!play ~/.vim/support/tape.aiff &'
219" endfunction
220"autocmd CursorMovedI * call PlaySound()
221
222
223set nocompatible
224set modeline
225set modelines=3
226" vim: syntax=vim
227"
228"
229"
230" clang_autocomplete options
231
232
233let g:clang_use_library=1
234"let g:clang_library_path='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib'
235let g:clang_auto_select=0
236let g:clang_complete_auto=1 " automatically complete after ->, ., ::
237let g:clang_periodic_quickfix=1
238let g:clang_close_preview=1 " If equal to 1, the preview window will be close automatically after a completion
239"let g:clang_snippets=1
240"let g:clang_conceal_snippets=1
241"let g:clang_snippets_engine='clang_complete'
242"let g:clang_complete_macros=1
243"let g:clang_complete_patterns=1
244"let g:clang_close_preview=1
245
246" Show clang errors in the quickfix window
247"let g:clang_complete_copen = 1
248"
249"
250let g:clang_user_options='|| exit 0'
251let g:clang_sort_algo="alpha"
252
253
254
255" muss am ende stehen, macht das INSERT nicht angezeigt wird. macht ja airline
256" auch schon.
257set noshowmode " hide --INSERT-- from command line (as its already shown in airline)
258set cursorline " highlight currently selected line
259
260set wildmenu " displays command options in status line / airline when pressing TAB
261set wildmode=longest:full,full
262
263set scrolloff=2 " always keep at least two lines visible (when seeking)
264
265"noremap help vert help
266cabbrev help tab help
267"autocmd FileType help,* wincmd L
268
269"autocmd BufNew * if winnr('$') == 1 | tab sball | endif
270"autocmd BufReadPost * tab ball
271map ,e :e <C-R>=expand("%:p:h") . "/" <CR>
272
273" If wanted, auto commenting can be disabled for all files with:
274autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
275
276colorscheme maxvb6
277if has("gui_running")
278 "colorscheme Tomorrow-Night-Blue
279 "colorscheme bclear
280else
281 " use 256 colors in Console mode if we think the terminal supports it
282 if &term =~? 'mlterm\|xterm\|screen'
283 set t_Co=256
284 endif
285 "set t_Co=256
286 "set t_AB=^[[48;5;%dm
287 "set t_AF=^[[38;5;%dm
288 "set term=ansi
289 "colorscheme ibmedit
290 "colorscheme h80
291 "colorscheme greyhouse
292 "colorscheme tango-morning
293 "colorscheme jhlight
294 "colorscheme newspaper
295 "colorscheme relaxedgreen
296 let g:airline_theme = 'hybrid'
297 "highlight LineNr ctermfg=grey ctermbg=black
298endif
299
300
301" ex command for toggling hex mode - define mapping if desired
302command -bar Hexmode call ToggleHex()
303
304" helper function to toggle hex mode
305function ToggleHex()
306 " hex mode should be considered a read-only operation
307 " save values for modified and read-only for restoration later,
308 " and clear the read-only flag for now
309 let l:modified=&mod
310 let l:oldreadonly=&readonly
311 let &readonly=0
312 let l:oldmodifiable=&modifiable
313 let &modifiable=1
314 if !exists("b:editHex") || !b:editHex
315 " save old options
316 let b:oldft=&ft
317 let b:oldbin=&bin
318 " set new options
319 setlocal binary " make sure it overrides any textwidth, etc.
320 let &ft="xxd"
321 " set status
322 let b:editHex=1
323 " switch to hex editor
324 %!xxd
325 else
326 " restore old options
327 let &ft=b:oldft
328 if !b:oldbin
329 setlocal nobinary
330 endif
331 " set status
332 let b:editHex=0
333 " return to normal editing
334 %!xxd -r
335 endif
336 " restore values for modified and read only state
337 let &mod=l:modified
338 let &readonly=l:oldreadonly
339 let &modifiable=l:oldmodifiable
340endfunction
341
342
343" Show syntax highlighting groups for word under cursor
344map <C-S-P> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
345 \ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<"
346 \ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>
347
348
349" Append modeline after last line in buffer using \ml
350" Use substitute() instead of printf() to handle '%%s' modeline in LaTeX
351" files.
352function! AppendModeline()
353 let l:modeline = printf(" vim: set ts=%d sw=%d tw=%d %set :",
354 \ &tabstop, &shiftwidth, &textwidth, &expandtab ? '' : 'no')
355 let l:modeline = substitute(&commentstring, "%s", l:modeline, "")
356 call append(line("$"), l:modeline)
357endfunction
358nnoremap <silent> <Leader>ml :call AppendModeline()<CR>
359
360
361" make vimdiff ignore white spaces
362set diffopt+=iwhite
363set diffopt+=filler
364set diffexpr=""
365set nocompatible
366
367
368set diffopt+=iwhite
369
370
371set guicursor=n-v-c:ver30-Cursor-blinkon500-blinkoff500
372highlight Cursor guifg=black guibg=lightgreen
373
374
375
376set virtualedit=onemore
377" damit das highlight der klammern nicht genauso aussieht wie der cursor
378hi MatchParen cterm=none ctermbg=yellow ctermfg=yellow
379
380
381" An example for a vimrc file.
382"
383" Maintainer: Bram Moolenaar <Bram@vim.org>
384" Last change: 2014 Nov 05
385"
386" To use it, copy it to
387" for Unix and OS/2: ~/.vimrc
388" for Amiga: s:.vimrc
389" for MS-DOS and Win32: $VIM\_vimrc
390" for OpenVMS: sys$login:.vimrc
391
392" When started as "evim", evim.vim will already have done these settings.
393if v:progname =~? "evim"
394 finish
395endif
396
397" Use Vim settings, rather than Vi settings (much better!).
398" This must be first, because it changes other options as a side effect.
399set nocompatible
400
401" allow backspacing over everything in insert mode
402set backspace=indent,eol,start
403
404if has("vms")
405 set nobackup " do not keep a backup file, use versions instead
406else
407 set backup " keep a backup file (restore to previous version)
408 set undofile " keep an undo file (undo changes after closing)
409endif
410set history=50 " keep 50 lines of command line history
411set ruler " show the cursor position all the time
412set showcmd " display incomplete commands
413set incsearch " do incremental searching
414
415" For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
416" let &guioptions = substitute(&guioptions, "t", "", "g")
417
418" Don't use Ex mode, use Q for formatting
419map Q gq
420
421" CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo,
422" so that you can undo CTRL-U after inserting a line break.
423inoremap <C-U> <C-G>u<C-U>
424
425" In many terminal emulators the mouse works just fine, thus enable it.
426if has('mouse')
427 set mouse=a
428endif
429
430" Switch syntax highlighting on, when the terminal has colors
431" Also switch on highlighting the last used search pattern.
432if &t_Co > 2 || has("gui_running")
433 syntax on
434 set hlsearch
435endif
436
437" Only do this part when compiled with support for autocommands.
438if has("autocmd")
439
440 " Enable file type detection.
441 " Use the default filetype settings, so that mail gets 'tw' set to 72,
442 " 'cindent' is on in C files, etc.
443 " Also load indent files, to automatically do language-dependent indenting.
444 filetype plugin indent on
445
446 " Put these in an autocmd group, so that we can delete them easily.
447 augroup vimrcEx
448 au!
449
450 " For all text files set 'textwidth' to 78 characters.
451 autocmd FileType text setlocal textwidth=78
452
453 " When editing a file, always jump to the last known cursor position.
454 " Don't do it when the position is invalid or when inside an event handler
455 " (happens when dropping a file on gvim).
456 " Also don't do it when the mark is in the first line, that is the default
457 " position when opening a file.
458 autocmd BufReadPost *
459 \ if line("'\"") > 1 && line("'\"") <= line("$") |
460 \ exe "normal! g`\"" |
461 \ endif
462
463 augroup END
464
465else
466
467 set autoindent " always set autoindenting on
468
469endif " has("autocmd")
470
471" Convenient command to see the difference between the current buffer and the
472" file it was loaded from, thus the changes you made.
473" Only define it when not defined already.
474if !exists(":DiffOrig")
475 command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
476 \ | wincmd p | diffthis
477endif
478
479if has('langmap') && exists('+langnoremap')
480 " Prevent that the langmap option applies to characters that result from a
481 " mapping. If unset (default), this may break plugins (but it's backward
482 " compatible).
483 set langnoremap
484endif
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519" An example for a vimrc file.
520"
521" Maintainer: Bram Moolenaar <Bram@vim.org>
522" Last change: 2014 Nov 05
523"
524" To use it, copy it to
525" for Unix and OS/2: ~/.vimrc
526" for Amiga: s:.vimrc
527" for MS-DOS and Win32: $VIM\_vimrc
528" for OpenVMS: sys$login:.vimrc
529
530" When started as "evim", evim.vim will already have done these settings.
531if v:progname =~? "evim"
532 finish
533endif
534
535" Use Vim settings, rather than Vi settings (much better!).
536" This must be first, because it changes other options as a side effect.
537set nocompatible
538
539" allow backspacing over everything in insert mode
540set backspace=indent,eol,start
541
542if has("vms")
543 set nobackup " do not keep a backup file, use versions instead
544else
545 set backup " keep a backup file (restore to previous version)
546 set undofile " keep an undo file (undo changes after closing)
547endif
548set history=50 " keep 50 lines of command line history
549set ruler " show the cursor position all the time
550set showcmd " display incomplete commands
551set incsearch " do incremental searching
552
553" For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
554" let &guioptions = substitute(&guioptions, "t", "", "g")
555
556" Don't use Ex mode, use Q for formatting
557map Q gq
558
559" CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo,
560" so that you can undo CTRL-U after inserting a line break.
561inoremap <C-U> <C-G>u<C-U>
562
563" In many terminal emulators the mouse works just fine, thus enable it.
564if has('mouse')
565 set mouse=a
566endif
567
568" Switch syntax highlighting on, when the terminal has colors
569" Also switch on highlighting the last used search pattern.
570if &t_Co > 2 || has("gui_running")
571 syntax on
572 set hlsearch
573endif
574
575" Only do this part when compiled with support for autocommands.
576if has("autocmd")
577
578 " Enable file type detection.
579 " Use the default filetype settings, so that mail gets 'tw' set to 72,
580 " 'cindent' is on in C files, etc.
581 " Also load indent files, to automatically do language-dependent indenting.
582 filetype plugin indent on
583
584 " Put these in an autocmd group, so that we can delete them easily.
585 augroup vimrcEx
586 au!
587
588 " For all text files set 'textwidth' to 78 characters.
589 autocmd FileType text setlocal textwidth=78
590
591 " When editing a file, always jump to the last known cursor position.
592 " Don't do it when the position is invalid or when inside an event handler
593 " (happens when dropping a file on gvim).
594 " Also don't do it when the mark is in the first line, that is the default
595 " position when opening a file.
596 autocmd BufReadPost *
597 \ if line("'\"") > 1 && line("'\"") <= line("$") |
598 \ exe "normal! g`\"" |
599 \ endif
600
601 augroup END
602
603else
604
605 set autoindent " always set autoindenting on
606
607endif " has("autocmd")
608
609" Convenient command to see the difference between the current buffer and the
610" file it was loaded from, thus the changes you made.
611" Only define it when not defined already.
612if !exists(":DiffOrig")
613 command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
614 \ | wincmd p | diffthis
615endif
616
617if has('langmap') && exists('+langnoremap')
618 " Prevent that the langmap option applies to characters that result from a
619 " mapping. If unset (default), this may break plugins (but it's backward
620 " compatible).
621 set langnoremap
622endif
..