|
楼主 |
发表于 2007-10-2 02:13:09
|
显示全部楼层
show line number and fill tab with spaces in vi
Often, you might want to delete a set of arguments within bash scripts in Unix/Linux environments as an admin.
So you might think "dw" (delete word) does the job, because it often does it actually. BUT! In Unix/Linux environments
you might also interpret a word in a different way, e.g. a "/path/to/file" can be seen as just one word in terms of the
number of arguments. In that case, "dw" will not delete "/path/to/file", instead it will interpret every slash "/" as a seperate
word, so you have to enter "dw" 6 times.
Instead, you can dynamically enter your own, currently needed delimiter without changing vim';s global behavior in .vimrc
by just typing "df " (d like Donald, f like **** and then just a whitespace). By doing this, you tell vim to interpret its current
position until the next occurance of " " (whitespace) as a word.
You can easily adapt this style of deleting "words" by replacing whitespace by your own character.
Maybe you want to delete a whole sentence, then you want to type "df.". There are many thinkable usages.
Once you get used to it you can work "yet another bit" more productive. There no limit to productivity.
Thank what i like about vi(m). |
|