Saturday, June 30, 2012

Re: vim/cygwin: python support

On 6/30/2012 6:04 PM, Tony Mechelynck wrote:
> On 30/06/12 23:32, ping wrote:
>> Thanks
>> I just got it recompiled under cygwin with python support
>> At least Voom that is based on python runs smoothly now
>> I can post detailed steps if anyone is interested
> [...]
>
> Maybe you should create a tip at http://vim.wikia.com/ ?
>
>
> Best regards,
> Tony.

sure I'll seriously do it later..
but currently, I'm still testing it -- trying to move all my linux-based
works (whole .vim including all plugins!) on this new build.

so Voom (python based) works perfect:

[1] bash.exe - 1 [2] tech-tips2.txt_VOOM2
close
2 161 . . |c-s mod> 4570 === arp
2 162 . . |smc 4571
2 163 . . |swap 4572 ==== ##arp
2+ 164 . . |coredump 4573 in.arpd
2+ 166 . . |NFS /1 4574 /etc/inet/hosts <- /etc/hosts
2+ 181 . . |autoFS 4575
2+ 188 . . |RAID & v 4576 /etc/ethers
2+ 192 . . |config v 4577
2+ 196 . . |name ser 4578 arp -a
- 198 . |book3 4579 -s
2 199 . . |etherne> 4580 -d
- 200 = . . |arp 4581
3 201 . . . |##arp 4582
3 202 . . . |##rarp 4583 ==== ##rarp



and ... I do find some minor (maybe not that minor) issue in here, e.g:

1)sometime (not everytime, roughly half chances) follow warning/errors
prompt, press <enter> it will go away and laugh vim.

[ping@ping-new-laptop ~]$ vim
1 [main] vim 6740 child_info_fork::abort: address space needed by
'fcntl.dll' (0x320000) is already occupied

Cannot fork


Press ENTER or type command to continue


2) if 1) happened, then ConqueTerm plugin crash vim; otherwise it works
fine.

#when it crashes:

~
~
~
:ConqueTerm bash.exe

Error detected while processing function 231..conque_term#set_mappings:
line 150:
E31: No such mapping
Vim: Caught deadly signal HUPo continue

Vim: Finished.
Hangup


#when it works (inside vim buffer):

[ping@ping-new-laptop ~]$
[ping@ping-new-laptop ~]$ ls
c doc Dropbox fuf living files n vim win-home win-programfile
[ping@ping-new-laptop ~]$
~
~
~
-- INSERT -- 20,27
All


overall I feel there is still some hopes that it can be a production tool...

regards
ping

--
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: print vim syntax highlighted text to stdout using ansi color

On Sat, 12 May 2012 20:11:07 -0700 (PDT), Peng Yu wrote:
>
>
> On May 12, 6:47 pm, Magnus Woldrich <m...@japh.se> wrote:
>> On May 12, Peng Yu (Peng Yu) wrote:
>>
>>> I'm wondering if there is a way to print the syntax highlighted text
>>> to stdout using ansi color. I was told the following trick to print
>>> the output to an html file. But I'd prefer the output to stdout.
>>
>> Yes, but let us do better than that and use all the available colors and text
>> attributes, making the output to stdout identical to what you see in your vim
>> session.
>>
>> I have this [0] aliased to cat, and when I don't want the highlighting, I just
>> do a \cat file or =cat file instead.
>>
>> Here's a screenshot of what it looks like:http://devel.japh.se/vim-cat/vim_cat.png
>>
>> [0]:https://github.com/trapd00r/utils/blob/master/v
>
> Would please show me how to use it? The figure is not very clear to
> me.
>
> I tried the following. But nothing happens.
>
> ~/dvcs_src/utils$ ./v v
>

Did you check the content of ./v? Is it the same with
the online version? Did you chmod the script to add the execution bit?

I just tried the latest version and it works for me.
Just note that it has been renamed to `_v`.

HTH

--
alick
Fedora 16 (Verne) user
https://fedoraproject.org/wiki/User:Alick

--
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: What does the second example for map() mean?

Chris Jones <cjns1989@gmail.com>:
> On Tue, Jun 26, 2012 at 09:56:48PM EDT, Benjamin R. Haskell wrote:
>> There's an example in the help for map() that reads:
>>
>> :let tlist = map(copy(mylist), ' & . "\t"')
>>
>> What is that ampersand doing there? Is the example incomplete?
>> Obsolete? Should it be v:val instead?
>
> Yes. Looks like someone was making quick changes to the doc and used '&'
> to recall the last match and somehow, a literal ampersand ended up in
> there instead...

From looking at the commit logs it seems that rather an '&' is what was
originally used for substituting in the current value, and then got
replaced by 'v:val' a bit later. This line seems to have been
overlooked. I'll send a patch to vim-dev.

Jan

--
-[ OpenPGP key ID: 00A0FD5F ]-
The most exciting phrase to hear in science, the one that heralds new
discoveries, is not "Eureka!" (I found it!) but "That's funny ..."
-- Isaac Asimov

--
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

Fwd: Re: vim Utl plugin: how to render a linked doc file

Hi guys/experts:

sorry for wide-expend, but I can't figure out a solution for this...
below is the response to my original issue I got from author of Utl plugin:
http://www.vim.org/scripts/script.php?script_id=293

to summarize:

==issue==
use Utl, linking to an external file, when external file is text it
works perfect.
regardless of Utl, with autocmd I can open MS-word files from inside vim
perfectly.
problem is , with Utl linking to external MS-word file, it doesn't work,
instead it give me an empty buffer instead of buffer of the rendered
external file in the text format (this is my target).

==my Utl related config==
let g:utl_cfg_hdl_mt_application_msword="VIM"

==my autocmd==
see below

b.t.w I feel this is a good feature brought by Utl plugin -- it turns
text file into a hyper-linked page, analogous to the vim help file
feature but still be independent of the FT -- just ideally if this
"linking to autocmd rendered external file" feature can work...

regards
ping


-------- Original Message --------
Subject: Re: vim Utl plugin: how to render a linked doc file
Date: Wed, 27 Jun 2012 09:21:30 +0200
From: stefan.bittner@bf-consulting.de
To: songpingemail@gmail.com

Hi,

sorry for the late answer.

If I test with a MS Word document, having in my .vimrc file:

let g:utl_cfg_hdl_mt_application_msword="VIM"

but without these autocmd commands, then I get the Word file displayed
inside Vim when I open it with :Utl . It is of course displayed as
binary data since the .doc is binary data.

Now, when I use these autocmd command, but replacing antiword with
notepad since I have no antiword installed:

autocmd BufReadPre *.doc set ro
autocmd FileReadPre *.doc set ro
autocmd BufReadPre *.doc set hlsearch!
autocmd BufReadPost *.doc %!notepad "%"
autocmd FileReadPost *.doc %!notepad "%"

I get a .doc file displayed in Notepad, ending up inside Vim with an
empty buffer as you described.

So I guess you should modify your autocmd in order not to open the
file externally (in antiword/notepad) but rather filter it and feed it
back into Vim.

I think Utl is not part of your problem.

Regards,
Stefan



