9

I am fairly new to vim. I am trying to practice (been reading a couple of tutorials lately) but I found out I couldn't live without highlighting characters/words/lines for Copy-paste.

In Textmate, I usually SHIFT+CTRL+LeftArrowKey to highlight words and then Copy.

How do I do that in VIM?

NOTE: I have NERDTree plugin installed and mapped some keys for my own consumption.

Nathan Fellman
  • 122,701
  • 101
  • 260
  • 319
wenbert
  • 5,263
  • 8
  • 48
  • 77

2 Answers2

11

Give a look to the Vim Visual Mode.

The Shift+Ctrl+LeftArrowKey for word highlighting can be replaced easily for vw or vb.

Highlighting lines :

V to enter in Visual Line mode, then you can move with j,k, Ctrl-U, Ctrl-D, etc...

The Visual Mode is very powerful and useful.

Also, give a look to my answer to this question.

Community
  • 1
  • 1
Christian C. Salvadó
  • 807,428
  • 183
  • 922
  • 838
  • Thank you so much for this. On a sidenote, is it possible to have Vim (w/ NERDTree) to access files via FTP? I am still researching on this and thought asking here would also help. – wenbert Aug 05 '09 at 08:55
1

I am using VIM on Windows right now and in my .vimrc I have the following:

if has("win32")
   set clipboard=unnamed "always copy into clipboard
   set go+=a " when I am selecting anything, it is autamtically copied 
             " into clipboard
endif

I don't have any Linux machine right now with me, but I think, that it should work on Linux too. (maybe it will require some hacking)

Edit

There are lots of usefull tips about yanking(copying) here: Vim Wikia

zeroDivisible
  • 4,041
  • 8
  • 40
  • 62