Thursday, April 30, 2015

Re: How to ensure 1 byte per character

Paul <Paul.Domaskis <at> gmail.com> writes:
> ...simple text file that contains about 42
> million characters. The file on the HD is 84MB.

Problem solved! With millions of lines, I did not thoroughly check that
all lines had the expected content of 3 comma-separated-fields. With more
sleuthing, I found that many lines were not like that. This revealed some
holes in the process for generating the file. Fixed now, and the file size
is as expected.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: autocmd BufEnter * :set selection=exclusive

toothpik <toothpik6 <at> gmail.com> writes:
>On Fri, Apr 24, 2015 at 10:29:00PM +0000, Paul wrote:
>>Christian Brabandt <cblists <at> 256bit.org> writes:
>>> Check with :verbose set selection? what caused the change of the
>>> selection.
>>>
>>> If a plugin is the culprit contact the plugin author. He should
>>> fix it.
>
>> It shows that netrw is the last to change the "selection" option.
>> However, the author confirmed that netrw saves and restores the
>> original values.
>
> when working with said author you need to give specific details
> about how you invoke netrw and how you leave it -- that plugin has
> more entries and exits than a big block of swiss cheese and it's
> possible you've found a way to foil the expected behavior

That would be challenging...I am not exactly sure *when* the selection
option gets clobbered and not restored. It's difficult to know which
method of exiting is causing the problem. And my methods of exiting
are probably the same as most people's: Change windows, close window,
close tab, switch tab, open a file, or preview a file.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

How to ensure 1 byte per character

This is my first foray into character encoding, and I'm trying to
ensure that a large file is of the size that one can expect for 1 byte
per character. It is a simple text file that contains about 42
million characters. The file on the HD is 84MB. I've set encoding
and fileencoding to latin1, which the help says is 8-bit characters.
I also have fileformat=unix to ensure that line endings are only 1
byte. After writing to HD, however, the file on the HD is still 84MB.
I know that it's not due to my use of cygwin because for this very text
that I'm using to compose this message, the characters counts so match
the file size.

What else could be cause the 2x discrepancy between file size and
characte count?

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

BufReadPost event for location list

Dear all,

I want to do the following for location-list buffers:
autocmd BufReadPost quickfix nnoremap <CR> <CR>

how to do that?

Some documentation seems be missing. See e.g. http://vimdoc.sourceforge.net/htmldoc/quickfix.html - here the location-list-window is mentioned right after the quickfix-window, but no respective BufReadPost-buffer-identifier is given.

thanks in advance,

best,
Stephan

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

reverting keymaps for location-list buffer

Dear all,

I remapped <CR> and I really like my remapping. There are however some problems
For quickfix buffers I found this:

autocmd BufReadPost quickfix nnoremap <CR> <CR>

is there something similar for location-list buffers?

thanks in advance,

best,
Stephan

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Autocmd to have a mapping only for a specific file

But even if i put backspace instead of ctrl-enter it will not be executed, only one of the mapping is executed
Le mer. 29 avr. 2015 à 17:05, Charles Campbell <Charles.E.Campbell@nasa.gov> a écrit :
av wrote:
> Le jeudi 23 avril 2015 09:25:11 UTC+2, av a écrit :
>> Hi,
>>
>> I try to have an autocommand that would provide a mapping to the <enter> and <c-enter> keys only on a certain file name. Like myfile.txt for example.
>>
>> I have tried a test like this here, and it works for the <c-Enter> mapping but not for the <Enter> one:
>>
>>     autocmd! BufNewFile,BufRead,BufEnter myfile.txt nmap <buffer> <Enter> :echo 'Hi!'<cr>
>>     autocmd! BufNewFile,BufRead,BufEnter myfile.txt nmap <buffer> <c-Enter> :echo 'Test!'<cr>
>>
>> And when I do :map <enter> vim says that there are "No mapping found"
>>
>> Any ideas why? And please tell me if I chose the right list of events.
>>
>> Thank you very much,
>>
>> Alexandre
> It seems I cannot use <Enter> and <c-Enter> at the same time, only one of the 2 works. Why is that?
>
Go into insert mode.

Type ctrl-v [return]
Type ctrl-v ctrl-[return]

You'll likely find that there's no difference between them.

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

---
You received this message because you are subscribed to a topic in the Google Groups "vim_use" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/y9qYhazt1Ls/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Wednesday, April 29, 2015

Re: Autocmd to have a mapping only for a specific file

av wrote:
> Le jeudi 23 avril 2015 09:25:11 UTC+2, av a écrit :
>> Hi,
>>
>> I try to have an autocommand that would provide a mapping to the <enter> and <c-enter> keys only on a certain file name. Like myfile.txt for example.
>>
>> I have tried a test like this here, and it works for the <c-Enter> mapping but not for the <Enter> one:
>>
>> autocmd! BufNewFile,BufRead,BufEnter myfile.txt nmap <buffer> <Enter> :echo 'Hi!'<cr>
>> autocmd! BufNewFile,BufRead,BufEnter myfile.txt nmap <buffer> <c-Enter> :echo 'Test!'<cr>
>>
>> And when I do :map <enter> vim says that there are "No mapping found"
>>
>> Any ideas why? And please tell me if I chose the right list of events.
>>
>> Thank you very much,
>>
>> Alexandre
> It seems I cannot use <Enter> and <c-Enter> at the same time, only one of the 2 works. Why is that?
>
Go into insert mode.

Type ctrl-v [return]
Type ctrl-v ctrl-[return]

You'll likely find that there's no difference between them.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tuesday, April 28, 2015

Re: Build amenu from Funcref

On Tuesday, April 28, 2015 at 4:22:55 PM UTC+1, Ben Fritz wrote:
> On Tuesday, April 28, 2015 at 2:01:47 AM UTC-5, Ni Va wrote:
> > Hi Ben,
> >
> > I have added a selft-contained test case to show :
> > 1- the standalone call to the func is working
> > 2- the call to the func from menu entry added is not working. this is my goal. to call a func or funcref retrieved from object (psexec).
> >
> > Thank you for your help
>
> I'm not looking through 300 lines of undocumented Vimscript to try to figure out what is going on or even where the problem lines are.
>
> You should be able to create a 5-15 line file to demonstrate your problem without confusing the issue with a full-blown plugin script.

Ok I have clean up some unused lines and add comment . You just have to push PfiTest.echo to see errors.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Build amenu from Funcref

