mileszs / ack.vim

Vim plugin for the Perl module / CLI script 'ack'
Other
3.08k stars 396 forks source link

Fast close #7

Closed bitboxer closed 14 years ago

bitboxer commented 14 years ago

Is it possible to close the split window with a simple keystroke ? e.g. esc ?

mileszs commented 14 years ago

ack.vim uses Vim's quickfix window (http://vimdoc.sourceforge.net/htmldoc/quickfix.html). You could map a key to close the quickfix window via the command :ccl . For instance:

map :-) :ccl<ENTER>

I do not plan to build such a command into ack.vim, as I'd rather not usurp default quickfix window behavior for users who may not want such a thing, and I don't want to clobber a key that might be assigned to something that someone already uses.

Does that make sense?

bitboxer commented 14 years ago

It makes sense not to map a key to that, but in Ack.vim I can press escape and in NERDTree I can press q to close the window. That's not a complete binding, that key is only available when navigating in that window.

mileszs commented 14 years ago

Interesting. Perhaps I'll look into it at some point. I'm no vim-script expert, unfortunately. You're welcome to have at it yourself, as well. ;-)

bitboxer commented 14 years ago

I updated the ack.vim and sent you a pull request. Hope you like it. Pressing q in the Ack buffer will close the window

mileszs commented 14 years ago

Damn! I go to lunch, and the feature is finished before I get back! It looks like it was pretty simple, too. (Not to diminish your efforts, which I greatly appreciate.) Thanks!

bitboxer commented 14 years ago

Yeah, one of the good things that come out of timezones :) . I will cook my dinner now.

With that method you can also add #3

hafeyang commented 7 years ago
" Ecs to close quickfix window
nnoremap <silent> <ESC> :ccl<CR>