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

Changing the delimiter of the tag #928

Closed
Tecvoc opened this issue Jun 26, 2020 · 2 comments
Closed

Changing the delimiter of the tag #928

Tecvoc opened this issue Jun 26, 2020 · 2 comments
Labels
idea tag Related to tag system

Comments

@Tecvoc
Copy link

Tecvoc commented Jun 26, 2020

I have been using a custom script along with pandoc for converting vimwiki in markdown format to html, along with emojis. However emojis have a syntax very similar to tags ( like :star : for ⭐) and they create new tags.

Is there is a way we can set the delimiter in the vimwiki global options for tags.

Currently I have identified as to where the change are needed, in order to do so, however due to limited vimscript knowledge I am just posting the diff code that worked for me.

syntax/vimwiki_markdown.vim

-let s:markdown_syntax.tag_search = '\(^\|\s\)\zs:\([^:''[:space:]]\+:\)\+\ze\(\s\|$\)'
+let s:markdown_syntax.tag_search = '\(^\|\s\)\zs@\([^@''[:space:]]\+@\)\+\ze\(\s\|$\)'

autoload/vimwiki/tags.vim
-     for tag in split(tag_group, ':')
+     for tag in split(tag_group, '@')

The above changes the delimiter to '@' like @mytag1@.

@tinmarino tinmarino added the idea label Jul 21, 2020
@tinmarino
Copy link
Member

Related: #922

@tinmarino tinmarino added the tag Related to tag system label Jul 26, 2020
tinmarino added a commit to tinmarino/vimwiki that referenced this issue Aug 8, 2020
…imwiki#922 vimwiki#928)

Affects: (via user configurated regexp)

- VimwikiGenerateTagLinks
- follow_link
- completion
- Syntax Highlighting
@tinmarino
Copy link
Member

Fixed: 188ead5

See the new doc:

vimwiki/doc/vimwiki.txt

Lines 3602 to 3631 in 188ead5

*g:vimwiki_tag_format*
Dictionary to describe the format of the tags vimwiki uses to highlight,
generate and follow_link
| Key | Default | Description
----------------------------------------------------- ReGeX
| pre | '^\|\s' | Limitations to tag precedence
| pre_mark | ':' | Tag list opener
| in | '[:space:]]\+' | Tag permitted characters
| sep | ':' | Tag separators in a tag list
| post_mark | ':' | Tag list closer
| post | '\s\|$' | Limitations to tag following
----------------------------------------------------- Number
| conceal | 0 | Do conceal the tag
----------------------------------------------------- Character
| cchar | '' | If conceal, the conceal char
The default dictionary gets |extends| with the user provided dictionary. So it
is only necessary to provide the values to change. For Example, to use a:
- Tag like: >
<<tag1|tag2>>
- Set: >
let g:vimwiki_tag_format = {'pre_mark': '<<', 'post_mark': '>>', 'sep': '|'}
- Tag like: >
tags: @tag1 @tag2
- Set: >
let g:vimwiki_tag_format = {'pre': '\(^[ -]*tags\s*: .*\)\@<=',
\ 'pre_mark': '@', 'post_mark': '', 'sep': '>><<'}

In your case ( after rebase on dev ):

let g:vimwiki_tag_format = {'pre_mark': '@', 'post_mark': '@', 'sep': '@'}

deepredsky pushed a commit to deepredsky/vimwiki that referenced this issue Jan 16, 2021
…imwiki#922 vimwiki#928)

Affects: (via user configurated regexp)

- VimwikiGenerateTagLinks
- follow_link
- completion
- Syntax Highlighting
jls83 pushed a commit to jls83/vimwiki that referenced this issue Jan 17, 2023
…imwiki#922 vimwiki#928)

Affects: (via user configurated regexp)

- VimwikiGenerateTagLinks
- follow_link
- completion
- Syntax Highlighting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea tag Related to tag system
Projects
None yet
Development

No branches or pull requests

2 participants