Tuesday, March 31, 2015

Re: How to indicate multiple window lines that belong to a long line in a file

Le mercredi 01 avril 2015 à 04:21, 'Paul' via vim_use a écrit:
> Currently I use "set number" for this purpose. But it takes a lot of window
> space. So I wonder whether there is a better way to do it, such as the way
> used in Emacs window (showing a little line wrap symbol at the end of a
> window line if it continues to the next window line), or maybe show
> alternative background colors for different long lines? Any ideas?

I'm not sure I understand your request correctly, but perhaps the
showbreak option is what you're looking for?

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: How to get to the helppage of shiftwidth in options.txt?

Am 2015-04-01 04:27, schrieb Peng Yu:
> Check compgen in bash, then you will see what I mean.

Please be more specific and say exactly what you want. Not everybody
wants to install bash to check a manual page.

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: mapping dot to trigger omni completion

2015-04-01 6:14 GMT+03:00 Ivan <ivan.brennan@gmail.com>:
> Towards the end of `:help ins-completion` there's mention of mapping `.` to trigger omni completion when possible:
>
> inoremap <expr> . MayComplete()
> func MayComplete()
> if (can complete)
> return ".\<C-X>\<C-O>"
> endif
> return '.'
> endfunc
>
> I like this idea, but have no idea what might be used for the "can complete" if-condition. Any ideas out there?

Check that you are not in comment and not in a string literal.

I think this mapping should be filetype-specific buffer-local mapping
and not a global one: "can complete" conditions are very different in
different filetypes.

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

mapping dot to trigger omni completion

Towards the end of `:help ins-completion` there's mention of mapping `.` to trigger omni completion when possible:

inoremap <expr> . MayComplete()
func MayComplete()
if (can complete)
return ".\<C-X>\<C-O>"
endif
return '.'
endfunc

I like this idea, but have no idea what might be used for the "can complete" if-condition. Any ideas out there?

--
--
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 get to the helppage of shiftwidth in options.txt?

hi,

On Mon, Mar 30, 2015 at 9:02 AM, Gary Johnson <garyjohn@spocom.com> wrote:
> On 2015-03-29, Tim Chase wrote:
>> [side rant]
>>
>> On 2015-03-29 18:28, toothpik wrote:
>> > let mapleader = ','
>>
>> I've never understood why people remap the exceptionally useful
>> functionality of "," to become the map-leader. I use the native ","
>> and ";" all the time in conjunction with f/F/t/T.
>>
>> :help ;
>> :help ,
>>
>> If one isn't going to keep the single-key "\", at least choose
>> something that has more than one key providing the same
>> functionality, such as "+" & <enter>
>>
>> Or, just map them straight out:
>>
>> :nnoremap <f8> :cn<cr>
>> :nnoremap <f7> :cN<cr>
>>
>> without bothering to wrap them in an extra mapping merely to create
>> the mappings.
>
> Because I don't need the functionality of ',' very often and I do
> need some sort of prefix/leader for mappings. I can easily type ','
> followed by any other key. To type '\', I have to lift my right
> hand off the home row and stretch my pinkie to the right. Then
> before I type a right-hand key, I have to put my right hand back on
> the home row and strike that next key before timeoutlen expires.
> That's too much effort and likelihood of error for a mapping I use
> often. As for using the function keys: I have enough trouble
> touch-typing the keys in the number row. Touch-typing function keys
> is right out.
>
> For me, the functionality and usability I gain by using ',' as a map
> leader greatly exceeds that lost by not having the bare
> functionality of ','.

I also have ',' as my leader key, and I find I can still use it after f/t/F/T
There is just a lag between the moment I press ',' and the cursor
movement, unless I immediately type another command after hitting ','.
This made me realise that if that command started like a mapping of
mine it would not do what I expect :)

nico

>
> 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: How to get to the helppage of shiftwidth in options.txt?

