home *** CD-ROM | disk | FTP | other *** search
/ chilidog.highland.cc.ks.us / chilidog.highland.cc.ks.us.zip / chilidog.highland.cc.ks.us / backup / bradford.20120521.etc.tar.gz / bradford.20120521.etc.tar / etc / vimrc < prev    next >
Text File  |  2006-05-02  |  6KB  |  228 lines

  1. " /etc/vimrc (configuration file for vim only)
  2. " author: Klaus Franken     <kfr@suse.de>
  3. " author: Werner Fink       <werner@suse.de> 
  4. " author: Florian La Roche  <florian@suse.de> 
  5. " version: 00/01/20
  6. " commented lines start with `"'
  7.  
  8. " enable syntax highlighting
  9. " syntax on
  10.  
  11. " automatically indent lines (default)
  12. " set noautoindent
  13.  
  14. " select case-insenitiv search (not default)
  15. " set ignorecase
  16.  
  17. " show cursor line and column in the status line
  18. set ruler
  19.  
  20. " show matching brackets
  21. set showmatch
  22.  
  23. " display mode INSERT/REPLACE/...
  24. set showmode
  25.  
  26. " changes special characters in search patterns (default)
  27. " set magic
  28.  
  29. " Required to be able to use keypad keys and map missed escape sequences
  30. set esckeys
  31.  
  32. " get easier to use and more user friendly vim defaults
  33. " CAUTION: This option breaks some vi compatibility. 
  34. "          Switch it off if you prefer real vi compatibility
  35. set nocompatible
  36.  
  37. " Complete longest common string, then each full match
  38. " enable this for bash compatible behaviour
  39. " set wildmode=longest,full
  40.  
  41. " Try to get the correct main terminal type
  42. if &term =~ "xterm"
  43.     let myterm = "xterm"
  44. else
  45.     let myterm =  &term
  46. endif
  47. let myterm = substitute(myterm, "cons[0-9][0-9].*$",  "linux", "")
  48. let myterm = substitute(myterm, "vt1[0-9][0-9].*$",   "vt100", "")
  49. let myterm = substitute(myterm, "vt2[0-9][0-9].*$",   "vt220", "")
  50. let myterm = substitute(myterm, "\\([^-]*\\)[_-].*$", "\\1",   "")
  51.  
  52. " Here we define the keys of the NumLock in keyboard transmit mode of xterm
  53. " which misses or hasn't activated Alt/NumLock Modifiers.  Often not defined
  54. " within termcap/terminfo and we should map the character printed on the keys.
  55. if myterm == "xterm" || myterm == "kvt" || myterm == "gnome"
  56.     " keys in insert/command mode.
  57.     map! <ESC>Oo  :
  58.     map! <ESC>Oj  *
  59.     map! <ESC>Om  -
  60.     map! <ESC>Ok  +
  61.     map! <ESC>Ol  ,
  62.     map! <ESC>OM  
  63.     map! <ESC>Ow  7
  64.     map! <ESC>Ox  8
  65.     map! <ESC>Oy  9
  66.     map! <ESC>Ot  4
  67.     map! <ESC>Ou  5
  68.     map! <ESC>Ov  6
  69.     map! <ESC>Oq  1
  70.     map! <ESC>Or  2
  71.     map! <ESC>Os  3
  72.     map! <ESC>Op  0
  73.     map! <ESC>On  .
  74.     " keys in normal mode
  75.     map <ESC>Oo  :
  76.     map <ESC>Oj  *
  77.     map <ESC>Om  -
  78.     map <ESC>Ok  +
  79.     map <ESC>Ol  ,
  80.     map <ESC>OM  
  81.     map <ESC>Ow  7
  82.     map <ESC>Ox  8
  83.     map <ESC>Oy  9
  84.     map <ESC>Ot  4
  85.     map <ESC>Ou  5
  86.     map <ESC>Ov  6
  87.     map <ESC>Oq  1
  88.     map <ESC>Or  2
  89.     map <ESC>Os  3
  90.     map <ESC>Op  0
  91.     map <ESC>On  .
  92. endif
  93.  
  94. " xterm but without activated keyboard transmit mode
  95. " and therefore not defined in termcap/terminfo.
  96. if myterm == "xterm" || myterm == "kvt" || myterm == "gnome"
  97.     " keys in insert/command mode.
  98.     map! <Esc>[H  <Home>
  99.     map! <Esc>[F  <End>
  100.     " Home/End: older xterms do not fit termcap/terminfo.
  101.     map! <Esc>[1~ <Home>
  102.     map! <Esc>[4~ <End>
  103.     " Up/Down/Right/Left
  104.     map! <Esc>[A  <Up>
  105.     map! <Esc>[B  <Down>
  106.     map! <Esc>[C  <Right>
  107.     map! <Esc>[D  <Left>
  108.     " KP_5 (NumLock off)
  109.     map! <Esc>[E  <Insert>
  110.     " PageUp/PageDown
  111.     map <ESC>[5~ <PageUp>
  112.     map <ESC>[6~ <PageDown>
  113.     map <ESC>[5;2~ <PageUp>
  114.     map <ESC>[6;2~ <PageDown>
  115.     map <ESC>[5;5~ <PageUp>
  116.     map <ESC>[6;5~ <PageDown>
  117.     " keys in normal mode
  118.     map <ESC>[H  0
  119.     map <ESC>[F  $
  120.     " Home/End: older xterms do not fit termcap/terminfo.
  121.     map <ESC>[1~ 0
  122.     map <ESC>[4~ $
  123.     " Up/Down/Right/Left
  124.     map <ESC>[A  k
  125.     map <ESC>[B  j
  126.     map <ESC>[C  l
  127.     map <ESC>[D  h
  128.     " KP_5 (NumLock off)
  129.     map <ESC>[E  i
  130.     " PageUp/PageDown
  131.     map <ESC>[5~ 
  132.     map <ESC>[6~ 
  133.     map <ESC>[5;2~ 
  134.     map <ESC>[6;2~ 
  135.     map <ESC>[5;5~ 
  136.     map <ESC>[6;5~ 
  137. endif
  138.  
  139. " xterm/kvt but with activated keyboard transmit mode.
  140. " Sometimes not or wrong defined within termcap/terminfo.
  141. if myterm == "xterm" || myterm == "kvt" || myterm == "gnome"
  142.     " keys in insert/command mode.
  143.     map! <Esc>OH <Home>
  144.     map! <Esc>OF <End>
  145.     map! <ESC>O2H <Home>
  146.     map! <ESC>O2F <End>
  147.     map! <ESC>O5H <Home>
  148.     map! <ESC>O5F <End>
  149.     " Cursor keys which works mostly
  150.     " map! <Esc>OA <Up>
  151.     " map! <Esc>OB <Down>
  152.     " map! <Esc>OC <Right>
  153.     " map! <Esc>OD <Left>
  154.     map! <Esc>[2;2~ <Insert>
  155.     map! <Esc>[3;2~ <Delete>
  156.     map! <Esc>[2;5~ <Insert>
  157.     map! <Esc>[3;5~ <Delete>
  158.     map! <Esc>O2A <PageUp>
  159.     map! <Esc>O2B <PageDown>
  160.     map! <Esc>O2C <S-Right>
  161.     map! <Esc>O2D <S-Left>
  162.     map! <Esc>O5A <PageUp>
  163.     map! <Esc>O5B <PageDown>
  164.     map! <Esc>O5C <S-Right>
  165.     map! <Esc>O5D <S-Left>
  166.     " KP_5 (NumLock off)
  167.     map! <Esc>OE <Insert>
  168.     " keys in normal mode
  169.     map <ESC>OH  0
  170.     map <ESC>OF  $
  171.     map <ESC>O2H  0
  172.     map <ESC>O2F  $
  173.     map <ESC>O5H  0
  174.     map <ESC>O5F  $
  175.     " Cursor keys which works mostly
  176.     " map <ESC>OA  k
  177.     " map <ESC>OB  j
  178.     " map <ESC>OD  h
  179.     " map <ESC>OC  l
  180.     map <Esc>[2;2~ i
  181.     map <Esc>[3;2~ x
  182.     map <Esc>[2;5~ i
  183.     map <Esc>[3;5~ x
  184.     map <ESC>O2A  ^B
  185.     map <ESC>O2B  ^F
  186.     map <ESC>O2D  b
  187.     map <ESC>O2C  w
  188.     map <ESC>O5A  ^B
  189.     map <ESC>O5B  ^F
  190.     map <ESC>O5D  b
  191.     map <ESC>O5C  w
  192.     " KP_5 (NumLock off)
  193.     map <ESC>OE  i
  194. endif
  195.  
  196. if myterm == "linux"
  197.     " keys in insert/command mode.
  198.     map! <Esc>[G  <Insert>
  199.     " KP_5 (NumLock off)
  200.     " keys in normal mode
  201.     " KP_5 (NumLock off)
  202.     map <ESC>[G  i
  203. endif
  204.  
  205. " This escape sequence is the well known ANSI sequence for
  206. " Remove Character Under The Cursor (RCUTC[tm])
  207. map! <Esc>[3~ <Delete>
  208. map  <ESC>[3~    x
  209.  
  210. " Only do this part when compiled with support for autocommands. 
  211. if has("autocmd") 
  212.   " When editing a file, always jump to the last known cursor position. 
  213.   " Don't do it when the position is invalid or when inside an event handler 
  214.   " (happens when dropping a file on gvim). 
  215.   autocmd BufReadPost * 
  216.     \ if line("'\"") > 0 && line("'\"") <= line("$") | 
  217.     \   exe "normal g`\"" | 
  218.     \ endif 
  219.  
  220. endif " has("autocmd")
  221.  
  222. " Changed default required by SuSE security team--be aware if enabling this
  223. " that it potentially can open for malicious users to do harmful things.
  224. set modelines=0
  225.  
  226. " get easier to use and more user friendly vim defaults
  227. " /etc/vimrc ends here
  228.