Sunday, February 28, 2010

Re: Split window automatically when opening 2 or 3 files

On 03/01/10 21:39, Gary Johnson wrote:
> On 2009-12-31, Brock Henry wrote:
>> Hi,
>>
>> I want to have Vim (on Windows), automatically split the window if I open two
>> files (using right-click explorer integration - Open in Single VIM Window).
>>
>> Actually, a new right-click integration that did this (Open in split VIM
>> Window), would be perfect.
>>
>> Is there anyway to do this?
>
> I don't have a Windows machine handy at the moment so I can't test
> this, but it seems to me that you should be able to test in your
> _vimrc for the presence of more than one file name in the argument
> list with the argc() function, then if the number of arguments is
> greater than 1, execute ":all". See
>
> :help argc()
> :help :all
>
> HTH,
> Gary
>
>

Note that if you set 'winheight' to a high value in your vimrc in order
to make window sizes change dynamically (and the current window always
be the biggest one), you must use ":all" _before_ setting 'winheight',
otherwise it won't work.


Best regards,
Tony.
--
It is generally agreed that "Hello" is an appropriate greeting because
if you entered a room and said "Goodbye," it could confuse a lot of
people.
-- Dolph Sharp, "I'm O.K., You're Not So Hot"

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Can't remap

sidgalt@gmail.com schrieb:
> Hey,
>
> I just installed a vim c/c++ plugin from here
> http://www.vim.org/scripts/script.php?script_id=213.
>
> Now I'm unable to map <C-j> to any command (I usually map it to 4j)
>
> Any help would be appreciated.
>
> Thanks
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
With the following two lines in my ~/.vimrc
the mapping for 'C-j' works for me:

let g:C_Ctrl_j = 'off'

nmap <silent> <C-j> 4j

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Programmatically detect a current "highlight" setting?

I'm writing a plug-in and want to temporarily hide the cursor.

It would be really neat if I could do "highlight Cursor NONE" and
later restore the highlight setting to whatever it was before.

But I am not sure how to capture the old setting. Evidently "highlight
Cursor" _echoes_ the current setting, but doesn't actually return
anything that I could capture programmatically.

Anything I can do?

Cheers,
Wincent

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: building console version on unices (was: iMac slow in vi)

On 27/02/2010, at 08:17 PM, Florian Rehnisch wrote:

> * Miklos Somogyi <msom@netspace.net.au> [100227 09:28]:
>> On 27/02/2010, at 06:20 PM, Florian Rehnisch wrote:
>>
>>> You get a certain speedup when you use the console version and build vim
>>> w/o gui facilities.
>>>
>>> This is my shell function receipt:
>>> #v+
>>>
>>> function mkvim() {
>>> ./configure \
>>> --prefix=/opt/vim \
>>> --disable-gui \
>>> --without-x \
>>> --with-features=huge \
>>> --enable-perlinterp \
>>> --with-compiledby='Florian "eix" Rehnisch <eixman@gmx.de>' &&
>>> make
>>> }
>
>> Having lurked here a few days I could see that vim has grown
>> enormously from my familiar vi, like word processor or more. I suspect
>> that contributes to the slowness of the complete system.
>
> Ohh, that's not too bad. Purists suggest nvi. ;-)
>
>> I'd like to try building a console version as you suggests, but how do
>> I get to do it?
>
> Tony made a HowTo on compiling Vim on unices. See
> http://users.skynet.be/antoine.mechelynck/vim/compunix.htm
> See also ':h usr_90'.
>
>> And where is the place of your shell function
>> receipt?
>
> It lives as a stanza in my ~/.zshrc. Bash users go with ~/.bashrc.
> Lovers of small inition files would put the part between {} in a shell
> script ~/bin/mkvim, whoose first line is sth. like '#!/bin/sh'.
>
> Still questions? Don't refrain to ask ;-)
> --
> flori
> Vim-Hilfe auf Deutsch http://www.florianrehnisch.de/vimhelp/
> WARNING: PRGRAMMING BUG IN E2FSCK!
> OR SOME BONEHEAD (YOU) IS CHECKING A MOUNTED (LIVE) FILESYSTEM.
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php


Thank you Florian,

As I am not a big Nix-er, I'll need a very calm day alone to go through with this installation.
I'm sure I'll need to find and download a lot of things Vim needs.
Probably I'll do what you suggested because vim's slowness really bothers me.

Again, thank you,

Miklos

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: FedoraCore 8

> 1) Build of sources might not work since the installation might
> not have some "developer" packages needed for the build
> process. One would think that an installation of Fedora would
> have "everything" whereas an installation of "RedHat" might
> miss some developer packages but I found a Fedora 8 install
> that did not have things needed to build vim!

This is true for all mainstream Linux distributions: you may need 50G
disk spaces to install all developer packages or some 100G to install
"everything".

Believe me, you won't want to install everything and you don't even want
to download everything.


> 4) On Fedora, one can use the "yum" command; for example, on
> Fedora 8, "yum install vim-enhanced" will install vim 7.1 with
> patches 1-242. Note that the rpm listed in the link at (2),
> viz., vim-enhanced-7.1.135-1.fc8.i386.rpm, has only 135 patches
> but yum was able to install vim-enhanced with 242 patches; no
> idea where yum found this! (The latest version of vim that
> yum finds on Fedora 5 is 7.0.042.)

You'll have a hard time if you don't know how to use the "package
manager". Because most mainstream Linux distributions are much bigger
than a DVD and they won't install everything by default.

The installation media gives you a basic system, the package manager
helps you find what you want in the remaining 100G.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Smart expandtab at beginning of line vs in mid-line?

John Beckett schrieb am 01.03.2010 um 11:25:35 (+1100):
> Michael Ludwig wrote:
> > For indenting at the beginning of the line, I want tabs.
> > But in mid-line, I want them to be expanded to spaces.
>
> The first has general principles; the second is on your point:
> http://vim.wikia.com/wiki/Indenting_source_code
> http://vim.wikia.com/wiki/Indent_with_tabs,_align_with_spaces

Thanks! I had read the first but not the second. Excellent
documentation!

Smart Tabs (ctab.vim) 1.4.1 does exactly what I want.

The newer version 2.1, however, seems to be less robust. I got
the following error messages right after hitting "o" to insert
lines:

=<SNR>12_CheckAlign(line('.'))."\<END>"
Error detected while processing function <SNR>12_CheckAlign:
line 25:
E121: Undefined variable: inda
Press ENTER or type command to continue
Error detected while processing function <SNR>12_CheckAlign:
line 25:
E15: Invalid expression: inda / 50
Press ENTER or type command to continue
Error detected while processing function <SNR>12_CheckAlign:
line 26:
E121: Undefined variable: inda
Press ENTER or type command to continue
Error detected while processing function <SNR>12_CheckAlign:
line 26:
E15: Invalid expression: inda % 50
Press ENTER or type command to continue
Error detected while processing function <SNR>12_CheckAlign:
line 28:
E121: Undefined variable: indatabs
Press ENTER or type command to continue
Error detected while processing function <SNR>12_CheckAlign:
line 28:
E15: Invalid expression: indatabs*&tabstop + indaspace == indb
Press ENTER or type command to continue

Posting this only for informative purposes - so far, I'm happy
with version 1.4.1.

Thanks again!
--
Michael Ludwig

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Any limitation of autocmd when the bufdo is processing ?

On Fri, Feb 26, 2010 at 3:41 PM, winterTTr <winterTTr.vim@gmail.com> wrote:
Actually, i meet a problem like below.
I tried to update a specific "unlisted" buffer every time the BufEnter event happens.

the Code like below( just an example, not the real code ):
I am trying to use the "set eventignore+=BufEnter" and "set eventignore-=BufEnter" to prevent the
process from running recursively.

--------------------------begin-----------------------------------
function! TestFunc()
    set eventignore+=BufEnter

    let bufname = bufname("%")
    " move to specific window
    2wincmd w
    " update buffer
    call append( 0 , bufname )
    " move back
    1wincmd w

    set eventignore-=BufEnter
endfunction

autocmd BufEnter * call TestFunc()
--------------------------end--------------------------------------

Everything is OK until i do the bufdo command. such as "bufdo s/^/1/"
"E474: Invalid argument: eventignore+=BufEnter" message is shown.

I can NOT find any information in the documentation showing any limitation during the bufdo command.
And I hope anyone could give the answer to the following question:
1. Is there a limitation that you can NOT set the variable "eventignore" during the bufdo process?
2. If so, is the "eventignore" the only one or are there any other variable that have the same limitation?
3. Someone told me that the ""set eventignore+=BufEnter" is unnecessary, cause the "bufdo" itself would
    prevent the recursive running ? Is this the truth ?

Anyone can give some idea ? :-)
 


If you really want to reproduce the error, i attach the file to do this. Please follow the next step:
1. source the test.vim
2. run a bufdo command, such as ""bufdo s/^/1/"
And , the error would be shown.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

RE: vi, search string and comment line howto?

omonte7 wrote:
> Subject: vi, search string and comment line howto?

The answers to your previous post are here:
http://groups.google.com/group/vim_use/browse_thread/thread/3ff28355fd3416fa

John

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

RE: Smart expandtab at beginning of line vs in mid-line?

Michael Ludwig wrote:
> For indenting at the beginning of the line, I want tabs.
> But in mid-line, I want them to be expanded to spaces.

The first has general principles; the second is on your point:
http://vim.wikia.com/wiki/Indenting_source_code
http://vim.wikia.com/wiki/Indent_with_tabs,_align_with_spaces

John

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: vi, search string and comment line howto?

Did my reply not come through on the 26th?

In short, the pipe can be used to string together *ex* commands,
not normal-mode commands. Even then only certain ex commands can
be separated by the pipe as detailed at

:help :bar

I've pasted my original reply below in case it didn't come
through for you on the first pass.

-tim

>> Hello, I can't figure out the syntax to search
>> for a certain string and then comment out that
>> line. I know you can have multiple commands on
>> a single line, but I can't figure it out. As
>> an example I have a "file" with the following
>> contents:
>>
>> line 1 and stuff
>> line 2 contains my_string
>> line 2 and stuff
>>
>> Now I want to vi the "file" and comment out the line
containing "my_string"
>> by running the following commands:
>> vi file #to start editing "file"
>> /my_string #to search for the line I want to
comment, containing
>> "my_string"
>> I# #to append a comment (#) to the
beginning of the
>> current line
>> :wq #to write and quit
>>
>> I should be able to string all the above
>> commands together separated by a
>> pipe:
>> vi -c "/my_string | I# | :wq" file

You're passing command-line (Ex) commands to vim, not normal-mode
commands, so you can do this using ex commands instead:

vi -c "/my_string/s/^/#/" -c "wq" file.txt

Or, if you want to comment all instances of it:

vi -c "g/my_string/s/^/#/" -c "wq" file.txt

or even just do it in sed:

sed -iBAK '/my_string/s/^/#/' file.txt

-tim

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

vi, search string and comment line howto?

Hello, I can't figure out the syntax to search for a certain string and then
comment out that line. I know you can have multiple commands on a single
line, but I can't figure it out. As an example I have a "file" with the
following contents:

line 1 and stuff
line 2 contains my_string
line 2 and stuff

Now I want to vi the "file" and comment out the line containing "my_string"
by running the following commands:
vi file #to start editing "file"
/my_string #to search for the line I want to comment, containing
"my_string"
I# #to append a comment (#) to the beginning of the
current line
:wq #to write and quit

I should be able to string all the above commands together separated by a
pipe:
vi -c "/my_string | I# | :wq" file #give all the editing
commands to vi on the command line

vi file
/my_string | I# | :wq #or open the file in
vi and then enter the commands

but the above fails with: E486: Pattern not found: my_string | I# | wq

so, what am I doing wrong, anyone know how to accomplish searching for a
particular string and then comment out the line that it's on? Thanks.

--
View this message in context: http://old.nabble.com/vi%2C-search-string-and-comment-line-howto--tp27724017p27724017.html
Sent from the Vim - General mailing list archive at Nabble.com.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: iMac slow in vi

On 28 Feb 2010, at 22:47, Miklos Somogyi wrote:

>
> On 27/02/2010, at 09:34 PM, Keyan wrote:
>
>>
>> On 27 Feb 2010, at 02:23, Miklos Somogyi wrote:
>>
>>> Hello Folks,
>>>
>>> I bought a 27" i7 iMac. It is blazingly fast re any job, except in vi.
>>> E.g. inserting or deleting a character takes noticeable time.
>>
>> have you considered MacVim? i have a macbook pro, 2007, and its runs beautifully, both, gui and console mode.
>>
>> regards,
>> keyan
>
> Hello Keyan,
>
> Thanks, I just downloaded it. It still needs some TLC to set-up
> because it was installed deep under ~/Downloads and gave me an error message:
>
> 2010-03-01 08:32:39.019 MacVim[13906:903] FATAL ERROR: Failed to register connection with name 'org.vim.MacVim-connection'
>
> Also I could only shut it down with ctrl-c.
> Otherwise it looks speedier than vim.
>
> I'll play with it a bit, hopefully I can fix the problems.
> Thank you,
>
> Miklos

Hi,

glad to hear that i could help. there is a vim_mac mailing list that i recommend. bjoern, the main developer, is very fast in answering questions.

regards,
keyan

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Naive question: scrolling down keeping only 1 line

Hello Mat,

I have copied your code in the _vimrc of my local PC.
It works perfectly.

I have copied it in the _vimrc of my office PC on which I work from
home via a Remote desktop connection using VPN.
It works also very good, but you can see a very little trembling in
the display when you scroll down.

Finally, I have copied it in the .vimrc on a Linux server. I connect
to this server first by using the above Remote desktop connection,
then by launching Cygwin on the remote PC. The connection is rather
slow but still workable. Unfortunately in that case, you can clearly
distinguish the CTRL-F effect followed by the CTRL-E effect. It is
really unpleasant.

I think a script using CRTL-D with a correct calculation of "scroll"
would be better. I am not myself an expert of vim script language. So
you are welcome :-)

The best solution would be to ask Bram to include in Vim an "offset"
option which could be 0, 1, 2... but may be it is not so simple to
implement.

Best regards
Jean Johner

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: iMac slow in vi

On 27/02/2010, at 09:34 PM, Keyan wrote:

>
> On 27 Feb 2010, at 02:23, Miklos Somogyi wrote:
>
>> Hello Folks,
>>
>> I bought a 27" i7 iMac. It is blazingly fast re any job, except in vi.
>> E.g. inserting or deleting a character takes noticeable time.
>
> have you considered MacVim? i have a macbook pro, 2007, and its runs beautifully, both, gui and console mode.
>
> regards,
> keyan

Hello Keyan,

Thanks, I just downloaded it. It still needs some TLC to set-up
because it was installed deep under ~/Downloads and gave me an error message:

2010-03-01 08:32:39.019 MacVim[13906:903] FATAL ERROR: Failed to register connection with name 'org.vim.MacVim-connection'

Also I could only shut it down with ctrl-c.
Otherwise it looks speedier than vim.

I'll play with it a bit, hopefully I can fix the problems.
Thank you,

Miklos

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

RE: FedoraCore 8

Just to end the thread on installing vim on certain unix systems
(based on replies from Benjamin R. Haskell and Matt Wozniski):

1) Build of sources might not work since the installation might
not have some "developer" packages needed for the build
process. One would think that an installation of Fedora would
have "everything" whereas an installation of "RedHat" might
miss some developer packages but I found a Fedora 8 install
that did not have things needed to build vim!

2) Links google finds of rpms for old unixes might be broken.
This is a good place for packages for old OS:
http://archive.kernel.org/fedora-archive/fedora/linux/releases/8/Everything/i386/os/Packages/

3) On Debian based systems, such as ubuntu, one can use the
"sudo apt-get" (that's apt, not app!) command; more details
for ubuntu: https://help.ubuntu.com/community/VimHowto

4) On Fedora, one can use the "yum" command; for example, on
Fedora 8, "yum install vim-enhanced" will install vim 7.1 with
patches 1-242. Note that the rpm listed in the link at (2),
viz., vim-enhanced-7.1.135-1.fc8.i386.rpm, has only 135 patches
but yum was able to install vim-enhanced with 242 patches; no
idea where yum found this! (The latest version of vim that
yum finds on Fedora 5 is 7.0.042.)

--Suresh

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Capturing group in regex

