> It appears I've been to clever for my own good. I mapped the q
> key to :q<CR> - which permits me to simply type q to quit.
> 
> However, I discovered that the q: (q colon) is the keystroke
> to bring up the the command history window.
> 
> So - my question is - is there a way to tell vim to
> momentarily ignore the mappings and use the original
> keystroke. (this would be similar to using the backslash in
> shell to instruct the shell to ignore aliases).
> 
> Or - perhaps there's a smarter quit mapping or a smarter q:
> mapping?

As usual, there are a number of ways to go.  You can access the
command-line history window with <c-f> (or, if you've overridden
your 'cedit' setting, whatever you used

   :help 'cedit'

) while you're already in the command-line, so you can just learn
it as

   :<c-f>

Alternatively, you can map both:

   :nnoremap q :q<cr>
   :nnoremap q: q:

(you may also want to do similarly for "q/" and possibly "q?" for
the search history window)  This does introduce a momentary pause
  (associated with your 'timeoutlen' setting) while it waits to
see if you've hit ":" or not.

As yet one more alternative, you can tweak your mapping to

   :nnoremap q<cr> :q<cr>

so using 2 keys "q<cr>" instead of just the one "q" allows Vim to
disambiguate between your intentions.

As a last alternative, you can always use something else to
access the functionality of "q:"...

   :nnoremap q :q<cr>
   :nnoremap <f4> q:

moving the "q:" functionality to <f4> instead.

Hope this gives you enough options to find one you like :)

-tim









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

Reply via email to