Re: Vim 7 pre-announcement

2006-05-07 Thread Linsong

Bram Moolenaar wrote:


Vim 7 is out!

 

Thanks for you guys's excellent work!  Vim has saved me a lot and now 
vim7 is even better! I wish vim becoming better and better!


Thanks again! :)

Best regards,
Vincent


Re: some problem with vim7f Beta

2006-04-26 Thread Linsong

Martin Stubenschrott wrote:


On Wed, Apr 26, 2006 at 10:35:30AM +0800, Linsong wrote:

 

My main point is: I don't want to select entry in the completion menu by 
pressing CTRL-N or CTRL-P, instead, I want to input enough characters to 
make correct entry  become the first entry and it is highlighted, then I 
can use CTRL-Y(yes, I have mapped Enter to CTRL-Y since I am tempted 
to use Enter) to confirm the completion.
   



Then just :inoremap C-Y C-NC-Y 
That should should do what you expect now (untested).
 


Thanks, martin, it works well.


I really disliked old behavior, and think the current completion with
'longest' and ctrl-n is what it should behave like since it's more
logical as you only need c-xc-o and c-n and not yet another key like
c-y.
 

But I am still not very clear why the first entry in the menu is not 
highlighted? Is it not reasonable?  I don't get any point that 
highlighting the first entry will make the behavior unreasonable. I 
think there shoud be an very good reason and I really want to know. 
Anyone can give some hints?  :)


Thanks a lot!

BR
Vincent







Re: some problem with vim7f Beta

2006-04-26 Thread Linsong

Bram Moolenaar wrote:


Vincent Linsong wrote:

 


This is by design.  Some people mentioned that when using the longest
common string the first entry should not be selected.  Now you can use
CTRL-N to select the first entry.  Previously you would need to do
CTRL-N CTRL-P to get the first entry.

 


 I use the omnicompletion like this:
 I set completeopt=menu,preview,longest . Now consider I input some 
characters of a function's name, for example, the function's name is 
'helloWorld' and I input 'hel'. I am not glad to remember the exact 
function name, so I invoke omnicompletion by C-XC-O, then I know 
what is the exact name of the function, instead of press C-N or C-P 
multiple times to select it from the menu, I choose to input more 
characters and when function's name becomes the top entry on the menu, I 
will press C-Y to accept it. I think this way is very convenient and I 
know many intelligence like tools works in this way.
 If others have enough reason to change the behavior, would you like 
to add a new option to make two ways work ?  Thanks a lot!
   


I think the current behavior is best for most people.  For you, instead
of pressing CTRL-Y you can use CTRL-N and continue typing, that normally
stops completion.
 

If I press CTRL-N, then what I inputed will be replaced with the first 
entry of the completion menu, but that is not what I want.
   



I don't get it.  


Sorry, my words is a little confusing.


You type characters until the function you were looking
for is the first match.  Then CTRL-N will select that match and you're
done.
 

In fact, I input more characters until the function I am looking for is 
the the first match, under this case, I want to select the first match 
and make the menu disappear(why? because to my impression, the 
completion is not done until I select some entry and the completion menu 
disappears). But now I have to press CTRL-N CTRL-E to do so, that is not 
very convenient.


Yes, I can make a map make it easier, for example I have the following 
match:

if exists('*pumvisible')
   inoremap Enter C-R=pumvisible() ? \ltC-y : 
\ltEnterCR

endif
   It works very well under vim7d Beta with 
completeopt=menu,preview,longest, this map just makes Enter as the 
confirm key instead of C-Y since I am tempted to use Enter as the 
confirm key. It works in the following two cases:
   case 1: I input charactes and when the first match is what I want, I 
just press Enter to confirm, what I inputed is completed and the 
completion menu disappear
   case 2: I use CTRL-N or CTRL-P to change the highlighted entry to 
the one I want, then I press Enter to confirm.
   But in vim7f Beta, since the first match has not been highlighted 
any more, the map does not work in case 1. I can modify it a little to 
make it work:

   if exists('*pumvisible')
   inoremap Enter C-R=pumvisible() ? \ltC-n\ltC-y : 
\ltEnterCR

   endif
  But it will not work in case 2. I can not work out a way to make it 
