Friday, October 30, 2015

Re: How to avoid zip.vim being used when docx2txt is installed to open docx files?

Le jeudi 29 octobre 2015 23:41:43 UTC+1, Enno a écrit :
> Le mardi 24 mars 2015 16:09:09 UTC+1, Charles Campbell a écrit :
> > Peng Yu wrote:
> > >> Modify g:zipPlugin_ext to hold whichever suffices you want zip.vim to handle and put it into your .vimrc. This change will take effect only in subsequent instances of vim, not a currently running one.
> > > What is the syntax for multiple suffixes? Should it be something like this?
> > >
> > > let g:zipPlugin_ext = '.gz,.zip'
> > >
> > Its set up in plugin/zipPlugin.vim (by default): let g:zipPlugin_ext=
> > '*.zip,*.jar,*.xpi,*.ja,*.war,*.ear,*.celzip,*.oxt,*.kmz,*.wsz,*.xap,*.docx,*.docm,*.dotx,*.dotm,*.potx,*.potm,*.ppsx,*.ppsm,*.pptx,*.pptm,*.ppam,*.sldx,*.thmx,*.xlam,*.xlsx,*.xlsm,*.xlsb,*.xltx,*.xltm,*.xlam,*.crtx,*.vdw,*.glox,*.gcsx,*.gqsx'
> >
> > Sorry about not getting back to you sooner; I've been out a lot lately.
> >
> > Regards,
> > Chip Campbell
>
> If zipPlugin set the autocmd
>
> exe "au BufReadCmd ".g:zipPlugin_ext.' call zip#Browse(expand("<amatch>"))'
>
> after .vimrc is read, then a command that only excludes triggering zipPlugin for *.docx files, such as
>
> let g:zipPlugin_ext = substitute(g:zipPlugin_ext, '\*\.docx', '', '')
>
> could work, too.

That was not correct: The autocmd is set after .vimrc is read.

If it would be set on VimEnter, then a change of g:zipPlugin_ext in .vimrc by

autocmd VimEnter * let g:zipPlugin_ext = substitute(g:zipPlugin_ext, '\*\.docx', '', '')

would also change the pattern of the autocmd (because that of the plugin is set later, and hence loads later).

--
--
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, October 29, 2015

Re: Switching syntax highlighting

On Thu, Oct 29, 2015 at 11:24 PM, sycc <sycc90@mail.com> wrote:
> Nice, thanks a lot!
> Since I'm so new to all this I'm going to have to go through that script (as
> short as it may be) until I fully understand it... but I'm not complaining.
> Not to mention I didn't know I could set different syntaxes for the same
> buffer, that might really come in handy in the future.
>
> Once again, thanks!
>
> -- Sycc


Yeah, syntax/vim.vim itself includes the syntaxes for all interpreted
scripts compiled into this version of Vim, i.e. at most lua, mzscheme,
perl, python, ruby, tcl; and the perl syntax may in turn include the
syntax for pod: total 8 different syntaxes (including Vim syntax
itself) for, let's say, your vimrc, if you edit it in a Vim with all
possible scripts compiled-in.

Best regards,
Tony.

--
--
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 avoid zip.vim being used when docx2txt is installed to open docx files?

Le mardi 24 mars 2015 16:09:09 UTC+1, Charles Campbell a écrit :
> Peng Yu wrote:
> >> Modify g:zipPlugin_ext to hold whichever suffices you want zip.vim to handle and put it into your .vimrc. This change will take effect only in subsequent instances of vim, not a currently running one.
> > What is the syntax for multiple suffixes? Should it be something like this?
> >
> > let g:zipPlugin_ext = '.gz,.zip'
> >
> Its set up in plugin/zipPlugin.vim (by default): let g:zipPlugin_ext=
> '*.zip,*.jar,*.xpi,*.ja,*.war,*.ear,*.celzip,*.oxt,*.kmz,*.wsz,*.xap,*.docx,*.docm,*.dotx,*.dotm,*.potx,*.potm,*.ppsx,*.ppsm,*.pptx,*.pptm,*.ppam,*.sldx,*.thmx,*.xlam,*.xlsx,*.xlsm,*.xlsb,*.xltx,*.xltm,*.xlam,*.crtx,*.vdw,*.glox,*.gcsx,*.gqsx'
>
> Sorry about not getting back to you sooner; I've been out a lot lately.
>
> Regards,
> Chip Campbell

If zipPlugin set the autocmd

exe "au BufReadCmd ".g:zipPlugin_ext.' call zip#Browse(expand("<amatch>"))'

after .vimrc is read, then a command that only excludes triggering zipPlugin for *.docx files, such as

let g:zipPlugin_ext = substitute(g:zipPlugin_ext, '\*\.docx', '', '')

could work, too.

--
--
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: Switching syntax highlighting

Nice, thanks a lot!
Since I'm so new to all this I'm going to have to go through that script
(as short as it may be) until I fully understand it... but I'm not
complaining. Not to mention I didn't know I could set different syntaxes
for the same buffer, that might really come in handy in the future.

Once again, thanks!

-- Sycc


On 10/29/2015 11:00 AM, Charles E Campbell wrote:
> sycc wrote:
>> Hello all!
>> I'm trying to write a function for switching between the current
>> buffer syntax highlighting and whitespace, but I'm really new to vim
>> scripting and such and am having a hard time.
>> I switch to whitespace syntax highlighting and back quite frequently.
>> However, it's not as simple as switching back to the buffer's filetype
>> syntax because there are times when I've changed it to something else.
>> For instance, data in .txt files that I visualize with different
>> syntax highlighting formats depending on the situation.
>>
>> What I've tried is creating a buffer variable on buffer creation and
>> then updating it, this is what I have so far:
>>
>> au BufEnter * let b:current_syntax=&syntax
>> fu! SwitchHLwhitespace()
>> if &syntax == "whitespace"
>> let &syntax=b:current_syntax
>> else
>> let tmp=&syntax
>> set syntax=whitespace
>> let b:current_syntax=tmp
>> endif
>> endfunction
>>
>> This works pretty well until I open a second buffer, either with
>> split, newtab or whatever.
>> Now onto the questions...
>> 1) If I don't use the tmp variable, somewhere inside the "set syntax"
>> routine the buffer var b:current_syntax disappears. I'm not entirely
>> sure why this happens, is it normal? For instance, right after opening
>> a file I can do "echo b:current_syntax" and get the correct output,
>> then I call my function and then once again the echo command and now
>> it fails with 'Undefined variable'. Why is this?
>> 2) When opening a second buffer (lets name the A and B), if I call
>> this on A and switch it to whitespace, then B and switch it as well,
>> then back to A I can no longer go back, the buffer var has changed to
>> "whitespace" and no longer contains the stored syntax highlighting.
>>
>> Now, I'm pretty sure I'm missing something important here... given
>> that I'm pretty new to vim scripting and such. I was under the
>> impression that b: variables were local to buffers, so I thought I
>> could create one per opened buffer and this would work, does it not
>> behave like this?
> In addition to other's comments about the use of b:current_syntax, you
> should use ownsyntax (see :help :ownsyntax). I've attached a small
> plugin which does this.
>
> 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.

Re: vim: yaml syntax highlighting, Problem with variables



2015-10-29 17:52 GMT+03:00 Thomas Bodine -X (tbodine - KFORCE INC at Cisco) <tbodine@cisco.com>:

 

Nikolai

 

There appears to be a problem with coloring variables in vim with Ansible yaml files, at least to me

 

Whenever an Ansible variable appears the first double-quote is ignored  and the second takes effect in a way where everything until the next double-quote appears to be a part of the same string.


    ​msg="Backup failed with error {{ syncsync_result.stderr }}"

is a string

    '​msg="Backup failed with error {{ syncsync_result.stderr }}"'

: quotes are not special here, so they *must not* be highlighted as if there was any quoted string. Error with second quote is there because quoted strings as well as flow-style dictionaries are at the top level. If you know how to make `{`, `}` or `"` in the string *not* highlighted (and preferably without performance degradation) you are welcome, I will resend your patch to Bram. I personally have no idea, main problem with plain scalars like this string is that they may contain almost anything, including some valid YAML code that will be parsed as a part of the string by a YAML parser.

Note that in the second case `!=` and `0` also should not be highlighted: `!` is not a tag and `… 0` is not an integer constant.

BTW, also CC the vim-dev or vim-use mailing list. I am not the proficient syntax file author, somebody there may know better.

 

E.g.:

 

But if I add an extra double-quote then coloring goes back to what I expect. Is there some way to fix this? Or do I need a clue?

 

Thanks for all you do.

Thomas Bodine
Engineer / Developer
tbodine@cisco.com
Phone:

Cisco Systems Limited




US
Cisco.com

 

Think before you print.

This email may contain confidential and privileged material for the sole use of the intended recipient. Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message.

For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html

 

 


--
--
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: Switching syntax highlighting

sycc wrote:
> Hello all!
> I'm trying to write a function for switching between the current
> buffer syntax highlighting and whitespace, but I'm really new to vim
> scripting and such and am having a hard time.
> I switch to whitespace syntax highlighting and back quite frequently.
> However, it's not as simple as switching back to the buffer's filetype
> syntax because there are times when I've changed it to something else.
> For instance, data in .txt files that I visualize with different
> syntax highlighting formats depending on the situation.
>
> What I've tried is creating a buffer variable on buffer creation and
> then updating it, this is what I have so far:
>
> au BufEnter * let b:current_syntax=&syntax
> fu! SwitchHLwhitespace()
> if &syntax == "whitespace"
> let &syntax=b:current_syntax
> else
> let tmp=&syntax
> set syntax=whitespace
> let b:current_syntax=tmp
> endif
> endfunction
>
> This works pretty well until I open a second buffer, either with
> split, newtab or whatever.
> Now onto the questions...
> 1) If I don't use the tmp variable, somewhere inside the "set syntax"
> routine the buffer var b:current_syntax disappears. I'm not entirely
> sure why this happens, is it normal? For instance, right after opening
> a file I can do "echo b:current_syntax" and get the correct output,
> then I call my function and then once again the echo command and now
> it fails with 'Undefined variable'. Why is this?
> 2) When opening a second buffer (lets name the A and B), if I call
> this on A and switch it to whitespace, then B and switch it as well,
> then back to A I can no longer go back, the buffer var has changed to
> "whitespace" and no longer contains the stored syntax highlighting.
>
> Now, I'm pretty sure I'm missing something important here... given
> that I'm pretty new to vim scripting and such. I was under the
> impression that b: variables were local to buffers, so I thought I
> could create one per opened buffer and this would work, does it not
> behave like this?
In addition to other's comments about the use of b:current_syntax, you
should use ownsyntax (see :help :ownsyntax). I've attached a small
plugin which does this.

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.

Wednesday, October 28, 2015

Re: Switching syntax highlighting

Well, I thought I was supposed to create the variable outside the scope
of the function... but I see that's not necessary. And not setting it on
BufEnter actually solves my problem, great!
Just for clarification though, I'm not using filetype because sometimes
I change the syntax highlighting, so I'd need it to go back to the one
I'd changed to instead of the filetype.

Thank you very much!

-- Sycc


On 10/28/2015 08:20 PM, Nikolay Pavlov wrote:
> 2015-10-29 2:19 GMT+03:00 Nikolay Pavlov <zyx.vim@gmail.com>:
>> 2015-10-29 0:52 GMT+03:00 sycc <sycc90@mail.com>:
>>> Thank you all for the answers!
>>>
>>> Yes, I'm actually using it to highlight whitespace... I know it's a
>>> programming language on its own, but it works perfectly well for my needs so
>>> I don't see a reason to install extra plugins for it.
>>>
>>> I hadn't realized that b:current_syntax had a special meaning... that
>>> clearly explains the problem with the tmp var and makes me feel like an
>>> idiot =)
>>> But even after changing that (now I've named it b:current_buffer_syntax and
>>> I can see that this one's not used) problem 2) keeps happening. Maybe this
>>> buffer variables don't work the way I though they did...? I'd like to store
>>> the syntax of each buffer I have open, how can this be done?
>> Why are you setting this variable on BufEnter? I would do this just
>> before setting the option to whitespace and *only* before setting the
>> option to whitespace. Not sure this will fix the issue.
> And also note that &syntax is usually the same thing as &filetype. So
> toggler may look like
>
> if &l:syntax is# &l:filetype
> setlocal syntax=whitespace
> else
> let &l:syntax = &l:filetype
> endif
>
>>> -- Sycc
>>>
>>>
>>> On 10/28/2015 12:38 PM, David Fishburn wrote:
>>>>
>>>> > Didn't quite follow what you are tying to do with whitespace.
>>>> >
>>>> ...
>>>>
>>>> > I use this plugin:
>>>> >
>>>> > cream-showinvisibles : Toggle view of invisible tabs, returns,
>>>> trailing
>>>> > spaces
>>>> > http://vim.sourceforge.net/scripts/script.php?script_id=363
>>>> >
>>>> >
>>>> > Anytime I want to see that stuff, I just hit F4 (that is the
>>>> default mapping
>>>> > for the plugin).
>>>>
>>>> Whitespace is an esoteric programming language:
>>>> https://en.wikipedia.org/wiki/Whitespace_(programming_language)
>>>> <https://en.wikipedia.org/wiki/Whitespace_%28programming_language%29>.
>>>> If it
>>>> is used highlighting of anything, *but* spaces is disturbing.
>>>>
>>>>
>>>> Okay, scratch that reply!!
>>>>
>>>> --
>>>> --
>>>> 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
>>>> <mailto: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.

--
--
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: Switching syntax highlighting

2015-10-29 2:19 GMT+03:00 Nikolay Pavlov <zyx.vim@gmail.com>:
> 2015-10-29 0:52 GMT+03:00 sycc <sycc90@mail.com>:
>> Thank you all for the answers!
>>
>> Yes, I'm actually using it to highlight whitespace... I know it's a
>> programming language on its own, but it works perfectly well for my needs so
>> I don't see a reason to install extra plugins for it.
>>
>> I hadn't realized that b:current_syntax had a special meaning... that
>> clearly explains the problem with the tmp var and makes me feel like an
>> idiot =)
>> But even after changing that (now I've named it b:current_buffer_syntax and
>> I can see that this one's not used) problem 2) keeps happening. Maybe this
>> buffer variables don't work the way I though they did...? I'd like to store
>> the syntax of each buffer I have open, how can this be done?
>
> Why are you setting this variable on BufEnter? I would do this just
> before setting the option to whitespace and *only* before setting the
> option to whitespace. Not sure this will fix the issue.

And also note that &syntax is usually the same thing as &filetype. So
toggler may look like

if &l:syntax is# &l:filetype
setlocal syntax=whitespace
else
let &l:syntax = &l:filetype
endif

>
>>
>> -- Sycc
>>
>>
>> On 10/28/2015 12:38 PM, David Fishburn wrote:
>>>
>>>
>>> > Didn't quite follow what you are tying to do with whitespace.
>>> >
>>> ...
>>>
>>> > I use this plugin:
>>> >
>>> > cream-showinvisibles : Toggle view of invisible tabs, returns,
>>> trailing
>>> > spaces
>>> > http://vim.sourceforge.net/scripts/script.php?script_id=363
>>> >
>>> >
>>> > Anytime I want to see that stuff, I just hit F4 (that is the
>>> default mapping
>>> > for the plugin).
>>>
>>> Whitespace is an esoteric programming language:
>>> https://en.wikipedia.org/wiki/Whitespace_(programming_language)
>>> <https://en.wikipedia.org/wiki/Whitespace_%28programming_language%29>.
>>> If it
>>> is used highlighting of anything, *but* spaces is disturbing.
>>>
>>>
>>> Okay, scratch that reply!!
>>>
>>> --
>>> --
>>> 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
>>> <mailto: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.

--
--
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: Switching syntax highlighting

2015-10-29 0:52 GMT+03:00 sycc <sycc90@mail.com>:
> Thank you all for the answers!
>
> Yes, I'm actually using it to highlight whitespace... I know it's a
> programming language on its own, but it works perfectly well for my needs so
> I don't see a reason to install extra plugins for it.
>
> I hadn't realized that b:current_syntax had a special meaning... that
> clearly explains the problem with the tmp var and makes me feel like an
> idiot =)
> But even after changing that (now I've named it b:current_buffer_syntax and
> I can see that this one's not used) problem 2) keeps happening. Maybe this
> buffer variables don't work the way I though they did...? I'd like to store
> the syntax of each buffer I have open, how can this be done?

Why are you setting this variable on BufEnter? I would do this just
before setting the option to whitespace and *only* before setting the
option to whitespace. Not sure this will fix the issue.

>
> -- Sycc
>
>
> On 10/28/2015 12:38 PM, David Fishburn wrote:
>>
>>
>> > Didn't quite follow what you are tying to do with whitespace.
>> >
>> ...
>>
>> > I use this plugin:
>> >
>> > cream-showinvisibles : Toggle view of invisible tabs, returns,
>> trailing
>> > spaces
>> > http://vim.sourceforge.net/scripts/script.php?script_id=363
>> >
>> >
>> > Anytime I want to see that stuff, I just hit F4 (that is the
>> default mapping
>> > for the plugin).
>>
>> Whitespace is an esoteric programming language:
>> https://en.wikipedia.org/wiki/Whitespace_(programming_language)
>> <https://en.wikipedia.org/wiki/Whitespace_%28programming_language%29>.
>> If it
>> is used highlighting of anything, *but* spaces is disturbing.
>>
>>
>> Okay, scratch that reply!!
>>
>> --
>> --
>> 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
>> <mailto: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.

--
--
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: Switching syntax highlighting

Thank you all for the answers!

Yes, I'm actually using it to highlight whitespace... I know it's a
programming language on its own, but it works perfectly well for my
needs so I don't see a reason to install extra plugins for it.

I hadn't realized that b:current_syntax had a special meaning... that
clearly explains the problem with the tmp var and makes me feel like an
idiot =)
But even after changing that (now I've named it b:current_buffer_syntax
and I can see that this one's not used) problem 2) keeps happening.
Maybe this buffer variables don't work the way I though they did...? I'd
like to store the syntax of each buffer I have open, how can this be done?

-- Sycc


On 10/28/2015 12:38 PM, David Fishburn wrote:
>
> > Didn't quite follow what you are tying to do with whitespace.
> >
> ...
>
> > I use this plugin:
> >
> > cream-showinvisibles : Toggle view of invisible tabs, returns,
> trailing
> > spaces
> > http://vim.sourceforge.net/scripts/script.php?script_id=363
> >
> >
> > Anytime I want to see that stuff, I just hit F4 (that is the
> default mapping
> > for the plugin).
>
> Whitespace is an esoteric programming language:
> https://en.wikipedia.org/wiki/Whitespace_(programming_language)
> <https://en.wikipedia.org/wiki/Whitespace_%28programming_language%29>.
> If it
> is used highlighting of anything, *but* spaces is disturbing.
>
>
> Okay, scratch that reply!!
>
> --
> --
> 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
> <mailto: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.

Re: Switching syntax highlighting

> Didn't quite follow what you are tying to do with whitespace.
>
...
 
> I use this plugin:
>
> cream-showinvisibles : Toggle view of invisible tabs, returns, trailing
> spaces
> http://vim.sourceforge.net/scripts/script.php?script_id=363
>
>
> Anytime I want to see that stuff, I just hit F4 (that is the default mapping
> for the plugin).

Whitespace is an esoteric programming language:
https://en.wikipedia.org/wiki/Whitespace_(programming_language). If it
is used highlighting of anything, *but* spaces is disturbing.


Okay, scratch that reply!!
 

--
--
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: Switching syntax highlighting

2015-10-28 18:34 GMT+03:00 David Fishburn <dfishburn.vim@gmail.com>:
>
>
> On Tue, Oct 27, 2015 at 7:52 PM, sycc <sycc90@mail.com> wrote:
>>
>> Hello all!
>> I'm trying to write a function for switching between the current buffer
>> syntax highlighting and whitespace, but I'm really new to vim scripting and
>> such and am having a hard time.
>> I switch to whitespace syntax highlighting and back quite frequently.
>> However, it's not as simple as switching back to the buffer's filetype
>> syntax because there are times when I've changed it to something else. For
>> instance, data in .txt files that I visualize with different syntax
>> highlighting formats depending on the situation.
>>
>> What I've tried is creating a buffer variable on buffer creation and then
>> updating it, this is what I have so far:
>>
>> au BufEnter * let b:current_syntax=&syntax
>> fu! SwitchHLwhitespace()
>> if &syntax == "whitespace"
>> let &syntax=b:current_syntax
>> else
>> let tmp=&syntax
>> set syntax=whitespace
>> let b:current_syntax=tmp
>> endif
>> endfunction
>>
>>
>
> Didn't quite follow what you are tying to do with whitespace.
>
> I know at times you want to see "invisible" stuff, like tabs, whitespace,
> special codes and so on.
>
> I use this plugin:
>
> cream-showinvisibles : Toggle view of invisible tabs, returns, trailing
> spaces
> http://vim.sourceforge.net/scripts/script.php?script_id=363
>
>
> Anytime I want to see that stuff, I just hit F4 (that is the default mapping
> for the plugin).

Whitespace is an esoteric programming language:
https://en.wikipedia.org/wiki/Whitespace_(programming_language). If it
is used highlighting of anything, *but* spaces is disturbing.

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

Re: Switching syntax highlighting



On Tue, Oct 27, 2015 at 7:52 PM, sycc <sycc90@mail.com> wrote:
Hello all!
I'm trying to write a function for switching between the current buffer syntax highlighting and whitespace, but I'm really new to vim scripting and such and am having a hard time.
I switch to whitespace syntax highlighting and back quite frequently. However, it's not as simple as switching back to the buffer's filetype syntax because there are times when I've changed it to something else. For instance, data in .txt files that I visualize with different syntax highlighting formats depending on the situation.

What I've tried is creating a buffer variable on buffer creation and then updating it, this is what I have so far:

au BufEnter * let b:current_syntax=&syntax
fu! SwitchHLwhitespace()
    if &syntax == "whitespace"
        let &syntax=b:current_syntax
    else
        let tmp=&syntax
        set syntax=whitespace
        let b:current_syntax=tmp
    endif
endfunction



Didn't quite follow what you are tying to do with whitespace.

I know at times you want to see "invisible" stuff, like tabs, whitespace, special codes and so on.

I use this plugin:

cream-showinvisibles : Toggle view of invisible tabs, returns, trailing spaces 


Anytime I want to see that stuff, I just hit F4 (that is the default mapping for the plugin).

HTH,
David
 

--
--
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: Switching syntax highlighting

2015-10-28 2:52 GMT+03:00 sycc <sycc90@mail.com>:
> Hello all!
> I'm trying to write a function for switching between the current buffer
> syntax highlighting and whitespace, but I'm really new to vim scripting and
> such and am having a hard time.
> I switch to whitespace syntax highlighting and back quite frequently.
> However, it's not as simple as switching back to the buffer's filetype
> syntax because there are times when I've changed it to something else. For
> instance, data in .txt files that I visualize with different syntax
> highlighting formats depending on the situation.
>
> What I've tried is creating a buffer variable on buffer creation and then
> updating it, this is what I have so far:
>
> au BufEnter * let b:current_syntax=&syntax
> fu! SwitchHLwhitespace()
> if &syntax == "whitespace"
> let &syntax=b:current_syntax
> else
> let tmp=&syntax
> set syntax=whitespace
> let b:current_syntax=tmp
> endif
> endfunction
>
> This works pretty well until I open a second buffer, either with split,
> newtab or whatever.
> Now onto the questions...
> 1) If I don't use the tmp variable, somewhere inside the "set syntax"
> routine the buffer var b:current_syntax disappears. I'm not entirely sure
> why this happens, is it normal? For instance, right after opening a file I
> can do "echo b:current_syntax" and get the correct output, then I call my
> function and then once again the echo command and now it fails with
> 'Undefined variable'. Why is this?
> 2) When opening a second buffer (lets name the A and B), if I call this on A
> and switch it to whitespace, then B and switch it as well, then back to A I
> can no longer go back, the buffer var has changed to "whitespace" and no
> longer contains the stored syntax highlighting.

