Vim

   { This is WIP, I use Vim but am not such guru really so there may appear
   some errors, I know this topic is pretty religious so don't eat me.
   ~drummyfish }

   Vim (Vi Improved) is a legendary [1]free as in freedom, fairly (though not
   hardcore) [2]minimalist and [3]suckless [4]terminal-only (no [5]GUI)
   [6]text editor for skilled programmers and hackers, and one of the best
   editors you can choose for text editing and [7]programming. It is a
   successor of a much simpler editor [8]vi that was made in 1976 and which
   has become a standard text editor installed on every [9]Unix system. Vim
   added features like tabs, [10]syntax highlight, [11]scriptability, screen
   splitting, [12]unicode support, sessions and [13]plugins and as such has
   become not just a simple text editor but an editor that can comfortably be
   used for [14]programming instead of any bloated [15]IDE. Observing a
   skilled Vim user edit text is really like watching a magician or a literal
   movie hacker -- the editing is extremely fast, without any use of mouse,
   it transcends mere text editing and for some becomes something akin a way
   of life.

   Vim is generally known to be "difficult to learn" -- it is not because it
   is inherently difficult but rather for being very different from other
   editors -- it has no [16]GUI (even though it's still a screen-oriented
   [17]interactive [18]TUI), it is keyboard-only and is operated via text
   commands rather than with a [19]mouse, it's also preferable to not even
   use arrow keys but rather [20]hjkl keys. There is even a [21]meme that
   says Vim is so difficult that just exiting it is a non-trivial task.
   People not acquainted with Vim aren't able to do it and if they
   accidentally open Vim they have to either Google how to close it or force
   kill the terminal [22]xD Of course it's not so difficult to do, it's a
   little bit different than in other software -- you have to press escape,
   then type :q and press enter (although depending on the situation this may
   not work, e.g. if you have multiple documents open and want to exit
   without saving you have to type :wqa etc.). The (sad) fact is that most
   [23]coding monkeys and "professional programmers" [24]nowadays choose some
   ugly [25]bloated [26]IDE as their most important tool rather than
   investing two days into learning Vim, probably the best editor.

   Why use Vim? Well, simply because it is (relatively) [27]suckless,
   universal and extremely good for editing any text and for any kind of
   [28]programming, for many it [29]settles the search for an editor -- once
   you learn it you'll find it is flexible, powerful, comfortable,
   modifiable, lightweight... it has everything you need. Anyone who has ever
   invested the time to learn Vim will almost certainly tell you it was one
   of the best decisions he made and that guy probably only uses Vim for
   everything now. Many people even get used to it so much they download mods
   that e.g. add Vim commands and shortcuts to programs like web browsers. A
   great advantage is that vi is installed on every Unix as it is a standard
   utility, so if you know Vim, you can just comfortably use any Unix-like
   system just from the [30]command line: when you [31]ssh into a server you
   can simply edit files without setting up any remote GUI or whatever.
   Therefore Vim is automatically a must learn skill for any sysadmin. A huge
   number of people also use Vim for "[32]productivity" -- even though we
   don't fancy the productivity cult and the bottleneck of programming speed
   usually isn't the speed of typing, it is true that Vim makes you edit text
   extremely fast (you don't move your hands between mouse and keyboard, you
   don't even need to touch the arrow keys, the commands and shortcuts make
   editing very efficient). Some nubs think you "need" a huge IDE to make big
   programs, that's just plain wrong, you can do anything in Vim that you can
   do in any other IDE, it's as good for editing tiny files as for managing a
   huge codebase.

   Vim's biggest rival is [33]Emacs, a similar editor which is however more
   complex and [34]bloated (it is [35]joked that Emacs is really an
   [36]operating system) -- Vim is more [37]suckless, yet not less powerful,
   and so it is naturally the choice of the suckless community and also
   [38]ours. Vim and Emacs are a subject of a [39]holy war for the the best
   editor yet developed; the Emacs side calls itself the [40]Church of Emacs,
   led by [41]Richard Stallman (who created Emacs) while the Vi supporters
   are called members of the [42]Cult of Vi (vi vi vi = 666).

   It has to be noted that Vim as a program is still kind of [43]bloated,
   large part of the [44]suckless community acknowledges this ([45]cat-v
   lists Vim as [46]harmful, recommends [47]Acme, [48]Sam or [49]ed instead).
   Nonetheless the important thing is that Vim is a good [50]de facto
   standard -- the Vim's interface and philosophy is what matters the most,
   there are alternatives you can comfortably switch to. The situation is
   similar to for example "Unix as a concept", i.e. its interface,
   [51]philosophy and culture, which together create a certain
   standardization that allows for different implementations that can be
   switched without much trouble. In the suckless community Vim has a similar
   status to [52]C, [53]Linux or [54]X11 -- it is not ideal, by the strict
   standards it is a little bit bloated, however it is one of the best
   existing solutions and makes up for its shortcomings by being a stable,
   well established de-facto standard.

