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

Vimwiki Error: Unable to resolve link! #440

Closed
guakamole opened this issue Feb 21, 2018 · 21 comments
Closed

Vimwiki Error: Unable to resolve link! #440

guakamole opened this issue Feb 21, 2018 · 21 comments
Labels

Comments

@guakamole
Copy link

guakamole commented Feb 21, 2018

Hello,

Thank you for vimwiki ! I have installed (and been using for years) it via Vundle.

I just updated it and I can't navigate anymore using internal links (external links do work).

vim
<leader>ww
Vimwiki Error: Wiki 1 is not registered in your Vimwiki settings!
vim -c VimwikiIndex
# move to the next internal link and hit Enter
Vimwiki Error: Unable to resolve link!

Where are the vimwiki settings located and how do I get the currently installed version number ?

Thank you for your help.

@EinfachToll
Copy link
Member

Whoops, that's unfortunate. Can you post the output of :echo g:vimwiki_wikilocal_vars?

@guakamole
Copy link
Author

Sure, here you go:

[{'auto_tags': 0, 'css_name': 'style.css', 'auto_export': 0, 'diary_index': 'diary', 'template_default': 'default', 'nested_syntaxes': {}, 'auto_toc': 0, 'maxhi': 0, 'diary_sort': 'desc', 'path': '/home/guakamole/vimwiki/', 'template_ext': '.tpl', 'syntax': 'default', 'custom_wiki2html': '', 'automatic_nested_syntaxes': 1, 'index': 'index', 'diary_header': 'Diary', 'ext': '.wiki', 'is_temporary_wiki': 1, 'path_html': '/home/guakamole/vimwiki_html/', 'template_path': '/home/guakamole/vimwiki/templates/', 'list_margin': -1, 'diary_rel_path': 'diary/'}]

@rolandog
Copy link

I presented the same issue a short while ago. Here's my output of :echo g:vimwiki_wikilocal_vars.

I'm also using the TaskWiki plug-in (although I'm just getting started with the vim, vimwiki and taskwiki echosystem). And I'm using the Ubuntu 16.04 distro on the Linux Subsystem on Windows 10.

[{'auto_tags': 0, 'css_name': 'style.css', 'auto_export': 0, 'diary_index': 'diary', 'template_default': 'default', 'nested_syntaxes': {}, 'auto_toc': 0, 'maxhi': 0, 'diary_sort': 'desc', 'path': '/home/rolandog/vimwiki/', 'template_ext': '.tpl', 'syntax': 'default', 'custom_wiki2html': '', 'automatic_nested_syntaxes': 1, 'index': 'index', 'diary_header': 'Diary', 'ext': '.wiki', 'is_temporary_wiki': 1, 'path_html': '/home/rolandog/vimwiki_html/', 'template_path': '/home/rolandog/vimwiki/templates/', 'list_margin': -1, 'diary_rel_path': 'diary/'}]

@EinfachToll
Copy link
Member

Weird. I would have expected at least two dictionaries in the list instead of one. Am I right that the error appears since monday? (Because that was when I merged a branch containing huge refactorings). Are you both using Vundle? Are there known issues with Vundle when updating plugins? Can one of you post their .vimrc? (At least all the Vimwiki related settings.)

@guakamole
Copy link
Author

Weird. I would have expected at least two dictionaries in the list instead of one. Am I right that the error appears since monday?