On Tue, Mar 31, 2015 at 4:07 PM, Gary Johnson <garyjohn@spocom.com> wrote:
> On 2015-03-31, Peng Yu wrote:
>> On Sun, Mar 29, 2015 at 8:40 PM, Tim Chase <vim@tim.thechases.com> wrote:
>> > On 2015-03-29 20:22, Peng Yu wrote:
>> >> On Sun, Mar 29, 2015 at 5:52 PM, Tim Chase wrote:
>> >> > :help list<C-D>
>> >>
>> >> Is there a way to somehow print the potential matches in the
>> >> command to stdout.
>> >>
>> >> I am able to get vim print some arbitrary text. But I can not get
>> >> the above printed to the command line.
>> >>
>> >> vim -T dumb -c echo\ \"Hello\ World\!\" -c q
>> >
>> > Not that I know of. If I aspired to do something like that, I'd start
>> > by using :helpgrep to find the matches of interest:
>> >
>> > :helpgrep \*[#-)!+-~]\+list[#-)!+-~]\+\*
>> >
>> > and then access the quick-fix window with ":copen", extracting the
>> > matching contents.
>>
>> In bash, there is `compgen`. So, it might make sense to add something
>> similar to vim as well?
>
> Isn't that what Tim already explained above with

Check compgen in bash, then you will see what I mean.

> :help list<C-D>
>
> ? Take a look at
>
> :help 'wildmode'
>
> for ways to customize the results. You might try
>
> :set wildmode=longest,list
>
> which is what I use.
>
> 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 a topic in the Google Groups "vim_use" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/sQk2EPvlEVY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to vim_use+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Regards,
Peng

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

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

How to indicate multiple window lines that belong to a long line in a file

Currently I use "set number" for this purpose. But it takes a lot of
window space. So I wonder whether there is a better way to do it, such
as the way used in Emacs window (showing a little line wrap symbol at
the end of a window line if it continues to the next window line), or
maybe show alternative background colors for different long lines? Any
ideas?

--
--
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 get to the helppage of shiftwidth in options.txt?

On 2015-03-31, Peng Yu wrote:
> On Sun, Mar 29, 2015 at 8:40 PM, Tim Chase <vim@tim.thechases.com> wrote:
> > On 2015-03-29 20:22, Peng Yu wrote:
> >> On Sun, Mar 29, 2015 at 5:52 PM, Tim Chase wrote:
> >> > :help list<C-D>
> >>
> >> Is there a way to somehow print the potential matches in the
> >> command to stdout.
> >>
> >> I am able to get vim print some arbitrary text. But I can not get
> >> the above printed to the command line.
> >>
> >> vim -T dumb -c echo\ \"Hello\ World\!\" -c q
> >
> > Not that I know of. If I aspired to do something like that, I'd start
> > by using :helpgrep to find the matches of interest:
> >
> > :helpgrep \*[#-)!+-~]\+list[#-)!+-~]\+\*
> >
> > and then access the quick-fix window with ":copen", extracting the
> > matching contents.
>
> In bash, there is `compgen`. So, it might make sense to add something
> similar to vim as well?

Isn't that what Tim already explained above with

:help list<C-D>

? Take a look at

:help 'wildmode'

for ways to customize the results. You might try

:set wildmode=longest,list

which is what I use.

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: How to get to the helppage of shiftwidth in options.txt?

On Sun, Mar 29, 2015 at 8:40 PM, Tim Chase <vim@tim.thechases.com> wrote:
> On 2015-03-29 20:22, Peng Yu wrote:
>> On Sun, Mar 29, 2015 at 5:52 PM, Tim Chase wrote:
>> > :help list<C-D>
>>
>> Is there a way to somehow print the potential matches in the
>> command to stdout.
>>
>> I am able to get vim print some arbitrary text. But I can not get
>> the above printed to the command line.
>>
>> vim -T dumb -c echo\ \"Hello\ World\!\" -c q
>
> Not that I know of. If I aspired to do something like that, I'd start
> by using :helpgrep to find the matches of interest:
>
> :helpgrep \*[#-)!+-~]\+list[#-)!+-~]\+\*
>
> and then access the quick-fix window with ":copen", extracting the
> matching contents.

In bash, there is `compgen`. So, it might make sense to add something
similar to vim as well?

--
Regards,
Peng

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

---
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, March 30, 2015

Re: Incorrect column positions with vertical splits

Thanks, that explains a lot of things. I just noticed that the status
line I'm using (copied from someone else) uses the "virtual column"
(%v) number instead of the normal column number (%c), which apparently
includes the padding. I've replaced it by "%c%V" now to get both
numbers (the latter only if different from the first).

It's still annoying that the '|'-key uses the "virtual" column number,
too, I didn't expect that. Not sure whether there is a better way,
but instead of '{n}|' I've tried '0{n-1}l', which works well enough
for me.

Best regards,
Markus

On Mon, Mar 30, 2015 at 2:11 PM, Mathias Rav <mathiasrav@gmail.com> wrote:
> This happens when the linebreak setting is set, which causes Vim to
> break the line at whitespace instead of in the middle of any word.
>
> When I resize my terminal to 60 characters, and create the line
> consisting of 40 'x', a space, 40 'x', the ruler displays 1,41 when my
> cursor is on the space and 1,42-61 when my cursor is on the first 'x'
> of the second word. I believe 42 is the byte offset of the character
> under the cursor relative to the beginning of the line, whereas 61 is
> the column of the cursor in the current line. Vim had to add 20 spaces
> to pad the line, which explains why the cursor would be at column 61.
>
> Is that not what you observe?
>
> Best,
> Mathias Rav
>
> On Mon, Mar 30, 2015 at 5:29 PM, Markus Mottl <markus.mottl@gmail.com> wrote:
>> Hi,
>>
>> Vim may report incorrect column positions when vertical splits force a
>> line to wrap.
>>
>> E.g. enter a line consisting of 80 characters of 'x's. Now perform
>> vertical splits until the split windows are too small to display all
>> 80 characters in one line. Right now, Vim will still display correct
>> column positions in the status line, because it cannot break the line
>> at a word boundary and hence needs to wrap it within the word.
>>
>> Now move the cursor to e.g. column 40 and replace the 'x' there with a
>> whitespace. Vim will break the line at the whitespace. If you move
>> the cursor past the break, you will notice that the column count in
>> the status line will suddenly jump, apparently incorrectly counting
>> some whitespace that was used to fill in the break.
>>
>> Note that jumping to column positions in the line using '|' will not
>> work as expected anymore either if the position falls within the "jump
>> range". The cursor will just move to the position of the break
>> instead.
>>
>> This problem was observed using text-mode Vim version 7.4.258 on Mac OS X.
>>
>> Best regards,
>> Markus
>>
>> --
>> Markus Mottl http://www.ocaml.info markus.mottl@gmail.com
>>
>> --
>> --
>> 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.



--
Markus Mottl http://www.ocaml.info markus.mottl@gmail.com

--
--
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: Incorrect column positions with vertical splits

This happens when the linebreak setting is set, which causes Vim to
break the line at whitespace instead of in the middle of any word.

When I resize my terminal to 60 characters, and create the line
consisting of 40 'x', a space, 40 'x', the ruler displays 1,41 when my
cursor is on the space and 1,42-61 when my cursor is on the first 'x'
of the second word. I believe 42 is the byte offset of the character
under the cursor relative to the beginning of the line, whereas 61 is
the column of the cursor in the current line. Vim had to add 20 spaces
to pad the line, which explains why the cursor would be at column 61.

Is that not what you observe?

Best,
Mathias Rav

On Mon, Mar 30, 2015 at 5:29 PM, Markus Mottl <markus.mottl@gmail.com> wrote:
> Hi,
>
> Vim may report incorrect column positions when vertical splits force a
> line to wrap.
>
> E.g. enter a line consisting of 80 characters of 'x's. Now perform
> vertical splits until the split windows are too small to display all
> 80 characters in one line. Right now, Vim will still display correct
> column positions in the status line, because it cannot break the line
> at a word boundary and hence needs to wrap it within the word.
>
> Now move the cursor to e.g. column 40 and replace the 'x' there with a
> whitespace. Vim will break the line at the whitespace. If you move
> the cursor past the break, you will notice that the column count in
> the status line will suddenly jump, apparently incorrectly counting
> some whitespace that was used to fill in the break.
>
> Note that jumping to column positions in the line using '|' will not
> work as expected anymore either if the position falls within the "jump
> range". The cursor will just move to the position of the break
> instead.
>
> This problem was observed using text-mode Vim version 7.4.258 on Mac OS X.
>
> Best regards,
> Markus
>
> --
> Markus Mottl http://www.ocaml.info markus.mottl@gmail.com
>
> --
> --
> 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: which match-highlighting is in effect (if any) at a point in a file?

Nikolay Pavlov wrote:
> 2015-03-30 7:55 GMT+03:00 LCD 47 <lcd047@gmail.com>:
>> On 28 March 2015, Charles E Campbell <drchip@campbellfamily.biz> wrote:
>>> Hello!
>>>
>>> In using :match, :2match, :3match, or matchadd(), one may specify
>>> special highlighting. Any easy way for a vimscript to know which,
>>> if any, highlighting match is active? Such highlighting overrides
>>> the usual syntax highlighting, and I'd like to know what's going on
>>> at the current cursor position.
>> getmatches() returns the list of patterns set by matchadd() and
>> friends, but as far as I know there is no easy way to tell whether a
>> given pattern affects a given line or not.
> I neither know the easy way, but I have the hard one:
>
> https://sourceforge.net/p/formatvim/code/ci/ff11b92e967b66c7ad21ce0c4d0c939618c2b97f/tree/autoload/format.vim#l1288
>
> This is a function which determines where highlighting of each match
> starts and ends, and also when match highlights past the end of line.
> The returned `splcolumns` value (first in the pair) is a dictionary of
> dictionaries of lists where keys in top dictionary are line numbers
> with matches and keys in second level dictionary are columns at which
> matches start or end. List shows where matches start and end.
>
Thank you -- I'll look it over.

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: which match-highlighting is in effect (if any) at a point in a file?

LCD 47 wrote:
> On 28 March 2015, Charles E Campbell <drchip@campbellfamily.biz> wrote:
>> Hello!
>>
>> In using :match, :2match, :3match, or matchadd(), one may specify
>> special highlighting. Any easy way for a vimscript to know which,
>> if any, highlighting match is active? Such highlighting overrides
>> the usual syntax highlighting, and I'd like to know what's going on
>> at the current cursor position.
> getmatches() returns the list of patterns set by matchadd() and
> friends, but as far as I know there is no easy way to tell whether a
> given pattern affects a given line or not.
>
That was my conclusion, too, from perusing the help, but I was hoping
I'd overlooked something.

Thank you,
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.

Incorrect column positions with vertical splits

Hi,

Vim may report incorrect column positions when vertical splits force a
line to wrap.

E.g. enter a line consisting of 80 characters of 'x's. Now perform
vertical splits until the split windows are too small to display all
80 characters in one line. Right now, Vim will still display correct
column positions in the status line, because it cannot break the line
at a word boundary and hence needs to wrap it within the word.

Now move the cursor to e.g. column 40 and replace the 'x' there with a
whitespace. Vim will break the line at the whitespace. If you move
the cursor past the break, you will notice that the column count in
the status line will suddenly jump, apparently incorrectly counting
some whitespace that was used to fill in the break.

Note that jumping to column positions in the line using '|' will not
work as expected anymore either if the position falls within the "jump
range". The cursor will just move to the position of the break
instead.

This problem was observed using text-mode Vim version 7.4.258 on Mac OS X.

Best regards,
Markus

--
Markus Mottl http://www.ocaml.info markus.mottl@gmail.com

--
--
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 category does the help page for AnsiEsc belong to?

Peng Yu wrote:
> Hi,
>
> `:help` shows the following categories of help topics. But what does
> AnsiEsc belong to?
>
> WHAT PREPEND EXAMPLE
> Normal mode command (nothing) :help x
> Visual mode command v_ :help v_u
> Insert mode command i_ :help i_<Esc>
> Command-line command : :help :quit
> Command-line editing c_ :help c_<Del>
> Vim command argument - :help -r
> Option ' :help 'textwidth'
>
:AnsiEsc comes from a plugin (AnsiEsc.vim); it provides a command line
command (:AnsiEsc[!]). You had to have installed AnsiEsc.vim yourself.
Plugins, btw, may provide commands and maps falling in several categories.

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: Understanding Vim exclusive motions.

I think i understand what you are saying.  I was misinterpreting the reference manual terms 'start of motion' and 'end of motion'; i was determining start and end of motion based on direction that the cursor moves, which like you said, is not the correct way.

Thanks :),
Arun

On Mon, Mar 30, 2015 at 11:41 AM, Christian Brabandt <cblists@256bit.org> wrote:
Am 2015-03-29 22:46, schrieb arunj:
Hi all,

I have just started with vim, and i need some help.  This is a bit
lengthy, please bear with me :).

I refer to : http://vimdoc.sourceforge.net/htmldoc/motion.html#exclusive.
Specifically, the following text:

Which motions are linewise, inclusive or exclusive is mentioned with the
command.  There are however, two general exceptions:

1. If the motion is exclusive and the end of the motion is in column 1, the
   end of the motion is moved to the end of the previous line and the motion
   becomes inclusive.  Example: `}` moves to the first line after a paragraph,
   but `d}` will not include that line.

Given the following piece of text to start with:

    This is just a random paragraph.

    This is another random paragraph (Some text inside brackets).

    This is a third paragraph.

I start with my cursor on the character `S`, just after the `(`, in
the second paragraph.

I do the following commands - `d}` - in normal mode.  I get the following:

    This is just a random paragraph.

    This is another random paragraph (

    This is a third paragraph.

The cursor is now on the `(` in the second paragraph.  This is
expected as per the rule above: `}` is an exclusive motion, that
causes the cursor to go to column 1 of the blank line between
paragraphs 2 and 3; as per the rule, the cursor goes to the previous
line (on the full-stop), and the motion becomes inclusive (the
full-stop is deleted as part of the `d` operation).

Let's take the original text again, with the cursor again on the `S`.

If i do the following commands - `d{` - in normal mode, i would expect
to get the following, because the `{` is an exclusive motion, and it
causes the cursor to go to column 1 of the blank line between
paragraphs 1 and 2: everything between the full-stop of paragraph 1
and the `S` are deleted, inclusive.

    This is just a random paragraphome text inside brackets).

    This is a third paragraph.

But what actually happens is this:

    This is just a random paragraph.
    Some text inside brackets).

    This is a third paragraph.