*Don't* use b:current_syntax name. It has special meaning, see :h
b:current_syntax-variable. Specifically after `set syntax=whitespace`
it must be set to `whitespace`.

You need to use buffer variable which has no special meaning.

>
> Now, I'm pretty sure I'm missing something important here... given that I'm
> pretty new to vim scripting and such. I was under the impression that b:
> variables were local to buffers, so I thought I could create one per opened
> buffer and this would work, does it not behave like this?
>
> Thank you all for your help!!
>
> -- Sycc
>
> --
> --
> 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.

Re: Printing bug in gVim?

On Wednesday, October 28, 2015 at 2:30:55 AM UTC-5, Christian Brabandt wrote:
> On Di, 27 Okt 2015, Wolf Bogacz wrote:
>
> > Thanks for the clarification. Here's the whole thing. . .
> >
> > VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 10 2013 14:38:33)
> > MS-Windows 32-bit GUI version with OLE support
> > Compiled by mool@tororo
>
> Hm, I have just tried with a windows build of vim and trying to print 10
> copies of a various help page to a pdf file. It didn't happen for me...
>

7.4 is relatively recent, but there are a few hundred bugfix patches since the initial release. You could try upgrading to the latest ( http://vim.wikia.com/wiki/Where_to_download_Vim ).

However, the only patches affecting print/:hardcopy don't seem related to any issues with the actual printing. So I'm not all that hopeful.

Can you try printing to PDF? Perhaps there is a print driver issue Vim is running into for your real printer. Then you could print from the PDF.

It might also be an option to use :TOhtml first to create an html version of your file with syntax highlighting, and print from there.

Of course those are both a two-step process that can be annoying to deal with every single time.

--
--
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 entry to ex history (broken recently)

Hi rolf.asmund!

On Mi, 28 Okt 2015, rolf.asmund@greenwavereality.com wrote:

> I have the following function in my .vimrc
>
> function! AddToExHistory(cmd)
> execute "normal! q:i" . a:cmd
> endfunction
>
> I adds the command 'cmd' to my ex history (command history) without executing it.
> One way to use it, is the following:
>
> map gls :call AddToExHistory('!ls')<CR>
>
> If I now type 'gls', and then 'q:' I can see ':!ls' as the most recent entry in my ex history.
>
> After I updated my Gentoo installation this has stopped working. (Typing 'gls' has no apparent effect)
>
> My questions:
>
> - Does this work on _your_ computer?
> - Do you know of any other way to add a command to the ex history?
> - Is this a bug in VIM?
> - Could this be caused by a recent VIM patch? Where do I find these patches?
>
> I'm running this version:
> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Oct 22 2015 15:02:48)
> Included patches: 1-769
> Modified by Gentoo-7.4.769

