Closed EricEWeir closed 2 years ago
I'll give a more in depth reply later, here is just a quick improvement of your vimrc file. I've tried to comment the suggested changes.
call plug#begin('~/.vim/plugged')
Plug 'xolox/vim-misc'
Plug 'xolox/vim-session'
Plug 'xolox/vim-notes'
Plug 'lervag/wiki.vim'
" TYPO HERE:
"plug 'lervaf/lists.vim'
plug 'lervag/lists.vim'
Plug 'dahu/vim-help'
Plug 'dahu/learnvim'
plug 'masukomi/vim-markdown-folding'
plug 'preservim/vim-markdown'
Plug 'davidoc/taskpaper.vim'
Plug 'mattn/calendar.vim'
Plug 'tyru/capture.vim'
call plug#end()
set encoding=utf-8
set fileencoding=utf-8
set fileformats=unix,dos,mac
set guifont=Source Code Pro:h16
set wrap
set linebreak
set display=lastline
set backup
set clipboard=unnamed
set laststatus=2
set statusline=\ %F\ %r\ %l\ %c\ %y
set mousemodel=popup
set spell spelllang=en_us
set spellfile=~/.vim/spell/en.utf-8.add ~/.vim/spell/en.utf-8.add.spl
" THIS IS A MORE GENERAL VIM OPTION; should be here, not near markdown plugin
" config
set conceallevel=2
let mapleader = ","
noremap <Up> gk
noremap k gk
noremap <Down> gj
noremap j gj
noremap ^ g^
noremap $ g$
inoremap jj <ESC>
nnoremap <Leader>be :%s@^\(\s*\)\(=\+\)\s\+\(.*\)\s\+\2\%(\s*\)$@\=submatch(1).
" DELETE THESE LINES; they are NOT necessary!
" set nocompatible
" if has("autocmd")
" filetype plugin indent on
" endif
"vim-markdown-folding
let g:markdown_fold_style = 'nested'
"vim-markdown
let g:vim_markdown_follow_anchor = 1
let g:vim_markdown_edit_url_in = 'current'
let g:vim_markdown_no_extensions_in_markdown = 1
let g:vim_markdown_new_list_item_indent = 0
let g:vim_markdown_folding_level = 6
let g:vim_markdown_autowrite = 1
let g:vim_markdown_strikethrough = 1
let g:notes_directories = ['~/library/mobile documents/com~apple~CloudDocs/vimfiles/notes/']
let g:notes_suffix = '.txt'
let g:wiki_root = '~/library/mobile documents/com~apple~CloudDocs/vimfiles/wiki/'
let g:wiki_filetypes = ['md']
let g:wiki_link_extension = '.md'
let g:wiki_link_target_type = 'md'
let g:wiki_write_on_nav = 1
let g:wiki_journal = {
\ 'date_format': {
\ 'daily' : '%y-%m-%d',
\ 'weekly' : '%y_w%V',
\ 'monthly' : '%y_m%m',
\ },
\}
let g:session_autoload = 'prompt'
let g:session_lock_enabled = 0
autocmd BufRead,BufNewFile *.txt set ft=markdown
If you have time, could you please make a more concrete list of steps for how to reach the error? I.e. something like this:
cd directory
vim ...
The more explicit, the better!
@EricEWeir , I would remove 'xolox/vim-notes' for now. 'wiki.vim' IMHO can replace any other notes plugin, but having multiple notes plugins will very likely interfere with each other in regard to mappings (at least).
You will need to issue PlugInstall after you change the list of your plugins.
That is probably a good point by @bybor, although I have not checked that vim-notes actually do interfere with wiki.vim. It might. Also, one might want to do :PlugClean
and :PlugUpdate
after adjusting the plugin list. Then you will both remove unused plugins (free up space) and install and update the new/existing plugins.
If you have time, could you please make a more concrete list of steps for how to reach the error? ….
Just a quick response. First, thanks for the suggestions re: my .vimrc
. I’ll follow through.
Second, the error I reported occurred on my macbook and ipad. But I had to delete ivim from my iphone and reinstall it. I know have it set up with vim-markdown
, vim-markdown-folding
, and wiki.vim
as my only plugins.
Weirdly, the error does not occur on the iphone. Same .vimrc
as on ipad. I will check again on the ipad and the macbook and do as you suggest if I get the error again.
But for now gotta walk my little dog and get some breakfast.
But as I go a question that's occurred to me since deciding to trying to do the zettelkasten thing with barebones markdown: Doing that I’m able to create and save files in a directory in the cloud. No errors. Why then do I get errors when I issue wiki.vim commands?
@EricEWeir , I would remove 'xolox/vim-notes' for now. 'wiki.vim' IMHO can replace any other notes plugin, but having multiple notes plugins will very likely interfere with each other in regard to mappings (at least).
Thanks for the suggestion, @bybor. I had actually done that on my mobile devices. Hadn’t gotten around to it on the macbook.
I wouldn’t know about conflicts—too technology/code naive—but I agree about redundancy. Not just redundancy. Wiki.vim
does what I want.
I may be misremembering, but do you have experience with ivim?
I may be misremembering, but do you have experience with ivim?
Sorry, no, I don't. But I have another suggestion. Using Enter and Backspace is handy, but Vim offers a more universal and IMHO convenient way if you use Leader key.
Like, you can map 'WikiFollowLink' and 'WikiReturn' to be called when you press ,wf and ,wb (where your vim Leader is set to comma).
I'm sorry for lack of formatting in this message, I also typed commands out of memory - I'm writing this from mobile browser
If you have time, could you please make a more concrete list of steps for how to reach the error? I.e. something like this:
- Open terminal(???)
cd directory
- Start Vim with
vim ...
- Navigate to "SOME WORD" (line x, column y) (perhaps you could use an example file and show me the file?)
- ...
The more explicit, the better!
Hoping terminal is optional. I rarely use it. Don't think I've ever launched an app from it.
Vim
on my macbook is macvim
. I invoke macvim
from Alfred--an app launcher, and much more, for macos
.
When macvim
is up I start netrw
and navigate to a file I've created--markdown-test.md
--to test function of the markdown features I particularly want--concealing, folding, linking.
Bottom line of the file is a text string--some text
. I put the cursor on some
and do <CR>
. The error message is displayed. (Does so also on iPad.)
Again the error message is:
Error detected while processing function wiki#link#follow[14]..function wiki#link#follow[9]..21[4]..27:line 30:
E716: Key not present in Dictionary: "root"
E116: Invalid arguments for function printf('%s/%s', b:wiki.root, l:url_actual)))
E116: Invalid arguments for function wiki#paths#s(printf('%s/%s', b:wiki.root, l:url_actual)))
E116: Invalid arguments for function filereadable(wiki#paths#s(printf('%s/%s', b:wiki.root, l:url_actual)))
Just a little off-topic bitching: I noticed that in the markdown test file on my macbook conceal is not working on the link contained in it. My .vimrc has set conceallevel=2
. So I did help on that to make sure I understood what I should be getting. This is what help says about it:
Concealed text is completely hidden unless it has a custom replacement character defined (see |:syn-cchar|).
That doesn't help me at all. I don't even know what it's saying.
Second, the error I reported occurred on my macbook and ipad. But I had to delete ivim from my iphone and reinstall it. I know have it set up with
vim-markdown
,vim-markdown-folding
, andwiki.vim
as my only plugins.
Let's focus on one thing at the time! It is very hard to follow up problems that may or may not be the same problem on three different locations/devices/setups. Further, it is also hard to follow when you raise more than a single issue per thread.
Could I kindly ask that we first focus solely on the problem you have on your MacBook with MacVim?
But as I go a question that's occurred to me since deciding to trying to do the zettelkasten thing with barebones markdown: Doing that I’m able to create and save files in a directory in the cloud. No errors. Why then do I get errors when I issue wiki.vim commands?
Well, barebones Markdown and wiki.vim are completely different beasts. The error you get is from wiki.vim.
If you have time, could you please make a more concrete list of steps for how to reach the error? I.e. something like this:
- Open terminal(???)
cd directory
- Start Vim with
vim ...
- Navigate to "SOME WORD" (line x, column y) (perhaps you could use an example file and show me the file?)
- ...
The more explicit, the better!
Hoping terminal is optional. I rarely use it. Don't think I've ever launched an app from it.
Yes, terminal is optional; the point is that it makes everything much easier for me to help you if you describe your problem in detail with all steps explained explicitly. In your original issue, there are a lot of things that are not stated:
<cr>
)The ideal issue reports provide what I (and many) call minimal examples. A minimal example combines a minimal set of config files and test files. In addition, the ideal issue report provides a concise and explicit set of steps for how to reproduce the issue/problem.
However, I don't expect everyone to write ideal issue reports. Doing it takes practise and experience. But I do think is still useful to get the issue description as explicit and full of context as possible, even when it is hard to create a minimal example.
In addition, it is useful to avoid too much text. You want to provide as much information as necessary, but not more. More than necessary means noise, which means it will take more time for me to read and understand. Still, I very much acknowledge as a fact that it takes experience and knowledge to know what is the right amount of context and information!
Vim
on my macbook ismacvim
. I invokemacvim
from Alfred--an app launcher, and much more, formacos
.When
macvim
is up I startnetrw
and navigate to a file I've created--markdown-test.md
--to test function of the markdown features I particularly want--concealing, folding, linking.
Great, thanks! Is markdown-test.md
within the directory you specify for g:wiki_root
?
Bottom line of the file is a text string--
some text
. I put the cursor onsome
and do<CR>
. The error message is displayed. (Does so also on iPad.)Again the error message is: ...
Great, thanks!
Error detected while processing function wiki#link#follow[14]..function wiki#link#follow[9]..21[4]..27:line 30: E716: Key not present in Dictionary: "root" E116: Invalid arguments for function printf('%s/%s', b:wiki.root, l:url_actual))) E116: Invalid arguments for function wiki#paths#s(printf('%s/%s', b:wiki.root, l:url_actual))) E116: Invalid arguments for function filereadable(wiki#paths#s(printf('%s/%s', b:wiki.root, l:url_actual)))
I believe this error is fixed in a relatively recent update. Could you do :PlugUpdate
and try again?
Just a little off-topic bitching: I noticed that in the markdown test file on my macbook conceal is not working on the link contained in it. My .vimrc has
set conceallevel=2
. So I did help on that to make sure I understood what I should be getting. This is what help says about it:
Concealed text is completely hidden unless it has a custom replacement character defined (see |:syn-cchar|).
That doesn't help me at all. I don't even know what it's saying.
Ah, no, that help text is cryptic unless you know more about how the conceals work technically. But it is not so important to you. You are using preservim/vim-markdown
, so conceals for links are provided by that plugin. wiki.vim does not do syntax highlighting (and thus conceals). So if you are not happy with vim-markdown's syntax highlighting, I propose you open an issue there.
Let's focus on one thing at the time! It is very hard to follow up problems that may or may not be the same problem on three different locations/devices/setups. Further, it is also hard to follow when you raise more than a single issue per thread.
Could I kindly ask that we first focus solely on the problem you have on your MacBook with MacVim?
Absolutely. Didn't mean to complicate things unnecessarily. I'll be more careful in the future.
Hoping terminal is optional. I rarely use it. Don't think I've ever launched an app from it.
Yes, terminal is optional; the point is that it makes everything much easier for me to help you if you describe your problem in detail with all steps explained explicitly. In your original issue, there are a lot of things that are not stated:
- Which OS and Vim version?
- How did you start Vim?
- Where are your files?
- How did you open the file that you were in when you had the problem?
- What was the content and context when the problem appeared?
- Which keys did you type before the problem happened (I believe this was stated:
<cr>
)The ideal issue reports provide what I (and many) call minimal examples. A minimal example combines a minimal set of config files and test files. In addition, the ideal issue report provides a concise and explicit set of steps for how to reproduce the issue/problem.
However, I don't expect everyone to write ideal issue reports. Doing it takes practise and experience. But I do think is still useful to get the issue description as explicit and full of context as possible, even when it is hard to create a minimal example.
In addition, it is useful to avoid too much text. You want to provide as much information as necessary, but not more. More than necessary means noise, which means it will take more time for me to read and understand. Still, I very much acknowledge as a fact that it takes experience and knowledge to know what is the right amount of context and information!
There are contexts in which I know how to be explicit without mudding the waters with excess verbiage. Here I'm learning. I'll keep all the above in mind. Especially the list.
When
macvim
is up I startnetrw
and navigate to a file I've created--markdown-test.md
--to test function of the markdown features I particularly want--concealing, folding, linking.Great, thanks! Is
markdown-test.md
within the directory you specify forg:wiki_root
?
Yes.
Error detected while processing function wiki#link#follow[14]..function wiki#link#follow[9]..21[4]..27:line 30: E716: Key not present in Dictionary: "root" E116: Invalid arguments for function printf('%s/%s', b:wiki.root, l:url_actual))) E116: Invalid arguments for function wiki#paths#s(printf('%s/%s', b:wiki.root, l:url_actual))) E116: Invalid arguments for function filereadable(wiki#paths#s(printf('%s/%s', b:wiki.root, l:url_actual)))
I believe this error is fixed in a relatively recent update. Could you do
:PlugUpdate
and try again?
It is. I've tried only on the macbook. Likely will be on the ipad. I'll check of course.
Just a little off-topic bitching: I noticed that in the markdown test file on my macbook conceal is not working on the link contained in it. My .vimrc has
set conceallevel=2
. So I did help on that to make sure I understood what I should be getting. This is what help says about it:Concealed text is completely hidden unless it has a custom replacement character defined (see |:syn-cchar|).
That doesn't help me at all. I don't even know what it's saying.
. . . . You are using
preservim/vim-markdown
, so conceals for links are provided by that plugin. wiki.vim does not do syntax highlighting (and thus conceals). So if you are not happy with vim-markdown's syntax highlighting, I propose you open an issue there.
I'll do that. Lke I said, that was off-topic bitching. I didn't mean to be covertly asking for help on still another issue. Mostly taking the occasion to comment on the difficulty of the vim help files for lay people, marvelously detailed and precise as they are. Something I think we've commiserated about previously.
Thanks again for being patient with me. And for educating me as to the ways of communicating clearly, succinctly, helpfully here. Sincerely.
Absolutely. Didn't mean to complicate things unnecessarily. I'll be more careful in the future.
Thanks :)
. . . . You are using
preservim/vim-markdown
, so conceals for links are provided by that plugin. wiki.vim does not do syntax highlighting (and thus conceals). So if you are not happy with vim-markdown's syntax highlighting, I propose you open an issue there.I'll do that. Lke I said, that was off-topic bitching. I didn't mean to be covertly asking for help on still another issue. Mostly taking the occasion to comment on the difficulty of the vim help files for lay people, marvelously detailed and precise as they are. Something I think we've commiserated about previously.
I didn't really mind the "off-topic bitching", I just tried to guide you in the right direction if you wanted to do anything more about it. :)
Thanks again for being patient with me. And for educating me as to the ways of communicating clearly, succinctly, helpfully here. Sincerely.
I'm glad to help. Also, I find much education in this type of activity and discussion. For instance, giving feedback to people to help them provide more useful information can easily come of as condescending. I try to avoid that, and I am not sure I always succeed.
I believe this error is fixed in a relatively recent update. Could you do
:PlugUpdate
and try again?It is. I've tried only on the macbook. Likely will be on the ipad. I'll check of course.
I'm glad to hear it! So, it seems for the most part this issue is resolved. I'll leave it to you to close the issue; or to continue the discussion if you have any further related problems e.g. on on the iPad or iPhone.
The error occurs on the ipad. I updated the wiki.vim plugin. IPlug reported it was up to date. I deleted the plugin and reinstalled it. Still get the error. It is different from the one reported on the macbook. Do you want me to start a different issue or report here.
Either works, just make sure to include the various details :)
Oops! Should read more carefully. I see you anticipated the possibility that the problem on the ipad. (Again, creating a link works fine on the phone.
So, per your suggestion uesterday:
I put the cursor on "some" and typed <CR>
. The link was not created.
The error message displayed was different from the one reported from the macbook. Because I couldn’t select/copy the message as displayed in ivim, I typed a copy. I’ve double-check for accuracy. Spacing might be off in a couple places but ai believe it is an otherwise accurate copy:
Error detected while processing function wiki#link#follow[9]..21[4]..27:
line 6
E121: Undefined variable g:wiki_map_text_to_link
E116 Invalid arguments for function empty(g:wiki_map_text_to_link) && (type(g:wiki_text_to_link) == v:t_func || exists('*' . g:wiki_map_text_to_link)
(Sorry, I couldn’t find a way to put back ticks around the code.)
I'm glad to help. Also, I find much education in this type of activity and discussion. For instance, giving feedback to people to help them provide more useful information can easily come of as condescending. I try to avoid that, and I am not sure I always succeed.
I didn’t feel condescended to. I appreciate the help. And the instruction. I used to get lots of help from the vim-use
and macvim
list serves. Never felt condescended to there either.
Recently they and other vim-related forums haven’t been as responsive as they were when I was even more of a struggling nooby than I am now.
But as I go a question that's occurred to me since deciding to trying to do the zettelkasten thing with barebones markdown: Doing that I’m able to create and save files in a directory in the cloud. No errors. Why then do I get errors when I issue wiki.vim commands?
Well, barebones Markdown and wiki.vim are completely different beasts. The error you get is from wiki.vim.
I understand. But it seems the problem is not that vim
doesn’t recognize the path but that in some way it causes problems for wiki.vim
.
Likely naive of me to ask, and certainly selfish—it’s a problem for me not anybody else—but could wiki.vim
be tweaked to get around the problem, whatever it is?
Even if possible, I would certainly understand if you were reluctant to undertake it given that it’s not a problem for anyone else.
Error detected while processing function wiki#link#follow[9]..21[4]..27: line 6 E121: Undefined variable g:wiki_map_text_to_link E116 Invalid arguments for function empty(g:wiki_map_text_to_link) && (type(g:wiki_text_to_link) == v:t_func || exists('*' . g:wiki_map_text_to_link)
Strange. g:wiki_map_text_to_link
should always be defined. Can you repeat this test, but just after the error, type :scriptnames<cr>
- it will create a listing similar to this:
1: /usr/share/nvim/runtime/ftplugin.vim
2: /usr/share/nvim/runtime/indent.vim
3: /etc/xdg/nvim/sysinit.vim
4: /usr/share/nvim/archlinux.vim
5: ~/.config/nvim/init.vim
6: ~/.config/nvim/colors/my_solarized_lua.lua
7: ~/.config/nvim/autoload/personal/init.vim
8: ~/.config/nvim/init/plugins.vim
9: ~/.config/nvim/autoload/plug.vim
...
It may be hard to copy it, but it would be useful to see that full listing.
But as I go a question that's occurred to me since deciding to trying to do the zettelkasten thing with barebones markdown: Doing that I’m able to create and save files in a directory in the cloud. No errors. Why then do I get errors when I issue wiki.vim commands?
Well, barebones Markdown and wiki.vim are completely different beasts. The error you get is from wiki.vim.
I understand. But it seems the problem is not that
vim
doesn’t recognize the path but that in some way it causes problems forwiki.vim
.Likely naive of me to ask, and certainly selfish—it’s a problem for me not anybody else—but could
wiki.vim
be tweaked to get around the problem, whatever it is?Even if possible, I would certainly understand if you were reluctant to undertake it given that it’s not a problem for anyone else.
Is this a different problem than the one we're discussing above? If so, could you open a new issue for it and describe it there? It would help me not get too confused.
Error detected while processing function wiki#link#follow[9]..21[4]..27: line 6 E121: Undefined variable g:wiki_map_text_to_link E116 Invalid arguments for function empty(g:wiki_map_text_to_link) && (type(g:wiki_text_to_link) == v:t_func || exists('*' . g:wiki_map_text_to_link)
Strange.
g:wiki_map_text_to_link
should always be defined. Can you repeat this test, but just after the error, type:scriptnames<cr>
- it will create a listing similar to this:1: /usr/share/nvim/runtime/ftplugin.vim 2: /usr/share/nvim/runtime/indent.vim 3: /etc/xdg/nvim/sysinit.vim 4: /usr/share/nvim/archlinux.vim 5: ~/.config/nvim/init.vim 6: ~/.config/nvim/colors/my_solarized_lua.lua 7: ~/.config/nvim/autoload/personal/init.vim 8: ~/.config/nvim/init/plugins.vim 9: ~/.config/nvim/autoload/plug.vim
More strangeness. No error on this attempt. Link created.
But as I go a question that's occurred to me since deciding to trying to do the zettelkasten thing with barebones markdown: Doing that I’m able to create and save files in a directory in the cloud. No errors. Why then do I get errors when I issue wiki.vim commands?
Well, barebones Markdown and wiki.vim are completely different beasts. The error you get is from wiki.vim.
I understand. But it seems the problem is not that
vim
doesn’t recognize the path but that in some way it causes problems forwiki.vim
. Likely naive of me to ask, and certainly selfish—it’s a problem for me not anybody else—but couldwiki.vim
be tweaked to get around the problem, whatever it is? Even if possible, I would certainly understand if you were reluctant to undertake it given that it’s not a problem for anyone else.Is this a different problem than the one we're discussing above? If so, could you open a new issue for it and describe it there? It would help me not get too confused.
I didn’t mean to be raising an issue. (Though obviously I so.)
Wiki.vim is working for me now on all my devices. I’ll try to focus my use on one device at a time and make do with some Rub Goldberg synchronizing when necessary.
Take it as a comment.
Yes, indeed - strange. Perhaps you forgot to restart Vim after updating plugins?
As a response to the comment, if taken in the more general sense:
I understand. But it seems the problem is not that
vim
doesn’t recognize the path but that in some way it causes problems forwiki.vim
. Likely naive of me to ask, and certainly selfish—it’s a problem for me not anybody else—but couldwiki.vim
be tweaked to get around the problem, whatever it is? Even if possible, I would certainly understand if you were reluctant to undertake it given that it’s not a problem for anyone else.
I don't mind considering requests, even if they are "selfish" or tied to personal workflows. There may still be value for more people hidden in such types of issues. To be specific: I will probably not tweak wiki.vim to get around any problem, but I might tweak it for problems that at first might look very specific if either 1) there is little or no cost of doing it, or 2) I can see more value in the tweaks than just the specific case.
I'll let you close the issue if you think it resolved. I still read updates even if the issue is closed, so feel free to continue any discussions if there is still something unresolved conversation vice.
Yes, indeed - strange. Perhaps you forgot to restart Vim after updating plugins?
That was my first thought. And I think I did.
As a response to the comment, if taken in the more general sense: ….
I don't mind considering requests, even if they are "selfish" or tied to personal workflows. There may still be value for more people hidden in such types of issues. To be specific: I will probably not tweak wiki.vim to get around any problem, but I might tweak it for problems that at first might look very specific if either 1) there is little or no cost of doing it, or 2) I can see more value in the tweaks than just the specific case.
I appreciate that. And wouldn’t ask for more.
Description
The difficulties I have experienced executing
wiki.vim
commands on files in directories in the cloud led me to see if I could do what I want to do withvim-markdown
as my only writing-related plugin.As I recall, perhaps incorrectly, with wiki.vim installed I was able to create a markdown style link--
[name](name.md)
--by doing<CR>
on a word or visual selection of words, which opened the new file, from which I could navigate back to the file linked from with<BS>
.I was disappointed to find that that did not work with vim-markdown alone. After reactivating wiki.vim I find that what I believe worked with it is also now not working. When I do
<CR>
on a word or selection of words I get the following error message:My .vimrc follows: