Difference between revisions of "Hdi2u S16"

From wiki
Jump to: navigation, search
(Created page with "== Getting by in only normal mode == * movement keys, "w" jump via start of words; "e" jump via ends; "fc" jump to next c * "0" for start of line, "A" for end of line and int...")
 
(No difference)

Latest revision as of 22:35, 19 April 2017

Getting by in only normal mode

  • movement keys, "w" jump via start of words; "e" jump via ends; "fc" jump to next c
  • "0" for start of line, "A" for end of line and into insert mode
  • "x" delete current character, "xp" switch positions of current and next character
  • "yyp" copy current line and paste it underneath
  • "dd" delete line, "2d" delete this and following two lines. "dgg" delete to start, "dG" delete to end
  • "dw" delete current word
  • Command: Activated by ":", sub-box at the bottom open, rich command language
  • Visual: Activated by "v" or "V" (visual block), sub-box at the bottom open, rich command language

Advanced but really useful commands

  • ":colorscheme desert" chang to the desert colour scheme, "morning" "delek" many others
  • :%s/\(sn\)oo\(ze\)/\1ee\2/gc change all instance of snooze to sneeze
  • :%s/snooze/sneeze/gc also works
  • :g/sneeze/d delete all lines without sneeze"
  • :v/sneeze/d delete all lines with sneeze"
  • ":42y[RET]p" paste line 42
  • "d214G" delete to line 214
  • "y214G" delete to line 214

Exercises

  • Use vim to open multiseqs_1.blastx
vim multiseqs_1.blastx
  • Type :set list, what extra are you seeing?
  • Type :set nu what extra are you seeing?
  • Create a file-listing by:
ls * > my.list
  • use v/multiple/d to delete verything that doesn't say "multiple"