I am having problem in using stow correctly. The scrip I use to install all my stow's is :
cd ~/Utility/configs
for file in *; do
# Only run Stow on the directories in the dotfiles folder and not the individual files.
# Using 'basename' strips the filepath from the directory name.
if [ -d ${file} ]; then
stow $(basename $file) -t ~/
echo "$(basename $file) stowed.";
fi
done
Now, I have, in vim directory as: ~Utility/configs/vim/ with:
tree . -a -L 2
.
├── .stow-local-ignore
├── .vim
│ ├── autoload
│ ├── plugged
│ └── UltiSnips
└── .vimrc
Among them, I want to ignore plugged not to be stowed and hence the .stow-local-ignore:
\.vim/plugged
\.vim/spell
But this is not doing what is intended and plugged is always stowed. Basically, whatever is inside ~/.vim/ is inside ~/Utility/configs/vim/.vim. This I don't want. I specifically just want only autoload and Ultisnips to be stowed, nothing else.
How I can do that?
NB: I have taken vim as an example, but this is not related to vim, but to stow. So I have posted here, and not in vim channel.
stow output with verbose=5
Stowing contents of Utility/configs/vim (cwd=/home/rudra)
=> Utility/configs/vim
is_a_node(.)
link_task_action(.): no task
dir_task_action(.): no task
parent_link_scheduled_for_removal(.): prefix
parent_link_scheduled_for_removal(.): returning false
is_a_node(.): really exists
Using ignore file: Utility/configs/vim/.stow-local-ignore
Ignore list regexp for paths: /(?^:(^|/)(\.vim/spell|^/\.stow\-local\-ignore$|\.vim/plugged)(/|$))/
Ignore list regexp for segments: none
Not ignoring .vimrc
Stowing Utility/configs / vim / .vimrc
=> Utility/configs/vim/.vimrc
is_a_link(.vimrc)
link_task_action(.vimrc): no task
is_a_link(.vimrc): returning 0
is_a_node(.vimrc)
link_task_action(.vimrc): no task
dir_task_action(.vimrc): no task
parent_link_scheduled_for_removal(.vimrc): prefix .vimrc
parent_link_scheduled_for_removal(.vimrc): returning false
is_a_node(.vimrc): returning false
LINK: .vimrc => Utility/configs/vim/.vimrc
Using ignore file: Utility/configs/vim/.stow-local-ignore
Using memoized regexps from Utility/configs/vim/.stow-local-ignore
Ignore list regexp for paths: /(?^:(^|/)(\.vim/spell|^/\.stow\-local\-ignore$|\.vim/plugged)(/|$))/
Ignore list regexp for segments: none
Ignoring path /.stow-local-ignore
Using ignore file: Utility/configs/vim/.stow-local-ignore
Using memoized regexps from Utility/configs/vim/.stow-local-ignore
Ignore list regexp for paths: /(?^:(^|/)(\.vim/spell|^/\.stow\-local\-ignore$|\.vim/plugged)(/|$))/
Ignore list regexp for segments: none
Not ignoring .vim
Stowing Utility/configs / vim / .vim
=> Utility/configs/vim/.vim
is_a_link(.vim)
link_task_action(.vim): no task
is_a_link(.vim): returning 0
is_a_node(.vim)
link_task_action(.vim): no task
dir_task_action(.vim): no task
parent_link_scheduled_for_removal(.vim): prefix .vim
parent_link_scheduled_for_removal(.vim): returning false
is_a_node(.vim): returning false
LINK: .vim => Utility/configs/vim/.vim
Planning stow of package vim... done
@Kusalananda: This is what I am doing, with verbose=2:
pwd
/home/rudra/Utility/configs
mv vim/.stow-local-ignore ~/
stow -D vim --verbose=2
stow dir is /home/rudra/Utility/configs
stow dir path relative to target /home/rudra/Utility is configs
Planning unstow of package vim...
CONFLICT when unstowing vim: existing target is neither a link nor a directory: .vimrc
.vim did not exist to be unstowed
Planning unstow of package vim... done
WARNING! unstowing vim would cause conflicts:
* existing target is neither a link nor a directory: .vimrc
All operations aborted.
cd vim/
stow -D .vim --verbose=2
stow dir is /home/rudra/Utility/configs/vim
stow dir path relative to target /home/rudra/Utility/configs is vim
Planning unstow of package .vim...
UltiSnips did not exist to be unstowed
autoload did not exist to be unstowed
plugged did not exist to be unstowed
Planning unstow of package .vim... done
Processing tasks...
stow -D .vimrc --verbose=2
stow dir is /home/rudra/Utility/configs/vim
stow dir path relative to target /home/rudra/Utility/configs is vim
stow: ERROR: The stow directory vim does not contain package .vimrc
cd ..
ll ~/.vim*
lrwxrwxrwx. 1 rudra rudra 24 Apr 30 16:16 /home/rudra/.vim -> Utility/configs/vim/.vim
-rw-------. 1 rudra rudra 13K Apr 30 16:17 /home/rudra/.viminfo
lrwxrwxrwx. 1 rudra rudra 26 Apr 30 16:10 /home/rudra/.vimrc -> Utility/configs/vim/.vimrc
unlink ~/.vim
unlink ~/.vimrc
cp ~/.stow-local-ignore vim/
stow vim -t ~/ --verbose=2
stow dir is /home/rudra/Utility/configs
stow dir path relative to target /home/rudra is Utility/configs
Planning stow of package vim...
LINK: .vimrc => Utility/configs/vim/.vimrc
LINK: .vim => Utility/configs/vim/.vim
Planning stow of package vim... done
Processing tasks...
Processing tasks... done
tree ~/.vim -L 1
/home/rudra/.vim
├── autoload
├── plugged
└── UltiSnips