With the cursor being on the `S`.

Is this an exception to the exception?  Or am i simply getting it all wrong?

What you are seeing here is, that exclusive/inclusive always works to
that end of the motion that is further away from the buffer's start and
does not depend on the direction of the motion. Therefore the S is not
included in the 'd' command and therefore the empty line won't be joined
with the line above as you expected.

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: Understanding Vim exclusive motions.

Am 2015-03-29 22:46, schrieb arunj:
> Hi all,
>
> I have just started with vim, and i need some help. This is a bit
> lengthy, please bear with me :).
>
> I refer to :
> http://vimdoc.sourceforge.net/htmldoc/motion.html#exclusive.
> Specifically, the following text:
>
> Which motions are linewise, inclusive or exclusive is mentioned with
> the
> command. There are however, two general exceptions:
>
> 1. If the motion is exclusive and the end of the motion is in column 1,
> the
> end of the motion is moved to the end of the previous line and the
> motion
> becomes inclusive. Example: `}` moves to the first line after a
> paragraph,
> but `d}` will not include that line.
>
> Given the following piece of text to start with:
>
> This is just a random paragraph.
>
> This is another random paragraph (Some text inside brackets).
>
> This is a third paragraph.
>
> I start with my cursor on the character `S`, just after the `(`, in
> the second paragraph.
>
> I do the following commands - `d}` - in normal mode. I get the
> following:
>
> This is just a random paragraph.
>
> This is another random paragraph (
>
> This is a third paragraph.
>
> The cursor is now on the `(` in the second paragraph. This is
> expected as per the rule above: `}` is an exclusive motion, that
> causes the cursor to go to column 1 of the blank line between
> paragraphs 2 and 3; as per the rule, the cursor goes to the previous
> line (on the full-stop), and the motion becomes inclusive (the
> full-stop is deleted as part of the `d` operation).
>
> Let's take the original text again, with the cursor again on the `S`.
>
> If i do the following commands - `d{` - in normal mode, i would expect
> to get the following, because the `{` is an exclusive motion, and it
> causes the cursor to go to column 1 of the blank line between
> paragraphs 1 and 2: everything between the full-stop of paragraph 1
> and the `S` are deleted, inclusive.
>
> This is just a random paragraphome text inside brackets).
>
> This is a third paragraph.
>
> But what actually happens is this:
>
> This is just a random paragraph.
> Some text inside brackets).
>
> This is a third paragraph.
>
> With the cursor being on the `S`.
>
> Is this an exception to the exception? Or am i simply getting it all
> wrong?

