Difference between revisions of "Vi"
From MyWiki
(Created page with "'''Delete all white space till end of line''' :%s/ [ ]*$//") |
|||
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | '''Delete all white space till end of line''' :%s/ [ ] | + | '''Delete all white space till end of line''' :%s/ *$//g <br> |
+ | <br> | ||
+ | [Control][b] - Move back one full screen<br> | ||
+ | [Control][f] - Move forward one full screen<br> | ||
+ | [Control][d] - Move forward 1/2 screen<br> | ||
+ | [Control][u] - Move back (up) 1/2 screen<br> | ||
+ | Delete blank lines : :v/./d<br> | ||
+ | <source lang="text"> | ||
+ | :v/./d | ||
+ | or | ||
+ | :g/^$/d | ||
+ | or | ||
+ | :%!cat -s | ||
+ | </source> | ||
+ | Vim Setting colours example - :highlight Normal ctermfg=grey ctermbg=darkblue<br> | ||
+ | |||
+ | |||
+ | Try adding ????????? <br> | ||
+ | set background=dark<br> | ||
+ | to your .gvimrc too. This work well for me.<br> | ||
+ | |||
+ | '''Delete blank lines'''<br> | ||
+ | :g/^$/d<br> |
Latest revision as of 08:22, 1 September 2016
Delete all white space till end of line :%s/ *$//g
[Control][b] - Move back one full screen
[Control][f] - Move forward one full screen
[Control][d] - Move forward 1/2 screen
[Control][u] - Move back (up) 1/2 screen
Delete blank lines : :v/./d
:v/./d or :g/^$/d or :%!cat -s
Vim Setting colours example - :highlight Normal ctermfg=grey ctermbg=darkblue
Try adding ?????????
set background=dark
to your .gvimrc too. This work well for me.
Delete blank lines
- g/^$/d