2

I'm using Putty (on Windows) to access Ubuntu Servers, I work a lot with Vim (split and Vsplit) and I'm trying to map :wincmd ? commands with Alt + Arrows. Something like this:

nmap <silent> <A-Up> :wincmd k<CR>
nmap <silent> <A-Down> :wincmd j<CR>
nmap <silent> <A-Left> :wincmd h<CR>
nmap <silent> <A-Right> :wincmd l<CR>

Obviously don't work with Putty, using directly in bash (debian, ubuntu, etc) its fine.... Is there any way to work with putty + vim?

Or map :wincmd like Tmux (Ctrl+B Arrows)

  • I have the exact same problem and have been unable to find a solution so far. Mapping <M-arrow> in tmux works just fine but vim does not accept it. Doesn't accept any Alt-mapping as far as I can tell... – anorm Nov 19 '18 at 12:51
0

For now, I've only been able to configure same the Tmux shortcut keys, which is already good

Ctrl+B + Arrows

vim ~/.vimrc

colorscheme desert
set nowrap
set expandtab
set tabstop=4
noremap <C-b><Up> :wincmd k<cr>
noremap <C-b><Down> :wincmd j<cr>
noremap <C-b><Left> :wincmd h<cr>
noremap <C-b><Right> :wincmd l<cr>

To test:

On vim:

:vsplit :split

Will open 3 panels... So Press Ctrl+B + Arrows to navigate.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.