Use histadd() function. BTW: on what version did this work for you?


Best,
Christian
--
Letzte Worte eines Zoowärters:
"Der Löwe ist nicht hungrig."

--
--
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 entry to ex history (broken recently)

I have the following function in my .vimrc

function! AddToExHistory(cmd)
execute "normal! q:i" . a:cmd
endfunction

I adds the command 'cmd' to my ex history (command history) without executing it.
One way to use it, is the following:

map gls :call AddToExHistory('!ls')<CR>

If I now type 'gls', and then 'q:' I can see ':!ls' as the most recent entry in my ex history.

After I updated my Gentoo installation this has stopped working. (Typing 'gls' has no apparent effect)

My questions:

- Does this work on _your_ computer?
- Do you know of any other way to add a command to the ex history?
- Is this a bug in VIM?
- Could this be caused by a recent VIM patch? Where do I find these patches?

I'm running this version:
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Oct 22 2015 15:02:48)
Included patches: 1-769
Modified by Gentoo-7.4.769

--
--
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: [ANN]: vimagit, a new way to use git within vim

>Believe it or not, but emacs has an excellent plugin ;) . This is an interface to git, a plugin named Magit[1]. Its creator designed a unique and really efficient workflow with git. IMO, Magit is more than just a plugin to use git within an editor, this is a new way to use git.
>
>I felt very frustrated during two years, stuck with git gui (or git add -p ?!), although my officemate staged like crazy with Magit. Actually, before he showed me Magit, I was quite happy with what I had. But once I discovered Magit, that was too late. Then, I had two choices, start using emacs, or develop a Magit-like interface for vim. I chose the latter!
>
>> But hey, Tim Pope himself created fugitive, what's wrong with you?
>
>I do not blame fugitive quality, this is a very good plugin. But I don't like much what fugitive offers for staging. As long as your changes belong to one file,
>:Gstatus<CR>do]cdo]c]cdo:w^WkC
>does the job. But if you have changes among multiple files, visualize them globally and stage some of them is a pain to me with fugitive.
>
>Anyway, features like Gdiff or Gblame will stay key features in my workflow. I believe that fugitive, vim-gitgutter and vimagit are complementary.
>
>For all these reasons, I started to develop vimagit[2]. It is 100% inspired^Wcopied from Magit, from the display to the key bindings, trying to reproduce the same workflow. In a first time, I will only focus on stage part. In that sense, vimagit has reached an important step with version 1.4. IMO, it now embeds the minimal feature requirements to be a usable git staging tool, and not just a toy. I use it for my professional projects.
>
>You can see a complete description on github[2], and a demo on asciinema[3].
>
>Looking forward for feedback!
>
>Jérôme
>
>[1]: https://github.com/magit/magit
>[2]: https://github.com/jreybert/vimagit
>[3]: https://asciinema.org/a/28761

