SlideShare a Scribd company logo
ViM – A text editor
About 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 editor
What is Vim?
●    Vim is a text editor. Not a word processor.
●    Based on the vi text editor.
●    You can't 'WYSIWYG' it. Through syntax highlighting, you can get close. That's not its purpose,
     however.

History

Vi
     ●   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.
ADM-3A Terminal
Photo courtesy: http://www.nekochan.net
ADM-3A Keyboard
Photo courtesy: http://www.vintagecomputer.net
ViM – A text editor
Vim (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 editor
Feature 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. It's 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 editor
Navigation
When 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 line
e – place cursor at the end of the next word. (dog, ford, cigar)
w -- set cursor to the beginning of the next word
b -- set cursor to the beginning of the previous word
E – place cursor at the end of the next non-blank spaced character (dogfood”, ford-focus”, cigar^box')
– Same for W and B respectively
Tab -- normal function
"." -- Repeat action
yy -- 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 editor
Follow-up items from the discussion:
Is there a vi mode in ZSH? Yes. It apparently doesn't behave as you would expect. A couple of Google searches yielded some
blog 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)
        :vsplit

To 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 don't execute
them 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. For
example, CTRL+ws, 's' would be the key to tap after 'CTRL w'.
ViM – A text editor

Links:
www.vim.org

www.viemu.com

http://arstechnica.com/information-technology/2011/11/two-decades-of-productivity-vims-20th-ann

http://en.wikipedia.org/wiki/Vi

http://en.wikipedia.org/wiki/Vim_(text_editor)




Questions?

More Related Content

Similar to Augusta Linux User Group - Vim Introduction

Unit 5 vim an advanced text editor
Unit 5 vim an advanced text editorUnit 5 vim an advanced text editor
Unit 5 vim an advanced text editor
root_fibo
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
Reka
 
Open Source Virtualization Hacks
Open Source Virtualization HacksOpen Source Virtualization Hacks
Open Source Virtualization Hacks
Niel Bornstein
 

Similar to Augusta Linux User Group - Vim Introduction (20)

Introduction to Vim
Introduction to VimIntroduction to Vim
Introduction to Vim
 
What is Vim?
What is Vim?What is Vim?
What is Vim?
 
Vim Book
Vim BookVim Book
Vim Book
 
Unit 5 vim an advanced text editor
Unit 5 vim an advanced text editorUnit 5 vim an advanced text editor
Unit 5 vim an advanced text editor
 
Vi editor
Vi editorVi editor
Vi editor
 
Vi editor in linux
Vi editor in linuxVi editor in linux
Vi editor in linux
 
Vim Vi Improved
Vim Vi ImprovedVim Vi Improved
Vim Vi Improved
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Vi and redirection & piping in linux
Vi and redirection & piping in linuxVi and redirection & piping in linux
Vi and redirection & piping in linux
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Open Source Virtualization Hacks
Open Source Virtualization HacksOpen Source Virtualization Hacks
Open Source Virtualization Hacks
 
Vi
ViVi
Vi
 
Small Screen Development
Small Screen DevelopmentSmall Screen Development
Small Screen Development
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Vi survival guide
Vi survival guideVi survival guide
Vi survival guide
 
swl--3 (1).docx
swl--3 (1).docxswl--3 (1).docx
swl--3 (1).docx
 
Linux network manager configure
Linux network manager configureLinux network manager configure
Linux network manager configure
 
Linux network manager configuration
Linux network manager configurationLinux network manager configuration
Linux network manager configuration
 
Emacs tutorial
Emacs tutorialEmacs tutorial
Emacs tutorial
 
Command line for the beginner - Using the command line in developing for the...
Command line for the beginner -  Using the command line in developing for the...Command line for the beginner -  Using the command line in developing for the...
Command line for the beginner - Using the command line in developing for the...
 

Recently uploaded

Recently uploaded (20)

Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 

Augusta Linux User Group - Vim Introduction

  • 1. ViM – A text editor About 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
  • 2. ViM – A text editor What is Vim? ● Vim is a text editor. Not a word processor. ● Based on the vi text editor. ● You can't 'WYSIWYG' it. Through syntax highlighting, you can get close. That's not its purpose, however. History Vi ● 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.
  • 3. ADM-3A Terminal Photo courtesy: http://www.nekochan.net
  • 4. ADM-3A Keyboard Photo courtesy: http://www.vintagecomputer.net
  • 5. ViM – A text editor Vim (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.
  • 6. ViM – A text editor Feature 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. It's 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.
  • 7. 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.
  • 8. ViM – A text editor Navigation When 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 line e – place cursor at the end of the next word. (dog, ford, cigar) w -- set cursor to the beginning of the next word b -- set cursor to the beginning of the previous word E – place cursor at the end of the next non-blank spaced character (dogfood”, ford-focus”, cigar^box') – Same for W and B respectively Tab -- normal function "." -- Repeat action yy -- 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)
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. ViM – A text editor Follow-up items from the discussion: Is there a vi mode in ZSH? Yes. It apparently doesn't behave as you would expect. A couple of Google searches yielded some blog 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) :vsplit To 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 don't execute them 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. For example, CTRL+ws, 's' would be the key to tap after 'CTRL w'.
  • 17. ViM – A text editor Links: www.vim.org www.viemu.com http://arstechnica.com/information-technology/2011/11/two-decades-of-productivity-vims-20th-ann http://en.wikipedia.org/wiki/Vi http://en.wikipedia.org/wiki/Vim_(text_editor) Questions?