On Tuesday, April 28, 2015 at 2:01:47 AM UTC-5, Ni Va wrote:
> Hi Ben,
>
> I have added a selft-contained test case to show :
> 1- the standalone call to the func is working
> 2- the call to the func from menu entry added is not working. this is my goal. to call a func or funcref retrieved from object (psexec).
>
> Thank you for your help

I'm not looking through 300 lines of undocumented Vimscript to try to figure out what is going on or even where the problem lines are.

You should be able to create a 5-15 line file to demonstrate your problem without confusing the issue with a full-blown plugin script.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Build amenu from Funcref

On Monday, April 27, 2015 at 3:51:39 PM UTC+1, Ben Fritz wrote:
> On Monday, April 27, 2015 at 1:43:00 AM UTC-5, Ni Va wrote:
> >
> >
> > Hi Ben
> >
> > I knew that call was different from exe and I supposed that I bad explained the probleme.
> >
> >
> > Calling and building a local func like you do is easier than calling a func declared as "object method" in a dedicated vimscript.
> >
> > You can see in attached file that I have wrote similar object as described here : http://bling.github.io/blog/2013/08/16/modularizing-vimscript/
> >
> > Although, I got E488 error when I use the button menu the script buildt.
>
> Can you attach a small self-contained test case demonstrating the problem in just a few lines, please? I don't have time to go through your script to figure out what it is TRYING to accomplish.
>
> I thought from your previous messages you were trying to call actual functions. If this is the case, I don't know if this will work without a simpler example, but it may help to re-interpret the string function name as a function before calling it:
>
> exe 'anoremenu PfiTest.'.foo.' :call function('.string(m[foo]).')()<CR><CR>'
>
>
> This still throws errors when I edit your script as above, however, I don't have the slightest idea what the script is trying to do in the first place, so perhaps that is a different problem.



Hi Ben,

I have added a selft-contained test case to show :
1- the standalone call to the func is working
2- the call to the func from menu entry added is not working. this is my goal. to call a func or funcref retrieved from object (psexec).

Thank you for your 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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Monday, April 27, 2015

Re: Build amenu from Funcref

On Monday, April 27, 2015 at 1:43:00 AM UTC-5, Ni Va wrote:
>
>
> Hi Ben
>
> I knew that call was different from exe and I supposed that I bad explained the probleme.
>
>
> Calling and building a local func like you do is easier than calling a func declared as "object method" in a dedicated vimscript.
>
> You can see in attached file that I have wrote similar object as described here : http://bling.github.io/blog/2013/08/16/modularizing-vimscript/
>
> Although, I got E488 error when I use the button menu the script buildt.

Can you attach a small self-contained test case demonstrating the problem in just a few lines, please? I don't have time to go through your script to figure out what it is TRYING to accomplish.

I thought from your previous messages you were trying to call actual functions. If this is the case, I don't know if this will work without a simpler example, but it may help to re-interpret the string function name as a function before calling it:

exe 'anoremenu PfiTest.'.foo.' :call function('.string(m[foo]).')()<CR><CR>'


This still throws errors when I edit your script as above, however, I don't have the slightest idea what the script is trying to do in the first place, so perhaps that is a different problem.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sunday, April 26, 2015

Re: Build amenu from Funcref

On Thursday, April 23, 2015 at 3:43:43 PM UTC+1, Ben Fritz wrote:
> On Thursday, April 23, 2015 at 4:42:40 AM UTC-5, Ni Va wrote:
> > Even if I replace call by exe, the func is not called by pressing button on my toolbar's menu.
> >
>
> STOP and think a minute. You *cannot* replace "call" with "exe" because you MUST "call" a function, unless you want to evaluate the function and execute the string result it returns as if it were an ex command.
>
> > exe 'anoremenu '.m.getMenuPath().'.'.foo.' :call funcref#Call("'.string(Fn).'")<CR>'
> >
>
> This should work fine. You say Vim just displays the command...but there is no "echo" anywhere. Are you sure you tried this exact command?
>
> I experimented as follows and everything works as expected:
>
> function! MyFunc(num)
> echo "number is " a:num
> endfun
> silent! unmenu Plugin.foo
> exe 'anoremenu '."Plugin".'.'."foo".' :call MyFunc("'."12345".'")<CR>'
>
> I get a "foo" item in my "Plugin" menu, and when I click on it, I see "number is 12345" echoed on the screen.
>
> > replaced by
> >
> > exe 'anoremenu '.m.getMenuPath().'.'.foo.' :exe funcref#Call("'.string(Fn).'")<CR>'
>
> As discussed above, this will not work. "exe" means "take this string and use it like an ex command". "call" is what you want.



Hi Ben

I knew that call was different from exe and I supposed that I bad explained the probleme.


Calling and building a local func like you do is easier than calling a func declared as "object method" in a dedicated vimscript.

You can see in attached file that I have wrote similar object as described here : http://bling.github.io/blog/2013/08/16/modularizing-vimscript/

Although, I got E488 error when I use the button menu the script buildt.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Help with netrw's gx setting

Hello guys,

I'm happy to use netrw for a lot of tasks (especially paired with vim-vinegar), but still can't make the 'gx' command behave to my liking, which is:
- Always open an URL with the external browser, even if it has a trailing slash: the default is to interpret an URL as a remote dir and download that to a new buffer
- Correctly match URL's surrounded by parethesis etc, and also with symbols like '?' etc, within: I know that 'g:netrw_gx="<cWORD>"' would get me that but then I loose the inner parethesis matching, any way to get them both?

Closest of this experience is using the open-browser plugin which also has a lot of other features i don't use.

Any clues?

- Alexandre

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Best way to programmatically define a function

> It is very strange to do this via a register. Just use `execute join(fn, "\n")`.

Hm ... I'm pretty sure the last time I tried the more obvious solution it didn't work for defining functions. Thanks.

Thanks for pointing out the problem with the register.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Best way to programmatically define a function

2015-04-26 20:42 GMT+03:00 lith <minilith@gmail.com>:
> Hi!
>
> What's the best way to create a function that creates functions?
>
> I currently construct a string with the vim code, put that into a register, and then evaluate the register. See https://github.com/tomtom/tcomment_vim/blob/master/plugin/tcomment.vim#L165 for an example.

It is very strange to do this via a register. Just use `execute join(fn, "\n")`.