I can't tell for sure, I didn't use vimwiki for a week or so (I was on vacation) and recetnly updated it (I'd say a couple of days ago). I know that's probably not helpful, sorry.

Are you both using Vundle?

I am.

Are there known issues with Vundle when updating plugins?

Not that I know of.

Can one of you post their .vimrc? (At least all the Vimwiki related settings.)

There's almost nothing related to vimwiki, here are the relevant parts:

call vundle#begin()

Plugin 'VundleVim/Vundle.vim'

Plugin 'myusuf3/numbers.vim'
Plugin 'tpope/vim-surround'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'vimwiki/vimwiki'
Plugin 'xolox/vim-misc'
Plugin 'xolox/vim-session'

call vundle#end()

That's the part that takes care of vundle plugins basicaly (I also included other plugins just in case this would be related to an incompatibility with another plugin, but I highly doubt it).

@rolandog
Copy link

I'm a relatively new user. I had just started trying the example last week for my index.wiki :

= My knowledge base =
    * [[Tasks]] -- things to be done _yesterday_!!!
    * Project Gutenberg -- good books are power.
    * Scratchpad -- various temporary stuff.

And for Tasks.wiki (I was trying out taskwiki):

= Tasks =

== Work Tasks | project:Work ==

Which worked fine on Friday (when writing the file, a list of different tasks and their dependent tasks was generated).

Am I right that the error appears since monday?

For me, I started getting the error on Wednesday. I can't recall correctly if I updated first or after getting the error message (thinking it would resolve the issue).

Are you both using Vundle?

I'm using vim-plug.

Are there known issues with Vundle when updating plugins?

Can't say for sure. There were some vimwiki related -- but closed -- issues a year ago.

Can one of you post their .vimrc? (At least all the Vimwiki related settings.)

" Prerequisites for vimwiki
set nocompatible
filetype plugin on
syntax on

" Specify a directory for plugins
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')
Plug 'powerman/vim-plugin-AnsiEsc'
Plug 'majutsushi/tagbar'
Plug 'Shougo/denite.nvim'
Plug 'vim-airline/vim-airline'
Plug 'blindFS/vim-taskwarrior'
Plug 'vimwiki/vimwiki', { 'branch': 'dev' }
Plug 'tbabej/taskwiki'
call plug#end()

" Fix colors for vim dark background on WSL
set background=dark

@EinfachToll
Copy link
Member

Bah, I'm stupid. The reason for the error message is just that you don't have registered a wiki, because you are new users. Read :h vimwiki-register-wiki and then put something like let g:vimwiki_list = [{'path': '~/my_site/', 'path_html': '~/public_html/'}] into your .vimrc.
Vimwiki used to behave nicer in this situation. I should fix that.

EinfachToll added a commit that referenced this issue Feb 22, 2018
@EinfachToll
Copy link
Member

Ok, now, it should ask you if you want to create a wiki at a default place (as it used to do).

@rolandog
Copy link

rolandog commented Feb 22, 2018

Thanks for your support and efforts, @EinfachToll !

After updating, I tried without declaring anything in the .vimrc but found links broken.

After declaring two wiki dictionaries with their respective paths (and paths for the html exports) and then declaring the g:vimwiki_list, I was prompted to create the folder and found links working again.

How about you, @guakamole ?

Taskwiki appears to be broken, but I'll file a bug over there (had forgotten about the timezone bug ). Everything is back to normal for me. Thanks so much @EinfachToll !

@thecarlhall
Copy link

After reading this issue then the docs, I set the following in .vimrc for a default setup:

let g:vimwiki_list = [{}]

@guakamole
Copy link
Author

guakamole commented Feb 23, 2018

@EinfachToll

Bah, I'm stupid. The reason for the error message is just that you don't have registered a wiki, because you are new users.

What do you mean by "new users" (as said in my first post, I've been using vimwiki for years and have tens of wiki pages)? :)

@rolandog I just fetched 5a00028

vim
<leader>ww

Doesn't return an error anymore and properly opens my wiki but the links are still broken.

After adding the following line to my .vimrc, links work properly again (I didn't get any prompt).

let g:vimwiki_list = [{'path': '~/vimwiki/', 'path_html': '~/vimwiki_html/'}]

@Nudin
Copy link
Member

Nudin commented Feb 23, 2018

What do you mean by "new users" (as said in my first post, I've been using vimwiki for years and have tens of wiki pages)? :)

What he meant is that you work without a configuration for your wiki. Most people have their wiki (or multiple wikis) configured in their vimrc. If you don't have a configuration vimwiki used a default config in the past (and will do so again) – that is like the line mentioned above, specifying where the wiki and the rendered pages are located at.

@guakamole
Copy link
Author

guakamole commented Feb 23, 2018

After further inspection, it seems that navigating through pages breaks the links again (in another way).

All the internal links are in their raw form:

[[Internal link 1]]
[[Internal link 2]]
...

I have added this line to my `.vimrc' (and changed the extensions accordingly):

let g:vimwiki_list = [{'path': '~/vimwiki/', 'path_html': '~/vimwiki_html/', 'auto_export': 1, 'syntax': 'markdown', 'ext': '.md'}]

Could this be related to #441 #442 ?

Steps to reproduce

vim
<leader>ww
# navigate to the next internal link, hit enter
# navigate back to the index by pressing backspace

PS @Nudin thank you for your explanation :)

@EinfachToll
Copy link
Member

Should be fixed now.

@guakamole
Copy link
Author

I fecthed 02e8fb3.

The initial problem is fixed but the one in #440 (comment) isn't. Do you want me to open a new issue ?

@EinfachToll
Copy link
Member

No, I can reproduce the issue now and take care of it.

EinfachToll added a commit that referenced this issue Feb 26, 2018
Else, Vim decides the filetype according to the file extension.
Ref #440
@EinfachToll
Copy link
Member

Done (I think)

@rolandog
Copy link

rolandog commented Feb 27, 2018

Hi @EinfachToll

I'd like to report an edge-case where this isn't fully fixed. If this should be a different bug, by itself, I'd be happy to open it as such.

During the initial fixing of this issue, I separate my work and personal wikis by placing this on my .vimrc:

" Personal wiki attributes
let wiki_personal = {}
let wiki_personal.path = '~/vimwiki_pers/'
let wiki_personal.path_html = '~/vimwiki_pers_html/'

" Work wiki attributes
let wiki_work = {}
let wiki_work.path = '~/vimwiki_work/'
let wiki_work.path_html = '~/vimwiki_work_html/'

" Register wikis
let g:vimwiki_list = [wiki_personal, wiki_work]

However, I didn't remove the original folder (~/vimwiki/). This folder is auto-discovered, but not auto-registered, and therefore the same issue persists. After deleting it and re-launching, I was offered to create the folder, but after accepting to create the folder and trying to access a link on it, I was still met by the same error "Unable to resolve link!".

Edit (2018-02-28 21:59 UTC):
For clarification:

The registered wikis (personal and work) can be accessed through <leader>ww and 2<leader>ww (those have working links); the third wiki (the one I mentioned is that not auto-registered, as it is not explicitly listed in .vimrc) is accessed through 3<leader>ww, and still has the link issue.

@EinfachToll EinfachToll reopened this Feb 28, 2018
@jc324x
Copy link

jc324x commented Mar 2, 2018

I'm also experiencing this same issue. I just setup a new laptop today. I cloned my dotfiles and my existing wiki on the new machine and I only get Vimwiki Error: Unable to resolve link! there.

@ranebrown
Copy link
Contributor

@jychri is your situation the same as the above mentioned edge case?

@ranebrown
Copy link
Contributor

I can't reproduce this. If there is still a problem please reopen or create a new issue with more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants