Saturday, November 30, 2013

Re: Location list autocommand

I managed to accomplish what I wanted with the following:

au! BufWinEnter quickfix nnoremap <silent> <buffer> q :cclose<cr>:lclose<cr>

Since there seems to be no way to distinguish a quickfix from a
location-list I just execute both commands and it works as
expected(the other one is just silently ignored)

In any case thanks for your help

On Sat, Nov 30, 2013 at 5:20 PM, Ben Fritz <fritzophrenic@gmail.com> wrote:
> On Saturday, November 30, 2013 6:51:45 AM UTC-6, Thiago de Arruda wrote:
>> Could you give an example? My requirement is very simple: I want to
>>
>> bind the letter 'q' to ':lclose<cr>' for location-list and to
>>
>> ':cclose<cr>' do I can use 'q' to quickly close quickfix or
>>
>> location-list(both have filetype qf). As I said I managed to do it for
>>
>> quickfix, not for location-list
>>
>>
>
> Example:
>
> autocmd BufWinEnter * if &ft=="qf" | echomsg "I'm in quickfix!" | endif
>
> This seems to work for me. Replace echomsg with your desired mapping. Make sure you make the mapping buffer-local.
>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: