Troskyvs
Troskyvs

Reputation: 8047

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?

Upvotes: 2

Views: 5428

Answers (1)

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

Upvotes: 11

Related Questions