> -------- Original-Nachricht --------
> Betreff: Re: vim Utl plugin: how to render a linked doc file
> Datum: Thu, 14 Jun 2012 15:59:43 -0400
> Von: ping <songpingemail@gmail.com>
> An: Stefan Bittner <stefan.bittner@bf-consulting.de>, vim-use
> Mailingliste <vim_use@googlegroups.com>
>
>
>
> hi Stefan:
> sorry I don't know why but somehow email from you were put into SPAM here...
> please see my comments in lines to better answer you.
> please let me know if you have any advice.
>
> On 06/04/2012 12:12 PM, Stefan Bittner wrote:
>> Hi,
>>
>> as I understand your usage, files with an extension ".doc" are not
>> Microsoft-Word documents, but rather text files like a .txt
>> extension.
> *no that is not the case. ".doc" IS MS docs, I use following autocmd to
> open MS-word docs in vim and it works just fine:
>
> "doc to text
> autocmd BufReadPre *.doc set ro
> autocmd FileReadPre *.doc set ro
> autocmd BufReadPre *.doc set hlsearch!
> autocmd BufReadPost *.doc %!antiword "%"
> autocmd FileReadPost *.doc %!antiword "%"
>
> so my goal here is , instead of launch an external handler APP(MS
> office or OOO suite), I want Utl to try open the
> MS word doc ,via using these autocmd to render it, all from inside vim
> -- either in a new buffer in same window or a new tab.*
>
>>
>> What happens is that some extensions (as ".doc" is) are hard coded
>> into Vim which means, that utl.vim is looking for a handler that
>> deals with the document. In your case no one is defined.
>>
>> In order to display files, for which a handler is involved, in Vim,
>> you can provide a handler variable with the special value "VIM".
>> In your case you should put the following line into you .vimrc file:
>>
>> let g:utl_cfg_hdl_mt_application_msword="VIM"*
>> *
> *I put this in .vimrc and restart it, still not working.
> it seems open a new empty buffer.*
>
>>
>> Hope that helps,
>> Regards,
>>
>> Stefan
>>
>> Am 31.05.2012 20:31, schrieb ping:
>>> stefen:
>>> I'm using vim Utl plugin and enjoy it.
>>> http://www.vim.org/scripts/script.php?script_id=293
>>> but today I run into an issue here.
>>> so if I use this in my text:
>>>
>>> 7 habit <url:books/7\ habits\ of\ highly\ effective\
>>> people.txt>
>>>
>>> it works. it will jump into the folder books and open linked file
>>> in current window for me.
>>>
>>> while if I use this:
>>>
>>> 7 habit <url:books/7\ habits\ of\ highly\ effective\
>>> people.doc>
>>>
>>> it report:
>>> No handler for media type application/msword defined yet. Entering
>>> Setup now. <RETURN>
>>>
>>> and i f I return it goes to the Utl help.
>>>
>>> I already have these setup in my vimrc file:
>>>
>>> "doc to text
>>> autocmd BufReadPre *.doc set ro
>>> autocmd FileReadPre *.doc set ro
>>> autocmd BufReadPre *.doc set hlsearch!
>>> autocmd BufReadPost *.doc %!antiword "%"
>>> autocmd FileReadPost *.doc %!antiword "%"
>>>
>>> so if I :open/:read a doc file it will be automatically rendered into vim.
>>>
>>> is there anything missed here?
>>>
>>> copy to the vim google group if anyone else knows how-to.
>>>
>>> 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: How to just load a vim file and run the command and print the output to stdout and exit?

On 01/07/12 05:21, Ben Fritz wrote:
> On Saturday, June 30, 2012 4:12:46 PM UTC-5, Peng Yu wrote:
>> Hi,
>>
>> I just want to run some vim script and print output to stdout and
>> exit. The following will print something at the bottom of the screen
>> without exiting vim. Is there a way to do want I want? Thanks!
>>
>> vim -c "source main.vim"
>>
>> Regards,
>> Peng
>
> You can make Vim quit after running the script like this:
>
> vim -c "source main.vim" -c "q"
>
> Or even better:
>
> vim -S main.vim -c "q"
>
> But I don't know of any way to make Vim print arbitrary stuff to stdout.
>

When started with the -es switches in that order (see :help -s-ex), some
messages will be printed on stdout, but only from a _very limited_ set
of commands. The normal Vim display is suppressed in that mode.

If you're a really lazy typist, like I am, you could even use (maybe
somewhat baroquely)

vim -es -S main.vim -cq

(the space is optional after -c in that case, maybe for compatibility);
or if your script is named Session.vim in the current directory, and
includes the final :q line,

vim -esS

would (I think) be enough.


Best regards,
Tony.
--
"There is a God, but He drinks"
-- Blore

--
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 just load a vim file and run the command and print the output to stdout and exit?

On Saturday, June 30, 2012 4:12:46 PM UTC-5, Peng Yu wrote:
> Hi,
>
> I just want to run some vim script and print output to stdout and
> exit. The following will print something at the bottom of the screen
> without exiting vim. Is there a way to do want I want? Thanks!
>
> vim -c "source main.vim"
>
> Regards,
> Peng

You can make Vim quit after running the script like this:

vim -c "source main.vim" -c "q"

Or even better:

vim -S main.vim -c "q"

But I don't know of any way to make Vim print arbitrary stuff to stdout.

--
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

Treat spaces as tabs only at the start of the line

I have sofftabstop (and shiftwidth) set to 4, and expandtab enabled. Thus, when deleting groups of spaces, vim treats them as tabs and deletes them 4 at a time. I want vim to do that only if from the start of the line and up to the cursor's position there's only spaces and nothing else.
Currently I'm doing the following:

inoremap <silent> <BS> <C-R>=fbs()<CR>

function fbs()
if getline('.') =~ '^ \{' . (col('.') - 1) . '}'
return "\<BS>"
endif
return "\<Left>\<Del>"
endfunction

It works, but it breaks the repeat (dot) command, and I don't want that :). I think it's because of the <Left>. Any help (either modifying the previous code so that it doesn't break the dot command or coming up with a new one that doesn't) is appreciated.

--
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: vim/cygwin: python support

On 30/06/12 23:32, ping wrote:
> Thanks
> I just got it recompiled under cygwin with python support
> At least Voom that is based on python runs smoothly now
> I can post detailed steps if anyone is interested
[...]

Maybe you should create a tip at http://vim.wikia.com/ ?


Best regards,
Tony.
--
There is a Massachusetts law requiring all dogs to have their hind legs
tied during the month of April.

--
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: vim/cygwin: python support

Thanks
I just got it recompiled under cygwin with python support
At least Voom that is based on python runs smoothly now
I can post detailed steps if anyone is interested

------Original Message------
From: Tony Mechelynck
To: vim_use@googlegroups.com
Cc: ping
Cc: cygwin@cygwin.com
Cc: Vlad Irnov
Subject: Re: vim/cygwin: python support
Sent: Jun 30, 2012 09:09

On 29/06/12 16:22, ping wrote:
> not sure this should go to vim/cygwin team...so copy both and Vlad(Voom
> plugin author)
> I got a new laptop (folio) come with win7.
> for some reason I want to give win7 a trial.
>
> cygwin full install went smooth.
> but looks I don't have python support here.
> that means I won't be able to have some plugins (like Voom) that is
> based on python.
> I did a lot of search and looks this is a common issue, but still I
> don't see a clear answer yet.
> any cygwin users can advise?
>
> regards
> ping

When I was still on Windows, I used to have some Cygwin packages
installed, but the Python I used (and compiled Vim with, using the
make_cyg.mak and the Cygwin/MinGW gcc) was not from Cygwin but from
python.org itself. See
http://users.skynet.be/antoine.mechelynck/vim/compile.htm for details.

The vim.exe and gvim.exe which I made that way were _built_ under Cygwin
but not for _use_ under Cygwin — they were for use under Windows from a
desktop icon or a cmd.exe prompt, and did not use the cygwin1.dll
library. Also, Win64 was still a thing of the future at the time.

DISCLAIMER: The HowTo page mentioned two paragraphs above is about 1½
years old, and since I have left Windows forever I cannot check if it is
still accurate. However, even if it isn't, a "clever user" ought to be
able to fill in the gaps.


Best regards,
Tony.
--
Ask not for whom the <CONTROL-G> tolls.




--
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 just load a vim file and run the command and print the output to stdout and exit?

Hi,

I just want to run some vim script and print output to stdout and
exit. The following will print something at the bottom of the screen
without exiting vim. Is there a way to do want I want? Thanks!

vim -c "source main.vim"

Regards,
Peng

--
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 did I get two instances of vim?

On Jun 30, 2012, at 9:53 AM, Tim Gray wrote:

> To me, the signs point that your installation of Vim isn't doing proper housekeeping when you shut things down. Maybe session.vim is involved, maybe not. You could deactivate it and see the swap file behavior is different. You could also keep an eye out on your instance names with it deactivated. The only time you should see VIM1 is if you start up a second instance while one is already running.

I can produce the symptoms---multiple instances of vim, persisting swap files. I can do it reliably. Write all my files. Then quit vim without closing the session that was loaded.

When I do that the vim process in Activity Monitor persists. The swap files for all the files included in the session persist. The next time vim is started it starts as vim1. The default session will not be loaded automatically. A second set of swap files will be created when I do OpenSession manually.