Also note that `let @t=t` does *not* restore register correctly. E.g. try

call setreg('a', ['a', 'b', 'c'], 'b1')
echo getregtype('a') " Echoes ^V1
let @a=@a
echo getregtype('a') " Echoes v: register type is determined
automatically at `let @a` and is never block

. Also

let reg = ["a\n", "b"]
call setreg('a', reg)
let @a=@a
echo reg ==# getreg('a', 1, 1) " Echoes 0: NUL cannot be restored
via `let @a`

.

>
> This works well but seems to cause serious problems in certain situations with certain installations. See here for an example report: https://github.com/tomtom/tcomment_vim/issues/140
>
> Is this a known issue with certain versions of gvim?
>
> Is there an alternative way to achieve this that doesn't cause the problem reported above?
>
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Best way to programmatically define a function

Hi!

What's the best way to create a function that creates functions?

I currently construct a string with the vim code, put that into a register, and then evaluate the register. See https://github.com/tomtom/tcomment_vim/blob/master/plugin/tcomment.vim#L165 for an example.

This works well but seems to cause serious problems in certain situations with certain installations. See here for an example report: https://github.com/tomtom/tcomment_vim/issues/140

Is this a known issue with certain versions of gvim?

Is there an alternative way to achieve this that doesn't cause the problem reported above?

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: setting statusline with function that uses system()

2015-04-26 18:17 GMT+03:00 Mark Volkmann <r.mark.volkmann@gmail.com>:
> When I do this I often see stray characters displayed in the current buffer.
> For example, I can press "j" several times to move down in the current
> buffer.
> It will work a few times and then start displaying "j" characters instead of
> moving down.
> After that point, if I press the esc key I will see "^[" displayed.
> The function I use to get my statusline string is called each time the
> cursor is moved.
> The problem goes away if I remove calls to system() in that function.
> Is this possibly related to the system() calls taking a while to return?

It is related to statusline function taking too much to run, not to
the system() function directly.

Problem is that each system() call is at two fork()s* with two
execve()s and each of this is not particularly fast. The whole thing
is much slower on Windows. And also one system() call is a number of
open() or stat() calls (to read shell configuration files) (cached) +
open() call for temporary file (2 times: one for writing, done by
shell, one for reading, done by vim) (because Vim does not use pipes)
(most likely cached) + loads of open()s for shared libraries for both
processes (shell and whatever command you run) (cached) + whatever
other initialization steps are done by shell or your script.

This is far worse if you happen to use `-i` in &shellcmdflag because
this way shell reads user configuration.

* Some shells are able to optimize this to one fork() (done by Vim,
not by shell), but execve() and other stuff is always there:

:echo system("python -c \"print($$); import os; print(os.getpid())\"")
" set shell=/bin/zsh shellcmdflag=-c: two identical numbers: no fork()
" set shell=/bin/bash: two different numbers

>
> This is how I configured my statusline:
>
> setlocal statusline=%!MyStatuslineFunction()
>
> --
> R. Mark Volkmann
> Object Computing, Inc.
>
> --
> --
> 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 because you are subscribed to the Google Groups
> "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vim_use+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

setting statusline with function that uses system()

When I do this I often see stray characters displayed in the current buffer.
For example, I can press "j" several times to move down in the current buffer.
It will work a few times and then start displaying "j" characters instead of moving down.
After that point, if I press the esc key I will see "^[" displayed.
The function I use to get my statusline string is called each time the cursor is moved.
The problem goes away if I remove calls to system() in that function.
Is this possibly related to the system() calls taking a while to return?

This is how I configured my statusline:

setlocal statusline=%!MyStatuslineFunction()

--
R. Mark Volkmann
Object Computing, Inc.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Friday, April 24, 2015

Re: autocmd BufEnter * :set selection=exclusive

On Fri, Apr 24, 2015 at 10:29:00PM +0000, Paul wrote:
> Christian Brabandt <cblists <at> 256bit.org> writes:
> > Check with
> > :verbose set selection?
> > what caused the change of the selection.
> >
> > If a plugin is the culprit contact the plugin author. He should fix
> > it.

> It shows that netrw is the last to change the "selection" option.
> However, the author confirmed that netrw saves and restores the
> original values.

when working with said author you need to give specific details about
how you invoke netrw and how you leave it -- that plugin has more
entries and exits than a big block of swiss cheese and it's possible
you've found a way to foil the expected behavior

--
_|_ _ __|_|_ ._ o|
|_(_)(_)|_| ||_)||<
|

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: autocmd BufEnter * :set selection=exclusive

Christian Brabandt <cblists <at> 256bit.org> writes:
> Check with
> :verbose set selection?
> what caused the change of the selection.
>
> If a plugin is the culprit contact the plugin author. He should fix
> it.

It shows that netrw is the last to change the "selection" option.
However, the author confirmed that netrw saves and restores the
original values.

In any case, the autocmd seems to work well enough to hide this
problem, whatever the cause. Not the most efficient, I know.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Build amenu from Funcref

On Thursday, April 23, 2015 at 3:43:43 PM UTC+1, Ben Fritz wrote:
> On Thursday, April 23, 2015 at 4:42:40 AM UTC-5, Ni Va wrote:
> > Even if I replace call by exe, the func is not called by pressing button on my toolbar's menu.
> >
>
> STOP and think a minute. You *cannot* replace "call" with "exe" because you MUST "call" a function, unless you want to evaluate the function and execute the string result it returns as if it were an ex command.
>
> > exe 'anoremenu '.m.getMenuPath().'.'.foo.' :call funcref#Call("'.string(Fn).'")<CR>'
> >
>
> This should work fine. You say Vim just displays the command...but there is no "echo" anywhere. Are you sure you tried this exact command?
>
> I experimented as follows and everything works as expected:
>
> function! MyFunc(num)
> echo "number is " a:num
> endfun
> silent! unmenu Plugin.foo
> exe 'anoremenu '."Plugin".'.'."foo".' :call MyFunc("'."12345".'")<CR>'
>
> I get a "foo" item in my "Plugin" menu, and when I click on it, I see "number is 12345" echoed on the screen.
>
> > replaced by
> >
> > exe 'anoremenu '.m.getMenuPath().'.'.foo.' :exe funcref#Call("'.string(Fn).'")<CR>'
>
> As discussed above, this will not work. "exe" means "take this string and use it like an ex command". "call" is what you want.

