DEV Community

Shahriyar Al Mustakim Mitul
Shahriyar Al Mustakim Mitul

Posted on

Edit your files in vim

Edit the file with vim:

Open the file in vim with the command "vim".

For example:
#vim /etc/iscan/intscan.ini

Type "/" and then the name of the value you would like to edit and press Enter to search for the value in the file.
Enter fullscreen mode Exit fullscreen mode

Image description

Search with "/"

If more than on instance of the search string was found you can use "n" to go to the next instance or "?" to go to the previous one.
Type "i" to enter insert mode.

Modify the value that you would like to change using the arrow keys on your keyboard.
Enter fullscreen mode Exit fullscreen mode

Image description

Modify file in insert mode

Press ESC and then type ":wq!" then press Enter to save the changes and exit vim.

If you would like to exit the file without making any changes press ESC, then type ":q!" and press Enter.
Enter fullscreen mode Exit fullscreen mode

Image description

Latest comments (0)