home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / mac / vim54rt.sit / runtime / mswin.vim < prev    next >
Encoding:
Text File  |  1999-08-14  |  2.2 KB  |  99 lines  |  [TEXT/ALFA]

  1. " Set options and add mapping such that Vim behaves a lot like MS-Windows
  2. "
  3. " Maintainer:    Bram Moolenaar <Bram@vim.org>
  4. " Last change:    1999 Apr 26
  5.  
  6. " make 'cpoptions' empty
  7. if 1    " only do this when compiled with expression evaluation
  8.   let mswin_save_cpo = &cpoptions
  9. endif
  10. set cpoptions=
  11.  
  12. " set 'selection', 'selectmode', 'mousemodel' and 'keymodel' for MS-Windows
  13. behave mswin
  14.  
  15. " backspace and cursor keys wrap to previous/next line
  16. set backspace=2 whichwrap+=<,>,[,]
  17.  
  18. " backspace in Visual mode deletes selection
  19. vmap <BS> d
  20.  
  21. " CTRL-X and SHIFT-Del are Cut
  22. vmap <C-X> "*x
  23. vmap <S-Del> "*x
  24.  
  25. " CTRL-C and CTRL-Insert are Copy
  26. vmap <C-C> "*y
  27. vmap <C-Insert> "*y
  28.  
  29. " CTRL-V and SHIFT-Insert are Paste
  30. nm \\Paste\\ "=@*.'xy'<CR>gPFx"_2x:echo<CR>
  31. map <C-V>                \\Paste\\
  32. map <S-Insert>                \\Paste\\
  33. if has("gui")
  34.   nmenu 20.360 &Edit.&Paste        \\Paste\\
  35.   nmenu  1.40  PopUp.&Paste        \\Paste\\
  36.   nmenu        ToolBar.Paste        \\Paste\\
  37. endif
  38.  
  39. imap <C-V>                x<Esc>\\Paste\\"_s
  40. imap <S-Insert>                x<Esc>\\Paste\\"_s
  41. if has("gui")
  42.   imenu 20.360 &Edit.&Paste        x<Esc>\\Paste\\"_s
  43.   imenu  1.40  PopUp.&Paste        x<Esc>\\Paste\\"_s
  44.   imenu        ToolBar.Paste        x<Esc>\\Paste\\"_s
  45. endif
  46.  
  47. cmap <C-V>      <C-R>*
  48. cmap <S-Insert> <C-R>*
  49.  
  50. vmap <C-V>                "-cx<Esc>\\Paste\\"_x
  51. vmap <S-Insert>                "-cx<Esc>\\Paste\\"_x
  52. if has("gui")
  53.   vmenu 20.360 &Edit.&Paste        "-cx<Esc>\\Paste\\"_x
  54.   vmenu  1.40  PopUp.&Paste        "-cx<Esc>\\Paste\\"_x
  55.   vmenu        ToolBar.Paste        "-cx<Esc>\\Paste\\"_x
  56. endif
  57.  
  58. " For CTRL-V to work autoselect must be off
  59. set guioptions-=a
  60.  
  61. " CTRL-Z is Undo
  62. map <C-Z> u
  63. imap <C-Z> <C-O>u
  64. cmap <C-Z> <C-C><C-Z>
  65.  
  66. " CTRL-Y is Redo (although not repeat)
  67. map <C-Y> <C-R>
  68. imap <C-Y> <C-O><C-R>
  69. cmap <C-Y> <C-C><C-Y>
  70.  
  71. " Alt-Space is System menu
  72. if has("gui")
  73.   map <M-Space> :simalt ~<CR>
  74.   imap <M-Space> <C-O>:simalt ~<CR>
  75.   cmap <M-Space> <C-C><M-Space>
  76. endif
  77.  
  78. " CTRL-A is Select all
  79. map <C-A> gggH<C-O>G
  80. imap <C-A> <C-O>gg<C-O>gH<C-O>G
  81. cmap <C-A> <C-C><C-A>
  82.  
  83. " CTRL-Tab is Next window
  84. map <C-Tab> <C-W>w
  85. imap <C-Tab> <C-O><C-W>w
  86. cmap <C-Tab> <C-C><C-Tab>
  87.  
  88. " CTRL-F4 is Close window
  89. map <C-F4> <C-W>c
  90. imap <C-F4> <C-O><C-W>c
  91. cmap <C-F4> <C-C><C-F4>
  92.  
  93. " restore 'cpoptions'
  94. set cpoptions&
  95. if 1
  96.   let &cpoptions = mswin_save_cpo
  97.   unlet mswin_save_cpo
  98. endif
  99.