I Know difference betwwen exe ad call.

Just don't happen to build amenu command that do the call of object method:
Just source the attachment file to see those errors :


let m = psexec#machine()
call m.configure("SRV01-MACHINE02","XX","N1")
for foo in m.getCmdList()
" call m[foo]() "works!
exe 'anoremenu PfiTest.'.foo.' :call '.string(m[foo]).'()<CR>'
endfor

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Gvim save session dialog

Le mardi 21 avril 2015 13:51:17 UTC+2, av a écrit :
> Hi Jürgen,
>
> Thanks it works! I will add a mapping to replace the toolbar.
>
> Best regards / Bien cordialement
>
> Alexandre
>
>
>
>
> 2015-04-21 13:38 GMT+02:00 Jürgen Krämer <jottkaerr@googlemail.com>:
>
>
> Hi,
>
>
>
> av schrieb am 21.04.2015 um 13:25:
>
> >
>
> > I would like to know what is the command in gvim to popup the save or
>
> > load session dialog that is available from the gvim toolbar.
>
>
>
> take a look at the output of
>
>
>
>   :menu ToolBar
>
>
>
> Somewhere in this output you will see something like
>
>
>
>   220 LoadSesn
>
>       n*s  :call <SNR>25_LoadVimSesn()<CR>
>
>       v*s  <C-C>:call <SNR>25_LoadVimSesn()<CR><C-\><C-G>
>
>       s*s  <C-C>:call <SNR>25_LoadVimSesn()<CR><C-\><C-G>
>
>       o*s  <C-C>:call <SNR>25_LoadVimSesn()<CR><C-\><C-G>
>
>   230 SaveSesn
>
>       n*s  :call <SNR>25_SaveVimSesn()<CR>
>
>       v*s  <C-C>:call <SNR>25_SaveVimSesn()<CR><C-\><C-G>
>
>       s*s  <C-C>:call <SNR>25_SaveVimSesn()<CR><C-\><C-G>
>
>       o*s  <C-C>:call <SNR>25_SaveVimSesn()<CR><C-\><C-G>
>
>
>
> (The numbers you see might be different.) Then issue the following
>
> commands:
>
>
>
>   :function <SNR>25_LoadVimSesn
>
>   :function <SNR>25_SaveVimSesn
>
>
>
> This will show you how these function were declared. At the end, those
>
> functions are wrappers around
>
>
>
>   browse source <some_session_file_name>
>
>
>
> and
>
>
>
>   browse mksession! <some_session_file_name_as_default>
>
>
>
> 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
>
>
>
> ---
>
> You received this message because you are subscribed to a topic in the Google Groups "vim_use" group.
>
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/Y5IBCGp1X70/unsubscribe.
>
> To unsubscribe from this group and all its topics, send an email to vim_use+unsubscribe@googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

I solved the issue by associating the .vim files to a batch file containing:

start c:\vim\vim74\gvim.exe -S %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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Fedora 22 and Vim

* Kevin Tough <kevin@toughlife.org> [2015-04-23 17:46 +0200]:

> Hi Folks,
>
> I've installed Fedora 22 on one of my notebooks. The syntax highlighting
> in Fedora 22 is terrible. The new colors are very pastel like, and not
> at all to my liking. Would someone be able to explain how I can retain
> the colors I like?

Choose your colorscheme:
http://www.vim.org/scripts/script.php?script_id=1488

add

colorscheme $YOURCOLORSCHEME$

to your (g)vimrc

Elimar
--
You cannot propel yourself forward by
patting yourself on the back.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Add milliseconds to strftime()

On Friday, April 24, 2015 at 6:02:04 PM UTC+12, av wrote:

> I'd like to know if it is possible to get the milliseconds() in this expression for example:
>
> echo strftime("%Y-%m-%d_%H:%M:%S")

As Paul Isambert says, vim strftime is based on the C function, which uses a struct tm that has no field for parts of a second.

If your vim has python (look for +python in your :version output), you can ask
python, f.ex. in vim

:python import datetime
:python print datetime.datetime.now().strftime("%H:%M:%S.%f")

Regards, John Little

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Build amenu from Funcref

On Thursday, April 23, 2015 at 3:43:43 PM UTC+1, Ben Fritz wrote:
> On Thursday, April 23, 2015 at 4:42:40 AM UTC-5, Ni Va wrote:
> > Even if I replace call by exe, the func is not called by pressing button on my toolbar's menu.
> >
>
> STOP and think a minute. You *cannot* replace "call" with "exe" because you MUST "call" a function, unless you want to evaluate the function and execute the string result it returns as if it were an ex command.
>
> > exe 'anoremenu '.m.getMenuPath().'.'.foo.' :call funcref#Call("'.string(Fn).'")<CR>'
> >
>
> This should work fine. You say Vim just displays the command...but there is no "echo" anywhere. Are you sure you tried this exact command?
>
> I experimented as follows and everything works as expected:
>
> function! MyFunc(num)
> echo "number is " a:num
> endfun
> silent! unmenu Plugin.foo
> exe 'anoremenu '."Plugin".'.'."foo".' :call MyFunc("'."12345".'")<CR>'
>
> I get a "foo" item in my "Plugin" menu, and when I click on it, I see "number is 12345" echoed on the screen.
>
> > replaced by
> >
> > exe 'anoremenu '.m.getMenuPath().'.'.foo.' :exe funcref#Call("'.string(Fn).'")<CR>'
>
> As discussed above, this will not work. "exe" means "take this string and use it like an ex command". "call" is what you want.


Ok I knew that 'exe' is not 'call' command and my pb is a little bit different:
Trying to call a func defined in a local script taken as class object.

So I don't know funcName, that's why I have to find a solution to call func from funcrefId list retrieve from getter method from my class : psexec.vim

In this way, I have seen the help that say to use funcref#Call(


From my attached files, you can build the menu by typing :so% on opened file utilsPFIMenu.vim.
Don't worry, it will show you funcrefid on sourcing phase.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

RE: Cannot log into my vim account.

>>> I cannot log into my vim account
> (http://www.vim.org/account/profile.php?user_id=34258) and there is no
> way to reset the password. It says to ask Bram to reset my password.

You can email me as Bram might be a bit busy.

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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thursday, April 23, 2015

Re: positive lookbehind

On Thu, 23 Apr 2015 at 11:06pm -0700, av wrote:

> Instead of positive look behind, you could use \zs to define the location you want to start matching.

Thanks, Alexandre. Yes, I know that \zs is the better choice for
simplicity and performance. I would prefer it over positive lookbehinds;
I was just curious about why the lookbehind didn't work (well, now
does).

