Re: New feature: cursor at the beginning of tab character in normal mode

2008-11-02 Fir de Conversatie Vladimir A . Pavlov

Hi!

I made a patch to the documentation to mention the way to
display the cursor where most popular editors do.

I mention the cursor positioning behaviour in 'list' help node,
put the command in question there and made a link from 'listchars'
node to 'list' one.

I think it's better to put the command in question to 'list'
help node since it's 'list' (not, 'listchars') option's issue
that allows us to do what we want.

P.S. Sorry for being so late, I've been busy this month :(

--
Vladimir

The patch follows (should be applied to just unpacked
vim-7.2.tar.bz2):

diff -Naur vim72.orig/runtime/doc/options.txt vim72/runtime/doc/options.txt
--- vim72.orig/runtime/doc/options.txt  2008-08-09 18:22:59.0 +0400
+++ vim72/runtime/doc/options.txt   2008-11-02 13:45:41.0 +0300
@@ -4331,6 +4331,18 @@
'wrapmargin') when 'cpoptions' includes 'L'.  See 'listchars' for
changing the way tabs are displayed.
 
+   In Normal mode the cursor is displayed at the end of the space a tab
+   character occupies. In List mode it's displayed at the beginning of
+   the space while vim behaves similarly to Normal mode.
+
+   This can be used to make vim display the cursor in Normal mode at the
+   beginning of the space a tab character occupies as it does in Insert
+   mode and as other popular text editors do.
+
+   The following command does this: >
+   :set list lcs=tab:\ \ 
+<  Note a space following the second baskslash.
+
*'listchars'* *'lcs'*
 'listchars' 'lcs'  string  (default "eol:$")
global
@@ -4368,6 +4380,11 @@
"precedes".  "SpecialKey" for "nbsp", "tab" and "trail".
|hl-NonText| |hl-SpecialKey|
 
+   Another probable usage for 'lcs' option is to make vim display the
+   cursor in Normal mode at the beginning of the space a tab character
+   occupies as it does in Insert mode and as other popular text editors
+   do. See |'list'| for details.
+
*'lpl'* *'nolpl'* *'loadplugins'* *'noloadplugins'*
 'loadplugins' 'lpl'boolean (default on)
global


--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: New feature: cursor at the beginning of tab character in normal mode

2008-10-07 Fir de Conversatie Tony Mechelynck

On 06/10/08 21:38, Vladimir A. Pavlov wrote:
> On Sat, 4 Oct 2008 at 02:37 Richard Hartmann wrote:
>> I would suggest adapting the helpfiles to reflect the above, though.
>
> I found the section called "VIEWING TABS" in the chapter 05.7 of the
> standard vim manual. It contains the following:
>
>> :set listchars=tab:>-,trail:-
>
> with the explanation what the setting does. However there is no
> word concerning cursor position there. That chapter seems to be the
> best place to write how to emulate the "standard" cursor behaviour
> in vim. But:
> 1. it would be difficult for a novice who came from another editor
> to find that place and he/she won't probably find the solution of
> the problem. Are there better places?

What about under either or both of ":help 'list'" and ":help 
'listchars'" instead? Wouldn't that be more "discoverable"? (And þese 
options are referenced from that 05.7 section.)

> 2. is the solution in question correct on all platforms/terminals so
> that we are allowed to add such a comment to the help file? It
> works on x86 and x86_64 in xterm and linux terminals but what
> about others?

It works the same way in the GTK2 GUI, and I don't see why it wouldn't 
work the same way in other cases, including not only other Linux GUIs 
and terminals, but also Windows, Mac, Amiga, VMS, whatever...

>
>> Vladimir, I suspect Bram would accept a patch against the help.
>
> Bram, would you?
>
> --
> Vladimir

Best regards,
Tony.
-- 
Please, won't somebody tell me what diddie-wa-diddie means?

--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: New feature: cursor at the beginning of tab character in normal mode

2008-10-06 Fir de Conversatie Richard Hartmann

2008/10/6 Vladimir A. Pavlov <[EMAIL PROTECTED]>:

> 1. it would be difficult for a novice who came from another editor
>   to find that place and he/she won't probably find the solution of
>   the problem. Are there better places?

Agreed. But havin it _somewhere_ is better than nowhere.


> 2. is the solution in question correct on all platforms/terminals so
>   that we are allowed to add such a comment to the help file? It
>   works on x86 and x86_64 in xterm and linux terminals but what
>   about others?

As this is a UI thing and quite basic, I am willing to bet that it will
work everywhere.


> Bram, would you?

He is on holidays, don't expect a quick answer.
Richard

--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: New feature: cursor at the beginning of tab character in normal mode

2008-10-06 Fir de Conversatie Vladimir A . Pavlov

On Sat, 4 Oct 2008 at 02:37 Richard Hartmann wrote:
>
> I would suggest adapting the helpfiles to reflect the above, though.

I found the section called "VIEWING TABS" in the chapter 05.7 of the
standard vim manual. It contains the following:

> :set listchars=tab:>-,trail:-

with the explanation what the setting does. However there is no
word concerning cursor position there. That chapter seems to be the
best place to write how to emulate the "standard" cursor behaviour
in vim. But:
1. it would be difficult for a novice who came from another editor
   to find that place and he/she won't probably find the solution of
   the problem. Are there better places?
2. is the solution in question correct on all platforms/terminals so
   that we are allowed to add such a comment to the help file? It
   works on x86 and x86_64 in xterm and linux terminals but what
   about others?

> Vladimir, I suspect Bram would accept a patch against the help.

Bram, would you?

--
Vladimir

--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: New feature: cursor at the beginning of tab character in normal mode

2008-10-03 Fir de Conversatie Richard Hartmann

