Wayne State University

AIM HIGHER

Wayne State University

High Performance Computing Services

vim

HOW TO EDIT TEXT USING THE VIM TEXT EDITOR

Follow these steps to use the Vim text editor.
Vim (Vi IMproved) is a text editor. Download this cheatsheet for basic commands to use in Vim.
VI Editor Cheatsheet
Logon to the Grid.
Use vim to modify one of your files. In this example, I am editing the text file "Grid_User". Type vim filename then press Enter.

  Input: vim Grid_User
You will now see the text of the original file.

  Text input into vim: Hello. My name is Grid User. Have a nice day. We can use the Grid for research.
To insert text, press the "I" key. You will notice the words "INSERT" near the bottom. Move the cursor where you want to input text by using the arrows keys and then type. Here one sentence was added beneath the previous text.

  Text input into vim: Hello. My name is Grid User. Have a nice day. We can use the Grid for research. This is a tutorial in using vim for text editing.
To exit, saving your changes, press the Esc key (this takes you out of Insert mode). Now press the colon key, and then type wq (:wq). (This stands for write and quit, meaning you want to save and quit.) Press enter. (If you want to just save you can type :w and if you want to quit without saving changes you can type :q!)

  Lower-left-corner: wq is typed, which gives the command to write and quit.
You have now edited a file and saved it.
Computer Center Services * 5925 Woodward Avenue Detroit, Michigan 48202