Tip #301: Edit files in path, or related.
tip karma |
Rating 5/2, Viewed by 901
|
created: |
|
August 7, 2002 0:09 |
|
complexity: |
|
intermediate |
author: |
|
Little Dragon |
|
as of Vim: |
|
5.7 |
You can write a little shell function that will let you easily edit any file that is in the path, or which's location can be retrieved with the whereis tool. This is something similar to what I have in /etc/profile:
function vvim() { vim `whereis $1|cut -d: -f2` }
function ggvim() { gvim `whereis $1|cut -d: -f2` }
Then just type, for example, "vvim ls", and you'll start vim with /bin/ls and /usr/share/man/ls.1.gz loaded :)
(it's not very useful to edit /bin/ls, but you get the ideea ;)
<<Making a tags file for IDL (Interactive Data Language) |
Use gvim in kmail >>
Additional Notes
|