On Thu, Oct 2, 2008 at 23:04, Ingo Karkat <[EMAIL PROTECTED]> wrote:

> ':set list listchars=tab:\ \ '

Note the second space after the second \.

I agree with the others that yet another option is overkill.
I would suggest adapting the helpfiles to reflect the above, though.
Vladimir, I suspect Bram would accept a patch against the help.


Richard

--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: New feature: cursor at the beginning of tab character in normal mode

2008-10-03 Fir de Conversatie Ian Kelling

> That seems unexpected to me.
> Cheers,
> Craig

Think about this. Changing it would be unexpected to the vast majority
of vim users. I agree with Bram, this is best left alone.

- Ian
--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



RE: New feature: cursor at the beginning of tab character in normal mode

2008-10-02 Fir de Conversatie Craig Barkhouse

Not to take sides, but just to add my comments...

1) In normal mode, if you have the 'list' option on, the cursor is displayed at 
the beginning of the tab character, not the end.  So now it's not just mode 
that determines it.  If you sit your cursor on a tab character and repeatedly 
toggle the 'list' option (which I actually have a keymapping for), the cursor 
will actually jump back and forth on screen from the beginning of the tab to 
the end.  That seems unexpected to me.

2) As a general question:  If there's a quirk carried forward from original Vi, 
and the general consensus among Vim users is that the quirk is only there for 
strict Vi compatibility and it would make more sense to change it, would it not 
make sense to have it controlled by the 'compatible' option?  Setting 
'nocompatible' already breaks some Vi compliance.  So, yet-another-option would 
not necessarily need to be introduced.

Cheers,
Craig


--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: New feature: cursor at the beginning of tab character in normal mode

2008-10-02 Fir de Conversatie Ingo Karkat

On 02-Oct-08 20:03, Vladimir A. Pavlov wrote:
> Hello!
> 
> A few days ago I wrote the following to [EMAIL PROTECTED]:
> 
>> I'd like to switch to vim but there is an annoying issue with
>> it that I couldn't solve.
>>
>> When the cursor is at a tab character most editors display
>> the cursor at the beginning of the interval the tab character
>> occupies as follows (_ is the cursor):
>>
>> _   if (a > c) ...
>>
>> Vim does the same in insert or replace mode. But in normal
>> mode the cursor is displayed at the end of the tab character:
>>
>>_if (a > c) ...
>>
>> Is there a way to make vim show the cursor at the beginning
>> of a tab character in normal mode as it does in insert mode?
>>
>> I tried searching in Google but found nothing unfortunatelly :(
> 
> Then I got a reply that said it's impossible without vim code
> modification so I decided to find out how to fix that.
> 
> I seem to find the solution (the patch is at the end of this
> email) but it is so simple that I can't understand why it hasn't
> been done yet (since I know several people that are irritated by
> this "feature" of vim).
> 
> I guess this mailing list is the best place to ask whether I
> miss anything. Here are my questions:
> 
> 1. Are there any obvious problems/bugs with the patch itself?
>In other words, does it breaks anything very "basic" so
>that it definitely breaks some basic functionality or
>some plugins?
> 
> 2. If there are no problems with it, do you have any wishes to
>apply it to the trunk? (And what the reasons for not doing
>so?)
> 
>If so, I would add an option called, say, cursorattabstart
>that will trigger the new behaviour and resend the patch
>here for anyone of you to commit.
> 
> --
> Vladimir

When 'list' is set, the cursor stays at the beginning of a  interval, too. 
So you could achieve the same effect with these settings:
 ':set list listchars=tab:\ \ '
Of course, you would lose the functionality of ':set invlist'; but you can 
probably define an alternative command / mapping that now will toggle the 
'listchars' option.

-- regards, ingo

--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: New feature: cursor at the beginning of tab character in normal mode

2008-10-02 Fir de Conversatie Bram Moolenaar


Vladimir A. Pavlov wrote:

> A few days ago I wrote the following to [EMAIL PROTECTED]:
> 
> > I'd like to switch to vim but there is an annoying issue with
> > it that I couldn't solve.
> > 
> > When the cursor is at a tab character most editors display
> > the cursor at the beginning of the interval the tab character
> > occupies as follows (_ is the cursor):
> > 
> > _   if (a > c) ...
> > 
> > Vim does the same in insert or replace mode. But in normal
> > mode the cursor is displayed at the end of the tab character:
> > 
> >_if (a > c) ...
> > 
> > Is there a way to make vim show the cursor at the beginning
> > of a tab character in normal mode as it does in insert mode?
> > 
> > I tried searching in Google but found nothing unfortunatelly :(
> 
> Then I got a reply that said it's impossible without vim code
> modification so I decided to find out how to fix that.
> 
> I seem to find the solution (the patch is at the end of this
> email) but it is so simple that I can't understand why it hasn't
> been done yet (since I know several people that are irritated by
> this "feature" of vim).
> 
> I guess this mailing list is the best place to ask whether I
> miss anything. Here are my questions:
> 
> 1. Are there any obvious problems/bugs with the patch itself?
>In other words, does it breaks anything very "basic" so
>that it definitely breaks some basic functionality or
>some plugins?

The way it works is intentional.  It's how Vi has always worked.  I have
no intention to change it.

Now we could start a long discussion about yet another option...  Keep
in mind that switching this option on would have the risk of breaking
some plugins and making users wonder why Vim doesn't behave as expected.

> 2. If there are no problems with it, do you have any wishes to
>apply it to the trunk? (And what the reasons for not doing
>so?)

I haven't tried it, but I would suspect there are a few more places to
change.

>If so, I would add an option called, say, cursorattabstart
>that will trigger the new behaviour and resend the patch
>here for anyone of you to commit.

-- 
You cannot have a baby in one month by getting nine women pregnant.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---