What you are seeing here is, that exclusive/inclusive always works to
that end of the motion that is further away from the buffer's start and
does not depend on the direction of the motion. Therefore the S is not
included in the 'd' command and therefore the empty line won't be joined
with the line above as you expected.

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 category does the help page for AnsiEsc belong to?

Am 2015-03-30 03:36, schrieb Peng Yu:
> `:help` shows the following categories of help topics. But what does
> AnsiEsc belong to?

That is a plugin you have installed yourself. Those are usually visible
below :h local-additions.

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: How to get to the helppage of shiftwidth in options.txt?

On 2015-03-29, Tim Chase wrote:
> [side rant]
>
> On 2015-03-29 18:28, toothpik wrote:
> > let mapleader = ','
>
> I've never understood why people remap the exceptionally useful
> functionality of "," to become the map-leader. I use the native ","
> and ";" all the time in conjunction with f/F/t/T.
>
> :help ;
> :help ,
>
> If one isn't going to keep the single-key "\", at least choose
> something that has more than one key providing the same
> functionality, such as "+" & <enter>
>
> Or, just map them straight out:
>
> :nnoremap <f8> :cn<cr>
> :nnoremap <f7> :cN<cr>
>
> without bothering to wrap them in an extra mapping merely to create
> the mappings.

Because I don't need the functionality of ',' very often and I do
need some sort of prefix/leader for mappings. I can easily type ','
followed by any other key. To type '\', I have to lift my right
hand off the home row and stretch my pinkie to the right. Then
before I type a right-hand key, I have to put my right hand back on
the home row and strike that next key before timeoutlen expires.
That's too much effort and likelihood of error for a mapping I use
often. As for using the function keys: I have enough trouble
touch-typing the keys in the number row. Touch-typing function keys
is right out.

For me, the functionality and usability I gain by using ',' as a map
leader greatly exceeds that lost by not having the bare
functionality of ','.

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.

Sunday, March 29, 2015

Re: which match-highlighting is in effect (if any) at a point in a file?

On 30 March 2015, Nikolay Pavlov <zyx.vim@gmail.com> wrote:
> 2015-03-30 7:55 GMT+03:00 LCD 47 <lcd047@gmail.com>:
> > On 28 March 2015, Charles E Campbell <drchip@campbellfamily.biz>
> > wrote:
> >> Hello!
> >>
> >> In using :match, :2match, :3match, or matchadd(), one may specify
> >> special highlighting. Any easy way for a vimscript to know which,
> >> if any, highlighting match is active? Such highlighting overrides
> >> the usual syntax highlighting, and I'd like to know what's going on
> >> at the current cursor position.
> >
> > getmatches() returns the list of patterns set by matchadd() and
> > friends, but as far as I know there is no easy way to tell whether a
> > given pattern affects a given line or not.
>
> I neither know the easy way, but I have the hard one:
>
> https://sourceforge.net/p/formatvim/code/ci/ff11b92e967b66c7ad21ce0c4d0c939618c2b97f/tree/autoload/format.vim#l1288
[...]

