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

Is it possible to configure options locally (on a per buffer basis) ? #368

Open
lyndhurst opened this issue Sep 3, 2021 · 3 comments
Open

Comments

@lyndhurst
Copy link

Hi,
I am using vim-pandoc along with vimwiki, and it is mostly working as expected so far.

I have the "conceal url" option set to 0 globally to avoid the erratic wrapping it causes, but I wanted to enable it for the vimwiki index pages since they consist mostly of list items made of links, it would improve the visual.

Unfortunately, I could not find a way in the documentation to set vim-pandoc-syntax options locally whereas vim-pandoc mentions the possibility to use the let b:pandoc... local variables to do so.

I am aware of the s:WithConceal() function, but for what I understood, it is designed to set up new specific concealment rules.

Since my index pages are all named index.wiki, I tried the following, but received an illegal variable error message:

augroup wiki_index_files
    autocmd!
    autocmd BufRead,BufNewFile */index.wiki
                \ setlocal nofoldenable |
                \ let b:pandoc#syntax#conceal#urls = 1
augroup END
@fmoralesc
Copy link
Member

I don't think there is a local version of the conceal#urls setting, that would have to be implemented (need to think about how that would work).

@user202729
Copy link

Making an autocmd command that checks the path of the current file and set the variable accordingly should work, as long as it's executed before the pandoc syntax file is loaded.

Because in vim :syn commands are already buffer-local.

@lyndhurst
Copy link
Author

Making an autocmd command that checks the path of the current file and set the variable accordingly should work, as long as it's executed before the pandoc syntax file is loaded.

Thanks user202729, setting the global g:pandoc#syntax#conceal#urls with an autocmd does work, but then, all other pandoc files are affected too, I am trying to target index files only.

I don't think there is a local version of the conceal#urls setting, that would have to be implemented (need to think about how that would work).

Thank you fmoralesc, I look forward to it.

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

3 participants