If I go through the same process with vim1 as I did with vim, the same thing happens. The two vim processes in Activity Monitor persist. The swap files persist. The next time vim is started it starts as vim2. Etc., etc., etc.

If I close the session before quitting vim, the symptoms don't occur. If I don't, they do.

My conclusion: Quitting vim without closing the open session causes the problem.

Again, I could not have discovered this without your initial suggestions. So thank you again.

------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA
eeweir@bellsouth.net

"What is man without the beasts? If all the beasts were gone,
men would die from a great loneliness of spirit."

- Chief Seattle






--
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 did I get two instances of vim?

On Jun 30, 2012 at 06:39 AM -0400, Eric Weir wrote:
>Again, I could be overlooking something, but none of your
>suggestions---improper shut down, etc.---rings a bell. All I know is
>when I deleted all those swap files and started closing the session
>before quitting vim, I haven't had the problem.

You really shouldn't have to manually delete swap files if you are
saving and closing your files properly. Something is amiss. You should
ask the list directly about that.

>I'm puzzled how there could be instances of vim running that don't show
>up anywhere, at least in the places I would expect them---in the menu
>bar, minimized on the desktop, in Activity Monitor.

They aren't necessarily running. I'm not sure how Vim records that it
has instances up and running, but if it fails to record that an
instances has CLOSED, then it might think the VIM instance is
active (and it's not), so when you start up a new instance, you get
VIM1.

To me, the signs point that your installation of Vim isn't doing proper
housekeeping when you shut things down. Maybe session.vim is involved,
maybe not. You could deactivate it and see the swap file behavior is
different. You could also keep an eye out on your instance names with
it deactivated. The only time you should see VIM1 is if you start up a
second instance while one is already running.

--
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: where are those %F, %y, %f......

On 30/06/12 15:39, Tony Mechelynck wrote:
> On 28/06/12 15:37, Charles Campbell wrote:
>> Tony Mechelynck wrote:
>>> On 27/06/12 16:55, Charles Campbell wrote:
>>>> Bee wrote:
>>>>>
>>>>> On Jun 26, 2:51 pm, andy richer<andy.ric...@gmail.com> wrote:
>>>>>> On Fri, Jun 15, 2012 at 5:28 PM, Tony Mechelynck<
>>>>>>
>>>>>> antoine.mechely...@gmail.com> wrote:
>>>>>>
>>>>>>> 'titlestring' is a 'statusline'-like option. If you want a specific
>>>>>>> (nondefaut) title, you set it. For instance, having
>>>>>>> if has('title')
>>>>>>> set title titlestring=%F%y%m%r
>>>>>>> endif
>>>>>>> Best regards,
>>>>>>> Tony.
>>>>>>> --
>>>>>>> I tried to use :help %F, %y,... to find the definition above with no
>>>>>>> luck.
>>>>>> And by experiment I see %F shows ~/c/d/e.v, %f shows ./c/d/e.v
>>>>>> if I
>>>>>> opened e.v inside a utility called SOS.
>>>>>> 1.
>>>>>> Would anyone please advise me where can I find all those %x
>>>>>> definition in
>>>>>> gvim?
>>>>>> 2.
>>>>>> I modified above example to: set title titlestring=%{$PWD}/%f and it
>>>>>> works in titlebar.
>>>>>> The thing is that it shows "/a/b/c/d/e.v" where e.v is the file
>>>>>> name.
>>>>>> How can I show "e.v /a/b/c/d" in titlebar?
>>>>>>
>>>>>> Best Regards,
>>>>>> Andy
>>>>> :help titlestring
>>>>> When this option contains printf-style '%' items,
>>>>> they will be expanded according to the rules used for 'statusline'.
>>>>>
>>>>> :help statusline
>>>>>
>>>> Additionally, when one is perplexed about finding help for something in
>>>> Vim's help pages, use helpgrep. Applied to your question:
>>>>
>>>> :helpgrep %F
>>>> :cope
>>>>
>>>> would've pointed you in the right direction.
>>>>
>>>> Regards,
>>>> Chip Campbell
>>>>
>>> In this case, the only uses of %F in the help are in an example under
>>> 'titlestring' and in a TODO item.
>>>
>>> Bee's reply, and the line where I said earlier that 'titlestring' is a
>>> 'statusline'-like option, should have pointed Andy the help for
>>> 'statusline', where it is explained first that there can be
>>> printf-style % items in the value of that option, and lower down
>>> (about one page down with my 'guifont' in a maximized gvim) there is a
>>> list of possible items. For %F, the relevant line is:
>>>
>>> F S Full path to the file in the buffer.
>>>
>>> and its meaning is explained in the help text that comes above it.
>> Tony -- have you heard the phrase, "Give a man a fish and you feed him
>> for a day. Teach a man to fish and you feed him for a lifetime"?
>>
>> I was attempting to "teach the man to fish".
>>
>> Regards,
>> Chip Campbell
>>
>
> Aha. And what do you do when no fish bites on the kind of fishline you
> taught him to use?
>
>
> Best regards,
> Tony.

P.S. I was also trying to "teach him to fish", namely, by paying
attention to what he's been told. Let's hope he will, in the future.


Best regards,
Tony.
--
"You can't survive by sucking the juice from a wet mitten."
-- Charles Schulz, "Things I've Had to Learn Over and
Over and Over"

--
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: where are those %F, %y, %f......

On 28/06/12 15:37, Charles Campbell wrote:
> Tony Mechelynck wrote:
>> On 27/06/12 16:55, Charles Campbell wrote:
>>> Bee wrote:
>>>>
>>>> On Jun 26, 2:51 pm, andy richer<andy.ric...@gmail.com> wrote:
>>>>> On Fri, Jun 15, 2012 at 5:28 PM, Tony Mechelynck<
>>>>>
>>>>> antoine.mechely...@gmail.com> wrote:
>>>>>
>>>>>> 'titlestring' is a 'statusline'-like option. If you want a specific
>>>>>> (nondefaut) title, you set it. For instance, having
>>>>>> if has('title')
>>>>>> set title titlestring=%F%y%m%r
>>>>>> endif
>>>>>> Best regards,
>>>>>> Tony.
>>>>>> --
>>>>>> I tried to use :help %F, %y,... to find the definition above with no
>>>>>> luck.
>>>>> And by experiment I see %F shows ~/c/d/e.v, %f shows ./c/d/e.v if I
>>>>> opened e.v inside a utility called SOS.
>>>>> 1.
>>>>> Would anyone please advise me where can I find all those %x
>>>>> definition in
>>>>> gvim?
>>>>> 2.
>>>>> I modified above example to: set title titlestring=%{$PWD}/%f and it
>>>>> works in titlebar.
>>>>> The thing is that it shows "/a/b/c/d/e.v" where e.v is the file
>>>>> name.
>>>>> How can I show "e.v /a/b/c/d" in titlebar?
>>>>>
>>>>> Best Regards,
>>>>> Andy
>>>> :help titlestring
>>>> When this option contains printf-style '%' items,
>>>> they will be expanded according to the rules used for 'statusline'.
>>>>
>>>> :help statusline
>>>>
>>> Additionally, when one is perplexed about finding help for something in
>>> Vim's help pages, use helpgrep. Applied to your question:
>>>
>>> :helpgrep %F
>>> :cope
>>>
>>> would've pointed you in the right direction.
>>>
>>> Regards,
>>> Chip Campbell
>>>
>> In this case, the only uses of %F in the help are in an example under
>> 'titlestring' and in a TODO item.
>>
>> Bee's reply, and the line where I said earlier that 'titlestring' is a
>> 'statusline'-like option, should have pointed Andy the help for
>> 'statusline', where it is explained first that there can be
>> printf-style % items in the value of that option, and lower down
>> (about one page down with my 'guifont' in a maximized gvim) there is a
>> list of possible items. For %F, the relevant line is:
>>
>> F S Full path to the file in the buffer.
>>
>> and its meaning is explained in the help text that comes above it.
> Tony -- have you heard the phrase, "Give a man a fish and you feed him
> for a day. Teach a man to fish and you feed him for a lifetime"?
>
> I was attempting to "teach the man to fish".
>
> Regards,
> Chip Campbell
>

Aha. And what do you do when no fish bites on the kind of fishline you
taught him to use?


Best regards,
Tony.
--
Good day to let down old friends who need help.

--
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: please explain g/\S/,/^\s*$/j

On 29/06/12 20:06, Bee wrote:
>
>
> On Jun 29, 10:56 am, Taylor Hedberg <tmhedb...@gmail.com> wrote:
>> Bee, Fri 2012-06-29 @ 10:39:54-0700:
>>
>>> Please explain HOW this works.
>>> g/\S/,/^\s*$/j
>>
>>> I see it joins all lines by paragraph.
>>
>>> g/\S/ find all lines that contain non-whitespace
>>
>>> , ??? what does this do?
>>
>>> /^\s*$/ find all blank lines (only zero or more whitespace)
>>
>>> j ??? what does this do?
>>
>> `,/^\s*$/j` is a command that will be executed on each line that matches
>> the /\S/ pattern (that's how the :g command works: :g/pattern/command).
>> So it will be executed on each line that contains a non-whitespace
>> character.
>>
>> The actual command here is `j`, which joins lines. Like many ex
>> commands, it can be prefixed with a range of addresses to indicate which
>> line(s) it should apply to. A range consists of an address, then a
>> comma, then another address. In this case, the first address is omitted,
>> which means it defaults to the current line (in this case, the line that
>> matched the /\S/ pattern). The comma separates this from the second
>> address, /^\s*$/. These two addresses comprise the start and end lines
>> for the join operation.
>>
>> So in a nutshell, this command finds every non-blank line in the buffer.
>> On each of those lines (A), it searches forward for the next blank line
>> (B), and joins each line in the range from A to B using the :j command.
>>
>> signature.asc
>> < 1KViewDownload
>
> Thank you.
>
> My confusion, I was thinking the 'j' was the 'normal' version for line
> down and was expecting the 'normal J' for join. Now I understand it is
> ':j' for join lines.
>

Yes, the command to be executed on each match of the :g command is
always an ex-command (the kind you would use after typing a colon, or on
any line of a script such as your vimrc). If you don't specify an
ex-command after the pattern, then :p is used by default (print, which
defaults to displaying the current line if no range is used). That's
where the Unix grep command got its name: g/re/p where /re/ stands for
"regular expression".


Best regards,
Tony.
--
"I'd love to go out with you, but I have to stay home and see if I
snore."

--
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: vim/cygwin: python support

On 29/06/12 16:22, ping wrote:
> not sure this should go to vim/cygwin team...so copy both and Vlad(Voom
> plugin author)
> I got a new laptop (folio) come with win7.
> for some reason I want to give win7 a trial.
>
> cygwin full install went smooth.
> but looks I don't have python support here.
> that means I won't be able to have some plugins (like Voom) that is
> based on python.
> I did a lot of search and looks this is a common issue, but still I
> don't see a clear answer yet.
> any cygwin users can advise?
>
> regards
> ping

When I was still on Windows, I used to have some Cygwin packages
installed, but the Python I used (and compiled Vim with, using the
make_cyg.mak and the Cygwin/MinGW gcc) was not from Cygwin but from
python.org itself. See
http://users.skynet.be/antoine.mechelynck/vim/compile.htm for details.

The vim.exe and gvim.exe which I made that way were _built_ under Cygwin
but not for _use_ under Cygwin — they were for use under Windows from a
desktop icon or a cmd.exe prompt, and did not use the cygwin1.dll
library. Also, Win64 was still a thing of the future at the time.

DISCLAIMER: The HowTo page mentioned two paragraphs above is about 1½
years old, and since I have left Windows forever I cannot check if it is
still accurate. However, even if it isn't, a "clever user" ought to be
able to fill in the gaps.


Best regards,
Tony.
--
Ask not for whom the <CONTROL-G> tolls.


--
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: New build of official Vim?

On 29/06/12 17:33, Ben Fritz wrote:
> On Friday, June 29, 2012 9:15:33 AM UTC-5, Robert wrote:
>> The current version at vim.org for Windows is 7.3_46. If I look at the Cream download it is at 7.3_556. So what determines if a newer build of the official gets put out there?
>>
>> Note: I rely on the installer, I don't build Vim myself.
>>
>> I am just curious really.
>>
>> Robert
>
> Normally Bram only releases a new installer with a new minor version, not for new patches. The 7.3.46 was an oddity, I think there were some big windows bugs fixed somewhere in those first 46 patches. The next "official" installer will most likely be 7.4.0 or 8.0.0.
>

Yes, and one of the reasons Bram doesn't feel the need to compile Vim
executables very often is that Steve Hall very regularly updates his
"Vim without Cream" distribution for Windows, Björn Winckler regularly
releases MacVim for the Macintosh (and maintains "snapshots" for MacVim
beta-testers), and (I suppose) Linux or other non-Mac "Unix-like" users
are more "technical" and not afraid of compiling Vim from source, or
those who are can get "reasonably recent" versions (though maybe still a
few months old) from whatever distribution they are using. (For example,
the latest gvim on the openSUSE Linux "stable" 12.1 release that I'm
using is a 7.3.322 about half a year old. I prefer compiling my own.) :-)

With the new patches that came out yesterday, the latest patchlevel of
Vim is 7.3.582. OTOH the first patch not in Steve's "Vim without Cream",
i.e. 7.3.557, is only about 10 days old, so I think you can confidently
use that unless you experience one of the bugs fixed by a later patch,
as shown near the end of http://ftp.vim.org/pub/vim/patches/7.3/README
I'm copying them here for your convenience:

> 2958 7.3.557 crash when an autocommand wipes out a buffer when it is hidden
> 2956 7.3.558 (after 7.3.552) memory access error
> 3483 7.3.559 home_replace() does not work with 8.3 filename
> 1551 7.3.560 get an error for a locked argument in extend()
> 1511 7.3.561 refresh: always in a complete function breaks the "." command
> 1659 7.3.562 ":profdel" works when the +profile feature is disabled
> 2742 7.3.563 (after 7.3.557) can't build with tiny features
> 1785 7.3.564 (after 7.3.559) warning for pointer conversion
> 1806 7.3.565 can't generate proto file for Python 3
> 2363 7.3.566 (after 7.3.561) redo works incorrectly without refresh:always
> 1739 7.3.567 missing copyright notice
> 3890 7.3.568 bad indents for #ifdefs
> 133265 7.3.569 evaluating Vim expression in Python is insufficient
> 4659 7.3.570 ":vimgrep" does not obey 'wildignore'
> 3915 7.3.571 duplicated condition
> 1915 7.3.572 duplicate statement in if and else
> 1419 7.3.573 using array index before bounds checking
> 2491 7.3.574 a CTRL-L character is not pasted on the search command line
> 1586 7.3.575 "ygt" tries to yank instead of giving an error
> 7301 7.3.576 formatting of lists inside comments is not right yet
> 6542 7.3.577 size of memory does not fit in 32 bit unsigned
> 2025 7.3.578 misplaced declaration.
> 7644 7.3.579 (after 7.3.569) can't compile with Python 2.5
> 1517 7.3.580 warning on 64 bit MS-Windows
> 4236 7.3.581 problems compiling with Python
> 1342 7.3.582 missing pieces in test OK file

As you can see, Vim is actively updated software. :-)