Yes!
That works fine.
thank you Teemu.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Close all buffers, stay open

* Tim Johnson <tim@johnsons-web.com> [100227 19:04]:
> * sc <toothpik@swbell.net> [100227 17:03]:
> > On Saturday 27 February 2010 07:11:05 pm Tim Johnson wrote:
> >
> > > For my purposes, it would be great if I could close all
> > > buffers, but keep vim open.
<...>
> > one thing i like to [easily] do is close all but the current
> > buffer -- to this end i have
And the conclusion is: Works like a charm!
thanks again
--
Tim
tim@johnsons-web.com
http://www.akwebsoft.com

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: dictionary functions: Is there a "magic" missing-attribute method/function?

Hi,

> I suspect you're reaching for the get() function
> which allows an optional 3rd parameter for a default

Thanks. But with the get() function the caller would have to know how
the values are computed and the computed value isn't added to the
dictionary. This doesn't make it a good solution for the intended use
cases.

One could of course define a wrapper function:

function! Get(dict, key, ...)
if !has_key(a:dict, a:key) && has_key(a:dict, '__Missing__')
call a:dict.__Missing__(a:key)
endif
return call('get', [a:dict, a:key] + a:000)
endf

let x = {}
function! x.__Missing__(n) dict
if a:n <= 1
let self[a:n] = a:n
else
let self[a:n] = Get(self, a:n - 2) + Get(self, a:n - 1)
endif
endfunction
echo map(range(0, 10), 'Get(x, v:val)')

Well, maybe that's sufficient. I just wasn't sure whether vim already
has such a functionality or not.

Regard,
Tom

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: dictionary functions: Is there a "magic" missing-attribute method/function?

Tom Link wrote:
> I vaguely remember that such a thing exists but it could well be that
> I'm confusing vimscript with some other language.
>
> It there such a thing as a missing method/attribute function for
> dictionaries? So that I could write code like this:
[snip pseudo-code]
> Does such a fallback function exist? If not, is there a chance for it
> to be included in vimscript?


While I'm not sure I followed your pseudo-code (not being a ruby
programmer), I suspect you're reaching for the get() function
which allows an optional 3rd parameter for a default if the key
isn't in the dictionary:

let my_dict = {}
let non_existant_key = 'hello'
echo get(my_dict, non_existant_key, 42)
(prints "42")

which you can read about at

:help get()

Hope this helps,

-tim


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Can't remap

Hey,

I just installed a vim c/c++ plugin from here http://www.vim.org/scripts/script.php?script_id=213.

Now I'm unable to map <C-j> to any command (I usually map it to 4j)

Any help would be appreciated.

Thanks

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: FedoraCore 8

On Sun, 28 Feb 2010, Matt Wozniski wrote:

> On Sat, Feb 27, 2010 at 7:36 PM, Benjamin R. Haskell <vim@benizi.com> wrote:
> > So, you might have 'curses' or 'ncurses' installed, but you also
> > need 'curses-devel' or 'ncurses-dev' (I don't know the correct
> > name).
> >
> > You'll probably need several such packages.  The following is
> > probably your easiest approach:
> >
> >> Matt Wozniski wrote on February 11th:
> >>
> >> > Or just "sudo apt-get build-dep vim" to get all of the
> >> > dependencies needed to build the version that's in the
> >> > repositories.  In theory, that might not be all of the things you
> >> > need to build a vim that you're ./configuring yourself, since it
> >> > won't include headers needed for features that aren't compiled
> >> > into vim-gnome.  In practice, though, vim-gnome includes nearly
> >> > all features, so that's not really a problem.  At the very least,
> >> > it's the best jumping off point, since the worst case is that you
> >> > need to track down one or two more missing packages.
>
> Unfortunately, that only works on deb-based systems, not RPM ones.
> I'd hope that RPM based systems have something similar, but I don't
> know about it; all of the Linux systems I've ever admin'ed have been
> Debian-derived.

Ah, sorry. I haven't used either RPM- or deb-based distros for a very
long time, much preferring Gentoo.

Googling 'fedora apt-get build-dep' suggests the Fedora version of that
command is:

yum-builddep vim-enhanced

--
Best,
Ben

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Winmanager + color directories / sorting

Is it possible to color the directories in Winmanager as in NERDTree?
(p.e. all directories blue?)

I can't find out as well how to sort the files and directories in
Winmanager not case sensitive.

-------------------------------

ps:
I like NerdTree a lot but there is no buffermanager inside.
(Is there no way to insert a buffermanager below the fileexplorer in
NerdTree?)

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: FedoraCore 8

On Sat, Feb 27, 2010 at 7:36 PM, Benjamin R. Haskell <vim@benizi.com> wrote:
> So, you might have 'curses' or 'ncurses' installed, but you also need
> 'curses-devel' or 'ncurses-dev' (I don't know the correct name).
>
> You'll probably need several such packages.  The following is probably
> your easiest approach:
>
>> Matt Wozniski wrote on February 11th:
>>
>> > Or just "sudo apt-get build-dep vim" to get all of the dependencies
>> > needed to build the version that's in the repositories.  In theory,
>> > that might not be all of the things you need to build a vim that
>> > you're ./configuring yourself, since it won't include headers needed
>> > for features that aren't compiled into vim-gnome.  In practice,
>> > though, vim-gnome includes nearly all features, so that's not really a
>> > problem.  At the very least, it's the best jumping off point, since
>> > the worst case is that you need to track down one or two more missing
>> > packages.

Unfortunately, that only works on deb-based systems, not RPM ones.
I'd hope that RPM based systems have something similar, but I don't
know about it; all of the Linux systems I've ever admin'ed have been
Debian-derived.

~Matt

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

dictionary functions: Is there a "magic" missing-attribute method/function?

Hi,

I vaguely remember that such a thing exists but it could well be that
I'm confusing vimscript with some other language.

It there such a thing as a missing method/attribute function for
dictionaries? So that I could write code like this:

let x = {}
function! x.__Missing__(name) dict
if a:name <= 1
let self[a:name] = a:name
else
let self[a:name] = self[a:name - 2] + self[a:name - 1]
endif
endfunction
echo map(range(0, 10), 'x[v:val]')

The equivalent ruby code would be:

x = Hash.new do |h, k|
case k
when 0, 1
h[k] = k
else
h[k] = h[k-2] + h[k-1]
end
end
0.upto(10).map {|n| x[n]}
# => [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]

Does such a fallback function exist? If not, is there a chance for it
to be included in vimscript?

Regards,
Tom

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

file manager recommendations

Hi vimmers!

There are a couple of vim-like file managers out there, most notably
vifm, but also there are plugins for vim itself, like VimExplorer. I'm
wondering if anybody has experiences with any such vim-like file
manager functionality and what the majority of the folks use here. VE
seems to be dead since 2007, vifm is cool, but I'd most like to have a
vim plugin that can do file manager style operations like copy, paste,
delete, etc.

Did the market already speak which is the best one? :)

Cheers,
Daniel

--
Psss, psss, put it down! - http://www.cafepress.com/putitdown

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Smart expandtab at beginning of line vs in mid-line?

For indenting at the beginning of the line, I want tabs.
But in mid-line, I want them to be expanded to spaces.
Can this be achieved in Vim?

bla.callSomeMethod( eins, zwei ); // jau
bla.callAnotherMethod( eins, zwei, drei ); // jaujau

The reason for this is that while it all looks fine given my
personal tabstop setting of 4, and possibly others for this
particular piece of text; but in general the end-of-line
comments will not look justified for each and every setting
of tabstop. Spaces are more robust here.

Is there a setting in Vim to expand tabs depending on whether
I'm at the beginning of a line (indenting), or in the middle
of the line (formatting)?

--
Michael Ludwig

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Capturing group in regex

* 2010-02-28 01:42 (-0800), rameo wrote:

> Lets say I want to search all number [0-9] with regex and what to put
> a "_" sign after every number.
>
> Normally I can capture the group using $1 but this doesn't work in
> gvim.

In regexp replace strings you can use "&" to refer back to the whole
match or \1 to \9 to refer to submatches.

> :s%/[0-9]/$1_/g --> doesn't work.

Try this:

%s/[0-9]/&_/g

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Capturing group in regex

Lets say I want to search all number [0-9] with regex
and what to put a "_" sign after every number.

