Thursday, January 10, 2019

Re: Saving Viminfo?

On 2019-01-10, Ven Tadipatri wrote:
> Hi,
> I found that when I yanked a large number of lines, exited vim and
> tried pasting, only the first 50 lines were pasted. I was able to set
> the viminfo variable: viminfo='100,<600,s10,h , then yank the lines,
> and it worked. However, I don't want to keep setting the viminfo
> variable every time I want to yank a large number of lines. For some
> reason, when I set the viminfo variable in my .vimrc, it's not picking
> it up, and always reverts to the default : "viminfo='100,<50,s10,h".
> Is there some way I can set this permanently in some Vim config file?

I have set 'viminfo' in my vimrc for many years and it works fine.

set viminfo-=<50 " Remove the default line-count limit. This
" prevented saving large registers, such as
" :redir outputs.

What is the command you use to set it? As soon as you start vim,
what is the result of this command?

:verbose set viminfo?

Regards,
Gary

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

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

Placing fold markers above comments above declarations

I have a perl file with several instances of a variable number of
comment lines, followed by a subroutine or variable declaration in
the leftmost column with a comment with a fold marker on the same
line as the declaration:

````
# comment here
# maybe more comment here
sub subname { #{{{1
...

# comment here
my %hash = ( #{{{1
...
````

What I want to do is to get a commented-out copy of the line with
the fold marker above the first of the variable number of comment
lines above that line:

````
# sub subname #{{{1
# comment here
# maybe more comment here
sub subname {
...

# my %hash #{{{1
# comment here
my %hash = (
...
````

Naturally I have a decent idea of how that could be done with a
Perl script :-) but I wonder if there is a way to do it with Vim
that can be put in a command -- preferably a way where I can
confirm every instance an preferably a oneliner. I can live with
getting the assignment operators and brackets copied along with
the sub/variable names. Note that I want the comment marker
immediately before the fold marker preserved, as I search for
`#{{{\d\+` to remove the fold makers when I'm done.

/bpj

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

Saving Viminfo?

Hi,
I found that when I yanked a large number of lines, exited vim and
tried pasting, only the first 50 lines were pasted. I was able to set
the viminfo variable: viminfo='100,<600,s10,h , then yank the lines,
and it worked. However, I don't want to keep setting the viminfo
variable every time I want to yank a large number of lines. For some
reason, when I set the viminfo variable in my .vimrc, it's not picking
it up, and always reverts to the default : "viminfo='100,<50,s10,h".
Is there some way I can set this permanently in some Vim config file?

Thanks,
Ven

--
--
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, January 9, 2019

Re: Nested syntax highlighting in vim

* 'Andy Wokula' via vim_use (vim_use@googlegroups.com) wrote:
> syn region mineRed start=+\[+ skip=+\\[\\\]]+ end=+]+ oneline contains=mineRed
That's it. Although I do not understand much, but I get it done.
Thank you very much,

--
Gua Chung Lim

"UNIX is basically a simple operating system,
but you have to be a genius to understand the simplicity."
-- Dennis M. Ritchie

--
--
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: Nested syntax highlighting in vim

Am 08.01.2019 um 19:09 schrieb Gua Chung Lim:
> Hi all,
>
> I'm trying to create a syntax for my own mine.vim.
> I always highlight [words between square brackets in one line] in red.
> What if the mentioned square brackets are nested like ...
> [words [inside another brackets]]?
> I got red color only the first 3 [, [ and ].
> But the color for the last one (]) is still white.
> The relevant lines of mine.vim are as followings.
> % grep mineRed ~/.vim/syntax/mine.vim
> syn region mineRed start=+\[+ skip=+\\\\\|\\'+ end=+\]+ oneline
> hi def link mineRed SpecialChar
>
> Actually I don't know much about vim syntax highlighting.
> I copied these commands from somewhere else (mostly help.vim).
> And I then modified it to suit my needs.
>
> Any input would be highly appreciated. Thanks,

" add a contains argument:
syn clear
syn region mineRed start=+\[+ skip=+\\\\\|\\'+ end=+]+ oneline contains=mineRed
hi link mineRed SpecialChar

" the skip argument seems useless, you may want to use it to escape a closing ']' (?):
syn clear
syn region mineRed start=+\[+ skip=+\\[\\\]]+ end=+]+ oneline contains=mineRed
hi link mineRed SpecialChar

(syn clear and hi link only added for demo purposes)

--
Andy

--
--
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, January 8, 2019

Nested syntax highlighting in vim

Hi all,

I'm trying to create a syntax for my own mine.vim.
I always highlight [words between square brackets in one line] in red.
What if the mentioned square brackets are nested like ...
[words [inside another brackets]]?
I got red color only the first 3 [, [ and ].
But the color for the last one (]) is still white.
The relevant lines of mine.vim are as followings.
% grep mineRed ~/.vim/syntax/mine.vim
syn region mineRed start=+\[+ skip=+\\\\\|\\'+ end=+\]+ oneline
hi def link mineRed SpecialChar

Actually I don't know much about vim syntax highlighting.
I copied these commands from somewhere else (mostly help.vim).
And I then modified it to suit my needs.

Any input would be highly appreciated. Thanks,

--
Gua Chung Lim

"UNIX is basically a simple operating system,
but you have to be a genius to understand the simplicity."
-- Dennis M. Ritchie

--
--
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, January 4, 2019

Re: display warning msg a little longer or until another keypress

Hi,

In search.c if I add the ui_delay() call in three places,
it pretty much does what I am looking for:

give_warning((char_u *)_(top_bot_msg), TRUE);
+ ui_delay(p_mat * 100L, TRUE);

And then I set matchtime=3 for example.
Cool imho if there could be some kind of wrapscan/warning timeout
or keypress to continue setting.

thx,
-m

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