Nice, and also pretty efficient as far as I can tell. Thank you!

/lcd

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

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

Re: which match-highlighting is in effect (if any) at a point in a file?

2015-03-30 7:55 GMT+03:00 LCD 47 <lcd047@gmail.com>:
> On 28 March 2015, Charles E Campbell <drchip@campbellfamily.biz> wrote:
>> Hello!
>>
>> In using :match, :2match, :3match, or matchadd(), one may specify
>> special highlighting. Any easy way for a vimscript to know which,
>> if any, highlighting match is active? Such highlighting overrides
>> the usual syntax highlighting, and I'd like to know what's going on
>> at the current cursor position.
>
> getmatches() returns the list of patterns set by matchadd() and
> friends, but as far as I know there is no easy way to tell whether a
> given pattern affects a given line or not.

I neither know the easy way, but I have the hard one:

https://sourceforge.net/p/formatvim/code/ci/ff11b92e967b66c7ad21ce0c4d0c939618c2b97f/tree/autoload/format.vim#l1288

This is a function which determines where highlighting of each match
starts and ends, and also when match highlights past the end of line.
The returned `splcolumns` value (first in the pair) is a dictionary of
dictionaries of lists where keys in top dictionary are line numbers
with matches and keys in second level dictionary are columns at which
matches start or end. List shows where matches start and end.

>
> /lcd
>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
--
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 get to the helppage of shiftwidth in options.txt?

On Sun, Mar 29, 2015 at 07:08:53PM -0500, Tim Chase wrote:
> [side rant]

> On 2015-03-29 18:28, toothpik wrote:
> > let mapleader = ','

> I've never understood why people remap the exceptionally useful
> functionality of "," to become the map-leader. I use the native ","
> and ";" all the time in conjunction with f/F/t/T.

> :help ;
> :help ,

I can tell you why I do, but not any of the others: I don't use the
comma or the semi-colon -- I can see what's in the current line and
don't need to search it, let alone repeat that search -- not only do I
use comma as the mapleader, I remapped the semi-colon to the colon,
because I use the colon all the time to get to the ex command line and
with it mapped to the semi-colon I save all that energy I might have
expended pressing that big old shift key

> If one isn't going to keep the single-key "\", at least choose
> something that has more than one key providing the same
> functionality, such as "+" & <enter>

> Or, just map them straight out:

> :nnoremap <f8> :cn<cr>
> :nnoremap <f7> :cN<cr>

> without bothering to wrap them in an extra mapping merely to create
> the mappings.

I don't use them enough to permanently map them -- I have things I do
with my F-keys that I do much more frequently than :cn and :cp, and I
happen to like the little message that pops up when I run that function

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

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

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

Re: which match-highlighting is in effect (if any) at a point in a file?

On 28 March 2015, Charles E Campbell <drchip@campbellfamily.biz> wrote:
> Hello!
>
> In using :match, :2match, :3match, or matchadd(), one may specify
> special highlighting. Any easy way for a vimscript to know which,
> if any, highlighting match is active? Such highlighting overrides
> the usual syntax highlighting, and I'd like to know what's going on
> at the current cursor position.

getmatches() returns the list of patterns set by matchadd() and
friends, but as far as I know there is no easy way to tell whether a
given pattern affects a given line or not.

/lcd

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

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

Re: What category does the help page for AnsiEsc belong to?

On 2015-03-29 20:36, Peng Yu wrote:
> `:help` shows the following categories of help topics. But what does
> AnsiEsc belong to?
>
> WHAT PREPEND EXAMPLE
> Normal mode command (nothing) :help x
> Visual mode command v_ :help v_u
> Insert mode command i_ :help
> i_<Esc> Command-line command : :help :quit
> Command-line editing c_ :help
> c_<Del> Vim command argument - :help -r
> Option ' :help
> 'textwidth'

What do you mean by "AnsiEsc"? I don't see anything regarding that
in the help:

:helpgrep ansiesc\c
E149: Sorry, no help for ansiesc\c

-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: How to get to the helppage of shiftwidth in options.txt?

On 2015-03-29 20:22, Peng Yu wrote:
> On Sun, Mar 29, 2015 at 5:52 PM, Tim Chase wrote:
> > :help list<C-D>
>
> Is there a way to somehow print the potential matches in the
> command to stdout.
>
> I am able to get vim print some arbitrary text. But I can not get
> the above printed to the command line.
>
> vim -T dumb -c echo\ \"Hello\ World\!\" -c q

Not that I know of. If I aspired to do something like that, I'd start
by using :helpgrep to find the matches of interest:

