Tag Archive
3D 3dprinting android ant BigData bitcoin Browsers C/C++ cryptocurrency CSS dd ddrescue dogecoin DOS editors find Games Git hadoop html html5 Java Linux litecoin node perl Postgres Programming Python scripting Shell SQL Swing TOTK Utilities utilization vi Video Web Web Design Wifi Windows Wordpress XML Zelda
VI: Reload Current file
When I am editing and having a “clumsy fingers” day, I find that I have to reload the file that I am editing from disk repeatedly. I usually just do a quick “:q!” and re-run the vi command that opened the file. But there is a better way!
Use the :edit command:
:edit
Or you can shorten it to
:e
Now if you have typed in the window you are editing and want to reload from disk anyway without saving, remember to add the exclamation point(!) to the command.
:edit!
or
:e!
Vi: toggle syntax highlighting
If you have ever used vi to edit source code, there are occasions where you get on a system that has a very difficult to read color mode. At these times you want the colors to just go away. You can use the following in command mode in vi:
This will toggle off the syntax highlighting mode.
:syntax off
This will turn it back on.
:syntax on
VI: Display tabs and end of lines
I was working on a system the other day and needed to see where the end of lines were and where there were tabs instead of spaces. And I found the list option to vi.
This will turn on the display of “$” to indicate the end of line and “^I” to indicate a tab.
:set list
This will turn off the option to display the end of line and tabs.
:set nolist
Toggle wrap in VI
This turns off word wrap in the vi window
:set nowrap
to enable it again:
:set wrap