> I use Vim principly for coding interpreted languages. I usually don't use the
> Vim terminal because I like to examine my code as the program is running.
> Thought I might use a second instance of vim (as a terminal) if I can find a
> way to cycle through the command history without using the arrow keys - I
> can't reach them easily on my laptop.

I'm not sure where you want to do this cycling...in your shell, 
or in Vim.

In bash-like shells, you can use control+p (previous) and 
control+n (next) to go backwards/forwards in your command-line 
history.  You can also use control+R to search for matching text 
(once you've typed some text, you can hit control+R to search 
again further back in your history).  You can also change the 
behavior of the bash command-line by issuing

   bash$ set -o vi

However, even as a long-time vi/vim user I still find this 
unwieldy in bash, so I don't bother.  I think it boils down to 
what I'm doing:  in vi/vim, I spend most of my time *editing* 
text; while at the bash prompt, I spend most of my time 
*entering* [commands as] text with very little time spent editing 
them.

If you're working within Vim, you can use control+P and control+N 
as well (as long as you're not in the middle of a wildchar 
expansion).  You can also use "q:" to bring up the command-line 
history window where you can navigate it with your usual suite of 
Vim commands (including normal-mode, command-line mode, and 
insertion/replace mode).  If you're in the middle of entering a 
command line and want to consult a previous one (perhaps to pull 
a piece of it) you can use control+F to get the same command-line 
window.

   :help c_ctrl-p
   :help c_ctrl-n
   :help cmdwin
   :help 'cedit'

Additionally, if you always want the behavior of the arrow-keys 
(not dependent on wildchars), you can remap them like

   :cnoremap <c-p> <up>
   :cnoremap <c-n> <down>

(I also like to add emacs-like bindings for <c-a> and <c-e> to 
their analogous <home> and <end> to make navigating my 
vim-command-line a bit faster)

Hope this helps,

-tim





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

Reply via email to