Re: execute command without adding it to command history

2006-11-04 Thread Yakov Lerner

On 11/4/06, Yegappan Lakshmanan [EMAIL PROTECTED] wrote:

Hi Yakov,

On 11/3/06, Yakov Lerner [EMAIL PROTECTED] wrote:
 On 11/3/06, Yegappan Lakshmanan [EMAIL PROTECTED] wrote:
  Hi Yakov,
 
  On 11/3/06, Yakov Lerner [EMAIL PROTECTED] wrote:
   How do I execute command without adding it to command
   history ? (I need it for the command on the rhs of the mappnig)
  
 
  You can try using call histdel('cmd', -1) after executing a command
  from your map.

 And won't the ':call histdel('cmd', -1)' iself remain in the history then ?


From the help for cmdline-history, commands invoked from maps
will not be added to the history. Are you using a normal or insert or
visual or command-line mode map?

- Yegappan


I have command executed via feedkeys() in rhs of mapping,
and these commands do appear in command history.

Yakov


Re: Getting out of netrw

2006-11-04 Thread Yegappan Lakshmanan

Hi,

On 11/3/06, Jean-Rene David [EMAIL PROTECTED] wrote:

Say I open vim7's new super duper file explorer
netrw to browse some local directory. Say then I
decide I don't want to open any new file and just
want to go back to what I was doing. What would be
the standard way to do that?

I can use C-O to eventually land up where I was
but I need to backtrack all the motion commands I
did in the netrw buffer.

I thought of using :q but that closes vim if only
one window is open.

Am I missing something obvious?



You can try using CTRL-^ to jump to the alternate buffer.

But for some reason, this doesn't work right after starting
up Vim. It works after that.

   $ vim xyz.txt
   :e .

If you press CTRL-^ now to jump to the alternate buffer,
it says, E23: No alternate file. But if you do the following,
then it works.

   $ vim xyz.txt
   :e .
   :e xyz.txt

Now, you can use CTRL-^ to jump between netrw buffer
and xyz.txt file.

This looks like a bug in netrw.

- Yegappan


Re: Getting out of netrw

2006-11-04 Thread A.J.Mechelynck

Bill McCarthy wrote:

On Sat 4-Nov-06 5:40pm -0600, A.J.Mechelynck wrote:


Vim's :quit, :close or :exit commands will close any window, including
special windows like the netrw, options, quickfix, ... windows. So where's
the problem?


Reading the thread, it appears the OP was editing a file and
then started the explorer with something like :edit . -
i.e. he was in a single window.

In that case, :quit or :exit would close down Gvim - not
what he wanted.  :close would generate an error message.

Perhaps simply :bd is more like what he wants?



Well, let him learn split-window commands then: :new . opens the explorer in 
a separate window; or, if you want a File-Explorer-like display on the side, 
:topleft vsplit .; later, :q will close that extra window.



Best regards,
Tony.


Re: Getting out of netrw

2006-11-04 Thread Bill McCarthy
On Sat 4-Nov-06 6:10pm -0600, A.J.Mechelynck wrote:

 Bill McCarthy wrote:
 On Sat 4-Nov-06 5:40pm -0600, A.J.Mechelynck wrote:
 
 Vim's :quit, :close or :exit commands will close any window, including
 special windows like the netrw, options, quickfix, ... windows. So where's
 the problem?
 
 Reading the thread, it appears the OP was editing a file and
 then started the explorer with something like :edit . -
 i.e. he was in a single window.
 
 In that case, :quit or :exit would close down Gvim - not
 what he wanted.  :close would generate an error message.
 
 Perhaps simply :bd is more like what he wants?
 

 Well, let him learn split-window commands then: :new . opens the explorer in
 a separate window; or, if you want a File-Explorer-like display on the side,
 :topleft vsplit .; later, :q will close that extra window.

Good point.  And if wants to work in a full window, then
:tabe . will do that and still close down with :q.

-- 
Best regards,
Bill



Re: Getting out of netrw

2006-11-04 Thread Jean-Rene David
* Gary Johnson [2006.11.04 18:30]:
 When you open file A, then open file B, then
 want to go back to A, you don't do so by
 quitting B--you explicitly open A.

Looking at it that way, it makes good sense.

Thanks again for all the suggestions.

-- 
JR


Re: noimd don't works under linux

2006-11-04 Thread Eddy Zhao


 I tried this on FC2:

:set stl=%{imd}
:inoremap ESC ESC:set imdCR
:nnoremap i :set noimdCRi

The first line (along with my usual :set laststatus=2) means that I can
check my 'imd' setting in the status line.  When I go between Normal and
Insert modes with i and Esc, it changes from 1 to 0 and back, so I
think it is working.



Yes, I get the same result.


 Please try this and see whether you get anything different.  Also,
try it with

$ vim -u NONE
:set nocp

If you get the same results but are still having trouble, then the
problem might be some other setting.

HTH --Benji Fisher



When starting with -u NONE, status line isn't showed.
Is there anything else I can do to locate the problem?

Thanks
Eddy


Re: noimd don't works under linux

2006-11-04 Thread A.J.Mechelynck

Eddy Zhao wrote:


 I tried this on FC2:

:set stl=%{imd}
:inoremap ESC ESC:set imdCR
:nnoremap i :set noimdCRi

