Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Look, it's really not that tough. Here's what you need to treat vim as a text editor with syntax highlighting:

  esc (escape) = go to the default mode
  i (insert) = when you want to make changes to the document
  
  esc + : (escape, colon) = think of this as control + whatever
  :w = (w)rite - save your file
  :q = (q)uit - quit vim
  :wq = (w)rite, then (q)uit
  :q! = (q)uit!, discarding any changes
Just those few things will let you use vim well enough while you're figuring out all the really cool stuff it can do.

Emacs can be treated similiarly: C = control M = "meta", usually the alt or option key. You can use escape if you want.

  C-x C-f = control x (do something) + control f (find file) - open a file
  C-x C-s = save a file
  C-x C-c = quit
  C-k = (k)ill - this is similar to cut
  C-y = yank - this is similar to paste
For emacs, it may be easier to start with cua mode -

  M-x cua-mode 
  (btw, m-x means "run this function") 
Cua mode gives you a copy, cut and paste that works the same as your operating system.


You're replying to the wrong person - vim is my primary editor. I'm ranting about the stupidity of the phrase "Steep learning curve."


heh, I guess I misread what it was you were ranting about; I took it to mean that you hate any sort of learning curve when it comes to editors. Thanks for clarifying!


You left out hjkl and C-bnpf, the cursor. And / and C-s, search. These are the only things I know in vi but it makes it barely usable for config.


If you're using vi/vim for real programming, you'll want to know about tag searching as well - it's one of the better ways to deal with multi-file source code. In both nvi and vim, control-] jumps to the tag under the cursor, and control-t pops back to the previous context. (You'll need to run a program such as ctags on the source to create the tag index first.)


The commands you demonstrate are not going to convince anybody that Vi(m) is a great editor. Not at all.


I'm not trying to convince anyone; I'm pointing out that you can get started with basic tasks without having to know a ton of commands.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: