Skip to content

esch3r/VimTutorials

Repository files navigation

Vim Editor

VimTutorials

Resources for learning Vim.

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'

Vimesque file managers

Vimesque web browsers

Recommended Peripherals


Exercises

Do the excercises below in the following order:


Getting Started

Curl

Instance:

  'curl -o VimTutorials.gz https://github.com/esch3r/VimTutorials'

Git

Another way to yank these files to view them in console is with the git clone command.

'$ git clone https://github.com/esch3r/VimTutorials'

.vimrc Config

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 '~'.

1. Basic Configuration

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/'


Lesson 1. Entering/Exiting Vim

  1. Open a file with Vim FirstLesson.txt
  2. Once in vim hit i to enter insert mode. Write some random sentences for practice later. When finished hit the esc key.
  3. 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.
  4. 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

Lesson 2. Modes within vim

alt text

Insert:

  • Modify the file inserting new text.

Visual:

  • 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.

Normal:

  • Default mode
  • Allows quick mauevers through the text.
  • Switching between other modes.

Select:

Command:

Lesson 3. Navigating text

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

Lesson 4. Window Pains

Keystroke Function
hsp Horizontally split window
vsp vertically split window
Shift+W Traverse between windows

Lesson 5. Searching

keystroke Function
/PaTTeRn Search forward for PaTTeRn
?PaTTeRn Search backward for PaTTeRn
n Repeat foward search
N Repeat backward search

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published