People

Repo info

Activity

@Shougo the complete config (including bundlrc and stuff) is in this repo in the ohcibi branch

if you need to see something else than the vimrc

i'll also try to bisect that file after lunch

Shougo

@Shougo

Bisecting is needed...

less than 50 lines are better.

Tobias Witt

@ohcibi

@Shougo it must be the results

of the file_rec

if I change the directory, there is no segfault

Shougo

@Shougo

Hm.

Zhaosheng Pan

@brglng

Hi @Shougo , I would like to ask a question about the correct use of dein. Before using dein, I have long used vim-plug, and I put all my plugins at ~/.vim/plug, where ~/.vim is actually a symlink to a synced directory in my Dropbox, so that the whole vim configuration is synced. I continued this habit when started using dein, but I found the configuration if often broken when I have synced between different OS'es, e.g., between Linux and macOS. Then I checked the cache_* file in dein's directory and found dein records absolute paths in its cache, so that the paths are broken between different OS'es, e.g., on Linux it may be /home/username/.vim/dein/.cache and macOS it may be /Users/username/.vim/dein/.cache. I read the doc and it says the typical directory for dein is ~/.cache/dein or ~/.local/share/dein. So does that mean the correct use of dein is to put its directory at some OS-specific path, which should not be synced? As a result, do we have to :call dein#install() or :call dein#update() when setting up the vim configuration for a new computer? Thank you!

Shougo

@Shougo

You can set g:dein#cache_directory for it.

Zhaosheng Pan

@brglng

Thank you! This solves my problem!

Shougo

@Shougo

:-)

Zhaosheng Pan

@brglng

I found the caching is really a good feature. When I was using vim-plug, I have to clone several copies for YouCompleteMe and rename them to different names, and pick a specific name on specific OS. I wrote a long function doing all those. With caching, I just need to keep only one copy of the original YouCompleteMe repo at ~/.vim/dein/repo and cache it to ~/.cache/dein, which is a OS-specific path. I don't need to care about the directory names anymore, and the long function is no longer necessary.

Zhaosheng Pan

@brglng

It seems Dein does not cache hooks, so the plugins add in .vimrc with hook_post_update dict entry are only correctly installed for the first time. After the vim restarted, dein#load_state() returns 0 and the hooks are not loaded for the plugins, so no hooks will be called for dein#update(). Does that mean I have to call dein#set_hook() after the dein#begin() and dein#end() block?

Shougo

@Shougo

The cache hook is only cached if it is String.

You should not use Funcref for hooks.

Zhaosheng Pan

@brglng

OK. Thanks.

Zhaosheng Pan

@brglng

It seem calling dein#set_hook() after dein#end() does not work, whether or not the hook is a String or a Funcref. But using a String hook in the dictionary of dein#add() works.

Shougo

@Shougo

It is cache feature.

Because the cache is generated when dein#end()

You should upload the sample vimrc.

We have not ESP skills

_

Zhaosheng Pan

@brglng

OK. I have solved hook problem by using String for hook_post_update. But there seems another problem that dein#clear_state() does not delete the state file when g:dein#cache_directory is set. Here is my minimal configuration:

OK. I have solved hook problem by using String for hook_post_update. But there seems another problem that dein#clear_state() does not delete the state file when g:dein#cache_directory is set. Here is my minimal configuration:

Hi Shougo, if I have set g:dein#cache_directory to a machine specific path such as ~/.cache/dein and use a symlink to a directory in my Dropbox for ~/.vim, does that mean if I have updated the plugins on one machine, it won't be updated on another machine (because the cache is not updated and only the repos are synced and updated)? My configuration is still like above. Thanks.

Shougo

@Shougo

If ~/.cache/dein is Dropbox directory, it will be updated.

But it seems ~/.vim/dein only Dropbox directory.

You must execute dein#recache_runtimepath().

because the cache is not updated and only the repos are synced and updated

Yes.

dein#recache_runtimepath() is cache update.

dein#update() is repos and cache update.

Zhaosheng Pan

@brglng

OK. I think it is not possible for me to use a Dropbox directory for ~/.cache/dein because the cache_*.vim and state_*.vim files records absolute paths for the the runtimepaths, but the paths are different on my several machines (differens OS). Maybe I have to execute dein#recache_runtimepath() on my every machines after I update the plugins.

Shougo

@Shougo

Yes

Zhaosheng Pan

@brglng

Is it possible to record the repo revisions in dein's cache, so that I can write a function to compare the revisions in the cache and in the repo, and call dein#recach_runtimepath() automatically if there is difference?

Shougo

@Shougo

@brglng It is saved on ~/.cache/dein/rollbacks.

Zhaosheng Pan

@brglng

OK. Thanks.

Tobias Witt

@ohcibi

@Shougo can the runtime path caching be disabled for developing plugins? or is there any faster way than call dein#recache_runtimepath() after every change in a plugins file?