Thanks. This works well.

-Dave

--
--
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: Where do I add configuration lines to ~/.vimrc

Hi Tony!

On Mi, 28 Okt 2015, Tony Mechelynck wrote:

> I don't know what it is supposed to do, I cannot guess.

It's one of the more popular plugin managers.

Best,
Christian
--
Sehenswürdigkeiten gehören zu den härtesten Pflichten, die die Kultur
dem europäischen Reisenden auferlegt.
-- Peter Bamm

--
--
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: Printing bug in gVim?

On Di, 27 Okt 2015, Wolf Bogacz wrote:

> Thanks for the clarification. Here's the whole thing. . .
>
> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 10 2013 14:38:33)
> MS-Windows 32-bit GUI version with OLE support
> Compiled by mool@tororo

Hm, I have just tried with a windows build of vim and trying to print 10
copies of a various help page to a pdf file. It didn't happen for me...

Best,
Christian
--
Wenn's Brett vor'm Kopf gewaltig harzt, dann geh' zum Tischler, nicht zum Arzt.

--
--
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, October 27, 2015

Re: Where do I add configuration lines to ~/.vimrc

On Wed, Oct 28, 2015 at 2:40 AM, Brenton Horne <brentonhorne77@gmail.com> wrote:
> Hi,
>
> I have installed the vim-mediawiki-editor plugin and added:
>
> <pre>
> g:mediawiki_editor_url 'en.wikipedia.org'
> g:mediawiki_editor_path '/w/'
> </pre>
>
> to the end of ~/.vimrc. I also tried adding this line right after:
>
> <pre>
> Plugin 'aquach/vim-mediawiki-editor'
> </pre>
>
> and before:
>
> <pre>
> call vundle

Where do I add configuration lines to ~/.vimrc

Hi,

I have installed the vim-mediawiki-editor plugin and added:

<pre>
g:mediawiki_editor_url 'en.wikipedia.org'
g:mediawiki_editor_path '/w/'
</pre>

to the end of ~/.vimrc. I also tried adding this line right after:

<pre>
Plugin 'aquach/vim-mediawiki-editor'
</pre>

and before:

<pre>
call vundle

Re: Printing bug in gVim?

Thanks for the clarification. Here's the whole thing. . .

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 10 2013 14:38:33)
MS-Windows 32-bit GUI version with OLE support
Compiled by mool@tororo
Big version with GUI.  Features included (+) or not (-):
+arabic             +ex_extra           +mouseshape         +syntax
+autocmd            +extra_search       +multi_byte_ime/dyn +tag_binary
+balloon_eval       +farsi              +multi_lang         +tag_old_static
+browse             +file_in_path       -mzscheme           -tag_any_white
++builtin_terms     +find_in_path       +netbeans_intg      +tcl/dyn
+byte_offset        +float              +ole                -tgetent
+cindent            +folding            +path_extra         -termresponse
+clientserver       -footer             +perl/dyn           +textobjects
+clipboard          +gettext/dyn        +persistent_undo    +title
+cmdline_compl      -hangul_input       -postscript         +toolbar
+cmdline_hist       +iconv/dyn          +printer            +user_commands
+cmdline_info       +insert_expand      -profile            +vertsplit
+comments           +jumplist           +python/dyn         +virtualedit
+conceal            +keymap             +python3/dyn        +visual
+cryptv             +langmap            +quickfix           +visualextra
+cscope             +libcall            +reltime            +viminfo
+cursorbind         +linebreak          +rightleft          +vreplace
+cursorshape        +lispindent         +ruby/dyn           +wildignore
+dialog_con_gui     +listcmds           +scrollbind         +wildmenu
+diff               +localmap           +signs              +windows
+digraphs           -lua                +smartindent        +writebackup
-dnd                +menu               -sniff              -xfontset
-ebcdic             +mksession          +startuptime        -xim
+emacs_tags         +modify_fname       +statusline         -xterm_save
+eval               +mouse              -sun_workshop       +xpm_w32
   system vimrc file: "$VIM\vimrc"
     user vimrc file: "$HOME\_vimrc"
 2nd user vimrc file: "$HOME\vimfiles\vimrc"
 3rd user vimrc file: "$VIM\_vimrc"
      user exrc file: "$HOME\_exrc"
  2nd user exrc file: "$VIM\_exrc"
  system gvimrc file: "$VIM\gvimrc"
    user gvimrc file: "$HOME\_gvimrc"
2nd user gvimrc file: "$HOME\vimfiles\gvimrc"
3rd user gvimrc file: "$VIM\_gvimrc"
    system menu file: "$VIMRUNTIME\menu.vim"
Compilation: cl -c /W3 /nologo  -I. -Iproto -DHAVE_PATHDEF -DWIN32   -DFEAT_CSCOPE
-DFEAT_NETBEANS_INTG   -DFEAT_XPM_W32   -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 
/Fo.\ObjGOLYHTRi386/ /Ox /GL -DNDEBUG  /Zl /MT -DFEAT_OLE -DFEAT_MBYTE_IME -DDYNAMIC_IME
-DFEAT_GUI_W32 -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_TCL -DDYNAMIC_TCL
-DDYNAMIC_TCL_DLL=\"tcl85.dll\" -DDYNAMIC_TCL_VER=\"8.5\" -DFEAT_PYTHON -DDYNAMIC_PYTHON
-DDYNAMIC_PYTHON_DLL=\"python27.dll\" -DFEAT_PYTHON3 -DDYNAMIC_PYTHON3
-DDYNAMIC_PYTHON3_DLL=\"python32.dll\" -DFEAT_PERL -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl51
4.dll\" -DFEAT_RUBY -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=19 -DDYNAMIC_RUBY_DLL=\"msvcrt-ruby192.
dll\" -DFEAT_BIG /Fd.\ObjGOLYHTRi386/ /Zi
Linking: link /RELEASE /nologo /subsystem:windows /LTCG:STATUS oldnames.lib kernel32.lib advapi32.lib
shell32.lib gdi32.lib  comdlg32.lib ole32.lib uuid.lib /machine:i386 /nodefaultlib gdi32.lib version.lib   winspool.lib
comctl32.lib advapi32.lib shell32.lib  /machine:i386 /nodefaultlib libcmt.lib oleaut32.lib  user32.lib     
/nodefaultlib:python27.lib /nodefaultlib:python32.lib   "E:\tcl\lib\tclstub85.lib" WSock32.lib
xpm\x86\lib\libXpm.lib /PDB:gvim.pdb -debug



