" /etc/vimrc (configuration file for vim only)
" author: Klaus Franken <[email protected]>
" author: Werner Fink <[email protected]>
" author: Florian La Roche <[email protected]>
" version: 00/01/20
" commented lines start with `"' " enable syntax highlighting
syntax on " automatically indent lines (default)
" set noautoindent " select case-insenitiv search (not default)
set ignorecase " show cursor line and column in the status line
set ruler " show matching brackets
set showmatch " display mode INSERT/REPLACE/...
set showmode " changes special characters in search patterns (default)
" set magic " Required to be able to use keypad keys and map missed escape sequences
set esckeys " get easier to use and more user friendly vim defaults
" CAUTION: This option breaks some vi compatibility.
" Switch it off if you prefer real vi compatibility
set nocompatible " Complete longest common string, then each full match
" enable this for bash compatible behaviour
" set wildmode=longest,full " Try to get the correct main terminal type
if &term =~ "xterm"
let myterm = "xterm"
else
let myterm = &term
endif
let myterm = substitute(myterm, "cons[0-9][0-9].*$", "linux", "")
let myterm = substitute(myterm, "vt1[0-9][0-9].*$", "vt100", "")
let myterm = substitute(myterm, "vt2[0-9][0-9].*$", "vt220", "")
let myterm = substitute(myterm, "\\([^-]*\\)[_-].*$", "\\1", "") " Here we define the keys of the NumLock in keyboard transmit mode of xterm
" which misses or hasn't activated Alt/NumLock Modifiers. Often not defined
" within termcap/terminfo and we should map the character printed on the keys.
if myterm == "xterm" || myterm == "kvt" || myterm == "gnome"
" keys in insert/command mode.
map! <ESC>Oo :
map! <ESC>Oj *
map! <ESC>Om -
map! <ESC>Ok +
map! <ESC>Ol ,
map! <ESC>OM
map! <ESC>Ow
map! <ESC>Ox
map! <ESC>Oy
map! <ESC>Ot
map! <ESC>Ou
map! <ESC>Ov
map! <ESC>Oq
map! <ESC>Or
map! <ESC>Os
map! <ESC>Op
map! <ESC>On .
" keys in normal mode
map <ESC>Oo :
map <ESC>Oj *
map <ESC>Om -
map <ESC>Ok +
map <ESC>Ol ,
map <ESC>OM
map <ESC>Ow
map <ESC>Ox
map <ESC>Oy
map <ESC>Ot
map <ESC>Ou
map <ESC>Ov
map <ESC>Oq
map <ESC>Or
map <ESC>Os
map <ESC>Op
map <ESC>On .
endif " xterm but without activated keyboard transmit mode
" and therefore not defined in termcap/terminfo.
if myterm == "xterm" || myterm == "kvt" || myterm == "gnome"
" keys in insert/command mode.
map! <Esc>[H <Home>
map! <Esc>[F <End>
" Home/End: older xterms do not fit termcap/terminfo.
map! <Esc>[~ <Home>
map! <Esc>[~ <End>
" Up/Down/Right/Left
map! <Esc>[A <Up>
map! <Esc>[B <Down>
map! <Esc>[C <Right>
map! <Esc>[D <Left>
" KP_5 (NumLock off)
map! <Esc>[E <Insert>
" PageUp/PageDown
map <ESC>[~ <PageUp>
map <ESC>[~ <PageDown>
map <ESC>[;~ <PageUp>
map <ESC>[;~ <PageDown>
map <ESC>[;~ <PageUp>
map <ESC>[;~ <PageDown>
" keys in normal mode
map <ESC>[H
map <ESC>[F $
" Home/End: older xterms do not fit termcap/terminfo.
map <ESC>[~
map <ESC>[~ $
" Up/Down/Right/Left
map <ESC>[A k
map <ESC>[B j
map <ESC>[C l
map <ESC>[D h
" KP_5 (NumLock off)
map <ESC>[E i
" PageUp/PageDown
map <ESC>[~
map <ESC>[~
map <ESC>[;~
map <ESC>[;~
map <ESC>[;~
map <ESC>[;~
endif " xterm/kvt but with activated keyboard transmit mode.
" Sometimes not or wrong defined within termcap/terminfo.
if myterm == "xterm" || myterm == "kvt" || myterm == "gnome"
" keys in insert/command mode.
map! <Esc>OH <Home>
map! <Esc>OF <End>
map! <ESC>O2H <Home>
map! <ESC>O2F <End>
map! <ESC>O5H <Home>
map! <ESC>O5F <End>
" Cursor keys which works mostly
" map! <Esc>OA <Up>
" map! <Esc>OB <Down>
" map! <Esc>OC <Right>
" map! <Esc>OD <Left>
map! <Esc>[;~ <Insert>
map! <Esc>[;~ <Delete>
map! <Esc>[;~ <Insert>
map! <Esc>[;~ <Delete>
map! <Esc>O2A <PageUp>
map! <Esc>O2B <PageDown>
map! <Esc>O2C <S-Right>
map! <Esc>O2D <S-Left>
map! <Esc>O5A <PageUp>
map! <Esc>O5B <PageDown>
map! <Esc>O5C <S-Right>
map! <Esc>O5D <S-Left>
" KP_5 (NumLock off)
map! <Esc>OE <Insert>
" keys in normal mode
map <ESC>OH
map <ESC>OF $
map <ESC>O2H
map <ESC>O2F $
map <ESC>O5H
map <ESC>O5F $
" Cursor keys which works mostly
" map <ESC>OA k
" map <ESC>OB j
" map <ESC>OD h
" map <ESC>OC l
map <Esc>[;~ i
map <Esc>[;~ x
map <Esc>[;~ i
map <Esc>[;~ x
map <ESC>O2A ^B
map <ESC>O2B ^F
map <ESC>O2D b
map <ESC>O2C w
map <ESC>O5A ^B
map <ESC>O5B ^F
map <ESC>O5D b
map <ESC>O5C w
" KP_5 (NumLock off)
map <ESC>OE i
endif if myterm == "linux"
" keys in insert/command mode.
map! <Esc>[G <Insert>
" KP_5 (NumLock off)
" keys in normal mode
" KP_5 (NumLock off)
map <ESC>[G i
endif " This escape sequence is the well known ANSI sequence for
" Remove Character Under The Cursor (RCUTC[tm])
map! <Esc>[~ <Delete>
map <ESC>[~ x " Only do this part when compiled with support for autocommands.
if has("autocmd")
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
autocmd BufReadPost *
\ if line("'\"") > && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif endif " has("autocmd") " Changed default required by SuSE security team--be aware if enabling this
" that it potentially can open for malicious users to do harmful things.
set modelines= set number " get easier to use and more user friendly vim defaults
" /etc/vimrc ends here
05-17 01:49