Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no setlocal foldopen or ...close as explained in the Vim doc. #138

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

Konfekt
Copy link
Contributor

@Konfekt Konfekt commented Jul 9, 2014

To prevent messing up user settings, disable it for good.

To preserve this functionality, how about adding the following to plugin/ack.vim ?

autocmd BufReadPost quickfix call s:qfEnter()
autocmd WinLeave * call s:qfLeave()
function! s:qfEnter()
  let g:oldfc=&foldclose
  let g:oldfo=&foldopen
  set foldclose=all
  set foldopen=all
endfunction
function! s:qfLeave()
  if &filetype!='qf'
    return
  endif
  set foldclose=g:oldfc
  set foldopen=g:oldfo
endfunction

However, I'd propose instead adding nnoremap <buffer> x zx to ftplugin\qf.vim for convenient fold toggling.

EPNGH added 2 commits July 9, 2014 20:40
If insist on this functionality, try adding
```
autocmd BufReadPost quickfix call s:qfEnter()
autocmd WinLeave * call s:qfLeave()
function! s:qfEnter()
  let g:oldfc=&foldclose
  let g:oldfo=&foldopen
  set foldclose=all
  set foldopen=all
endfunction
function! s:qfLeave()
  if &filetype!='qf'
    return
  endif
  set foldclose=g:oldfc
  set foldopen=g:oldfo
endfunction
```
to `plugin\ack.vim`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant