Kamaraju S Kusumanchi wrote:
Using Debian Etch (stable), vim 7.0.122

Inside ~/.bashrc, I have a function

# Use gvim as a manpage reader
function wman {
  /usr/bin/man $* | /usr/bin/col -bp | /usr/bin/iconv -c | \
  /usr/bin/gview -c 'set ft=man nomod nolist' -
}

This opens the man page in a new gview window. However, this invocation does
not result in a title for the newly opened gview window. I want to set the
title of gview window to the 2nd argument of the bash script. How can I do
this?

For example if I do

wman whoami

I want the newly opened gview's title to be set to whoami.

I tried

/usr/bin/gview -c 'set ft=man nomod nolist titlestring="$1"' -
/usr/bin/gview -c 'set ft=man nomod nolist titlestring=$1' -

but both do not work. How can I expand $1 and set the window title
appropriately?

thanks
raju


try (untested)

        gview --cmd "set ft=man nomod nolist title titlestring=$1" -

- Double quotes should let the shell expand the positional parameter $1
- --cmd is applied before sourcing the vimrc; it may or may not be wise.


Best regards,
Tony.
--
It is difficult to produce a television documentary that is both
incisive and probing when every twelve minutes one is interrupted by
twelve dancing rabbits singing about toilet paper.
                -- Rod Serling

Reply via email to