Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VIM: how to set the window size of quickfix window?

I've set hotkey for opening quickfix window in my ~/.vimrc like this:

map <F9> vertical botright copen

(1) It works, But the window size is too narrow, how can I set the qfix window size to 60 within the same "map" statement? I don't wish to type extra commands after

(2) If I open it horizontally like

map <F10> copen

By default the quickfix window is 10 lines in hightly. How to set this size to 40, within the same "map" statement?

like image 419
Troskyvs Avatar asked Dec 13 '25 21:12

Troskyvs


1 Answers

Try with these mappings:

noremap <F9>  :execute "vertical botright copen \| vertical resize 60"<cr>
noremap <F10> :execute "copen \| resize 40"<cr>

Edit:

As @romaini stated in comment you still can achieve that effectively via:

noremap <F9> :vertical botright copen 60<cr>
noremap <F10> :copen 40<cr>

See :help copen

like image 191
Meninx - メネンックス Avatar answered Dec 16 '25 21:12

Meninx - メネンックス



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!