On Sun, Nov 06, 2011 at 08:20:22AM EST, Clark J. Wang wrote: > On Sat, Nov 5, 2011 at 4:30 AM, Jostein Berntsen <jber...@broadpark.no>wrote: > > > On 02.11.11,13:42, Clark J. Wang wrote:
> > > In vim, all windows (created by :split and :vsplit commands) are > > > numbered as 1, 2, 3, ... and we can include the window number in > > > 'statusline'. If I want to go to window 3 I can type 3<ctrl-w>w > > > which is very convenient. And I make it even more convenient with > > > following mappings: > > > > > > nnoremap <silent> g1 1<C-W>w > > > nnoremap <silent> g2 2<C-W>w > > > nnoremap <silent> g3 3<C-W>w > > > nnoremap <silent> g4 4<C-W>w > > > nnoremap <silent> g5 5<C-W>w > > > nnoremap <silent> g6 6<C-W>w > > > nnoremap <silent> g7 7<C-W>w > > > nnoremap <silent> g8 8<C-W>w > > > nnoremap <silent> g9 9<C-W>w > > > > > > Is that possible with regions (created by :split command) in screen? > > > > > > > Would something like this work for you? > > > > http://aperiodic.net/screen/commands:focus > > > > > Yes I already know the focus command but it requires quite a few of > key strokes when moving between >2 regions. Would be much easier if > I can focus a region by its number. Personally, since I rarely (if ever) have more than four sub-windows, with one vertical and one horizontal split, either in Vim or in GNU/screen, I always (and only) use <C-A> ¹ + <h,j,k,l> to move quickly between regions. Maybe this does not sound quite as effective (at least in theory, see note below) as jumping directly to a given sub-window, but I find that since the keyboard actions are almost identical in both Vim and screen, I am able to navigate between sub-windows with no overhead. Here's what I added to my .screenrc: bind j focus down bind k focus up bind h focus top bind l focus bottom bind o only Not exactly what you were asking, but this "solution" meets my requirements of having (somewhat) consistent keyboard actions across the environments that I use on a regular basis. CJ ¹ white lie: I really use <CTRL + spacebar> as my command key combo, actioning CapsLk (remapped to Control) with my left pinkie and the spacebar with my right thumb, so that I don't even have to move my fingers off the home row. Even when I have to to a "<C-SB> + J" followed by a "<C-SB> + L" to move diagonally, I still find it less of a hassle than having to *think* of the correct digit/number *and* reach for the corresponding key in the top row of the keyboard.