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

s:setup_vinegar() seems never to be triggered #70

Closed
kiryph opened this issue Jun 21, 2016 · 1 comment
Closed

s:setup_vinegar() seems never to be triggered #70

kiryph opened this issue Jun 21, 2016 · 1 comment

Comments

@kiryph
Copy link
Contributor

kiryph commented Jun 21, 2016

I was trying to solve #69 myself. However, a simple move of let g:netrw_hide_list = ... to s:setup_vinegar() does not work.

I have observed in general that a simple echo message in s:setup_vinegar() is never listed in :messages

function! s:setup_vinegar() abort
  echo "Updating g:netrw_list_hide within s:setup_vinegar()"
  let g:netrw_list_hide =
      \ join(map(split(&wildignore, ','), '"^".' . s:escape . '. "$"'), ',') . ',^\.\.\=/\=$' .
      \ (get(g:, 'netrw_list_hide', '')[-strlen(s:dotfiles)-1:-1] ==# s:dotfiles ? ','.s:dotfiles : '')

Addition

Following the discussion of
http://vi.stackexchange.com/questions/7890/how-to-display-line-number-in-netrw

au FileType netrw set nu does not work, but a special netrw variable (available in recent netrw versions) let g:netrw_bufsettings = 'noma nomod nu nobl nowrap ro'

So I am wondering whether vinegars autocmd does work

augroup vinegar
  autocmd!
  autocmd FileType netrw call s:setup_vinegar()
augroup END

A simple change to

augroup vinegar
  autocmd!
  autocmd FileType netrw echom "Greetings from augroup vinegar"
augroup END

,as far as I can confirm, does not change anything.

Following calls a custom function only when entering a file from netrw not when entering a netrw window.

fun! MyFuncRef()
    echom "Greetings from netrw_funcref"
endfun
let g:Netrw_funcref= function("MyFuncRef")

vim version: 7.4.1831
netrw version: v156

@kiryph
Copy link
Contributor Author

kiryph commented Jun 22, 2016

Resolved this issue, netrw has an autocommand which silence messages.

function! s:setup_vinegar() abort
  unsilent echo "Updating g:netrw_list_hide within s:setup_vinegar()"

@kiryph kiryph closed this as completed Jun 22, 2016
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

No branches or pull requests

1 participant