Editing Text Files With Vim [Linux]

Vim Logo
A key design principle of Linux is that information is stored in text-based files. Text files include
both flat files with rows of similar information, such as configuration files in /etc, and Extensible Markup Language (XML) files, which define data structure through text tags, seen in application configuration files throughout both /etc and /usr. The advantage of text files is that they can be moved or shared between systems without requiring conversion, and can be viewed and edited using any simple text editor.

Vim is an improved version of the vi editor distributed with Linux and UNIX systems. Vim is highly
configurable and efficient for practiced users, including such features as split screen editing, color formatting, and highlighting for editing text.

When first opened, Vim starts in command mode, used for navigation, cut and paste, and other text manipulation. Enter each of the other modes with single character keystrokes to access specific editing functionality

[First of all you need to install Vim if you are not already, simply type yum install vim to install vim editor]

  1. An i keystroke enters insert mode, where all text typed becomes file content. Pressing Esc returns to command mode.
  2. A v keystroke enters visual mode, where multiple characters may be selected for text manipulation.
  3. The : keystroke begins extended command mode for tasks like writing the file to save it, and quitting the Vim Editor.
    1. Enter : w to write (save) the file and remain in command mode for more editing.
    2. Enter : wq to write the file and quit Vim.
    3. Enter : q! to quit Vim, but discard all file changes since the last write.
  4. In Vim, copy and paste is known as yank and put, using command characters y and p. Begin by Positioning the cursor on the first character to be selected, then enter visual mode. Use arrow keys to expand the visual selection. When ready, press y to yank the selection into memory. Position the cursor at the new location, then press p to put the selection at the cursor.

Watch Video Tutorial





Tech info

Comments

  1. Nice Article and it is very useful. If you want I can share article to you related to technology.

    ReplyDelete
  2. Good job . Help full post

    And it is working too........

    In a word your website is osam

    SEO , science and online earning

    ReplyDelete
  3. nice article thanks for sharing see more about me on my site earntouch

    ReplyDelete
  4. This comment has been removed by a blog administrator.

    ReplyDelete

Post a Comment