Normally I can capture the group using $1
but this doesn't work in gvim.


:s%/[0-9]/$1_/g --> doesn't work.

tnx in advance.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Saturday, February 27, 2010

Re: close file but not the tab

rameo <raiwil@gmail.com>:
> When I close Vim with 1 or 2 open documents I would like to reopen
> these documents open.
>
> Is that possible?

Use :mksession, just like Ben said.

Jan

--
OpenPGP Key-ID: 00A0FD5F
"The surest way to corrupt a youth is to instruct him to hold in higher
esteem those who think alike than those who think differently." --
Nietzsche, "The Dawn" (1881)

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Close all buffers, stay open

* sc <toothpik@swbell.net> [100227 17:03]:
> On Saturday 27 February 2010 07:11:05 pm Tim Johnson wrote:
>
> > For my purposes, it would be great if I could close all
> > buffers, but keep vim open.
> >
> > I note ':on', but that just closes all windows, buffers
> > remain.
> >
> > The end game is:
> > Close all buffers, load a different session.
> >
>
> one thing i like to [easily] do is close all but the current
> buffer -- to this end i have
>
> nnoremap <Leader>dd :call ClearBuffers()<CR>
>
> function! ClearBuffers()
> let i = 1
> let dc = 0
> while i <= bufnr("$")
> if buflisted(i) && i != bufnr("")
> exe "bdelete" i
> let dc += 1
> endif
> let i += 1
> endwhile
> echo 'buffers deleted:' dc
> endfunction
>
> in my .vimrc -- you could easily modify it (by removing the
>
> "&& i != bufnr("")"
>
> ) to delete even the current buffer
>
> hth,

I bet this *will* help.
I will implement this and let you know if I have any questions.
Thank you very much.
--
Tim
tim@johnsons-web.com
http://www.akwebsoft.com

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Close all buffers, stay open

On Saturday 27 February 2010 07:11:05 pm Tim Johnson wrote:

> For my purposes, it would be great if I could close all
> buffers, but keep vim open.
>
> I note ':on', but that just closes all windows, buffers
> remain.
>
> The end game is:
> Close all buffers, load a different session.
>

one thing i like to [easily] do is close all but the current
buffer -- to this end i have

nnoremap <Leader>dd :call ClearBuffers()<CR>

function! ClearBuffers()
let i = 1
let dc = 0
while i <= bufnr("$")
if buflisted(i) && i != bufnr("")
exe "bdelete" i
let dc += 1
endif
let i += 1
endwhile
echo 'buffers deleted:' dc
endfunction

in my .vimrc -- you could easily modify it (by removing the

"&& i != bufnr("")"

) to delete even the current buffer

hth,

sc

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Close all buffers, stay open

I'm using vim 7.2, normal version on slackware 13.0 32-bit.

For my purposes, it would be great if I could close all buffers, but
keep vim open.

I note ':on', but that just closes all windows, buffers remain.

The end game is:
Close all buffers, load a different session.

thanks
--
Tim
tim@johnsons-web.com
http://www.akwebsoft.com

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Open a new file if the file doesn't exist when using ctrl+W_ctrl+F?

On Thu, 25 Feb 2010, Peng Yu wrote:

> On Feb 25, 12:58 am, "Christian Brabandt" <cbli...@256bit.org> wrote:
> > On Thu, February 25, 2010 3:33 am, Peng  Yu wrote:
> > > I see the following line on the above page. But I'm not sure what
> > > '<Leader>' represents here. Would you please let me know?
> >
> > > <Leader>is switches to the alternate file of file under cursor
> > > (e.g. on  <foo.h> switches to foo.cpp)
> >
> > :h <Leader>
>
> I typed "\is" in the "ESC" mode. Instead of switching to foo.cpp, vim
> enters edit mode.

Perhaps '\', '\i', or '\is' is mapped to something else. Try:

:map \
:map \i
:map \is

Before trying out 'a.vim', for example, I also had:

:map \i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>

> I try to let mapleader =",", then type ",is" in the
> ESC mode, vim still enters edit mode. What is wrong with my
> operations?

As pointed out in :h <Leader>, the 'let mapleader' must be done before
the mapping is defined. If 'a.vim' is in your .vim/plugin/ directory,
it might be sourced before your 'let mapleader' was. If you want to
change it, you should have it somewhere in your .vimrc.

It might also be the case that something else is setting mapleader.
Look in the output of ':map' for what is mapped to :IHS<CR>, e.g. in
mine, without setting mapleader, I have:

:map
[...]
n \ihn :IHN<CR>
n \is :IHS<CR>:A<CR>
n \ih :IHS<CR>

--
Best,
Ben

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: FedoraCore 8

On Sat, 27 Feb 2010, Suresh Govindachar wrote:

>
> Hello,
>
> I tried 3 ways to install "vim-with-everything" on Fedora Core 8, but failed:
>
> Attempt 1) vim-7.2.tar.bz2 - typing make resulted in the following error:
>
> [...]
> checking for tgetent()... configure: error: NOT FOUND!
> You need to install a terminal library; for example ncurses.
> Or specify the name of the library with --with-tlib.

Generally, to compile software on RPM-based distributions, you need to
install '-dev' or '-devel' packages for things that are normally
installed as binaries.

So, you might have 'curses' or 'ncurses' installed, but you also need
'curses-devel' or 'ncurses-dev' (I don't know the correct name).

You'll probably need several such packages. The following is probably
your easiest approach:

> Matt Wozniski wrote on February 11th:
>
> > Or just "sudo apt-get build-dep vim" to get all of the dependencies
> > needed to build the version that's in the repositories. In theory,
> > that might not be all of the things you need to build a vim that
> > you're ./configuring yourself, since it won't include headers needed
> > for features that aren't compiled into vim-gnome. In practice,
> > though, vim-gnome includes nearly all features, so that's not really a
> > problem. At the very least, it's the best jumping off point, since
> > the worst case is that you need to track down one or two more missing
> > packages.

> [...]
> Attempt 2) Was unable to find vim-enhanced-7.2.315-1 fc8 rpm on the internet.

Seems unlikely to exist. Fedora 8 is pretty old. Latest vim-enhanced
in the official repository looks to be 7.1.135-1
(
http://archive.kernel.org/fedora-archive/fedora/linux/releases/8/Everything/i386/os/Packages/)

> Attempt 3) rpm -iv --test vim-enhanced-7.2.245-3.fc12.i686.rpm resulted in:

This is also unlikely to work without significant hassle. Between
versions, RPM-based distributions tend to only work with a given version
of the core libraries.

> [...]
> error: Failed dependencies:
> libc.so.6(GLIBC_2.11) is needed by vim-enhanced-7.2.245-3.fc12.i686

In this case, it looks like Fedora 8 doesn't have the version of the GNU
C library (GLIBC) that the Fedora 12 package would require.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

FedoraCore 8

Hello,

I tried 3 ways to install "vim-with-everything" on Fedora Core 8, but failed:

Attempt 1) vim-7.2.tar.bz2 - typing make resulted in the following error:

checking for rlim_t... yes
checking for stack_t... yes
checking whether stack_t has an ss_base field... no
checking --with-tlib argument... empty: automatic terminal library selection
checking for tgetent in -lncurses... no
checking for tgetent in -ltermlib... no
checking for tgetent in -ltermcap... no
checking for tgetent in -lcurses... no
no terminal library found
checking for tgetent()... configure: error: NOT FOUND!
You need to install a terminal library; for example ncurses.
Or specify the name of the library with --with-tlib.
make[1]: *** [config] Error 1
make[1]: Leaving directory `/h/sgovinda/tmp/vim72/src'
make: *** [first] Error 2

Attempt 2) Was unable to find vim-enhanced-7.2.315-1 fc8 rpm on the internet.

Attempt 3) rpm -iv --test vim-enhanced-7.2.245-3.fc12.i686.rpm resulted in:

warning: vim-enhanced-7.2.245-3.fc12.i686.rpm: Header V3 RSA/SHA256 signature: NOKEY, key ID 57bbccba
error: Failed dependencies:
libc.so.6(GLIBC_2.11) is needed by vim-enhanced-7.2.245-3.fc12.i686
libgpm.so.2 is needed by vim-enhanced-7.2.245-3.fc12.i686
libpython2.6.so.1.0 is needed by vim-enhanced-7.2.245-3.fc12.i686
perl(:MODULE_COMPAT_5.10.0) is needed by vim-enhanced-7.2.245-3.fc12.i686
rpmlib(FileDigests) <= 4.6.0-1 is needed by vim-enhanced-7.2.245-3.fc12.i686
vim-common = 2:7.2.245-3.fc12 is needed by vim-enhanced-7.2.245-3.fc12.i686
rpmlib(PayloadIsXz) <= 5.2-1 is needed by vim-enhanced-7.2.245-3.fc12.i686

Please help.

--Suresh

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: bdelete all buffers with same pattern extension

epanda wrote:
> I would like to bdelete buffers that I don't use anymore and it
> happens that they all are *.csv
>
> Can I bdelete *.csv ?

I suppose you could do something like

:sil bufdo if expand('%')[-4]=='.txt' | bdel | endif

or

:sil bufdo if expand('%')=~'\.txt$' | bdel | endif

The latter gives you a little more flexibility in handling the
file-names -- you can ignore case with "\c", or wipe multiple
file-types using the "\|" notation of a regexp.

-tim

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: middle click close tab

Didn't work. :-(

>
> Try
> :map <MiddleMouse> :tabclose<cr>
>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: De-select search highlight

thank you :-)

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: middle click close tab

Hi rameo!

On Sa, 27 Feb 2010, rameo wrote:

> Is it possible in Vim to close a tab with a middle click?

Try
:map <MiddleMouse> :tabclose<cr>

(untested)

regards,
Christian
--
:wq

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: De-select search highlight

rameo wrote:
> I would like to find a way to de-select the search highlight.
>
> The only way I found is to do another search which isn't in the text
> p.e.
>
> /fffffffff
>
> Isn't there another way to de-select the search highlight?

:nohls

:help nohlsearch

Brett Stahlman

>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

De-select search highlight

I would like to find a way to de-select the search highlight.

The only way I found is to do another search which isn't in the text
p.e.

/fffffffff

Isn't there another way to de-select the search highlight?

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Map menu command

I would like to map a few menu commands.

p.e.

A menu command is:

an <silent> 10.330 &File.&Close<Tab>:close
\ :if winheight(2) < 0 <Bar>
\ confirm enew <Bar>
\ else <Bar>
\ confirm close <Bar>
\ endif<CR>

How can I map this command to a shortcut (ctrl-w)?

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

middle click close tab

Is it possible in Vim to close a tab with a middle click?

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: close file but not the tab

Jan,

Have you seen my 2nd question also?

When I close Vim with 1 or 2 open documents I would like to reopen
these documents open.

Is that possible?

On Feb 27, 10:51 am, Jan Larres <li...@majutsushi.net> wrote:
> rameo <rai...@gmail.com>:
>
> > I have read the help pieces you've mentioned but not found the answer
> > to my questions.
>
> > What do I have to do?
>
> Put this into your .vimrc:
>
> " delete buffer without closing window
> function! Bclose()
>     let l:currentBufNum = bufnr("%")
>     let l:alternateBufNum = bufnr("#")
>
>     if buflisted(l:alternateBufNum)
>         buffer #
>     else
>         bnext
>     endif
>
>     if bufnr("%") == l:currentBufNum
>         new
>     endif
>
>     if buflisted(l:currentBufNum)
>         execute("bdelete! ".l:currentBufNum)
>     endif
> endfunction
>
> and assign a mapping to it:
>
> nmap <F8> :call Bclose()<cr>
>
>         Jan
>
> --
> OpenPGP Key-ID: 00A0FD5F
> "Religion is regarded by the common people as true, by the wise as false,
> and by the rulers as useful."  -- Seneca

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Saving signs

Hi Vitor!

On Fr, 26 Feb 2010, Vitor Eiji Justus Sakaguti wrote:

> From ":help :sign"
> [quote]
> Note that the ":sign" command cannot be followed by another command or a
> comment. If you do need that, use the |:execute| command.
> [/quote]

Thanks for pointing me to that note. I didn't notice it.

regards,
Christian

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: close file but not the tab

rameo <raiwil@gmail.com>:
> I have read the help pieces you've mentioned but not found the answer
> to my questions.
>
> What do I have to do?

Put this into your .vimrc:

" delete buffer without closing window
function! Bclose()
let l:currentBufNum = bufnr("%")
let l:alternateBufNum = bufnr("#")

if buflisted(l:alternateBufNum)
buffer #
else
bnext
endif

if bufnr("%") == l:currentBufNum
new
endif

if buflisted(l:currentBufNum)
execute("bdelete! ".l:currentBufNum)
endif
endfunction

and assign a mapping to it:

nmap <F8> :call Bclose()<cr>


Jan

--
OpenPGP Key-ID: 00A0FD5F
"Religion is regarded by the common people as true, by the wise as false,
and by the rulers as useful." -- Seneca

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

building console version on unices (was: iMac slow in vi)

* Miklos Somogyi <msom@netspace.net.au> [100227 09:28]:
> On 27/02/2010, at 06:20 PM, Florian Rehnisch wrote:
>
> > You get a certain speedup when you use the console version and build vim
> > w/o gui facilities.
> >
> > This is my shell function receipt:
> > #v+
> >
> > function mkvim() {
> > ./configure \
> > --prefix=/opt/vim \
> > --disable-gui \
> > --without-x \
> > --with-features=huge \
> > --enable-perlinterp \
> > --with-compiledby='Florian "eix" Rehnisch <eixman@gmx.de>' &&
> > make
> > }

> Having lurked here a few days I could see that vim has grown
> enormously from my familiar vi, like word processor or more. I suspect
> that contributes to the slowness of the complete system.

Ohh, that's not too bad. Purists suggest nvi. ;-)

> I'd like to try building a console version as you suggests, but how do
> I get to do it?

Tony made a HowTo on compiling Vim on unices. See
http://users.skynet.be/antoine.mechelynck/vim/compunix.htm
See also ':h usr_90'.

> And where is the place of your shell function
> receipt?

It lives as a stanza in my ~/.zshrc. Bash users go with ~/.bashrc.
Lovers of small inition files would put the part between {} in a shell
script ~/bin/mkvim, whoose first line is sth. like '#!/bin/sh'.

Still questions? Don't refrain to ask ;-)
--
flori
Vim-Hilfe auf Deutsch http://www.florianrehnisch.de/vimhelp/
WARNING: PRGRAMMING BUG IN E2FSCK!
OR SOME BONEHEAD (YOU) IS CHECKING A MOUNTED (LIVE) FILESYSTEM.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: iMac slow in vi

On 27/02/2010, at 06:20 PM, Florian Rehnisch wrote:

> You get a certain speedup when you use the console version and build vim
> w/o gui facilities.
>
> This is my shell function receipt:
> #v+
>
> function mkvim() {
> ./configure \
> --prefix=/opt/vim \
> --disable-gui \
> --without-x \
> --with-features=huge \
> --enable-perlinterp \
> --with-compiledby='Florian "eix" Rehnisch <eixman@gmx.de>' &&
> make
> }
> --
> flori
> Vim-Hilfe auf Deutsch http://www.florianrehnisch.de/vimhelp/
> WARNING: PRGRAMMING BUG IN E2FSCK!
> OR SOME BONEHEAD (YOU) IS CHECKING A MOUNTED (LIVE) FILESYSTEM.
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php


Thanks Florian,

Having lurked here a few days I could see that vim has grown enormously from my familiar vi,
like word processor or more. I suspect that contributes to the slowness of the complete system.

I'd like to try building a console version as you suggests, but how do I get to do it?
And where is the place of your shell function receipt?

Thanks,

Miklos

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Friday, February 26, 2010

Re: Fonts become fuzzy in vim 7.2

* Fengting Chen <fechen@gmail.com> [100226 23:22]:
> I recently upgraded my gvim from 6.2 to 7.2. I found the front which
> used to be very sharp in gvim 6.2 became a little fuzzy. Anyone has
> similar experience? and how to fix it?

Just an idea: ':h anti'. Ain't use gvim...
--
flori
Vim-Hilfe auf Deutsch http://www.florianrehnisch.de/vimhelp/
WARNING: PRGRAMMING BUG IN E2FSCK!
OR SOME BONEHEAD (YOU) IS CHECKING A MOUNTED (LIVE) FILESYSTEM.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: iMac slow in vi

You get a certain speedup when you use the console version and build vim
w/o gui facilities.

This is my shell function receipt:
#v+

function mkvim() {
./configure \
--prefix=/opt/vim \
--disable-gui \
--without-x \
--with-features=huge \
--enable-perlinterp \
--with-compiledby='Florian "eix" Rehnisch <eixman@gmx.de>' &&
make
}
--
flori
Vim-Hilfe auf Deutsch http://www.florianrehnisch.de/vimhelp/
WARNING: PRGRAMMING BUG IN E2FSCK!
OR SOME BONEHEAD (YOU) IS CHECKING A MOUNTED (LIVE) FILESYSTEM.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Naive question: scrolling down keeping only 1 line

On Fri, Feb 26, 2010 at 5:23 PM, Jean Johner <jean.johner@cea.fr> wrote:
> On Feb 26, 6:58 pm, Ben Fritz <fritzophre...@gmail.com> wrote:
>
>> 2. Re-map CTRL-F/CTRL-B with an :nnoremap command that issues the
>> command, then scrolls by 1 line with CTRL-Y/CTRL-E in the correct
>> direction to get the desired amount of context.
>
> Hi Ben,
> CTRL-F CTRL-E does the job but the transition is visible on a slow
> connection (VPN).
> For CTRL-D, it is more complicated since it depends on the vertical
> dimension of the screen.
>
> It is nevertheless surprising that, in a code where everything can be
> configured, this two lines overlap between screens seems to be set in
> stone.

Perhaps make the map call a function that ensures 'lazyredraw' is set
while scrolling. This seems to do the trick, afaics, and has no
noticeable delay over the slowest connection I can get.

~Matt

function! s:ScrollLeavingOneLineOffset(dir, insert)
let savelz = &lz
set lazyredraw

try
if a:dir > 0 && a:insert
return "\<PageDown>\<C-o>\<C-e>"
elseif a:dir > 0
return "\<PageDown>\<C-e>"
elseif a:insert
return "\<PageUp>\<C-o>\<C-y>"
else
return "\<PageUp>\<C-y>"
endif
finally
let &lz = savelz
endtry
endfunction

noremap <expr> <C-b> <SID>ScrollLeavingOneLineOffset(-1, 0)
noremap <expr> <PageUp> <SID>ScrollLeavingOneLineOffset(-1, 0)
noremap <expr> <C-f> <SID>ScrollLeavingOneLineOffset( 1, 0)
noremap <expr> <PageDown> <SID>ScrollLeavingOneLineOffset( 1, 0)

inoremap <expr> <C-b> <SID>ScrollLeavingOneLineOffset(-1, 1)
inoremap <expr> <PageUp> <SID>ScrollLeavingOneLineOffset(-1, 1)
inoremap <expr> <C-f> <SID>ScrollLeavingOneLineOffset( 1, 1)
inoremap <expr> <PageDown> <SID>ScrollLeavingOneLineOffset( 1, 1)

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

iMac slow in vi

Hello Folks,

I bought a 27" i7 iMac. It is blazingly fast re any job, except in vi.
E.g. inserting or deleting a character takes noticeable time.

Many times I get into trouble by watching the screen and deleting at my speed and (jeez, this is still here,
let me delete it), but this was already on vim's list to delete, so my extra delete results in vim deleting one more
item than what I need.

What could be the explanation?
Vim version is 7.2

My .vimrc has only 34 nmap, 4 map!, 2 iabbr definitions.

I set the following:

set cpo-=<
ai aw wm=1 nojoinspaces

Regards,

Miklos

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: vi, search string and comment line howto?

> Hello, I can't figure out the syntax to search for a certain string and then
> comment out that line. I know you can have multiple commands on a single
> line, but I can't figure it out. As an example I have a "file" with the
> following contents:
>
> line 1 and stuff
> line 2 contains my_string
> line 2 and stuff
>
> Now I want to vi the "file" and comment out the line containing "my_string"
> by running the following commands:
> vi file #to start editing "file"
> /my_string #to search for the line I want to comment, containing
> "my_string"
> I# #to append a comment (#) to the beginning of the
> current line
> :wq #to write and quit
>
> I should be able to string all the above commands together separated by a
> pipe:
> vi -c "/my_string | I# | :wq" file

You're passing command-line (Ex) commands to vim, not normal-mode
commands, so you can do this using ex commands instead:

vi -c "/my_string/s/^/#/" -c "wq" file.txt

Or, if you want to comment all instances of it:

vi -c "g/my_string/s/^/#/" -c "wq" file.txt

or even just do it in sed:

sed -iBAK '/my_string/s/^/#/' file.txt

-tim

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

RE: vi, search string and comment line howto?

omonte7 wrote:
> I should be able to string all the above commands together
> separated by a pipe:
> vi -c "/my_string | I# | :wq" file

This is the Vim mailing list (not vi)!

There is an example using g// at:
http://vim.wikia.com/wiki/Power_of_g

However I would just do a substitute:

vim -c "%s/.*my_string.*/# &/" myfile.txt

The .* before and after means it finds the whole line, and the &
in the replacement represents that whole line.

John

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

RE: menu --> add input window

Please bottom post on this list. Quote a small (relevant) part
of the message you are replying to, and put your text underneath.

See the list guidelines:
http://groups.google.com/group/vim_use/web/vim-information

and the footer now at the bottom of each email.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: how to use cscope find command with a variable?

On 2010-02-26, "yixiaodafang@gmail.com" <yixiaodafang@gmail.com> wrote:
> Hi,
>
> I am writing a script to run the cscope. I have a string passed from
> function call, the string can be l:tmp='test'. The cscope command cs
> find s l:tmp will try to find l:tmp instead of the string test. Does
> anyone know how to fix this?

exe 'cs find s' l:tmp

See

:help :exe

Regards,
Gary

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

vi, search string and comment line howto?

Hello, I can't figure out the syntax to search for a certain string and then
comment out that line. I know you can have multiple commands on a single
line, but I can't figure it out. As an example I have a "file" with the
following contents:

line 1 and stuff
line 2 contains my_string
line 2 and stuff

Now I want to vi the "file" and comment out the line containing "my_string"
by running the following commands:
vi file #to start editing "file"
/my_string #to search for the line I want to comment, containing
"my_string"
I# #to append a comment (#) to the beginning of the
current line
:wq #to write and quit

I should be able to string all the above commands together separated by a
pipe:
vi -c "/my_string | I# | :wq" file #give all the editing
commands to vi on the command line

vi file
/my_string | I# | :wq #or open the file in
vi and then enter the commands

but the above fails with: E486: Pattern not found: my_string | I# | wq

so, what am I doing wrong, anyone know how to accomplish searching for a
particular string and then comment out the line that it's on? Thanks.

--
View this message in context: http://old.nabble.com/vi%2C-search-string-and-comment-line-howto--tp27724017p27724017.html
Sent from the Vim - General mailing list archive at Nabble.com.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

how to use cscope find command with a variable?

Hi,

I am writing a script to run the cscope. I have a string passed from
function call, the string can be l:tmp='test'. The cscope command cs
find s l:tmp will try to find l:tmp instead of the string test. Does
anyone know how to fix this?

Thanks

Frank

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Naive question: scrolling down keeping only 1 line

On Feb 26, 6:58 pm, Ben Fritz <fritzophre...@gmail.com> wrote:

> 2. Re-map CTRL-F/CTRL-B with an :nnoremap command that issues the
> command, then scrolls by 1 line with CTRL-Y/CTRL-E in the correct
> direction to get the desired amount of context.

Hi Ben,
CTRL-F CTRL-E does the job but the transition is visible on a slow
connection (VPN).
For CTRL-D, it is more complicated since it depends on the vertical
dimension of the screen.

It is nevertheless surprising that, in a code where everything can be
configured, this two lines overlap between screens seems to be set in
stone.

Best regards
Jean Johner

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Possible problem with sudden shortening of very large files by an external process

Gary Bickford wrote:

> I often misuse vim to view log files while debugging batch jobs. It is
> very handy for moving around in the file, viewing the colorized content
> and searching for relevant text. These log files can be from several
> thousand to millions of lines. Vim does a remarkably good job of
> handling these files. However, sometimes it has a problem when the
> batch job is re-run while I am viewing the file in vim, and the log file
> is replaced by a much shorter one.
>
> When vim tries to reload the file, sometimes I get a very long series of
> red warning messages - I can't repeat the event just now, so can't
> provide the content of the warning, but I think it has to do with
> missing lines.
>
> This succession of warnings can be inconvenient when there are several
> million to report, or even a few thousand! And very occasionally vim
> hangs (apparently), or just gives up the ghost and dies. I think
> problems are more likely when the 'present location' is far down the
> file.
>
> Considering the abuse I am giving vim this is within the range of
> acceptable behavior, but I thought it was worth mentioning as an issue
> anyway. From the behavior, I speculate that vim has found the present
> line to be after the end of file, is trying to move the line pointer
> upwards one line at a time, and is finding no data there each time.

It would help a lot to know what the text of that error message is.

If it is " ml_get: cannot find line {N}" then the cause might be hard to
find. A stack trace would be helpful then.

--
ZOOT: I'm afraid our life must seem very dull and quiet compared to yours.
We are but eightscore young blondes, all between sixteen and
nineteen-and-a-half, cut off in this castle, with no one to protect us.
Oooh. It is a lonely life ... bathing ... dressing ... undressing ...
making exciting underwear....
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: PATCH: 'cindent' is too forgiving for function return type decls

Matt Wozniski wrote:

> In #vim, ShingRay pointed out a bug in cindent, which can be reproduced with:
>
> echo $'void f() {\nif (1)\n;\n}' \
> | vim - -u NONE -N -c 'set ft=c' -c 'norm gg=G'
>
> The above adds an extra 'shiftwidth' to every line. It's caused by
> vim mistakenly deciding that "void f() {" is specifying the function
> return type for the function "if". Since I can't think of a C-like
> language that would allow { or } anywhere in the return type of a
> function, here's a patch that fixes the problem by never considering a
> line containing braces to be return type declaration.
>
> ~Matt
>
> diff -r 903fcd726d90 src/misc1.c
> --- a/src/misc1.c Thu Feb 11 18:54:43 2010 +0100
> +++ b/src/misc1.c Thu Feb 25 01:21:16 2010 -0500
> @@ -7729,9 +7729,12 @@
> * line needs to be indented as a function type spec.
> * Don't do this if the current line looks like a comment
> * or if the current line is terminated, ie. ends in ';'.
> + * It also cannot contain a '{' or a '}'.
> */
> else if (cur_curpos.lnum < curbuf->b_ml.ml_line_count
> && !cin_nocode(theline)
> + && !vim_strchr(theline, '{')
> + && !vim_strchr(theline, '}')
> && !cin_ends_in(theline, (char_u *)":", NULL)
> && !cin_ends_in(theline, (char_u *)",", NULL)
> && cin_isfuncdecl(NULL, cur_curpos.lnum + 1)

Thanks for the fix! Not obvious that this would be the cause of the
problem.

--
GALAHAD turns back. We see from his POV the lovely ZOOT standing by him
smiling enchantingly and a number of equally delectable GIRLIES draped
around in the seductively poulticed room. They look at him smilingly and
wave.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: close file but not the tab

On 2010-02-26, rameo wrote:
> 1)
> I would like to know if it is possible to close the last tab but keep
> the empty tab without closing vim.

Vim does not have the notion of empty tabs or empty windows. A
window is a view into a buffer. A tab must contain at least one
window. Vim itself must contain at least one buffer while it is
running. The closest you can get to an empty tab is to have that
tab contain an empty buffer, hence the :enew suggestion from Ben.

Regards,
Gary

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Unexpected behaviour of File browser in multi-windows environment

On Feb 26, 4:44 pm, Charles Campbell <Charles.E.Campb...@nasa.gov>
wrote:
> Perhaps you should join the vimdev mailing
> list as this problem appears to be a vim one to me.

I have created a post on vim_dev with the same name.

Best regards,
Jean Johner

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: menu --> add input window

thank you Florian, that resolved my question :-)

On Feb 26, 6:26 pm, Florian Rehnisch <eix...@gmx.de> wrote:
> > * rameo <rai...@gmail.com> [100226 16:02]:
> > > I added a few menu commands in Gvim.
>
> > > p.e. :sort u
>
> > > Is it possible to ask for an input value:
>
> > > - from line xxx to line xxx
>
> > > and if no input given using "all lines".
>
> You would need a function for this ...
>
> > > How do I create such an input window?
>
> See ':h inputdialog()'.
> --
>  flori
> Vim-Hilfe auf Deutsch        http://www.florianrehnisch.de/vimhelp/
> WARNING: PRGRAMMING BUG IN E2FSCK!
>         OR SOME BONEHEAD (YOU) IS CHECKING A MOUNTED (LIVE) FILESYSTEM.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: close file but not the tab

I have read the help pieces you've mentioned but not found the answer
to my questions.

What do I have to do?

On Feb 26, 7:08 pm, Ben Fritz <fritzophre...@gmail.com> wrote:
> On Feb 26, 7:46 am, rameo <rai...@gmail.com> wrote:
>
> > 1)
> > I would like to know if it is possible to close the last tab but keep
> > the empty tab without closing vim.
>
> :help :bdelete
> :help :enew
>
> But, why do you want this? Wouldn't it be easier to just go ahead and
> edit the next file you want?
>
> > 2)
> > I would also like to know if it is possible to reopen the last files
> > (the last tabs) when I reopen vim.
>
> :help :mksession
>
> I've found this doesn't work well (for me) if I have TagList windows
> open in any of the tab pages. I have not yet investigated the problem,
> it may have something to do with my setup. So, I do a ":tabdo
> TListClose" before I make a session on the rare occasions I do so.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: how to keep the cscope output in a window?

Thank you very much for your help.

Your answer helps me to find a way to keep the output always open by
typing the command :copen.

Thanks

Frank

On Feb 26, 10:34 am, Reid Thompson <reid.thomp...@ateb.com> wrote:
> On Fri, 2010-02-26 at 13:26 -0500, Reid Thompson wrote:
> > On Fri, 2010-02-26 at 13:18 -0500, Reid Thompson wrote:
> > > On Fri, 2010-02-26 at 10:14 -0800, yixiaodaf...@gmail.com wrote:
>
> > > :clist
>
> > > :help clist
>
> > ack -- sorry - got my cscope and quickfix intermingled
>
> well,, now that I go and look....
>
>                                             *cscopequickfix* *csqf*
> *E469*
> {not available when compiled without the |+quickfix| feature}
> 'cscopequickfix' specifies whether to use quickfix window to show cscope
> results.  This is a list of comma-separated values. Each item consists
> of
> |cscope-find| command (s, g, d, c, t, e, f or i) and flag (+, - or 0).
> '+' indicates that results must be appended to quickfix window,
> '-' implies previous results clearance, '0' or command absence - don't
> use
> quickfix.  Search is performed from start until first command
> occurrence.
> The default value is "" (don't use quickfix anyway).  The following
> value
> seems to be useful: >
>         :set cscopequickfix=s-,c-,d-,i-,t-,e-
>
> so, setting the above :set cscopequickfix=s-,c-,d-,i-,t-,e-
>
> you can
>
> :cs find e function-name
>
> then :clist
> then :cnN
> where N is the number of the item in the list you want to jump to
> then :clist again
> then :cnN
> repeat

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: how to keep the cscope output in a window?

On Fri, 2010-02-26 at 13:26 -0500, Reid Thompson wrote:
> On Fri, 2010-02-26 at 13:18 -0500, Reid Thompson wrote:
> > On Fri, 2010-02-26 at 10:14 -0800, yixiaodafang@gmail.com wrote:
>
> >
> > :clist
> >
> >
> > :help clist
>
> ack -- sorry - got my cscope and quickfix intermingled
>
>

well,, now that I go and look....

*cscopequickfix* *csqf*
*E469*
{not available when compiled without the |+quickfix| feature}
'cscopequickfix' specifies whether to use quickfix window to show cscope
results. This is a list of comma-separated values. Each item consists
of
|cscope-find| command (s, g, d, c, t, e, f or i) and flag (+, - or 0).
'+' indicates that results must be appended to quickfix window,
'-' implies previous results clearance, '0' or command absence - don't
use
quickfix. Search is performed from start until first command
occurrence.
The default value is "" (don't use quickfix anyway). The following
value
seems to be useful: >
:set cscopequickfix=s-,c-,d-,i-,t-,e-


so, setting the above :set cscopequickfix=s-,c-,d-,i-,t-,e-

you can

:cs find e function-name

then :clist
then :cnN
where N is the number of the item in the list you want to jump to
then :clist again
then :cnN
repeat

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: how to keep the cscope output in a window?

On Fri, 2010-02-26 at 13:18 -0500, Reid Thompson wrote:
> On Fri, 2010-02-26 at 10:14 -0800, yixiaodafang@gmail.com wrote:

>
> :clist
>
>
> :help clist

ack -- sorry - got my cscope and quickfix intermingled


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: how to keep the cscope output in a window?

On Fri, 2010-02-26 at 10:14 -0800, yixiaodafang@gmail.com wrote:
> Hi,
>
> I am using gvim v7.2 with cscope_map.vim plugin. When I run the
> cscope, the outputs are a list of files. However, when I select one of
> them, the list disappeared. If I want to see another output, I have to
> run the cscope again. Are there ways to keep the output in a window
> even after you select one of the output?
>
> thanks
>
> Frank
>

:clist


:help clist

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

how to keep the cscope output in a window?

Hi,

I am using gvim v7.2 with cscope_map.vim plugin. When I run the
cscope, the outputs are a list of files. However, when I select one of
them, the list disappeared. If I want to see another output, I have to
run the cscope again. Are there ways to keep the output in a window
even after you select one of the output?

thanks

Frank

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: close file but not the tab

On Feb 26, 7:46 am, rameo <rai...@gmail.com> wrote:
> 1)
> I would like to know if it is possible to close the last tab but keep
> the empty tab without closing vim.
>

:help :bdelete
:help :enew

But, why do you want this? Wouldn't it be easier to just go ahead and
edit the next file you want?

> 2)
> I would also like to know if it is possible to reopen the last files
> (the last tabs) when I reopen vim.
>

:help :mksession

I've found this doesn't work well (for me) if I have TagList windows
open in any of the tab pages. I have not yet investigated the problem,
it may have something to do with my setup. So, I do a ":tabdo
TListClose" before I make a session on the rare occasions I do so.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Naive question: scrolling down keeping only 1 line

On Feb 26, 8:00 am, Jean Johner <jean.joh...@cea.fr> wrote:
>
> Scrolling down with <Page-down> or CTRL-F keeps 2 lines from the
> previous sceen at the top of the new screen.
>
> z+ does the same keeping 0 line.
>
> Is it possible to keep 1 line (as some other editors do by default).
>

CTRL-F and CTRL-B scroll by "pages" at a time, but I cannot find the
definition of a page in the :help anywhere. z+ and z^ work in an
entirely different way, the behavior is not related.

You have a couple options:

1. Use CTRL-U/CTRL-D instead, and set the 'scroll' option to your
taste
2. Re-map CTRL-F/CTRL-B with an :nnoremap command that issues the
command, then scrolls by 1 line with CTRL-Y/CTRL-E in the correct
direction to get the desired amount of context.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: menu --> add input window

> * rameo <raiwil@gmail.com> [100226 16:02]:
> > I added a few menu commands in Gvim.
> >
> > p.e. :sort u
> >
> > Is it possible to ask for an input value:
> >
> > - from line xxx to line xxx
> >
> > and if no input given using "all lines".

You would need a function for this ...

> > How do I create such an input window?

See ':h inputdialog()'.
--
flori
Vim-Hilfe auf Deutsch http://www.florianrehnisch.de/vimhelp/
WARNING: PRGRAMMING BUG IN E2FSCK!
OR SOME BONEHEAD (YOU) IS CHECKING A MOUNTED (LIVE) FILESYSTEM.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: menu --> add input window

* rameo <raiwil@gmail.com> [100226 16:02]:
> I added a few menu commands in Gvim.
>
> p.e. :sort u
>
> Is it possible to ask for an input value:
>
> - from line xxx to line xxx
>
> and if no input given using "all lines".
>
> -------------------
>
> How do I create such an input window?

If I got what you'r about, that can be done with user defined colon
command. See ':h 40.2' + '/LINE RANGE'.

Try out, if this works with the :menu command, too. If not, try and
make a user defined colon command, that you call in your :menu command.

HTH and nice weekend,
--
flori
Vim-Hilfe auf Deutsch http://www.florianrehnisch.de/vimhelp/
WARNING: PRGRAMMING BUG IN E2FSCK!
OR SOME BONEHEAD (YOU) IS CHECKING A MOUNTED (LIVE) FILESYSTEM.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Fonts become fuzzy in vim 7.2

Hi,

I recently upgraded my gvim from 6.2 to 7.2. I found the front which
used to be very sharp in gvim 6.2 became a little fuzzy. Anyone has
similar experience? and how to fix it?

Thanks,
Tina

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Unexpected behaviour of File browser in multi-windows environment

Jean Johner wrote:
> Hi Chip,
>
> Sorry for my lack of precision.
> The official name of the "black bar below the file" in the help is the
> "status line".
> Let us take the windows vim7.2 distribution with the default _vimrc.
>
> Please type:
> gvim file1 (long enough file to full the window)
> :sp . (long enough directory to full the half window created)
>
> The File browser is opened in the upper half window with the cursor
> positioned on ../
>
> Click on the status line below the screen where file1 is written in
> reverse video.
> Result: 1/ the cursor is positioned at its location before :sp . (OK)
> 2/.. is activated in the upper windows (surprising in my
> opinion)
>
> Quit and redo exactly the same except that instead of clicking on the
> status line of file1, you now click somewhere inside file1.
> Result: The cursor is positioned at the place you have clicked and ..
> is not activated in the upper window (OK)
>
> I hope you will reproduce the same behaviour.
>
> Anyway, it is a minor flaw. But vim is so reliable...
>
Hello Jean,

I was able to reproduce the behavior -- unfortunately, I don't know that
I can do anything about it. At the time of the click, the active window
is the file browser window -- and so the leftmouse click is processed in
that window. The change in windows doesn't appear to occur until after
netrw has done its thing. Perhaps you should join the vimdev mailing
list as this problem appears to be a vim one to me.

Regards,
Chip Campbell

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Naive question: scrolling down keeping only 1 line

On Feb 26, 3:16 pm, Tim Chase <v...@tim.thechases.com> wrote:
> What is your 'scrolloff' setting?
>
>    :set scrolloff?

Both :set scrolloff? and :verbose set scrolloff? give scrolloff=0

Changing scrolloff changes the position of the cursor on the next
page after you have typed CTRL-F.

Here I am interested in the number of lines at the bottom of the
screen (before typing CRTL-F) which are reproduced at the top of the
screen after you have typed CTRL-F.

That number is always 2 independly of the scrolloff setting.

Thank you.

Jean Johner

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

menu --> add input window

I added a few menu commands in Gvim.

p.e. :sort u

Is it possible to ask for an input value:

- from line xxx to line xxx

and if no input given using "all lines".

-------------------

How do I create such an input window?

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Possible problem with sudden shortening of very large files by an external process

I often misuse vim to view log files while debugging batch jobs. It is
very handy for moving around in the file, viewing the colorized content
and searching for relevant text. These log files can be from several
thousand to millions of lines. Vim does a remarkably good job of
handling these files. However, sometimes it has a problem when the
batch job is re-run while I am viewing the file in vim, and the log file
is replaced by a much shorter one.

When vim tries to reload the file, sometimes I get a very long series of
red warning messages - I can't repeat the event just now, so can't
provide the content of the warning, but I think it has to do with
missing lines.

This succession of warnings can be inconvenient when there are several
million to report, or even a few thousand! And very occasionally vim
hangs (apparently), or just gives up the ghost and dies. I think
problems are more likely when the 'present location' is far down the
file.

Considering the abuse I am giving vim this is within the range of
acceptable behavior, but I thought it was worth mentioning as an issue
anyway. From the behavior, I speculate that vim has found the present
line to be after the end of file, is trying to move the line pointer
upwards one line at a time, and is finding no data there each time.
--
"He that breaks a thing to find out what it is has left the path of
wisdom."-- J.R.R. Tolkien
- But where does that leave particle physics?

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php