The reason Steve's builds are labeled "unofficial" is that Bram doesn't
compile them. However they are made from Bram's own sources using a good
C/C++ compiler (the Cygwin/MinGW gcc for "native" Windows, I think).
That compiler (the one I think Steve uses) is not made by Microsoft. I
never had trouble with it when I was still on Windows, and I haven't
noticed complaints about Vim that could be traced to a bug in that compiler.


Best regards,
Tony.
--
FATHER: Did you kill all those guards?
LAUNCELOT: Yes ... I'm very sorry ...
FATHER: They cost fifty pounds each!
"Monty Python and the Holy Grail" PYTHON (MONTY)
PICTURES LTD

--
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: print vim syntax highlighted text to stdout using ansi color

On Fri, Jun 29, 2012 at 9:08 PM, Dave <david.t.kerns@gmail.com> wrote:
> Wow, I've wanted this for a long time... I copied your script, and called it ccat, but get this (hope the attachment works)

How it works? In my previous email, I showed that I couldn't get it
work. Would you please show me which command you copied and what is
the command line? Thanks!


--
Regards,
Peng

--
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 did I get two instances of vim?

On Jun 30, 2012, at 6:39 AM, Eric Weir wrote:

> On Jun 29, 2012, at 11:38 AM, Tim Gray wrote:
>
>> You seem to think all of your problems are always from whatever plugin you are running. I would look into why a newly started MacVim instance is starting as VIM1 and not VIM. I don't think that's a session thing. I also don't think it's a session thing that you have swap files scattered about. That sounds like something related to improper shut down to me.
>
> Again, I could be overlooking something, but none of your suggestions---improper shut down, etc.---rings a bell.

