Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Many machines i need to work with have basic NIX installation with vim as text editor. But vim's way to select text is kind of unusual to me :). Is it any easy way to re-configure vim so it will use shift in order to select text and ctrl+c / ctrl+v for copy and paste?

share|improve this question

1 Answer 1

up vote 11 down vote accepted

Add the following lines to your _vimrc or .vimrc

source $VIMRUNTIME/mswin.vim
behave mswin

But beware, visual mode is then CTRL-Q instead of CTRL-V.

For an overview what mswin.vim does see the mswin.vim sourcode. It is commented very well and if some command is unclear you can easily look it up in vim's help.

Here is a quick overview compile from the source:

  • backspace and cursor keys wrap to previous/next line
  • CTRL-X and SHIFT-Del are Cut
  • CTRL-C and CTRL-Insert are Copy
  • CTRL-V and SHIFT-Insert are Paste
  • Use CTRL-Q to do what CTRL-V used to do
  • Use CTRL-S for saving, also in Insert mode
  • CTRL-Z is Undo; not in cmdline though
  • CTRL-Y is Redo (although not repeat); not in cmdline though
  • Alt-Space is System menu
  • CTRL-A is Select all
  • CTRL-Tab is Next window
  • CTRL-F4 is Close window
share|improve this answer
    
What else this option reconfigures? –  Kazimieras Aliulis Jun 18 '09 at 10:31
    
Thanks, that partially works. But on some platforms ctrl+v still don't insert - it just draws a blue '^' O_O. –  Eye of Hell Jun 18 '09 at 10:57
    
@softly.lt: Added to the answer. –  Ludwig Weinzierl Jun 18 '09 at 11:24
    
@Eye of Hell: This is the expected behaviour if mswin.vim is not active, but it's difficult to say why without further information. –  Ludwig Weinzierl Jun 18 '09 at 11:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.