2006-12-15 17:15:12 +01:00
|
|
|
" /etc/vimrc (configuration file for vim only)
|
|
|
|
" author: Klaus Franken <kfr@suse.de>
|
|
|
|
" author: Werner Fink <werner@suse.de>
|
|
|
|
" author: Florian La Roche <florian@suse.de>
|
2011-11-07 13:59:59 +01:00
|
|
|
" version: 06/11/2011
|
2006-12-15 17:15:12 +01:00
|
|
|
" commented lines start with `"'
|
|
|
|
|
2011-11-07 13:59:59 +01:00
|
|
|
function! SKEL_spec()
|
|
|
|
0r /usr/share/vim/current/skeletons/skeleton.spec
|
|
|
|
language time en_US
|
|
|
|
if $USER != ''
|
|
|
|
let login = $USER
|
|
|
|
elseif $LOGNAME != ''
|
|
|
|
let login = $LOGNAME
|
|
|
|
else
|
|
|
|
let login = 'unknown'
|
|
|
|
endif
|
|
|
|
let newline = stridx(login, "\n")
|
|
|
|
if newline != -1
|
|
|
|
let login = strpart(login, 0, newline)
|
|
|
|
endif
|
|
|
|
if $HOSTNAME != ''
|
|
|
|
let hostname = $HOSTNAME
|
|
|
|
else
|
|
|
|
let hostname = system('hostname -f')
|
|
|
|
if v:shell_error
|
|
|
|
let hostname = 'localhost'
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
let newline = stridx(hostname, "\n")
|
|
|
|
if newline != -1
|
|
|
|
let hostname = strpart(hostname, 0, newline)
|
|
|
|
endif
|
|
|
|
exe "%s/specCURRENT_YEAR/" . strftime("%Y") . "/ge"
|
|
|
|
exe "%s/specRPM_CREATION_DATE/" . strftime("%a\ %b\ %d\ %Y") . "/ge"
|
|
|
|
exe "%s/specRPM_CREATION_AUTHOR_MAIL/" . login . "@" . hostname . "/ge"
|
|
|
|
exe "%s/specRPM_CREATION_NAME/" . expand("%:t:r") . "/ge"
|
|
|
|
setf spec
|
|
|
|
endfunction
|
|
|
|
|
2006-12-15 17:15:12 +01:00
|
|
|
" enable syntax highlighting
|
2007-08-24 00:22:56 +02:00
|
|
|
syntax on
|
2006-12-15 17:15:12 +01:00
|
|
|
|
|
|
|
" 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
|
|
|
|
|
2007-01-23 18:02:55 +01:00
|
|
|
" allow backspacing over everything in insert mode
|
|
|
|
set backspace=indent,eol,start
|
|
|
|
|
2006-12-15 17:15:12 +01:00
|
|
|
" 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"
|
2010-08-27 12:00:42 +02:00
|
|
|
elseif &term =~ "screen"
|
|
|
|
let myterm = "screen"
|
2006-12-15 17:15:12 +01:00
|
|
|
else
|
|
|
|
let myterm = &term
|
|
|
|
endif
|
|
|
|
let myterm = substitute(myterm, "cons[0-9][0-9].*$", "linux", "")
|
2010-08-27 12:00:42 +02:00
|
|
|
let myterm = substitute(myterm, "cons[0-9][0-9].*$", "linux", "")
|
2006-12-15 17:15:12 +01:00
|
|
|
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 7
|
|
|
|
map! <ESC>Ox 8
|
|
|
|
map! <ESC>Oy 9
|
|
|
|
map! <ESC>Ot 4
|
|
|
|
map! <ESC>Ou 5
|
|
|
|
map! <ESC>Ov 6
|
|
|
|
map! <ESC>Oq 1
|
|
|
|
map! <ESC>Or 2
|
|
|
|
map! <ESC>Os 3
|
|
|
|
map! <ESC>Op 0
|
|
|
|
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 7
|
|
|
|
map <ESC>Ox 8
|
|
|
|
map <ESC>Oy 9
|
|
|
|
map <ESC>Ot 4
|
|
|
|
map <ESC>Ou 5
|
|
|
|
map <ESC>Ov 6
|
|
|
|
map <ESC>Oq 1
|
|
|
|
map <ESC>Or 2
|
|
|
|
map <ESC>Os 3
|
|
|
|
map <ESC>Op 0
|
|
|
|
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>[1~ <Home>
|
|
|
|
map! <Esc>[4~ <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>
|
|
|
|
" keys in normal mode
|
|
|
|
map <ESC>[H 0
|
|
|
|
map <ESC>[F $
|
|
|
|
" Home/End: older xterms do not fit termcap/terminfo.
|
|
|
|
map <ESC>[1~ 0
|
|
|
|
map <ESC>[4~ $
|
|
|
|
" 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
|
|
|
|
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>[2;2~ <Insert>
|
|
|
|
map! <Esc>[3;2~ <Delete>
|
|
|
|
map! <Esc>[2;5~ <Insert>
|
|
|
|
map! <Esc>[3;5~ <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 0
|
|
|
|
map <ESC>OF $
|
|
|
|
map <ESC>O2H 0
|
|
|
|
map <ESC>O2F $
|
|
|
|
map <ESC>O5H 0
|
|
|
|
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>[2;2~ i
|
|
|
|
map <Esc>[3;2~ x
|
|
|
|
map <Esc>[2;5~ i
|
|
|
|
map <Esc>[3;5~ 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
|
|
|
|
|
2010-08-27 12:00:42 +02:00
|
|
|
if myterm == "screen"
|
|
|
|
map! <ESC>[1;2D <S-Left>
|
|
|
|
map! <ESC>[1;2C <S-Right>
|
|
|
|
map! <ESC>[1;2A <S-Up>
|
|
|
|
map! <ESC>[1;2B <S-Down>
|
|
|
|
map! <ESC>[1;2H <Home>
|
|
|
|
map! <ESC>[1;2F <End>
|
|
|
|
map! <ESC>[2;2~ <Insert>
|
|
|
|
map! <ESC>[3;2~ <Delete>
|
|
|
|
map! <ESC>[5;2~ <PageUp>
|
|
|
|
map! <ESC>[6;2~ <PageDown>
|
|
|
|
map! <ESC>[1;5D <C-Left>
|
|
|
|
map! <ESC>[1;5C <C-Right>
|
|
|
|
map! <ESC>[1;5A <C-Up>
|
|
|
|
map! <ESC>[1;5B <C-Down>
|
|
|
|
map! <ESC>[1;5H <Home>
|
|
|
|
map! <ESC>[1;5F <End>
|
|
|
|
map! <ESC>[2;5~ <Insert>
|
|
|
|
map! <ESC>[3;5~ <Delete>
|
|
|
|
map! <ESC>[5;5~ <PageUp>
|
|
|
|
map! <ESC>[6;5~ <PageDown>
|
|
|
|
map! <ESC>[1;3D <A-Left>
|
|
|
|
map! <ESC>[1;3C <A-Right>
|
|
|
|
map! <ESC>[1;3A <A-Up>
|
|
|
|
map! <ESC>[1;3B <A-Down>
|
|
|
|
map! <ESC>[1;3H <Home>
|
|
|
|
map! <ESC>[1;3F <End>
|
|
|
|
map! <ESC>[2;3~ <Insert>
|
|
|
|
map! <ESC>[3;3~ <Delete>
|
|
|
|
map! <ESC>[5;3~ <PageUp>
|
|
|
|
map! <ESC>[6;3~ <PageDown>
|
|
|
|
endif
|
|
|
|
|
2006-12-15 17:15:12 +01:00
|
|
|
" This escape sequence is the well known ANSI sequence for
|
|
|
|
" Remove Character Under The Cursor (RCUTC[tm])
|
|
|
|
map! <Esc>[3~ <Delete>
|
|
|
|
map <ESC>[3~ 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("'\"") > 0 && 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.
|
2009-02-20 23:53:18 +01:00
|
|
|
set nomodeline
|
2006-12-15 17:15:12 +01:00
|
|
|
|
2011-11-07 13:59:59 +01:00
|
|
|
" Skeleton for spec files
|
|
|
|
autocmd BufNewFile *.spec call SKEL_spec()
|
|
|
|
|
2006-12-15 17:15:12 +01:00
|
|
|
" get easier to use and more user friendly vim defaults
|
|
|
|
" /etc/vimrc ends here
|