One thing I haven't mentioned: I start MacVim with QuickSilver. I type <ctrl> <space> to bring up qs, then mv to get the MacVim icon displayed, then hit <return> to start vim.

I don't know if that could get multiple surreptitious instances of vim going or not.

------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA
eeweir@bellsouth.net

"What is man without the beasts? If all the beasts were gone,
men would die from a great loneliness of spirit."

- Chief Seattle






--
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 did I get two instances of vim?

On Jun 29, 2012, at 11:38 AM, Tim Gray wrote:

> .... You have swap files sitting around. You get warnings when you try to open a file and there is a swap file for it already. Vim makes swap files when you open a file. It's supposed to remove them when you close a buffer. If the buffer hasn't been closed properly (vim crashes, you lose power, or something else), then the swap file doesn't get deleted and you get warned the next time you open that file..... Another common reason to get that warning is if you start editing a file that is already open by another instance of vim.
>
> The question is why is why do you have swap files sitting around?

I haven't a clue. None of the suggestions above ring a bell. I don't think vim has ever crashed for me, I always write my files before quitting vim, etc., etc.

> The processes in Activity Monitor are not necessarily all separate instances of Vim. When I start up MacVim, I get one process named MacVim and two named Vim. Opening up a new instance (VIM1), gives me one extra process named Vim in Activity Monitor.
>
> I didn't bring up Activity Monitor as a way for you to count Vim instances. It was a way to make sure that you could have nothing related to vim running. Quit Vim. Then check Activity Monitor for anything called vim in there. If you've quit all instances of vim, there shouldn't be anything there related to vim. Then you can start from a clean slate.

Don't know if I've ever seen a process called MacVim when I start MacVim. Yesterday and today, at least, they been called Vim, Vim!, or Vim2. As I recall, in beginning to work with your suggestions yesterday, I believe I had three processes called Vim running after I had quit vim.

>> I'm wondering if the way I've been using vim-session is part of, or all of, the problem. Do I need to close the session before quitting vim?
>
> That would make sense to me. I'm not sure if the lock file is cleaned up if you don't close the session. I've not looked at the code to check. I also don't particularly care because I just use :CloseSession when I'm done.

Yes, the lock file goes away when you close the session. Since starting to close the session prior to quitting vim I've not had multiple instances of vim or persisting swap files.

> You seem to think all of your problems are always from whatever plugin you are running. I would look into why a newly started MacVim instance is starting as VIM1 and not VIM. I don't think that's a session thing. I also don't think it's a session thing that you have swap files scattered about. That sounds like something related to improper shut down to me.

Again, I could be overlooking something, but none of your suggestions---improper shut down, etc.---rings a bell. All I know is when I deleted all those swap files and started closing the session before quitting vim, I haven't had the problem.

> If you completely quit vim and restart it, you should have a vim server running with the name VIM (on MacVim at least). If it's something else, like VIM1, something funny is going on - Vim must seem to think instance VIM is occupied. This isn't a session thing (most likely).

I'm puzzled how there could be instances of vim running that don't show up anywhere, at least in the places I would expect them---in the menu bar, minimized on the desktop, in Activity Monitor.

Bottom line, the symptoms have been eliminated, though the problem, the underlying reason, has not been solved.

Even that much would not have been possible without your feedback.

So thanks,
------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA
eeweir@bellsouth.net

"Everywhere the crisis of the private financial system
has been transformed into a tale of slovenly and overweening government
that perpetuates and is perpetuated by a dependent and demanding population."

- Marilynne Robinson



--
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, June 29, 2012

Re: print vim syntax highlighted text to stdout using ansi color

Wow, I've wanted this for a long time... I copied your script, and called it ccat, but get this (hope the attachment works)

--
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: fullscreen in vim dont change $LINES and $COLUMN after quit vim

On Friday, June 29, 2012 7:51:17 PM UTC+12, sgra ekim wrote:
> Oh, I solved this.
> There is a 'checkwinsize' option ...

Thanks for that. Checking, I've got checkwinsize set, which is not the bash default; it's been set in /etc/bash.bashrc, which looks like one of those somewhat arbitrary debian or ubuntu tweaks.

Regards, 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: It works but it doesn't work

On 06/29/12 16:27, howard Schwartz wrote:
> I discovered the problem.

I should have double-checked (I changed domain registrars and my
domain was messed up for the last 24hr or so. Ditched GoDaddy to
1&1, but unhappy with how 1&1 handled the DNS transfer </gripe>)
before I resynced my mail online or I would have seen the other
replies where it looks like everything got sorted out. Glad you got
things working.

-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: It works but it doesn't work

Yes, I often seem to make simple mistakes when typing to the vim group. The
command should be:

g/^.\{80,}$/normal gqgq

I discovered the problem. The text I run the script is converted, with
software from a complex PDF file. It includes very long lines as well as
hyphenated lines that are both long (over 80 characters) and short.

I made the script work by setting textwidth=2000 before executing the
command that gets rid of the hyphens, and then resetting it to 75 when I ran
the formatting command that shortens long lines.

Apparently, the hyphen command, which included an EOL character (\n) did not
work on lines that were longer than the value of textwidth.

It took a while to realize that the value of textwidth would affect this
command.


On Fri, 29 Jun 2012, Tim Chase wrote:

> On 06/29/12 01:10, howard Schwartz wrote:
>> "wrap long lines
>> g/^.\{80,}$/gqgq
>
> Are you sure you don't need a "normal" in there?
>
> g/^.\{80,}$/norm gqq
>
> -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: It works but it doesn't work

On 06/29/12 01:10, howard Schwartz wrote:
> "wrap long lines
> g/^.\{80,}$/gqgq

Are you sure you don't need a "normal" in there?

g/^.\{80,}$/norm gqq

-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: please explain g/\S/,/^\s*$/j

