ff2bdb2eca8b0db169d93fff46ceae15f1da8ba3
I used zoxide wrong all the time... By simply initiating it correctly it immediately get's smarter and better. Imagine you have a dir like this: ~/deep/level/nested/but-with-very-specific-name/xy11-with-many-more Imagine further that in your current directory is nothing that starts with `xy`, then you only have to enter `cd xy` and zoxide will figure out that you meant the deeply nested complicated name and change the directory to there! - How awesome is that! So, keep in mind use zoxide correct and it becomes easy to use!
Dotfiles
I use stow to sync my dotfiles between the OS and this repository.
Requirements
Install git and stow if not already present on the system.
Install via apt on Debian/Ubuntu
sudo apt install git stow
Install via brew on macos
brew install git stow
Setup and useage
My dev-machine setup will install and setup these dotfiles automatically.
So, the only thing I’ve to care about is the stow . --adopt command and to commit changes to the VSC.
|
Checkout this repository into ~/dotfiles and apply run stow to sync the dotfiles.
The directory should be loacted directly in the HOME directory.
Otherwise stow needs an additional flat -t $HOME everytime, which is a bit annoying!
|
git clone git@gitea.nehrke.info:nemoinho/dotfiles.git ~/dotfiles (1)
cd $_
stow --adopt . (2)
[ -n "$(git status --short)" ] && git restore . (3)
| 1 | Clone this repository |
| 2 | Create symlinks for all files managed by this repository, so that the file in the $HOME points to the file in this repository |
| 3 | In case of differences between existing files and the ones from this repository keep the version of the repository |
Removing files
If a file is going to be removed make sure to remove the linked file as well.
Otherwise we end up with a bunch of dangling files in $HOME!
To automatically delete these dangling links we can use a git-hook as the following. That will remove the links pre-commit.
Setup git-hook to automatically remove links to deleted files
cat <<EOF > .git/hooks/pre-commit
#!/usr/bin/env bash
set -e
git status --short | grep -E '^D|^R' | sed 's/...//;s/ -> .*//' | while read f
do
test -L "\$HOME/\$f" && rm "\$HOME/\$f"
done
EOF
chmod +x .git/hooks/pre-commit
Description
Languages
Lua
82.3%
Shell
10.8%
Vim Snippet
6.3%
Python
0.6%