How To

   These are some Vim basics for getting started. There are two important
   editing modes in Vim:

     * insert mode: For writing text, you just type text as normal. Pressing
       ESC enters command mode. Here CTRL + n can be used for text
       completion.
     * command mode: For executing commands. Pressing i enters insert mode.

   Some important commands in command mode are:

     * arrow keys: Can be used for moving cursor, even though many prefer to
       use the hjkl keys. With SHIFT held down the cursor moves horizontally
       by words and by screens vertically.
     * h,j,k,l: Cursor movement.
     * $: Move cursor to end of the line.
     * 0: Move cursor to start of the line.
     * CTRL + w + w: Move between windows (created with :split or :vspit).
     * CTRL + PAGEUP, CTRL + PAGEDOWN: Move between tabs.
     * u: Undo.
     * CTRL + SHIFT + r: Redo.
     * :: Allows entering longer commands. TAB can be used for completion and
       up/down keys for listing command history. Some of the commands are:
          * q: Quit, or close the current extra window/tab. Use qa for
            closing all windows/tabs and quit. q! (or qa!) quits without
            saving changes, wq quits with saving changes, wqa quits all
            saving all changes etc.
          * w: Save changes (can be followed by filename).
          * noh: Cancel highlighted text (e.g. after search).
          * !: Run command in terminal, you can e.g. compile your program
            this way. For running Vim commands before the terminal commands
            use vimcommands |! terminalcommands, e.g. :wa |! make &&
            ./program.
          * tabedit filename: Opens given file in a new tab (tabs are closed
            with :q).
          * tabmove number: Move current tab to given position (+ and - can
            be used for relative movement of tabs).
          * vsplit: Creates a new window by splitting the current one
            vertically.
          * split: Creates a new window by splitting the current on
            horizontally.
          * >: Indent to the right, well combined with text selection (v, V).
          * .: Repeat previous command.
          * %s/find/replace/g: Search and replace [55]regex, [56]sed style.
          * help command: Show help about given command.
          * set variable value: Set a variable, used e.g. in configs.
     * /pattern: Search for a [57]regex patter entered after /. Found matches
       will be highlighted (:noh cancels the highlight), you can move to the
       next one with n and to the previous one with N.
     * NUMBER G: Go to line with given number (0 means last line).
     * v, V: Select/highlight text (by characters and by lines).
     * d: Delete, this is followed by a command saying what to delete, e.g.
       dw deletes to the end of the word, dd deletes the whole line. WARNING:
       delete actually copies the deleted text into clipboard (it behaves
       like cut)!
     * o: Insert new line.
     * p: Paste.
     * y: Copy (yank), followed by a command saying what to copy (e.g. yw
       copies a word), yy copies the whole line.

   Vim can be configured with a file named .vimrc in home directory. In it
   there is a set of commands that will automatically be run on start.
   Example of a simple config file follows:

 set number " set line numbering
 set et     " expand tabs
 set sw=2
 set hlsearch
 set nowrap          " no line wrap
 set colorcolumn=80  " highlight 80th column
 set list
 set listchars=tab:>.
 set backspace=indent,eol,start
 syntax on