On Jun 29, 10:56 am, Taylor Hedberg <tmhedb...@gmail.com> wrote:
> Bee, Fri 2012-06-29 @ 10:39:54-0700:
>
> > Please explain HOW this works.
> > g/\S/,/^\s*$/j
>
> > I see it joins all lines by paragraph.
>
> > g/\S/ find all lines that contain non-whitespace
>
> > , ??? what does this do?
>
> > /^\s*$/ find all blank lines (only zero or more whitespace)
>
> > j ??? what does this do?
>
> `,/^\s*$/j` is a command that will be executed on each line that matches
> the /\S/ pattern (that's how the :g command works: :g/pattern/command).
> So it will be executed on each line that contains a non-whitespace
> character.
>
> The actual command here is `j`, which joins lines. Like many ex
> commands, it can be prefixed with a range of addresses to indicate which
> line(s) it should apply to. A range consists of an address, then a
> comma, then another address. In this case, the first address is omitted,
> which means it defaults to the current line (in this case, the line that
> matched the /\S/ pattern). The comma separates this from the second
> address, /^\s*$/. These two addresses comprise the start and end lines
> for the join operation.
>
> So in a nutshell, this command finds every non-blank line in the buffer.
> On each of those lines (A), it searches forward for the next blank line
> (B), and joins each line in the range from A to B using the :j command.
>
>  signature.asc
> < 1KViewDownload

Thank you.

My confusion, I was thinking the 'j' was the 'normal' version for line
down and was expecting the 'normal J' for join. Now I understand it is
':j' for join lines.

--
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: please explain g/\S/,/^\s*$/j

On 2012-06-29, Bee wrote:
> Please explain HOW this works.
> g/\S/,/^\s*$/j
>
> I see it joins all lines by paragraph.
>
> g/\S/ find all lines that contain non-whitespace
>
> , ??? what does this do?

The comma (,) is a range separator. See

:help 10.3
:help [range]

> /^\s*$/ find all blank lines (only zero or more whitespace)

/\S/,/^\s*$/

specifies the range of lines from the first one containing a
non-whitespace character through the next line containing only
whitespace (possibly none).

> j ??? what does this do?

:help :j

It joins all the lines in the range.

The :g tells Vim to do this for all such ranges.

HTH,
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: please explain g/\S/,/^\s*$/j

Bee, Fri 2012-06-29 @ 10:39:54-0700:
> Please explain HOW this works.
> g/\S/,/^\s*$/j
>
> I see it joins all lines by paragraph.
>
> g/\S/ find all lines that contain non-whitespace
>
> , ??? what does this do?
>
> /^\s*$/ find all blank lines (only zero or more whitespace)
>
> j ??? what does this do?

`,/^\s*$/j` is a command that will be executed on each line that matches
the /\S/ pattern (that's how the :g command works: :g/pattern/command).
So it will be executed on each line that contains a non-whitespace
character.

The actual command here is `j`, which joins lines. Like many ex
commands, it can be prefixed with a range of addresses to indicate which
line(s) it should apply to. A range consists of an address, then a
comma, then another address. In this case, the first address is omitted,
which means it defaults to the current line (in this case, the line that
matched the /\S/ pattern). The comma separates this from the second
address, /^\s*$/. These two addresses comprise the start and end lines
for the join operation.

So in a nutshell, this command finds every non-blank line in the buffer.
On each of those lines (A), it searches forward for the next blank line
(B), and joins each line in the range from A to B using the :j command.

please explain g/\S/,/^\s*$/j

Please explain HOW this works.
g/\S/,/^\s*$/j

I see it joins all lines by paragraph.

g/\S/ find all lines that contain non-whitespace

, ??? what does this do?

/^\s*$/ find all blank lines (only zero or more whitespace)

j ??? what does this do?

Bill

--
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: vim: use external program, but direct output to a new vsplitted buffer

On 06/29/2012 11:40 AM, Ben Fritz wrote:

>> so using another tip I learned from a previous thread, how about this:
>>
>> "redirect output to reg z
>> :redir @z
>> "take seleted text as input, output to screen
>> :'<,'> !asciidoc ...
>
> You forgot the w. But maybe it's just a typo.
>
> :'<,'>w !asciidoc
>
> See :help :w_c.
>
>> "end redirection
>> :redir END
>> "open a vsplit win
>> :vsp
>> "paste content of reg z
>> "zp
>>

hi Ben,
yes that is a typo when I write email, I use w when I tested.

gary said in his reply:
:redir redirects the output of Vim commands, not shell commands.

I assume that's why...

thanks aw.

regards
ping

--
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: vim: use external program, but direct output to a new vsplitted buffer

On Thursday, June 28, 2012 3:27:15 PM UTC-5, ping wrote:
> thanks Ben, for the solutions.
> looks like the default behavior is , if you selected a range of text as
> the input, then the output from external prog will overide the input
> texts...
>
> 1) to summarize as a learning excercise
> http://vim.wikia.com/wiki/Display_output_of_shell_commands_in_new_window
> this looks good when no need use range of text as input
>
> 2) :'<,>'w !ext-prog
> I found this syntax is interesting.
> it take seleted text as input, but just print the output to the screen,
> without overiding the selected text. which seems good.
>
> so using another tip I learned from a previous thread, how about this:
>
> "redirect output to reg z
> :redir @z
> "take seleted text as input, output to screen
> :'<,'> !asciidoc ...

You forgot the w. But maybe it's just a typo.

:'<,'>w !asciidoc

See :help :w_c.

> "end redirection
> :redir END
> "open a vsplit win
> :vsp
> "paste content of reg z
> "zp
>
> surprisingly I got nothing here.
>
> 3) yes asciidoc has its way to define an output filename, but my again
> that's not what I want (I want the def a similar behavior like :TOhtml)
>
> but it's not big deal. either way I can done my work, just wonder what's
> the best options here.
>
> currently I'm just using:
> :'<,'>!ext-prog
> yank the output (which overide my original texts as input)
> u to recover my text back
> open another window and paste
>

--
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 did I get two instances of vim?

On Jun 29, 2012 at 11:08 AM -0400, Eric Weir wrote:
>When I do this, I get a "swap file already exists" *every* time I load
>a file---no matter how many times I load it. Even after I've written
>the file. I tried deleting "~/.vim/sessions/default.vim.lock." That at
>least got the session to load when vim is started up, but I get the
>"swap file already exists" warning with it too. Again, *every* time I
>open the file. Even after writing it.

Well, if you don't remove the swap file, then you should get that
warning every time. Note, this isn't a session.vim issue, this is just
a vim issue. You have swap files sitting around. You get warnings when
you try to open a file and there is a swap file for it already. Vim
makes swap files when you open a file. It's supposed to remove them
when you close a buffer. If the buffer hasn't been closed properly (vim
crashes, you lose power, or something else), then the swap file doesn't
get deleted and you get warned the next time you open that file. "Hey,
there's a swap file here, do you want to edit it?" Another common
reason to get that warning is if you start editing a file that is
already open by another instance of vim.

The question is why is why do you have swap files sitting around?

>I quite vim and restart it. It opens as vim1 again! The default session
>doesn't load I look at the Activity Monitor and there are two instances
>of vim again! What the hell is going on?

The processes in Activity Monitor are not necessarily all separate
instances of Vim. When I start up MacVim, I get one process named
MacVim and two named Vim. Opening up a new instance (VIM1), gives me
one extra process named Vim in Activity Monitor.

I didn't bring up Activity Monitor as a way for you to count Vim
instances. It was a way to make sure that you could have nothing
related to vim running. Quit Vim. Then check Activity Monitor for
anything called vim in there. If you've quit all instances of vim,
there shouldn't be anything there related to vim. Then you can start
from a clean slate.

>I'm wondering if the way I've been using vim-session is part of, or all
>of, the problem. Do I need to close the session before quitting vim?

That would make sense to me. I'm not sure if the lock file is cleaned
up if you don't close the session. I've not looked at the code to
check. I also don't particularly care because I just use :CloseSession
when I'm done.

You seem to think all of your problems are always from whatever plugin
you are running. I would look into why a newly started MacVim instance
is starting as VIM1 and not VIM. I don't think that's a session thing.
I also don't think it's a session thing that you have swap files
scattered about. That sounds like something related to improper shut
down to me.

If you completely quit vim and restart it, you should have a vim server
running with the name VIM (on MacVim at least). If it's something else,
like VIM1, something funny is going on - Vim must seem to think instance
VIM is occupied. This isn't a session thing (most likely).

--
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: It works but it doesn't work

On Friday, June 29, 2012 2:05:44 AM UTC-5, Gary Johnson wrote:
>
> If you're using Windows, it could be that you are saving script.vim
> with the DOS file format, i.e., with carriage-return/line-feed line
> endings. When Vim sources such a file, it sees the carriage returns
> at the ends of the lines as part of the lines and not as part of the
> line terminators.
>

Native Windows Vim sources scripts with DOS fileformat without any problems.

The problem with sourcing these scripts is on Unix Vim or maybe cygwin Vim.

--
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: New build of official Vim?

On Friday, June 29, 2012 9:15:33 AM UTC-5, Robert wrote:
> The current version at vim.org for Windows is 7.3_46. If I look at the Cream download it is at 7.3_556. So what determines if a newer build of the official gets put out there?
>
> Note: I rely on the installer, I don't build Vim myself.
>
> I am just curious really.
>
> Robert

Normally Bram only releases a new installer with a new minor version, not for new patches. The 7.3.46 was an oddity, I think there were some big windows bugs fixed somewhere in those first 46 patches. The next "official" installer will most likely be 7.4.0 or 8.0.0.

--
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: g_ different from :normal! g_

On Thursday, June 28, 2012 3:32:53 PM UTC-5, rockybalboa4 wrote:
> Is there any rationale behind the fact that
>
> dg_
>
> yields different results than
>
> d:normal! g_
>
> ? The latter does not reach the last character on the line. Is it documented? Shouldn&#39;t it be documented? Is it a bug?

I don't know if it's a bug, or if it's documented somewhere, but it looks like d:normal! g_ is acting in an "exclusive" fashion, even though g_ is normally "inclusive".

With that in mind, this DOES work (for me anyway):