On Tue, Oct 27, 2015 at 12:50 PM, Charles E Campbell <drchip@campbellfamily.biz> wrote:
Wolf Bogacz wrote:
> Windows 2008R2
>
> I'm not sure about Feature Level, but here's the output from the Help
> menu, assuming its what you want:
>
> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 10 2013 14:38:33)
> MS-Windows 32-bit GUI version with OLE support
Hello:

I'm guessing that Ben wanted you to type

  vim --version

and send the output of that along.

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.

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

Switching syntax highlighting

Hello all!
I'm trying to write a function for switching between the current buffer
syntax highlighting and whitespace, but I'm really new to vim scripting
and such and am having a hard time.
I switch to whitespace syntax highlighting and back quite frequently.
However, it's not as simple as switching back to the buffer's filetype
syntax because there are times when I've changed it to something else.
For instance, data in .txt files that I visualize with different syntax
highlighting formats depending on the situation.

What I've tried is creating a buffer variable on buffer creation and
then updating it, this is what I have so far:

au BufEnter * let b:current_syntax=&syntax
fu! SwitchHLwhitespace()
if &syntax == "whitespace"
let &syntax=b:current_syntax
else
let tmp=&syntax
set syntax=whitespace
let b:current_syntax=tmp
endif
endfunction

This works pretty well until I open a second buffer, either with split,
newtab or whatever.
Now onto the questions...
1) If I don't use the tmp variable, somewhere inside the "set syntax"
routine the buffer var b:current_syntax disappears. I'm not entirely
sure why this happens, is it normal? For instance, right after opening a
file I can do "echo b:current_syntax" and get the correct output, then I
call my function and then once again the echo command and now it fails
with 'Undefined variable'. Why is this?
2) When opening a second buffer (lets name the A and B), if I call this
on A and switch it to whitespace, then B and switch it as well, then
back to A I can no longer go back, the buffer var has changed to
"whitespace" and no longer contains the stored syntax highlighting.

Now, I'm pretty sure I'm missing something important here... given that
I'm pretty new to vim scripting and such. I was under the impression
that b: variables were local to buffers, so I thought I could create one
per opened buffer and this would work, does it not behave like this?

Thank you all for your help!!

-- Sycc

--
--
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: Printing bug in gVim?

Wolf Bogacz wrote:
> Windows 2008R2
>
> I'm not sure about Feature Level, but here's the output from the Help
> menu, assuming its what you want:
>
> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 10 2013 14:38:33)
> MS-Windows 32-bit GUI version with OLE support
Hello:

I'm guessing that Ben wanted you to type

vim --version

and send the output of that along.

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.

Re: Printing bug in gVim?

Windows 2008R2

I'm not sure about Feature Level, but here's the output from the Help menu, assuming its what you want:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 10 2013 14:38:33)
MS-Windows 32-bit GUI version with OLE support


On Tue, Oct 27, 2015 at 10:01 AM, Ben Fritz <fritzophrenic@gmail.com> wrote:
> I currently run gVim 7.4

What OS? What Vim feature level?

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

Printing bug in gVim?

> I currently run gVim 7.4

What OS? What Vim feature level?

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

[ANN]: vimagit, a new way to use git within vim

Believe it or not, but emacs has an excellent plugin ;) . This is an interface to git, a plugin named Magit[1]. Its creator designed a unique and really efficient workflow with git. IMO, Magit is more than just a plugin to use git within an editor, this is a new way to use git.

I felt very frustrated during two years, stuck with git gui (or git add -p ?!), although my officemate staged like crazy with Magit. Actually, before he showed me Magit, I was quite happy with what I had. But once I discovered Magit, that was too late. Then, I had two choices, start using emacs, or develop a Magit-like interface for vim. I chose the latter!

> But hey, Tim Pope himself created fugitive, what's wrong with you?

I do not blame fugitive quality, this is a very good plugin. But I don't like much what fugitive offers for staging. As long as your changes belong to one file,
:Gstatus<CR>do]cdo]c]cdo:w^WkC
does the job. But if you have changes among multiple files, visualize them globally and stage some of them is a pain to me with fugitive.

Anyway, features like Gdiff or Gblame will stay key features in my workflow. I believe that fugitive, vim-gitgutter and vimagit are complementary.

For all these reasons, I started to develop vimagit[2]. It is 100% inspired^Wcopied from Magit, from the display to the key bindings, trying to reproduce the same workflow. In a first time, I will only focus on stage part. In that sense, vimagit has reached an important step with version 1.4. IMO, it now embeds the minimal feature requirements to be a usable git staging tool, and not just a toy. I use it for my professional projects.

You can see a complete description on github[2], and a demo on asciinema[3].

Looking forward for feedback!

Jérôme

[1]: https://github.com/magit/magit
[2]: https://github.com/jreybert/vimagit
[3]: https://asciinema.org/a/28761

--
--
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, October 26, 2015

Printing bug in gVim?

When trying to print ten copies of a multi-page document today, I found the printer had made 100 copies each of the first 2 pages, before I got to the printer. I killed the job, and assumed I had mistyped 100 into the "Number of Copies" field on the dialog. Tried it again, with 10, specifically, and carefully, but 100 copies of page 1 were in the bin on the second try. Killed that, too. Submitted the print job 10x as 1 copy to get full output.

I currently run gVim 7.4

