1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
# Dotfiles
Personal collection of (public) dotfiles, managed with
[GNU Stow](https://www.gnu.org/software/stow/).

The following *configuration packages* are provided: `bash`, `fzf`,
`mailcap`, `misc`, `mpd`, `mpv`, `ncmpcpp`, `neomutt`, `nnn`, `ripgrep`,
`sxhkd`, `sxiv`, `tmux`, `transmission`, `vim`, `x11`.
On top of this I'm using my own fork of st:
- Official repo ([https://st.suckless.org/](https://st.suckless.org/))
- My personal fork ([https://git.dyamon.me/st.git](https://git.dyamon.me/st/))
If something does not work it is probably because you are not using this
terminal emulator.
Some packages depend on other and should be deployed together:
- `vim` and `bash` are interdependent;
- `vim` loosely depends on `ripgrep` and `fzf` for the [`fzf.vim`](https://github.com/junegunn/fzf.vim)
plugin to work properly. It will fallback to Vim `find` command (`:h
:find`) otherwise.
`git` and `stow` are assumed to be installed on the machine.
## Organization
Thanks to the *package* structure of Stow it is possible to group files
in a logical way (in this case per program). Following this approach all
config files related to Vim are in the `vim` folder and all Bash related
config files are in the `bash` one.
In some cases a file might be related to multiple programs (e.g. config
files for package nnn might include same Bash related configuration). In
these cases the file can be found in (what I consider) the most relevant
package (in this example it is the nnn package).
### Additional configuration
Package `vim` needs the following:
```
$ mkdir -p $HOME/.local/share/vim/{backup,sessions,swap,undo}
```
### Private configuration
I personally keep a separate repository with all my private
configuration files, and you might want to do the same. This is
organized with `stow` as well. Keep in mind that when using
`stow` from multiple locations you might need the `--no-folding` flag to
avoid clashes.
### Note on Stow
In Stow 2.3.0, a new feature was introduced to better handle dotfiles.
In particular any file or directory in the package tree that starts with
the prefix `dot-` is substituted, during symlink creation, with an actual
dot. This is to avoid having a package with a bunch of hidden files.
Unfortunately the feature
[doesn't work properly](https://github.com/aspiers/stow/issues/33)
and in particular there is a bug that prevent to use the features for
directories in the package tree.
## Installation
Clone the repository in your `$HOME` directory and populate the
submodules.
```
$ git clone --recurse-submodules https://git.dyamon.me/dotfiles .dotfile
$ cd .dotfiles
```
Stow the packages you need.
```
$ stow <package> ...
```
E.g.,
```
$ stow bash vim
```
Check the manual for more details on how to use `stow`
```
$ man stow
```
If you want to preview what are the effects of the command without
creating any symlink use the `--no` option.
```
$ stow --no --verbose=2 <package>
```
To unstow a package use
```
$ stow --delete <package>
```
To restow a package (to apply changes in the structure of the package)
use
```
$ stow --restow <package>
```
## Different systems
I currently tested this setup on the following systems without any
issues:
- Gentoo Linux
- Manjaro Linux (so this will problably work on any Arch-based distro)
- Termux (on my phone):
+ Install `ncurses-utils`
+ `/tmp/` needs write permissions or alternatilvely fallback to
`~/.local/cache`
|