1 Aug 2006 10:31
Re: vim -S
Yakov Lerner <iler.ml <at> gmail.com>
2006-08-01 08:31:09 GMT
2006-08-01 08:31:09 GMT
On 7/31/06, mwoehlke <mwoehlke <at> tibco.com> wrote: > A.J.Mechelynck wrote: > > Rodolfo Borges wrote: > >> I made a file with vim commands, starting with > >> #!/usr/bin/vim -S > >> so I can execute the file directly, instead of using "vim -S file". > >> The problem is that vim tries to execute this first line too. > >> > >> Can we have a workaround on this? > >> Like, ignoring "#!" at the start of a command, instead of giving the > >> "no ! allowed" error? > >> Or am I having it all wrong? > >> > > > > Method I: > > -----8<----- foo (or whatever) > > #!/bin/bash > > vim -S foo.vim > > ----->8----- > > then put the rest in foo.vim and do "chmod a+x foo" or "chmod 0755 foo". > > > > Method II: add to one of your shell startup scripts (~/.bashrc or > > whatever): > > > > alias foo='vim -S ~/foo.vim' > > > > Commentary: > > In a vim script, the first line has no special meaning. Empty lines, > > blank lines (i.e. consisting only of spaces and/or tabs) and lines > > starting with zero or more spaces or tabs plus a double quote are(Continue reading)
) in vim is to press
ctrl-f5 and have a word show up in the string
:vimgrep/WORD/j c:/projects/foo/**/*.[ch]
I know how to do this in a kludgy way, by yanking the word with viwy.
However, that "kills" the * register. The question is whether it is
possible to do what i want through some temp register, without "killing"
the * (or using the * and then restoring it):
I could map ctrl f5 to something like (kludgy):
nmap <C-F5> <ESC>viwy:vimgrep/<S-Insert>/j c:/projects/kopera/**/*.[ch]
map! <C-F5> <ESC>viwy:vimgrep/<S-Insert>/j c:/projects/kopera/**/*.[ch]
There must be a prettier way of doing that (and a way which does not
kill the *)
Could someone please point me to the right direction?
thanks,
denis
RSS Feed