YANVT: yet another neat vi trick 
Author Message
 YANVT: yet another neat vi trick

: I tend to write and rewrite a lot of shell scripts. It is
: not uncommon for me to have one shell script invoke another.
: This can be a nuiscance for finding the one you really want
: to edit when fixing bugs/adding new ones. Recently I have
: come across a solution that works nicely.

: Shell scripts running in sh or ksh treat ':' as an
: internally implemented /bin/true. This means that it
: ignores all of its arguments. vi uses ':' as the start
: of an ex command, and does not care about whitespace after
: the colon. In this way I can keep ex commands permanantly
: embedded in shell scripts without causing execution
: problems. In particular I can do this:

:       . $DIRECTORY/shell-script
:       : e ~/directory/shell-script

: If I want to go off and look at the subscript, I can just
: yank the colon line into a register and execute it. I
: usually do this with a macro:

:       " Yank the current line into register y and execute it

: It can also be useful for storing complex substitutions near
: places they are useful, eg this one from my ksh environment
: file for converting csh-isms to ksh-isms:

:       : %s/^setenv \(.[^ <tab>]*\)[ <tab>]*/export \1=/

: Ain't vi grand?

: Elijah
: ------
: from the guy who brought you #!/bin/vi and the vi sig virus

Same is in VHDL possible: put -- (Comment for VHDL comp.editors folks ;)
in front of the vi/ex commands.

Really nice!


Joerg Schoeppe - Labor Mikroelektronik - FH-Muenchen

Key fingerprint =  C1 58 7A 1E BD 88 75 6B  21 8E 80 78 CB 09 67 7C

Sat, 30 Jan 1999 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Neat Net Tricks

2. A Neat ALC Trick

3. Programming BIOS Flash Roms -- Neat trick!

4. Neat Fortran/Numerical tricks

5. Neat scripting trick...

6. Yet Another Newbie Question: Stupid Clock tricks, Part II.

7. Neat trick: `n' listboxes scrolled with one scrollbar

8. Vi Name string for NI print panel vi - how to get dynamically for vi the print panel vi is in.

9. Using control reference with a Sub-vi over a TCP VI Server connection

10. Using control reference with a Sub-vi over a TCP VI Server connection

11. Unlock VI, File>>VI Properties dosn't work

12. Create an Exe of a VI that controls another VI


Powered by phpBB® Forum Software