Alternatives

   See also a nice big list at
   http://texteditors.org/cgi-bin/wiki.pl?ViFamily.

   Of course there are alternatives to Vim that are based on different
   paradigms, such as [58]Emacs (or possibly more "minimal" clones of it such
   as [59]Zile), its biggest rival, or plan9 editors such as [60]acme (or
   maybe even [61]ed). In this regard any [62]text editor is a potential
   alternative. Nevertheless people looking for Vim alternatives are usually
   looking for other vi-like editors. These are for example:

     * [63]vi: While you probably won't use the original ancient vi program
       but rather something like [64]nvi, vi is a [65]POSIX standard for a
       text editor that's much simpler and universal than Vim. It lacks many
       features one may be used to from Vim such as tabs, [66]autocompletion,
       [67]syntax highligh or multiple [68]undos. But limiting yourself to
       only using the features specified by the standard makes you more
       likely to be able to operate any vi-like text editor you encounter.
       (List of features added by Vim to vi can be found in
       runtime/doc/vi_diff.txt in Vim source tree.)
     * [69]neovim: Tries to be the "[70]modernized" ([71]refactored) fork of
       Vim, it removes some code, adds a new plugin system but also [72]bloat
       like [73]CMake. One of its self-stated goals is to be more "community
       driven". It is also written in C99 (while Vim is in C89, more
       portable). { At least I think. ~drummyfish }
     * [74]vis: Inspired by Vim and [75]Sam, written in C99, seems to have
       only a few dependencies. Has no tabs. { At least I didn't find them.
       ~drummyfish }
     * [76]nvi (new vi): Vi implementation originally made for [77]BSD, much
       simpler than Vim (see vi above).
     * [78]elvis: Another vi implementation, pretty simple (see vi above).
     * [79]BusyBox vi: Very minimal vi implementation with very few features
       (see vi above), missing even window splits etc.
     * [80]gvim: Various versions of Vim with [81]GUI frontends made with
       libraries such as [82]GTK3 or [83]Xaw. These run in a graphical window
       and have a menu with items you find in mainstream editors (save, open,
       find etc.). Of course you can still use this in the same way as the
       terminal version.

Links:
1. free_software.md
2. minimalism.md
3. suckless.md
4. terminal.md
5. gui.md
6. text_editor.md
7. programming.md
8. vi.md
9. unix.md
10. syntax_highlight.md
11. script.md
12. unicode.md
13. plugin.md
14. programming.md
15. ide.md
16. gui.md
17. interactive.md
18. tui.md
19. mouse.md
20. hjkl.md
21. meme.md
22. xd.md
23. coding.md
24. kids_these_days.md
25. bloat.md
26. ide.md
27. suckless.md
28. programming.md
29. settled.md
30. terminal.md
31. ssh.md
32. productivity_cult.md
33. emacs.md
34. bloat.md
35. jokes.md
36. os.md
37. suckless.md
38. lrs.md
39. holy_war.md
40. church_of_emacs.md
41. rms.md
42. cult_of_vi.md
43. bloat.md
44. suckless.md
45. cat_v.md
46. harmful.md
47. acme.md
48. sam.md
49. ed.md
50. de_facto_standard.md
51. unix_philosophy.md
52. c.md
53. linux.md
54. x11.md
55. regex.md
56. sed.md
57. regex.md
58. emacs.md
59. zile.md
60. acme.md
61. ed.md
62. text_editor.md
63. vi.md
64. nvi.md
65. posix.md
66. autocomplete.md
67. syntax_highlight.md
68. undo.mf
69. neovim.md
70. modern.md
71. refactoring.md
72. bloat.md
73. cmake.md
74. vis.md
75. sam.md
76. nvi.md
77. bsd.md
78. elvis.md
79. busybox.md
80. gvim.md
81. gui.md
82. gtk3.md
83. xaw.md