Saturday, February 28, 2015

syntax highlighting for class names

In the following text

class Foo {

I want to highlight "Foo".

I tried the following in .vim/syntax/javascript.vim:

syntax region javaScriptClassName start=/class / end=/ /

In .vimrc I have:

hi javaScriptClassName ctermfg=blue

That isn't working. Any idea what I'm doing wrong?

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

Re: vimdiff performance bug?

On Sat, Feb 21, 2015 at 2:16 PM, Erik Falor <ewfalor@gmail.com> wrote:
>
> Could you post the results of launching vimdiff on these files in
> profile mode? Something like the following:
>
> $ vimdiff --statuptime profile.txt file1.gz file2.gz
>

I am not the OP but have a follow up question. Is it possible to
document the --startuptime option in the man page? It works in vim
7.4.488 on Debian but is not listed in the man page.

thanks
--
Kamaraju S Kusumanchi
http://raju.shoutwiki.com/wiki/Blog

--
--
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: obtain current visual selection

Le mercredi 11 février 2015 21:54:54 UTC+1, Enno a écrit :
> Le mardi 10 février 2015 09:22:35 UTC+1, Enno a écrit :
> > Hello,
> >
> > There is a thread on StackOverflow labelled
> >
> > "How to get visually selected text in VimScript"
> >
> > The naive and stable approach would be
> >
> > let old_reg = @v
> > normal! gv"vy
> > let raw_search = @v
> > let @v = old_reg
> > return raw_search
> >
> > but that only works if `set nosecure`. If `set secure` then
> > the functions become involved. I posted my own take at
> >
> > http://stackoverflow.com/questions/1533565/how-to-get-visually-selected-text-in-vimscript/28398359#28398359
> >
> > but it handles neither block-wise selections nor multibyte columns. A function that supports both is for example given at
> >
> > https://github.com/haya14busa/vim-asterisk/blob/4fda3a4d90926512fbb10eda8b7b0491c650eb5e/autoload/asterisk.vim#L163
> >
> > Is there a simple solution at all?
> >
> > Enno
>
> You are right. Thanks for your patience.
>
> I cannot reproduce this dependency on the function
> residing in the autoload folder. So in the end the
> explanation given at :help E523 was a red herring.
>
> I erroneously thought of <expr> mappings and expression register
> mappings as equivalent but found the former more easily readable.
>
> I don't know if there are situations when an <expr> mapping cannot
> be reproduced by an equivalent expression register mapping, or if
> there are other instances when the normal command is impossible.

Just encountered such a situation: If <CR> shall close the completion popup menu and otherwise open a new line, then only

inoremap <expr> <CR> pumvisible() ? "<C-Y>" : "<C-]><CR>"

works. The try

inoremap <CR> <C-R>=pumvisible() ? "<C-Y>" : "<C-]><CR>"<CR>

does not work because abbreviations will not expand anymore.
Apparently the command <C-]> comes to late.

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

Re: Prevent from closing window

2015-02-16 23:25 GMT+03:00 Paul <Paul.Domaskis <at> gmail.com>:
> I do not want <C-W><C-C> to close the current window, so my _vimrc
> contains: nmap <C-W><C-C> <Esc>
> Unfortunately, this only nullifies <C-W><C-C> if the two keys are
> pressed in quick succession. Is there a way to completely prevent
> <C-W><C-C> from closing the window? I want only <C-W>C to close the
> window. <C-C> should always be to stop doing anything.

Nikolay Pavlov <zyx.vim <at> gmail.com> writes:
| You should map `<C-w>` to a function that will use `getchar()` to
| get the next character and, depending on its value, either run
| `<C-w>{char}` or exit. `<C-w>` and other partial normal-mode
| commands use internally C equivalent of `getchar()` function to get
| the next character, thus they do not care how quick the next
| character was entered.

Thanks, Nikolay. I'll delve into the help files and look for online
examples of getchar() usage when I have the chance.

--
--
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 recursively add an entire directory with all its sub-directories to PATH global setting?

On Friday, February 27, 2015 at 8:54:16 PM UTC+13, Bao Niu wrote:
> For example, if I had this folder structure:
>
> ../Main/Sub1
> ------/Sub2
> ------/Sub3/GrandSub

> How can I make my GVim automatically add all the subfolders under Main to the PATH setting?

