justone / dfm

dotfiles manager
http://endot.org/projects/#dfm
Other
122 stars 18 forks source link

Importing a folder nested inside another one (.vim/Ultisnips without the whole .vim) #34

Closed netei closed 8 years ago

netei commented 8 years ago

Hi,

When I run dfm import ~/.vim/UltiSnips, I get the following error :

ERROR: file .vim/UltiSnips is in a subdirectory that is not tracked, consider using 'dfm import .vim'.

I would like to include .vim/UltiSnips into my dotfiles, but without including my full .vim folder. Is this somehow possible ?

I don't wish to import my full .vim directory inside my dotfiles, because it contains a lot of things that aren't interesting to me (all versions of all bundles)

justone commented 8 years ago

Hey,

In your situation, you can use dfm's recursion capabilities. The following should get you set up:

$ cd ~
$ echo ".vim recurse" >> .dotfiles/.dfminstall
$ mkdir .dotfiles/.vim
$ mv .vim/UltiSnips .dotfiles/.vim
$ dfm add .dfminstall .vim
$ dfm commit -m "adding ultisnips"

After doing this, you can do dfm import .vim/otherplugin and dfm will do the right thing. It's just the initial set up that's a little complicated. Perhaps I can teach dfm import to do this set up in the future.

netei commented 8 years ago

Ok, works fine. Thanks a lot !

netei commented 8 years ago

It would be great that it would work automatically with dfm import as you said.

edi9999 commented 8 years ago

Hi, I'm netei. I have had some problems when I did dfm install from an other machine after doing what you proposed here, my complete .vim/bundle was deleted. I think it is not expected behaviour.

justone commented 8 years ago

Hey,

That is definitely unexpected. dfm install shouldn't ever delete files. When it is installing and finds a directory where it wants to put something it will move it to $HOME/.backup. Do you have that directory and are your files in there?

Sorry for the inconvenience.

edi9999 commented 8 years ago

Strangely I have two directories with ".backup" :

~/.vim/.backup which is empty

~/.backup but it doesn't contain a .vim folder.

justone commented 8 years ago

That's odd. Could you share your dotfiles repo with me so I can try to replicate it? Or, if you'd rather not do that, can you create a dotfiles repo and set of steps to reproduce the bug?

Thanks for your help.

edi9999 commented 8 years ago

Hi, yes here's the link to the repository : (I've made it public)

git clone https://bitbucket.org/edi9999/dotfiles.git

edi9999 commented 8 years ago

For information, I've run dfm install from my home directory.

justone commented 8 years ago

Thanks for the information. I'll try to get to it this weekend.

edi9999 commented 8 years ago

Hi, any updates on this ?

justone commented 8 years ago

Hey, sorry for the delay, life got busy for a bit. I have some travel time on a plane this week, so I'll try to get to it.

justone commented 8 years ago

Hey, I tried installing your dotfiles on a test machine. I made a local .vim/bundle directory with a plugin inside and then installed your dotfiles. In my test, the .vim/bundle directory is still there after installation.

What sequence of commands are you running where the bundle directory gets deleted?

Thanks.

nate@testmachine:~$ mkdir -p .vim/bundle/
nate@testmachine:~$ cd .vim/bundle/
nate@testmachine:~/.vim/bundle$ git clone https://github.com/tpope/vim-fugitive.git
Cloning into 'vim-fugitive'...
remote: Counting objects: 2099, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 2099 (delta 4), reused 0 (delta 0), pack-reused 2087
Receiving objects: 100% (2099/2099), 755.91 KiB | 1.29 MiB/s, done.
Resolving deltas: 100% (767/767), done.
Checking connectivity... done.
nate@testmachine:~/.vim/bundle$ cd ~
nate@testmachine:~$ git clone https://bitbucket.org/edi9999/dotfiles.git .dotfiles
Cloning into '.dotfiles'...
remote: Counting objects: 2026, done.
remote: Compressing objects: 100% (1130/1130), done.
remote: Total 2026 (delta 1227), reused 1365 (delta 809)
Receiving objects: 100% (2026/2026), 303.65 KiB | 0 bytes/s, done.
Resolving deltas: 100% (1227/1227), done.
Checking connectivity... done.
nate@testmachine:~$ ./.dotfiles/bin/dfm install
INFO: Installing dotfiles...
INFO:   Symlinking .fzf.bash (.dotfiles/.fzf.bash).
INFO:   Symlinking .git_template (.dotfiles/.git_template).
INFO:   Symlinking .gitconfig (.dotfiles/.gitconfig).
INFO:   Symlinking .tmux.conf (.dotfiles/.tmux.conf).
INFO:   Symlinking .profile (.dotfiles/.profile).
INFO:   Symlinking .ctags (.dotfiles/.ctags).
INFO:   Symlinking bin (.dotfiles/bin).
INFO:   Symlinking .shellrc.load (.dotfiles/.shellrc.load).
INFO:   Symlinking .bashrc (.dotfiles/.bashrc).
INFO:   Symlinking .vimrc (.dotfiles/.vimrc).
INFO:   Symlinking .edgarstart (.dotfiles/.edgarstart).
INFO:   Symlinking scripts (.dotfiles/scripts).
INFO:   Symlinking .fzf-key-bindings.bash (.dotfiles/.fzf-key-bindings.bash).
INFO:   Symlinking windows (.dotfiles/windows).
INFO:   Symlinking .tigrc (.dotfiles/.tigrc).
INFO:   Symlinking UltiSnips (../.dotfiles/.vim/UltiSnips).
INFO:   Symlinking after (../.dotfiles/.vim/after).
nate@testmachine:~$ ls -l .vim
total 4
lrwxrwxrwx 1 nate nate   23 Oct  6 11:54 after -> ../.dotfiles/.vim/after
drwxrwxr-x 3 nate nate 4096 Oct  6 11:53 bundle
lrwxrwxrwx 1 nate nate   27 Oct  6 11:54 UltiSnips -> ../.dotfiles/.vim/UltiSnips
nate@testmachine:~$ ls -l .vim/bundle/
total 4
drwxrwxr-x 5 nate nate 4096 Oct  6 11:53 vim-fugitive
nate@testmachine:~$ 
edi9999 commented 8 years ago

I can't reproduce the issue on a new machine either. I will tell you if this happens again in the future and try to create a script to reproduce the issue in that case

justone commented 8 years ago

Sounds good. Thank you.