Difference between revisions of "Vi"

From NetHackWiki
Jump to navigation Jump to search
(Some vi strategy, especially for those public serves with vi-like nethackrc editors. Some red links for contributors.)
 
(mention Vim)
Line 14: Line 14:
 
* Press '''[:] [q] [!] [RETURN]''' to quit without saving; this is useful if you messed something.
 
* Press '''[:] [q] [!] [RETURN]''' to quit without saving; this is useful if you messed something.
  
You will find vi upon many [[Unix]] systems, though some [[GNU/Linux]] distros (notably [[Debian]] and [[Gentoo]]) leave it away from of the core system. To learn about vi in general, you could try to start with [http://www.bbc.co.uk/dna/h2g2/A306857 H2G2's brief description vi], then move to [http://everything2.com/index.pl?node_id=13588 vi@Everything2.com] for commands and tutorials. [[Wikipedia:Vi]] reveals the history of Vi, while [[Wiki:ViEditor]] explains how to pronounce "vi" and links to comparisons with [[Emacs]].
+
You will find vi upon many [[Unix]] systems, though some [[GNU/Linux]] distros (notably [[Debian]] and [[Gentoo]]) leave it away from of the core system. To learn about vi in general, you could try to start with [http://www.bbc.co.uk/dna/h2g2/A306857 H2G2's brief description vi], then move to [http://everything2.com/index.pl?node_id=13588 vi@Everything2.com] for commands and tutorials. [[Wikipedia:Vi]] reveals the history of Vi, while [[Wiki:ViEditor]] explains how to pronounce "vi" and links to comparisons with [[Emacs]]. There is also improved version of Vi called [[w:c:vim|Vim]].
  
 
[[Category:Development]]
 
[[Category:Development]]

Revision as of 01:12, 22 January 2009

Around here, Vi (being vee eye, not six) is most notorious as the origin of the use of [hjkl] for movement. Vi, short for VIsual editor, is a classic but controversial text editor for Unix.

The programmers of vi did not care much about moving the cursor diagonally. The programmers of Rogue (game) adopted the [hjkl] movement system (likely because their keyboards lacked both numeric keypads and separate arrow keys) and added [yubn] for diagonal movement. NetHack adopts this yuhjklbn system.

Strategy

These days, the one reason that you might need to know "vi" is if you play on nethack.alt.org or slashem.crash-override.net. If you telnet in and try to edit your nethackrc, you will find yourself in a vi-like editor. Some brief hints:

  • Use the [hjkl] keys to move the cursor.
  • Press [x] to delete the character that the cursor is on.
  • Press [d] [d] to delete the line that the cursor is on.
  • Press [i] to enter insert mode, type something, then press [Esc] to return to command mode.
  • Move the cursor to the last character of the line, then press [a] to enter insert mode, type something, then press [Esc] to return to command mode.
  • Press [:] [w] [q] [RETURN] to save and quit.
  • Press [:] [q] [!] [RETURN] to quit without saving; this is useful if you messed something.

You will find vi upon many Unix systems, though some GNU/Linux distros (notably Debian and Gentoo) leave it away from of the core system. To learn about vi in general, you could try to start with H2G2's brief description vi, then move to vi@Everything2.com for commands and tutorials. Wikipedia:Vi reveals the history of Vi, while Wiki:ViEditor explains how to pronounce "vi" and links to comparisons with Emacs. There is also improved version of Vi called Vim.