Best,
Claus

Re: Add milliseconds to strftime()

Le vendredi 24 avril 2015 à 08:02, av a écrit:
> I'd like to know if it is possible to get the milliseconds() in this expression for example:
>
> echo strftime("%Y-%m-%d_%H:%M:%S")

Given that "strftime()" is based on the C function, and since there is
no mention of milliseconds in "man strftime", I guess the answer is no.

Best,
Paul

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: positive lookbehind

Le jeudi 23 avril 2015 13:46:03 UTC+2, Claus Atzenbeck a écrit :
> On Thu, 23 Apr 2015 at 2:21pm +0300, LCD 47 wrote:
>
> > Because the anchor is not inside the lookbehind group, thus it isn't
> > optional. Since the lookbehind group is matched with zero width, you're
> > effectively asking Vim to match /\v^\w+ .
>
> Right! Strange I didn't see this right away.
>
> Thanks for the pointer.
> Claus

Hi Claus,

Instead of positive look behind, you could use \zs to define the location you want to start matching.

For example:

%s,thingsIdon'twanttomatchbutthatshouldbethere\zsthingsIwanttomatch,replacement,

Best regards / Bien cordialement

Alexandre

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Add milliseconds to strftime()

Hi,

I'd like to know if it is possible to get the milliseconds() in this expression for example:

echo strftime("%Y-%m-%d_%H:%M:%S")

Thanks,

Alexandre

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Cannot log into my vim account.

Just send Bram an email. His address should be on many list posts.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Fedora 22 and Vim



On Thu, Apr 23, 2015 at 11:46 AM, Kevin Tough <kevin@toughlife.org> wrote:
Hi Folks,

I've installed Fedora 22 on one of my notebooks. The syntax highlighting
in Fedora 22 is terrible. The new colors are very pastel like, and not
at all to my liking. Would someone be able to explain how I can retain
the colors I like?

I sent an Email to the Fedora people but did not get an answer from
them.

Namaste,
Kevin Tough

Kevin,

What is your color scheme?  You can find this out by running the command ':colorscheme' (without the single quotes.) Are you aware that you can change the color scheme to your liking, regardless of what Fedora provides? See ':help colorscheme'

Vim usually ships with a handful of options so you should be able to find one you like. You can also install schemes you find online.

Ethan Alan
--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Fedora 22 and Vim

Hi Folks,

I've installed Fedora 22 on one of my notebooks. The syntax highlighting
in Fedora 22 is terrible. The new colors are very pastel like, and not
at all to my liking. Would someone be able to explain how I can retain
the colors I like?

I sent an Email to the Fedora people but did not get an answer from
them.

Namaste,
Kevin Tough

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Cannot log into my vim account.