:helpgrep \*[#-)!+-~]\+list[#-)!+-~]\+\*

and then access the quick-fix window with ":copen", extracting the
matching contents.

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

What category does the help page for AnsiEsc belong to?

Hi,

`:help` shows the following categories of help topics. But what does
AnsiEsc belong to?

WHAT PREPEND EXAMPLE
Normal mode command (nothing) :help x
Visual mode command v_ :help v_u
Insert mode command i_ :help i_<Esc>
Command-line command : :help :quit
Command-line editing c_ :help c_<Del>
Vim command argument - :help -r
Option ' :help 'textwidth'

--
Regards,
Peng

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

---
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 get to the helppage of shiftwidth in options.txt?

On Sun, Mar 29, 2015 at 5:52 PM, Tim Chase <vim@tim.thechases.com> wrote:
> On 2015-03-29 15:26, Peng Yu wrote:
>> > > When I ":help shiftwidth", I get to eval.txt. But I'd like to
>> > > get to options.txt. How to do so? Thanks.
>> >
>> > :help 'shiftwidth'
>>
>> What is the difference between with the single quote and without
>> the single quote? Where is this difference documented?
>
> By convention, Vim's settings are targeted in the help by putting
> single-quotes around them. If they're unique, you can find them in
> the help without the quotes, as Vim does a best-guess matching for
> substrings. Thus if you do something like
>
> :help formatexpr
>
> it will take you to the same place as
>
> :help 'formatexpr'
>
> However, as you discovered, if you leave off the single-quotes and
> some other target is found, it will take you there instead. E.g.
>
> :help 'list' " takes you to the help on the 'list' setting
> vs
> :help list " takes you to the help on ":list"
>
> So generally, if you want to find an option/setting, make sure to
> include the single-quote. The conventions are listed at
>
> :help help-context
>
> which is visible right from the first page of just typing
>
> :help
>
> You can also hit control+D to have Vim show you the potential matches
> such as
>
> :help list<C-D>

Is there a way to somehow print the potential matches in the command to stdout.

I am able to get vim print some arbitrary text. But I can not get the
above printed to the command line.

vim -T dumb -c echo\ \"Hello\ World\!\" -c q

> which shows that there are Ex commands, settings, functions,
> build-time options, variables, and data-types all containing the
> search-term "list".
>
> -tim
>
>



--
Regards,
Peng

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

---
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 get to the helppage of shiftwidth in options.txt?

[side rant]

On 2015-03-29 18:28, toothpik wrote:
> let mapleader = ','

I've never understood why people remap the exceptionally useful
functionality of "," to become the map-leader. I use the native ","
and ";" all the time in conjunction with f/F/t/T.

:help ;
:help ,

If one isn't going to keep the single-key "\", at least choose
something that has more than one key providing the same
functionality, such as "+" & <enter>

Or, just map them straight out:

:nnoremap <f8> :cn<cr>
:nnoremap <f7> :cN<cr>

without bothering to wrap them in an extra mapping merely to create
the mappings.

-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: How to get to the helppage of shiftwidth in options.txt?

On Sun, Mar 29, 2015 at 05:52:04PM -0500, Tim Chase wrote:
> On 2015-03-29 15:26, Peng Yu wrote:
> > > > When I ":help shiftwidth", I get to eval.txt. But I'd like to
> > > > get to options.txt. How to do so? Thanks.
> > >
> > > :help 'shiftwidth'
> >
> > What is the difference between with the single quote and without
> > the single quote? Where is this difference documented?

> By convention, Vim's settings are targeted in the help by putting
> single-quotes around them. If they're unique, you can find them in
> the help without the quotes, as Vim does a best-guess matching for
> substrings. Thus if you do something like

> :help formatexpr

> it will take you to the same place as

> :help 'formatexpr'

> However, as you discovered, if you leave off the single-quotes and
> some other target is found, it will take you there instead. E.g.

> :help 'list' " takes you to the help on the 'list' setting
> vs
> :help list " takes you to the help on ":list"

> So generally, if you want to find an option/setting, make sure to
> include the single-quote. The conventions are listed at

> :help help-context

> which is visible right from the first page of just typing

> :help

> You can also hit control+D to have Vim show you the potential matches
> such as

> :help list<C-D>

> which shows that there are Ex commands, settings, functions,
> build-time options, variables, and data-types all containing the
> search-term "list".

and, if you want to dive in and spend an afternoon reading up on various
things in the docs try using

:helpgrep <whatever-you're-interested-in>

with

let mapleader = ','

nnoremap <Leader>hhh :call HelpgrepScrollers()<CR>

function! HelpgrepScrollers()
silent! nmap <F6> :cnext<CR>
silent! nmap <S-F6> :cprev<CR>
echo 'helpgrep scrollers :cn and :cp mapped to F6 and S-F6'
endfunction

in your .vimrc you then hit ,hhh to map F6 and S-F6 to scroll through
the helpgrep results at your leisure

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

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

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

Re: How to get to the helppage of shiftwidth in options.txt?

On 2015-03-29 15:26, Peng Yu wrote:
> > > When I ":help shiftwidth", I get to eval.txt. But I'd like to
> > > get to options.txt. How to do so? Thanks.
> >
> > :help 'shiftwidth'
>
> What is the difference between with the single quote and without
> the single quote? Where is this difference documented?

By convention, Vim's settings are targeted in the help by putting
single-quotes around them. If they're unique, you can find them in
the help without the quotes, as Vim does a best-guess matching for
substrings. Thus if you do something like

:help formatexpr

it will take you to the same place as

:help 'formatexpr'

However, as you discovered, if you leave off the single-quotes and
some other target is found, it will take you there instead. E.g.

:help 'list' " takes you to the help on the 'list' setting
vs
:help list " takes you to the help on ":list"

So generally, if you want to find an option/setting, make sure to
include the single-quote. The conventions are listed at

:help help-context

which is visible right from the first page of just typing

:help

You can also hit control+D to have Vim show you the potential matches
such as

:help list<C-D>

which shows that there are Ex commands, settings, functions,
build-time options, variables, and data-types all containing the
search-term "list".

-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: How to get to the helppage of shiftwidth in options.txt?

On Sunday, March 29, 2015 at 5:09:58 PM UTC-5, toothpik wrote:
> On Sun, Mar 29, 2015 at 04:45:46PM -0500, Peng Yu wrote:
> > Hi,
>
> > When I ":help shiftwidth", I get to eval.txt. But I'd like to get to
> > options.txt. How to do so? Thanks.
>
> :help 'shiftwidth'

What is the difference between with the single quote and without the single quote? Where is this difference documented?

--
--
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 get to the helppage of shiftwidth in options.txt?

* Peng Yu <pengyu.ut@gmail.com> [2015-03-29 16:45]:
> When I ":help shiftwidth", I get to eval.txt. But I'd like to get to
> options.txt. How to do so? Thanks.

Surround shiftwidth with single quotes. Read ":help help-context".

--
Dmitri Vereshchagin

--
--
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 get to the helppage of shiftwidth in options.txt?

On Sun, Mar 29, 2015 at 04:45:46PM -0500, Peng Yu wrote:
> Hi,

> When I ":help shiftwidth", I get to eval.txt. But I'd like to get to
> options.txt. How to do so? Thanks.

:help 'shiftwidth'


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

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

How to get to the helppage of shiftwidth in options.txt?

Hi,

When I ":help shiftwidth", I get to eval.txt. But I'd like to get to
options.txt. How to do so? Thanks.

--
Regards,
Peng

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

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

Understanding Vim exclusive motions.

Hi all,

I have just started with vim, and i need some help. This is a bit lengthy, please bear with me :).