dv:normal! g_

See :help o_v

--
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 did I get two instances of vim?

On Jun 29, 2012, at 11:08 AM, Eric Weir wrote:

> I'm wondering if the way I've been using vim-session is part of, or all of, the problem. Do I need to close the session before quitting vim? I've been assuming that if the default session has the files I want on startup, I wouldn't need to, that simply quitting vim, making sure all files are written before doing so, would be OK.

My guess is this is the source of the problem. I cleaned everything out. Got rid of all the swap files. Got down to one instance of vim. When I started it up, the default session loaded. I opened files and didn't get "swap already exists." Saved the session, then closed the session. Restarted vim. Repeated the process. Symptoms not recurring now.

Quitting vim without closing the session leaves ~/.vim/session/default.vim.lock in existence. Closing the session before quitting vim gets rid of ~/.vim/session/default.vim.lock.

I had been quitting vim without closing the session since starting to use vim-session several days ago. This is the first time I've encountered this problem.

------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA
eeweir@bellsouth.net

"Style is truth."

- Ray Bradbury

--
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 did I get two instances of vim?

On Jun 29, 2012, at 10:16 AM, Tim Gray wrote:

> You could use Activity Monitor to search for running or hung instances of vim if you are concerned, and (force) quit them from there.

Thanks, Tim. I found three. I forced all three to quit. When I started Vim back up and tried to load my session, I got the same error message, only this time referencing an instance named vim2. Only one shows in Activity Monitor.

> In my experience, starting up vim from scratch results in an instance called VIM. Starting up a second one creates an instance called VIM1. In MacVim, these instance (server) names are in the title bar of the vim window. Presumably your only MacVim window currently says 'VIM'. If you open up more OS X windows, not vim panes, windows, or tabs, but windows in the OS, you start a new instance. Do you have multiple windows that you opened with command-N or through the 'New Window' command in the File menu? If so, you have multiple vim instances running. Each OS X window in MacVim is it's own vim instance.

I have on occasion opened a second OS X window of vim with command-N. Don't recall having done so recently. [This problem just showed up this morning. Have never encountered it before.] I always quit vim with command-q. If there's a warning about buffers being open, I write my files and then use command-q again.

>> How do I get rid of the second instance?
>
> If it's still running somewhere in some window, just quit it. If it's not running anywhere and the message is the result of improper session cleanup, remove ~/.vim/sessions/default.vim.lock. Or just follow the instructions of what session told you to do:
>
>> Use :OpenSession! to override.

When I do this, I get a "swap file already exists" *every* time I load a file---no matter how many times I load it. Even after I've written the file. I tried deleting "~/.vim/sessions/default.vim.lock." That at least got the session to load when vim is started up, but I get the "swap file already exists" warning with it too. Again, *every* time I open the file. Even after writing it.

I went to the folders for the documents in my session and deleted all the swap files. There were two instances of each vimwiki swap file. Two taskpaper files had four instances. One had three. I deleted them all.

I went back to Activity Monitor. Found three new instances of vim. Quit them. Started vim. Default session didn't load. Tried OpenSession. Got the warning about the session being locked by another instance of vim---vim1 again. Deleted "~/.vim/sessions/default.vim.lock" again.

Finally, I think I have only one instance of vim. The default session loads when I start up vim. I don't get repeated "swap file already exists" warnings.

I quite vim and restart it. It opens as vim1 again! The default session doesn't load I look at the Activity Monitor and there are two instances of vim again! What the hell is going on?

I'm wondering if the way I've been using vim-session is part of, or all of, the problem. Do I need to close the session before quitting vim? I've been assuming that if the default session has the files I want on startup, I wouldn't need to, that simply quitting vim, making sure all files are written before doing so, would be OK.

Thanks for the suggestions of things to do. Haven't fixed the problem, but at least I have some things to work with.

------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA
eeweir@bellsouth.net

"We do not inherit the earth from our ancestors,
we borrow it from our children."

- Chief Seattle.

--
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: vim/cygwin: python support

got returned msg about cygwin. so resent..

On 06/29/2012 10:22 AM, ping wrote:
> not sure this should go to vim/cygwin team...so copy both and Vlad(Voom
> plugin author)
> I got a new laptop (folio) come with win7.
> for some reason I want to give win7 a trial.
>
> cygwin full install went smooth.
> but looks I don't have python support here.
> that means I won't be able to have some plugins (like Voom) that is
> based on python.
> I did a lot of search and looks this is a common issue, but still I
> don't see a clear answer yet.
> any cygwin users can advise?
>
> regards
> ping
>

--
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

vim/cygwin: python support

not sure this should go to vim/cygwin team...so copy both and Vlad(Voom plugin author)
I got a new laptop (folio) come with win7.
for some reason I want to give win7 a trial.

cygwin full install went smooth.
but looks I don't have python support here.
that means I won't be able to have some plugins (like Voom) that is based on python.
I did a lot of search and looks this is a common issue, but still I don't see a clear answer yet.
any cygwin users can advise?

regards
ping

Re: New build of official Vim?

You can download just the updated executables from Yongwei's website and replace vim.exe and gvim.exe wherever you already installed vim.  I've been doing this for years and have had no issue so far.

http://wyw.dcweb.cn/#download

~Adam~

--
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 did I get two instances of vim?

On Jun 29, 2012 at 08:12 AM -0400, Eric Weir wrote:
>Or, more importantly, how do I get rid of the second?

The second session might have already been closed. Or crashed, or just
improperly shut down. Who knows without looking at your computer. As
long as you don't have any vim instances running in a terminal somewhere
that you've forgotten about, or MacVim windows that you might have
minimized and forgotten about, it's probably fine to ignore the warning.

You could use Activity Monitor to search for running or hung instances
of vim if you are concerned, and (force) quit them from there.

>Didn't understand what it was telling me at first---because I *assumed*
>I did. Just realized this means I've got two sessions of vim running.

In my experience, starting up vim from scratch results in an instance
called VIM. Starting up a second one creates an instance called VIM1.
In MacVim, these instance (server) names are in the title bar of the vim
window. Presumably your only MacVim window currently says 'VIM'. If
you open up more OS X windows, not vim panes, windows, or tabs, but
windows in the OS, you start a new instance. Do you have multiple
windows that you opened with command-N or through the 'New Window'
command in the File menu? If so, you have multiple vim instances
running. Each OS X window in MacVim is it's own vim instance.

>How do I get rid of the second instance?

If it's still running somewhere in some window, just quit it. If it's
not running anywhere and the message is the result of improper session
cleanup, remove ~/.vim/sessions/default.vim.lock. Or just follow the
instructions of what session told you to do:

> Use :OpenSession! to override.

--
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

New build of official Vim?

The current version at vim.org for Windows is 7.3_46. If I look at the Cream download it is at 7.3_556. So what determines if a newer build of the official gets put out there?

Note: I rely on the installer, I don't build Vim myself.

I am just curious really.

Robert

--
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

Simple way to add local spell file for a limited set of filesystem locations

Hi!

I do a fair amount of LaTeXing, across a wider selection of
subjects. Since most of these subjects have their own jargon, I
usually add quite a few words to my local spell files (using zg).

The problem is that since there are a lot of acronyms, there is a
good chance that the spellchecker misses a typo because it is a
proper word/acronym in a different context/document.

So ideally, I'd be able to have a spell file per directory (this
would also make using version control easier). All this while
still using the user-global spell file in ~/.vim.

Algorithmically:

- Load system-global word lists*
- Load word lists from runtimepath*
- if there is a possibly empty local spellfile conforming to some
naming scheme, load it, implicitly creating the .spl file

When spellchecking
- When using zg/zw, use local-to-directory spell file, keeping
.spl up-to-date, of course.

If there is no dir-local spell file, just use the user-global
file (usually in ~/.vim).

While I'm sure I could come up with a vim script to do all of
this, I'd very much prefer to use something already done. My vim
script skills are waaaay rusty and why reinvent a wheel (badly at
that). Even better would to achieve this (or some close
approximation) using vim options.

Regards,
Tobias

--
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 did I get two instances of vim?


Or, more importantly, how do I get rid of the second?

I'm using the vim-session plugin. This morning I've been getting the following error message when I attempt to open a session:
session.vim 1.5: The 'default' session is locked by another Vim instance named 'VIM
1'! Use :OpenSession! to override. 

