vim

Vim TerminalRoot

stty -ixon # 30 min

things to do after vimtutor

By reading the contents of this repository I realized that these are the things to do after finishing the vimtutor:

things I wanna do

things I wanna learn

cheatsheet

This is personal. I'm not taking notes of things I already memorized.

The commands are usually composed of a verb and a noun. Example: dw, stands for delete a word.

Tip: usually the same key used two times in a row applies the verb in the whole line. Examples: dd deletes the whole line, cc change the whole line.

motion

See :h motion for more info.

mapping summary
f<char> (f)ind a char forward in a line and move to it (F goes backward)
t<char> find a char forward in a line and move un(t)il it (T goes backward)
; repeat last f, F, t or T command
, repeat last f, F, t or T command, but in opposite direction
H, M, L move (H)igh, (M)iddle, or (L)ow within the viewport
C-u, C-d move (u)p or (d)own

Text Objects

Tip: prefer using text-objects rather than motions in order to increase repeatability.

See :h text-objects for more options.

mapping operation
iw, aw "inner word", "a word" (a word includes the space)
is, as "inner sentece", "a sentece"
ip, ap "inner paragraph", "a paragraph"
i), a) "inner parenthesis", "a parenthesis"
i', a' "inner single quote", "a single quote"
it, at "inner tag", "a tag" (HTML tag)

random tips

basic .vimrc options

colorscheme evening
set number
set tabstop=2
set showcmd
set cursorline " gutter

sensible.vim

Avoid too much configurations, but take a look at this one (which claims to be "defaults everyone can agree on"):
https://github.com/tpope/vim-sensible

It enables things like <C-L> to clear hlsearch, <C-W> to delete previous word when in INSERT mode, etc.

install vim-plug

The vim-plug is useful to install/update vim plugins.

Here's a way to install it at startup:

if empty(glob('~/.vim/autoload/plug.vim'))
  silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

video: Mastering the Vim Language

Syntax of the language: Verb + Noun

Example:

Some verbs:

Some nouns related to motions:

Some nouns related to text objects:

Some nouns related to parameterized text objects

Tips:

plugin suggestions

vimwiki

Questions to be answered:

https://thorstenball.com/blog/2012/07/09/vim-learning-resources/