I refer to : http://vimdoc.sourceforge.net/htmldoc/motion.html#exclusive.
Specifically, the following text:

Which motions are linewise, inclusive or exclusive is mentioned with the
command. There are however, two general exceptions:

1. If the motion is exclusive and the end of the motion is in column 1, the
end of the motion is moved to the end of the previous line and the motion
becomes inclusive. Example: `}` moves to the first line after a paragraph,
but `d}` will not include that line.

Given the following piece of text to start with:

This is just a random paragraph.

This is another random paragraph (Some text inside brackets).

This is a third paragraph.

I start with my cursor on the character `S`, just after the `(`, in the second paragraph.

I do the following commands - `d}` - in normal mode. I get the following:

This is just a random paragraph.

This is another random paragraph (

This is a third paragraph.

The cursor is now on the `(` in the second paragraph. This is expected as per the rule above: `}` is an exclusive motion, that causes the cursor to go to column 1 of the blank line between paragraphs 2 and 3; as per the rule, the cursor goes to the previous line (on the full-stop), and the motion becomes inclusive (the full-stop is deleted as part of the `d` operation).

Let's take the original text again, with the cursor again on the `S`.

If i do the following commands - `d{` - in normal mode, i would expect to get the following, because the `{` is an exclusive motion, and it causes the cursor to go to column 1 of the blank line between paragraphs 1 and 2: everything between the full-stop of paragraph 1 and the `S` are deleted, inclusive.

This is just a random paragraphome text inside brackets).

This is a third paragraph.

But what actually happens is this:

This is just a random paragraph.
Some text inside brackets).

This is a third paragraph.

With the cursor being on the `S`.

Is this an exception to the exception? Or am i simply getting it all wrong?

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

Correct syntax for enums in C++

Hi everyone.

I want to correctly highlight enumeration values in a C++ application. I tried several approaches but the only one that worked is a little overkill. So I got here to ask the experts.

Suppose that I have a class named "MyClass". That class declares an enum with several values: "EnumConst1", "EnumConst2", etc. In the syntax file, off course, I added "MyClass" in a keyword group of C++ classes:

syn keyword cppClass MyClass

What I want to do is highlight the enumeration values only when they are typed with the class identifier. Like; "MyClass::EnumConst1". I tried this in the following way:

syn macth cppEnum transparent /\<MyClass::\@<=\i\w*\>/
syn keyword cppEnumValue contained EnumConst1 EnumConst2 containedin=cppEnum

Didn't work. I know that the keyword syntax of "MyClass" have precedence over the match syntax but I thought that using it in a transparent match would not interfere in the highlight of the contained enumeration value, since the operator '\@<=' is only to check the presence of a string before the real match. Writing the match in the following way works:

syn match cppEnumValue /\<MyClass::\@<=\(EnumConst1\|EnumConst2\)\>/

But then the 'MyClass' is not highlighted as cppClass group. Only the numeration values are highlighted. And, for a large list of enumeration values, would be overkill to write matches all over it.

There is a solution to this?

Thanks in advance.

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

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

Saturday, March 28, 2015

which match-highlighting is in effect (if any) at a point in a file?

Hello!

In using :match, :2match, :3match, or matchadd(), one may specify
special highlighting. Any easy way for a vimscript to know which, if
any, highlighting match is active? Such highlighting overrides the
usual syntax highlighting, and I'd like to know what's going on at the
current cursor position.

Thank you,
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: [ANN] Vim for Windows build, contains all 3rd party dependencies

Dan Wierenga wrote:

> On Fri, Mar 27, 2015 at 5:43 AM, Bram Moolenaar <Bram@moolenaar.net> wrote:
>
> >
> > I have been wondering: In this time of fast internet connections and big
> > harddisks: Should we make this all-in-one installation the default?
> > Does that make users happy or will the scream?
> > In other words: who would NOT want this?
> >
> >
> That would be fantastic. This "Single Drop Vim" is missing the console
> version (vim.exe) and its associated .bat files, so while it's a great gvim
> experience, it's still not the total solution.

For the console version there already is a .zip file. Well, you need to
get two files:

9229662 vim74rt.zip V7.4 runtime files
1140124 vim74w32.zip V7.4 bin Windows NT/XP console

Obviously these are outdated. And including this in the "one size fits
all" archive is probably easier.


--
"When I die, I want a tombstone that says "GAME OVER" - Ton Richters

/// 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: Bunch of files loaded ==> convertion into "loaded into single tabs"

Hi Meino and Tim,

2015/3/28(Sat) 21:28:08 UTC+9 Tim Chase:
> On 2015-03-28 11:02, Meino.Cramer@gmx.de wrote:
> > accidentally I have loaded a bunch of files into vim without giving
> > the "-p" option.
> > Is there a way to convert this "loading scheme" (or how can one name
> > that? 8) into the "with separated tabs"-loading scheme without
> > restart vim again?
>
> You could try
>
> :argdo tab sp
>
> (:"sp"lit)

Maybe this might better simple.

:tab all

Best regards,
Hirohito Higashi (a.k.a. h_east)

--
--
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: Bunch of files loaded ==> convertion into "loaded into single tabs"

On 2015-03-28 11:02, Meino.Cramer@gmx.de wrote:
> accidentally I have loaded a bunch of files into vim without giving
> the "-p" option.
> Is there a way to convert this "loading scheme" (or how can one name
> that? 8) into the "with separated tabs"-loading scheme without
> restart vim again?

You could try

:argdo tab sp

(:"sp"lit)

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

Bunch of files loaded ==> convertion into "loaded into single tabs"

Hi,

