ViM – A text editorAbout me● Keith Pickett● Married, 0 kids, 2 dogs● From SE Tennessee (Appalachian Mountains.. that explains the ak-cent :) )● Software developer (mostly web development)● 22 years in Unix/Linux experience● Love technology and the recent push in the CSRA.● Why am I here? To provide what I know and to learn something from you.● @KeithPickett● http://about.me/KeithPickett
ViM – A text editorWhat is Vim?● Vim is a text editor. Not a word processor.● Based on the vi text editor.● You cant WYSIWYG it. Through syntax highlighting, you can get close. Thats not its purpose, however.HistoryVi ● Created by Bill Joy (one of the co-founders of Sun Microsystems). ● Defined as "a screen-oriented text editor originally created for the Unix operating system. The portable subset of the behavior of vi and programs based on it, and the ex editor language supported within these programs, is described by (and thus standardized by) the Single Unix Specification and POSIX." (source: http://en.wikipedia.org/wiki/Vi ) ● Developed at first on an old ADM-3A terminal, before computer mice became ubiquitous. Users relied on commands and keyboard-based navigation to interact with the editor. (See pictures) ● Derived from very painful editor named "ed" and a series of other command-line editors like ex. The ex functionality is still part of Vim. ● Ex v2.0 became Vi. Version 3.1 became a permanent part of what we now know as Unix.
ViM – A text editorVim (Vi IMproved) ● Created by Bram Moolenaar in 1988 for the Atari platform. Mr. Moolenaar is active in the International Child Care Fund (ICCF) to help educate children in Uganda. ● First public release in 1991 (Unix and early implementations of Linux later). ● The name "Vim" is an acronym for "Vi IMproved" because Vim is an extended version of the vi editor, with many additional features designed to be helpful in editing program source code. - [Source: http://en.wikipedia.org/wiki/Vim_(text_editor) ] ● Ported to Unix in 1992.
ViM – A text editorFeature List ● Highly customizable ● Compatible with Vi (but now 100% compatible) ● Built in vimtutor for learning Vim ● GUI mode (gVim) with full mouse integration. ● Multi-level undo. ● Extended Regular Expression support. ● Code-completion ● Code merging ● Strong diff functionality (vimdiff) ● Code folding ● Syntax highlighting ● Session / State Preservation ● Built in text expansion using “iab” or can use plugins (snippetsEMU). ● Has its own scripting language (vimscript) for configuration and writing plugins. ● Plugins can be written in Lua (as of Vim 7.3), Perl, Python, Racket (formerly PLT Scheme), Ruby, and Tcl. Its not real robust, but scripts in these languages do work. ● Project distributions exist to make Vim more specific in its functionality. Cream is the most popular of these. Its aim is to make Vim more modern by taking advantages of the GUI feature set.
ViM – A text editor Availability● All major operating systems and even the minor ones too.● Versions are available for Android and iOS. Other Interesting Facts● Shells like KSH and BASH have vi mode. (set -o vi)● Allows you to use most of the ex/vi commands and movements on the command line.● ESC invokes vi mode. ESC-k brings up previous command. Pressing j or k will scroll through command history. Pressing h or l will move the cursor over the command. 0 places cursor at the beginning of the line and $ at the end.
ViM – A text editorNavigationWhen Vim is launched, the window is in “Normal” mode. This allows for the navigation of the cursor through the document. Pressing h, j,k, l navigates the cursor.0(Zero) -- positiosn cursor at the beginning of line$ -- positions cursor at the end of the linee – place cursor at the end of the next word. (dog, ford, cigar)w -- set cursor to the beginning of the next wordb -- set cursor to the beginning of the previous wordE – place cursor at the end of the next non-blank spaced character (dogfood”, ford-focus”, cigar^box)– Same for W and B respectivelyTab -- normal function"." -- Repeat actionyy -- yank (copy) current line (line that cursor is positioned on).dd -- delete current line (line that cursor is positioned on).u -- undo last action (multi-level undo)CTRL-R – Repeat next history item (multi-level re-do)
ViM – A text editorFollow-up items from the discussion:Is there a vi mode in ZSH? Yes. It apparently doesnt behave as you would expect. A couple of Google searches yielded someblog posts discussing the matter.To split a Vim session horizontally, go into command mode and type “split”.To split a Vim session vertically, go into command mode and type “vsplit”.Examples:(horizontal split) :split(vertical split) :vsplitTo switch between windows * See Note-1 below*: Split windows :: CTRL+ws or :split in command mode. Split windows vertically :: CTRL+wv or :vsplit in command mode. Switch between windows :: CTRL+ww Quit a window :: CTRL+wq -*Note-1*The CTRL+<key> sequences above (example: CTRL+ws) probably look confusing and may not actually work if you dont executethem correctly. The proper way to execute the command is to hold down CTRL and w, let go, and then tap the letter next to w. Forexample, CTRL+ws, s would be the key to tap after CTRL w.
ViM – A text editorLinks:www.vim.orgwww.viemu.comhttp://arstechnica.com/information-technology/2011/11/two-decades-of-productivity-vims-20th-annhttp://en.wikipedia.org/wiki/Vihttp://en.wikipedia.org/wiki/Vim_(text_editor)Questions?