On Thursday, April 23, 2015 at 10:07:37 AM UTC+3, av wrote:
> Le jeudi 23 avril 2015 04:13:53 UTC+2, Bidit Mazumder a écrit :
> > On Wednesday, April 22, 2015 at 9:56:29 PM UTC+3, Bidit Mazumder wrote:
> > > Hello,
> > >
> > > I cannot log into my vim account (http://www.vim.org/account/profile.php?user_id=34258) and there is no way to reset the password. It says to ask Bram to reset my password.
> > >
> > > How do I contact Bram?
> > >
> > > Regards,
> > >
> > > Bidit Mazumder
> >
> > Nevermind, I managed to log in.
>
> How did you do it because I lost my password and I would like to update a plugin.

I tried to log-in from different IP addresses: I tried to log-in X times from IP address Y, then move onto IP address Z and try X times again.

I had to resort to such extreme measures because after a certain number of log-in attempts from the same IP address will ban that IP address for a certain number of hours.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Open session does not restore position in files

On Thursday, April 23, 2015 at 8:26:05 AM UTC-5, av wrote:
> Hi,
>
> I create tabs and windows with certain positions to files and I try to save session and open it using the gvim toolbar and with the mappings I have:
>
> " Show the session open dialog
> map <tab>[ :browse source!<cr>
>
> " Show the session save dialog
> map <tab>] :browse mksession!<cr>
>
> But for some windows the cursor is at the top of the file and not at the line number when I saved the session.
>
> I have multiple windows opened on the same 2 or 3 same files.
>
> Does somebody know if line numbers should be remembered in sessions? And why it is not keeping them in this case?
>
> Thank you.
>
> Alexandre

See :help 'sessionoptions' for what Vim sessions can remember. Cursor position is not in the list, so I don't think it is remembered.

HOWEVER, the help is confusing me at this point. In :help :mksession is this statement:

9. Restores the Views for all the windows, as with |:mkview|. But
'sessionoptions' is used instead of 'viewoptions'.

Views, unlike sessions DEFINITELY restore the cursor position. So perhaps a session also restores the stuff in a view? I'm not sure, I don't use either very often.

You may have an autocmd in your .vimrc (possibly taken from vimrc_example.vim long ago) to restore cursor position to a position remembered from the last time you edited that file. I think that autocmd will fail for some windows if you had the same file open in multiple windows when you last edited the file.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Build amenu from Funcref

On Thursday, April 23, 2015 at 4:42:40 AM UTC-5, Ni Va wrote:
> Even if I replace call by exe, the func is not called by pressing button on my toolbar's menu.
>

STOP and think a minute. You *cannot* replace "call" with "exe" because you MUST "call" a function, unless you want to evaluate the function and execute the string result it returns as if it were an ex command.

> exe 'anoremenu '.m.getMenuPath().'.'.foo.' :call funcref#Call("'.string(Fn).'")<CR>'
>

This should work fine. You say Vim just displays the command...but there is no "echo" anywhere. Are you sure you tried this exact command?

I experimented as follows and everything works as expected:

function! MyFunc(num)
echo "number is " a:num
endfun
silent! unmenu Plugin.foo
exe 'anoremenu '."Plugin".'.'."foo".' :call MyFunc("'."12345".'")<CR>'

I get a "foo" item in my "Plugin" menu, and when I click on it, I see "number is 12345" echoed on the screen.

> replaced by
>
> exe 'anoremenu '.m.getMenuPath().'.'.foo.' :exe funcref#Call("'.string(Fn).'")<CR>'

As discussed above, this will not work. "exe" means "take this string and use it like an ex command". "call" is what you want.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Open session does not restore position in files

Hi,

I create tabs and windows with certain positions to files and I try to save session and open it using the gvim toolbar and with the mappings I have:

" Show the session open dialog
map <tab>[ :browse source!<cr>

" Show the session save dialog
map <tab>] :browse mksession!<cr>

But for some windows the cursor is at the top of the file and not at the line number when I saved the session.

I have multiple windows opened on the same 2 or 3 same files.

Does somebody know if line numbers should be remembered in sessions? And why it is not keeping them in this case?

Thank you.

Alexandre

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: norm in a global command not working in script

On 2015-04-23 02:21, av wrote:
>>>> :g/^\w/-j
>>>>
>>>> where "-j" is the Ex command to, on the previous line ("-"),
>>>> join it with the next line (":help :j").
>>
>> Instead of what I wrote:
>> g, = ,-j
>> it should be
>> g!, = ,-j
>> which is working fine with the sample data.
>>
>> Many thanks Tim!!

Glad it seems to be doing what you needed.

> Just another quick related question: the -j seems to work
> but still how could I execute any other exe command inside
> the global. Something like g!/ = /exe 'mycommand' didn't
> work nor g!/ = /norm something. Actually the command ran
> but the results where erroneous for me (gvim 7.3 on
> windows).
>
> I ask this because this command construct would be very
> powerful to accomplish many things.

In theory any(*) Ex command should work fine here, including
:exec and :normal for example:

:g/^/exec '.w '.getline('.').'.txt'

will write each line in the current file to its own file,
named "{that line's contents}.txt"

So without the actual commands that you tried, it's hard to
say what failed.

-tim

(*) You can't nest :g or :v commands, so it's really "any ex
command except other :g/:v commands"

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: positive lookbehind

On Thu, 23 Apr 2015 at 2:21pm +0300, LCD 47 wrote:

> Because the anchor is not inside the lookbehind group, thus it isn't
> optional. Since the lookbehind group is matched with zero width, you're
> effectively asking Vim to match /\v^\w+ .

Right! Strange I didn't see this right away.

Thanks for the pointer.
Claus

Re: integrating subversion into vim

On 04/23/2015 02:33 AM, Erik Falor wrote:
> On Thu, Apr 23, 2015 at 08:02:17AM +0200, Christian Brabandt wrote:
>>> Is this vim -> vimdiff -> vim cycle achievable in vim?
>>
>> I don't know. But try the vcscommand
>> (http://www.vim.org/scripts/script.php?script_id=90)
>> plugin.
>
> +1 this suggestion.
>
> I highly recommend this plugin.

+1 from me as well. I particularly like diffing via :VCSVimDiff
(<Leader>cv) and undoing the diff via :VCSGotoOriginal!
(<Leader>cG). The out-of-the-box behavior of :VCSVimDiff puts
your modified buffer on the left and leaves your cursor in the
original file on the right. Like the original poster, I prefer
to have the old (original unmodified) file on the left and to
have the cursor remain in the editable buffer ready for any
modifications I'd like to make. I work around this by changing
the default mapping as follows:

nmap <silent> <Leader>cv <Plug>VCSVimDiff<C-w>H<C-w>w

Michael Henry

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Recovering gvim windows/sessions after startup (KDE/Linux)

Hi all,

I am facing a problem since some months now, and I thought it would be worth asking the community if there is a simple solution.

I am using KDE/Ubuntu (KUbuntu to be accurate) and I used to keep several gvim sessions/windows open when I shut down my computer. When starting up again, the windows used to come back as they were, with the full editing session on each of the files which were opened before the shut down.

Since some months, this does not happen any more. I basically get back gvim sessions, but these are basically empty and it looks like there is no "name" attached to the file it tries to open.

So basically: rebooting my machine does not make the gvim windows/sessions come back as they were, but only empty windows.

Is there is simple way out ? Any hints would be most welcome!
Thanks in advance .

(laptop using KUbuntu, Ubuntu 14.04.2 LTS and
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 2 2014 19:39:59)
GTK2 interface)

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: positive lookbehind

On 23 April 2015, Claus Atzenbeck <claus.atzenbeck@freenet.de> wrote:
> On Thu, 23 Apr 2015 at 10:46am +0200, Christian Brabandt wrote:
>
> >Well, at least, this is consistent with both regexp engines ;)
> >
> >I think the problem is, that the '^' prevents a match of the following word.
>
> Apparently this is the case. I'm wondering why.
[...]

Because the anchor is not inside the lookbehind group, thus it isn't
optional. Since the lookbehind group is matched with zero width, you're
effectively asking Vim to match /\v^\w+ .

/lcd

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Autocmd to have a mapping only for a specific file

Am 2015-04-23 12:50, schrieb av:
> It seems I cannot use <Enter> and <c-Enter> at the same time, only one
> of the 2 works. Why is that?

http://vimhelp.appspot.com/vim_faq.txt.html#faq-20.5

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Autocmd to have a mapping only for a specific file

Le jeudi 23 avril 2015 09:25:11 UTC+2, av a écrit :
> Hi,
>
> I try to have an autocommand that would provide a mapping to the <enter> and <c-enter> keys only on a certain file name. Like myfile.txt for example.
>
> I have tried a test like this here, and it works for the <c-Enter> mapping but not for the <Enter> one:
>
> autocmd! BufNewFile,BufRead,BufEnter myfile.txt nmap <buffer> <Enter> :echo 'Hi!'<cr>
> autocmd! BufNewFile,BufRead,BufEnter myfile.txt nmap <buffer> <c-Enter> :echo 'Test!'<cr>
>
> And when I do :map <enter> vim says that there are "No mapping found"
>
> Any ideas why? And please tell me if I chose the right list of events.
>
> Thank you very much,
>
> Alexandre

It seems I cannot use <Enter> and <c-Enter> at the same time, only one of the 2 works. Why is that?

Thanks,

Alexandre

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: How to encode ASCII text to BASE64 without last Line Feed character?

Ben, command:
:setlocal binary noeol
before executing:
:%!base64
helped and solved the problem.
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Build amenu from Funcref

