Putty + Vim + Alt Keys

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)

Fausto Branco

Posted 2017-11-24T15:19:40.747

Reputation: 91

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 – 2018-11-19T12:51:45.840

Answers

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

Fausto Branco

Posted 2017-11-24T15:19:40.747

Reputation: 91