set path=../Main/**

See :help file-searching for the details.

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.

Thursday, February 26, 2015

How to recursively add an entire directory with all its sub-directories to PATH global setting?

For example, if I had this folder structure:

../Main/Sub1
------/Sub2
------/Sub3/GrandSub

and my current PATH setting is:
path=.,/usr/include/,,

How can I make my GVim automatically add all the subfolders under Main to the PATH setting? Thanks.

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

---
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: Capturing setting ro/noro

On 2015-02-26 21:07, Christian Brabandt wrote:
>> :set cp
>>
>> which changes a whole bunch of other settings. Does one just
>> fire a single "OptionSet", or does one then cascade the firing of
>> more "OptionSet" events for the ~48 settings it would impact?
>
> I would say, it should only trigger once.

While I prefer this for simplicity, it does mean that it becomes
difficult (if not impossible) to watch a setting that gets cascaded.
If I want to know when 'cpoptions' changes, and someone issues a
":set cp', it will change my 'cpoptions', but fire a "hey, 'cp'
changed", leaving me to store and compare the value for
'cpoptions' (or any of the other 40+ settings listed at ":help
'cp'")

If vim offers some variables for before/after inspection (I'd claim
it only needs one, depending on whether this is an OptionSetPre or
OptionSetPost sort of thing, as one of the before/after variables
would be the setting value itself), this trickle-down wouldn't work,
as the changed item would be described as "compatible" rather than
"cpoptions", and its values would be True/False rather than the
before/after values of 'cpoptions'

>> Then you also have "useless machine"[1] cases where the code
>> fired on the event re-sets the option back to its previous state:
>>
>> :autocmd OptionSet * if g:option_name=='expandtab'|set et|endif
>
> That shouldn't be a problem, since autocommands do not nest by
> default.

Okay, I'm cool with "this breaks things, don't do that", much like
the "WARNING: If the autocommand moves the cursor the effect of the
change is undefined" from the help.

>> You'd also have issues of option names: do you use the long or
>> short form to identify them?
>
> Well both should be unique, so the value should be matched against
> the short/long name (including prefix 'no/inv' and suffix '!')

I was presuming that the autocommand would set a pair of variables:
one to let you know which setting had changed, and one to let you
know the other (either previous or new as mentioned above) value.
The contents of the "which setting changed" would be where it would
matter. Would I test

if g:set_name=='cp' ...

or

if g:set_name=='compatible' ...

> Yes this will be tricky. If I have some time, I'll look into it.
> But note, autocommands have in the past contributed to quite some
> bugs and crashes with Vim so I can understand if Bram hesitates to
> add new ones.

I'd file the whole thing under a "nice to have", much preferring a
stable vim over one that had these features with instability.

-tim





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

---
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: Capturing setting ro/noro

Hi Axel!

On Do, 26 Feb 2015, Axel Bender wrote:

> @Christian
>
> Correct me, if I get sth wrong here, but autocommands are based on
> events? How would I implement e.g. a "ReadonlyChanged" with other
> events?

I do not understand the question.

Best,
Christian
--
Es gibt nur ein Elend, und das ist Unwissenheit.
-- Thornton Niven Wilder

--
--
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: Capturing setting ro/noro

Hi Tim!

On Do, 26 Feb 2015, Tim Chase wrote:

> On 2015-02-26 12:01, Christian Brabandt wrote:
> > >> I had to dismiss a solution based on CursorHold as it isn't
> > >> immediate. Sadly there is no ReadonlyChanged event...
> > >
> > > Where in the sources would I start btw. if I wanted to implement
> > > a new event?
> >
> > I would rather add a new autocommand au Option or au OptionSet
>
> I second Christian's suggestion, making it more generic. There are
> times I've wanted to catch changes in other settings (mostly for
> debugging purposes), and a broader OptionSet event with some variable
> containing the option name, the old value, and the new value.
>
> Though this would get particularly hairy for settings that impact
> other settings such as
>
> :set cp
>
> which changes a whole bunch of other settings. Does one just fire a
> single "OptionSet", or does one then cascade the firing of more
> "OptionSet" events for the ~48 settings it would impact?

I would say, it should only trigger once.

> Then you also have "useless machine"[1] cases where the code fired on
> the event re-sets the option back to its previous state:
>
> :autocmd OptionSet * if g:option_name=='expandtab'|set et|endif

That shouldn't be a problem, since autocommands do not nest by default.
>
> You'd also have issues of option names: do you use the long or short
> form to identify them?

Well both should be unique, so the value should be matched against the
short/long name (including prefix 'no/inv' and suffix '!')

> It's a big ugly can of worms, and while I'd enjoy seeing the
> functionality come to Vim, I'd rather it be done "right".

Yes this will be tricky. If I have some time, I'll look into it. But
note, autocommands have in the past contributed to quite some bugs and
crashes with Vim so I can understand if Bram hesitates to add new ones.

Best,
Christian
--
Es ist schon komisch, daß ein Mann, der sich um nichts auf der Welt
Sorgen machen muß, hingeht und eine Frau heiratet.
-- Robert Lee Frost

--
--
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: Capturing setting ro/noro



On Thu, Feb 26, 2015 at 12:17 PM, Salman Halim <salmanhalim@gmail.com> wrote:


On Feb 26, 2015 11:36 AM, "Tim Chase" <vim@tim.thechases.com> wrote:
>
> On 2015-02-26 12:01, Christian Brabandt wrote:
> > >> I had to dismiss a solution based on CursorHold as it isn't
> > >> immediate. Sadly there is no ReadonlyChanged event...
> > >
> > > Where in the sources would I start btw. if I wanted to implement
> > > a new event?
> >
> > I would rather add a new autocommand au Option or au OptionSet
>
> I second Christian's suggestion, making it more generic.  There are
> times I've wanted to catch changes in other settings (mostly for
> debugging purposes), and a broader OptionSet event with some variable
> containing the option name, the old value, and the new value.
>
> Though this would get particularly hairy for settings that impact
> other settings such as
>
>   :set cp
>
> which changes a whole bunch of other settings.  Does one just fire a
> single "OptionSet", or does one then cascade the firing of more
> "OptionSet" events for the ~48 settings it would impact?
>
> Then you also have "useless machine"[1] cases where the code fired on
> the event re-sets the option back to its previous state:
>
>   :autocmd OptionSet * if g:option_name=='expandtab'|set et|endif
>
> You'd also have issues of option names:  do you use the long or short
> form to identify them?
>
> It's a big ugly can of worms, and while I'd enjoy seeing the
> functionality come to Vim, I'd rather it be done "right".
>
> -tim
>

I think that a second event fires after 'cp' is changed, but without some indication that it's a secondary reaction or some such, people will go mad trying to find out how the option was triggered. I would consider such a thing to be a single operation and create one event and have the variable be a list of all options.

Maybe also indicate the old value in there?


Yes, if it is a list I would want to see:
1.  current value  
2.  previous value

Whether this event fires before or after the option is actually changed.

In that list it would nice to have what triggered the option setting.  Not sure how we would describe that, maybe the statement itself "set cp" or some enumeration of it.

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: Defining Region focused on current page

On 2015-02-26, Paul Isambert wrote:
> Le jeudi 26 février 2015 à 04:57, Ni Va a écrit:
> > On Thursday, February 26, 2015 at 4:31:40 PM UTC+1, Gary Johnson wrote:
> > > On 2015-02-26, Ni Va wrote:
> > > > Hi,
> > > >
> > > > I would like to define a region based on current page displayed of
> > > > opened buffer.
> > > >
> > > > How can I define that ?
> > >
> > > I don't know what you mean by "define a region", but you can
> > > visually select all the lines on the current displayed page with
> > >
> > > HVL
> > >
> > > H moves the cursor to the first line of the window; V starts
> > > visual mode linewise; L moves the cursor to the last line of the
> > > window.
> > >
> > > Regards,
> > > Gary
> >
> > Hi Gary,
> >
> > I know visual selection but I just want to define a region to set this command line :
> >
> > syntax sync region ... in order to do syn only on current displayed page
>
> See ":help \%l" and ":help line()" (especially with "w0" and "w$") and
> you should be able to do something like:
>
> exec 'syntax region YourRegion start=+\\%' . line('w0') . 'l+ end=+\\%' . line('w$') . 'l+'

The trouble with that is that the line() functions are evaluated
only at the time the exec command is executed, so the region remains
the lines in the window at the time the syntax file was sourced.

I discovered that the other day when I tried doing something similar
with matchadd(), \%l and line("'a"). After seeing the result, it
was "obvious" why it failed. I wound up evaluating the matchadd()
in a CursorHold autocommand.

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: Capturing setting ro/noro


On Feb 26, 2015 11:36 AM, "Tim Chase" <vim@tim.thechases.com> wrote:
>
> On 2015-02-26 12:01, Christian Brabandt wrote:
> > >> I had to dismiss a solution based on CursorHold as it isn't
> > >> immediate. Sadly there is no ReadonlyChanged event...
> > >
> > > Where in the sources would I start btw. if I wanted to implement
> > > a new event?
> >
> > I would rather add a new autocommand au Option or au OptionSet
>
> I second Christian's suggestion, making it more generic.  There are
> times I've wanted to catch changes in other settings (mostly for
> debugging purposes), and a broader OptionSet event with some variable
> containing the option name, the old value, and the new value.
>
> Though this would get particularly hairy for settings that impact
> other settings such as
>
>   :set cp
>
> which changes a whole bunch of other settings.  Does one just fire a
> single "OptionSet", or does one then cascade the firing of more
> "OptionSet" events for the ~48 settings it would impact?
>
> Then you also have "useless machine"[1] cases where the code fired on
> the event re-sets the option back to its previous state:
>
>   :autocmd OptionSet * if g:option_name=='expandtab'|set et|endif
>
> You'd also have issues of option names:  do you use the long or short
> form to identify them?
>
> It's a big ugly can of worms, and while I'd enjoy seeing the
> functionality come to Vim, I'd rather it be done "right".
>
> -tim
>

I think that a second event fires after 'cp' is changed, but without some indication that it's a secondary reaction or some such, people will go mad trying to find out how the option was triggered. I would consider such a thing to be a single operation and create one event and have the variable be a list of all options.

Maybe also indicate the old value in there?

I'm not too worried about the useless case because I can already, in a WinLeave, go back to the window that was left, so this already exists. Alternatively, you could sandbox this event so you can't reset any options in the list of options that triggered this event.

I can also see the case where this event could be fired recursively with two listeners that listen to options A and B and keep resetting options B and A, respectively. So, maybe the sandbox would have to be limited on whether settings within the listener trigger further events.

Salman

--
--
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: what does iskeyword option do?

On Thursday, February 26, 2015 at 4:57:34 AM UTC-6, Erik Christiansen wrote:
> That all seems to confirm that "iskeyword" is a misnomer for what in
> reality is "istoken", AFAICT. Not only is token boundary recognition the
> process described above, but the process in no way resembles detection
> of a member of a keyword set, like those use in 'C': "if", "switch",
> "case", etc.
>

Actually it has a great deal to do with keyword detection. One use of 'iskeyword' is in syntax definition files, when using "keyword" type matches. :help :syn-keyword.

Syntax highlighting in Vim predates my use of Vim by many years. But since keyword highlighting is the most basic sort, I'd guess it was the first introduced.

--
--
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: dbext without a password

On Wednesday, 25 February, 2015 at 19:53:49 GMT, David Fishburn wrote:
>let g:dbext_default_profile_mysql_no_password =
>"type=MYSQL:user=root:passwd=:dbname=mysql:extra=--password='' "

Yep, this works for me, too. 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: Defining Region focused on current page

Le jeudi 26 février 2015 à 04:57, Ni Va a écrit:
> On Thursday, February 26, 2015 at 4:31:40 PM UTC+1, Gary Johnson wrote:
> > On 2015-02-26, Ni Va wrote:
> > > Hi,
> > >
> > > I would like to define a region based on current page displayed of
> > > opened buffer.
> > >
> > > How can I define that ?
> >
> > I don't know what you mean by "define a region", but you can
> > visually select all the lines on the current displayed page with
> >
> > HVL
> >
> > H moves the cursor to the first line of the window; V starts
> > visual mode linewise; L moves the cursor to the last line of the
> > window.
> >
> > Regards,
> > Gary
>
> Hi Gary,
>
> I know visual selection but I just want to define a region to set this command line :
>
> syntax sync region ... in order to do syn only on current displayed page

See ":help \%l" and ":help line()" (especially with "w0" and "w$") and
you should be able to do something like:

exec 'syntax region YourRegion start=+\\%' . line('w0') . 'l+ end=+\\%' . line('w$') . 'l+'

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: Enable Syntax on Xml Large File only on drawed window

On Tuesday, February 24, 2015 at 5:26:52 PM UTC+1, Ethan Hereth wrote:
> On Tue, Feb 24, 2015 at 11:04 AM, Ben Fritz <fritzo...@gmail.com> wrote:
> On Tuesday, February 24, 2015 at 9:24:34 AM UTC-6, Ni Va wrote:
>
> > Hi,
>
> >
>
> > After applying this http://vim.wikia.com/wiki/Faster_loading_of_large_files, my big xml file is quick loaded.
>
> >



>
> > Then how can I set syn=xml only for drawed part of file in order to be as fast as possible to view colored part of file?
>
> >
>
> > Thank you
>
>
>
> You can't enable syntax highlighting for only part of a file. Syntax highlighting always applies to the entire file.
>
>
>
> I don't know if this would be helpful or fit your work flow, but I just tried it and it seems to work ok with a C file anyway. You can try to use Christian Brabandt's NrrwRgn plugin to open the section of interest in a 'narrowed region' and then enable syntax highlighting in only that region. Doing this did not effect the syntax highlighting of the full file, only the narrowed section.
>
>
> You might try it out and see if it suits your fancy.
>
>
> Cheers,
>
>
> 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+u...@googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.


Hi I resolevd it in vim74\syntax\xml.vim and just put maxlines=100

syn sync minlines=100
syn sync maxlines=100


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: Defining Region focused on current page

On Thursday, February 26, 2015 at 4:57:47 PM UTC+1, Ni Va wrote:
> On Thursday, February 26, 2015 at 4:31:40 PM UTC+1, Gary Johnson wrote:
> > On 2015-02-26, Ni Va wrote:
> > > Hi,
> > >
> > > I would like to define a region based on current page displayed of
> > > opened buffer.
> > >
> > > How can I define that ?
> >
> > I don't know what you mean by "define a region", but you can
> > visually select all the lines on the current displayed page with
> >
> > HVL
> >
> > H moves the cursor to the first line of the window; V starts
> > visual mode linewise; L moves the cursor to the last line of the
> > window.
> >
> > Regards,
> > Gary
>
> Hi Gary,
>
> I know visual selection but I just want to define a region to set this command line :
>
> syntax sync region ... in order to do syn only on current displayed page

It's ok I have just modified vim74/syntax/xml.vim in order to synchronize only onto 100 fewer lines

syn sync minlines=100
syn sync maxlines=100

--
--
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: Defining Region focused on current page

On Thursday, February 26, 2015 at 4:31:40 PM UTC+1, Gary Johnson wrote:
> On 2015-02-26, Ni Va wrote:
> > Hi,
> >
> > I would like to define a region based on current page displayed of
> > opened buffer.
> >
> > How can I define that ?
>
> I don't know what you mean by "define a region", but you can
> visually select all the lines on the current displayed page with
>
> HVL
>
> H moves the cursor to the first line of the window; V starts
> visual mode linewise; L moves the cursor to the last line of the
> window.
>
> Regards,
> Gary

Hi Gary,

I know visual selection but I just want to define a region to set this command line :

syntax sync region ... in order to do syn only on current displayed page

--
--
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: Defining Region focused on current page

On 2015-02-26, Ni Va wrote:
> Hi,
>
> I would like to define a region based on current page displayed of
> opened buffer.
>
> How can I define that ?

I don't know what you mean by "define a region", but you can
visually select all the lines on the current displayed page with

HVL

H moves the cursor to the first line of the window; V starts
visual mode linewise; L moves the cursor to the last line of the
window.

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.

Defining Region focused on current page

Hi,

I would like to define a region based on current page displayed of opened buffer.

How can I define that ?

--
--
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: Capturing setting ro/noro

@Christian

Correct me, if I get sth wrong here, but autocommands are based on events? How would I implement e.g. a "ReadonlyChanged" with other events?

--
--
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: Capturing setting ro/noro

On 2015-02-26 12:01, Christian Brabandt wrote:
> >> I had to dismiss a solution based on CursorHold as it isn't
> >> immediate. Sadly there is no ReadonlyChanged event...
> >
> > Where in the sources would I start btw. if I wanted to implement
> > a new event?
>
> I would rather add a new autocommand au Option or au OptionSet

I second Christian's suggestion, making it more generic. There are
times I've wanted to catch changes in other settings (mostly for
debugging purposes), and a broader OptionSet event with some variable
containing the option name, the old value, and the new value.

Though this would get particularly hairy for settings that impact
other settings such as

:set cp

which changes a whole bunch of other settings. Does one just fire a
single "OptionSet", or does one then cascade the firing of more
"OptionSet" events for the ~48 settings it would impact?

Then you also have "useless machine"[1] cases where the code fired on
the event re-sets the option back to its previous state:

:autocmd OptionSet * if g:option_name=='expandtab'|set et|endif

You'd also have issues of option names: do you use the long or short
form to identify them?

It's a big ugly can of worms, and while I'd enjoy seeing the
functionality come to Vim, I'd rather it be done "right".

-tim

[1]
http://i.imgur.com/d7IwYq1.gif




--
--
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: Capturing setting ro/noro

Am 2015-02-26 11:47, schrieb Axel Bender:
> On Thursday, February 26, 2015 at 9:11:35 AM UTC+1, Axel Bender wrote:
>> I had to dismiss a solution based on CursorHold as it isn't immediate.
>> Sadly there is no ReadonlyChanged event...
>
> Where in the sources would I start btw. if I wanted to implement a new
> event?

I would rather add a new autocommand au Option or au OptionSet

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: what does iskeyword option do?

On 25.02.15 10:32, Tim Chase wrote:
> On 2015-02-25 08:02, FlashBurn wrote:
> > I'm trying to understand the meaning of 'iskeyword' option but I
> > can't figure out from the help what it does. Any help in finding
> > out of the meaning of this option is greatly appreciated.
>
> 'isk' contains a list of characters (or character-ranges) for those
> characters that should be considered a "word". This comes into play
> when using "\<", "\>", "\k" and "\K" in a regular expression; what
> gets considered when you use "*" and "#" to search; what the "iw" and
> "aw" text-objects select; what's considered a "w"ord motion; how
> abbreviations are found; and plenty of other places.
>
> For example, by default "-" isn't part of the 'isk' setting, but if
> you wanted "vip" to highlight/select whole CSS selectors like
> "background-color"
>
> :set isk+=-
>
> to add the dash. Now, if you do "viw" anywhere in the attribute,
> it will highlight/select the entire "background-color" not just
> "background" or "color".

That all seems to confirm that "iskeyword" is a misnomer for what in
reality is "istoken", AFAICT. Not only is token boundary recognition the
process described above, but the process in no way resembles detection
of a member of a keyword set, like those use in 'C': "if", "switch",
"case", etc.

If it were "isword", rather than "iskeyword", then the name would also
be truthful, and more easily understood, I guess.

Erik

--
Australia ranks 44th for average connection speed, according to The State of the
Internet Report from cloud service provider Akamai.
- http://www.abc.net.au/news/2015-02-09/remote-rural-australians-to-wait-another-year-for-fast-internet/6079476

--
--
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: Capturing setting ro/noro

On Thursday, February 26, 2015 at 9:11:35 AM UTC+1, Axel Bender wrote:
> I had to dismiss a solution based on CursorHold as it isn't immediate. Sadly there is no ReadonlyChanged event...

Where in the sources would I start btw. if I wanted to implement a new event?

--
--
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: Capturing setting ro/noro

I had to dismiss a solution based on CursorHold as it isn't immediate. Sadly there is no ReadonlyChanged event...

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

Re: what does iskeyword option do?

On Wednesday, February 25, 2015 at 2:03:40 PM UTC-5, Charles Campbell wrote:
> FlashBurn wrote:
> > On Wednesday, February 25, 2015 at 11:31:36 AM UTC-5, Tim Chase wrote:
> >> On 2015-02-25 08:02, FlashBurn wrote:
> >>> I'm trying to understand the meaning of 'iskeyword' option but I
> >>> can't figure out from the help what it does. Any help in finding
> >>> out of the meaning of this option is greatly appreciated.
> >> 'isk' contains a list of characters (or character-ranges) for those
> >> characters that should be considered a "word". This comes into play
> >> when using "\<", "\>", "\k" and "\K" in a regular expression; what
> >> gets considered when you use "*" and "#" to search; what the "iw" and
> >> "aw" text-objects select; what's considered a "w"ord motion; how
> >> abbreviations are found; and plenty of other places.
> >>
> >> For example, by default "-" isn't part of the 'isk' setting, but if
> >> you wanted "vip" to highlight/select whole CSS selectors like
> >> "background-color"
> >>
> >> :set isk+=-
> >>
> >> to add the dash. Now, if you do "viw" anywhere in the attribute,
> >> it will highlight/select the entire "background-color" not just
> >> "background" or "color".
> >>
> >> It's a little tricky to add certain characters as they have special
> >> meaning. The easiest way I've found is to make a range of length one
> >> for "@":
> >>
> >> :set isk+=@-@ " add an at-sign, good for email addresses
> >> " and Python decorators
> >>
> >> -tim
> > I was trying to understand if it has a meaning in the highlight context. I'm going through an online book, Learn Vimscript the Hard Way and in the following chapter, http://learnvimscriptthehardway.stevelosh.com/chapters/46.html, it talks about the # symbol not being in iskeyword in the context of comments and highlighting and I can't figure out why this matters. I think I'm getting the meaning of this option, i.e. it defines what a word is, but why it matters in highlighting, that is not clear to me.
> >
> Syntax highlighting is based upon regular expressions (see :he regexp).
> A commonly used thing to pick up on are: words. Most variables,
> function names, and commands, for example, fit into the description of
> "word". Hence, the scripts that specify syntax highlighting often use
> the \k atom (see :help /character-classes); and the \k atom depends upon
> the iskeyword setting. For example, syntax/latex.vim (by default)
> removes the underscore from the iskeyword option because latex will
> (usually) flag usage of it as an error.
>
> Regards,
> Chip Campbell

Thanks a lot Chip. That cleared it up.

--
--
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] New plugin to use patience diff algorithm for vim

Hi,

I made a new plugin to make Vim understand unified diffs.

This allows to generate diffs using the patience algorithm which might
provide better readable diffs. This really depends on the changes and
will not always provide better results but at least this allows to
easily switch between different diff algorithms.

Alternatively one can use any other tool to generate the diffs as long
as they are "unified" or "normal" style diffs.

You can also customize your setup to use any other tool to generated
diffs (e.g. mercurial) Read the help on how to configure the plugin
accordingly.

Screenshots are available at github:
https://github.com/chrisbra/vim-diff-enhanced

Installation:
Use the plugin manager of your choice. Or download the stable version of
the plugin, edit it with Vim (vim EnhancedDiff-XXX.vmb) and simply
source it (:so %). Restart and take a look at the help (:h
EnhancedDiff.txt)

Usage:

Once installed, take a look at the help at :h EnhancedDiff

Here is a short overview of the commands provided by the plugin:

:PatienceDiff - Use the Patience Diff algorithm for the next diff mode

:CustomDiff <algorithm> - Use <algorithm> to generate the diff. Use any of
myers
default
histogram
minimal
patience
After changing the algorithm, you need to run :diffupdate if you are in
diff mode to regenerate the diff.

Note: Those 2 commands use internally git to generate the diffs. Make sure you have at least git version 1.8.2 installed.

:DisableEnhancedDiff - Disable plugin (and use default Vim diff capabilities).

License:
The Vim License applies. See :h license

Best,
Christian
--
Der Vertreter klingelt an der Haustür.
Als ihm geöffnet wird, sagt er:
"Gnädige Frau, darf ich Ihnen unseren Verkaufsschlager vorführen,
von dem Ihre Nachbarin meint, Sie könnten ihn sich nicht leisten?"

--
--
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: dbext without a password



On Wed, Feb 25, 2015 at 12:02 PM, Paul <google1241@rainslide.net> wrote:
On Sunday, 22 February, 2015 at 17:42:55 GMT, David Fishburn wrote:
Outside of dbext, can you concoct a mysql command line that does what you
want without using a password.  That usually helps when coming up with the
connection profile that will result in the same command line.

You can also see the dbext command line by running:
:DBSetOption display_cmd_line=1

With that DBSetOption, I can see that the command dbext is using is:

    mysql  -u root -D test -t < /tmp/vplBhqM/dbext.sql

I have previously defined some other mysql user and password in ~/.my.cnf. With the above command line, mysql, since there is no password parameter given, [I'm assuming] takes the password from ~/.my.cnf, which is not necessarily the password of the root user. I think this is a failing of mysql rather than dbext. A command that does is:

    mysql  -u root --password='' -D test -t < /tmp/vplBhqM/dbext.sql


Okay, great, now you have a mysql command line which works as you want.

Were you able to create a dbext profile that will add that?

If you create the following profile in your .vimrc:

let g:dbext_default_profile_mysql_no_password = "type=MYSQL:user=root:passwd=:dbname=mysql:extra=--password='' "

Then for me this produced the following mysql command line:

mysql  -u root -D mysql --password=''  < D:\WINDOW~1\dbext.sql


This one indicated to used the -t (tabbed) output:

let g:dbext_default_profile_mysql_no_password_tabbed = "type=MYSQL:user=root:passwd=:dbname=mysql:extra=-t --password='' "


Thanks for getting back to the list.  I will update the dbext.txt with this example.


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: Capturing setting ro/noro

On Wednesday, February 25, 2015 at 10:50:38 AM UTC-6, Axel Bender wrote:
> I'd like to set the editor's background whenever I switch to/read a RO file, or when I set the readonly option.
>
> Right now I'm "abusing" statusline for my needs; it works pretty good but it is also pretty "dirty"...

For that use, a BufEnter autocmd is probably sufficient, combined with CursorHold for when you set the option manually.

--
--
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: what does iskeyword option do?

FlashBurn wrote:
> On Wednesday, February 25, 2015 at 11:31:36 AM UTC-5, Tim Chase wrote:
>> On 2015-02-25 08:02, FlashBurn wrote:
>>> I'm trying to understand the meaning of 'iskeyword' option but I
>>> can't figure out from the help what it does. Any help in finding
>>> out of the meaning of this option is greatly appreciated.
>> 'isk' contains a list of characters (or character-ranges) for those
>> characters that should be considered a "word". This comes into play
>> when using "\<", "\>", "\k" and "\K" in a regular expression; what
>> gets considered when you use "*" and "#" to search; what the "iw" and
>> "aw" text-objects select; what's considered a "w"ord motion; how
>> abbreviations are found; and plenty of other places.
>>
>> For example, by default "-" isn't part of the 'isk' setting, but if
>> you wanted "vip" to highlight/select whole CSS selectors like
>> "background-color"
>>
>> :set isk+=-
>>
>> to add the dash. Now, if you do "viw" anywhere in the attribute,
>> it will highlight/select the entire "background-color" not just
>> "background" or "color".
>>
>> It's a little tricky to add certain characters as they have special
>> meaning. The easiest way I've found is to make a range of length one
>> for "@":
>>
>> :set isk+=@-@ " add an at-sign, good for email addresses
>> " and Python decorators
>>
>> -tim
> I was trying to understand if it has a meaning in the highlight context. I'm going through an online book, Learn Vimscript the Hard Way and in the following chapter, http://learnvimscriptthehardway.stevelosh.com/chapters/46.html, it talks about the # symbol not being in iskeyword in the context of comments and highlighting and I can't figure out why this matters. I think I'm getting the meaning of this option, i.e. it defines what a word is, but why it matters in highlighting, that is not clear to me.
>
Syntax highlighting is based upon regular expressions (see :he regexp).
A commonly used thing to pick up on are: words. Most variables,
function names, and commands, for example, fit into the description of
"word". Hence, the scripts that specify syntax highlighting often use
the \k atom (see :help /character-classes); and the \k atom depends upon
the iskeyword setting. For example, syntax/latex.vim (by default)
removes the underscore from the iskeyword option because latex will
(usually) flag usage of it as an error.

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: what does iskeyword option do?

On Wednesday, February 25, 2015 at 11:31:36 AM UTC-5, Tim Chase wrote:
> On 2015-02-25 08:02, FlashBurn wrote:
> > I'm trying to understand the meaning of 'iskeyword' option but I
> > can't figure out from the help what it does. Any help in finding
> > out of the meaning of this option is greatly appreciated.
>
> 'isk' contains a list of characters (or character-ranges) for those
> characters that should be considered a "word". This comes into play
> when using "\<", "\>", "\k" and "\K" in a regular expression; what
> gets considered when you use "*" and "#" to search; what the "iw" and
> "aw" text-objects select; what's considered a "w"ord motion; how
> abbreviations are found; and plenty of other places.
>
> For example, by default "-" isn't part of the 'isk' setting, but if
> you wanted "vip" to highlight/select whole CSS selectors like
> "background-color"
>
> :set isk+=-
>
> to add the dash. Now, if you do "viw" anywhere in the attribute,
> it will highlight/select the entire "background-color" not just
> "background" or "color".
>
> It's a little tricky to add certain characters as they have special
> meaning. The easiest way I've found is to make a range of length one
> for "@":
>
> :set isk+=@-@ " add an at-sign, good for email addresses
> " and Python decorators
>
> -tim

I was trying to understand if it has a meaning in the highlight context. I'm going through an online book, Learn Vimscript the Hard Way and in the following chapter, http://learnvimscriptthehardway.stevelosh.com/chapters/46.html, it talks about the # symbol not being in iskeyword in the context of comments and highlighting and I can't figure out why this matters. I think I'm getting the meaning of this option, i.e. it defines what a word is, but why it matters in highlighting, that is not clear to me.

--
--
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: dbext without a password

On Wednesday, 25 February, 2015 at 17:02:39 GMT, Paul wrote:
>I have previously defined some other mysql user and password in ~/.my.cnf. With the above command line, mysql, since there is no password parameter given, [I'm assuming] takes the password from ~/.my.cnf, which is not necessarily the password of the root user. I think this is a failing of mysql rather than dbext. A command that does is:

That should be, "A command that does work is"!

--
--
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: dbext without a password

On Sunday, 22 February, 2015 at 17:42:55 GMT, David Fishburn wrote:
>Outside of dbext, can you concoct a mysql command line that does what you
>want without using a password. That usually helps when coming up with the
>connection profile that will result in the same command line.
>
>You can also see the dbext command line by running:
>:DBSetOption display_cmd_line=1

With that DBSetOption, I can see that the command dbext is using is:

mysql -u root -D test -t < /tmp/vplBhqM/dbext.sql

I have previously defined some other mysql user and password in ~/.my.cnf. With the above command line, mysql, since there is no password parameter given, [I'm assuming] takes the password from ~/.my.cnf, which is not necessarily the password of the root user. I think this is a failing of mysql rather than dbext. A command that does is:

mysql -u root --password='' -D test -t < /tmp/vplBhqM/dbext.sql

Note that -p doesn't accept a blank password (it'll prompt), but --password does.

--
--
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: Capturing setting ro/noro

I'd like to set the editor's background whenever I switch to/read a RO file, or when I set the readonly option.

Right now I'm "abusing" statusline for my needs; it works pretty good but it is also pretty "dirty"...

--
--
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: Capturing setting ro/noro

On Wednesday, February 25, 2015 at 3:57:57 AM UTC-6, Axel Bender wrote:
> Is there a way to capture the setting of readonly? I.e. I'd like to be able to inject a function when the readonly setting is changed.

No, you cannot detect when arbitrary options change.

You could monitor for an option change in a CursorHold event, maybe even combined with CursorMoved, etc.

But readonly will only change automatically when reading the file. So is BufReadPost sufficient for your needs? Why do you need to detect when the value changed?

For all these methods, you can read the current value with something like:

:let current_readonly = &readonly

--
--
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: Syntax folding not responding

On Wednesday, February 25, 2015 at 4:23:37 AM UTC-6, Ni Va wrote:
> Hi,
>
> What filetype I am opening (.vim or .xml), the method syntax folding does not proceed to fold operations meanwhile indent folding method do it.
>
> I think it is a bad configuration in vimfiles.
>
> Can you help me on this topic?
>
> Thank you

Both of these filetypes need an additional setting in your .vimrc to enable syntax folding. See :help xml-folding and :help g:vimsyn_folding

For Vim scripts, also see http://vim.wikia.com/wiki/Syntax_folding_of_Vim_scripts for possible enhancements.

--
--
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: what does iskeyword option do?

On 2015-02-25 08:02, FlashBurn wrote:
> I'm trying to understand the meaning of 'iskeyword' option but I
> can't figure out from the help what it does. Any help in finding
> out of the meaning of this option is greatly appreciated.

'isk' contains a list of characters (or character-ranges) for those
characters that should be considered a "word". This comes into play
when using "\<", "\>", "\k" and "\K" in a regular expression; what
gets considered when you use "*" and "#" to search; what the "iw" and
"aw" text-objects select; what's considered a "w"ord motion; how
abbreviations are found; and plenty of other places.

For example, by default "-" isn't part of the 'isk' setting, but if
you wanted "vip" to highlight/select whole CSS selectors like
"background-color"

:set isk+=-

to add the dash. Now, if you do "viw" anywhere in the attribute,
it will highlight/select the entire "background-color" not just
"background" or "color".

It's a little tricky to add certain characters as they have special
meaning. The easiest way I've found is to make a range of length one
for "@":

:set isk+=@-@ " add an at-sign, good for email addresses
" and Python decorators

-tim




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

---
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: what does iskeyword option do?

On Wednesday, February 25, 2015 at 10:02:46 AM UTC-6, FlashBurn wrote:
> I'm trying to understand the meaning of 'iskeyword' option but I can't figure out from the help what it does. Any help in finding out of the meaning of this option is greatly appreciated.

What's not clear? The help says: 'Keywords are used in searching and recognizing with many commands: "w", "*", "[i", etc. It is also used for "\k" in a |pattern|.'

So, it affects where the 'w' command (move to next word) stops. It affects what text the '*' command searches for. It affects what text the '[i' command searches for. It affects what other similar commands search for.

It also affects what text the '\k' character class matches when you are searching.

Search the help with ':helpgrep iskeyword' for other things it affects, for example, the CTRL-W command in insert and command-line mode, for deleting a word.

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

what does iskeyword option do?

I'm trying to understand the meaning of 'iskeyword' option but I can't figure out from the help what it does. Any help in finding out of the meaning of this option is greatly appreciated.

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

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

Syntax folding not responding

Hi,

What filetype I am opening (.vim or .xml), the method syntax folding does not proceed to fold operations meanwhile indent folding method do it.

I think it is a bad configuration in vimfiles.

Can you help me on this topic?

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.

Capturing setting ro/noro

Is there a way to capture the setting of readonly? I.e. I'd like to be able to inject a function when the readonly setting is changed.

--
--
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 74 compiled and wrong runtimepath ?

Thanks for the answer, indeed, I forgot the helptags
command.

On 02/24/2015 07:35 PM, Gary Johnson wrote:
> On 2015-02-24, aRkadeFR wrote:
>> Hello,
>>
>> I wanted to compile my vim in order to get the python option.
>>
>> I downloaded vim74 from http://www.vim.org/sources.php and
>> then in /usr/local/opt/vim74 I configure like this:
>> ./configure --with-features=huge --enable-pythoninterp
>> --prefix=/usr/local/opt
>> make -j10
>> make install
>>
>> Then with an empty vimrc (but existing) and a ~/.vim/doc/NERD_tree.txt,
>> I launch the vim like so: /usr/local/opt/bin/vim
>> Inside vim now, I have the right runtimepath:
>> /home/arkadefr/.vim,/usr/local/opt/share/vim/vimfiles,/usr/local/opt/share/vim/vim74,/usr/local/opt/share/vim/vimfiles/after,/home/arkadefr/.vim/after
>>
>> but even a :help NERDTree doesnt work.
> Did ":help NERDTree" work before you compiled your own version? You
> may just need to build a helptags file for your local help files by
> executing
>
> :helptags ~/.vim/doc
>
>> I try to include a ~/.vim/plugin/python.vim but even if it is read on
>> the startup, it is not applied when I open a python file :( Even worse
>> it set variables like "set noexpandtab" even though the filetype is
>> right.
> If you expect your python.vim file to be sourced as a filetype
> plugin when you open a Python file, you need to put it in the
> directory for filetype plugins, ~/.vim/ftplugin.
>
> 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.

Tuesday, February 24, 2015

Variable reset on new buffer [old] vim 74 compiled and wrong runtimepath

Ok, my problem is not about the help at all, sorry about
that. I completely forgot to run :helptags <dir>

Then for the runtime, a plugin broke cause some variables
(expandtab locally or not) are setup in a new buffer
now.

Sorry, and have a good one :)

On 02/24/2015 06:25 PM, aRkadeFR wrote:
> Hello,
>
> I wanted to compile my vim in order to get the python option.
>
> I downloaded vim74 from http://www.vim.org/sources.php and
> then in /usr/local/opt/vim74 I configure like this:
> ./configure --with-features=huge --enable-pythoninterp
> --prefix=/usr/local/opt
> make -j10
> make install
>
> Then with an empty vimrc (but existing) and a ~/.vim/doc/NERD_tree.txt,
> I launch the vim like so: /usr/local/opt/bin/vim
> Inside vim now, I have the right runtimepath:
> /home/arkadefr/.vim,/usr/local/opt/share/vim/vimfiles,/usr/local/opt/share/vim/vim74,/usr/local/opt/share/vim/vimfiles/after,/home/arkadefr/.vim/after
>
>
> but even a :help NERDTree doesnt work.
>
> I try to include a ~/.vim/plugin/python.vim but even if it is read on
> the startup, it is not applied when I open a python file :( Even worse
> it set variables like "set noexpandtab" even though the filetype is
> right.
>
> What can I do in order to fix it? Did I compiled / configure it right?
>
> Thanks
>
> PS: I'm under a debian jessie
>
>
> My :version vim:
> :version
> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Feb 24 2015 17:50:31)
> Compiled by arkadefr@online-arkadefr-desktop
> Huge version with GTK2 GUI. Features included (+) or not (-):
> +arabic +cmdline_info -ebcdic +fork()
> +listcmds +mouse_netterm +persistent_undo +signs
> +terminfo +vreplace
> +autocmd +comments +emacs_tags +gettext
> +localmap +mouse_sgr +postscript +smartindent
> +termresponse +wildignore
> +balloon_eval +conceal +eval -hangul_input
> -lua -mouse_sysmouse +printer -sniff
> +textobjects +wildmenu
> +browse +cryptv +ex_extra +iconv
> +menu +mouse_urxvt +profile +startuptime
> +title +windows
> ++builtin_terms +cscope +extra_search +insert_expand
> +mksession +mouse_xterm +python +statusline
> +toolbar +writebackup
> +byte_offset +cursorbind +farsi +jumplist
> +modify_fname +multi_byte -python3 -sun_workshop
> +user_commands +X11
> +cindent +cursorshape +file_in_path +keymap
> +mouse +multi_lang +quickfix +syntax
> +vertsplit -xfontset
> +clientserver +dialog_con_gui +find_in_path +langmap
> +mouseshape -mzscheme +reltime +tag_binary
> +virtualedit +xim
> +clipboard +diff +float +libcall
> +mouse_dec +netbeans_intg +rightleft +tag_old_static
> +visual +xsmp_interact
> +cmdline_compl +digraphs +folding +linebreak
> -mouse_gpm +path_extra -ruby -tag_any_white
> +visualextra +xterm_clipboard
> +cmdline_hist +dnd -footer +lispindent
> -mouse_jsbterm -perl +scrollbind -tcl
> +viminfo -xterm_save
> system vimrc file: "$VIM/vimrc"
> user vimrc file: "$HOME/.vimrc"
> 2nd user vimrc file: "~/.vim/vimrc"
> user exrc file: "$HOME/.exrc"
> system gvimrc file: "$VIM/gvimrc"
> user gvimrc file: "$HOME/.gvimrc"
> 2nd user gvimrc file: "~/.vim/gvimrc"
> system menu file: "$VIMRUNTIME/menu.vim"
> fall-back for $VIM: "/usr/local/opt/share/vim"
> Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK
> -pthread -I/usr/include/gtk-2.0
> -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/
> -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0
> -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng12
> -I/usr/include/gdk-pixbuf-2.0 -
> I/usr/include/libpng12 -I/usr/include/pango-1.0
> -I/usr/include/harfbuzz -I/usr/include/pango-1.0
> -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/
> usr/include/freetype2 -I/usr/local/include -g -O2 -U_FORTIFY_SOURCE
> -D_FORTIFY_SOURCE=1
> Linking: gcc -L/usr/local/lib -Wl,--as-needed -o vim -lgtk-x11-2.0
> -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0
> -lgio-2.0 -lpangoft2-1.0 -lpango
> -1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lSM -lICE
> -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lnsl -lselinux
> -ldl -L/usr/lib/python2.7/config-
> x86_64-linux-gnu -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker
> -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions
>

--
--
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 74 compiled and wrong runtimepath ?

On 2015-02-24, aRkadeFR wrote:
> Hello,
>
> I wanted to compile my vim in order to get the python option.
>
> I downloaded vim74 from http://www.vim.org/sources.php and
> then in /usr/local/opt/vim74 I configure like this:
> ./configure --with-features=huge --enable-pythoninterp
> --prefix=/usr/local/opt
> make -j10
> make install
>
> Then with an empty vimrc (but existing) and a ~/.vim/doc/NERD_tree.txt,
> I launch the vim like so: /usr/local/opt/bin/vim
> Inside vim now, I have the right runtimepath:
> /home/arkadefr/.vim,/usr/local/opt/share/vim/vimfiles,/usr/local/opt/share/vim/vim74,/usr/local/opt/share/vim/vimfiles/after,/home/arkadefr/.vim/after
>
> but even a :help NERDTree doesnt work.

Did ":help NERDTree" work before you compiled your own version? You
may just need to build a helptags file for your local help files by
executing

:helptags ~/.vim/doc

> I try to include a ~/.vim/plugin/python.vim but even if it is read on
> the startup, it is not applied when I open a python file :( Even worse
> it set variables like "set noexpandtab" even though the filetype is
> right.

If you expect your python.vim file to be sourced as a filetype
plugin when you open a Python file, you need to put it in the
directory for filetype plugins, ~/.vim/ftplugin.

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.

vim 74 compiled and wrong runtimepath ?

Hello,

I wanted to compile my vim in order to get the python option.

I downloaded vim74 from http://www.vim.org/sources.php and
then in /usr/local/opt/vim74 I configure like this:
./configure --with-features=huge --enable-pythoninterp
--prefix=/usr/local/opt
make -j10
make install

Then with an empty vimrc (but existing) and a ~/.vim/doc/NERD_tree.txt,
I launch the vim like so: /usr/local/opt/bin/vim
Inside vim now, I have the right runtimepath:
/home/arkadefr/.vim,/usr/local/opt/share/vim/vimfiles,/usr/local/opt/share/vim/vim74,/usr/local/opt/share/vim/vimfiles/after,/home/arkadefr/.vim/after

but even a :help NERDTree doesnt work.

I try to include a ~/.vim/plugin/python.vim but even if it is read on
the startup, it is not applied when I open a python file :( Even worse
it set variables like "set noexpandtab" even though the filetype is
right.

What can I do in order to fix it? Did I compiled / configure it right?

Thanks

PS: I'm under a debian jessie


My :version vim:
:version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Feb 24 2015 17:50:31)
Compiled by arkadefr@online-arkadefr-desktop
Huge version with GTK2 GUI. Features included (+) or not (-):
+arabic +cmdline_info -ebcdic +fork()
+listcmds +mouse_netterm +persistent_undo +signs
+terminfo +vreplace
+autocmd +comments +emacs_tags +gettext
+localmap +mouse_sgr +postscript +smartindent
+termresponse +wildignore
+balloon_eval +conceal +eval -hangul_input
-lua -mouse_sysmouse +printer -sniff
+textobjects +wildmenu
+browse +cryptv +ex_extra +iconv
+menu +mouse_urxvt +profile +startuptime
+title +windows
++builtin_terms +cscope +extra_search +insert_expand
+mksession +mouse_xterm +python +statusline
+toolbar +writebackup
+byte_offset +cursorbind +farsi +jumplist
+modify_fname +multi_byte -python3 -sun_workshop
+user_commands +X11
+cindent +cursorshape +file_in_path +keymap
+mouse +multi_lang +quickfix +syntax
+vertsplit -xfontset
+clientserver +dialog_con_gui +find_in_path +langmap
+mouseshape -mzscheme +reltime +tag_binary
+virtualedit +xim
+clipboard +diff +float +libcall
+mouse_dec +netbeans_intg +rightleft +tag_old_static
+visual +xsmp_interact
+cmdline_compl +digraphs +folding +linebreak
-mouse_gpm +path_extra -ruby -tag_any_white
+visualextra +xterm_clipboard
+cmdline_hist +dnd -footer +lispindent
-mouse_jsbterm -perl +scrollbind -tcl +viminfo
-xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/usr/local/opt/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread
-I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include
-I/usr/include/gio-unix-2.0/
-I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0
-I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng12
-I/usr/include/gdk-pixbuf-2.0 -
I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz
-I/usr/include/pango-1.0 -I/usr/include/glib-2.0
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/
usr/include/freetype2 -I/usr/local/include -g -O2 -U_FORTIFY_SOURCE
-D_FORTIFY_SOURCE=1
Linking: gcc -L/usr/local/lib -Wl,--as-needed -o vim -lgtk-x11-2.0
-lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0
-lgio-2.0 -lpangoft2-1.0 -lpango
-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lSM -lICE -lXpm
-lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lnsl -lselinux -ldl
-L/usr/lib/python2.7/config-
x86_64-linux-gnu -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker
-export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions

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