Some of these resources may prove to be more useful to you than this document. Exercises provided below are constructed in such a way each build on each other. Consider this resource as a supplement to the links given below. Before doing that start 'vimtutor'
- Learn vim For the Last Time: A Tutorial and Primer
- Luke Smith's Youtube Vim tutorials
- Vim Tutorial for Beginners: vimtutor
- Dr. Chip's Vim Page
- VIM Cheatsheet
- Vi Keybindings
- OpenVim Tutor
- Groking Vim
- Vim Regex
'curl -o VimTutorials.gz https://github.com/esch3r/VimTutorials'
'$ git clone https://github.com/esch3r/VimTutorials'
Its common to place the .vimrc configuration file '/etc/vim/vimrc/' or '/etc/vimrc/' another alternative which works well if the default .vimrc is read-only is to place it in your home directory '~'.
Upload git respository for pathogen into the following file path: '~/.vim/autoload/pathogen.vim'
Or copy and paste the following into your terminal/shell 'mkdir -p ~/.vim/autoload ~/.vim/bundle && '
'curl -LSso /.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim'
For each plugin upload them inside bundle folder
'/.vim/bundle/'
- Open a file with Vim FirstLesson.txt
- Once in vim hit i to enter insert mode. Write some random sentences for practice later. When finished hit the esc key.
- Repeat this text selection, as many times as the task requires:
- Using the arrow keys move the cursor about the screen.
- Enter visual mode by pressing v
- Highlight text using the cursor in visual mode using the arrow keys.
- Press y to yank or otherwise known as copy the selected text.
- Move using arrow keys again to intended location in the text to paste
- Press p to paste selected text in question.
- Upon exiting and saving your progress preform following keystokes listed below in the table to write or discard file edits:
Keystroke | Function |
---|---|
:w or w file | save changes to buffer or safe file to new file |
ZZ or :wq | Save changes and quit |
:q! | quit without saving |
- Modify the file inserting new text.
- Visually select text by moving cursor over it, then operate over the text thats selected.
- Visual mode has many different subtypes: visual, block visual, and linewise visual.
- Default mode
- Allows quick mauevers through the text.
- Switching between other modes.
Keystroke | Function |
---|---|
h | Move cursor left |
l/spacebar | Move cursor right |
k/Ctrl+p | Move cursor up |
J/Ctrl+n | Move cursor down |
w | Move cursor up |
b | Move cursor down |
e | Move cursor up |
W | Move cursor down |
B | Move to beginning of previous word before whitespace |
E | Move to end of word before a whitespace |
0 | Move to the beginning of the line |
$ | move to the end of the line |
Keystroke | Function |
---|---|
hsp | Horizontally split window |
vsp | vertically split window |
Shift+W | Traverse between windows |
keystroke | Function |
---|---|
/PaTTeRn | Search forward for PaTTeRn |
?PaTTeRn | Search backward for PaTTeRn |
n | Repeat foward search |
N | Repeat backward search |