Yakov Lerner | 1 Aug 2006 10:31
Picon

Re: vim -S

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)

Matthew Winn | 1 Aug 2006 12:55
Picon

Re: vim -S

On Mon, 31 Jul 2006 16:19:28 -0300, "Rodolfo Borges"
<rodolfo.borges <at> gmail.com> 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?

One way is to create a file that is both a valid shell script and
a valid Vim script by starting the file with the following line:

"exec" vim -S $0 "$ <at> "
[vim commands go here]

(That's a dollar-zero after the -S, not dollar-capital-O.)  When the
shell runs this file it sees the exec command and runs Vim.  Because
$0 is the name of the script Vim opens the script and executes it,
but it ignores the first line because it sees it as a comment.

--

-- 
Matthew Winn

mwoehlke | 1 Aug 2006 17:22
Favicon

Re: vim -S

(On the list, please?)

Rodolfo Borges wrote:
> mwoehlke 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:
(Continue reading)

Charles E Campbell Jr | 1 Aug 2006 17:38

Re: Bug: Can't select bottom window by mouse-clicking

A.J.Mechelynck wrote:

> No it doesn't (and I'm using almost the same as yours, i.e., Huge 
> version 7.0.42 with GTK2-GNOME GUI) on SuSE Linux 9.3 Professional.
>
> With my own vimrc I get it even with no editfile.
>
> A little experimenting shows that the e flag must be absent from 
> 'guioptions' for the bug to manifest. Here's a new testcase:
>
>   gvim -N -u NONE
>     :set go-=e stal=2 wmh=0 wh=999
>     :new
>
> Now click on both status lines in alternation and see what happens. 
> (Clicking inside the bottom window does select it, but with ":set 
> wmh=0 wh=999" this is usually not possible.)

OK, with this  (I also included a "-u NONE") I was unable to select the 
bottom window by clicking on it.
Interestingly, after a ctrl-w j to select the bottom window by moving 
the cursor to it, I was able to click
on the upper window status line with the mouse to select it.

Consider it duplicated!

For those who are silently browsing: the 'e' option in guioptions is 
supposed to

    "Add tab pages when indicated with 'showtabline'"
(Continue reading)

A.J.Mechelynck | 1 Aug 2006 18:19
Picon

Re: Bug: Can't select bottom window by mouse-clicking

Charles E Campbell Jr wrote:
> A.J.Mechelynck wrote:
> 
>> No it doesn't (and I'm using almost the same as yours, i.e., Huge 
>> version 7.0.42 with GTK2-GNOME GUI) on SuSE Linux 9.3 Professional.
>>
>> With my own vimrc I get it even with no editfile.
>>
>> A little experimenting shows that the e flag must be absent from 
>> 'guioptions' for the bug to manifest. Here's a new testcase:
>>
>>   gvim -N -u NONE
>>     :set go-=e stal=2 wmh=0 wh=999
>>     :new
>>
>> Now click on both status lines in alternation and see what happens. 
>> (Clicking inside the bottom window does select it, but with ":set 
>> wmh=0 wh=999" this is usually not possible.)
> 
> OK, with this  (I also included a "-u NONE") I was unable to select the 
> bottom window by clicking on it.

I didn't include -U NONE (with uppercase U) for two reasons, each of 
which is sufficient by itself:

1) -u NONE (with lowercase u) suppresses sourcing of vimrc, plugins 
_and_ gvimrc.
2) I don't have a gvimrc anyway.

> Interestingly, after a ctrl-w j to select the bottom window by moving 
(Continue reading)

Nicolas Schodet | 1 Aug 2006 21:23

Re: Suggestion for a change to compiler/gcc.vim

* Nikolai Weibull <now <at> bitwi.se> [060722 12:08]:
> I am the maintainer of compiler/gcc.vim and I would like to propose
> the following change to its errorformat:

>  <at>  <at>  -20,7 +20,8  <at>  <at>  setlocal errorformat=
>       \\"%f\"\\,\ line\ %l%*\\D%c%*[^\ ]\ %m,
>       \%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
>       \%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
> -      \%DMaking\ %*\\a\ in\ %f
> +      \%DMaking\ %*\\a\ in\ %f,
> +      \%-G%.%#
>
> let &cpo = s:cpo_save
> unlet s:cpo_save

> The reason for this change is that I find it tiresome that whenever a
> successful build it built, I have to press enter twice to first get
> through the "shell output is finished, please hit Enter" prompt and
> then "Hi, I'm gcc command-line number one that successfully compiled
> file so and so, and hey, there are 18 more of these commands waiting
> for you to look through, so please begin by hitting Enter".
> So the addition of %-G%.%# to exclude anything but the defined formats
> from the listing saves us the trouble of seeing useless compiler
> command-lines in the list of changes.
> However, this is a rather drastic measure, and may cause messages that
> people rely on to go missing.  If so, then this patch is perhaps not
> for public consumption.  We do have the chance to add these messages
> to the errorformat, however, so if someone has any suggestions, please
> do pass them on.
> Any comments?
(Continue reading)

Rodolfo Borges | 2 Aug 2006 00:06
Picon
Gravatar

feature proposal: ":tabe file1 fileN" and ":sp file1 fileN"

I wanted to open a new tab, to edit three files, splited in their own
three windows.

I tried ":tabe file1 file2 file3", vim complained "Only one file name allowed".

Then I tried ":tabnew" and ":sp file1 file2 file3", it also didn't work.

My proposal:

Open N tabs with
:tabe file1 file2 ... fileN

Open a new tab, with N splited windows with
:tabe -s file1 file2 ... fileN

Split N windows with
:sp file1 file2 ... fileN

What do you think?

--

-- 
Rodolfo Borges

A.J.Mechelynck | 2 Aug 2006 00:43
Picon

Re: feature proposal: ":tabe file1 fileN" and ":sp file1 fileN"

Rodolfo Borges wrote:
> I wanted to open a new tab, to edit three files, splited in their own
> three windows.
> 
> I tried ":tabe file1 file2 file3", vim complained "Only one file name 
> allowed".
> 
> Then I tried ":tabnew" and ":sp file1 file2 file3", it also didn't work.
> 
> 
> My proposal:
> 
> Open N tabs with
> :tabe file1 file2 ... fileN
> 
> Open a new tab, with N splited windows with
> :tabe -s file1 file2 ... fileN
> 
> Split N windows with
> :sp file1 file2 ... fileN
> 
> 
> What do you think?
> 

What does already work is, for instance

	:sp file1 | sp file2 | sp file3

or (untested; v7 only)
(Continue reading)

Denis Perelyubskiy | 2 Aug 2006 02:25

yanking into register and using that in command

hello,

I am trying to emulate textpad. In textpad, when cursor is over some
word and you press ctrl-f5 the search box pops up, and a word is in the
input area.

So, an equivalent behavior (at least for now :-)) 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
--

-- 
// mailto: Denis Perelyubskiy <lists at overwhelmTAKECAPITALSOUT dot net>
// icq   : 12359698

(Continue reading)

Ulrich Lauther | 2 Aug 2006 09:47
Picon

once again - how to unsubscribe?

Hi,

the automated mechanism for unsubsrcibing from this list still doesn't
work.
Could please someone remove me from the list?

Thanks,
--

-- 
	-lauther

----------------------------------------------------------------------------
Ulrich Lauther          ph: +49 89 636 48834 fx: ... 636 42284
Siemens CT SE 6         Internet: Ulrich.Lauther <at> siemens.com


Gmane