--
--
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: Scrollbar slider doesn't change size when folding

Albert Berger wrote:

> When editing a large buffer in gvim/Linux with many folds and folding
> is toggled so that 800 line buffer is folded to 80 lines (with the
> window height being 50 lines), the scrollbar slider doesn't change its
> length and remains of the same size as when the buffer is fully
> unfolded. Is this behaviour by design and has some rationale as
> compared to the adaptable size of the slider depending on the actually
> visible lines?

This is because computing the size of the scrollbar thumb would require
going through the whole file and computing the folds. That can be very
slow in a large file.

--
hundred-and-one symptoms of being an internet addict:
53. To find out what time it is, you send yourself an e-mail and check the
"Date:" field.

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

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

---
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: Clipboard copy and paste

On 10/26/2015 08:47 AM, Tim Chase wrote:
> On 2015-10-26 09:00, Tim Ferguson wrote:
>> I find :%yank+ quicker and easier to type
>
> If you're looking for faster-and-easier, you can reduce that to just
>
> :%y+
>
> which I use on a regular basis.
>
> -tim (the original "tim" to whom "S Python" was replying, and I'm
> glad my post was useful)
>

Tim and Tim -- Thank you both!

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

Printing bug in gVim?

When trying to print ten copies of a multi-page document today, I found the printer had made 100 copies each of the first 2 pages, before I got to the printer. I killed the job, and assumed I had mistyped 100 into the "Number of Copies" field on the dialog. Tried it again, with 10, specifically, and carefully, but 100 copies of page 1 were in the bin on the second try. Killed that, too. Submitted the print job 10x as 1 copy to get full output.

I currently run gVim 7.4

--
--
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 find line in vim function

Thanks you, Gary and Tony. I was traveling and did not get a chance to reply. And my apology, I meant to say that I use vim to write/edit a large shell function in vim, which is called from .sh.

Typically, I write and debug small section, but since I was traveling, I wrote the entire function without debugging on the server. That was why I got into this trouble. I still don't know how to figure out the actual line error-ed out in the function, but was able to block and unblock the code to debug the problem.

If there is a better way, I love to hear.

Thanks again.

John

On Thursday, October 22, 2015 at 4:31:43 AM UTC-4, Gary Johnson wrote:
> On 2015-10-21, John Zhao wrote:
> > I am writing a large vim function. When I call it from a .sh
> > script, I got the following error:
>
> If you are really calling a Vim function from a shell script, that
> won't work. Shell scripts must use the language of the shell that
> interprets them. Vim functions must be interpreted by Vim.
>
> 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.

Re: Clipboard copy and paste

On 2015-10-26 09:00, Tim Ferguson wrote:
> I find :%yank+ quicker and easier to type

If you're looking for faster-and-easier, you can reduce that to just

:%y+

which I use on a regular basis.

-tim (the original "tim" to whom "S Python" was replying, and I'm
glad my post was useful)

--
--
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: Clipboard copy and paste

On 23/10/15 18:56, S Python wrote:

> I had kept trying to use gg"*yG based on what I read elsewhere with no luck
> but was able to successfully use gg"+yG instead

I find :%yank+ quicker and easier to type

There is something about an unmatched quote that I find unsettling... :-)

Tim F (no relation)




--
--
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, October 25, 2015

Scrollbar slider doesn't change size when folding

When editing a large buffer in gvim/Linux with many folds and folding is toggled so that 800 line buffer
is folded to 80 lines (with the window height being 50 lines), the scrollbar slider doesn't
change its length and remains of the same size as when the buffer is fully unfolded. Is this behaviour
by design and has some rationale as compared to the adaptable size of the slider depending
on the actually visible lines?


Albert Berger.

--
--
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: Character s is not work on vim maps

On Sun, Oct 25, 2015 at 1:00 AM, Sven Guckes <guckes@guckes.net> wrote:
> * 吴江 <wujiangthu@gmail.com>:
>> When I use noremap <C-S> :update<CR> to map ctrl-s to save file,
>> it's not work, and I use noremap <C-S-l> :update<CR> to
>> map ctrl-shift-s works, since character s is not work
>> and s will be translate only into shift in map? Thanks.
>
> * Dr. Charles E. Campbell, Jr. <drchip@campbellfamily.biz> [2015-10-25 00:49]:
>> Hello-I suspect you're using vim (as opposed to gvim) -
>> and your terminal is taking the ctrl-s.
>
> that's what i thought, too. but why does c-s-l work then?
>
> anyway.. wujiangthu - it's not the 's' that doesnt work -
> it is the CTRL-S which has a special meaning for terminals.
> the CTRL-S is usually the "stop" command for them.
> so the terminal "eats" it before vim gets to see it.
>
> if you do use vim within a terminal then you
> can unset the "stop" which CTRL-S gives it:
> $ stty stop ""
>
> now start vim and you will see that when you switch
> to insert mode and type CTRL-S that a "^S" shows up.
>
> however, you might want stop+start with CTRL-S
> and CTRL-Q in your terminal at times. if so then
> consider mapping command to other key combinations.

Yes, I recommend using the F keys (except <F1> = Help and sometimes
<F10> = Menu), with or without Shift, as {lhs} for mappings, because
they don't have a default binding. (On Linux, at least, Ctrl-Fn
combinations are usually preempted by the window manager; and
Ctrl-Alt-Fn, or Alt-Fn in non-X11 consoles, switch virtual consoles.)
Twelve F keys, times two for shift or no shift, minus two already
defined, that's a total of 22 keys available for mapping: one for
every Hebrew letter or Tarot arcana ;-)

>
> as the comma is on the same key with
> DE+EN layouts i use ",," for updating:
> map ,, :upd<cr>

I use F3 to "save all my work":
map <F3> :wa|wv<CR>
map! <F3> <C-O>:wa|wv<CR>

This, of course, needs care: if a file mustn't be modified on disk, it
has become second nature to me to open it with :view or :sview, not
:edit or :new, so that any attempt to write it this way causes an
error.

>
> Sven
>


Best regards,
Tony.

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