K
K
Karina2017-02-16 22:25:59
vim
Karina, 2017-02-16 22:25:59

How to map a keyboard shortcut to resize a window?

I want to map keys on window resize

nnoremap <silent> <Leader>[ :exe "resize " . (winheight(0) * 3/2)<CR>
nnoremap <silent> <Leader>] :exe "resize " . (winheight(0) * 2/3)<CR>

I enter: ctrl ]
and error
E433: No tags file
E426: tag not found: name
at the beginning of the file, I
set nocompatible
tried to do this, but it does not help.
set tags=./tags,tags
or writes:
No identifier under cursor
Thank you all

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Masterov, 2017-02-17
@AlexMasterov

Enter: ctrl ]

Many types of files use this combination <C-]>to navigate through "tags".
You can find out the existence and source of such a map using the verbose command :
:verbose map  <C-]>
:verbose nmap <buffer>

There are several ways to get around this; prevent default settings from being set or override them after.

N
nekipelov, 2017-02-20
@nekipelov

Try using the sequence \ and [ or ] . The ctrl
key (like shift, alt) cannot be Leader. By default, Leader character is \ .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question