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 / vim55rt.sit / runtime / mswin.vim < prev    next >
Encoding:
Text File  |  1999-09-25  |  2.3 KB  |  102 lines  |  [TEXT/VIM!]

  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 Aug 09
  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. " Use CTRL-Q to do what CTRL-V used to do
  59. noremap <C-Q> <C-V>
  60.  
  61. " For CTRL-V to work autoselect must be off
  62. set guioptions-=a
  63.  
  64. " CTRL-Z is Undo
  65. map <C-Z> u
  66. imap <C-Z> <C-O>u
  67. cmap <C-Z> <C-C><C-Z>
  68.  
  69. " CTRL-Y is Redo (although not repeat)
  70. map <C-Y> <C-R>
  71. imap <C-Y> <C-O><C-R>
  72. cmap <C-Y> <C-C><C-Y>
  73.  
  74. " Alt-Space is System menu
  75. if has("gui")
  76.   map <M-Space> :simalt ~<CR>
  77.   imap <M-Space> <C-O>:simalt ~<CR>
  78.   cmap <M-Space> <C-C><M-Space>
  79. endif
  80.  
  81. " CTRL-A is Select all
  82. map <C-A> gggH<C-O>G
  83. imap <C-A> <C-O>gg<C-O>gH<C-O>G
  84. cmap <C-A> <C-C><C-A>
  85.  
  86. " CTRL-Tab is Next window
  87. map <C-Tab> <C-W>w
  88. imap <C-Tab> <C-O><C-W>w
  89. cmap <C-Tab> <C-C><C-Tab>
  90.  
  91. " CTRL-F4 is Close window
  92. map <C-F4> <C-W>c
  93. imap <C-F4> <C-O><C-W>c
  94. cmap <C-F4> <C-C><C-F4>
  95.  
  96. " restore 'cpoptions'
  97. set cpoptions&
  98. if 1
  99.   let &cpoptions = mswin_save_cpo
  100.   unlet mswin_save_cpo
  101. endif
  102.