The first line (along with my usual :set laststatus=2) means that I can
check my 'imd' setting in the status line.  When I go between Normal and
Insert modes with i and Esc, it changes from 1 to 0 and back, so I
think it is working.



Yes, I get the same result.


 Please try this and see whether you get anything different.  Also,
try it with

$ vim -u NONE
:set nocp

If you get the same results but are still having trouble, then the
problem might be some other setting.

HTH --Benji Fisher



When starting with -u NONE, status line isn't showed.
Is there anything else I can do to locate the problem?

Thanks
Eddy



Enter :set stl=%{imd} ls=2 after starting Vim, and the status line will be 
shown, with 0 ('noimdisable') or 1 ('imdisable') on it.



Best regards,
Tony.


Re: noimd don't works under linux

2006-11-04 Thread Eddy Zhao

2006/11/5, A.J.Mechelynck [EMAIL PROTECTED]:

Eddy Zhao wrote:

  I tried this on FC2:

 :set stl=%{imd}
 :inoremap ESC ESC:set imdCR
 :nnoremap i :set noimdCRi

 The first line (along with my usual :set laststatus=2) means that I can
 check my 'imd' setting in the status line.  When I go between Normal and
 Insert modes with i and Esc, it changes from 1 to 0 and back, so I
 think it is working.


 Yes, I get the same result.

  Please try this and see whether you get anything different.  Also,
 try it with

 $ vim -u NONE
 :set nocp

 If you get the same results but are still having trouble, then the
 problem might be some other setting.

 HTH --Benji Fisher


 When starting with -u NONE, status line isn't showed.
 Is there anything else I can do to locate the problem?

 Thanks
 Eddy


Enter :set stl=%{imd} ls=2 after starting Vim, and the status line will be
shown, with 0 ('noimdisable') or 1 ('imdisable') on it.




Thanks (I forget to set ls).

I do the following
- gvim -u NONE
- :set stl=%{imd} ls=2
- :inoremap ESC ESC:set imdCR
- :nnoremap i :set noimdCRi
- :set nocp
- switching back  forth between normal mode  insert mode using ESC  i

When I pressing i, the input focus is on command line  command line
shows :set noimdCRi.

If I using :nnoremap i :set noimdCRiCR, pressing i get me to
insert mode (with an extra newline). But switching back  forth between
normal mode  insert mode, status line always shows 0

BTW, I discover that in vim (not gvim), even start without -u NONE,
statusline always shows 0 (while gvim statusline will switch between
0  1)

Anything I can do to further nail down the problem?

Thanks
Eddy


Re: noimd don't works under linux

2006-11-04 Thread Eddy Zhao

2006/11/5, A.J.Mechelynck [EMAIL PROTECTED]:

Eddy Zhao wrote:
 2006/11/5, A.J.Mechelynck [EMAIL PROTECTED]:
 Eddy Zhao wrote:
 
   I tried this on FC2:
 
  :set stl=%{imd}
  :inoremap ESC ESC:set imdCR
  :nnoremap i :set noimdCRi
 
  The first line (along with my usual :set laststatus=2) means that I
 can
  check my 'imd' setting in the status line.  When I go between
 Normal and
  Insert modes with i and Esc, it changes from 1 to 0 and back, so I
  think it is working.
 
 
  Yes, I get the same result.
 
   Please try this and see whether you get anything different.
 Also,
  try it with
 
  $ vim -u NONE
  :set nocp
 
  If you get the same results but are still having trouble, then the
  problem might be some other setting.
 
  HTH --Benji Fisher
 
 
  When starting with -u NONE, status line isn't showed.
  Is there anything else I can do to locate the problem?
 
  Thanks
  Eddy
 

 Enter :set stl=%{imd} ls=2 after starting Vim, and the status line
 will be
 shown, with 0 ('noimdisable') or 1 ('imdisable') on it.



 Thanks (I forget to set ls).

 I do the following
 - gvim -u NONE
 - :set stl=%{imd} ls=2
 - :inoremap ESC ESC:set imdCR
 - :nnoremap i :set noimdCRi
 - :set nocp
 - switching back  forth between normal mode  insert mode using ESC 
 i

 When I pressing i, the input focus is on command line  command line
 shows :set noimdCRi.

 If I using :nnoremap i :set noimdCRiCR, pressing i get me to
 insert mode (with an extra newline). But switching back  forth between
 normal mode  insert mode, status line always shows 0

 BTW, I discover that in vim (not gvim), even start without -u NONE,
 statusline always shows 0 (while gvim statusline will switch between
 0  1)

 Anything I can do to further nail down the problem?

 Thanks
 Eddy


- Is your console Vim compiled with IM support? (I suppose it is, but check
the :version output for +xim or +multi_byte_ime). Note: On Unix-like
systems, IM support may require X11 support, and IM functionality may require
access to an X server (thus, maybe in xterm displaying through X, not in
/dev/tty which has no access to X).

- Does it make any difference if you start Console Vim in 'nocompatible' mode,
e.g.

vim -u NONE -i NONE -N +set stl=%{imd} ls=2

?



Hi Tony,

I only using IM in gvim. So I only want IM work correctly in gvim.
gvim is with +xim support.

Thanks
Eddy