work in case 1 and case 2.
  I know what is the reason of the change between vim7f and vim7d and I 
think it is very reasonable. But I still suggest there should be an 
option to highlight the first match of completion menu.


Thanks.

BR
Vincent
   


There is a conflict between saying that the top entry of the menu is the
one you want and CTRL-N not getting what you want.
 






Re: some problem with vim7f Beta

2006-04-25 Thread Linsong

Bram Moolenaar wrote:


Vincent Linsong wrote:

 


   I just try the fresh vim7f Beta on my ubuntu box, found some problems:
   1. the behavior of omnicompletion is changed  
   I set

  completeopt=menu,preview,longest
   in vim7d beta, when I input something then press C-XC-O, the 
completion menu shows up, then as I input more characters, the content 
of the completion menu is changed and the first entry in the menu is 
highlighted. But in vim7f, all things work except the first entry is not 
highlighted. Is it a bug or a design?
   



This is by design.  Some people mentioned that when using the longest
common string the first entry should not be selected.  Now you can use
CTRL-N to select the first entry.  Previously you would need to do
CTRL-N CTRL-P to get the first entry.
 


  I use the omnicompletion like this:
  I set completeopt=menu,preview,longest . Now consider I input some 
characters of a function's name, for example, the function's name is 
'helloWorld' and I input 'hel'. I am not glad to remember the exact 
function name, so I invoke omnicompletion by C-XC-O, then I know 
what is the exact name of the function, instead of press C-N or C-P 
multiple times to select it from the menu, I choose to input more 
characters and when function's name becomes the top entry on the menu, I 
will press C-Y to accept it. I think this way is very convenient and I 
know many intelligence like tools works in this way.
  If others have enough reason to change the behavior, would you like 
to add a new option to make two ways work ?  Thanks a lot!


BR
Vincent

 


   2. one problem with syntax highlight
  Open help by :help command, the '|' is missing, that is 
|usr_01.txt| now becomes usr_01.txt. This happens in mud colorscheme, 
but does not occur in desert colorscheme. Maybe this is a problem of the 
colorscheme, but it works well before(at least in vim7d and vim6.x). It 
means there is something about syntax highlight changed in vim7f. Is it 
intended? 
   



This is intentional.  The || characters mark tags, but can make it more
difficult to read the command being explained.

 





Re: some problem with vim7f Beta

2006-04-25 Thread Linsong

Bram Moolenaar wrote:

Hi, Bram
  Thanks for your reply!


Vincent Linsong wrote:

 


This is by design.  Some people mentioned that when using the longest
common string the first entry should not be selected.  Now you can use
CTRL-N to select the first entry.  Previously you would need to do
CTRL-N CTRL-P to get the first entry.
 


  I use the omnicompletion like this:
  I set completeopt=menu,preview,longest . Now consider I input some 
characters of a function's name, for example, the function's name is 
'helloWorld' and I input 'hel'. I am not glad to remember the exact 
function name, so I invoke omnicompletion by C-XC-O, then I know 
what is the exact name of the function, instead of press C-N or C-P 
multiple times to select it from the menu, I choose to input more 
characters and when function's name becomes the top entry on the menu, I 
will press C-Y to accept it. I think this way is very convenient and I 
know many intelligence like tools works in this way.
  If others have enough reason to change the behavior, would you like 
to add a new option to make two ways work ?  Thanks a lot!
   



I think the current behavior is best for most people.  For you, instead
of pressing CTRL-Y you can use CTRL-N and continue typing, that normally
stops completion.
 

If I press CTRL-N, then what I inputed will be replaced with the first 
entry of the completion menu, but that is not what I want.


I don't know other tools that use CTRL-Y... 

I think my sentence is a little confusing. I don't mean CTRL-Y is very 
common but the way to use completion.



You might be tempted to hit
Enter to accept the current match, we had that discussion before.
That kind of use simply doesn't go well with longest.

My main point is: I don't want to select entry in the completion menu by 
pressing CTRL-N or CTRL-P, instead, I want to input enough characters to 
make correct entry  become the first entry and it is highlighted, then I 
can use CTRL-Y(yes, I have mapped Enter to CTRL-Y since I am tempted 
to use Enter) to confirm the completion.