On Wednesday, April 22, 2015 at 3:54:27 PM UTC+1, Ni Va wrote:
> On Wednesday, April 22, 2015 at 3:03:41 PM UTC+1, Ben Fritz wrote:
> > On Wednesday, April 22, 2015 at 4:03:07 AM UTC-5, Ni Va wrote:
> > > Hi all,
> > >
> > > I got some scriptPsexec#function('ddddd') to refer to but I don't happen to call it :
> > > 1- directly
> > > 2- mapped into amenu command
> > >
> > >
> > > let m = psexec#machine()
> > > call m.configure(machine,cce,level)
> > > for foo in m.getCmdList()
> > > let Fn = copy(m[foo])
> > > "1- exe funcref#Call( Fn )
> > > "2-exe 'anoremenu '.m.getMenuPath().'.'.foo.' :funcref#Call("'.string(Fn).'")<CR>'
> > > endfor
> > >
> > >
> > > The funcref#Call echoes me an error:
> > > E492: unknown command: call funcref#Call("function('3210')")
> > >
> > > Can you help me to call correctly the funcref please ?
> > > Thank you
> >
> > Are you sure that's the exact error message? I don't see a "call funcref#Call" anywhere in your script, and it looks like that would be the fix you need. I.e. rather than "exe funcref..." you need "call funcref...".
>
> Ok with these line code
>
> "1- call funcref#Call(Fn )
> "2- exe 'anoremenu '.m.getMenuPath().'.'.foo.' :call funcref#Call("'.string(Fn).'")<CR>'
>
> 1- The first one call the func.
> 2- The second one display call funcref#Call('21446')
> no error message effectively but I would like to execute the func ref 21446


Even if I replace call by exe, the func is not called by pressing button on my toolbar's menu.

exe 'anoremenu '.m.getMenuPath().'.'.foo.' :call funcref#Call("'.string(Fn).'")<CR>'

replaced by

exe 'anoremenu '.m.getMenuPath().'.'.foo.' :exe funcref#Call("'.string(Fn).'")<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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: norm in a global command not working in script

Le jeudi 23 avril 2015 09:34:43 UTC+2, av a écrit :
> Le jeudi 23 avril 2015 08:58:09 UTC+2, av a écrit :
> > Le vendredi 17 avril 2015 01:49:38 UTC+2, Tim Chase a écrit :
> > > On 2015-04-16 15:58, av wrote:
> > > > g,^\w,exe '.,.-1 join'
> > > >
> > > > Is it possible to achive the g,something,norm kJ but with ex
> > > > command instead, maybe it will work for me.
> > >
> > > A couple observations:
> > >
> > > - you're using :exe but don't really need to
> > >
> > > - your range is backwards
> > >
> > > I suspect that you can accomplish what you want with
> > >
> > > :g/^\w/-j
> > >
> > >
> > > where "-j" is the Ex command to, on the previous line ("-"), join it
> > > with the next line (":help :j").
> > >
> > > -tim
> >
> > Hi Tim,
> >
> > It is not working also. So I have this function with your -j method:
> >
> > fu! g:Gon()
> > bd! test.txt
> > exe 'split c:/temp/test.txt'
> > g, = ,-j
> > endfu
> >
> > And I have this test text here:
> >
> > --
> >
> > MySingleLineTextField = testalsdkflkasdf
> > MyMultilineTextField = alsdfjlasdjflksdjlf
> > asldjflaskdfjasdjflasjkdf
> > asdlkflaskdfjasdjfjasdkfjklsd
> > alsdflkasdfjksdjklf
> >
> > MySingleLineTextField = 2308230982309weofsf
> > MyMultilineTextField = asljf9u3f92jfj23fio32jfio3j2iojf23
> > asdfisdjafjs09fjsdf09sdj0f
> > as0dfj0asdj0fasd0j9fas09dfj09sdj0f9sdjf
> >
> > --
> >
> > Then I call using: call g:Gon()
> >
> > And the result is:
> >
> > --
> >
> > MySingleLineTextField = testalsdkflkasdf MyMultilineTextField = alsdfjlasdjflksdjlf
> > asldjflaskdfjasdjflasjkdf
> > asdlkflaskdfjasdjfjasdkfjklsd
> > alsdflkasdfjksdjklf
> > MySingleLineTextField = 2308230982309weofsf MyMultilineTextField = asljf9u3f92jfj23fio32jfio3j2iojf23
> > asdfisdjafjs09fjsdf09sdj0f
> > as0dfj0asdj0fasd0j9fas09dfj09sdj0f9sdjf
> >
> > --
> >
> > The expected results would be that all text that have not " = " would be joined with the previous line with " = " in it, like this:
> >
> > --
> >
> > MySingleLineTextField = testalsdkflkasdf
> > MyMultilineTextField = alsdfjlasdjflksdjlf asldjflaskdfjasdjflasjkdf asdlkflaskdfjasdjfjasdkfjklsd alsdflkasdfjksdjklf
> >
> > MySingleLineTextField = 2308230982309weofsf
> > MyMultilineTextField = asljf9u3f92jfj23fio32jfio3j2iojf23 asdfisdjafjs09fjsdf09sdj0f as0dfj0asdj0fasd0j9fas09dfj09sdj0f9sdjf
> >
> > --
> >
> > Do you obtain this result?
> >
> > Thank you,
> >
> > Alexandre
>
> Hi Tim,
>
> Sorry, it is working fine. I misused your command by inverting the match.
>
> Instead of what I wrote:
> g, = ,-j
> it should be
> g!, = ,-j
> which is working fine with the sample data. I still need to try it with the full data but other commands like the norm kJ didn't format the test data correctly when the file was close and reopened just before the command.
>
> But with your command it is working nice in the test function:
>
> fu! g:Gon()
> bd! test.txt
> exe 'split c:/temp/test.txt'
> g!, = ,-j
> endfu
>
> Many thanks Tim!!
>
> Alexandre

Hi,

Just another quick related question: the -j seems to work but still how could I execute any other exe command inside the global. Something like g!/ = /exe 'mycommand' didn't work nor g!/ = /norm something. Actually the command ran but the results where erroneous for me (gvim 7.3 on windows).

I ask this because this command construct would be very powerful to accomplish many things.

Thank you,

Alexandre

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: positive lookbehind

On Thu, 23 Apr 2015 at 10:46am +0200, Christian Brabandt wrote:

> Well, at least, this is consistent with both regexp engines ;)
>
> I think the problem is, that the '^' prevents a match of the following word.

Apparently this is the case. I'm wondering why.

