Difference between revisions of "Vi, Vim, Vscode editors"

From Ever changing code
Jump to navigation Jump to search
Line 11: Line 11:
  :%s/wily/trusty/g    #substitute all ''wily'' with ''trusty'' in all document
  :%s/wily/trusty/g    #substitute all ''wily'' with ''trusty'' in all document
  :s/wily/trusty/g    #substitute only in the current line
  :s/wily/trusty/g    #substitute only in the current line
;Undo and redo
  u -undo last change
  Ctrl-R -redo changes which were undone (undo the undos). '.' to repeat a previous change, at the current cursor position


= VIM only =
= VIM only =

Revision as of 15:35, 26 March 2016

VI or VIM

drop to bash
:!bash   or   :!sh
edit other file
:e file.txt    #autocomplite works
redirect command STDOUT to the current edited file in the cursor position
:r!dir
show line number
:set number    or  :set nu
find and replace VI translates to substitute
:%s/wily/trusty/g    #substitute all wily with trusty in all document
:s/wily/trusty/g     #substitute only in the current line
Undo and redo
 u -undo last change
 Ctrl-R -redo changes which were undone (undo the undos). '.' to repeat a previous change, at the current cursor position

VIM only

Split
:split   or   :vsplit

C^w, c -close current window C^w, C^w - switch between windows