"------------------------------------------------------------------------------- " ~/.vimrc-short-en (C) 2004-2025 T.Birnthaler OSTC GmbH " Vim configuration (rename to "~/.vimrc"!) " (emtpy lines not allowed --> change them to comment lines via "...) "------------------------------------------------------------------------------- " No Vi emulation, but activate Vim and all it's extensions set nocompatible " During "insertion" of text from another windows via X windows mouse select " switch on/off a lot of Vim special functionality via key " (just activate during insert mode, otherwise too much will be deactivated!) " 'paste' --> 'textwidth=0' " 'paste' --> 'wrapmargin=0' " 'paste' --> 'noautoindent' " 'paste' --> 'nosmartindent' " 'paste' --> 'nocindent' " 'paste' --> 'softtabstop=0' " 'paste' --> 'nolisp' " 'paste' --> 'norevins' " 'paste' --> 'noruler' " 'paste' --> 'noshowmatch' " 'paste' --> 'formatoptions=' set nopaste set paste set pastetoggle= " same as map :set invpaste/ " Switch line numbering on/off set number set nonumber " (Don't) show tabulators and line endings " (list mode --> "^I" for tabulators and "$" for line endings) set list set nolist " * Show status line at bottom (0=never, 1=2 windows or more, 2=always) " * Vim mode (INSERT, VISUAL, ...) " * Current Vim command (till complete) " * Current line,column + relative file position (All, Top, Bot, NN%) " * Change of more than 0 lines --> number of affected lines set laststatus=2 set showmode set showcmd set ruler set report=0 " Show hint in status line if more than N changed/deleted/inserted lines " (one of both lines works!) set report=0 set report=1 " Title line of terminal window will display file name set title set icon " Mark opening parentheses shortly (0.5s) when inserting corresp. closing one " (mps = matchpairs) " Mark corresponding parentheses while cursor on a parentheses " (respects type ([{<>}]) and hierarchical nesting!) set showmatch set matchpairs=(:) set mps+=[:] set mps+={:} set mps+=<:> set matchtime=2 " "Flash" screen instead of "alert sound" in case of input error set noerrorbells set visualbell " Search settings as intelligently as possible: " * Ignore UPPER/lower case (not if \C used in search pattern) " * If search pattern contains UPPER case --> UPPER/lower case respected " * Search at once while search pattern keyed in (inc=incremental) " * Mark hits (hl=highlight) " * Search wraps around text bottom/top (wrapscan) set ignorecase set smartcase set incsearch set hlsearch set wrapscan " Set tabulator and indendation width to 4 set tabstop=4 set shiftwidth=4 set shiftround " (Don't) expand tabulator to spaces (already existing ones not!) " (convert existing tabulators to spaces by "1!Gexpand") set noexpandtab set expandtab " (Don't) indent automatically (according to previous line) " ( indents by 1 level, dedents by 1 level) set autoindent set noautoindent " Automatic line breaking 10 characters from right border (0=no line breaking) " Max. width for inserted text (0=inactive, overwrites "wrapmargin") set wrapmargin=10 set wrapmargin=0 set textwidth=75 set textwidth=0 " Switch syntax coloring on/off syntax off syntax enable " Select syntax coloring scheme + some small adaptions "colorscheme blue "colorscheme darkblue colorscheme default "colorscheme delek "colorscheme desert "colorscheme elflord "colorscheme evening "colorscheme habamx "colorscheme industry "colorscheme koehler "colorscheme lunaperche "colorscheme morning "colorscheme murphy "colorscheme pablo "colorscheme peachpuff "colorscheme quiet "colorscheme retrobox "colorscheme ron "colorscheme shine "colorscheme slate "colorscheme sorbet "colorscheme torte "colorscheme unokai "colorscheme wildcharm "colorscheme zaibatsu "colorscheme zellner " Statement elements dark blue instead of yellow (otherwise hard do read!) " Variables black instead of yellow (otherwise hard do read!) "hi statement ctermfg=darkblue guifg=darkblue "hi identifier ctermfg=black guifg=black " Mark search hits invers "hi IncSearch term=reverse cterm=reverse gui=reverse "hi Search term=reverse cterm=reverse gui=reverse "hi Search term=reverse ctermbg=8 gui=reverse "hi Cursor term=reverse cterm=reverse gui=reverse " Color names: " White " Yellow LightYellow DarkYellow " Red LightRed DarkRed " Green LightGreen DarkGreen " Blue LightBlue DarkBlue " Cyan LightCyan DarkCyan " Magenta LightMagenta DarkMagenta " Gray LightGray DarkGray " Grey LightGrey DarkGrey " Brown " Black " Key "carriage return" switches search hits highlighting on/off (toggle) " (invhls = invert highlight search) " = Key F1 " = Key Carriage-Return " = Key BackSpace " (/ empties status line to avoid irritations!) "nnoremap :set invhls/ nnoremap :set invhls/ " Jump to last cursor position when opening a file " (only if "autocommands" are compiled in, pos. is valid and not in event handle) if has("autocmd") autocmd BufReadPost * \ if line("'\"") > 0 && line("'\"") <= line("$") | \ exe "normal g`\"" | \ endif endif