> I am not sure, why this happens, or if this is expected, but what seems to
> work
> is to include the '^' into the capturing group, e.g.
>
> /\(^\s*\)\@<=\w\+
>
> That works.

That's true.

Thanks, Christian.

Best,
Claus

Re: positive lookbehind

Am 2015-04-23 10:37, schrieb Claus Atzenbeck:
> Hello everybody,
>
> I came across a strange behavior of Vim. Consider the following two
> lines; the 2nd line starts with spaces.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Test test test
> Test test test
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> I want to match each 1st word of a line, ignoring preceding white
> spaces. The expression
>
> /\v^\s*\zs\w+
>
> works perfectly, however,
>
> /\v^(\s*)@<=\w+
>
> does not. It only matches words in the very beginning of a line, but
> not those preceded by whitespaces. I cannot see why the latter would
> not be equivalent to the first expression.
>
> According to
>
> :h @<=
>
> "Vim allows non-fixed-width patterns". Thus, I would expect the
> positive lookbehind to work also for the 2nd line. (I know that \zs is
> the preferable solution anyway, but I'm curious.)
>
> Any ideas?

Well, at least, this is consistent with both regexp engines ;)

I think the problem is, that the '^' prevents a match of the following
word.
I am not sure, why this happens, or if this is expected, but what seems
to work
is to include the '^' into the capturing group, e.g.

/\(^\s*\)\@<=\w\+

That works.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

positive lookbehind

Hello everybody,

I came across a strange behavior of Vim. Consider the following two
lines; the 2nd line starts with spaces.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Test test test
Test test test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I want to match each 1st word of a line, ignoring preceding white
spaces. The expression

/\v^\s*\zs\w+

works perfectly, however,

/\v^(\s*)@<=\w+

does not. It only matches words in the very beginning of a line, but not
those preceded by whitespaces. I cannot see why the latter would not be
equivalent to the first expression.

According to

:h @<=

"Vim allows non-fixed-width patterns". Thus, I would expect the positive
lookbehind to work also for the 2nd line. (I know that \zs is the
preferable solution anyway, but I'm curious.)

Any ideas?

Best,
Claus

Re: norm in a global command not working in script

Le jeudi 23 avril 2015 08:58:09 UTC+2, av a écrit :
> Le vendredi 17 avril 2015 01:49:38 UTC+2, Tim Chase a écrit :
> > On 2015-04-16 15:58, av wrote:
> > > g,^\w,exe '.,.-1 join'
> > >
> > > Is it possible to achive the g,something,norm kJ but with ex
> > > command instead, maybe it will work for me.
> >
> > A couple observations:
> >
> > - you're using :exe but don't really need to
> >
> > - your range is backwards
> >
> > I suspect that you can accomplish what you want with
> >
> > :g/^\w/-j
> >
> >
> > where "-j" is the Ex command to, on the previous line ("-"), join it
> > with the next line (":help :j").
> >
> > -tim
>
> Hi Tim,
>
> It is not working also. So I have this function with your -j method:
>
> fu! g:Gon()
> bd! test.txt
> exe 'split c:/temp/test.txt'
> g, = ,-j
> endfu
>
> And I have this test text here:
>
> --
>
> MySingleLineTextField = testalsdkflkasdf
> MyMultilineTextField = alsdfjlasdjflksdjlf
> asldjflaskdfjasdjflasjkdf
> asdlkflaskdfjasdjfjasdkfjklsd
> alsdflkasdfjksdjklf
>
> MySingleLineTextField = 2308230982309weofsf
> MyMultilineTextField = asljf9u3f92jfj23fio32jfio3j2iojf23
> asdfisdjafjs09fjsdf09sdj0f
> as0dfj0asdj0fasd0j9fas09dfj09sdj0f9sdjf
>
> --
>
> Then I call using: call g:Gon()
>
> And the result is:
>
> --
>
> MySingleLineTextField = testalsdkflkasdf MyMultilineTextField = alsdfjlasdjflksdjlf
> asldjflaskdfjasdjflasjkdf
> asdlkflaskdfjasdjfjasdkfjklsd
> alsdflkasdfjksdjklf
> MySingleLineTextField = 2308230982309weofsf MyMultilineTextField = asljf9u3f92jfj23fio32jfio3j2iojf23
> asdfisdjafjs09fjsdf09sdj0f
> as0dfj0asdj0fasd0j9fas09dfj09sdj0f9sdjf
>
> --
>
> The expected results would be that all text that have not " = " would be joined with the previous line with " = " in it, like this:
>
> --
>
> MySingleLineTextField = testalsdkflkasdf
> MyMultilineTextField = alsdfjlasdjflksdjlf asldjflaskdfjasdjflasjkdf asdlkflaskdfjasdjfjasdkfjklsd alsdflkasdfjksdjklf
>
> MySingleLineTextField = 2308230982309weofsf
> MyMultilineTextField = asljf9u3f92jfj23fio32jfio3j2iojf23 asdfisdjafjs09fjsdf09sdj0f as0dfj0asdj0fasd0j9fas09dfj09sdj0f9sdjf
>
> --
>
> Do you obtain this result?
>
> Thank you,
>
> Alexandre

Hi Tim,

Sorry, it is working fine. I misused your command by inverting the match.

Instead of what I wrote:
g, = ,-j
it should be
g!, = ,-j
which is working fine with the sample data. I still need to try it with the full data but other commands like the norm kJ didn't format the test data correctly when the file was close and reopened just before the command.

But with your command it is working nice in the test function:

fu! g:Gon()
bd! test.txt
exe 'split c:/temp/test.txt'
g!, = ,-j
endfu

Many thanks Tim!!

Alexandre

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Autocmd to have a mapping only for a specific file

Hi,

I try to have an autocommand that would provide a mapping to the <enter> and <c-enter> keys only on a certain file name. Like myfile.txt for example.

I have tried a test like this here, and it works for the <c-Enter> mapping but not for the <Enter> one:

autocmd! BufNewFile,BufRead,BufEnter myfile.txt nmap <buffer> <Enter> :echo 'Hi!'<cr>
autocmd! BufNewFile,BufRead,BufEnter myfile.txt nmap <buffer> <c-Enter> :echo 'Test!'<cr>

And when I do :map <enter> vim says that there are "No mapping found"

Any ideas why? And please tell me if I chose the right list of events.

Thank you very much,

Alexandre

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.