Thanks again.

Best regards,
Vincent






some problem with vim7f Beta

2006-04-24 Thread Linsong

Hi,
   I just try the fresh vim7f Beta on my ubuntu box, found some problems:
   1. the behavior of omnicompletion is changed  
   I set

  completeopt=menu,preview,longest
   in vim7d beta, when I input something then press C-XC-O, the 
completion menu shows up, then as I input more characters, the content 
of the completion menu is changed and the first entry in the menu is 
highlighted. But in vim7f, all things work except the first entry is not 
highlighted. Is it a bug or a design?

   2. one problem with syntax highlight
  Open help by :help command, the '|' is missing, that is 
|usr_01.txt| now becomes usr_01.txt. This happens in mud colorscheme, 
but does not occur in desert colorscheme. Maybe this is a problem of the 
colorscheme, but it works well before(at least in vim7d and vim6.x). It 
means there is something about syntax highlight changed in vim7f. Is it 
intended? 
  Thanks.


BR
Vincent
 


Re: suggestions for omni-completion

2006-04-19 Thread Linsong

Alan Briolat wrote:


On Wed, 19 Apr 2006 14:25:42 +0800
Linsong [EMAIL PROTECTED] wrote:

 


Alan Briolat wrote:

   


On Wed, 19 Apr 2006 11:51:31 +0800
Linsong [EMAIL PROTECTED] wrote:



 


Hi,
  I have tried the omni competion, it is very cool!
  But there is still one thing that I think is not very convenient. 
For example, when I input part of a function name(foobar):

foo|  (| is the position of the cursor)
  then I invoke the omnicompletion by pressing C-XC-O, consider 
the completion list like this:
   
fooblah

fooblahblah
fooblahblah
foobar
...
...

then the strings inputed will be replaced by the first matched item(here 
it is fooblah). If I want to get foobar, I need to press C-N several 
times. It is not very convenient.
  
   I think it would be better like the following:
   After C-XC-O, the inputed string will not be replaced, only the 
completion menu shows up, then I can choose the item that I want by 
pressing C-N; Or, I can go on to input more characters and the 
completion menu will update its menu items based on the new input when I 
input. So the items in completion menu will become less and less and it 
is easier to select the matched item. Inputing more characters is better 
than pressing C-N several times.
  

   


I *believe* this is the purpose of C-XC-OC-P (someone please correct me
if I am wrong...)


 


Yes, that is just what I mean. I need to go over the online help :)
Do you know how to make it as the default action, that is make 
C-XC-O works like C-XC-OC-P?
   



Well, what I do is map a different key sequence to it.  My preference (doesn't
work in terminals though) is:
:imap C-space C-XC-OC-P

There appears to be only one problem with using C-XC-OC-P, which is that
it makes omni-complete useless when there is only one match (doesn't replace,
and doesn't give a list of options). If someone knows how to overcome this,
please let me know :(
 

I suggest vim to provide a option that don't modify the inputed 
character when pressing C-XC-O.


BR
Vincent



Re: completion menu

2006-04-19 Thread Linsong

Bram Moolenaar wrote:


Georg Dahn wrote:

 

Ok, let's assume there are several completions, such that you get a menu 
with C-N. Then if you move the selection with the cursor keys and 
press Enter, the selected item is being chosen. If you do the same 
with C-N (instead of using cursor keys), Enter inserts a new line. I 
think, this is confusing.


Is this behavior intentional or is it a bug?
   



This is intentional, it was discussed recently.

This is a compromise between different expectations from different
users.  People who used CTRL-N/CTRL-P in Vim 6.4 expect the Enter to
be inserted, since that is what happened in older versions.  People who
are using cursor keys to select an item in the popup menu mostly expect
Enter to accept the selected match.  That's why the behavior of
Enter depends on what you did earlier.
 


Hi,
   I also think here is a little confusing. Since the user are 
selecting menu items with C-N/C-P, and at this time, Enter is 
normally assumed as a confirm of the selection. And I think it is very 
common a user interface convention.
  I think it is worth breaking the compatibility between vim6.x and 
vim7 since there is no completion menu in vim6.x.


Best regards,
Vincent