wiki.vim
wiki.vim copied to clipboard
Will wiki.vim handle vimwiki files
I am trying to sync vimwiki in vim on mobile devices—actually iVim; vim for Apple mobile devices—and vimwiki on a MacBook. The problem is that when accessed from the cloud, vimwiki files lose link highlighting and folding.
I’m wondering, since it’s not a filetype plugin, and since it’s based on vimwiki, if I might get around this problem with wiki.vim.
Also whether wiki.vim would handle vimwiki files. What syntax plugins I would need to give me link highlighting and folding with wiki.vim.
And whether in adding syntax to wiki.vim I would just have the problem—loss of link highlighting and folding—all over again.
I’ve provided my .vimrc
below. Help appreciated.
Thanks,
iVim
set nocompatible
filetype plugin indent on
syntax on
set encoding=utf-8
set fileencoding=utf-8
set fileformats=unix,dos,mac
set guifont=Menlo:h14
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
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).
execute pathogen#infect()
let g:notes_directories = ['~/mydocs/notes']
let g:notes_suffix = '.txt'
let g:vimwiki_global_ext = 0
let g:vimwiki_list = [
\ {'path': '~/vimwiki/', 'syntax': 'markdown'},
\ {'path': '~/vimfiles/vimwiki/', 'syntax': 'markdown'}
\]
let g:vimwiki_folding=1
let g:session_autoload = prompt
let g:session_lock_enabled = 0
autocmd BufRead,BufNewFile *.mmd :set ft=markdown
autocmd BufRead,BufNewFile *.txt set ft=markdown
autocmd BufRead,BufNewFile *.wiki set ft=markdown
Do you have vimwiki
installed as plugin in iVim? Do other vimwiki
commands work? Like opening Journal or index?
I do. I was going to remove it. I assume it would have control of any vimwiki files I opened. To see what wiki.vim would do with the vimiki would have to be out of the picture. The only way I see to do that is by removing vimwiki.
On Jun 28, 2022, at 9:30 AM, bybor @.***> wrote:
Do you have vimwiki installed as plugin in iVim? Do other vimwiki commands work? Like opening Journal or index? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.
@EricEWeir , makes sense. I cannot really help you, we need to wait for @lervag's reply. I use wiki.vim
between Android/Windows, which includes physical synchronization of files between different systems. I use asciidoc
as a file type plugin, which means that it's responsible for highlight and folding.
I never used Apple devices and I don't know how to approach it. But to me, if you have Vim and it loaded your plugins and it detected the file type then it would apply all stuff to it. Which means that if VimWiki doesn't work the expected way, then you may have a configuration issue, so you will have to deal with it if you switch to wiki.vim
. That was the point of my questions.
Do VimWiki
commands work in iVim? There must be some "general" that work from any file like "open journal", and some specific to vimwiki
file type, like "go to previous journal entry".
Hmm. I respond to your last message by email. Perhaps it’s running behind schedule.
Anyway, I’ve installed wiki.vim and tested it. I get a screenful of error messages when I open a file. But when those are dismissed I have folding but not links.
At present I’m not able to access my vimwiki files in the cloud. I can navigate in netrw to the directory that the vimwiki directory is in but I can’t access the files. The directory name is whited out. Other directories open.
More reading up on wiki.vim
@bybor Thanks for pitching in!
@EricEWeir First and FYI: I've taken the liberty of cleaning up your posted .vimrc
. Specifically, I
- Removed all comments (they are not necessary in this context).
- Fixed a couple of issues that I guess was a result from you copying things into the github issue (e.g. you had
linebreak
on a line and one of your comments missed the initial comment character. - Changed the order of things slightly, mostly to group things to make it easier for me to understand your config.
I am trying to sync vimwiki in vim on mobile devices—actually iVim; vim for Apple mobile devices—and vimwiki on a MacBook. The problem is that when accessed from the cloud, vimwiki files lose link highlighting and folding.
This should work well with wiki.vim, I believe. Although it would be under the assumption that iVim is compatible with Vim 8.1 (see :help wiki-intro-requirements
).
Also whether wiki.vim would handle vimwiki files. What syntax plugins I would need to give me link highlighting and folding with wiki.vim.
You can try wiki-ft.vim. It's not very advanced, but IMHO it works quite well for wiki files that are written in relatively standard markdown. It also includes a foldlevel function. I believe it should also work on iVim, if it is based on a recent Vim version.
Some comments to parts of your vimrc (:
" let g:vimwiki_list = [
" \ {'path': '~/vimwiki/', 'syntax': 'markdown'},
" \ {'path': '~/vimfiles/vimwiki/', 'syntax': 'markdown'}
" \]
" For wiki.vim, you would probably want something like this
" Notice: You can only have a single root with wiki.vim
let g:wiki_root = '~/vimwiki'
" let g:vimwiki_global_ext = 0
"
" wiki.vim has the following option, but I'm not sure if you really want it
let g:wiki_global_load = 0
" let g:vimwiki_folding=1
"
" wiki-ft.vim will provide folding automatically
" autocmd BufRead,BufNewFile *.wiki set ft=markdown
"
" wiki.vim can work with the markdown filetype, but if you want to use
" wiki-f.vim, then you should remove the above autocmd.
Anyway, I’ve installed wiki.vim and tested it. I get a screenful of error messages when I open a file. But when those are dismissed I have folding but not links.
After applying changes to your config based on my earlier comments, can you post a screenshot of the error messages if they still appear?
I am trying to sync vimwiki in vim on mobile devices—actually iVim; vim for Apple mobile devices—and vimwiki on a MacBook. The problem is that when accessed from the cloud, vimwiki files lose link highlighting and folding.
Also, can you explain in more detail how you are doing this sync?
@EricEWeir First and FYI: I've taken the liberty of cleaning up your posted .vimrc. Specifically, I
- Removed all comments (they are not necessary in this context).
- Fixed a couple of issues that I guess was a result from you copying things into the github issue (e.g. you had linebreak on a line and one of your comments missed the initial comment character.
- Changed the order of things slightly, mostly to group things to make it easier for me to understand your config.
Thanks, Karl. I certainly don’t object to someone who knows a lot more than I do helping me clean up my .vimrc. To the contrary.
I am trying to sync vimwiki in vim on mobile devices—actually iVim; vim for Apple mobile devices—and vimwiki on a MacBook. The problem is that when accessed from the cloud, vimwiki files lose link highlighting and folding.
This should work well with wiki.vim, I believe. Although it would be under the assumption that iVim is compatible with Vim 8.1 (see :help wiki-intro-requirements).
iVim is based Vim 8.1. It’s amazing the extent which the developer has been able to go in overcoming the major limitations placed on vim by Apple’s sandboxing of apps on it’s mobile devices, including, most importantly for syncing between devies, access to external directories.
Also whether wiki.vim would handle vimwiki files. What syntax plugins I would need to give me link highlighting and folding with wiki.vim.
You can try wiki-ft.vim. It's not very advanced, but IMHO it works quite well for wiki files that are written in relatively standard markdown. It also includes a foldlevel function. I believe it should also work on iVim, if it is based on a recent Vim version.
I’d like to give wiki.vim a try. If I continue running into the wall I encountered with vimwiki I’ll reconsider, e.g., I’d like to take advantage of the journal feature.
Some comments to parts of your vimrc (:
" let g:vimwiki_list = [ " \ {'path': '~/vimwiki/', 'syntax': 'markdown'}, " \ {'path': '~/vimfiles/vimwiki/', 'syntax': 'markdown'} " ]
" For wiki.vim, you would probably want something like this " Notice: You can only have a single root with wiki.vim let g:wiki_root = '~/vimwiki'
If I (understand) you correctly, I can’t have have two paths like the one’s set out above. The second one is an inadequate attempt to give vimwiki—or wiki.vim—access to directories in he cloud. It’s inadequate because it gives only the directories in the cloud that I want to give vimwiki/wiki.vim access to, but it doesn’t give the path to those directories.
I don’t give the full path because I don’t know what it is, or even how to find out. I've done a fair bit of trial-and-error floundering around to try to discover, without success so far. I can navigate to it in netrw, but I can’t name it for vimwiki/wiki.vim.
My first reaction to your saying that there can only be one root in wiki.vim was that syncing through the cloud won’t be possible. But if the root directory is in the cloud it will. The main problem at the moment is getting the syntax for link highlighting and folding to work with files loaded from the cloud.
" let g:vimwiki_global_ext = 0 " " wiki.vim has the following option, but I'm not sure if you really want it let g:wiki_global_load = 0
As I understand it that option has to do whether vimwiki/wiki.vim will take command of markdown files you want to manage with other plugins. It doesn’t matter to me, at least at this point. I won’t be creating or accessing markdown files with any other plugin.
" let g:vimwiki_folding=1 " " wiki-ft.vim will provide folding automatically
" autocmd BufRead,BufNewFile *.wiki set ft=markdown " " wiki.vim can work with the markdown filetype, but if you want to use " wiki-f.vim, then you should remove the above autocmd.
Again, for now I’d like to stick with wiki.vim. This brings me to the problem I’m having. As I understand it, Tim Pope’s specification of markdown “ships with” vim. But when I open vimwiki files from the cloud with wiki.vim I get only folding, not link hiighlighting. Shouldn’t I get both?
Anyway, I’ve installed wiki.vim and tested it. I get a screenful of error messages when I open a file. But when those are dismissed I have folding but not links.
After applying changes to your config based on my earlier comments, can you post a screenshot of the error messages if they still appear?
Will do. Do I need to make the changes you suggest or have you already made them in the copy included with my initial post? If the former, then the changes are just the ones you suggest in your message?
Thanks again,
First, having checked in here I see that some if my questions have been answered. Thanks for cleaning up my .vimrc. It looks great.
As to how I’m doing—actually, trying to do—this sync, it’s implicit in my response to you. It’s through directories in the cloud that vim on all my devices—iPhone, iPad, MacBook—will have access to. As I said, I’m able to navigate to those directories on all my devices, but the syntax that the plugins—vimwiki/wiki.vim and others—depend on isn’t taking effect on files opened from those directories.
Hope that answers your question. If not, let me know.
And thanks again.
Thanks, Karl. I certainly don’t object to someone who knows a lot more than I do helping me clean up my .vimrc. To the contrary.
No problem :)
iVim is based Vim 8.1. It’s amazing the extent which the developer has been able to go in overcoming the major limitations placed on vim by Apple’s sandboxing of apps on it’s mobile devices, including, most importantly for syncing between devies, access to external directories.
Ok, cool!
I’d like to give wiki.vim a try. If I continue running into the wall I encountered with vimwiki I’ll reconsider, e.g., I’d like to take advantage of the journal feature.
Noted.
If I (understand) you correctly, I can’t have have two paths like the one’s set out above. The second one is an inadequate attempt to give vimwiki—or wiki.vim—access to directories in he cloud...
With wiki.vim, the idea is that if you open a file in any wiki, it should be detected and wiki.vim should just work. The g:wiki_root
is really only used to specify a default wiki for mappings like \ll
(:WikiIndex
) and similar.
It’s inadequate because it gives only the directories in the cloud that I want to give vimwiki/wiki.vim access to, but it doesn’t give the path to those directories. I don’t give the full path because I don’t know what it is, or even how to find out. I've done a fair bit of trial-and-error floundering around to try to discover, without success so far. I can navigate to it in netrw, but I can’t name it for vimwiki/wiki.vim. My first reaction to your saying that there can only be one root in wiki.vim was that syncing through the cloud won’t be possible. But if the root directory is in the cloud it will. The main problem at the moment is getting the syntax for link highlighting and folding to work with files loaded from the cloud.
Ok, so, it sounds like the problem here is understanding how the cloud sync works. But it seems you have multiple things going here. We should keep these separated.
- Getting wiki.vim to work on your computer with regular Vim or MacVim.
- Getting wiki.vim to work on your phone with iVim. I assume this means a separate
.vimrc
file? If you want to use a single, shared.vimrc
file, then that's an important detail and we might need more advanced configuration.
As I understand it that option (g:wiki_global_load) has to do whether vimwiki/wiki.vim will take command of markdown files you want to manage with other plugins. It doesn’t matter to me, at least at this point. I won’t be creating or accessing markdown files with any other plugin.
Well, yes and no. For wiki.vim, if you set this to 0, then we don't load any features for any files except those under g:wiki_root
. But wiki.vim does not really provide any conflicting features, so IMHO it is safe to load. And it does add support for links that may be relevant also in other contexts.
" let g:vimwiki_folding=1 " " wiki-ft.vim will provide folding automatically " autocmd BufRead,BufNewFile *.wiki set ft=markdown " " wiki.vim can work with the markdown filetype, but if you want to use " wiki-f.vim, then you should remove the above autocmd.
Again, for now I’d like to stick with wiki.vim. This brings me to the problem I’m having. As I understand it, Tim Pope’s specification of markdown “ships with” vim. But when I open vimwiki files from the cloud with wiki.vim I get only folding, not link hiighlighting. Shouldn’t I get both?
Yes, you should get both. But it is very hard to understand your side of things, because I have no idea of how things are set up. Again, let's focus on the two separate issues from above.
Anyway, I’ve installed wiki.vim and tested it. I get a screenful of error messages when I open a file. But when those are dismissed I have folding but not links. After applying changes to your config based on my earlier comments, can you post a screenshot of the error messages if they still appear?
Will do. Do I need to make the changes you suggest or have you already made them in the copy included with my initial post? If the former, then the changes are just the ones you suggest in your message? Thanks again,
You need to to configure things as properly as you can, of course. I assume my input may help somewhat. And you should specify the config that you are actually using when you show the error messages.
As to how I’m doing—actually, trying to do—this sync, it’s implicit in my response to you. It’s through directories in the cloud that vim on all my devices—iPhone, iPad, MacBook—will have access to. As I said, I’m able to navigate to those directories on all my devices, but the syntax that the plugins—vimwiki/wiki.vim and others—depend on isn’t taking effect on files opened from those directories.
Ok, I see. So, on all devices, you have a folder, something like ~/vimfiles
, that is shared between the devices?
Moving forward, I propose we slow things down. Let us first get things working sufficiently on you computer (MacBook). Only when that works, we should continue to iVim and the phones/tabs. So:
- Could you, based on the discussion so far and the wiki.vim README and docs, try and configure your
.vimrc
so that things work as you want? - If you have problems with this, then post your current version of
.vimrc
and explain the problems. Again, please ignore the iVim and iphone stuff for now. - However, and important: Try and make it work with the synced folder. E.g., use
let g:wiki_root = '~/vimfiles/vimwiki'
or whatever you need to access your synced wiki files. As a side remark: Do you intend to have a different, local version of the synced files put into another folder,~/vimwiki
? If so, why?
Also: I would prefer if you could respond through the github UI. Responding by email disables a lot of the markdown features.
Damn! I had nearly finished a longish response when something I did--I have no idea what--deleted the entire thing! I'm starting over. Hopefully it will go a little more quickly. For now, I greatly appreciate your generosity with me.
I can understand that frustration; I've been there! And I'm glad to help :)
Apologies for the delayed reply, Karl. At the end of the day and this morning family matters to take care of.
I had nearly completed recomposing the long response I lost yesterday when I reencountered your suggestion that we start simple, focus on the MacBook implementation, see if we can get the link to the cloud working. I decided in comparison the earlier stuff was going to come across as so much fretting, more likely to complicate and confuse than to be enlightening. So I've thrown it away and am reporting only on what I've done with the MacBook implementation.
Moving forward, I propose we slow things down. Let us first get things working sufficiently on you computer (MacBook). Only when that works, we should continue to iVim and the phones/tabs. So:
- Could you, based on the discussion so far and the wiki.vim README and docs, try and configure your
.vimrc
so that things work as you want?
- If you have problems with this, then post your current version of
.vimrc
and explain the problems. Again, please ignore the iVim and iphone stuff for now.
- However, and important: Try and make it work with the synced folder. E.g., use
let g:wiki_root = '~/vimfiles/vimwiki'
or whatever you need to access your synced wiki files. As a side remark: Do you intend to have a different, local version of the synced files put into another folder,~/vimwiki
? If so, why?
Made only a few changes to the .vimrc. Put code to activate vim-plug in at the top. Replaced let g:vimwiki_global_ext = 0
with let g:wiki_global_load = 0
and let g:vimwiki_list
with let g:wiki_root
.
Because MacVim has menus I was able to follow "iCloud Drive" to its termination in the file system. (Buried very deep in it.)
I tested links to local files and files in the cloud. In both cases there was an error message; I think the same one in both cases; hard to read; maybe you can make sense of it. After dismissing the error message I got folding but no highlighting with files on both paths.
It can probably can be addressed, but In addition to the lack of highlighting I'm concerned that the path to the cloud docs is so long. Iill make it difficult to quickly create or open files.
Here's a screen capture of the the error message:
Here's my .vimrc
. It has the path to the documents in the cloud. The path to local documents is ~/vimwiki
.
call plug#begin('~/.vim/plugged')
Plug 'xolox/vim-misc'
Plug 'xolox/vim-session'
Plug 'xolox/vim-notes'
Plug 'lervag/wiki.vim'
Plug 'dahu/vim-help'
Plug 'dahu/learnvim'
Plug 'davidoc/taskpaper.vim'
call plug#end()
set nocompatible
filetype plugin indent on
syntax on
set encoding=utf-8
set fileencoding=utf-8
set fileformats=unix,dos,mac
set guifont=Menlo:h14
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
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).
execute pathogen#infect()
let g:notes_directories = ['~/mydocs/notes']
let g:notes_suffix = '.txt'
mv
let g:wiki_global_load = 0
let g:wiki_root = [{'path': '~/library/mobile documents/com~apple~CloudDocs/vimfiles/vimwiki/', 'syntax': 'markdown'}]
let g:vimwiki_folding=1
let g:session_autoload = prompt
let g:session_lock_enabled = 0
autocmd BufRead,BufNewFile *.md :set ft=markdown
autocmd BufRead,BufNewFile *.txt set ft=markdown
autocmd BufRead,BufNewFile *.wiki set ft=markdown
Apologies for the delayed reply, Karl. At the end of the day and this morning family matters to take care of.
No problems; take your time :)
Made only a few changes to the .vimrc. Put code to activate vim-plug in at the top. Replaced
let g:vimwiki_global_ext = 0
withlet g:wiki_global_load = 0
andlet g:vimwiki_list
withlet g:wiki_root
.
Cool; permit me to provide a suggested updated version below. The updates include:
- Added
wiki-ft.vim
for syntax highlighting and folding. Commented out the autocmd that toggles the markdown filetype. Of course, this is optional! - Removed some unnecessary stuff (e.g.;
plug#end()
applies thefiletype plugin indent on
andsyntax on
, so you don't need it. Also, you don't needset nocompatible
in the vimrc file. - Removed
pathogen#infect()
- why do you have that if you use vim-plug? - Removed a leftover
mv
(??). - Important: Fixed errouneous
g:wiki_root
setting.
call plug#begin('~/.vim/plugged')
Plug 'xolox/vim-misc'
Plug 'xolox/vim-session'
Plug 'xolox/vim-notes'
Plug 'lervag/wiki.vim'
Plug 'lervag/wiki-ft.vim'
Plug 'dahu/vim-help'
Plug 'dahu/learnvim'
Plug 'davidoc/taskpaper.vim'
call plug#end()
set encoding=utf-8
set fileencoding=utf-8
set fileformats=unix,dos,mac
set guifont=Menlo:h14
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
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).
let g:notes_directories = ['~/mydocs/notes']
let g:notes_suffix = '.txt'
let g:wiki_global_load = 0
let g:wiki_root = '~/library/mobile documents/com~apple~CloudDocs/vimfiles/vimwiki/'
let g:session_autoload = prompt
let g:session_lock_enabled = 0
autocmd BufRead,BufNewFile *.md :set ft=markdown
autocmd BufRead,BufNewFile *.txt set ft=markdown
" autocmd BufRead,BufNewFile *.wiki set ft=markdown
Because MacVim has menus I was able to follow "iCloud Drive" to its termination in the file system. (Buried very deep in it.)
I tested links to local files and files in the cloud. In both cases there was an error message;
Yes, because you had a wrong type for g:wiki_root
(I suggest you also read :help g:wiki_root
for more info).
Here's my
.vimrc
. It has the path to the documents in the cloud. The path to local documents is~/vimwiki
.
Are the cloud documents and the local documents different? Or are they the same and supposed to be synced? I.e., are you working with two different wikis?
If they are the same, then I suggest that you use a symlink between ~/library/mobile documents/com~apple~CloudDocs/vimfiles/vimwiki/
and ~/vimfiles
and then use let g:wiki_root = '~/vimwiki'
. That should still work. Or, you could also just use the full path to the cloud files directly. I believe Apple will download all files in that folder (or at least, that you can ask it to do so automatically).
Also, notice again: I think you can consider to not use g:wiki_global_load
. I personally find wiki.vim to be unobtrusive, and the mappings are useful also in various readme files and similar (e.g. to open external links to web pages or links between different markdown files in the same repository).
Late getting back to you. I was expecting an email notification of your response. Came here to upload what I thought might be an easier to read screenshot of the error messages. And found your response.
I REALLY appreciate your help! I understand what you've done. Things that I never would've caught or considered, e.g., the incorrect specification of let g:wiki_root
and installing wiki-ft.vim as well as wiki-vim. I will take g:wiki_global_load
out.
On testing with the revised .vimrc
I got neither highlighting nor folding. I'll include the modified .vimrc
so you can double-check my updating. I think I've done what you suggest. But I won't be surprised if you find some minor little mistake.
Regarding cloud directory vs. local directory: they are identical. My thought recently is just to have my root located in the cloud. Symlinking from the local directory to the cloud would give me a backup and maybe I should consider that. I'm open to your suggestion.
My one reservation has to do with the length of the path to the cloud. I like what you say about writing in the wiki.vim documentation. I'd like to be able to get to an open note as quickly as possible. I suspect there are ways to provide for that. I would appreciate suggestions.
call plug#begin('~/.vim/plugged')
Plug 'xolox/vim-misc'
Plug 'xolox/vim-session'
Plug 'xolox/vim-notes'
Plug 'lervag/wiki.vim'
Plug 'lervag/wiki-ft.vim'
Plug 'dahu/vim-help'
Plug 'dahu/learnvim'
Plug 'davidoc/taskpaper.vim'
call plug#end()
set encoding=utf-8
set fileencoding=utf-8
set fileformats=unix,dos,mac
set guifont=Menlo:h14
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
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).
let g:notes_directories = ['~/mydocs/notes']
let g:notes_suffix = '.txt'
let g:wiki_root = '~/library/mobile documents/com~apple~CloudDocs/vimfiles/vimwiki/'
let g:session_autoload = prompt
let g:session_lock_enabled = 0
autocmd BufRead,BufNewFile *.md :set ft=markdown
autocmd BufRead,BufNewFile *.txt set ft=markdown
" autocmd BufRead,BufNewFile *.wiki set ft=markdown
Late getting back to you. I was expecting an email notification of your response. Came here to upload what I thought might be an easier to read screenshot of the error messages. And found your response.
No problem. Don't know why the email notification failed. :\
I REALLY appreciate your help! I understand what you've done. Things that I never would've caught or considered, e.g., the incorrect specification of
let g:wiki_root
and installing wiki-ft.vim as well as wiki-vim. I will takeg:wiki_global_load
out.
Glad to hear it! :)
Regarding cloud directory vs. local directory: they are identical. My thought recently is just to have my root located in the cloud. Symlinking from the local directory to the cloud would give me a backup and maybe I should consider that. I'm open to your suggestion.
I strongly suggest that you keep things simple. As first steps, you could symlink your most important config into the cloud to keep a backup and a synced version you can use between devices. Notice that there can be sync conflicts, so just make sure to keep an eye on things.
For later, you should look into more structured bookkeeping of config files with e.g. dotfiles repos. If you search "maintaining dotfiles" you will find a LOT of resources on this. I believe Chezmoi may be a good choice for a system to maintain your dotfiles. See e.g. this blog post. But note - this is for later :)
My one reservation has to do with the length of the path to the cloud. I like what you say about writing in the wiki.vim documentation. I'd like to be able to get to an open note as quickly as possible. I suspect there are ways to provide for that. I would appreciate suggestions.
Ah, yes. You should learn how to setup shortcuts on MacOS and how to setup a shortcut to start a terminal (iterm?) that starts vim. I don't know much about Apple and MacOS stuff, so I can't help too much here, but I found e.g. this post that seems relevant. Or, perhaps better, this SO post.
I believe you can change something like set cmd to "vim"
to set cmd to "vim +WikiIndex"
or similar.
On testing with the revised
.vimrc
I got neither highlighting nor folding. I'll include the modified.vimrc
so you can double-check my updating. I think I've done what you suggest. But I won't be surprised if you find some minor little mistake.
I've checked; see a revised version below. I've tried to comment the main changes. Can you update, then ensure every plugin is installed and updated, then try if things work? If not, I'll help you debug.
call plug#begin('~/.vim/plugged')
Plug 'xolox/vim-misc'
Plug 'xolox/vim-session'
Plug 'xolox/vim-notes'
Plug 'lervag/wiki.vim'
Plug 'lervag/wiki-ft.vim'
Plug 'dahu/vim-help'
Plug 'dahu/learnvim'
Plug 'davidoc/taskpaper.vim'
call plug#end()
set encoding=utf-8
set fileencoding=utf-8
set fileformats=unix,dos,mac
set guifont=Menlo:h14
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
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).
let g:notes_directories = ['~/mydocs/notes']
let g:notes_suffix = '.txt'
" I would create a symlink to the wiki files. E.g. open a terminal and do
" ln -s '~/library/mobile documents/com~apple~CloudDocs/vimfiles/vimwiki/' vimwiki
" Note: MacOS is a BSD variant, I think, so the linker "ln -s" syntax may be
" different!
let g:wiki_root = '~/vimwiki/'
"let g:wiki_root = '~/library/mobile documents/com~apple~CloudDocs/vimfiles/vimwiki/'
" You need prompt in quotes here:
let g:session_autoload = 'prompt'
"let g:session_autoload = prompt
let g:session_lock_enabled = 0
" Markdown files should have the markdown filetype automatically
"autocmd BufRead,BufNewFile *.md :set ft=markdown
autocmd BufRead,BufNewFile *.txt set ft=markdown
Regarding cloud directory vs. local directory: they are identical. My thought recently is just to have my root located in the cloud. Symlinking from the local directory to the cloud would give me a backup and maybe I should consider that. I'm open to your suggestion.
I strongly suggest that you keep things simple. As first steps, you could symlink your most important config into the cloud to keep a backup and a synced version you can use between devices. Notice that there can be sync conflicts, so just make sure to keep an eye on things.
Will do--after we get wiki.vim working with files in the cloud. (I've checked how to do it, but will have questions when I go about doing it. I'm vague about the directionality of the link. And about what is accomplished: Will there be a copy of the local directory in the cloud. Will the cloud directory be updated when changes are made in the local directory?)
One possible issue down the road is that I'm not sure it's possible to establish a symlink from an app on an iPhone or iPad. (This suggests there may be: https://osxdaily.com/2018/01/08/get-terminal-app-ios-command-line/.) If there is there would have to be two symlinks, from local directories on the iPhone to the cloud and from the iPad to the cloud.
Having thought about it a bit, the way I've been thinking about syncing between the iPhone and iPad has me a bit confused. It's not by linking local directories on each device to a directory on the cloud, but by making the directory in the cloud the root for wiki.vim on both devices. In which case the directory in the cloud might as well be the root for wiki.vim on the MacBook too.
But maybe there are other ways of thinking about it/doing it.
For later, you should look into more structured bookkeeping of config files with e.g. dotfiles repos. If you search "maintaining dotfiles" you will find a LOT of resources on this. I believe Chezmoi may be a good choice for a system to maintain your dotfiles. See e.g. this blog post. But note - this is for later :)
Noted.
My one reservation has to do with the length of the path to the cloud. I like what you say about writing in the wiki.vim documentation. I'd like to be able to get to an open note as quickly as possible. I suspect there are ways to provide for that. I would appreciate suggestions.
Ah, yes. You should learn how to setup shortcuts on MacOS and how to setup a shortcut to start a terminal (iterm?) that starts vim. I don't know much about Apple and MacOS stuff, so I can't help too much here, but I found e.g. this post that seems relevant. Or, perhaps better, this SO post.
I believe you can change something like
set cmd to "vim"
toset cmd to "vim +WikiIndex"
or similar.
Noted. But a question I've long had: Why do people run vim in terminal? And, of course, why should I do so in this situation? (Not objecting. I just don't understand.)
On testing with the revised
.vimrc
I got neither highlighting nor folding. I'll include the modified.vimrc
so you can double-check my updating. I think I've done what you suggest. But I won't be surprised if you find some minor little mistake.I've checked; see a revised version below. I've tried to comment the main changes. Can you update, then ensure every plugin is installed and updated, then try if things work? If not, I'll help you debug.
I've made the changes you suggested. And because I'm still unclear/confused about how we'll go about syncing the iPhone/iPad and MacBook I tested them with both ~/vimwiki
and ~/library/mobile documents/com~apple~CloudDocs/vimfiles/vimwiki/
As root.
Initially I found wiki-ft.vim did not get installed. I ran PlugInstall and wiki-ft.vim got installed. But still getting neither highlighting or folding with both roots.
I'm including the updated .vimrc in case there I missed something or goofed something up.
call plug#begin('~/.vim/plugged')
Plug 'xolox/vim-misc'
Plug 'xolox/vim-session'
Plug 'xolox/vim-notes'
Plug 'lervag/wiki.vim'
Plug 'lervag/wiki-ft.vim'
Plug 'dahu/vim-help'
Plug 'dahu/learnvim'
Plug 'davidoc/taskpaper.vim'
call plug#end()
set encoding=utf-8
set fileencoding=utf-8
set fileformats=unix,dos,mac
set guifont=Menlo:h14
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
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).
let g:notes_directories = ['~/mydocs/notes']
let g:notes_suffix = '.txt'
let g:wiki_root = '~/vimwiki/'
"let g:wiki_root = '~/library/mobile documents/com~apple~CloudDocs/vimfiles/vimwiki/'
let g:session_autoload = 'prompt'
let g:session_lock_enabled = 0
autocmd BufRead,BufNewFile *.txt set ft=markdown
Will do--after we get wiki.vim working with files in the cloud. (I've checked how to do it, but will have questions when I go about doing it. I'm vague about the directionality of the link. And about what is accomplished: Will there be a copy of the local directory in the cloud. Will the cloud directory be updated when changes are made in the local directory?)
I don't really know, as I don't know exactly how the Apple cloud sync works. But my assumption would be that it syncs a set of folders for you automatically, placed at some location, e.g. at ~/library/mobile documents/com~apple~CloudDocs
.
Thus, you would have a file hierarchy looking like this:
~/
├── ...
├── ...
├── library/
│ ├── mobile documents/
│ ├── library/
│ │ └── com~apple~CloudDocs/
│ │ └── vimfiles/
│ │ └── vimwiki/
│ └── ...
└── ...
The vimwiki
folder would be synchronized and contains your wiki. Thus, if you create a link from ~/vimwiki
to the synced folder, then you could point the wiki root to the symlink.
But: This is not important. You can also just use the full cloud path. The wiki should still work equally well.
One possible issue down the road is that I'm not sure it's possible to establish a symlink from an app on an iPhone or iPad. (This suggests there may be: https://osxdaily.com/2018/01/08/get-terminal-app-ios-command-line/.) If there is there would have to be two symlinks, from local directories on the iPhone to the cloud and from the iPad to the cloud.
I would think you should not have symlinks here. Instead, you make sure to point the wiki root path to the correct location.
Having thought about it a bit, the way I've been thinking about syncing between the iPhone and iPad has me a bit confused. It's not by linking local directories on each device to a directory on the cloud, but by making the directory in the cloud the root for wiki.vim on both devices. In which case the directory in the cloud might as well be the root for wiki.vim on the MacBook too.
Yes. The symlink no the MacBook is not necessary, it would only provide for slightly easier paths.
I believe you can change something like
set cmd to "vim"
toset cmd to "vim +WikiIndex"
or similar.Noted. But a question I've long had: Why do people run vim in terminal? And, of course, why should I do so in this situation? (Not objecting. I just don't understand.)
Some of us prefer the terminal because we don't need any of the Gui related features. And keeping things "simple" helps avoid possible issues and unnecessary clutter/bloat on our computers. It is not important, though, and if you use MacVim or another gui Vim, then just use that. I believe the MacVim command from a terminal is mvim
. And the above script should probably work if you change vim
to mvim
in that case. You will have to investigate yourself, though, because, as said, I don't have MacOS and my knowledge here is limited!
I've made the changes you suggested. And because I'm still unclear/confused about how we'll go about syncing the iPhone/iPad and MacBook I tested them with both
~/vimwiki
and~/library/mobile documents/com~apple~CloudDocs/vimfiles/vimwiki/
As root.
Initially I found wiki-ft.vim did not get installed. I ran PlugInstall and wiki-ft.vim got installed. But still getting neither highlighting or folding with both roots.
Do your wiki files have the .wiki
extension? If so, after you load a file in your wiki, what is the output of :scriptnames
(copy the text into your post).
I'm including the updated .vimrc in case there I missed something or goofed something up.
No, it looks good. So, with this version: Does :WikiIndex
work with either or both of the g:wiki_root
settings?
By the way, it would be useful if you read up on Markdown formatting on Github. In particular, use the backtick `path`
to write paths (notice that ~text~
gives strikethrough ~text~), and use triple backticks to indicate a code snippet:
```vim
let g:wiki_root = '~/path'
```
gives this:
let g:wiki_root = '~/path'
Yes. The symlink no the MacBook is not necessary, it would only provide for slightly easier paths.
I believe you can change something like
set cmd to "vim"
toset cmd to "vim +WikiIndex"
or similar.
Responding summarily to your comments on symlinking, for the time being I'll put that aside. Once we get the syntax working, I'll explore shortcuts as a way to get more quickly to the index file. (Or, perhaps preferably, to a new file. If I could do that, would there be a way, after composing and saving, to get the new file incorporated back into the index?)
I've made the changes you suggested. And because I'm still unclear/confused about how we'll go about syncing the iPhone/iPad and MacBook I tested them with both
~/vimwiki
and~/library/mobile documents/com~apple~CloudDocs/vimfiles/vimwiki/
As root.Initially I found wiki-ft.vim did not get installed. I ran PlugInstall and wiki-ft.vim got installed. But still getting neither highlighting or folding with both roots.
Do your wiki files have the
.wiki
extension? If so, after you load a file in your wiki, what is the output of:scriptnames
(copy the text into your post).
Yes, they do. I don't know how to capture the output of :scriptnames. There are 75 lines. I don't see a way to get a copy of all of them. Only those showing in the window. I could get them in two screenshots.
I'm including the updated .vimrc in case there I missed something or goofed something up.
No, it looks good. So, with this version: Does
:WikiIndex
work with either or both of theg:wiki_root
settings?
I take it that's a command line command. I get "Not an editor command" on both roots.
And I don't know if this is possible, but I swear on one try on the local root I got highlighting but no folding. But on every try after that on both roots I again got neither highlighting nor folding.
By the way, it would be useful if you read up on Markdown formatting on Github. In particular, use the backtick
`path`
to write paths (notice that~text~
gives strikethrough ~text~), and use triple backticks to indicate a code snippet:
I've given it a quick look. I'll refer to it in the future. And maybe study it, too.
I put the current .vimrc in the .vim folder on my iPad. Get highlighting and folding. A couple of anomalies, though.
First, wiki.vim related: when I back out of a series of links all pages with links remain open when I get back to the top level. After I do “:bd” on the index the next level down is still open, on down as far as I have gone. I have to do an explicit “:bd” at each level. Didn’t happen with vimwiki.
Second, more generally. I don’t have line/word wrap. I did “:set wrap” with a file open. I considered putting into into the .vimrc, but that wasn’t necessary previously. And it wasn’t necessary with this configuration on the MacBook.
Do your wiki files have the
.wiki
extension? If so, after you load a file in your wiki, what is the output of:scriptnames
(copy the text into your post).Yes, they do. I don't know how to capture the output of :scriptnames. There are 75 lines. I don't see a way to get a copy of all of them. Only those showing in the window. I could get them in two screenshots.
Ehm... The lines should be displayed, so you could just select them with your mouse and copy them? Or use a screenshot tool?
No, it looks good. So, with this version: Does
:WikiIndex
work with either or both of theg:wiki_root
settings?I take it that's a command line command. I get "Not an editor command" on both roots.
No; :WikiIndex
means that after you start Vim, then you type :WikiIndex
. It's a command. If you get "Not an editor command", then, for some reason, wiki.vim is not properly loaded/installed in your system. That's the first thing you should fix/get working!
I put the current .vimrc in the .vim folder on my iPad. Get highlighting and folding. A couple of anomalies, though.
First, wiki.vim related: when I back out of a series of links all pages with links remain open when I get back to the top level. After I do “:bd” on the index the next level down is still open, on down as far as I have gone. I have to do an explicit “:bd” at each level. Didn’t happen with vimwiki.
If you have set hidden
, buffers are not deleted when you close them. wiki.vim does not wipe your buffers, as that would be intrusive (in my opinion).
Also: you should learn to describe what you do more explicitly. You say "when I back out of ..." - what does that mean? How do you back out? How can I help you without knowing specifically what you do? In this case, I assume you mean that you press the backspace key, which is mapped by wiki.vim to return to the previous position. But, as mentioned, wiki.vim does not close your buffers.
Second, more generally. I don’t have line/word wrap. I did “:set wrap” with a file open. I considered putting into into the .vimrc, but that wasn’t necessary previously. And it wasn’t necessary with this configuration on the MacBook.
The wrap
setting is not global, so you should not put it in your .vimrc
. It is specific to a buffer. So, you could add it with an autocommand or in a custom ~/.vim/ftplugin/wiki.vim
file. This is not really relevant to wiki.vim, though; this is just how Vim works.
Ehm... The lines should be displayed, so you could just select them with your mouse and copy them? Or use a screenshot tool?
The screen doesn't scroll while selecting. I combined two selections. Here's the result:
1: /Applications/MacVim.app/Contents/Resources/vim/vimrc
2: ~/.vimrc
3: ~/.vim/autoload/plug.vim
4: /Applications/MacVim.app/Contents/Resources/vim/runtime/filetype.vim
5: ~/.vim/plugged/wiki-ft.vim/ftdetect/wiki.vim
6: ~/.vim/plugged/taskpaper.vim/ftdetect/taskpaper.vim
7: /Applications/MacVim.app/Contents/Resources/vim/runtime/menu.vim
8: /Applications/MacVim.app/Contents/Resources/vim/runtime/autoload/paste.vim
9: /Applications/MacVim.app/Contents/Resources/vim/runtime/ftplugin.vim
10: /Applications/MacVim.app/Contents/Resources/vim/runtime/indent.vim
11: /Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/syntax.vim
12: /Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/synload.vim
13: /Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/syncolor.vim
14: ~/.vim/plugin/calendar.vim
15: ~/.vim/plugin/hilinks.vim
16: ~/.vim/plugin/wc.vim
17: ~/.vim/plugged/vim-misc/plugin/xolox/misc.vim
18: ~/.vim/plugged/vim-session/plugin/session.vim
19: ~/.vim/pack/plugins/start/vim-misc/autoload/xolox/misc.vim
20: ~/.vim/pack/plugins/start/vim-misc/autoload/xolox/misc/os.vim
21: ~/.vim/pack/plugins/start/vim-misc/autoload/xolox/misc/cursorhold.vim
22: ~/.vim/plugged/vim-notes/plugin/notes.vim
23: ~/.vim/pack/plugins/start/vim-notes/autoload/xolox/notes.vim
24: ~/.vim/pack/plugins/start/vim-misc/autoload/xolox/misc/path.vim
25: ~/.vim/plugged/wiki.vim/plugin/wiki.vim
26: ~/.vim/plugged/wiki.vim/autoload/wiki/init.vim
27: ~/.vim/plugged/wiki.vim/autoload/wiki/u.vim
28: ~/.vim/plugged/wiki.vim/autoload/wiki/tags.vim
29: ~/.vim/plugged/vim-help/plugin/help.vim
30: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/getscriptPlugin.vim
31: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/gzip.vim
32: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/logiPat.vim
33: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/manpager.vim
34: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/matchparen.vim
35: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/netrwPlugin.vim
36: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/rrhelper.vim
37: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/spellfile.vim
38: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/tarPlugin.vim
39: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/tohtml.vim
40: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/vimballPlugin.vim
41: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/zipPlugin.vim
42: ~/.vim/pack/plugins/start/taskpaper.vim/ftdetect/taskpaper.vim
43: ~/.vim/pack/plugins/start/vim-help/plugin/help.vim
44: ~/.vim/pack/plugins/start/vim-misc/plugin/xolox/misc.vim
45: ~/.vim/pack/plugins/start/vim-notes/plugin/notes.vim
46: ~/.vim/pack/plugins/start/vim-session/plugin/session.vim
47: ~/.vim/pack/plugins/start/vimwiki/plugin/vimwiki.vim
48: ~/.vim/pack/plugins/start/vimwiki/autoload/vimwiki/vars.vim
49: ~/.vim/pack/plugins/start/vimwiki/autoload/vimwiki/u.vim
50: /Applications/MacVim.app/Contents/Resources/vim/gvimrc
51: /Applications/MacVim.app/Contents/Resources/vim/runtime/colors/macvim.vim
52: ~/.gvimrc
53: ~/.vim/colors/torte.vim
54: ~/.vim/pack/plugins/start/vim-session/autoload/xolox/session.vim
55: ~/.vim/pack/plugins/start/vim-misc/autoload/xolox/misc/option.vim
56: ~/.vim/pack/plugins/start/vim-misc/autoload/xolox/misc/msg.vim
No;
:WikiIndex
means that after you start Vim, then you type:WikiIndex
. It's a command. If you get "Not an editor command", then, for some reason, wiki.vim is not properly loaded/installed in your system. That's the first thing you should fix/get working!
I had typed the command incorrectly, i.e., as :Wikiindex
. Typed correctly, with the local /vimwiki
as root, index.wiki
loaded, but without highlighting. With /vimwiki
in the cloud as as root :WikiIndex
loaded index.wiki
with highlighting. (If loaded by doing enter
on the filename in netrw, index.wiki
loads without highlighting.)
First, wiki.vim related: when I back out of a series of links all pages with links remain open when I get back to the top level. After I do “:bd” on the index the next level down is still open, on down as far as I have gone. I have to do an explicit “:bd” at each level. Didn’t happen with vimwiki.
If you have
set hidden
, buffers are not deleted when you close them. wiki.vim does not wipe your buffers, as that would be intrusive (in my opinion).
I don't have set hidden
. It's not in my .vimrc
. I notice a distinction between "deleting" and "closing." In my naiveté I would have taken them to be equivalent. In don't understand the comment about intrusiveness. (No doubt due to the fact that I'm a near ignoramus about vim.)
If what I observed is what I should have seen, it makes me uncomfortable. Perhaps I don't understand. But if I follow links down four levels and then backspace to the top level and then close the top level file, why would I want the files I passed through on the way down and back up to remain open? Presumably they are no longer of interest to me.
But then it occurs to me I am unlikely to ever close the top level (index.wiki) file. As long as I keep navigating in and out of it I'm never going to notice those files still hanging around.
But why keep them hanging around? I can always get to them from any higher level in the chain of links.
Also: you should learn to describe what you do more explicitly. You say "when I back out of ..." - what does that mean? How do you back out? How can I help you without knowing specifically what you do?
My apologies. I can certainly describe more carefully, more objectively.
Second, more generally. I don’t have line/word wrap. I did “:set wrap” with a file open. I considered putting into into the .vimrc, but that wasn’t necessary previously. And it wasn’t necessary with this configuration on the MacBook.
The
wrap
setting is not global, so you should not put it in your.vimrc
. It is specific to a buffer. So, you could add it with an autocommand or in a custom~/.vim/ftplugin/wiki.vim
file. This is not really relevant to wiki.vim, though; this is just how Vim works.
Hmm. With same .vimrc
I get wrapping with files opened in the MacBook, but not in files opened on the iPad. (This is new on the iPad. I believe previously the only relevant setting in my .vimrc
on the iPad was set linebreak
.)
One of the very first things I sought help with in vim was getting lines to wrap. I have never since had lines not wrap. I think the only setting I've ever had related to that is set linebreak.
Reading up on wrapping on the web I found: put ':set wrap` in your .vimrc; vim wraps by default; if lines wrap virtually, the cursor will still move between logical lines. (I've never experienced that.) Confusing.
I am not a coder. I imagine no context in which I would not want lines/words to wrap.
Bottom line: Except for lines/words not wrapping wiki.vim
is working on the iPad, i.e., I get both highlighting and folding. On the MacBook I get highlighting with :WikiIndex
; but neither highlighting nor folding when files are opened from netrw.
The screen doesn't scroll while selecting. I combined two selections. Here's the result:
Thanks! This makes it easy for me to confirm that 1) you've loaded wiki.vim properly, and 2) you've loaded wiki-ft.vim. But it shows more! For some reason, you have plugins located in both ~/.vim/plugged
and in ~/.vim/pack/plugins
. If you use vim-plug, then you probably don't want those and you should delete the ~/.vim/pack
directory from your system. I find these plugins loaded in your system:
These are in your personal config - you should be aware that they are also
loaded in general. They may interfere with other things. What is hilinks.vim?
~/.vim/plugin/calendar.vim
~/.vim/plugin/hilinks.vim
~/.vim/plugin/wc.vim
Loaded by vim-plug
~/.vim/plugged/wiki-ft.vim
~/.vim/plugged/vim-notes
~/.vim/plugged/wiki.vim
~/.vim/plugged/vim-help
Loaded automatically with the "new" package feature in Vim (because the files
are there)
~/.vim/pack/plugins/start/vim-misc
~/.vim/pack/plugins/start/vim-notes
~/.vim/pack/plugins/start/taskpaper.vim
~/.vim/pack/plugins/start/vim-help
~/.vim/pack/plugins/start/vim-session
~/.vim/pack/plugins/start/vimwiki
I also notice you have a .gvimrc
file with additional config. It may also be relevant!
No;
:WikiIndex
means that after you start Vim, then you type:WikiIndex
. It's a command. If you get "Not an editor command", then, for some reason, wiki.vim is not properly loaded/installed in your system. That's the first thing you should fix/get working!I had typed the command incorrectly, i.e., as
:Wikiindex
. Typed correctly, with the local/vimwiki
as root,index.wiki
loaded, but without highlighting. With/vimwiki
in the cloud as as root:WikiIndex
loadedindex.wiki
with highlighting. (If loaded by doingenter
on the filename in netrw,index.wiki
loads without highlighting.)
After you've loaded index.wiki
, if you lack highlighting and/or folding: Can
you do :scriptnames
and again list the files?
I don't have
set hidden
. It's not in my.vimrc
.
It may still be active. Check with :set hidden?
.
I notice a distinction between "deleting" and "closing." In my naiveté I would have taken them to be equivalent. In don't understand the comment about intrusiveness. (No doubt due to the fact that I'm a near ignoramus about vim.)
Buffers in Vim may be a little bit hard to get. With :set hidden
, buffers will not be wiped/removed when you close them. This is generally useful when working with code or working with multiple files. I can see how it may not be useful in your workflow, and then you might actually want set nohidden
.
If what I observed is what I should have seen, it makes me uncomfortable. Perhaps I don't understand. But if I follow links down four levels and then backspace to the top level and then close the top level file, why would I want the files I passed through on the way down and back up to remain open? Presumably they are no longer of interest to me.
It is customizable behaviour. You can learn about it by reading :help buffers
.
Also: you should learn to describe what you do more explicitly. You say "when I back out of ..." - what does that mean? How do you back out? How can I help you without knowing specifically what you do?
My apologies. I can certainly describe more carefully, more objectively.
Good :) Notice though, that describing things like this is actually harder than you'd think. But it is a very good skill to have, and I encourage you to work on it.
Second, more generally. I don’t have line/word wrap. I did “:set wrap” with a file open. I considered putting into into the .vimrc, but that wasn’t necessary previously. And it wasn’t necessary with this configuration on the MacBook.
The
wrap
setting is not global, so you should not put it in your.vimrc
. It is specific to a buffer. So, you could add it with an autocommand or in a custom~/.vim/ftplugin/wiki.vim
file. This is not really relevant to wiki.vim, though; this is just how Vim works.Hmm. With same
.vimrc
I get wrapping with files opened in the MacBook, but not in files opened on the iPad. (This is new on the iPad. I believe previously the only relevant setting in my.vimrc
on the iPad wasset linebreak
.)One of the very first things I sought help with in vim was getting lines to wrap. I have never since had lines not wrap. I think the only setting I've ever had related to that is
set linebreak.
This option is not relevant to behaviour when adding text, only to how it is displayed. You want set textwidth=0
to avoid having lines being broken at certain points. You may also want to add set formatoptions-=t
. Both options are local and may be set by other plugins as well.
Reading up on wrapping on the web I found: put ':set wrap` in your .vimrc; vim wraps by default; if lines wrap virtually, the cursor will still move between logical lines. (I've never experienced that.) Confusing.
Yes, sorry. I may have been a bit fast. I was "correct", except in that it does make sense to add set wrap
in your .vimrc
file. This will change the default behaviour and thus the behaviour in most cases. But you may be surprised if you do not understand the concept of local options (local to window or buffer). And :set wrap
is a window-local option.
If you find that the option is not as you thought it should be, then you can do :verbose set wrap?
to see where it was last changed.
By the way: wiki-ft.vim does :set nowrap
. Simply because it is my preferred setting. Sorry! You may easily override it by adding a file ~/.vim/after/ftplugin/wiki.vim
where you add set wrap
.
Bottom line: Except for lines/words not wrapping
wiki.vim
is working on the iPad, i.e., I get both highlighting and folding. On the MacBook I get highlighting with:WikiIndex
; but neither highlighting nor folding when files are opened from netrw.
It seems we are getting close, then?
Just a brief check in.
Thanks! This makes it easy for me to confirm that 1) you've loaded wiki.vim properly, and 2) you've loaded wiki-ft.vim. But it shows more! For some reason, you have plugins located in both
~/.vim/plugged
and in~/.vim/pack/plugins
. If you use vim-plug, then you probably don't want those and you should delete the~/.vim/pack
directory from your system. I find these plugins loaded in your system:
I deleted ~/.vim/pack/plugins
These are in your personal config - you should be aware that they are also loaded in general. They may interfere with other things. What is hilinks.vim? ~/.vim/plugin/calendar.vim ~/.vim/plugin/hilinks.vim ~/.vim/plugin/wc.vim
I deleted them. I don't remember what hljinks.vim
was for. I can get calendar and word count plugins later.
I also notice you have a
.gvimrc
file with additional config. It may also be relevant!
I checked it out. Seemed to be only about configuration of the basic vim window.
After you've loaded
index.wiki
, if you lack highlighting and/or folding: Can you do:scriptnames
and again list the files?
I now have highlighting and folding with both ~/vimwiki
and ~/library/mobile documents/....
as root. Yay!
I don't have
set hidden
. It's not in my.vimrc
.It may still be active. Check with
:set hidden?
.
Buffers in Vim may be a little bit hard to get. With
:set hidden
, buffers will not be wiped/removed when you close them. This is generally useful when working with code or working with multiple files. I can see how it may not be useful in your workflow, and then you might actually wantset nohidden
.
I get no hidden
. But buffers are still not being removed as I backspace up the link chain.
Good :) Notice though, that describing things like this is actually harder than you'd think. But it is a very good skill to have, and I encourage you to work on it.
I understand. I studied philosophy. Including logic. Including symbolic logic. I'm a half-decent writer. I can be clear and precise when it's important.
That is sometimes helpful in writing for general audiences too. But sometimes for them things don't have to be spelled out. Sometimes for them it's even more effective to leave a bit of the details, sometimes even a good bit, to be filled out by them. But that's another ballgame
Yes, sorry. I may have been a bit fast. I was "correct", except in that it does make sense to add
set wrap
in your.vimrc
file. This will change the default behaviour and thus the behaviour in most cases. But you may be surprised if you do not understand the concept of local options (local to window or buffer). And:set wrap
is a window-local option.If you find that the option is not as you thought it should be, then you can do
:verbose set wrap?
to see where it was last changed.By the way: wiki-ft.vim does
:set nowrap
. Simply because it is my preferred setting. Sorry! You may easily override it by adding a file~/.vim/after/ftplugin/wiki.vim
where you addset wrap
.
I put set wrap
in my .vimrc
on the MacBook. That had no effect. I created ~/.vim/after/ftplugin/wiki.vim
with set wrap
. Did the same on the iPad. Now have wrapping i both environments. Perhaps there will come a context in which I'll lose it?
Should I eave set wrap
in the .vimrc
?
It seems we are getting close, then?
Very. The only remaining problem buffers not closing when I backspace up a chain of links. That's on the iPad as well as the MacBook.
A couple questions: Can I rename my vimwiki
directory or will that screw up the linking of files in it? Can I have more than one wiki? I may have left the stuff in the vimwiki
directory behind. I might be setting out in a different direction. Might want a completely new directory.
So, very, very close. I'm gonna wannathank you when we're finally done, though nothing's finally final. I'll never be a coder. But I'd like to be more conversant/competent with vim than I am. Undoubtedly I'll run into more walls. But for now--thank you, thank you, thank you!
After you've loaded
index.wiki
, if you lack highlighting and/or folding: Can you do:scriptnames
and again list the files?I now have highlighting and folding with both
~/vimwiki
and~/library/mobile documents/....
as root. Yay!
Cool! :)
I don't have
set hidden
. It's not in my.vimrc
.It may still be active. Check with
:set hidden?
.Buffers in Vim may be a little bit hard to get. With
:set hidden
, buffers will not be wiped/removed when you close them. This is generally useful when working with code or working with multiple files. I can see how it may not be useful in your workflow, and then you might actually wantset nohidden
.I get
no hidden
. But buffers are still not being removed as I backspace up the link chain.
Ok; that's strange. We might want to investigate this point further. I'll add a new comment after this one.
Good :) Notice though, that describing things like this is actually harder than you'd think. But it is a very good skill to have, and I encourage you to work on it.
I understand. I studied philosophy. Including logic. Including symbolic logic. I'm a half-decent writer. I can be clear and precise when it's important.
Sounds true. I hope you were not offended.
That is sometimes helpful in writing for general audiences too. But sometimes for them things don't have to be spelled out. Sometimes for them it's even more effective to leave a bit of the details, sometimes even a good bit, to be filled out by them. But that's another ballgame
Agreed!
Yes, sorry. I may have been a bit fast. I was "correct", except in that it does make sense to add
set wrap
in your.vimrc
file. This will change the default behaviour and thus the behaviour in most cases. But you may be surprised if you do not understand the concept of local options (local to window or buffer). And:set wrap
is a window-local option. If you find that the option is not as you thought it should be, then you can do:verbose set wrap?
to see where it was last changed. By the way: wiki-ft.vim does:set nowrap
. Simply because it is my preferred setting. Sorry! You may easily override it by adding a file~/.vim/after/ftplugin/wiki.vim
where you addset wrap
.I put
set wrap
in my.vimrc
on the MacBook. That had no effect. I created~/.vim/after/ftplugin/wiki.vim
withset wrap
. Did the same on the iPad. Now have wrapping i both environments. Perhaps there will come a context in which I'll lose it?
No, I don't think so. It would surprise me.
Should I eave
set wrap
in the.vimrc
?
Yes. Leave it, if you want set wrap
also for other filetypes. For the wiki
filetype, wiki-ft.vim will set nowrap
, thus you need to override with ~/.vim/after/ftplugin/wiki.vim
.
It seems we are getting close, then?
Very. The only remaining problem buffers not closing when I backspace up a chain of links. That's on the iPad as well as the MacBook.
Good to hear!
A couple questions: Can I rename my
vimwiki
directory or will that screw up the linking of files in it?
Yes, you can name it whatever you want. Just point g:wiki_root
to the correct path and things should work.
Can I have more than one wiki?
Yes, but you can only have a single g:wiki_root
, which specifies the default wiki. If you have a second wiki, most/all of the wiki functionality should still work as long as you first open one of the files in the other wiki.
So, very, very close. I'm gonna wannathank you when we're finally done, though nothing's finally final. I'll never be a coder. But I'd like to be more conversant/competent with vim than I am. Undoubtedly I'll run into more walls. But for now--thank you, thank you, thank you!
I'm glad to help! :) (Learning Vim is, as you already know, a long journey. There are a lot of features and a lot of things to learn. I strongly recommend it, but I think an important prerequisite is that you find the journey to be at least somewhat fun and interesting!)
So, it seems the final point to figure out is your workflow with backspace navigation. Can you
- Open a wiki file (e.g.
:WikiIndex
) and follow one link. - Show the output of
:map <bs>
. - Show the output of
:ls!
. - Press
<bs>
. - Show the output of
:ls!
again. - Explain the step(s) from here that leads to the unexpected behaviour. Be precise (which keys do you press, and so on).
Tried to be as explicit as possible.
Curious why the ordering of files listed by ls!
is the same after going down one link and then going back up one link. I expected they would be reversed going back up.
-
I entered
:WikiIndex
. -
I typed
<return>
on a link. -
Entering
:map <bs>
produced "no mapping found." -
Entering
ls!
produced:1 # `~/library/mobile documents/com~apple~CloudDocs/vimfiles/vimwiki/index.wiki` line 12 2 %a `~/library/mobile documents/com~apple~CloudDocs/vimfiles/vimwiki/Philosophy.wiki` line 1
-
Pressed backspace.
-
Entering
ls!
produced:1 %a `~/library/mobile documents/com~apple~CloudDocs/vimfiles/vimwiki/index.wiki` line 12 2 # `~/library/mobile documents/com~apple~CloudDocs/vimfiles/vimwiki/Philosophy.wiki` line 1
-
Entered
bd
withindex
open.index
closed.philosophy.wiki
remains open. -
Entered
bd
withphilosophy.wiki
open.philosophy.wiki
closed.
For some reason vim
(iVim
) on my iPhone has only two top level folders--pack
and sessions
. (On the iPad it has a complete set.) Without /after/ftplugin/
there's no place to put a wiki.vim
with set wrap.
.
Wondering if I change change set local nowrap
in wiki-ft.vim/ftplugin/wiki.vim
to wrap
.
Tried to be as explicit as possible.
Thanks!
Curious why the ordering of files listed by
ls!
is the same after going down one link and then going back up one link. I expected they would be reversed going back up.
Each file opened in Vim is read into a buffer; each buffer gets a number. These persist throughout a session. So, buffer 1 is the first file you opened, and it remains so until you quit.
1. I entered `:WikiIndex`. 2. I typed `<return>` on a link. 3. Entering `:map <bs>` produced "no mapping found."
That's strange! It should show something like this:
n <BS> @<Plug>(wiki-link-return)
Did you type :map <bs>
verbatim?
After the same steps 1 and 2, what is the output after :echo b:wiki
?
5. Pressed backspace.
Backspace should have no significant effect unless it is mapped, so this is somehow inconsistent with the result from point 3. Notice the default behaviour in Vim of <bs>
(see :help <bs>
) is to move the cursor left.
6. Entering `ls!`produced: ``` 1 %a `~/library/mobile documents/com~apple~CloudDocs/vimfiles/vimwiki/index.wiki` line 12 2 # `~/library/mobile documents/com~apple~CloudDocs/vimfiles/vimwiki/Philosophy.wiki` line 1 ```
This is the expected result.
7. Entered `bd` with `index` open. `index` closed. `philosophy.wiki` remains open.
I'm curious: what do you want to achieve with :bd
? Do you want to close Vim? Or close the current buffer and have a "fresh/empty" buffer?
For some reason
vim
(iVim
) on my iPhone has only two top level folders--pack
andsessions
. (On the iPad it has a complete set.) Without/after/ftplugin/
there's no place to put awiki.vim
withset wrap.
.
Can't you just create these folders yourself?
Wondering if I change change
set local nowrap
inwiki-ft.vim/ftplugin/wiki.vim
towrap
.
Of course, you're free to do what you want. But then, if there is an update or change in wiki-ft.vim that is pushed to Github, you will not be able to immediately update before you undo that change.
1. I entered `:WikiIndex`. 2. I typed `<return>` on a link. 3. Entering `:map <bs>` produced "no mapping found."
That's strange! It should show something like this:
n <BS> @<Plug>(wiki-link-return)
Did you type
:map <bs>
verbatim?
I misread the brackets. I didn't realize they were to be typed literally. When typed literally :map <bs>
returned: n <BS> @<Plug>(wiki-link-return)
.
After the same steps 1 and 2, what is the output after
:echo b:wiki
?
It is ``{'in_journal': v:false, 'link_extension': '', 'index_name': 'index', 'extension': 'wiki'}`
5. Pressed backspace.
Backspace should have no significant effect unless it is mapped, so this is somehow inconsistent with the result from point 3. Notice the default behaviour in Vim of
<bs>
(see:help <bs>
) is to move the cursor left.
I take it the result I got entering :map <bs>
literally removes the inconsistency.
7. Entered `bd` with `index` open. `index` closed. `philosophy.wiki` remains open.
I'm curious: what do you want to achieve with
:bd
? Do you want to close Vim? Or close the current buffer and have a "fresh/empty" buffer?
I just want to close the buffer. Actually, what I want is for backspacing up a series of links to close each open buffer along the way.
But that is not strictly necessary. If I never do bd
on the index
I will never notice the buffers left open. But when I go to quit vim won't I have to close all those buffers?
For some reason
vim
(iVim
) on my iPhone has only two top level folders--pack
andsessions
. (On the iPad it has a complete set.) Without/after/ftplugin/
there's no place to put awiki.vim
withset wrap.
.Can't you just create these folders yourself?
I'll give that a try. I take it don't have to create all the folders, just ~/.vim/after/ftplugin
.
Wondering if I change change
set local nowrap
inwiki-ft.vim/ftplugin/wiki.vim
towrap
.Of course, you're free to do what you want. But then, if there is an update or change in wiki-ft.vim that is pushed to Github, you will not be able to immediately update before you undo that change.
If I'm able to create ~/.vim/after/ftplugin/wiki.vim
with set wrap
in it I won't change the setting in wiki-ft.vim
.
Did you type
:map <bs>
verbatim?I misread the brackets. I didn't realize they were to be typed literally. When typed literally
:map <bs>
returned:n <BS> @<Plug>(wiki-link-return)
.
That was my guess :)
Backspace should have no significant effect unless it is mapped, so this is somehow inconsistent with the result from point 3. Notice the default behaviour in Vim of
<bs>
(see:help <bs>
) is to move the cursor left.I take it the result I got entering
:map <bs>
literally removes the inconsistency.
Yes.
I'm curious: what do you want to achieve with
:bd
? Do you want to close Vim? Or close the current buffer and have a "fresh/empty" buffer?I just want to close the buffer. Actually, what I want is for backspacing up a series of links to close each open buffer along the way.
But that is not strictly necessary. If I never do
bd
on theindex
I will never notice the buffers left open. But when I go to quit vim won't I have to close all those buffers?
What is the point of :bd
on the index
; is it because you want to quit Vim? I guess not, because :bd
will never quit Vim, you should rather do :q
for that. But I don't understand the workflow/idea behind doing :bd
in any case. This is why I am asking; I believe you may just be making things unnecessarily complicated.
Of course, an alternative is to add a custom mapping in your after/ftplugin/wiki.vim
:
nmap <bs> <plug>(wiki-link-return):bd #<cr>
Still, I believe this is not really necessary.
For some reason
vim
(iVim
) on my iPhone has only two top level folders--pack
andsessions
. (On the iPad it has a complete set.) Without/after/ftplugin/
there's no place to put awiki.vim
withset wrap.
.Can't you just create these folders yourself?
I'll give that a try. I take it don't have to create all the folders, just
~/.vim/after/ftplugin
.
I don't see why this would not just work.
What is the point of
:bd
on theindex
; is it because you want to quit Vim? I guess not, because:bd
will never quit Vim, you should rather do:q
for that. But I don't understand the workflow/idea behind doing:bd
in any case. This is why I am asking; I believe you may just be making things unnecessarily complicated.
I think so. In Vimwiki I don’t think I ever did bd
on the index. I used the sessions
app with several directories open in tabs. When I quit I would close the session, then quit vim
. In any case, if I don’t do bd
I won’t notice the open buffers.
Of course, an alternative is to add a custom mapping in your
after/ftplugin/wiki.vim
:nmap <bs> <plug>(wiki-link-return):bd #<cr>
I don’t understand that. Guessing backspacing on a link closes the buffer containing the link?
In that connection, wondering about a not necessarily simplistic user friendly way to begin learning the ins and outs of wiki.vim. A pdf of the list of commands given in the documentation would be helpful. The vim help files have always been largely Greek to me. Learning to negotiate them would help.
For some reason
vim
(iVim
) on my iPhone has only two top level folders--pack
andsessions
. (On the iPad it has a complete set.) Without/after/ftplugin/
there's no place to put awiki.vim
withset wrap.
.Can't you just create these folders yourself?
I did. And now I have wrapping without changing the setting in wiki.vim
.
I think we’ve solved the pressing problems. You’ve spent a horrendous amount of time with me. Again, I really, really appreciate it
What is the point of
:bd
on theindex
; is it because you want to quit Vim? I guess not, because:bd
will never quit Vim, you should rather do:q
for that. But I don't understand the workflow/idea behind doing:bd
in any case. This is why I am asking; I believe you may just be making things unnecessarily complicated.I think so. In Vimwiki I don’t think I ever did
bd
on the index. I used thesessions
app with several directories open in tabs. When I quit I would close the session, then quitvim
. In any case, if I don’t dobd
I won’t notice the open buffers.
Ok. :)
Of course, an alternative is to add a custom mapping in your
after/ftplugin/wiki.vim
:nmap <bs> <plug>(wiki-link-return):bd #<cr>
I don’t understand that. Guessing backspacing on a link closes the buffer containing the link?
Sorry, I forgot to add an explanation. So:
nmap <bs> <plug>(wiki-link-return):bd #<cr>
First, nmap LHS RHS
is the vimscript command to create a recursive mapping from LHS to RHS. Since <plug>(wiki-link-return)
is a mapping created by wiki.vim, we need a recursive map - and it makes sense if you understand "recursive" as "being nestable". You would use nnoremap
for non recursive mappings, which will only allow the built-in maps in the RHS. Notice that it is recommended to use nnoremap
or other noremap
variants for custom mappings in general, unless you need the recursive property (which we do here).
With a map like this, when you press LHS, in this case <bs>
- but it could be one or a sequence of keys - Vim will execute the RHS set of keys. So, first, the <plug>(wiki-link-return)
mapping will be executed, which is what wiki.vim by default maps to <bs>
already. Next, we add :bd #<cr>
, which will delete the alternate buffer (#
). To understand this, you need to read how :bd
works with respect to arguments (:help :bd
) and what the # means in this context (:help :_#
). The final <cr>
is necessary to actually execute the command line.
I hope that helps!
In that connection, wondering about a not necessarily simplistic user friendly way to begin learning the ins and outs of wiki.vim. A pdf of the list of commands given in the documentation would be helpful. The vim help files have always been largely Greek to me. Learning to negotiate them would help.
Ah, yes. This is where I would say, first, don't panic. It's a lot of material to cover. I strongly recommend that you spend a couple of hours reading from the vim help files. You probably already know a bit more than the basics, which is what you learn from vimtutor
. It may still be useful to complete it, if you never did. Next, these are some recommended sources:
- The user manual is really quite good. It is lengthy, and there's probably a lot of stuff you are not interested in. Still, I recommend at least that you skim it. You find it in Vim with
:help user-manual
, but I also know of two PDF variants: - There are a lot of blog posts out there. I've noted Steps to learn Vim by Jakub Łukasiewicz as a relatively short and good source for tips on how to learn Vim.
- There's also the famous Your problem with Vim is that you don't grok vi. It's a nice read, although a little bit on the side in this context, perhaps.
For some reason
vim
(iVim
) on my iPhone has only two top level folders--pack
andsessions
. (On the iPad it has a complete set.) Without/after/ftplugin/
there's no place to put awiki.vim
withset wrap.
.Can't you just create these folders yourself?
I did. And now I have wrapping without changing the setting in
wiki.vim
.I think we’ve solved the pressing problems. You’ve spent a horrendous amount of time with me. Again, I really, really appreciate it
Great, I'm glad to hear it! Feel free to close the issue if you think it is resolved, and feel free to open new issues if you have other questions/problems/bugs, etc.
For some reason
vim
(iVim
) on my iPhone has only two top level folders--pack
andsessions
. (On the iPad it has a complete set.) Without/after/ftplugin/
there's no place to put awiki.vim
withset wrap.
.
I may be off base here, but just glancing at this I'm wondering whether iVim respects plugin directories in the usual way. I say this because it has its own plugin manager, iplug, which in my experience I've had to use to install plugins. I just assumed that there was some iOS limitation which made this necessary.
For some reason
vim
(iVim
) on my iPhone has only two top level folders--pack
andsessions
. (On the iPad it has a complete set.) Without/after/ftplugin/
there's no place to put awiki.vim
withset wrap.
.I may be off base here, but just glancing at this I'm wondering whether iVim respects plugin directories in the usual way. I say this because it has its own plugin manager, iplug, which in my experience I've had to use to install plugins. I just assumed that there was some iOS limitation which made this necessary.
I have iVim on an iPad as well as iPhone. On the iPad it has the complete set of vim directories. No doubt someone knows the reason for the difference--probably Terry--but I sure don't
That said, three things I like about iVim: the enhanced keyboard; plug; and iexdir. Vim is no longer crippled on iPhone or iPad.