Some time ago I choose Linux as my general operating system and that’s why I don’t have much experience with bash. I needed it not so often, because I’m simply a home user and not a developer. Yesterday, I updated the Emeranld Theme Manager and after that I could not load the GUI.
The reason of this problem was an update for Emerald Theme Manager, after that Beryl was unable to work properly.
To solve this problem I needed to edit the auto-start file.
But it was for me not so simply, because I’m a n00bi
I could use gEdit or Kate, but now I needed to work with vim.
With help of lynx I found a lot of different HowTos. With help of them I learned some useful commands and now I use vim more often than Kate or gEdit.
Here are some of important and useful commands:
Create or edit a file:
vi Filename (if the file exist, it will be opened, otherwise it will be created)
Editor-Mode: Insert
Command-Mode: Esc
Quit:
:q (if file was not edited)
:wq (save changes and exit)
:q! (ignore changes and exit)
Save a file:
:w
Delete line:
yy
Insert line:
p
Search:
/search-word – the document will be searched from the cursor position until end of the document
Search and replace:
:%s/search-word/replace-word – search-word will be replaced to replace-word
Syntax highlighting
:syntax on – activating of syntax highlighting
:syntax off deactivating of syntax highlighting
Line numbers:
:set number – activating of line numbers
:no number – deactivating of line numbers