On Monday, December 23, 2013 5:04:14 AM UTC-6, Matteo Cavalleri wrote:
> I'm trying to integrate ag in my workflow, i.e. stop switching to a shell to 
> grep and then going back to vim ;)
> 
> I first started to simply use :Ggrep (from fugitive) but the "press enter to 
> continue" message made me add another plugin to my vimrc, so I'm now trying 
> to use ag.vim
> 
> there's one thing though that confuses me a bit... I've configured vim to 
> automatically fold php files when i load them. when I press <cr> in the 
> quickfix window, vim loads the file and unfold the code as needed to show the 
> line I've jumped to, and that's fine. however if i presso "o" or "go" (two 
> maps defined by the plugin), vim loads the file but doesn't unfold the code. 
> given the fact that "o" is simply defined as:
> 
> nnoremap <silent> <buffer> o  <CR>
> 
> i don't understand why there's no unfolding here...

There's no unfolding here because the 'foldopen' option controls which actions 
open folds. Although this option includes "quickfix" by default, this option is 
also ignored when inside a mapping. From the help:

                                                *'foldopen'* *'fdo'*
'foldopen' 'fdo'        string (default: "block,hor,mark,percent,quickfix,
                                                             search,tag,undo")
                        global
                        {not in Vi}
                        {not available when compiled without the |+folding|
                        feature}
        Specifies for which type of commands folds will be opened, if the
        command moves the cursor into a closed fold.  It is a comma separated
        list of items.
        NOTE: When the command is part of a mapping this option is not used.
        Add the |zv| command to the mapping to get the same effect.

-- 
-- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to