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

E716, this plugin is language dependent #44

Closed
Zeitvertreib opened this issue Dec 10, 2019 · 6 comments
Closed

E716, this plugin is language dependent #44

Zeitvertreib opened this issue Dec 10, 2019 · 6 comments

Comments

@Zeitvertreib
Copy link

Zeitvertreib commented Dec 10, 2019

When on a word (default mappings) an Error msg appears and no link is created

Zeile    4:
E716: Schlüssel nicht in Dictionary enthalten: open, a:000, l:link)
E116: Ungültige Argumente für die Funktion call

trying to get a translated error msg:
$ export LC_ALL=C

-> no error appears, links and pages created accordingly.

however, setting
let g:wiki_link_target_type = ['md']
breaks then again with:

_word[44]..wiki#link#template_pick_from_option:
line    6:
E730: using List as a String
E116: Invalid arguments for function call
E15: Invalid expression: call('wiki#link#template_' . g:wiki_link_target_type, a:000)

I'll provide a minimal working example if needed. But it already took me a while to figure the problem after moving from another wiki plugin.

edit/ my (updated) plugin config:

Plug 'lervag/wiki.vim'
Plug 'lervag/wiki-ft.vim'
let g:wiki_root = '~/datenspeicher/documents/wiki/vimwiki'
let g:wiki_link_target_type = 'md'
let g:wiki_filetypes = ['md']
let g:wiki_journal = {'name': 'diary'}
@lervag
Copy link
Owner

lervag commented Dec 10, 2019

Thanks! I sometimes forget that people use different languages and therefore have some catch statements that explicitly assumes english language. Should be relatively easy to fix, and I'll see if I can push a fix later tonight.

@lervag
Copy link
Owner

lervag commented Dec 10, 2019

The g:wiki_link_target_type option should be a string, not a list. Try setting it to 'md'.

I think I fixed the language specific issue now. Please test.

@Zeitvertreib
Copy link
Author

Zeitvertreib commented Dec 11, 2019

Ty for your fast response, and it seems to work like a charm now.

Also ty for the hint with the g:wiki_link_target_type, that solved the other error as well.

However, links do not seem to 'collapse'. And I am not sure if that is the intended behavior. When the cursor is on word and I hit enter it turns into [word](word). (With the link, and all created properly, e.g. red and green coloring.) But when I move the cursor away, I would expect it to collapse, so it would read word, but it still reads [word](word).

There are prob little chances that this is related, but I would like to not miss out on that.

Edit: I just discovered for testing purpose, that when i open a .wiki file, and hit :WikiEnable, and there I can create the links like described above (except the coloring) and there the 'collapsing' works just fine. On other filetypes it seems to have no effect. (e.g. .txt) (<leader>ww opens up a index.md with the above setting.)

..but I guess I missed out on something in the manual. Sry for the inconvenience in that case.

@lervag
Copy link
Owner

lervag commented Dec 13, 2019

..but I guess I missed out on something in the manual. Sry for the inconvenience in that case.

No inconvenience. First, the feature you are talking about is the conceal feature from syntax highlighting, see :help syn-conceal. And yes, you did miss something from the docs (see :help wiki-intro):

Note: |wiki.vim| is `not` a filetype plugin. It is designed so that it may be used
      along with filetype plugins, e.g. for dedicated Markdown plugins. One
      may also use `wiki-ft.vim` (https://github.com/lervag/wiki-ft.vim) for
      simple syntax highlighting and folding of `.wiki` files, if desired.

The main point is that is does not include syntax rules or filetype specific rules. As suggested, one could use the wiki-ft.vim plugin for .wiki files. This implements folding and syntax highlighting. For Markdown files, there are a lot of other and probably better plugins, e.g. see this blog post. Personally, I use vim-markdown, which works quite well.

@lervag lervag closed this as completed Dec 13, 2019
@Zeitvertreib
Copy link
Author

Good work and thanks for pointing me into the co-related subject of the vim universe, and the implementation means of this plugin!

(Also the blog post is awesome.)

@lervag
Copy link
Owner

lervag commented Dec 17, 2019

(Also the blog post is awesome.)

Yes, I also liked it.

Feel free to let me know if you have other issues or feature requests :)

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

2 participants