Didn't understand what it was telling me at first---because I *assumed* I did. Just realized this means I've got two sessions of vim running. Have no idea how I got two. Certainly didn't do it deliberately. 

How do I get rid of the second instance?

Thanks,
------------------------------------------------------------------------------------------
Eric Weir

"You will be needed in the movement when you realize 
that you are not needed in the movement."

- Chris Crass

Re: fullscreen in vim dont change $LINES and $COLUMN after quit vim

Oh, I solved this.

I find these from a faq of Bash. http://www.faqs.org/faqs/unix-faq/shell/bash/

E11) If I resize my xterm while another program is running, why doesn't bash
     notice the change?
This is another issue that deals with job control.
The kernel maintains a notion of a current terminal process group.  Members
of this process group (processes whose process group ID is equal to the
current terminal process group ID) receive terminal-generated signals like
SIGWINCH.  (For more details, see the JOB CONTROL section of the bash
man page.)
If a terminal is resized, the kernel sends SIGWINCH to each member of
the terminal's current process group (the `foreground' process group).
When bash is running with job control enabled, each pipeline (which may be
a single command) is run in its own process group, different from bash's
process group.  This foreground process group receives the SIGWINCH; bash
does not.  Bash has no way of knowing that the terminal has been resized.
There is a `checkwinsize' option, settable with the `shopt' builtin, that
will cause bash to check the window size and adjust its idea of the
terminal's dimensions each time a process stops or exits and returns control
of the terminal to bash.  Enable it with `shopt -s checkwinsize'.

So, maybe I post this question in wrong place.




--
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: fullscreen in vim dont change $LINES and $COLUMN after quit vim

[mike@lab_wu ~]$ trap
trap -- '' SIGTSTP
trap -- '' SIGTTIN
trap -- '' SIGTTOU

When I change terminal window in bash, the size update correctly, So i guess it casue by vim. BUT I am wrong.

I enter repl of python, and press F11 to fullscreen, quit, echo $COLUMNS $LINES, it reamins 80 24. I dont know why...
2012/6/29 John Little <John.B.Little@gmail.com>
On Friday, June 29, 2012 1:22:06 PM UTC+12, sgra ekim wrote:
> I use vim in xfce terminal, I always launch vim then fullscreen the window, this cause the height and width changed. but when I quit vim and type a long line in bash's readline, the line mess wraped. 
>
> I get that SIGWINCH force bash to update it's $LINES and $COLUMN from bash's manual. SO i guess when I fullscreen in vim, vim traps the signal, and the bash doesn't know this.

No help to you, but my konsole in KDE doesn't do that.  Nor does gnome-terminal in Gnome, and I even booted into XFCE from my systemrescuecd, and it didn't do it; LINES and COLUMNS set correctly back in bash.  My understanding is that the signal is sent to every process in the process group, vim's catching it doesn't stop bash from getting it.

Conceivably, your bash has been told to ignore the signal, or do something else.  What does the bash builtin trap say after you exit vim?

Regards, 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

--
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: It works but it doesn't work

On 2012-06-28, howard Schwartz wrote:
> I've got two simple ex commands in a larger script. When I run them
> on the file, direct from the ex command line, they work fine. When I
> run them from the script, they do not work. Even If I simply jut put
> the commands below in
> a simple script file, script.vim, enter my main file and execute
>
> :source script.vim <ENTER>
>
> The commands do not do their job on the file. Why would they work, if run
> directly, but not, if run within a script?
>
> set wrapscan
> "wrap long lines
> g/^.\{80,}$/gqgq
> "join hyphnated words at end of lines
> g/[^-]-\n/s/-\n\([^ ]*\)/\1 /

If you're using Windows, it could be that you are saving script.vim
with the DOS file format, i.e., with carriage-return/line-feed line
endings. When Vim sources such a file, it sees the carriage returns
at the ends of the lines as part of the lines and not as part of the
line terminators.

Open script.vim and execute

:set ff?

to determine the file format. If it's "dos", that could be the
problem. Execute

:set ff=unix
:w

to get rid of those carriage returns, then try sourcing your script
again.

HTH,
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

Thursday, June 28, 2012

Re: It works but it doesn't work

Hi,

howard Schwartz wrote:
> I've got two simple ex commands in a larger script. When I run them on the
> file, direct from the ex command line, they work fine. When I run them from
> the script, they do not work. Even If I simply jut put the commands below in
> a simple script file, script.vim, enter my main file and execute
>
> :source script.vim <ENTER>
>
> The commands do not do their job on the file. Why would they work, if run
> directly, but not, if run within a script?
>
> set wrapscan
> "wrap long lines

did you really mean wrapscan? From you comment it seems you wanted ot

set wrap

> g/^.\{80,}$/gqgq
> "join hyphnated words at end of lines
> g/[^-]-\n/s/-\n\([^ ]*\)/\1 /

Regards,
Jürgen

--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)

--
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

It works but it doesn't work

I've got two simple ex commands in a larger script. When I run them on the
file, direct from the ex command line, they work fine. When I run them from
the script, they do not work. Even If I simply jut put the commands below in
a simple script file, script.vim, enter my main file and execute

:source script.vim <ENTER>

The commands do not do their job on the file. Why would they work, if run
directly, but not, if run within a script?

set wrapscan
"wrap long lines
g/^.\{80,}$/gqgq
"join hyphnated words at end of lines
g/[^-]-\n/s/-\n\([^ ]*\)/\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

Re: fullscreen in vim dont change $LINES and $COLUMN after quit vim

On Friday, June 29, 2012 1:22:06 PM UTC+12, sgra ekim wrote:
> I use vim in xfce terminal, I always launch vim then fullscreen the window, this cause the height and width changed. but when I quit vim and type a long line in bash's readline, the line mess wraped. 
>
> I get that SIGWINCH force bash to update it's $LINES and $COLUMN from bash's manual. SO i guess when I fullscreen in vim, vim traps the signal, and the bash doesn't know this.

No help to you, but my konsole in KDE doesn't do that. Nor does gnome-terminal in Gnome, and I even booted into XFCE from my systemrescuecd, and it didn't do it; LINES and COLUMNS set correctly back in bash. My understanding is that the signal is sent to every process in the process group, vim's catching it doesn't stop bash from getting it.

Conceivably, your bash has been told to ignore the signal, or do something else. What does the bash builtin trap say after you exit vim?

Regards, 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

fullscreen in vim dont change $LINES and $COLUMN after quit vim

I use vim in xfce terminal, I always launch vim then fullscreen the window, this cause the height and width changed. but when I quit vim and type a long line in bash's readline, the line mess wraped. 

I get that SIGWINCH force bash to update it's $LINES and $COLUMN from bash's manual. SO i guess when I fullscreen in vim, vim traps the signal, and the bash doesn't know this.

HOW can i fix this? either in bash's way or in vim's way.

Thanks your 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

Re: VimL functions to determine spelling categories?

On Fri, 29 Jun 2012, Marc Weber wrote:

> Excerpts from Benjamin R. Haskell's message of Thu Jun 28 19:35:19 +0200 2012:
>> Unfortunately, spellbadword() can change the cursor position.
> So?

So, it's a side-effect. It'd be better if there were a side-effect-free
version of the function. Plus the function combines two separate, but
related, tasks pertaining to the misspelled word under the cursor (if it
exists):

1. Move the cursor to the start of the word
2. Return information about the misspelling (the word and the type)

It'd be preferable if the function returned information about the
misspelled word, but that the information would also include its
location. Then setpos() could be used for functionality #1.


> use
> let save_cursor = getpos(".")
> MoveTheCursorAround
> call setpos('.', save_cursor)

The version I posted (based on Ingo Karkat's SpellCheck plugin) saved
the view, not just the cursor position. By only saving the cursor
position, the function that moves the cursor around might also alter
folds or the viewport (for example).


> to set cursor to old position. Not perfect - but fine.
> A second way is use sp to create a new window, move cursor there, then
> :q the split window again.

My point in calling it unfortunate wasn't to say that it's impossible
(or even that hard) to workaround. It just would have been nicer to
find an API similar to :synID (which takes a (line,col)-position as
input).

--
Best,
Ben H

--
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