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

Feature: VimwikiVar to list, get and set variables #988

Merged
merged 1 commit into from
Aug 18, 2020

Conversation

tinmarino
Copy link
Member

@tinmarino tinmarino commented Aug 18, 2020

This PR comes with a big code refaction in vars.vim. Especially for syntaxlocal variables.

VimwikiVar outputs

Screenshot-2020-08-17-22_00_05

VimwikiVar Completion

without arglead, with arglead and for the second argument, the value of the variable

Screenshot-2020-08-17-22_00_39

In a few commits, more refaction, features and syntaxlocal variables names, tests => a permanent solution for #892 will be provided and #894 may be closed.

@tinmarino tinmarino force-pushed the merge_vars branch 2 times, most recently from 93cd5b9 to 916d77c Compare August 18, 2020 02:47
Refaction:
- Add g:vimwiki_syntax_list to set syntaxlocal variables
- Delete: syntax/vimwiki_markdown.vim and friends
- Change: vimwiki_syntax_variables -> vimwiki_syntaxlocal_vars for consistency
- Include: some doc in design notes
@tinmarino
Copy link
Member Author

It should be good for a first shot. Many exported but non documented variables such as these are not ready to use:

        \ 'bold_match': {'type': type(''), 'default': '\%(^\|\s\|[[:punct:]]\)\@<=\*__Text__\*\%([[:punct:]]\|\s\|$\)\@='},
        \ 'bold_search': {'type': type(''), 'default': '\%(^\|\s\|[[:punct:]]\)\@<=\*\zs\%([^*`[:space:]][^*`]*[^*`[:space:]]\|[^*`[:space:]]\)\ze\*\%([[:punct:]]\|\s\|$\)\@='},
        \ 'bullet_types': {'type': type([]), 'default': ['-', '*', '#']},
        \ 'header_match': {'type': type(''), 'default': '^\s*\(=\{1,6}\)=\@!\s*__Header__\s*\1=\@!\s*$'},
        \ 'header_search': {'type': type(''), 'default': '^\s*\(=\{1,6}\)\([^=].*[^=]\)\1\s*$'},

Note that the exported format will often look like that: it permits to group pre and post markers.
Alos, a solution to group search and match must be designed. And this kind of format can be extended to a list if many format types are allowed.

        \ 'tag_format': {'type': type({}), 'default': {
        \   'pre': '^\|\s',
        \   'pre_mark': ':',
        \   'in': '[^:''[:space:]]\+',
        \   'sep': ':',
        \   'post_mark': ':',
        \   'post': '\s\|$',
        \   'conceal': 0, 'cchar':''}},

And after all that, maybe we can let user choose between different link formats as #892

@tinmarino tinmarino merged commit a51052c into vimwiki:dev Aug 18, 2020
@tinmarino tinmarino deleted the merge_vars branch August 23, 2020 07:47
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.

None yet

1 participant