accidentally I have loaded a bunch of files into vim without giving
the "-p" option.
Is there a way to convert this "loading scheme" (or how can one name
that? 8) into the "with separated tabs"-loading scheme without restart
vim again?

Thank you very much in advance for any help!
Best regars,
Meino

--
--
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: js reference in vim

Le vendredi 27 mars 2015 à 10:13, Егор a écrit:
> Perlusers has perldoc and some vim plugins, like perlsupport, allows to view
> reference about perl keyword in new split. Is there a way to do something
> like this for javascript?

This might not help you much, but anyway. I have this for R (here in
simplified form):

" This is in ftplugin/r.vim.
function! s:RHelp (f)

" Split screen.
silent split R\ Help

" Call to the 'R' command to display help; a bit of string
" manipulation is actually performed on the result, to remove
" formatting of the R help.
exe "0read !R --slave -e '?" . a:f . "'"

" Not necessary, but I have additional things in
" ftplugin/rhelp.vim.
set ft=rhelp

" Set the cursor at the beginning of the file.
call cursor(1, 1)
endfunction

" I now use ':Rhelp keyword'.
com! -buffer -nargs=1 Rhelp call s:RHelp(<q-args>)

This shouldn't be too hard to adapt to JS if you can find a reference
in appropriate form. On that point, I don't know if there exists a JS
doc readable in a terminal.

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.

Friday, March 27, 2015

Re: [ANN] Vim for Windows build, contains all 3rd party dependencies



On Fri, Mar 27, 2015 at 5:43 AM, Bram Moolenaar <Bram@moolenaar.net> wrote:

I have been wondering: In this time of fast internet connections and big
harddisks: Should we make this all-in-one installation the default?
Does that make users happy or will the scream?
In other words: who would NOT want this?


That would be fantastic.  This "Single Drop Vim" is missing the console version (vim.exe) and its associated .bat files, so while it's a great gvim experience, it's still not the total solution.

-Dan


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

js reference in vim

Perlusers has perldoc and some vim plugins, like perlsupport, allows to
view reference about perl keyword in new split. Is there a way to do
something like this for javascript?

--
--
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] Vim for Windows build, contains all 3rd party dependencies

Hi Bram,

Yes that would be a good idea. As mentioned before, the Windows users are really at a disadvantage at times as its not a platform that's as tweakable as Linux. So giving a single drop file with all the goodies plus a zip file would be a great idea. Upgrade Check would be awesome. If it would work out, we would have an official version of "all inclusive" Vim, which would really be great.

On another note, I was just diffing some server side outputs that consisted of about 200 storage devices being checked side by side (before and after reboot). After that I had to do some search and replace. A colleague of mine who used to call me "crazy" for using Vim is now fervently downloading and learning Vim :). The search and replace really badly stumped and hooked him.

Regards,

Pritesh Ugrankar.

On Sat, Mar 28, 2015 at 1:02 AM, Bram Moolenaar <Bram@moolenaar.net> wrote:

Christian Brabandt wrote:

> On Fr, 27 Mär 2015, Bram Moolenaar wrote:
> >
> > Pritesh Ugrankar wrote:
> >
> > > Agreed. The Vim Developers are doing an awesome job. And so are folks
> > > like you who are doing tweaks to it to make it awesome.
> > >
> > > By the way, I tried another setting given in the group:
> > >
> > > set
> > > renderoptions=type:directx,gamma:1.0,contrast:0.2,level:1.0,geom:1,renmode:5,taamode:1
> > >
> > > And the rendering is even better!!
> >
> > I have been wondering: In this time of fast internet connections and big
> > harddisks: Should we make this all-in-one installation the default?
> > Does that make users happy or will the scream?
> > In other words: who would NOT want this?
>
> I haven't tried this, but does it work without installing anything but
> just unzip it somewhere and it will just work™? That is a requirement
> for me, as I have some workstations, where I can't install anything.
>
> Also can we then have a place to download from, that is not
> bitbucket/github as those sites are forbidden for my workstations (Those
> site have been classified as online storage and access is not allowed")

I imagine we provide both a .zip file and an installer.
The .zip file you can unpack in a directory somewhere, then invole
gvim.exe there.  The installer would follow the usual MS-Windows
procedure, so that you can easily uninstall it.

These days we should also have an upgrade check somehow...

--
LAUNCELOT: Isn't there a St. Aaaaarrrrrrggghhh's in Cornwall?
ARTHUR:    No, that's Saint Ives.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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 a topic in the Google Groups "vim_use" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/l8TY2EiXNwk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

Re: [ANN] Vim for Windows build, contains all 3rd party dependencies

Christian Brabandt wrote:

> On Fr, 27 Mär 2015, Bram Moolenaar wrote:
> >
> > Pritesh Ugrankar wrote:
> >
> > > Agreed. The Vim Developers are doing an awesome job. And so are folks
> > > like you who are doing tweaks to it to make it awesome.
> > >
> > > By the way, I tried another setting given in the group:
> > >
> > > set
> > > renderoptions=type:directx,gamma:1.0,contrast:0.2,level:1.0,geom:1,renmode:5,taamode:1
> > >
> > > And the rendering is even better!!
> >
> > I have been wondering: In this time of fast internet connections and big
> > harddisks: Should we make this all-in-one installation the default?
> > Does that make users happy or will the scream?
> > In other words: who would NOT want this?
>
> I haven't tried this, but does it work without installing anything but
> just unzip it somewhere and it will just work™? That is a requirement
> for me, as I have some workstations, where I can't install anything.
>
> Also can we then have a place to download from, that is not
> bitbucket/github as those sites are forbidden for my workstations (Those
> site have been classified as online storage and access is not allowed")

I imagine we provide both a .zip file and an installer.
The .zip file you can unpack in a directory somewhere, then invole
gvim.exe there. The installer would follow the usual MS-Windows
procedure, so that you can easily uninstall it.

These days we should also have an upgrade check somehow...

--
LAUNCELOT: Isn't there a St. Aaaaarrrrrrggghhh's in Cornwall?
ARTHUR: No, that's Saint Ives.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

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