1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-10-31 18:01:30 +01:00

Compare commits

...

409 Commits

Author SHA1 Message Date
bretello
6d67506b9f
zsh: add master->main dotfiles migration 2024-07-07 20:27:03 +02:00
bretello
28b1d9e2f7
gha: fix failure notification 2024-07-05 22:30:02 +02:00
bretello
3bd5879d75
gha: use --noconfirm when installing ansible 2024-07-05 22:25:28 +02:00
bretello
e502dc2e12
gha: fix ansible workflow 2024-07-05 22:19:59 +02:00
bretello
4a08944497
gha: split workflows 2024-07-05 22:16:26 +02:00
bretello
81fa97520c
gha: add ansible run workflow 2024-07-05 22:14:36 +02:00
bretello
0cfab23eb9
gha: fix notification step 2024-07-05 22:14:36 +02:00
bretello
a2c03b8c8d
ansible: always run PlugInstall/PlugUpdate 2024-07-04 19:18:26 +02:00
bretello
eb97bec778
ansible: add dotfiles-update tag 2024-07-04 19:18:01 +02:00
bretello
2b2954d31a
README: cleanup 2024-07-04 18:55:52 +02:00
bretello
a2f3d6e764
ansible: refactor 2024-07-04 18:55:52 +02:00
bretello
78d36a6073
zsh: color which output, add BAT_STYLE 2024-07-04 11:45:11 +02:00
bretello
375d2177c1
vim: disable keywordprg for go 2024-07-01 12:23:14 +02:00
bretello
28fae7b8ce
vim: do not use fixers on .git dir patches 2024-06-29 10:53:41 +02:00
bretello
daf8e73f1d
vim: get rid of termdebug 2024-06-28 14:37:57 +02:00
bretello
ce72565b91
vim: change shortcuts to edit configs in vsplit 2024-06-19 12:08:25 +02:00
bretello
8214de3d65
zsh: add watchc function
this allows for watching a process while highlighting its output
with `grc`
2024-06-18 11:31:12 +02:00
bretello
7fa82f6cea
vim: improve virtualtext display for ALE issues 2024-06-08 18:27:41 +02:00
bretello
1b3178b264
vim: improve explanation for <leader><CR> command 2024-06-08 18:27:40 +02:00
bretello
68ae85b752
vim: do not enable spelling on markdown files by default 2024-06-08 17:53:35 +02:00
bretello
3bb339ad36
zsh: add support for fzf's --highlight line option (fzf>=0.52.0) 2024-06-04 09:42:47 +02:00
bretello
e021c813b2
zsh: theme: prevent breaking of prompt with virtualenv prefix 2024-05-09 16:33:31 +02:00
bretello
1e90b5766c
zsh: themes: fix prompt_too_long usage 2024-05-09 12:39:12 +02:00
bretello
120cd3f4d9
zsh: fix autoupgrade script for antidote 2024-04-22 09:50:05 +02:00
bretello
c572b2cb10
zsh: fix command lookup using $+array[] syntax 2024-04-22 09:47:24 +02:00
bretello
26022ea7b6
zsh: fix antidote migration cache dir 2024-04-17 16:01:39 +02:00
bretello
32df12a6df
zsh: fix sourcing of color functions, move to extras dir 2024-04-10 14:44:17 +02:00
bretello
030903dcd7
zsh: theme: get rid of more functions 2024-04-09 16:59:12 +02:00
bretello
81d8c56836
zsh: get rid of loading message 2024-04-09 15:10:25 +02:00
bretello
edc1934e83
zsh: migrate from antibody to antidote
See https://getantidote.github.io and https://github.com/mattmc3/antidote
2024-04-09 15:03:55 +02:00
bretello
a9a45864d2
README: fix CI badge 2024-04-06 21:24:46 +02:00
bretello
62c95b60d5
vim: disable ALE fix on save on git diffs 2024-04-06 21:24:45 +02:00
bretello
c137ef0e0f
vim: increase history limits 2024-04-06 21:24:45 +02:00
bretello
3db7721edb
zsh: functions: cleanup tracing functions 2024-04-06 21:24:45 +02:00
bretello
faf318c3d0
zsh: functions: add alarm function for quick alarms 2024-04-06 21:24:45 +02:00
bretello
1ee73be7f9
zsh: functions: get rid of ppath (use realpath instead) 2024-04-06 21:24:45 +02:00
bretello
8cdbefa3de
zsh: aliases: add C and P copy copy/paste 2024-04-06 21:24:45 +02:00
bretello
22023f667e
zsh: aliases: fix ssh1 alias (force new master, no persist) 2024-04-06 21:24:45 +02:00
bretello
114bbe758e
zsh: cleanup command lookup 2024-04-06 21:24:45 +02:00
bretello
7312c868b3
zsh: theme: avoid using functions where possible
includes fix for ohmyzsh's breaking change in ec1afe9d (async prompt)
2024-04-06 21:24:45 +02:00
bretello
56b8f1d05f
aliases: add grepi=grep -i 2024-03-25 21:13:10 +01:00
bretello
5674865f11
vim: cleanup clipboard shortcuts 2024-03-21 14:55:06 +01:00
bretello
0c7d0ec24f
zsh: cleanup bat configuration 2024-03-08 12:59:28 +01:00
bretello
b05fde87c2
zsh: simplify retry() 2024-03-01 11:25:12 +01:00
bretello
04bfe043ab
vim: use <leader>N,P for :cnext,:cprevious 2024-03-01 11:25:12 +01:00
bretello
35575755ef
vim: improve Man command display 2024-03-01 11:25:12 +01:00
bretello
10c79f1bad
zsh: add watch_file command
uses inotifywait to watch writes on a file and executes a specific
action whenever this is changed (killing the previous process)
2024-03-01 11:25:12 +01:00
bretello
25037bde1f
zsh: cleanup colors/color functions 2024-03-01 11:25:11 +01:00
bretello
481c81c68a git: add taglist command 2024-03-01 11:23:24 +01:00
bretello
94ed0a6ea8
tmux: fix rename-window shortcut 2024-01-11 13:10:52 +01:00
bretello
3955481e32
ci: add failure notification 2024-01-08 13:03:46 +01:00
bretello
471fc948a8
ci: switch to github actions 2024-01-08 09:52:17 +01:00
bretello
7f2fa528fe
ci: add registry tokens 2024-01-04 17:09:32 +01:00
bretello
fba95ede51
update README 2024-01-03 15:45:50 +01:00
bretello
2a1b2f5da4
extras: fix autoupdater script 2024-01-03 15:45:50 +01:00
bretello
3d260ec64d
dockerfile: use json notation for CMD 2024-01-03 15:45:50 +01:00
bretello
d70b43dbee
ansible: fix bat package name on debian 2024-01-03 15:24:17 +01:00
bretello
bcad9f77aa
ansible: cleanup setup playbook 2024-01-03 15:22:01 +01:00
bretello
208057ce91
zsh: theme: fix display of hostname for ssh connections 2024-01-03 15:22:01 +01:00
bretello
94eb4cded8
ci: cleanup, add notify-on-failure 2024-01-03 15:22:01 +01:00
bretello
2805f13208
ansible: add ssh config block 2024-01-02 15:51:01 +01:00
bretello
904f53b0e0
dockerfile: cleanup/improvements 2023-12-29 12:29:16 +01:00
bretello
a275d1fefc
dockerfile: replace bretellofier pip with AUR install 2023-12-28 17:57:44 +01:00
bretello
651a14135b
dockerfile: replace pylint with ruff 2023-12-28 17:38:47 +01:00
bretello
1038647c2c
ci: fix docker build 2023-12-28 17:31:26 +01:00
bretello
32ce07fcde
ci: remove useless secrets 2023-12-28 16:46:35 +01:00
bretello
d26f542874
ci: migrate to woodpecker 2023-12-28 16:35:24 +01:00
bretello
245eb034f4
vim: add comments to navigation shortcuts 2023-12-28 16:23:18 +01:00
bretello
b73838f58b
zsh: colors: add info about ansi colors 2023-12-21 16:14:14 +01:00
bretello
58393456a9
zsh: functions: add 'bold' function to print bold text 2023-12-21 16:13:48 +01:00
bretello
353378af8c
pdbrc: simplify for bretello/pdbpp version
https://github.com/bretello/pdbpp
2023-12-21 16:12:51 +01:00
bretello
439f29318c
zsh: disable completions when a comment is started, change comment highlight style 2023-12-21 16:11:32 +01:00
bretello
f9e4a2c224
zsh: clean/improve brethil theme 2023-12-21 16:09:43 +01:00
bretello
b5ebe15e79
ansible: fix yay install script 2023-12-20 12:33:27 +01:00
bretello
37f33a3614 vim: fix ruff python formatter 2023-12-04 11:10:09 +01:00
bretello
0ada46b805 vim: use ruff as default python formatter 2023-12-04 10:21:54 +01:00
bretello
c41a91e784
vim: add <Leader>] and <Leader>[ to move between definitions
`<Leader>[` moves to the start of the previous method/function/class
definition, `<Leader>]` to the start of the next
2023-11-22 12:52:22 +01:00
bretello
a20bffdf67
zsh: python: cleanup mkvenv 2023-11-11 23:33:50 +01:00
bretello
1537ddcc64
zsh: python: add -f flag to mkvenv
- improve mkvenv with getopts option parsing
- add -f flag to force recreation of venv

Usage:
```bash
mkvenv [-sf] [venv_name]
```
2023-11-11 18:54:40 +01:00
bretello
aaea49ecf8 aliases: add J global alias for | jq 2023-10-25 11:48:03 +02:00
bretello
41eb8f1a5f zsh: vimscratch: add filetype arg
Allows setting filetype for vimscratch command.

Usage: `<command> | vimscratch [filetype]`.

For example:

```bash
curl https://myip.wtf/json | vimscratch json
```
Will open the output of the curl command as a json
temporary file in vim.
2023-10-25 11:45:54 +02:00
bretello
f4e960be35 vim: lower timeout for combined keymaps 2023-10-25 11:44:33 +02:00
bretello
58201b2ab7 zsh: cleanup git functions 2023-10-25 11:43:44 +02:00
bretello
4d9462239f zsh: move git fuzzy log to gitconfig (usage: git flog) 2023-10-25 11:43:16 +02:00
bretello
c329308759 zsh: avoid printing command name in completion wrapper 2023-10-25 11:34:36 +02:00
bretello
ee531d18cd functions: remove debug statements in vimscratch 2023-09-25 12:56:09 +02:00
bretello
125a4e7aed functions: allow arguments in vimscratch 2023-09-25 12:39:24 +02:00
bretello
cff20cef16
Revert "vim: ale: try using deoplete for completion"
This reverts commit bfad3b2a4c.
deoplete requires pynvim to be always available.
This is annoying when using virtualenvs or pynvim is not available.
2023-09-22 18:21:56 +02:00
bretello
f307a705a2 vim: add info (texinfo) reader
Use `:Info <command>` to read the info page
for `<command>`

Read more on https://github.com/HiPhish/info.vim
2023-09-20 10:19:55 +02:00
bretello
a4019ac53a zsh: fix FZF_CTRL_T_COMMAND 2023-09-15 11:33:53 +02:00
bretello
cffd1ef025 vim: ale: use cursor detail and floating preview 2023-09-15 10:23:01 +02:00
bretello
bfad3b2a4c vim: ale: try using deoplete for completion 2023-09-15 10:23:01 +02:00
bretello
c71f4a83a3 ipython: make config saner 2023-09-15 10:23:01 +02:00
bretello
5703c21e43 gitconfig: formatting 2023-09-15 10:23:01 +02:00
bretello
7efeedf6d9
add extras folder
just miscellaneous script/configs that could be useful
2023-09-15 00:35:36 +02:00
bretello
e32676922e
zsh: add tracing module 2023-09-15 00:33:46 +02:00
bretello
b96f0a6f86
zsh: add pacman module 2023-09-15 00:32:28 +02:00
bretello
51f92885fe
ipython: add fix for broken pager with bat 2023-09-15 00:29:56 +02:00
bretello
d4bf2f32f8
vim: allow local override of config via the .vimrc.local file 2023-09-15 00:29:56 +02:00
bretello
e749eedb75
vim: get rid of set shell/shellcmdflag 2023-09-15 00:29:56 +02:00
bretello
455ba2c17e
vim: misc linting fixes 2023-09-15 00:29:56 +02:00
bretello
f6880b715e
vim: group autocommands in augroups 2023-09-15 00:29:55 +02:00
bretello
de05c9c8f7
vim: add support for THEME_PREFER_LIGHT env variable 2023-09-15 00:29:55 +02:00
bretello
20baed04d9
vim: cleanup plugs 2023-09-15 00:29:55 +02:00
bretello
cf6dad897d
vim: plugs: add colorizer for hex color codes 2023-09-15 00:29:55 +02:00
bretello
fa69ebe8f9
vim: ale: tweak ale_lint_on enter/insert 2023-09-15 00:29:55 +02:00
bretello
0e5f23e864
vim: ale: add arduino config 2023-09-15 00:29:55 +02:00
bretello
1ccb61013d
vim: make plugs lazier 2023-09-15 00:29:55 +02:00
bretello
a0c5985009
vim: ale: add basic android dev configuration 2023-09-15 00:29:55 +02:00
bretello
90c870b91d
vim: ale: update linters 2023-09-14 23:30:31 +02:00
bretello
be236d0e25
vim: <leader>Q :close! 2023-09-14 23:30:31 +02:00
bretello
f5f6133c53
vim: ale: update fixers 2023-09-14 23:30:31 +02:00
bretello
4b19ff0f38
ansible: update brethil dotfiles mark 2023-09-14 23:30:31 +02:00
bretello
9ed23cd5a5
ansible: update packages 2023-09-14 23:30:31 +02:00
bretello
99baa7f1e0
zsh: automatically enable/disable python virtualenvs on chdir 2023-09-14 23:30:31 +02:00
bretello
1dcdb77f97
zsh: add SAVEHIST for unlimited history 2023-09-14 23:30:31 +02:00
bretello
c5532fea31
zsh: add FZF_CTRL_T_COMMAND 2023-09-14 23:30:30 +02:00
bretello
70aec3b2b6
useful_commands: add dbus introspection 2023-09-14 23:30:30 +02:00
bretello
39abcd4756
zsh: remove set -x from mangrep() definition 2023-09-14 23:30:30 +02:00
bretello
5a1c3c07ac
zsh: add support for THEME_PREFER_LIGHT env variable for bat theme 2023-09-14 23:30:30 +02:00
bretello
0c52f21233
pdbrc: add support from THEME_PREFER_LIGHT env variable 2023-09-14 22:40:49 +02:00
bretello
b193afe50a
upgrade script: avoid printing extra line on source 2023-09-14 22:38:57 +02:00
bretello
323542a705
vim: cleanup wayland copy/paste 2023-09-14 13:07:36 +02:00
brethil
24fc7dd2ed zsh: add bathelp alias for highlighting commands' -h/--help flags 2023-09-11 15:47:22 +02:00
brethil
d1135262de zsh: add fuzzyman command for fuzzy search of man pages (with preview) 2023-09-11 15:46:01 +02:00
bretello
76579a603e
zsh: alias bat when available command is batcat 2023-09-02 15:15:52 +02:00
bretello
fbc6934f8f
functions: add vimscratch
use `vimscratch` to open a scratch vim buffer.

If run in a pipe, it uses `stdin` as input:

```bash
<command> | vimscratch
```
2023-08-23 13:52:35 +02:00
bretello
4b73ed209f
zsh: theme: do not increase shell level when using tmux 2023-07-27 12:01:26 +02:00
bretello
fc0410eff3
tmux: add bind C customize-mode for quick customize-mode access 2023-07-26 00:06:27 +02:00
bretello
cea2eed10c
tmux: use set -ga mouse 2023-07-25 10:45:44 +02:00
bretello
9ccf8699ec
zsh: functions: fix upload() 2023-07-10 09:12:50 +02:00
bretello
d72886b6c1
zsh: functions: add watch_file function
this can be used to watch a file for changes and execute the
given action on changes.
2023-07-10 09:12:30 +02:00
bretello
e08ee08768
zsh: functions: avoid using aliases when calling rm/mv 2023-07-08 10:18:04 +02:00
bretello
f30468da11
zsh: remove duplicate grc omz plugin 2023-06-23 20:10:42 +02:00
bretello
05699e751b
tmux: enable mouse by default 2023-06-22 11:27:27 +02:00
bretello
f6a405657c
tmux: disable monitor-activity by default 2023-06-22 11:26:38 +02:00
bretello
e9ad8a563d
tmux: reduce history size to 1e4 2023-06-22 11:26:26 +02:00
bretello
5563b3434f
vim: fix aupat for iptables files 2023-06-22 11:25:33 +02:00
bretello
ca30bd2d47
vim: tagbar: fix mouse-click issue
related: 3b6cf2b
2023-01-27 12:34:55 +01:00
bretello
a8c89d32c9
zsh: functions: add mangrep 2023-01-23 20:21:57 +01:00
bretello
3b6cf2b92f
vim: tagbar: workaround for mouse-click issue
the world ends at column 223.

https://stackoverflow.com/questions/7000960/in-vim-why-doesnt-my-mouse-work-past-the-220th-column

Note that (at least on alacritty) the ttymouse=sgr workaround does not
work:

```vim
if has('mouse_sgr') " fixes unclickable panes after a specific column (~220?)
    set ttymouse=sgr
else
    set ttymouse=xterm2
end
```
2023-01-20 14:31:08 +01:00
bretello
8e3c36d200
vim: tagbar/airline: properly show tag in lower right corner 2023-01-20 14:30:16 +01:00
bretello
2066baee05
vim: linting cleanup 2023-01-19 17:33:44 +01:00
bretello
3f89412fcc
vim: ALE: allow right click for refactors/code actions 2023-01-19 15:07:17 +01:00
bretello
8d561fea1f
vim: add <leader>D :AleToggle 2023-01-17 13:57:14 +01:00
bretello
b95fac5c72
vim: add config options for ALE's virtualtext 2023-01-17 13:56:47 +01:00
bretello
57caa424e6
zsh: move git aliases to its own file, add glsu (git ls untracked) 2023-01-12 12:46:09 +01:00
bretello
fd05f479d9
zsh: fix git completions for gbD/gbd 2022-12-30 16:01:16 +01:00
bretello
ff696ac5db
functions: fix dotfiles_selfupdate 2022-12-23 13:38:20 +01:00
bretello
9299c753e0
vim: add F8 shortcut for tagbar 2022-12-23 12:12:25 +01:00
bretello
12e521a2c6
vim: remap <leader>gl to Commits, add <leader>gL for :Bcommits 2022-12-21 13:54:02 +01:00
bretello
977a45e109
ansible: fix setup
- apply prettier
- fix misc issues
2022-12-18 13:36:26 +01:00
bretello
2c36af6615
zsh: set up PATH early 2022-12-18 13:36:26 +01:00
bretello
937555cd8d
vim: do not lint on text changed/insert leave 2022-11-26 00:56:23 +01:00
bretello
5b575986c9
misc improvements/cleanup
- add fzf-tab-config
- fix fzf plugin install
- change shortcut for spell
- set default shell to zsh
2022-11-26 00:56:23 +01:00
bretello
3df7a304c4
zsh: make update mechanism less annoying
move .zsh file to extras/ so that it doesn't
get sourced twice because of the ZSH_CUSTOM bug
2022-11-26 00:48:24 +01:00
bretello
b50a9dec24
ansible: fix setup.yml syntax error 2022-08-22 10:20:49 +02:00
bretello
c9767aad51
zsh: cleanup selfupdate mechanism (pt. 2) 2022-08-22 10:20:36 +02:00
bretello
0bfa411f7a
zsh: cleanup selfupdate mechanism 2022-08-22 10:11:24 +02:00
bretello
72a02e22e0
zsh: git: do not fail when aliases are undefined 2022-08-18 16:37:24 +02:00
karajan1001
b2df319e18 Add four new git function with the help of fzf 2022-08-18 20:56:34 +08:00
bretello
dea326e488
vendored dependency: z (autojump) 2022-08-12 15:55:09 +02:00
bretello
b0ae3d6e3d
vim: update ale/gutentags config, add new git maps
Git maps:

- <leader>gp -> push
- <leader>gl -> log
- <leader>gc -> commit
- <leader>gpf -> push --force-with-lease
- <leader>gs -> stage hunk under cursor
- <leader>gu -> unstage hunk under cursor
2022-08-12 15:52:55 +02:00
bretello
827843d8bd
gitignore: update location
gitignore should be symlinked to ~/.config/git/ignore

see a3f74bf
2022-08-12 15:49:12 +02:00
bretello
6e17084112
zsh: add completion styles 2022-08-12 15:45:38 +02:00
bretello
2fb53e6f2b
zsh: functions: cleanup git functions, add git-show-changes 2022-06-21 23:06:21 +02:00
bretello
5f4b4538bb
zsh: functions: mkvenv: replace venv with virtualenv
virtualenv is faster than venv and also installs wheel by default
2022-06-21 23:05:35 +02:00
bretello
a3f74bf816
ansible: gitignore migration + install 2022-05-08 19:17:29 +02:00
bretello
9f566efa8e
vim: add actionlint support (through ALE) 2022-05-03 10:17:42 +02:00
bretello
f3bf033fb8
zsh functions: add -s flag to mkvenv 2022-05-03 10:16:05 +02:00
bretello
dff98b066f
zsh functions: add python module 2022-04-29 11:16:39 +02:00
bretello
26e313e21e
vim: map <leader>H to actionlint on current file 2022-04-08 12:07:48 +02:00
bretello
75a00b2380
vim: fix Goyo config 2022-04-04 15:47:31 +02:00
bretello
76feeb3af0
zsh: remove fzf-tab, autoswitch virtualenv 2022-04-02 20:06:52 +02:00
bretello
9667cf96c2
update dockerignore 2022-04-02 19:58:52 +02:00
bretello
486ee8afbf
zsh: cleanup functions 2022-03-31 19:37:57 +02:00
bretello
5393f33795
vim: add GL shortcut to show git log for function under cursor 2022-03-31 19:30:31 +02:00
bretello
f88413ddf8
vim: make <leader>n show references in quickfix 2022-03-31 19:30:11 +02:00
bretello
0c95eef23a
zsh: extract git functions to git.zsh 2022-03-31 19:27:58 +02:00
bretello
21d9660e64
zsh: improve mkvenv function 2022-03-30 16:05:57 +02:00
bretello
bef37c3601
vim: add <leader>q shortcut (closes windows) 2022-03-26 16:43:46 +01:00
bretello
0ed9e5373c
zsh: add asciinema-switch
helps switch different asciinema profiles
2022-03-26 16:43:46 +01:00
bretello
d1be12fa3e
zsh: add UNDERLINE to colors 2022-03-26 16:43:46 +01:00
bretello
492205e86b
zsh: add mkvenv function 2022-03-26 16:43:36 +01:00
bretello
41b97a1be3
zsh: refactor aliases/functions sourcing 2022-03-26 16:43:36 +01:00
bretello
9b6494c94d
zsh: fix color function 2022-03-26 16:43:35 +01:00
bretello
2841fada0a
zsh: use zsh-users/zsh-syntax-highlight instead of zdharma's 2022-03-26 11:30:16 +01:00
bretello
6235cfb737
ansible: add tmux symlink 2022-03-25 09:26:27 +01:00
bretello
c5be7e7f0c
vim: set minimum fold lines 2022-03-25 08:52:57 +01:00
bretello
fe32254093
tmux: increase history limit 2022-03-25 08:37:14 +01:00
bretello
5d8850389f
aliaes: cleanup 2022-03-25 08:36:41 +01:00
bretello
cb05a031a6
zsh: add gswr to switch to recent branches 2022-03-25 08:35:09 +01:00
bretello
624eb4710c
zsh: add treep alias 2022-03-25 08:34:35 +01:00
bretello
782accd7ae
vim: do not return to previous edit position for files in .git 2022-03-25 08:34:09 +01:00
bretello
7005372b5a
vim: create undo_dir when missing 2022-03-25 08:33:47 +01:00
bretello
78ee86c14a
vim: only load ultisnips when python3 is available 2022-03-25 08:30:16 +01:00
bretello
ecd2472910
tmux: add history limit 2022-02-26 22:45:14 +01:00
bretello
b86622e598
functions: fix dotfiles_selfupdate() 2022-02-16 11:13:23 +01:00
bretello
f73659aa45
add drone CI 2022-02-07 23:44:19 +01:00
bretello
89c73f3adf
fixup! Docker: improvements 2022-02-07 21:12:45 +01:00
bretello
9d2a3d99bd
vim: add (commented) vim themes plugs 2022-02-07 21:12:30 +01:00
bretello
8689c25815
Docker: improvements 2022-02-07 21:10:44 +01:00
bretello
21c3f4ac51
ignore: add .vagrant dirs 2022-02-07 21:09:51 +01:00
bretello
24e705b332
vim: shortcuts improvements
- add `T` when on python file to run the pytest test
    under the cursor
- add <leader>xx to open a work buffer
- cleanup fugitive diff/blame/log maps
- remove outdated maps
2022-02-07 21:08:04 +01:00
bretello
6fa513850c
zsh: add editing mode setup check 2022-02-07 20:49:58 +01:00
bretello
85381436cf
zsh: cleanup aliases sourcing 2022-02-07 20:49:25 +01:00
bretello
fc4972dab3
zsh: update git_prune_branches 2022-02-07 20:45:59 +01:00
bretello
c6b110b325
zsh: cleanup functions completions 2022-02-07 20:44:54 +01:00
bretello
73ef8d928a
ansible: cleanup setup playbook 2022-02-05 13:44:05 +01:00
bretello
41d001a5ce
tmux: start counting windows from 0 2022-02-05 10:56:13 +01:00
bretello
925ef0901e
ansible: add yay install playbook 2022-02-04 16:08:21 +01:00
bretello
927601f444
add dockerfile 2022-01-31 17:19:27 +01:00
bretello
f48e6fa773
vim: add <leader>ue :UltiSnipsEdit mapping 2022-01-25 10:55:42 +01:00
bretello
8773349238
vim: fix rainbowcsv plug config 2022-01-25 10:55:13 +01:00
bretello
afb1a7a795
zsh: enable grc, ansible and vagrant omz plugins 2022-01-25 10:54:13 +01:00
bretello
c231afe36e
vim: add keywordprg config, override K
hit K to run a ripgrep search on the word under the cursor.
This leverages fzf.vim
2022-01-25 10:52:24 +01:00
bretello
43426f7ac5
zsh: add new functions: git-diff-branch, falias, make_backup, make_venv 2022-01-24 11:33:53 +01:00
bretello
c6d444c709
zsh: cleanup functions 2022-01-24 09:58:26 +01:00
bretello
476fd545b5
zsh: add ZSH_AUTOSUGGEST_STRATEGY 2022-01-24 09:57:29 +01:00
bretello
330d3dbef6
ansible: cleanup packages 2022-01-24 09:56:51 +01:00
bretello
66ca1af8b7
ansible: improve setup.yml playbook, formatting 2022-01-12 10:06:54 +01:00
bretello
4bf6198638
tmux: add rename-window keybinding 2022-01-06 15:57:08 +01:00
bretello
95e0d56ea7
zsh: add functions/aliases extras + migration 2022-01-05 18:16:45 +01:00
bretello
c507973d50
zsh: add fzf-tab module
https://github.com/Aloxaf/fzf-tab/wiki/Configuration
2021-12-27 12:55:17 +01:00
bretello
0b3213632e
vim: remove csv plug 2021-12-25 22:55:49 +01:00
bretello
ea25269d1f
zsh: add $g and $w for git and work dirs 2021-12-24 11:49:01 +01:00
bretello
683ca475ae
vim: cleanup fzf config 2021-12-22 12:57:55 +01:00
bretello
56d9cf12db
formatting 2021-12-21 10:55:13 +01:00
bretello
f05a892907
vim: update fzf layout 2021-12-20 20:09:57 +01:00
bretello
7e00071eda
vim: update ultisnips config 2021-12-20 20:09:00 +01:00
bretello
41816d6821
vim: add <leader>m for :Maps, update git maps 2021-12-20 20:09:00 +01:00
bretello
ea95b4edce vim: improve fzf configuration 2021-12-09 10:47:29 +01:00
bretello
40540908e0 vim: improve fugitive/gitgutter shortcuts 2021-12-09 10:43:05 +01:00
bretello
f1454a95f7 vim: update ALE configuration 2021-12-09 10:36:21 +01:00
bretello
b249ed88f3 vim: add cursorcolum toggle shortcut (<leader>i) 2021-12-09 10:36:17 +01:00
bretello
ef244d81e2 vim: add fzf_colors option 2021-12-09 10:22:26 +01:00
bretello
ca7a7453a9
vim: update ALE rust config 2021-12-09 00:11:19 +01:00
bretello
207a46b847
vim: fix comment 2021-12-09 00:02:39 +01:00
bretello
81a84dacd2
vim: add json comment highlighting 2021-12-09 00:02:38 +01:00
bretello
8236f71189
zsh: add pacbins and rexplain commands 2021-12-09 00:02:38 +01:00
bretello
d58d4232e8
vim: cleanup airline config 2021-12-09 00:02:38 +01:00
bretello
5d45f454f8
vim: add tab switch shortcuts 2021-12-09 00:02:38 +01:00
bretello
6d428ac1e7
zsh: enable compinit 2021-12-09 00:02:38 +01:00
bretello
d302f40ffc
zsh: make visual editing work 2021-12-09 00:02:38 +01:00
bretello
29fc94db68
tmux: remove broken settings 2021-12-09 00:02:38 +01:00
bretello
6a5991de8b
vim: add tagbar plug 2021-12-09 00:02:37 +01:00
bretello
d946a2b7d9
zsh: re-enable omz plugins, add rust completions 2021-12-09 00:02:37 +01:00
bretello
84236e28ad
vim: clean up colorscheme config 2021-12-09 00:02:37 +01:00
bretello
f297e2e221 vim: load plugins on-demand 2021-11-16 14:46:30 +01:00
bretello
b7f6ea2fc9 vim: add rainbow csv plugin 2021-11-16 14:42:56 +01:00
bretello
f8c767bf98 vim: fix python breakpoint macro 2021-11-16 14:36:26 +01:00
bretello
1a3856d78d vim: add yankstack mapping 2021-11-16 14:34:46 +01:00
bretello
86adb6f53a vim: ale lint on enter and auto poetry 2021-11-16 14:28:33 +01:00
bretello
52366a3769 zsh: disable slow loading plugins 2021-11-15 11:21:03 +01:00
bretello
6d16512c0a
zsh: update fast-syntax-highlighting path 2021-11-10 21:59:49 +01:00
bretello
234f3da804
[pdbrc] fix colorscheme 2021-10-23 15:19:48 +02:00
bretello
2a43038a48
git: add git mylog command 2021-10-10 12:41:21 +02:00
bretello
b8d56ee083
cleanup 2021-10-10 12:41:21 +02:00
bretello
4a985b2ffa
zsh: migrate sh -> zsh 2021-10-10 12:41:20 +02:00
bretello
904b0227b7
zsh: add filetype to antibody_plugins.txt 2021-10-09 00:37:14 +02:00
bretello
24999c4776
zsh: add git-fixup command (git fixup) 2021-10-09 00:37:14 +02:00
bretello
f2850c54f1
zsh: fix retry function 2021-10-08 23:48:56 +02:00
bretello
cce95a4ab7 zsh: disable dvc completion (slow!) 2021-10-07 20:42:05 +02:00
bretello
92e0591129
zsh: fix apt antibody command 2021-10-07 20:34:53 +02:00
bretello
a8039caf58
zsh: add completion style 2021-10-07 20:34:53 +02:00
bretello
b6c078fbfe
zsh: remove deprecated zsh plugin 2021-10-06 23:47:15 +02:00
bretello
54167b0107
zsh: sort antibody plugins 2021-10-04 09:35:21 +02:00
bretello
cce075e29c
zsh: improve fgitlog, make it a function 2021-10-04 09:34:49 +02:00
bretello
8e760f3e3e
zsh: add dvc aliases 2021-10-04 09:34:49 +02:00
bretello
97b49b34c8
aliases: cleanup 2021-10-02 13:22:44 +02:00
bretello
ea6dbc555e
vim: add autocmds for go and rust 2021-10-01 17:34:38 +02:00
bretello
9bdbd1774d
zsh: remove antibody extra plugins 2021-10-01 17:34:38 +02:00
bretello
54666b0a03
vim: set spellang=it,en for markdown 2021-10-01 17:34:37 +02:00
bretello
9d901364fc
vim: improve git shortcuts 2021-10-01 17:34:37 +02:00
bretello
cbcc841ba8
vim: add pytest plugin 2021-10-01 17:34:37 +02:00
bretello
601a16f07d
vim: load CSV module on-demand 2021-10-01 17:34:37 +02:00
bretello
8f481eb4b7
vim: update python ALE config 2021-10-01 17:34:37 +02:00
bretello
f9c08eefd1
zsh: remove jira plugin 2021-10-01 17:34:37 +02:00
bretello
23a9369e66
tmux: add join-pane/swap-window shortcuts 2021-10-01 17:34:37 +02:00
bretello
9b2328aad3
vim: replace snipmate with ultisnips 2021-10-01 17:34:37 +02:00
bretello
55ca57247d
vim: replace CTRLP with fzf.vim
- add fzf.vim
- Remove ack plugin (use :Rg instead)
2021-10-01 17:34:36 +02:00
bretello
266b121d68
add ripgrep, remove ack 2021-10-01 17:34:36 +02:00
bretello
6a1bba6bbd
add more fzf goodies 2021-10-01 17:34:36 +02:00
bretello
38f7bf2c60
vim: add dvc BufRead commands 2021-10-01 17:03:23 +02:00
bretello
bf933fcf3e
vim: shortcuts: fix <leader>k 2021-09-26 16:09:47 +02:00
bretello
6f1d1263fa
vim: add cursorline 2021-09-26 16:09:15 +02:00
bretello
d8461c69fc
vim: improve color handling 2021-09-26 16:07:34 +02:00
bretello
14be7945e1
vim: shortcuts: improve tab navigation 2021-09-26 16:02:21 +02:00
bretello
9fe51f308c
vim: improve plugins_config 2021-09-26 15:59:46 +02:00
bretello
d1a6bf898e
vim: add vim-go plug 2021-09-26 15:53:57 +02:00
bretello
53b5d0f9f7
vim: fix GitStatus() 2021-09-26 15:52:21 +02:00
bretello
79e584b7e8
tmux: cleanup 2021-09-26 15:47:03 +02:00
bretello
8c43d4c7c1
zsh: vim mode: show navigation indicator 2021-09-26 15:46:44 +02:00
bretello
ca15cbc840
zsh: add dotfiles/fzf plugin 2021-09-26 15:36:41 +02:00
bretello
32ca99ea14 vim: update git shortcuts 2021-08-09 18:38:35 +02:00
bretello
ddefba551e vim: update NERDTreeIgnore 2021-08-09 18:37:58 +02:00
bretello
e009704e75 vim: move from python pyls to pylsp
note: this requires python-lsp-server (https://pypi.org/project/python-lsp-server/)
2021-08-09 18:36:17 +02:00
bretello
517cf45174 functions: add retry function 2021-07-19 10:40:08 +02:00
bretello
b64781409c
ansible: update ansible.cfg setup 2021-07-18 17:32:15 +02:00
bretello
d7ccec7fef
zsh: add LANG to the top of the main dotfile 2021-07-16 21:39:46 +02:00
bretello
636a8c185c tmux: update config 2021-05-19 11:28:38 +02:00
bretello
1e86f54f3c vim: wrap text in quickfix, loclist 2021-05-19 11:28:38 +02:00
bretello
3acebef599 vim: use spellcheck and wrapping for markdown files 2021-05-19 11:28:38 +02:00
bretello
9ae5b71263 vim: fix visual mode yank to clipboard 2021-05-19 11:28:34 +02:00
bretello
0cde5c3ea8 vim: add truecolor support 2021-05-19 11:27:25 +02:00
bretello
6cd1f5e07a vim: update ale config (rust+pylint) 2021-05-19 11:25:40 +02:00
bretello
5f84402142 vim: add shfmt as sh formatter 2021-05-19 11:25:40 +02:00
bretello
5a6dd6bee7 zsh: increase history size 2021-05-19 11:25:40 +02:00
bretello
926bb413a4
updater: add vim plugins update 2021-04-12 13:49:40 +02:00
bretello
98604c6a4c
updater: fix it 2021-04-12 13:49:40 +02:00
bretello
bbf4c325b8
zsh: add bgnotify omz plugin: notifications for long running commands (>6s) 2021-04-11 20:18:17 +02:00
bretello
37821a77ab
ansible: add update.yml to perform updates, add vim install step 2021-04-11 20:16:31 +02:00
bretello
9ac97f0af7
vim: fix copy/paste shortcuts
use map instead of noremap so that <leader>Y can be also used
in visual mode
2021-04-11 18:50:03 +02:00
bretello
7f2e0333fd
vim: add <leader>m to run make silently 2021-04-11 13:26:50 +02:00
bretello
ab7660a41b
vim: fix python breakpoint macro (@b) 2021-04-11 13:24:17 +02:00
bretello
0cb850b8a4
zsh: add conditional insertion for systemd and debian plugins 2021-04-11 13:09:47 +02:00
bretello
d99915b642
vim: add vim-vpp-modern plug 2021-04-10 22:06:03 +02:00
bretello
c2ae92ff9e
aliases: add venv 2021-04-10 22:06:03 +02:00
bretello
f8bc1793b7
zsh: use omz's zsh-navigation-tools, add zsh_reload
use `src` to reload/recompile zsh
2021-04-10 22:06:02 +02:00
bretello
6f5b808787
zsh: remove pip completion, fix formatting 2021-04-10 22:06:02 +02:00
bretello
f307a2207d
zsh: add vim filetype/conf hint 2021-04-10 22:06:02 +02:00
bretello
a6a927e6d8
zsh: add add antibody extras, cleanup plugins.txt
export _DOTFILES_EXTRA_PLUGINS=true to load plugins in
`antibody_plugins_extra.txt`
2021-04-10 22:06:02 +02:00
bretello
e1921affdc
zsh: add BAT_THEME=gruvbox-dark env var 2021-04-10 22:05:44 +02:00
bretello
2e19f7d476
add tmux basic config 2021-04-05 18:12:53 +02:00
bretello
fe83822b56
vim: use popup for completion suggestions 2021-04-05 18:12:53 +02:00
bretello
3bab8cd959
vim: add csv plugin 2021-04-05 18:12:53 +02:00
bretello
d20c511105
vim: add terraform plugin 2021-04-05 18:12:53 +02:00
bretello
61fcdb7ea7
vim: remove duplicate shortcut 2021-04-05 18:12:53 +02:00
bretello
40074e5655
vim: add <leader>ll to open loclist 2021-04-05 18:12:53 +02:00
bretello
8a1ca40569
functions: add gi() to query toptal's gitignore API 2021-04-05 18:12:52 +02:00
bretello
681acc90e6
vim: use <leader>ep to open plugs.vim 2021-04-05 18:12:52 +02:00
bretello
c5edf934ef
gitconfig: revert back to vimdiff 2021-04-05 18:12:52 +02:00
bretello
55abb84de7
vim: add Quickpeek 2021-04-05 18:12:52 +02:00
bretello
f95cbf6e5c
vim: add ale_completion_symbols 2021-04-05 18:12:52 +02:00
bretello
1a603373ec
vim: add <leader>t shortcuts class for tab navigation 2021-04-05 18:12:52 +02:00
bretello
5a79c63f33
vim: map <leader>/ to Git 2021-04-05 18:12:52 +02:00
bretello
b3ad761244
vim: add snipmate config 2021-04-05 18:12:52 +02:00
bretello
7bdba383c6
vim: map <leader>r to ALERepeatSelection, add -relative flag to ALEFindReferences 2021-04-05 18:12:51 +02:00
bretello
d88b203b73
vim: add <leader>ef,ec,es to open config files
<leader>ef edits $DOTFILES/vim/functions.vim
<leader>ec edits $DOTFILES/vim/plugins_config.vim
<leader>es edits $DOTFILES/vim/shortcuts.vim
2021-04-05 18:12:51 +02:00
bretello
88c26c90d1
vim: cleanup 2021-04-05 18:12:51 +02:00
bretello
185330490b
vim: shortcuts: fix clipboard yanking on linux 2021-04-05 18:12:51 +02:00
bretello
a8f17dfaa3
vim: cleanup ALE linters and config 2021-04-05 18:12:51 +02:00
bretello
4f34f5957f
vim: shortcuts: use loclist for Ack (LAck), cleanup 2021-04-05 18:12:51 +02:00
bretello
036c631c0c
zsh: theme: improve navigation mode display 2021-04-05 18:12:51 +02:00
bretello
1e4bf92f96
add git-blame-ignore-revs 2021-04-05 18:12:50 +02:00
bretello
529f0f0dff
zsh: fix tab formatting for zsh-theme 2021-04-05 18:12:50 +02:00
bretello
e50cc58941
vim: add completion to Man and Cmd functions 2021-04-05 18:12:50 +02:00
bretello
9dd2aa7ac4
Revert "vim: remove <leader>mk shortcut"
This reverts commit 45e0800add.
2021-04-05 18:12:50 +02:00
bretello
e38021e324
vim: set gruvbox contrast to 'dark' 2021-04-05 18:12:50 +02:00
bretello
f19e9ea485
vim: add syntax highlighting to :Man command 2021-04-05 18:12:50 +02:00
bretello
f5f70bfc07
vim: add clang-format as a C fixer 2021-04-05 18:12:50 +02:00
bretello
43b72d36dd
vim: remove :Explore shortcut 2021-04-05 18:12:49 +02:00
bretello
71f307e12c
zsh: move vi_mode_prompt_info to RPS1 2021-04-05 18:12:49 +02:00
bretello
dbe581b065
vim: cleanup airline configuration 2021-04-05 18:12:49 +02:00
bretello
f9fe64f9f8
vim: map <leader>H to HighlightCoverageForAll 2021-04-05 18:12:49 +02:00
bretello
11ae80412d
vim: fix gutentags ctags exclude list 2021-04-05 18:12:49 +02:00
bretello
deb1563e50
vim: add noexpandtab for golang 2021-04-05 18:12:49 +02:00
bretello
db74463cd1
vim: add bash-language-server linter 2021-04-05 18:12:48 +02:00
bretello
b01bf588eb
vim: swap CtrlPBufTag with CtrlPTag, add CtrlPLine 2021-04-05 18:12:48 +02:00
bretello
53923d0d58
pdbprc: minor improvements 2021-04-05 18:12:48 +02:00
bretello
52e4ed0d88
vim: update gutentags/ctrlp configuration 2021-04-05 18:12:44 +02:00
bretello
4ef43fed16
vim: add snipmate plug dependency 2021-01-15 01:43:43 +01:00
bretello
79dcf5e973
zsh: add $ANTIBODY environment variable 2021-01-15 01:34:40 +01:00
bretello
d4ec9a5f2e
zsh: add visual mode indicator to zsh theme 2021-01-15 01:34:10 +01:00
bretello
42422738e4
vim: improve CtrlP shortcuts, remove bufexplorer plug 2021-01-15 00:12:13 +01:00
bretello
45e0800add
vim: remove <leader>mk shortcut 2021-01-09 23:54:58 +01:00
bretello
5e4fa5ef03
vim: enable folds by default 2021-01-09 23:54:20 +01:00
bretello
b280360a16
zsh: do not show parentheses around git prompt 2021-01-09 23:53:54 +01:00
bretello
651bfe01f7
vim: add Goyo shortcuts
- `<leader>za` opens Goyo
- `<leader>zz` toggles Goyo
2021-01-09 23:46:33 +01:00
bretello
9e2e7e1ee0
vim: add Man and Cmd functions
- `:Man <cmd>` opens the man of `cmd` in a new buffer
- `:Cmd <cmd>` executes `cmd` and shows the output in a new scratch
  buffer
2021-01-09 23:44:49 +01:00
bretello
229a97856e
add bash-language-server archlinux package 2021-01-09 23:41:47 +01:00
bretello
6c90122583
git: add global gitignore file 2021-01-09 23:41:47 +01:00
bretello
6b97913926 vim: add <leader>I to toggle indent guides 2021-01-07 16:14:41 +01:00
bretello
a6997cc37c functions: replace transfer() with upload()
transfer.sh is no longer around, replace it with 0x0.st
2021-01-07 11:25:48 +01:00
bretello
95e74f1d32 vim: set tab config for vue files 2021-01-07 11:08:00 +01:00
bretello
b4c180b0e8 vim: set foldmethod to "indent" 2021-01-07 11:07:36 +01:00
bretello
3ee43774cc vim: fix nohighlight shortcut 2020-12-28 12:16:43 +01:00
bretello
63fdbc59ae
zsh: add grc oh-my-zsh plugin 2020-12-24 23:54:15 +01:00
bretello
8317b80841 vim: add vue plugin 2020-12-23 15:59:24 +01:00
bretello
8a6cda547b theme: fix on OS X
MacOS' sed syntax is different from GNU's. A workaround
is to use gsed (GNU sed) whenever it is available.
The multi-line prompt will be broken without gsed.
2020-12-10 11:07:27 +01:00
bretello
0e3e7cd155
vim: fix GitGutter{Next,Previous}Hunk mappings 2020-12-10 01:24:40 +01:00
bretello
bc4db32d68
vim: move twilight256.vim theme to vim dir 2020-12-09 22:25:35 +01:00
bretello
6bd0ce46ba
docs: misc formatting fixes 2020-12-09 22:25:35 +01:00
bretello
d066906af3
vim: add extra rule for iptables filetypes 2020-12-09 22:25:35 +01:00
bretello
daf0094409
vim: add persistent undo 2020-12-09 22:25:35 +01:00
bretello
2b6cac6c8d
vim: add iptables-restore plugin 2020-12-09 01:36:55 +01:00
bretello
bc8861451e
zsh: add /home/brethil/projects variable for projects folder 2020-12-09 01:11:29 +01:00
bretello
9430765116
vim: fix visual selection commands
- use <leader>gs to run fugitive's Git show on the selected text
 (must be a git ref)
- use <leader>k to run ack on the selected text
2020-12-09 00:59:20 +01:00
bretello
34fd5a8726
dev: update makefile with release target, update docs 2020-12-09 00:14:14 +01:00
bretello
4b3b12db5b
fix mkdir zsh cache
fixup 8a8d061
2020-12-08 22:53:09 +01:00
bretello
64ade8d864
theme: show hostname if in a ssh session 2020-12-08 22:53:09 +01:00
bretello
6485af4411
dev: improve makefile log readability 2020-12-08 22:46:36 +01:00
bretello
74dcf328aa
dev: add volumes to dockerfile 2020-12-08 22:46:36 +01:00
bretello
d6e1aac0f2
install: do not clone git repo for local development
use ansible with flag `-e local_development=false` to
skip cloning of git repo (useful with docker bind mounts
to existing repos)
2020-12-08 22:45:24 +01:00
bretello
0b68fec862
zsh: explain oh-my-zsh's ZSH variable 2020-12-08 15:20:42 +01:00
bretello
8f599cc5cc
vim/shortcuts: update GitGutter Next/Previous hunks mappings 2020-12-08 15:20:42 +01:00
bretello
12b8cd8360
aliases: add gs alias for git status 2020-12-08 15:20:42 +01:00
bretello
5fbaf3d535
update selfupdate mechanism
still based on oh-my-zsh's, bumped to version `452586e7`
2020-12-08 15:20:42 +01:00
bretello
8a8d061fe4
zsh: speed up load by a factor of 3 2020-12-08 15:20:42 +01:00
bretello
96d7882471
install: make git config setup idem-potent 2020-12-08 02:05:07 +01:00
bretello
762f3ef58c
install: use ansible
- ansible/playbooks/setup.yml can be used to install all dotfiles
- a test setup is included in the `dev` folder with arch and debian
  images
2020-12-08 00:36:08 +01:00
bretello
5dc09a62ea
zsh-theme: improve initial setup 2020-12-08 00:07:55 +01:00
bretello
1b4c259c97
vim: add ansible.yaml rules 2020-12-08 00:07:55 +01:00
bretello
9fe2ec17a6
vim: formatting in vimrc 2020-12-08 00:06:36 +01:00
bretello
c15dd149d4
vim: move ale definition to ale group 2020-12-08 00:06:36 +01:00
bretello
5bf9ace8fb
vim: replace lightline with airline 2020-12-08 00:06:36 +01:00
bretello
a24e5efa7b
vim: reload all configurations on write 2020-12-08 00:06:36 +01:00
bretello
c37017f80e
vim: add <leader>vv to re-select text after pasting 2020-12-08 00:06:36 +01:00
bretello
0b68731e97
vim: add vim-toml 2020-12-08 00:06:35 +01:00
77 changed files with 3185 additions and 1628 deletions

7
.dockerignore Normal file
View File

@ -0,0 +1,7 @@
/.drone.yml
/.gitignore
/.dotfiles-update
.mypy_cache
.venv
.zcompdump*
.vagrant

1
.git-blame-ignore-revs Normal file
View File

@ -0,0 +1 @@
0c3b712

37
.github/workflows/ansible.yml vendored Normal file
View File

@ -0,0 +1,37 @@
name: Build Image
on:
push:
branches: [main]
pull_request:
schedule:
- cron: "20 4 * * 6" # saturday at 4.20
workflow_dispatch:
jobs:
ansible:
runs-on: archlinux-latest
steps:
- name: Install ansible
run: |
pacman -Sy
pacman -S ansible --noconfirm
- name: Setup local inventory
run: |
echo "localhost ansible_user=root connection=local" > ansible-hosts
- name: Run playbook
run: |
ansible-playbook -i ansible-hosts playbook.yml
- name: Notify on failure
if: failure()
run: |
python -m venv .
./bin/pip install git+https://git.decapod.one/brethil/bretellofier
./bin/bretellofier "[brethil/dotfiles] 💥 Build failed"
env:
BRETELLOFIER_RECIPIENTS: ${{ secrets.BRETELLOFIER_RECIPIENTS }}
BRETELLOFIER_TOKEN: ${{ secrets.BRETELLOFIER_TOKEN}}

41
.github/workflows/build_image.yml vendored Normal file
View File

@ -0,0 +1,41 @@
name: Build Image
on:
push:
branches: [main]
pull_request:
schedule:
- cron: "20 4 * * 6" # saturday at 4.20
workflow_dispatch:
env:
FORCE_COLOR: "1"
DOCKER_REGISTRY: registry.decapod.one
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to docker registry
uses: docker/login-action@v3
with:
registry: registry.decapod.one
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: registry.decapod.one/brethil/dotfiles:latest
- name: Notify on failure
if: failure()
run: |
python -m venv .
./pip install git+https://git.decapod.one/brethil/bretellofier
./bin/bretellofier "[brethil/dotfiles] 💥 Build failed"
env:
BRETELLOFIER_RECIPIENTS: ${{ secrets.BRETELLOFIER_RECIPIENTS }}
BRETELLOFIER_TOKEN: ${{ secrets.BRETELLOFIER_TOKEN}}

3
.gitignore vendored
View File

@ -1,8 +1,7 @@
.dotfiles-update
.DS_store
*antigen-compat
*.zwc
history.sqlite
dhist
ipython/profile_default/{log,db}
ipython/profile_default/history.sqlite

70
Dockerfile Normal file
View File

@ -0,0 +1,70 @@
FROM archlinux:latest as base
ENV TERM=xterm-256color
ENV DOTFILES=/root/.dotfiles
RUN pacman --noconfirm -Syu && pacman --noconfirm -Sy \
vim \
tmux \
git \
fzf \
base-devel \
ipython \
python-pip \
htop \
python-ruff \
python-virtualenv \
bash-language-server \
&& rm -rf /var/cache/pacman/pkg/*
# Enable colors in pacman
RUN sed -i 's/^#Color/Color/' /etc/pacman.conf
FROM base as builder
# Cannot run makepkg as root: add build user
RUN useradd build && echo "build ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers
USER build
# yay (pre-compiled) and bretellofier
WORKDIR /home/build/yay
RUN git clone https://aur.archlinux.org/yay-bin.git /home/build/yay && \
git clone https://aur.archlinux.org/bretellofier.git /home/build/bretellofier && \
cd /home/build/yay && env GOCACHE=/home/build makepkg --syncdeps --noconfirm && \
cd /home/build/bretellofier && makepkg --syncdeps --noconfirm
FROM base as final
WORKDIR /root
RUN pacman -Sy --noconfirm zsh && chsh -s /bin/zsh
COPY --from=builder /home/build/yay/*zst /tmp/
COPY --from=builder /home/build/bretellofier/*zst /tmp/
RUN pacman --noconfirm -U /tmp/*zst && rm -rf /tmp/*zst
# antibody
RUN curl -sL https://git.io/antibody | sh -s - -b /usr/local/bin
# vim-plug
RUN curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
RUN git clone https://git.decapod.one/brethil/dotfiles ${DOTFILES}
COPY . ${DOTFILES}
WORKDIR /root/
RUN echo -e "export DOTFILES=/root/.dotfiles\nsource \$DOTFILES/brethil_dotfile.sh" >> .zshrc && \
ln -s $DOTFILES/vim/vimrc .vimrc && \
ln -s $DOTFILES/tmux.conf .tmux.conf && \
echo -e "[include]\npath = $DOTFILES/gitconfig" >> .gitconfig
# Install vim plugins
RUN vim -c 'PlugInstall|qa!'
# Install zsh plugins
RUN zsh -c exit
CMD ["tmux"]

189
README.md
View File

@ -1,125 +1,98 @@
# brethil's dotfiles
A set of zsh dotfiles based on antibody and oh-my-zsh
My own dotfiles. `zsh` configuration based on [antidote](https://github.com/mattmc3/antidote.git) and [oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh), `vim` configuration uses [vim-plug](https://github.com/junegunn/vim-plug), [ALE](https://github.com/dense-analysis/ale) and more.
[!ci.decapod.one status](https://ci.decapod.one/api/badges/2/status.svg)
[zsh theme](docs/brethil-theme.png "zsh theme")
[vim theme](docs/vim.png "vim theme")
[tmux theme](docs/tmux.png "tmux theme")
## Description
├── README.md
├──────── Main files ────────
│ ├── aliases.sh
│ │     └── aliases definitions (sources `~/.dotfiles_aliases`)
│ ├── colors.sh
│ │     └── ANSI color escapes
│ ├── functions.sh
│ │     └── contains function definitions (sources `~/.dotfiles_functions`)
│ ├── install.sh
│ │     └── main install script
│ └── brethil_dotfile.sh:
      └── This file should be sourced by your `.zshrc`
├──────── antibody plugins ────────
│ ├── antibody_plugins_arch.txt
│ └── antibody_plugins.txt
├──────── oh-my-zsh themes ────────
│ ├── brethil.zsh-theme
│ └── brethil-minimal.zsh-theme
├──────── Misc rc files────────
│ ├── gitconfig
│ │     └── git configuration
│ ├── ackrc
│ │     └── `ack`'s rc: a grep-like text finder
│ ├── ipython
│ │     ├── profile_default
│ │     ├── ipython_config.py
│ │     ├── startup
│ │     ├── 11-autoreload.py
│ │     └── README
│ ├── vim
│ │    ├── vimrc
│ │    │ └── main vim rc
│ │    ├── plugs.vim
│ │    │ └── plugins to be installed with vim-plug
│ │    ├── plugins_config.vim
│ │    │ └── plugins configuration
│ │    ├── shortcuts.vim
│ │    │ └── vim shortcuts definitions
│ │    ├── functions.vim
│ │    │ └── miscellaneous vim function
│ │    └── twilight256.vim
│ │      └── an old colorscheme
│ └── pdbrc.py
     └── pdb++'s rc (a drop-in replacement for pdb)
├──────── Other ─────────────
├── check_for_update.sh
     └── selfupdate script
└── useful_commands
├── README.md
├── playbook.yml
   └── aliases definitions. Add .zsh files here to include more
├──────── Main files ────────
│ ├── aliases/
│ │    └── aliases definitions. Add .zsh files here to include more
│ ├── functions/
│ │    └── functions definitions. ADD .zsh files here to include more
│ ├── colors.zsh
│ │    └── ANSI color escapes
│ ├── ansible
│ │    └── ansible roles/vars
│ ├── brethil_dotfile.sh:
│ │    └── main configuration file
│ ├── zsh_plugins.txt
│ │     zsh plugins sourced by antidote
├──────── oh-my-zsh themes ────────
│ └── themes
│     ├─ brethil.zsh-theme
│     └─ brethil-minimal.zsh-theme
├──────── Misc rc files────────
│ ├── gitconfig
│ │    └── git configuration
│ ├── ipython/
│ │    ├── ipython configs
│ ├── vim
│ │    ├── vimrc
│ │    │ └── main vim rc
│ │    ├── plugs.vim
│ │    │ └── plugins to be installed with vim-plug
│ │    ├── plugins_config.vim
│ │    │ └── plugins configuration
│ │    ├── shortcuts.vim
│ │    │ └── vim shortcuts definitions
│ │    └── functions.vim
│ │      └── miscellaneous vim function
│ └── pdbrc.py
     └── pdb++ rc (a drop-in replacement for pdb)
├──────── Other ─────────────
├── extras/check_for_update.zsh
     └── selfupdate script
└── useful_commands
## Installation
git clone https://git.decapod.one/brethil/dotfiles ~/.dotfiles
cd .dotfiles && bash install.sh
### With ansible:
```bash
bash dev/add_community.general.sh # only if community.general is not installed
ansible-playbook -v -i <hosts file> playbook.yml
```
This playbook can be tested [with a docker container](dev/README.md)
### Manually
```bash
git clone https://git.decapod.one/brethil/dotfiles ~/.dotfiles
cat <<EOF >> .zshrc
export DOTFILES=~/.dotfiles
source \$DOTFILES/brethil_dotfile.sh
EOF
ln -s ~/.dotfiles/vim/vimrc ~/.vimrc
```
## Updating
A self-update mechanism is included. It asks for confirmation to pull the latest changes
from the git repo every two weeks. This also updates the git-sourced repositories installed
by the install script. The self-update routine can be called manually by calling
dotfiles_selfupdate
```bash
dotfiles_selfupdate
```
If you do not want to run the installer script, you can just add source `brethil_dotfile.sh`
in your `.zshrc`. This requires antibody installed.
This can be disabling by setting the `DISABLE_DOTFILES_AUTO_UPDATE` env var before before sourcing `brethil_dotfile.sh`
### Available Functions
## Try it out
0. `cheat`: show cheat sheet for commands using cheat.sh (`cheat <commandname>`)
1. Quickly edit/reload profile (`esource`/`resource`)
2. `dockertags` list all tags for a given docker image
3. `color` to print colored text (see 3. in the Misc section):
Docker images are regularly built, and they include a full development environment (hence are quite large)
color $Red "This will be printed in red"
color $Yellow "This will be printed in red"
4. `mecp` to copy files back to the machine from wich you are ssh-ing.
For this to work an ssh tunnel with `Remoteforward` is needed:
ssh -R 22:localhost:2222 YOURHOSTNAMEHERE
or specify this in `~/.ssh/config` for a persistent configuration:
Host YOURHOSTNAMEHERE
Remoteforward 2222 localhost:22
This can be enabled in `~/.ssh/config` globally for all hosts by uncommenting the relevant `Host * Remoteforward`.
You might have to manually edit the username in the `mecp` definition in `functions.sh` if this is
different between the two machines. `mecp` copies by default on the local machine on `~/Desktop/`
5. Many more. Use `list_functions` to list defined functions and a small description
### Files/Folders
1. `~/bin`, `~/git`, `~/projects` folders
2. ssh config (`~/.ssh/config`):
- Create ssh keys if not defined already
- Keep connections alive by increasing timeout time
- Include multiplexer to allow quick multiple connections to the same host
- (Optional: Compression, this should allow more responsive shells with slow connections,
but will slow things down when copying large files. My suggestion is to have compression enabled
on a by-host basis in `~/.ssh/config`)
3. `brethil.zsh-theme`, `brethil-minimal.zsh-themes`, themes for oh-my-zsh,
symlinked in `$ZSH/custom/themes` (`$ZSH=~/.oh-my-zsh`)
4. `~/.dotfiles_functions`, `~/.dotfiles_aliases` are sourced by this dotfiles, allowing for custom functions/aliases
5. useful_commands contains a list of useful commands (the first rule of the tautology club...)
### Misc
1. Colored output (via `grc`) for several commands.
2. Easy names for ANSI color escapes (Black, Red, Green, Yellow, Blue, Cyan, Purple, White, CLEAR), for example:
echo -e "${Green}This text will be green${CLEAR}"
will result in green text. Use `$CLEAR` to clear previous escape sequences add B before the variable (check `colors.sh`)
name to use **bold** and U to underline (examples: `$BRed`, `$UBlack` for bold red and underlined black)
3. Autoupdate script running every two weeks, autoupdate function: `dotfiles_selfupdate` (or `git pull` from `$DOTFILES`folder)
4. Automatic fix of the`SSH_AUTH_SOCK`environment variable:`~/.ssh/rc` is installed run on every ssh login,
and updates a symlink pointing (`~/.ssh/ssh_auth_sock`). `SSH_AUTH_SOCK`points to this (set in`brethil_dotfile.sh`).
The idea is that if the user is logging in using `ssh -A`, and using tmux, it will be possible to use
the remote socket over different sessions by always using the symlink.
```bash
docker run -it registry.decapod.one/brethil/dotfiles
```

461
ackrc
View File

@ -1,461 +0,0 @@
--ignore-file=match:tags
--ignore-dir=build
--ignore-dir=dist
--ignore-dir=node-modules
--ignore-dir=.venv
--ignore-ack-defaults
# Vue
--type-add=vue:ext:vue
# This is the default ackrc for ack version v3.3.1.
# There are four different ways to match
#
# is: Match the filename exactly
#
# ext: Match the extension of the filename exactly
#
# match: Match the filename against a Perl regular expression
#
# firstlinematch: Match the first 250 characters of the first line
# of text against a Perl regular expression. This is only for
# the --type-add option.
### Directories to ignore
# Bazaar
# https://bazaar.canonical.com/
--ignore-directory=is:.bzr
# Codeville
# http://freshmeat.sourceforge.net/projects/codeville
--ignore-directory=is:.cdv
# Interface Builder (Xcode)
# https://en.wikipedia.org/wiki/Interface_Builder
--ignore-directory=is:~.dep
--ignore-directory=is:~.dot
--ignore-directory=is:~.nib
--ignore-directory=is:~.plst
# Git
# https://git-scm.com/
--ignore-directory=is:.git
# When submodules are used, .git is a file.
--ignore-file=is:.git
# Mercurial
# https://www.mercurial-scm.org/
--ignore-directory=is:.hg
# Quilt
# https://directory.fsf.org/wiki/Quilt
--ignore-directory=is:.pc
# Subversion
# https://subversion.apache.org/
--ignore-directory=is:.svn
# Monotone
# https://www.monotone.ca/
--ignore-directory=is:_MTN
# CVS
# https://savannah.nongnu.org/projects/cvs
--ignore-directory=is:CVS
# RCS
# https://www.gnu.org/software/rcs/
--ignore-directory=is:RCS
# SCCS
# https://en.wikipedia.org/wiki/Source_Code_Control_System
--ignore-directory=is:SCCS
# darcs
# http://darcs.net/
--ignore-directory=is:_darcs
# Vault/Fortress
--ignore-directory=is:_sgbak
# autoconf
# https://www.gnu.org/software/autoconf/
--ignore-directory=is:autom4te.cache
# Perl module building
--ignore-directory=is:blib
--ignore-directory=is:_build
# Perl Devel::Cover module's output directory
# https://metacpan.org/release/Devel-Cover
--ignore-directory=is:cover_db
# Node modules created by npm
--ignore-directory=is:node_modules
# CMake cache
# https://www.cmake.org/
--ignore-directory=is:CMakeFiles
# Eclipse workspace folder
# https://eclipse.org/
--ignore-directory=is:.metadata
# Cabal (Haskell) sandboxes
# https://www.haskell.org/cabal/users-guide/installing-packages.html
--ignore-directory=is:.cabal-sandbox
# Python caches
# https://docs.python.org/3/tutorial/modules.html
--ignore-directory=is:__pycache__
--ignore-directory=is:.pytest_cache
# macOS Finder remnants
--ignore-directory=is:__MACOSX
--ignore-file=is:.DS_Store
### Files to ignore
# Backup files
--ignore-file=ext:bak
--ignore-file=match:/~$/
# Emacs swap files
--ignore-file=match:/^#.+#$/
# vi/vim swap files https://www.vim.org/
--ignore-file=match:/[._].*[.]swp$/
# core dumps
--ignore-file=match:/core[.]\d+$/
# minified Javascript
--ignore-file=match:/[.-]min[.]js$/
--ignore-file=match:/[.]js[.]min$/
# minified CSS
--ignore-file=match:/[.]min[.]css$/
--ignore-file=match:/[.]css[.]min$/
# JS and CSS source maps
--ignore-file=match:/[.]js[.]map$/
--ignore-file=match:/[.]css[.]map$/
# PDFs, because they pass Perl's -T detection
--ignore-file=ext:pdf
# Common graphics, just as an optimization
--ignore-file=ext:gif,jpg,jpeg,png
# Common archives, as an optimization
--ignore-file=ext:gz,tar,tgz,zip
# Python compiles modules
--ignore-file=ext:pyc,pyd,pyo
# C extensions
--ignore-file=ext:so
# Compiled gettext files
--ignore-file=ext:mo
### Filetypes defined
# Makefiles
# https://www.gnu.org/s/make/
--type-add=make:ext:mk
--type-add=make:ext:mak
--type-add=make:is:makefile
--type-add=make:is:Makefile
--type-add=make:is:Makefile.Debug
--type-add=make:is:Makefile.Release
--type-add=make:is:GNUmakefile
# Rakefiles
# https://rake.rubyforge.org/
--type-add=rake:is:Rakefile
# CMake
# https://cmake.org/
--type-add=cmake:is:CMakeLists.txt
--type-add=cmake:ext:cmake
# Actionscript
--type-add=actionscript:ext:as,mxml
# Ada
# https://www.adaic.org/
--type-add=ada:ext:ada,adb,ads
# ASP
# https://docs.microsoft.com/en-us/previous-versions/office/developer/server-technologies/aa286483(v=msdn.10)
--type-add=asp:ext:asp
# ASP.Net
# https://dotnet.microsoft.com/apps/aspnet
--type-add=aspx:ext:master,ascx,asmx,aspx,svc
# Assembly
--type-add=asm:ext:asm,s
# DOS/Windows batch
--type-add=batch:ext:bat,cmd
# ColdFusion
# https://en.wikipedia.org/wiki/ColdFusion
--type-add=cfmx:ext:cfc,cfm,cfml
# Clojure
# https://clojure.org/
--type-add=clojure:ext:clj,cljs,edn,cljc
# C
# .xs are Perl C files
--type-add=cc:ext:c,h,xs
# C header files
--type-add=hh:ext:h
# CoffeeScript
# https://coffeescript.org/
--type-add=coffeescript:ext:coffee
# C++
--type-add=cpp:ext:cpp,cc,cxx,m,hpp,hh,h,hxx
# C++ header files
--type-add=hpp:ext:hpp,hh,h,hxx
# C#
--type-add=csharp:ext:cs
# CSS
# https://www.w3.org/Style/CSS/
--type-add=css:ext:css
# Dart
# https://dart.dev/
--type-add=dart:ext:dart
# Delphi
# https://en.wikipedia.org/wiki/Embarcadero_Delphi
--type-add=delphi:ext:pas,int,dfm,nfm,dof,dpk,dproj,groupproj,bdsgroup,bdsproj
# Elixir
# https://elixir-lang.org/
--type-add=elixir:ext:ex,exs
# Emacs Lisp
# https://www.gnu.org/software/emacs
--type-add=elisp:ext:el
# Erlang
# https://www.erlang.org/
--type-add=erlang:ext:erl,hrl
# Fortran
# https://en.wikipedia.org/wiki/Fortran
--type-add=fortran:ext:f,f77,f90,f95,f03,for,ftn,fpp
# Go
# https://golang.org/
--type-add=go:ext:go
# Groovy
# https://www.groovy-lang.org/
--type-add=groovy:ext:groovy,gtmpl,gpp,grunit,gradle
# GSP
# https://gsp.grails.org/
--type-add=gsp:ext:gsp
# Haskell
# https://www.haskell.org/
--type-add=haskell:ext:hs,lhs
# HTML
--type-add=html:ext:htm,html,xhtml
# Jade
# http://jade-lang.com/
--type-add=jade:ext:jade
# Java
# https://www.oracle.com/technetwork/java/index.html
--type-add=java:ext:java,properties
# JavaScript
--type-add=js:ext:js
# JSP
# https://www.oracle.com/technetwork/java/javaee/jsp/index.html
--type-add=jsp:ext:jsp,jspx,jspf,jhtm,jhtml
# JSON
# https://json.org/
--type-add=json:ext:json
# Kotlin
# https://kotlinlang.org/
--type-add=kotlin:ext:kt,kts
# Less
# http://www.lesscss.org/
--type-add=less:ext:less
# Common Lisp
# https://common-lisp.net/
--type-add=lisp:ext:lisp,lsp
# Lua
# https://www.lua.org/
--type-add=lua:ext:lua
--type-add=lua:firstlinematch:/^#!.*\blua(jit)?/
# Markdown
# https://en.wikipedia.org/wiki/Markdown
--type-add=markdown:ext:md,markdown
# We understand that there are many ad hoc extensions for markdown
# that people use. .md and .markdown are the two that ack recognizes.
# You are free to add your own in your ackrc file.
# Matlab
# https://en.wikipedia.org/wiki/MATLAB
--type-add=matlab:ext:m
# Objective-C
--type-add=objc:ext:m,h
# Objective-C++
--type-add=objcpp:ext:mm,h
# OCaml
# https://ocaml.org/
--type-add=ocaml:ext:ml,mli,mll,mly
# Perl
# https://perl.org/
--type-add=perl:ext:pl,pm,pod,t,psgi
--type-add=perl:firstlinematch:/^#!.*\bperl/
# Perl tests
--type-add=perltest:ext:t
# Perl's Plain Old Documentation format, POD
--type-add=pod:ext:pod
# PHP
# https://www.php.net/
--type-add=php:ext:php,phpt,php3,php4,php5,phtml
--type-add=php:firstlinematch:/^#!.*\bphp/
# Plone
# https://plone.org/
--type-add=plone:ext:pt,cpt,metadata,cpy,py
# Python
# https://www.python.org/
--type-add=python:ext:py
--type-add=python:firstlinematch:/^#!.*\bpython/
# R
# https://www.r-project.org/
--type-add=rr:ext:R
# reStructured Text
# https://docutils.sourceforge.io/rst.html
--type-add=rst:ext:rst
# Ruby
# https://www.ruby-lang.org/
--type-add=ruby:ext:rb,rhtml,rjs,rxml,erb,rake,spec
--type-add=ruby:is:Rakefile
--type-add=ruby:firstlinematch:/^#!.*\bruby/
# Rust
# https://www.rust-lang.org/
--type-add=rust:ext:rs
# Sass
# https://sass-lang.com
--type-add=sass:ext:sass,scss
# Scala
# https://www.scala-lang.org/
--type-add=scala:ext:scala
# Scheme
# https://groups.csail.mit.edu/mac/projects/scheme/
--type-add=scheme:ext:scm,ss
# Shell
--type-add=shell:ext:sh,bash,csh,tcsh,ksh,zsh,fish
--type-add=shell:firstlinematch:/^#!.*\b(?:ba|t?c|k|z|fi)?sh\b/
# Smalltalk
# http://www.smalltalk.org/
--type-add=smalltalk:ext:st
# Smarty
# https://www.smarty.net/
--type-add=smarty:ext:tpl
# SQL
# https://www.iso.org/standard/45498.html
--type-add=sql:ext:sql,ctl
# Stylus
# http://stylus-lang.com/
--type-add=stylus:ext:styl
# SVG
# https://en.wikipedia.org/wiki/Scalable_Vector_Graphics
--type-add=svg:ext:svg
# Swift
# https://developer.apple.com/swift/
--type-add=swift:ext:swift
--type-add=swift:firstlinematch:/^#!.*\bswift/
# Tcl
# https://www.tcl.tk/
--type-add=tcl:ext:tcl,itcl,itk
# TeX & LaTeX
# https://www.latex-project.org/
--type-add=tex:ext:tex,cls,sty
# Template Toolkit (Perl)
# http//template-toolkit.org/
--type-add=ttml:ext:tt,tt2,ttml
# Typescript
# https://www.typescriptlang.org/
--type-add=ts:ext:ts,tsx
# Visual Basic
--type-add=vb:ext:bas,cls,frm,ctl,vb,resx
# Verilog
--type-add=verilog:ext:v,vh,sv
# VHDL
# http://www.eda.org/twiki/bin/view.cgi/P1076/WebHome
--type-add=vhdl:ext:vhd,vhdl
# Vim
# https://www.vim.org/
--type-add=vim:ext:vim
# XML
# https://www.w3.org/TR/REC-xml/
--type-add=xml:ext:xml,dtd,xsd,xsl,xslt,ent,wsdl
--type-add=xml:firstlinematch:/<[?]xml/
# YAML
# https://yaml.org/
--type-add=yaml:ext:yaml,yml

View File

@ -1,101 +0,0 @@
###########################
#### ALIAS #
###########################
####
#### Easier life (MAC SPECIFIC)
####
if [[ "$(uname)" == "Darwin" ]]; then
alias o="open"
alias ls="ls -G"
## Colorize system.log contents (with grc), and inspect with less.
alias console="grc cat /var/log/system.log | sort -r | less -R"
## Quicklook shortcut
alias quicklook='qlmanage -px 2>/dev/null'
alias ql='quicklook'
## Airport command line interface
alias airport='/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport'
## Flush dns cache
#alias dnsflushcache='sudo discoveryutil mdnsflushcache' # used to work until 10.6
alias dnsflushcache='sudo killall -HUP mDNSResponder' # Works up until 10.9 and after 10.10.4
alias lsrt='ls -G -lrt | tail -5'
else
alias ls='ls --color'
fi
####
#### Easier life (everything)
alias dot="cd $DOTFILES"
#### Audible bell
alias bell='echo -en "\007"'
alias grep="grep --colour=auto"
##############
## ls aliases
############
# ls -al, only show files that start with a dot
alias lsdot="ls -al | awk '\$9 ~ /^\./ {print \$0}'"
alias lt='ls -lrt | tail -10'
alias ll='ls -lhL' #long ls output
alias ka="killall"
alias ipy='ipython'
alias ipyl='ipython --pylab'
## Show the last 10 modified files
if [[ ! "$(uname)" == "Darwin" ]]; then
alias lsrt="ls -lrt | tail -10"
fi
## Stress one CPU core
alias stress='yes >> /dev/null'
# define ssh without controlmaster
alias ssh1="ssh -o ControlMaster=no"
# git: useful_stuff
alias git_sort_branches_by_date="git for-each-ref --sort=committerdate refs/heads/ --format='%(committerdate:short) %(refname:short)'"
alias gl5='git log -n 5'
alias pvim='poetry run vim'
# grc: try to source the definitions file in /etc/grc.zsh (print a warning if it does not exist)
if [[ -f /etc/grc.zsh ]] ; then
source /etc/grc.zsh
elif [[ -f /usr/local/etc/grc.zsh ]] ; then
source /usr/local/etc/grc.zsh
else
echo "Could not grc completion file (checked /etc/grc.zsh and /usr/local/etc/grc.zsh. Command colorization will not work. Check your grc configuration (is grc installed?)" 1>&2
fi
alias powerline_update="pip install --upgrade --user 'git+https://github.com/powerline/powerline.git@develop#powerline'"
alias gcf='git commit --fixup=HEAD'
alias gcaf='git commit -a --fixup=HEAD'
alias gls="git log --pretty=oneline --abbrev-commit" # gls: Git Log Short
alias watcha='watch ' # note the space after watch. This makes watch work with aliases
# A short version of docker ps
alias dps='docker ps --format "table {{.Image}}\t{{.RunningFor}}\t{{.Status}}\t{{.Ports}}\t{{.Names}}"'
# Get ip for a docker container, usage: `docker inspect <container> | dockerip`
alias dockerip="jq -r '.[].NetworkSettings.Networks.bridge.IPAddress'"
alias pvim='poetry run vim'
alias pshell='poetry shell'
# dotfiles user aliases
if [[ -f ~/.dotfiles_aliases ]]; then
source $HOME/.dotfiles_aliases
fi
# source ssh aliases
if [[ -f $HOME/.ssh_aliases ]]; then
source $HOME/.ssh_aliases
fi

4
aliases/README.md Normal file
View File

@ -0,0 +1,4 @@
# aliases
Place custom alias definitions in this folder, with a `.zsh` extension.
These files will be sourced on startup

88
aliases/aliases.zsh Executable file
View File

@ -0,0 +1,88 @@
###########################
#### ALIAS #
###########################
####
#### Easier life (MAC SPECIFIC)
####
if [[ "$(uname)" == "Darwin" ]]; then
alias o="open"
alias ls="ls -G"
## Colorize system.log contents (with grc), and inspect with less.
alias console="grc cat /var/log/system.log | sort -r | less -R"
## Quicklook shortcut
alias quicklook='qlmanage -px 2>/dev/null'
alias ql='quicklook'
## Airport command line interface
alias airport='/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport'
## Flush dns cache
#alias dnsflushcache='sudo discoveryutil mdnsflushcache' # used to work until 10.6
alias dnsflushcache='sudo killall -HUP mDNSResponder' # Works up until 10.9 and after 10.10.4
alias lsrt='ls -G -lrt | tail -5'
else
alias ls='ls --color'
fi
####
#### Easier life (everything)
alias dot="cd $DOTFILES"
#### Audible bell
alias bell='echo -en "\007"'
alias grep="grep --colour=auto"
alias grepi="grep -i"
##############
## ls aliases
############
# ls -al, only show files that start with a dot
alias lsdot="ls -al | awk '\$9 ~ /^\./ {print \$0}'"
alias lt='ls -lrt | tail -10'
alias ll='ls -lhL' #long ls output
alias ka="killall"
alias ipy='ipython'
alias ipyl='ipython --pylab'
alias treep='tree -I __pycache__'
## Show the last 10 modified files
if [[ ! "$(uname)" == "Darwin" ]]; then
alias lsrt="ls -lrt | tail -10"
fi
## Stress one CPU core
alias stress='yes >> /dev/null'
# ssh forcing a new connection (no persistent)
alias ssh1="ssh -o ControlMaster=yes -o ControlPersist=no"
alias watcha='watch ' # note the space after watch. This makes watch work with aliases
# A short version of docker ps
alias dps='docker ps --format "table {{.Image}}\t{{.RunningFor}}\t{{.Status}}\t{{.Ports}}\t{{.Names}}"'
# Get ip for a docker container, usage: `docker inspect <container> | dockerip`
alias dockerip="jq -r '.[].NetworkSettings.Networks.bridge.IPAddress'"
alias pvim='poetry run vim'
alias pshell='poetry shell'
alias venv='source .venv/bin/activate'
# Run fzf with file preview
alias pf="fzf --preview='BAT_STYLE='header,changes' bat --color=always {}' --bind shift-up:preview-page-up,shift-down:preview-page-down"
# dvc
alias dst='dvc status'
alias dstc='dvc status --cloud'
alias drp='dvc repro'
alias drps='dvc repro -s'
alias -g J="| jq "
# These two depend on oh-my-zsh's clipcopy/clippaste functions
alias -g C='| clipcopy'
alias -g P='clippaste'

8
aliases/git.zsh Normal file
View File

@ -0,0 +1,8 @@
# git: useful_stuff
alias git-sort-branches-by-date="git for-each-ref --sort=committerdate refs/heads/ --format='%(committerdate:short) %(refname:short)'"
alias gswr="git-switch-recent-branch" # defined in functions/git.zsh
alias gl5='git log -n 5'
alias gs='git status'
alias gcfx='git-fixup'
alias gls="git log --pretty=oneline --abbrev-commit" # gls: Git Log Short
alias glsu='git ls-files --others --exclude-standard'

View File

@ -0,0 +1,17 @@
# Archlinux User Repository (AUR)
Role to install [Archlinux User Repository (AUR)](https://aur.archlinux.org/packages) packages.
Add extra packages to the defaults in [vars/main.yml](vars/main.yml) by providing the `aur_extra` variable:
```yaml
- hosts: all
vars:
aur_extra:
- bretellofier
- yay
roles:
- role: aur-packages
```

View File

@ -0,0 +1,6 @@
---
collections:
# - { name: community.general, version: 3.1.0 }
- community.general
# dependencies:
# - role: yay

View File

@ -0,0 +1,24 @@
---
- debug:
msg: "Installing AUR package: {{ package }}"
- name: Clone package repo
become: true
become_method: sudo
become_user: nobody
git:
repo: "https://aur.archlinux.org/{{ package }}.git"
dest: "/home/build/{{ package }}"
# version: master
clone: true
force: true
- name: Build package
become: true
become_method: sudo
become_user: nobody
shell: |
cd "/home/build/{{package}}"
makepkg --force --syncdeps --rmdeps --noconfirm --install
environment:
GOCACHE: /tmp/go_cache/

View File

@ -0,0 +1,34 @@
---
- name: Create build directory
file:
path: "/home/build"
state: directory
mode: "0700"
owner: nobody
- name: Install aur packages
block:
- name: Allow nobody user to run pacman
community.general.sudoers:
name: allow-nobody-pacman
user: nobody
commands:
- /usr/sbin/pacman
# noexec: true # required by makepkg
state: present
- name: Install packages
include_tasks: ./build_package.yml
vars:
package: "{{ item }}"
loop: "{{ aur_packages + aur_extra }} "
always:
- name: Disallow nobody user to run pacman
community.general.sudoers:
name: allow-nobody-pacman
user: nobody
commands:
- /usr/sbin/pacman
noexec: true
state: absent

View File

@ -0,0 +1,4 @@
aur_packages:
- bretellofier
- yay
aur_extra: []

View File

@ -0,0 +1,5 @@
# dotfiles
Role to install dotfiles and do initial configuration of a new host.
Installed packages can be found in [vars/main.yml](vars/main.yml).

View File

@ -0,0 +1,3 @@
---
collections:
- community.general

View File

@ -0,0 +1,155 @@
---
- name: Install required system packages (debian)
apt:
install_recommends: false
update_cache: true
pkg: "{{ packages + packages_debian }}"
state: present
when: ansible_facts['os_family'] == "Debian"
become: true
- name: Install required system packages (arch)
pacman:
update_cache: true
name: "{{ packages + packages_archlinux }}"
state: present
when: ansible_facts['os_family'] == "Archlinux"
become: true
- name: Clone dotfiles repo
git:
repo: https://git.decapod.one/brethil/dotfiles
dest: "{{ dotfiles_path }}"
clone: true
update: false
register: git_clone_result
tags:
- dotfiles-update
- debug:
var: git_clone_result['after']
when: git_clone_result['before'] == "null"
tags:
- dotfiles-update
- name: Update dotfiles repo
git:
repo: https://git.decapod.one/brethil/dotfiles
dest: "{{ dotfiles_path }}"
clone: false
update: false
when: git_clone_result['before'] != "null"
register: git_update_result
tags:
- dotfiles-update
- debug:
var: git_update_result['after']
when: git_update_result['before'] != "null"
- name: directories
file:
dest: "{{ item }}"
state: directory
mode: "0700"
loop: "{{ directories }}"
vars:
directories:
- "$HOME/bin"
- "$HOME/projects"
- "$HOME/git"
- "$HOME/.config/git"
- "$HOME/.ssh/"
- "$HOME/.ssh/sockets"
- "$HOME/.ipython/profile_default"
- name: Set zsh as default shell
user:
name: "{{ ansible_user }}"
shell: /usr/bin/zsh
become: true
- name: Update zshrc
blockinfile:
path: $HOME/.zshrc
marker: "# {mark} brethil dotfiles"
block: |
export DOTFILES={{ dotfiles_path }}
source $DOTFILES/brethil_dotfile.sh
create: true
mode: 600
- name: Update .ssh/config
blockinfile:
path: $HOME/.ssh/config
marker: "# {mark} brethil dotfiles"
insertbefore: "BOF"
block: |
TCPKeepAlive=yes
ServerAliveCountMax=6
## Uncomment to enable compression for all ssh sessions
#Compression=yes
ControlMaster auto
ControlPath ~/.ssh/sockets/%r@%n:%p
ControlPersist yes
Host *
ServerAliveInterval 300
create: true
- name: dotfiles symlinks
file:
src: "{{ dotfiles_path }}/{{ item.key }}"
dest: "{{ item.value }}"
state: link
force: yes
loop: "{{ files | dict2items }}"
vars:
files:
"tmux.conf": "~/.tmux.conf"
"vim/vimrc": "~/.vimrc"
"pdbrc.py": "~/.pdbrc.py"
"gitignore": "~/.config/git/ignore"
"ipython/profile_default/ipython_config.py": "~/.ipython/profile_default/ipython_config.py"
"ipython/profile_default/startup": "~/.ipython/profile_default/startup"
- name: Exec vim undodir migration (if required)
command: |
mv ${HOME}/.vim_runtime/temp_dirs/undodir ${HOME}/.vim/undo
args:
removes: .vim_runtime/temp_dirs/undodir
- name: Install and update vim plugins
command: |
vim -c 'PlugInstall|PlugUpdate|qa!'
environment:
- DOTFILES: "{{ dotfiles_path }}"
tags:
- dotfiles-update
- name: Get git config facts
community.general.git_config:
name: "include.path"
scope: global
register: config_value
- name: Set up git config include if required
community.general.git_config:
name: "include.path"
value: "{{ dotfiles_path }}/gitconfig"
scope: global
when: config_value is not defined
- name: check gitignore migration
stat: path=${HOME}/.gitignore
register: gitignore
- name: gitignore migration
shell: |
set -eu
mkdir -p ${HOME}/.config/git
ln -s {{ dotfiles_path }}/gitignore ${HOME}/.config/git/ignore
rm -f ~/.gitignore
when: gitignore.stat.exists

View File

@ -0,0 +1,36 @@
---
dotfiles_path: "$HOME/.dotfiles"
packages:
- "bmon"
- "byobu"
- "ccze"
- "curl"
- "fzf"
- "git"
- "grc"
- "htop"
- "iotop"
- "nmap"
- "ripgrep"
- "tmux"
- "tree"
- "vim"
- "zsh"
packages_debian:
- "bat"
- "ipython3"
- "mtr-tiny"
- "python3-pip"
- "python3-setuptools"
- "virtualenv"
packages_archlinux:
- "ansible-language-server"
- "bash-language-server"
- "base-devel"
- "bat"
- "ipython"
- "man"
- "mtr"
- "python-virtualenv"
- "sudo"

View File

@ -0,0 +1,53 @@
---
- name: Create build directory
file:
path: "/home/build"
state: directory
mode: "0700"
owner: nobody
- name: Make sure requirements are installed
community.general.pacman:
update_cache: yes
name:
- base-devel
- git
- go
- sudo
state: present
become: true
- name: Clone yay repo
become: true
become_method: sudo
become_user: nobody
git:
repo: https://aur.archlinux.org/yay.git
dest: /home/build/yay
version: master
clone: true
force: true
- name: build
become: true
become_method: sudo
become_user: nobody
shell: |
cd /home/build/yay
makepkg -f
environment:
- GOCACHE: /tmp/gocache
- ANSIBLE_REMOTE_TMP: /tmp/ansible
- name: Get built package
shell: |
ls -rt /home/build/yay/yay*.pkg.tar.zst | grep -v debug | tail -1
register: yay_package
- debug:
msg: "Built {{ yay_package.stdout }}"
- name: Install yay
community.general.pacman:
name: "{{ yay_package.stdout }}"
state: present

View File

@ -1,16 +0,0 @@
robbyrussell/oh-my-zsh
robbyrussell/oh-my-zsh path:plugins/colored-man-pages
robbyrussell/oh-my-zsh path:plugins/common-aliases
robbyrussell/oh-my-zsh path:plugins/docker
robbyrussell/oh-my-zsh path:plugins/docker-compose
robbyrussell/oh-my-zsh path:plugins/git
#robbyrussell/oh-my-zsh path:plugins/kubectl
robbyrussell/oh-my-zsh path:plugins/sudo
robbyrussell/oh-my-zsh path:plugins/vi-mode
robbyrussell/oh-my-zsh path:plugins/pyenv
djui/alias-tips
psprint/zsh-navigation-tools
zdharma/fast-syntax-highlighting
zsh-users/zsh-autosuggestions
zsh-users/zsh-completions
MichaelAquilina/zsh-autoswitch-virtualenv

View File

@ -1,2 +0,0 @@
robbyrussell/oh-my-zsh path:plugins/systemd
robbyrussell/oh-my-zsh path:plugins/archlinux

View File

@ -1,126 +0,0 @@
# vim:ft=zsh ts=2 sw=2 sts=2
# color chart available at https://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html
# %F{202}: orange
# %K{202}: background orange
# 255: white
# See the prompt expansion section in `info zsh` for more info
function user_prompt(){
# root printed on a red background
local USER_PROMPT="%(#.%K{160}%F{255}[root]%k%f.)"
echo "$USER_PROMPT"
# if [[ -n $SSH_CONNECTION ]]; then
# local host="${purple}%B%m%b${default}"
# host="%U${host}%u"
# echo "$host"
# fi
}
function job_prompt() {
local JOB_PROMPT="%(1j.%B%K{202}%F{220} %j %k%b.)" # Shows jobs number on an orange background if there are background jobs
echo "$JOB_PROMPT"
}
function shlvl_prompt() {
local SHLVL_PROMPT
if [[ -n "$BYOBU_PREFIX" ]]; then
SHLVL_PROMPT="%(3L.%K{161}%F{255}%B $((SHLVL-1)) %f%b%k.)" # Shows SHLVL on a magenta background if SHLVL > 1
else
SHLVL_PROMPT="%(2L.%K{161}%F{255}%B %L %f%b%k.)" # Shows SHLVL on a magenta background if SHLVL > 1
fi
echo "$SHLVL_PROMPT"
}
function path_prompt(){
# Shows last 3 items in path if there are more than 4
local PATH_PROMPT="%F{white}[%F{green}%(4~:…/%3~:%~)%F{white}]%f"
echo "$PATH_PROMPT"
}
# PREFIX/SUFFIX are added before/after `git_prompt_info`
ZSH_THEME_GIT_PROMPT_PREFIX="%f%{$fg[yellow]%} "
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[white]%}%{$fg[red]%}x%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[white]%}%{$fg[green]%}√%{$reset_color%}"
# The following are part of `git_prompt_status`
# Rules:
# ? : untracked
# * : modified
# + : added
# $ : stashed
ZSH_THEME_GIT_PROMPT_STASHED="%B%F{32}$%b%f" # blue
# ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[red]%}✗ " # this is equivalent to DIRTY, if DISABLE_UNTRACKED_FILES_DIRTY is set
ZSH_THEME_GIT_PROMPT_ADDED="%B%F{34}+%b%f" # green
ZSH_THEME_GIT_PROMPT_UNTRACKED="%B%F{red}?%b%f" # red
# The following are part of `git_remote_status`
# ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE="%{$fg[green]%}="
ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE="%F{255}>%f"
ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE="%F{255}<%f"
ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE="%F{255}<>%f"
function virtualenv_info {
[ -z "$VIRTUAL_ENV" ] && return
local BOLD_PURPLE='%B%F{5}'
local CLEAR='%f%b'
local venv
venv="$(basename "$VIRTUAL_ENV")"
if [[ "$venv" == ".venv" ]]; then
venv="$(basename $(dirname "$VIRTUAL_ENV") )"
fi
echo -n "$BOLD_PURPLE"
echo -n " <$venv> "
echo -n "$CLEAR"
}
function git_prompt() {
if [[ -n "$(git status 2>/dev/null)" ]]; then
local GIT_PROMPT="%F{255}($(git_prompt_info)%B%F{255}|%f%b$(git_prompt_status)$(git_remote_status)%F{255})%f"
echo "$GIT_PROMPT"
else
echo ""
fi
}
function check_last_exit_code() {
local LAST_EXIT_CODE=$?
if [[ $LAST_EXIT_CODE -ne 0 ]]; then
local EXIT_CODE_PROMPT
EXIT_CODE_PROMPT+="%B%F{88}-$LAST_EXIT_CODE-%f%b"
echo "$EXIT_CODE_PROMPT"
fi
}
function return_code_RPS1() {
# For right-side prompt
local return_code="%(?..$(check_last_exit_code))" # for RPS1
echo "$return_code"
}
function ret_status() {
local ret_status="%(?:%B%F{28} →%f%b:%{$fg[red]%}x%{$reset_color%})"
echo "$ret_status"
}
_PROMPT_PROTO='$(virtualenv_info)$(user_prompt)$(path_prompt)$(git_prompt)$(job_prompt)$(shlvl_prompt)'
function prompt_too_long(){
local zero='%([BSUbfksu]|([FK]|){*})'
local stripped="$(echo ${(S%%)_PROMPT_PROTO//$~zero/} | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" ) "
local prompt_len=${#stripped}
local max_len=$(($COLUMNS/2))
if [[ $prompt_len -ge $max_len ]]; then
echo true
fi
}
PROMPT="$(echo "$_PROMPT_PROTO")"
NEWLINE=$'\n'
PROMPT+='${$(prompt_too_long)/true/${NEWLINE}}'
PROMPT+='$(ret_status) '
# Right prompt is just return code and time
RPS1='$(return_code_RPS1) %F{255}[%*]%f'

View File

@ -1,21 +1,92 @@
# Check for update, set DISABLE_UPDATE_PROMPT=yes to disable the prompt and automatically update
env DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT DOTFILES="$DOTFILES" zsh -f "$DOTFILES/check_for_update.sh"
# vim:ft=zsh ts=2 sw=2 sts=2
export LANG=en_US.UTF-8
# theme-related variables
export ZSH_CUSTOM="$DOTFILES"
export ZSH_THEME="brethil"
export DISABLE_UNTRACKED_FILES_DIRTY=true
export VIRTUAL_ENV_DISABLE_PROMPT=true
# Source all other plugins
source <(antibody init)
export ZSH="$(antibody path robbyrussell/oh-my-zsh)"
antibody bundle < "$DOTFILES/antibody_plugins.txt"
export PATH=$PATH:$HOME/bin
uname="$(uname -a)"
if [[ $uname == *"ARCH"* || $uname == *"MANJARO"* ]]; then
antibody bundle < "$DOTFILES/antibody_plugins_arch.txt"
( # main branch migration
set -euo pipefail
cd $DOTFILES
if [[ $(git branch --show-current) == "master" ]]; then
echo "Migrating to main branch..."
git fetch
git stash
git switch main
git stash pop
git branch -D master
echo "Migration done!"
fi
)
if [[ ! -d $DOTFILES/antidote ]]; then
git clone https://github.com/mattmc3/antidote.git ${DOTFILES}/antidote
fi
if [[ -d "$HOME/.cache/antibody" ]]; then
# antibody migration cleanup
rm -rf $HOME/.cache/antibody
fi
export ZSH_CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/oh-my-zsh"
[[ -d $ZSH_CACHE_DIR ]] || mkdir -p $ZSH_CACHE_DIR/completions
# Lazy-load antidote from its functions directory.
fpath=($DOTFILES/antidote/functions/ $fpath)
autoload -Uz antidote
autoload -Uz compinit && compinit
autoload -Uz bashcompinit && bashcompinit
# Lazy-load antidote and generate the static load file only when needed # TODO: look into deferred loading with zsh-defer
zsh_plugins="$DOTFILES/zsh_plugins"
if [[ ! ${zsh_plugins}.zsh -nt ${zsh_plugins}.txt ]]; then
(
source $DOTFILES/antidote/antidote.zsh
echo "ZSH=$(antidote path ohmyzsh/ohmyzsh)" >${zsh_plugins}.zsh
antidote bundle <${zsh_plugins}.txt >>${zsh_plugins}.zsh
if (( $+commands[systemctl] )); then
antidote bundle robbyrussell/oh-my-zsh path:plugins/systemd >>${zsh_plugins}.zsh
fi
if (( $+commands[pacman] )); then
antidote bundle robbyrussell/oh-my-zsh path:plugins/archlinux >>${zsh_plugins}.zsh
elif (( $+commands[apt-get] )); then
antidote bundle robbyrussell/oh-my-zsh path:plugins/debian >>${zsh_plugins}.zsh
fi
)
fi
source ${zsh_plugins}.zsh
source "$DOTFILES/themes/brethil.zsh-theme"
# Setup completion style
source $DOTFILES/extras/completion_style.zsh
source $DOTFILES/extras/colors.zsh
source $DOTFILES/extras/fzf-tab-config.zsh
if (( $+commands[fd] )); then
export FZF_CTRL_T_COMMAND='fd'
else
export FZF_CTRL_T_COMMAND='find'
fi
export FZF_CTRL_T_OPTS=" --preview-window=right,60% --preview \"bash -c 'if [[ -d \"{}\" ]]; then tree -C \"{}\"; else bat --style=plain --color=always \"{}\"; fi'\" --bind 'ctrl-/:change-preview-window(right,70%|down,40%,border-horizontal|hidden|right)'"
if [[ $(fzf --version | cut -d. -f 2) -ge 52 ]]; then
# only available for fzf 0.52.0+ https://github.com/junegunn/fzf/releases/tag/0.52.0
export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS --highlight-line"
fi
ZSH_HIGHLIGHT_STYLES[comment]='fg=white,bg=gray,bold'
# Enable zsh autocorrection
setopt CORRECT_ALL
@ -30,52 +101,104 @@ setopt INC_APPEND_HISTORY
# Execute commands without verifying after prompt substitution (!!, !$, etc)
setopt NO_HIST_VERIFY
# Silence completion beeps
unsetopt LIST_BEEP
## Misc environment variables
# https://www.xkcd.com/378/
export EDITOR="vim" # if antibody_plugins.txt includes robbyrussell/oh-my-zsh path:plugins/vi-mode, this also sets `bindkey -v`
export EDITOR="vim" # if antibody_plugins.txt includes robbyrussell/oh-my-zsh path:plugins/vi-mode, this also sets `bindkey -v` # FIXME
export VI_MODE_RESET_PROMPT_ON_MODE_CHANGE=true # refresh prompt on every mode change
# Fix delete (delete! not backspace) key
bindkey -a '^[[3~' delete-char
export KEYTIMEOUT=1 # reduce the transition time between vim modes to 0.1s
export KEYTIMEOUT=50 # reduce the transition time between vim modes to 0.1s
# bindkey -M vicmd 'V' edit-command-line # this remaps `vv` to `V` (but overrides `visual-mode`) # add this if the keytimeout is too slow
export HISTSIZE=100000
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
if ! grep -q "set editing-mode vi" $HOME/.inputrc &> /dev/null; then
echo "set editing-mode vi" >> ~/.inputrc && echo "Warning: set up editing-mode ~/.inputrc"
fi
export HISTSIZE=10000000
export SAVEHIST=10000000
# zsh-autosuggestions config
export ZSH_AUTOSUGGEST_STRATEGY=(history completion)
export ZSH_AUTOSUGGEST_COMPLETION_IGNORE='* \#*' # prevent completion for comments
# less options
export LESS='-xRF-j12' # -j12: displays 12 lines before search results with / and ?
if [[ "$(command -v bat)" ]]; then
alias cat=bat
export LESS='-xRF-j12' # -j12: displays 12 lines before search results with / and ?
if (( $+commands[bat] || $+commands[batcat] )); then
export BAT_STYLE='grid,numbers,changes,snip'
if (( $+commands[bat] )); then cmd=bat else cmd=batcat fi
alias cat=$cmd
export PAGER=$cmd
export BAT_PAGER="less $LESS"
export PAGER=bat
if [[ -n $THEME_PREFER_LIGHT ]]; then
export BAT_THEME="gruvbox-light"
else
export BAT_THEME="gruvbox-dark"
fi
## this breaks symlink testing with [ -h ], best not to activate it
# alias -g -- -h='-h 2>&1 | bat --language=help --style=plain'
alias bathelp="$cmd --language=help --style=plain"
alias -g -- --help='--help 2>&1 | bathelp '
fi
if [[ $SSH_CLIENT ]]; then
export SSH_AUTH_SOCK=$HOME/.ssh/ssh_auth_sock
fi
# pip completions
if which pip &>/dev/null ; then
eval "$(pip completion --zsh)"
fi
# Automatically enable/disable virtualenv on chdir/step
export DOTFILES_AUTOSWITCH_VIRTUALENV=1
alias esource='$EDITOR $HOME/.zshrc'
alias resource='source $HOME/.zshrc'
alias dotedit='$EDITOR $DOTFILES/brethil_dotfile.sh'
# Custom definitions files
alias funedit='$EDITOR ~/.dotfiles_functions.sh'
alias aledit='$EDITOR ~/.dotfiles_aliases.sh'
alias funedit='$EDITOR ~/.dotfiles_functions'
alias aledit='$EDITOR ~/.dotfiles_aliases'
export p="${HOME}/projects"
export g="${HOME}/git"
for defname in aliases functions ; do
for def in $DOTFILES/$defname/*zsh ; do
source $def
done
done
unset def defname
# Extras
functions_file=$DOTFILES/functions.sh # Function definitions
aliases_file=$DOTFILES/aliases.sh # Aliases definitions
colors_file=$DOTFILES/colors.sh # Colors definitions
functions_file=~/.dotfiles_functions
aliases_file=~/.dotfiles_aliases
ssh_file=~/.ssh_aliases
( # migration of old format
if [[ -f ${functions_file}.sh ]]; then
echo "Migrating ${functions_file}.sh to ${functions_file}"
mv ${functions_file}{.sh,}
fi
if [[ -f ${aliases_file}.sh ]]; then
echo "Migrating ${aliases_file}.sh to ${aliases_file}"
mv ${aliases_file}{.sh,}
fi
)
# Source extras
if [ -f "$functions_file" ]; then source "$functions_file"; else echo "[brethil-dotfiles] Couldn't load functions: $functions_file"; fi
if [ -f "$aliases_file" ]; then source "$aliases_file"; else echo "[brethil-dotfiles] Couldn't load aliases: $aliases_file"; fi
if [ -f "$colors_file" ]; then source "$colors_file"; else echo "[brethil-dotfiles] Couldn't load colors: $colors_file";fi
test -f "${functions_file}" && source "${functions_file}"
test -f "${aliases_file}" && source "${aliases_file}"
test -f "${ssh_file}" && source "${ssh_file}"
### SETUP PATHS ####
export PATH=$PATH:$HOME/bin
# autoload -U compinit && compinit
# autoload -U bashcompinit && bashcompinit
# Set DISABLE_DOTFILES_AUTOUPDATE=true to disable updates
source "${DOTFILES}/extras/check_for_update.zsh"

View File

@ -1,78 +0,0 @@
#!/usr/bin/env zsh
#
# brethil, brutally copied from https://github.com/robbyrussell/oh-my-zsh/blob/master/tools/check_for_upgrade.sh
# This also tries to update amix's vimrc and runs "antigen update"
# 14 July 2017
zmodload zsh/datetime
function _current_epoch() {
echo $(( $EPOCHSECONDS / 60 / 60 / 24 ))
}
function _update_dotfiles_update() {
echo "LAST_EPOCH=$(_current_epoch)" >! ~/.dotfiles-update
}
function _upgrade_dotfiles() {
(cd $DOTFILES; git pull -q --rebase && echo "Succesfully upgraded dotfiles" || echo "Could not upgrade dotfiles.")
# amix's vimrc update
amix_vimrc=$HOME/.vim_runtime
if [[ -d $amix_vimrc ]]; then
# the update_plugins.py script makes the vim_runtime dir dirty, so we have to reset --hard
(cd $amix_vimrc && git reset --hard HEAD >/dev/null && git pull -q --rebase && echo "Upgraded amix's vimrc" || echo "Could not upgrade amix's vimrc" >&2)
(python $amix_vimrc/update_plugins.py >/dev/null || echo "upgraded amix's vimrc's plugins || "echo "Could not upgrade amix's vimrc's plugins" >&2)
else
echo "Could not upgrade amix's vimrc and plugins (missing .vim_runtime folder)" >&2
fi
antibody update
# update the zsh file
_update_dotfiles_update
}
epoch_target=$UPDATE_ZSH_DAYS
if [[ -z "$epoch_target" ]]; then
# Default to old behavior
epoch_target=13
fi
# Cancel upgrade if the current user doesn't have write permissions for the
# dotfiles directory.
[[ -w "$DOTFILES" ]] || return 0
# Cancel upgrade if git is unavailable on the system
whence git >/dev/null || return 0
# Clean up old lock files
find $DOTFILES/update.lock -mmin 60 -exec rm {} \; &>/dev/null
if mkdir "$DOTFILES/update.lock" 2>/dev/null; then
if [ -f ~/.dotfiles-update ]; then
. ~/.dotfiles-update
if [[ -z "$LAST_EPOCH" ]]; then
_update_dotfiles_update && return 0;
fi
epoch_diff=$(($(_current_epoch) - $LAST_EPOCH))
if [ $epoch_diff -gt $epoch_target ]; then
if [ "$DISABLE_UPDATE_PROMPT" = "true" ]; then
_upgrade_dotfiles
else
echo "[brethil dotfiles] Would you like to check for updates? [Y/n]: \c"
read line
if [[ "$line" == Y* ]] || [[ "$line" == y* ]] || [ -z "$line" ]; then
_upgrade_dotfiles
else
_update_dotfiles_update
fi
fi
fi
else
# create the dotfiles file
_update_dotfiles_update
fi
rmdir $DOTFILES/update.lock
fi

18
dev/Dockerfile.archlinux Normal file
View File

@ -0,0 +1,18 @@
FROM archlinux:latest
ENV TERM=xterm-256color
RUN --mount=type=cache,target=/var/cache/pacman \
pacman --noconfirm -Syu && pacman --noconfirm -Sy \
python \
openssh
# uncomment to hardcode ssh_host keys in the image
# RUN ssh-keygen -A
WORKDIR /root/.dotfiles
COPY . .
RUN cat dev/id_ed25519.pub >> /root/.ssh/authorized_keys
CMD ["bash", "dev/entrypoint.sh"]

20
dev/Dockerfile.debian Normal file
View File

@ -0,0 +1,20 @@
FROM debian:unstable
ENV TERM=xterm-256color
RUN --mount=type=cache,target=/var/cache/apt \
apt-get update && apt-get install -y --no-install-recommends \
openssh-server \
python python3 \
&& rm -rf /etc/ssh/ssh_host_*
# ssh host keys are generated by entrypoint, remove rm /etc/ssh/ssh_host*
# to hardcode ssh host keys into the image
RUN mkdir /run/sshd
WORKDIR /root/.dotfiles
COPY . .
RUN cat dev/id_ed25519.pub >> /root/.ssh/authorized_keys
CMD ["bash", "dev/entrypoint.sh"]

68
dev/Makefile Normal file
View File

@ -0,0 +1,68 @@
SHELL=/bin/bash
ifndef VERBOSE
.SILENT:
endif
CLEAR="\033[0m"
BOLD="\033[1m"
GREEN="\033[32m"
RED="\033[31m"
BLUE="\033[34m"
WHITE="\033[37m"
.PHONY: clean list_targets build build-arch build-debian arch archlinux debian run ansible release
all: list_targets
list_targets:
echo "List of targets:"
@grep '^[^#[:space:]].*:' Makefile
debian: clean build-debian run
arch archlinux: clean build-arch run
build: build-arch
build-debian: Dockerfile.debian
docker build -t brethil/dotfiles:dev -f Dockerfile.debian ..
build-arch: Dockerfile.archlinux
docker build -t brethil/dotfiles:dev -f Dockerfile.archlinux ..
run: _run
echo -e ${GREEN} "***" ${CLEAR} Watching logs from the container. Hit Ctrl+C to stop watching.
docker logs -f dotfiles-dev
_run: clean build
# docker run -d --rm --name=dotfiles-dev -v ${PWD}/..:/root/.dotfiles:ro brethil/dotfiles:dev
docker run -d --rm --name=dotfiles-dev brethil/dotfiles:dev
echo -en ${GREEN} "***" ${CLEAR} Started container, listening on
echo -e ${BOLD}${WHITE} `docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dotfiles-dev`:22 ${CLEAR}
echo -e ${BLUE} "***" ${CLEAR} Run \`make clean\` to stop and remove the container, \`make run\` to check the logs.
ansible: SHELL:=/bin/bash
ansible: ../playbook.yml _run
@ip_address=$$(docker inspect dotfiles-dev --format '{{.NetworkSettings.IPAddress}}'); \
if [[ -z "$$ip_address" ]]; then \
echo "ip address is not defined, is your container running?" >&2; \
exit 1; \
else \
sed -i "s/172.18.0.2/$$ip_address/" ansible-hosts; \
ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i ansible-hosts ../playbook.yml; \
fi
release: build-arch ansible
docker commit -m "install and initialize dotfiles (ansible)" dotfiles-dev brethil/dotfiles:latest
docker tag brethil/dotfiles:latest brethil/dotfiles:`git rev-parse --short HEAD &2>/dev/null`
echo -e ${GREEN} "***" ${CLEAR} committed and tagged the \"dockerfiles-dev\" to brethil/dotfiles:latest and :`git rev-parse HEAD --short`
if ! git diff --quiet --exit-code; then \
docker tag brethil/dotfiles:latest brethil/dotfiles:dev && \
echo -e ${GREEN} "***" ${CLEAR} committed and tagged the \"dockerfiles-dev\" to brethil/dotfiles:dev; \
fi
clean:
echo -e ${GREEN} "***" ${CLEAR} Stopping and removing \"dockerfiles-dev\" container...
docker kill dotfiles-dev &>/dev/null &>/dev/null && echo -e ${GREEN} "***" ${CLEAR} Killed container: dotfiles-dev || echo -e ${BLUE} "***" ${CLEAR} no containers to stop
docker stop dotfiles-dev &>/dev/null && echo -e ${GREEN} "***" ${CLEAR} Removed container: dotfiles-dev || echo -e ${BLUE} "***" ${CLEAR} no containers to remove

57
dev/README.md Normal file
View File

@ -0,0 +1,57 @@
# dev
This directory contains some useful dockerfiles/makefiles that can be used
to test the deployment ansible playbooks.
```bash
make arch # this builds a docker image based on archlinux and runs it
make debian # this builds a docker image based on debian and runs it
```
## Workflow
Start a builder in one shell:
```bash
while true; do make _run; done
```
Check for the docker IP of the started container:
```bash
docker inspect dotfiles-dev --format '{{.NetworkSettings.IPAddress}}'
```
Make sure that this matches the IP in [ansible-hosts](/dev/ansible-hosts)
Test the playbook:
```bash
ansible-playbook -v -i ansible-hosts ../playbook.yml
```
## Docker images
- Build: `make build-arch` or `make build-debian` to build the image.
- Run: `make run` to run the docker container. This bind-mounts `../` to
`/root/.dotfiles`, making it possible to test the repo in the container.
## Docker + Ansible
Run `dotfiles-dev` image using `make run`. This starts the container with
the local repository bind-mounted on `/root/.dotfiles`. To use a custom volume:
```bash
docker run -v <volume>:/root/dofiles`
```
Ansible can now be used to test the installation.
```bash
make ansible
```
## Releasing
Use `make release` to build an image from scratch, run it, install dotfiles
in the container using ansible, then commit the resulting container.

View File

@ -0,0 +1,2 @@
#!/bin/bash
ansible-galaxy collection install community.general # for git_config

2
dev/ansible-hosts Normal file
View File

@ -0,0 +1,2 @@
[docker]
172.18.0.2 ansible_user=root ansible_python_interpreter=python3 alias=dotfiles_dev_container

8
dev/ansible.cfg Normal file
View File

@ -0,0 +1,8 @@
[defaults]
forks = 10
strategy=free
pipelining = true
internal_poll_interval = 0.001
roles_path = ../ansible

5
dev/entrypoint.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash
if [ ! -f /etc/ssh/ssh_host_ed25519_key.pub ]; then
ssh-keygen -A
fi
/usr/sbin/sshd -D -e

1
dev/id_ed25519.pub Normal file
View File

@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILyIgoGSyuRjxvW+2SBWYJF2dMAVX+3d5h8TpKmIVpuk brethil@distruzione.org

BIN
docs/brethil-theme.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
docs/tmux.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

BIN
docs/vim.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 KiB

View File

@ -0,0 +1,10 @@
#_tmux_sourced=1 exec tmux
if [[ -z $TMUX ]] && [[ -n $SSH_TTY ]]; then
session=tmux
if tmux has-session -t "$session" 2>/dev/null; then
exec tmux attach-session -t "$session"
else
exec tmux new-session -s "$session"
fi
fi

97
extras/check_for_update.zsh Executable file
View File

@ -0,0 +1,97 @@
#!/usr/bin/env zsh
# brethil, brutally copied from https://github.com/robbyrussell/oh-my-zsh/blob/master/tools/check_for_upgrade.sh
# This also runs antibody update"
# First version: 14 July 2017
# Rebased on upstream: 08 December 2020
local DOTFILES_UPDATEFILE=${DOTFILES}/.dotfiles-update
# Migrate .dotfiles-update file to $DOTFILES
if [[ -f ~/.dotfiles-update && ! -f "${DOTFILES_UPDATEFILE}" ]]; then
mv ~/.dotfiles-update "${DOTFILES_UPDATEFILE}"
fi
# Cancel update if:
# - the automatic update is disabled.
# - git is unavailable on the system.
if [[ -n $DISABLE_DOTFILES_AUTOUPDATE ]] || ! command -v git &>/dev/null; then
return
fi
function current_epoch() {
zmodload zsh/datetime
echo $(( EPOCHSECONDS / 60 / 60 / 24 ))
}
function _update_dotfiles_update() {
echo "LAST_EPOCH=$(current_epoch)" >! "${DOTFILES_UPDATEFILE}"
}
function update_dotfiles() {
(cd $DOTFILES; git pull -q --rebase && echo "Succesfully upgraded dotfiles" || echo "Could not upgrade dotfiles.")
(cd $DOTFILES/antidote && git pull --rebase || echo "Could not upgrade antidote")
vim -c 'PlugUpdate|PlugClean|qa!'
# update the zsh file
_update_dotfiles_update
}
() {
if [[ -n $DOTFILES_FORCEUPDATE ]]; then
update_dotfiles;
return;
fi
local epoch_target mtime option LAST_EPOCH
# Remove lock directory if older than a day
zmodload zsh/datetime
zmodload -F zsh/stat b:zstat
if mtime=$(zstat +mtime "$DOTFILES/update.lock" 2>/dev/null); then
if (( (mtime + 3600 * 24) < EPOCHSECONDS )); then
command rm -f "$DOTFILES/update.lock"
fi
fi
# Check for lock directory
if ! command mkdir "$DOTFILES/update.lock" 2>/dev/null; then
return
fi
# Remove lock directory on exit. `return 1` is important for when trapping a SIGINT:
# The return status from the function is handled specially. If it is zero, the signal is
# assumed to have been handled, and execution continues normally. Otherwise, the shell
# will behave as interrupted except that the return status of the trap is retained.
trap "
unset -f current_epoch _update_dotfiles_update update_dotfiles &>/dev/null
command rmdir '$DOTFILES/update.lock' &>/dev/null
return 1
" EXIT INT QUIT
# Create or update .zsh-update file if missing or malformed
if ! source "${DOTFILES_UPDATEFILE}" 2>/dev/null || [[ -z "$LAST_EPOCH" ]]; then
_update_dotfiles_update
return
fi
# Number of days before trying to update again
epoch_target=${UPDATE_DOTFILES_DAYS:-5}
# Test if enough time has passed until the next update
if (( ( $(current_epoch) - $LAST_EPOCH ) < $epoch_target )); then
return
fi
# Ask for confirmation before updating unless disabled
if [[ "$DISABLE_UPDATE_PROMPT" = true ]]; then
update_dotfiles
else
echo -n "[brethil-dotfiles] Would you like to update? [Y/n] "
read -r -k 1 option
case "$option" in
[yY$'\n']) update_dotfiles ;;
[nN]) _update_dotfiles_update ;;
*) echo -n "[brethil dotfiles] Skipping. Update using \`dotfiles_selfupdate\`" && echo ;;
esac
fi
}
unset -f current_epoch update_dotfiles _update_dotfiles_update

View File

@ -1,3 +1,9 @@
# ansi colors are pretty simple. In 256 color mode, for a given
# (r, g, b) tuple:
# \x1b[38;2;r;g;bm - foreground
# \x1b[48;2;r;g;bm - background
# ANSI COLOR ESCAPES
# CLEAR
CLEAR='\e[0m' # CLEAR
@ -23,6 +29,9 @@ BCyan='\e[1;36m' # Cyan
BWhite='\e[1;37m' # White
# Underline
if command -v tput &>/dev/null; then
UNDERLINE="$(tput smul)"
fi
UBlack='\e[4;30m' # Black
URed='\e[4;31m' # Red
UGreen='\e[4;32m' # Green
@ -85,3 +94,34 @@ LIGHTCYAN="\e[36m"; LIGHTRED="\033[31m"; LIGHTPURPLE="\033[35m";
YELLOW="\e[33m"; WHITE="\033[37m"
BACKGROUND_BLACK="\e[40"; BACKGROUND_RED="\033[41";
BACKGROUND_GREEN="\e[42"; BACKGROUND_YELLOW="\033[43m"
## Color string with given color. Usage: `color $NAME "string"`, available colors below
function color
{
local color=$1
shift 1
echo -e "${color}$@${CLEAR}"
}
## These functions return a colored version of the input string. Usage: red "string"
function red
{
echo -e "$Red$@$CLEAR"
}
function green
{
echo -e "$Green$@$CLEAR"
}
function yellow
{
echo -e "$Yellow$@$CLEAR"
}
function blue
{
echo -e "$Blue$@$CLEAR"
}
function bold
{
echo -e "$BOLD$@$CLEAR"
}

View File

@ -0,0 +1,83 @@
# stolen from https://github.com/Phantas0s/.dotfiles/blob/master/zsh/completion.zsh
## General
# zstyle pattern for the completion
# :completion:<function>:<completer>:<command>:<argument>:<tag>
# Should be called before compinit
zmodload zsh/complist
# Use hjlk in menu selection (during completion)
# Doesn't work well with interactive mode
bindkey -M menuselect 'h' vi-backward-char
bindkey -M menuselect 'k' vi-up-line-or-history
bindkey -M menuselect 'j' vi-down-line-or-history
bindkey -M menuselect 'l' vi-forward-char
bindkey -M menuselect '^xg' clear-screen
bindkey -M menuselect '^xi' vi-insert # Insert
bindkey -M menuselect '^xh' accept-and-hold # Hold
bindkey -M menuselect '^xn' accept-and-infer-next-history # Next
bindkey -M menuselect '^xu' undo # Undo
#setopt GLOB_COMPLETE # Show autocompletion menu with globs
#setopt MENU_COMPLETE # Automatically highlight first element of completion menu
setopt AUTO_LIST # Automatically list choices on ambiguous completion.
## Zstyles
# Ztyle pattern
# :completion:<function>:<completer>:<command>:<argument>:<tag>
# Define completers
zstyle ':completion:*' completer _extensions _complete _approximate
# Use cache for commands using cache
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path "$HOME/.cache/zsh/.zcompcache"
# Complete the alias when _expand_alias is used as a function
zstyle ':completion:*' complete true
zle -C alias-expension complete-word _generic
bindkey '^A' alias-expension
zstyle ':completion:alias-expension:*' completer _expand_alias
# Allow you to select in a menu
zstyle ':completion:*' menu select
# Autocomplete options for cd instead of directory stack
zstyle ':completion:*' complete-options true
zstyle ':completion:*' file-sort modification
zstyle ':completion:*:*:*:*:corrections' format '%F{yellow}!- %d (errors: %e) -!%f'
zstyle ':completion:*:*:*:*:descriptions' format '%F{blue}-- %D %d --%f'
zstyle ':completion:*:*:*:*:messages' format ' %F{purple} -- %d --%f'
zstyle ':completion:*:*:*:*:warnings' format ' %F{red}-- no matches found --%f'
# zstyle ':completion:*:default' list-prompt '%S%M matches%s'
# Colors for files and directory
zstyle ':completion:*:*:*:*:default' list-colors ${(s.:.)LS_COLORS}
# Only display some tags for the command cd
zstyle ':completion:*:*:cd:*' tag-order local-directories directory-stack path-directories
# zstyle ':completion:*:complete:git:argument-1:' tag-order !aliases
# Required for completion to be in good groups (named after the tags)
zstyle ':completion:*' group-name ''
zstyle ':completion:*:*:-command-:*:*' group-order aliases builtins functions commands
# See ZSHCOMPWID "completion matching control"
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' keep-prefix true
zstyle -e ':completion:*:(ssh|scp|sftp|rsh|rsync):hosts' hosts 'reply=(${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) /dev/null)"}%%[# ]*}//,/ })'
# kubectl
zstyle ':completion:*:*:kubectl:*' list-grouped false
# docker
zstyle ':completion:*:*:docker:*' option-stacking yes
zstyle ':completion:*:*:docker-*:*' option-stacking yes

25
extras/fzf-tab-config.zsh Normal file
View File

@ -0,0 +1,25 @@
# disable sort when completing options of any command
zstyle ':completion:complete:*:options' sort false
# use input as query string when completing zlua
zstyle ':fzf-tab:complete:_zlua:*' query-string input
# (experimental, may change in the future)
# some boilerplate code to define the variable `extract` which will be used later
# please remember to copy them
local extract="
# trim input(what you select)
local in=\${\${\"\$(<{f})\"%\$'\0'*}#*\$'\0'}
# get ctxt for current completion(some thing before or after the current word)
local -A ctxt=(\"\${(@ps:\2:)CTXT}\")
# real path
local realpath=\${ctxt[IPREFIX]}\${ctxt[hpre]}\$in
realpath=\${(Qe)~realpath}
"
# give a preview of commandline arguments when completing `kill`
zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm,cmd -w -w"
zstyle ':fzf-tab:complete:kill:argument-rest' extra-opts --preview=$extract'ps --pid=$in[(w)1] -o cmd --no-headers -w -w' --preview-window=down:3:wrap
# give a preview of directory by exa when completing cd
zstyle ':fzf-tab:complete:cd:*' extra-opts --preview=$extract'exa -1 --color=always $realpath'

50
extras/sort_timings.zsh Executable file
View File

@ -0,0 +1,50 @@
#!/usr/bin/env zsh
# Reads output from zprof.
# Usage:
# 1. add the following to the beginning of your zshrc
# if [[ -n $profiling ]]; then
# zmodload zsh/zprof
# zmodload zsh/datetime
# setopt PROMPT_SUBST
# PS4='+$EPOCHREALTIME %N:%i> '
#
# logfile=$(mktemp zsh_profile.XXXXXXXX)
# echo "Logging to $logfile"
# exec 3>&2 2>$logfile
#
# setopt XTRACE
# fi
# 2. add this to the end of your zshrc
# if [[ -n $profiling ]]; then
# unsetopt XTRACE
# exec 2>&3 3>&-
# zprof
# fi
# 3. zsh -i -c exit
# 4. sort_timings.zsh zsh_profile.* # or use the newly-created file
typeset -a lines
typeset -i prev_time=0
typeset prev_command
while read line; do
if [[ $line =~ '^.*\+([0-9]{10})\.([0-9]{6})[0-9]* (.+)' ]]; then
integer this_time=$match[1]$match[2]
if [[ $prev_time -gt 0 ]]; then
time_difference=$(( $this_time - $prev_time ))
lines+="$time_difference $prev_command"
fi
prev_time=$this_time
local this_command=$match[3]
if [[ ${#this_command} -le 80 ]]; then
prev_command=$this_command
else
prev_command="${this_command}..."
fi
fi
done < ${1:-/dev/stdin}
print -l ${(@On)lines} # | sort -h | vim -

4
extras/sshrc Normal file
View File

@ -0,0 +1,4 @@
#!/bin/bash
if test "$SSH_AUTH_SOCK" ; then
ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock
fi

15
extras/zprofile Normal file
View File

@ -0,0 +1,15 @@
# Make sure SSH_AUTH_sock is symlinked
if test "$SSH_AUTH_SOCK" ; then
ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock
fi
#_tmux_sourced=1 exec tmux
if [[ -z $TMUX ]] && [[ -n $SSH_TTY ]]; then
session=tmux
if tmux has-session -t "$session" 2>/dev/null; then
exec tmux attach-session -t "$session"
else
exec tmux new-session -s "$session"
fi
fi

View File

@ -0,0 +1,18 @@
# Make sure SSH_AUTH_sock is symlinked
if test "$SSH_AUTH_SOCK" ; then
ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock
fi
#_tmux_sourced=1 exec tmux
if [[ -z $TMUX ]] && [[ -n $SSH_TTY ]]; then
set -x
session=tmux
if tmux has-session -t "$session" 2>/dev/null; then
exec tmux attach-session -t "$session"
else
tmux new-session -s "$session"
exec tmux attach-session -t "$session"
fi
fi

View File

@ -1,279 +0,0 @@
###########################
#### Function Definitions #
###########################
## Selfupdate
function dotfiles_selfupdate
{
(. $DOTFILES/check_for_update.sh && _upgrade_dotfiles)
}
## get cheat sheets for commands from cheat.sh. Usage: cheat commandname
function cheat
{
curl "https://cheat.sh/$1"
}
# get cheat sheets for commands matching $1
function cheatall
{
curl "https://cheat.sh/~$1"
}
# List all docker tags for an image
function dockertags
{
if [[ -z $(command -v jq) ]]; then
echo "jq not installed. Please install jq." 1>&2
return
fi
i=0
while [[ $? == 0 ]]; do
i=$(($i+1))
curl "https://registry.hub.docker.com/v2/repositories/library/$1/tags/?page=$i" 2>/dev/null | jq '."results"[]["name"]'
done
}
# watch with grc enabled
function watchgrc
{
watch -n 1 -c grc --colour=on "$@"
}
## Simple calculator. Usage: calc 1+1, calc 5/7, calc "sqrt(2)"
function calc
{
awk "BEGIN { print $* }"
}
## Make new directory and cd to that directory. Usage: mcd newfolder
function mcd
{
mkdir -p "$1"
cd $1
}
## Print full path of item in current directory
function ppath
{
echo "$PWD/$1"
}
## Color string with given color. Usage: color $colorname "string", available colors in colors.sh
function color
{
color=$1
set -x
shift 1
echo -e "$"$color"$@${CLEAR}\n"
set +x
}
## These functions return a colored version of the input string. Usage: red "string"
function red
{
echo -e "$Red$@$CLEAR"
}
function green
{
echo -e "$Green$@$CLEAR"
}
function blue
{
echo -e "$Blue$@$CLEAR"
}
## Flashes the screen until user presses a key
function flasher
{
while true; do printf "\e[?5h\007"; sleep 0.25; printf "\e[?5l"; read -s -n -t1 && break; done;
}
## Beep until user presses a key
function beeper
{
while true; do printf "\e[?5h\007"; sleep 0.25; printf "\e[?5l"; read -s -n -t1 && break; done;
}
## Simple http server for current directory (or path)
function httpserver
{
(
if [[ -d $1 ]]; then
cd "$1" && echo "Starting webserver in $(realpath $1)/" || echo "directory: $1 does not exist" >&2 || exit 1
else
echo "Starting webserver in $PWD/"
fi
open "http://localhost:8000" &>/dev/null &
if [[ "$(command -v python3)" ]]; then
python=python3
else
python=python
fi
$python -m http.server 8000
)
}
alias webserver='httpserver'
## Upload something using the transfer.sh service. Usage: transfer filename
function transfer
{
basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g')
out=$(curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile")
echo -e "Done, file at:\t$out"
if [[ $(uname) == "Darwin" ]]; then
echo "$out" | pbcopy
else
echo "$out"
fi
}
## If connecting through ssh and reverse forwarding port 2222 (ssh -R 2222:localhost:22 ), this function allows to copy the files back to the machine one is connecting from by typing 'mecp filename' (configure the username for "localhost" in ~/.ssh/config or add an username)
function mecp
{
rsync -r -P -e "ssh -p 2222" -R "$@" localhost:~/Desktop/
}
## generate a password using pwgen, generate_password 20 generates a 20 characters long password
function generate_password
{
pwgen -1sycn $1
}
## Generate a password from dev urandom using only printable characters
function genpwd
{
if [[ $1 ]]; then
strlen=$1
else
strlen=32
fi
# All characters excluding backlash
env LC_CTYPE=C tr -dc '[:graph]\' < /dev/urandom | fold -w $strlen | head -n 1
}
if [[ "$(uname)" == "Darwin" ]]; then
## Copy output of previous command to termbin.com (command line pastebin) and put in in clipboard
function termbin
{
nc termbin.com 9999 | pbcopy && echo -n "$(pbpaste) --> in clipboard"
}
else
## Copy output of previous command to termbin.com (command line pastebin)
function termbin
{
nc termbin.com 9999
}
fi
## List defined functions in $DOTFILES/functions.sh
function list_functions
{
grep --color=no -A 1 '^##' $DOTFILES/functions.sh | sed -E 's/function (.*)/\1/g'
}
###########################
## MAC SPECIFIC #
###########################
if [[ "$(uname)" == "Darwin" ]]; then
## Create a RAM disk. Default size 1GB. If supplied, first argument defines the RAM disk size in GB
function ramdisk
{
if [[ -e $1 ]]; then
sizeingb=$1
else
sizeingb=1
fi
# Numsectors is size in bytes / 512 (sector size in bytes)
name='RAM_disk'
sizeinbytes=$(($sizeingb*1000**3))
NUMSECTORS=$(($sizeinbytes/512))
mydev=$(hdiutil attach -nomount ram://$NUMSECTORS )
# strip whitespace (hdiutil outputs a lot of spaces/tabs along with the device name)
mydev=$(echo "$mydev"| xargs echo)
newfs_hfs "$mydev"
mkdir -p "/tmp/$name"
mount -t hfs "$mydev" "/tmp/$name"
echo "RAM Disk mounted: /tmp/$name"
echo "To eject (destroy) RAM disk, use:"
echo " $ diskutil eject $mydev"
}
## Open a pdf version of the man in Preview
function man2pdf
{
man -t "$1" | open -f -a Preview
}
## Open Man in separate (different-looking) window
function nman
{
if [ $# -eq 1 ] ; then
open "x-man-page://$1"
elif [ $# -eq 2 ] ; then
open "x-man-page://$1/$2"
fi
}
fi
### end of mac-specific functions
pipupdate(){
set -x
if [[ "$1" == "user" ]]; then
user_flags='--user'
shift
fi
if [[ -n "$@" ]]; then
pip="$1"
shift
flags="$*"
echo "pip command is: '$pip $flags'"
if ! command -v "$pip" ; then
echo "Given command ($1) does not exist." 1>&2
return
fi
else
pip='python'
flags='-m pip'
echo "Using default pip: $pip $flags"
fi
for package in $($pip $flags freeze $user_flags --local | grep -v '^\-e' | cut -d = -f 1) ; do
$pip $flags install "$user_flags" -U "$package"
done
set +x
}
# unzip file to directory with the same name of the zip file (without extension)
function unzipd {
zip_file="$1"
filename=$(basename -- "$zip_file")
extension="${filename##*.}"
name="${filename%.*}"
unzip -d "$name" "$zip_file"
}
# remove local branches which have been merged into master
function git_prune_branches(){
git branch --merged master | grep -v '^[ * ]*master$' | xargs git branch -d
}
fvim() {
if [[ -n "$@" ]]; then
vim `fzf -q $@`
else
vim `fzf`
fi
}
# dotfiles user functions
if [[ -f $HOME/.dotfiles_functions ]]; then
source "$HOME/.dotfiles_functions"
fi

4
functions/README.md Normal file
View File

@ -0,0 +1,4 @@
# functions
Place custom functions definitions in this folder, with a `.zsh` extension.
These files will be sourced on startup

43
functions/asciinema.zsh Normal file
View File

@ -0,0 +1,43 @@
function switch-asciinema-user
{
local conf_dir="$HOME/.config/asciinema"
local current_id=$(basename $(readlink -f ${conf_dir}/install-id ))
function get_ids {
find ${conf_dir} -name 'install-id-*' -exec basename {} \;
}
if [[ $1 == "-l" || $1 == "--list" ]]; then
echo "$(color $BOLD Available ids): (current = $(color $UNDERLINE ${current_id}))"
for _id in $(get_ids); do
echo " $(green ➡️) ${_id}"
done
return
fi
local ids=$(get_ids)
local query
local new_id
if [[ -n "$@" ]]; then
query="-q $@"
fi
new_id=$(echo $ids| fzf --height=$(($(wc -l <<< $ids)+2)) ${query} )
if [[ -z $new_id ]]; then
yellow "Keeping curent id ($(color $UNDERLINE ${current_id}))"
return
fi
if [[ "$new_id" == "$current_id" ]]; then
yellow "id $new_id is already set."
return
fi
local id_file="${conf_dir}/${new_id}"
if [[ ! -f ${id_file} ]]; then
red "${id_file} does not exist"
return
fi
ln -sf "${id_file}" "${conf_dir}/install-id" && \
green "Set \"$new_id\"." || \
red "Could not set id \"$new_id\". (run with -l for a list of available profiles)"
}

125
functions/git.zsh Normal file
View File

@ -0,0 +1,125 @@
# vim:ft=zsh ts=2 sw=2 sts=2
#
# Miscellaneous git helpers
# Create a gitignore for the given argument (e.g. python, cpp, etc)
function gi() { curl -sL https://www.toptal.com/developers/gitignore/api/$@; }
# Completion helper, from requires __completion_wrapper from `misc.zsh`
__git_completion_wrapper() {
# Wrapper for `__git_*` completion functions
# Can be used to force loading of specialized git completions
# When defining custom commands. See below for usage examples.
__completion_wrapper $1 _git
}
# remove local branches which have been merged into master/main
function git-prune-branches(){
local main=$(git_main_branch)
git branch --merged $main | grep -v '^[ * ]*'$main'$' | xargs git branch -d
}
# sort branches by latest commit
function git-sort-branch-by-usage(){
git for-each-ref --sort=committerdate refs/heads/ --format='%(refname:short)'
}
# switch to a recent branch
function git-switch-recent-branch(){
git switch $1
}
compdef "__git_completion_wrapper __git_recent_branches" git-switch-recent-branch
function git-commit-show() {
git log --graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr" $@ |
fzf --ansi --no-sort --reverse --tiebreak=index --preview \
'f() {
set -- $(echo -- "$@" | grep -o "[a-f0-9]\{7\}")
[ $# -eq 0 ] || git show --color=always $1
}
f {}' \
--bind "j:down,k:up,alt-j:preview-down,alt-k:preview-up,ctrl-f:preview-page-down,ctrl-b:preview-page-up,q:abort,ctrl-m:execute:
(grep -o '[a-f0-9]\{7\}' | head -1 |
xargs -I % sh -c 'git show --color=always % | less -R') << 'FZF-EOF'
{} FZF-EOF" \
--preview-window=right:60%
}
compdef "__git_completion_wrapper __git_recent_commits" git-commit-show
function git-fixup() {
git commit --fixup=$1
git -c sequence.editor=true rebase --interactive --autosquash $1^
}
compdef "__git_completion_wrapper __git_recent_commits" git-fixup
function git-diff-branch() {
git diff $@
}
compdef "__git_completion_wrapper __git_branch_names" git-diff-branch
function git-show-changes(){
git log --reverse HEAD^..
}
# oh-my-zsh has some aliases which we might want to override
# with functions
function _disable_alias() {
[[ -n $(alias "$1") ]] && unalias "$1"
}
_disable_alias gco
function gco() {
if [[ "$#" -ge 1 ]]; then
g checkout $@
elif [[ "$#" -eq 0 ]]; then
local selected
selected=$(git branch --format "%(refname)" | cut -d / -f 3- | fzf)
if [[ -n $selected ]]; then
git checkout "$selected"
else
echo "Nothing selected"
fi
fi
}
compdef "__git_completion_wrapper _git-checkout" gco
_disable_alias gcor
function gcor() {
if [[ "$#" -ge 1 ]]; then
git checkout $@
elif [[ "$#" -eq 0 ]]; then
git checkout --track $(gbr | fzf)
fi
}
_disable_alias gbd
function gbd() {
if [[ "$#" -ge 1 ]]; then
g branch -d $@
elif [[ "$#" -eq 0 ]]; then
g branch -d $(gb | fzf -m)
fi
}
compdef "__git_completion_wrapper __git_recent_branches" gbd
_disable_alias gbD
function gbD() {
if [[ "$#" -ge 1 ]]; then
git branch -D $@
elif [[ "$#" -eq 0 ]]; then
git branch -D $(git branch | fzf -m)
fi
}
compdef "__git_completion_wrapper __git_recent_branches" gbD

19
functions/man.zsh Normal file
View File

@ -0,0 +1,19 @@
function fuzzyman() {
local preview_cmd
preview_cmd='command man {+1} 2>/dev/null | bat --style=plain --language=man --color=always'
apropos_args=$@
if [[ -z $apropos_args ]]; then
apropos_args="."
fi
man $(command man -k "${apropos_args}" \
| fzf \
--preview="${preview_cmd}" \
--preview-window=right,60% \
| awk '{print $1}'
)
}
compdef _man fuzzyman=man

349
functions/misc.zsh Executable file
View File

@ -0,0 +1,349 @@
###########################
#### Function Definitions #
###########################
## Selfupdate
function dotfiles_selfupdate
{
(DOTFILES_FORCEUPDATE=1 source $DOTFILES/extras/check_for_update.zsh || echo "[dotfiles_selfupdate] failed")
}
## get cheat sheets for commands from cheat.sh. Usage: cheat commandname
function cheat
{
curl "https://cheat.sh/$1"
}
# get cheat sheets for commands matching $1
function cheatall
{
curl "https://cheat.sh/~$1"
}
# List all docker tags for an image
function dockertags
{
if [[ -z $(command -v jq) ]]; then
echo "jq not installed. Please install jq." 1>&2
return
fi
i=0
while [[ $? == 0 ]]; do
i=$(($i+1))
curl "https://registry.hub.docker.com/v2/repositories/library/$1/tags/?page=$i" 2>/dev/null | jq '."results"[]["name"]'
done
}
# watch with grc enabled
function watchgrc
{
watch -n 1 -c grc --colour=on "$@"
}
## Simple calculator. Usage: calc 1+1, calc 5/7, calc "sqrt(2)"
function calc
{
awk "BEGIN { print $* }"
}
function warning {
echo -e "${Yellow}Warning:$CLEAR $@" >&2
}
function error {
echo -e "${Red}Error:$CLEAR $@" >&2
}
function info {
echo -e "${Green}Info:$CLEAR $@"
}
## Flashes the screen until user presses a key
function flasher
{
while true; do printf "\e[?5h\007"; sleep 0.25; printf "\e[?5l"; read -s -n -t1 && break; done;
}
## Beep until user presses a key
function beeper
{
while true; do printf "\e[?5h\007"; sleep 0.25; printf "\e[?5l"; read -s -n -t1 && break; done;
}
# set an alarm in seconds, minutes, hours
function alarm {
if [[ -z $1 ]]; then
echo "Usage: alarm 5[s]|5m|1h"
return 1
fi
local t
if [[ $1 = *"m" ]]; then
t=$((${1/m/}*60))
extra="($1)"
elif [[ $1 = *"h" ]]; then
t=$((${1/h/}*3600))
extra="($1)"
elif [[ $1 = *"s" ]]; then
t=${1/s/}
else
t=$1
fi
echo "Setting a timer for $1 $extra"
sleep $t && beeper
}
## Simple http server for current directory (or path)
function httpserver
{
(
if [[ -d $1 ]]; then
cd "$1" && echo "Starting webserver in $(realpath $1)/" || echo "directory: $1 does not exist" >&2 || exit 1
else
echo "Starting webserver in $PWD/"
fi
open "http://localhost:8000" &>/dev/null &
python -m http.server 8000
)
}
alias webserver='httpserver'
## Upload something using the 0x0.st service. Usage: upload [filename|url]
function upload
{
local url
if echo "$@" | grep -E -s -q "^http[s]://"; then
url=true
fi
if [[ $url == true ]]; then
out="$(curl -F"url=$@" https://0x0.st)"
else
out=$(curl --progress-bar -F"file=@$@" "https://0x0.st/")
fi
if [[ $? -ne 0 ]]; then
echo -e "Failed uploading $@:\n $out" >&2
return
fi
echo -e "Done, file at:\t$out"
if [[ $(uname) == "Darwin" ]]; then
clipboard="pbcopy"
elif command -v wl-copy &>/dev/null; then
clipboard="wl-copy"
elif command -v xclip &>/dev/null ; then
clipboard="xclip"
else
clipboard="cat"
fi
echo -en "$out" | $clipboard
}
## If connecting through ssh and reverse forwarding port 2222 (ssh -R 2222:localhost:22 ), this function allows to copy the files back to the machine one is connecting from by typing 'mecp filename' (configure the username for "localhost" in ~/.ssh/config or add an username)
function mecp
{
rsync -r -P -e "ssh -p 2222" -R "$@" localhost:~/Desktop/
}
## generate a password using pwgen, generate_password 20 generates a 20 characters long password
function generate_password
{
pwgen -1sycn $1
}
## Generate a password from dev urandom using only printable characters
function genpwd
{
if [[ $1 ]]; then
strlen=$1
else
strlen=32
fi
# All characters excluding backlash
env LC_CTYPE=C tr -dc '[:graph]\' < /dev/urandom | fold -w $strlen | head -n 1
}
## List defined functions in $DOTFILES/functions.sh
function list_functions
{
grep --color=no -A 1 '^##' $DOTFILES/functions/*.zsh| sed -E 's/function (.*)/\1/g'
}
# MacOS only
if [[ "$(uname)" == "Darwin" ]]; then
## Create a RAM disk. Default size 1GB. If supplied, first argument defines the RAM disk size in GB
function ramdisk
{
if [[ -e $1 ]]; then
sizeingb=$1
else
sizeingb=1
fi
# Numsectors is size in bytes / 512 (sector size in bytes)
name='RAM_disk'
sizeinbytes=$(($sizeingb*1000**3))
NUMSECTORS=$(($sizeinbytes/512))
mydev=$(hdiutil attach -nomount ram://$NUMSECTORS )
# strip whitespace (hdiutil outputs a lot of spaces/tabs along with the device name)
mydev=$(echo "$mydev"| xargs echo)
newfs_hfs "$mydev"
mkdir -p "/tmp/$name"
mount -t hfs "$mydev" "/tmp/$name"
echo "RAM Disk mounted: /tmp/$name"
echo "To eject (destroy) RAM disk, use:"
echo " $ diskutil eject $mydev"
}
fi
# unzip file to directory with the same name of the zip file (without extension)
function unzipd {
zip_file="$1"
filename=$(basename -- "$zip_file")
extension="${filename##*.}"
name="${filename%.*}"
unzip -d "$name" "$zip_file"
}
fvim() {
if [[ -n "$@" ]]; then
vim `fzf -q $@`
else
vim `fzf`
fi
}
# retry command until it succeeds (waiting one second or $RETRY_INTERVAL)
function retry() {
until $@; do sleep ${RETRY_INTERVAL:-1}; done
}
__completion_wrapper(){
# Wrapper for completion functions.
# These can be used to force loading of all completions
# for the given command in order to access specialized
# completion functions
local _completion_function=$1
local _completion_base=$2
if ! command -v $_completion_function &>/dev/null; then
$_completion_base
fi
$_completion_function
}
if command -v pacman &>/dev/null ; then
pacbins() {
pacman -Ql $1 | sed -n -e 's/.*\/bin\///p' | tail -n +2
}
_pacbins(){
# fix completion
__completion_wrapper _pacman_completions_installed_packages _pacman
}
compdef _pacbins pacbins
fi
if command -v rustc &>/dev/null
then
rexplain() {
rustc --explain $@ | bat --language=rust -
}
fi
if command -v fzf &>/dev/null ; then
falias() {
alias | fzf $@ | cut -d= -f 1
}
fi
make_backup() {
name="$1"
backup_name="backup_$1_$(date +%Y-%m-%d).tar.gz"
echo "Backing up to $backup_name"
tar -czf "$backup_name" "$1"
echo "done"
}
function find_by_mtime() {
find $@ -printf "%T+ %p\n" | sort
}
function mangrep() {
if [[ -z "$@" ]]; then
echo "Usage: $0 <pattern> <command>"
echo "Opens man page for <command> at the first match for <pattern>"
return
fi
pattern=$1
cmd=$2
if [[ -z "$cmd" ]]; then
man "$cmd"
return
fi
MANPAGER="less -p \"$pattern\"" man "$cmd"
}
# watches the given file and executes the given action whenever the file is changed. Usage: watch_file <file> <command>
function watch_file() {
if ! which inotifywait 2>&1 &>/dev/null ; then echo "$0 requires inotifywait"; return 1; fi
[[ -z "$1" ]] && echo "Usage: $0 <file> <action>" && return 1
local file=$1
shift
[[ -z "$@" ]] && echo "Usage: $0 <file> <action>" && return 1
local action="$@"
local _bg_job_pid
local TRAPINT(){
if [[ -n ${_bg_job_pid} ]]; then
kill -9 ${_bg_job_pid}
fi
yellow '\nQuitting.'
break;
}
{
set +m # disable job control messages
while true; do
zsh -c "$action" &
_bg_job_pid=$!
disown
echo -e "$Cyan ==> Running \"$action\" with pid=${_bg_job_pid}$CLEAR"
# block until the file has been written to
inotifywait -e close_write "$file" &>/dev/null
# the job might have failed, ignore errors
kill -9 ${_bg_job_pid} &>/dev/null || true
done
} always {
# remove ctrl-c trap
unset -f TRAPINT
set -m # restore job control messages
}
}
# use watch and force color with grc
function watchc() {
watch --differences --interval 1 --color grc --colour=on $@
}
# highlight functions with when calling which
function which(){
if ! (($+commands[bat])); then
builtin which $@
else
builtin which $@ | bat --language=zsh
fi
}

9
functions/pacman.zsh Normal file
View File

@ -0,0 +1,9 @@
if ! command -v pacman &>/dev/null; then return; fi
function pacpreview() {
if ! command -v fzf &>/dev/null; then
echo "Requires fzf! Quitting"
return 1
fi
pacman -Slq | fzf --multi --preview 'grc --colour=on pacman -Si {1}' | xargs -ro sudo pacman -S
}

82
functions/python.zsh Normal file
View File

@ -0,0 +1,82 @@
mkvenv(){
local source_venv force_create venv_name
while getopts "sf" opt; do
case $opt in
s|source) source_venv=y ;;
f|force) force_create=y ;;
*) echo "Unknown option: $opt"; return 1 ;;
esac
done
shift $(($OPTIND-1))
if [[ -n $1 ]]; then
venv_name=$1
shift
else
venv_name=.venv
fi
# any other arguments are passed on to the `venv` module as flags/arguments
if [[ -e ${venv_name} ]]; then
if [[ -n ${force_create} ]]; then
if [[ -n $VIRTUAL_ENV ]]; then # deactivate venv if enabled
deactivate && warning "Deactivated existing virtualenv" || red "Could not run deactivate";
fi
rm -rf ${venv_name} && warning "Deleted existing virtualenv."
else
error "$(color $BOLD .venv) already exists. Run with -f to recreate it." >&2
return 1
fi
fi
info "Creating virtualenv ${venv_name}... "
if ! python -m virtualenv $@ ${venv_name} ; then
error "Failed to create virtualenv. Is virtualenv installed? Try:\n $ pip install virtualenv"
return 1
fi
if [[ -z ${source_venv} ]]; then
echo -n " done. Enable? [Y/n] "
read source_venv
else
echo ""
fi
if [[ $source_venv != "n" ]]; then
source ${venv_name}/bin/activate && \
echo -e "$(color $BOLD Enabled!) 🐍 $(color $BOLD$PURPLE $(python --version | cut -d " " -f2 )) ($(color $BOLD$GREEN $(pip --version | cut -d " " -f -2)))"
fi
}
function enable_venv() {
local root
local activate
root=$(git rev-parse --show-toplevel 2>/dev/null)
if [[ -z $root ]]; then root=$PWD; fi
activate="$root/.venv/bin/activate"
if [[ -f "$activate" ]]; then
source "$activate"
fi
}
function disable_venv() {
if [[ -z ${VIRTUAL_ENV} ]]; then
return
fi
if [[ ! "$PWD" =~ $(dirname $VIRTUAL_ENV)}* ]]; then
echo "Deactivating venv..."
deactivate
fi
}
if [[ -n $DOTFILES_AUTOSWITCH_VIRTUALENV ]]; then
add-zsh-hook chpwd enable_venv
add-zsh-hook chpwd disable_venv
enable_venv
fi

22
functions/tracing.zsh Normal file
View File

@ -0,0 +1,22 @@
#!/bin/zsh
function start_tracing {
zmodload zsh/zprof
zmodload zsh/datetime
setopt PROMPT_SUBST
PS4+='+$EPOCHREALTIME %N:%i> '
logfile=$(mktemp --tmpdir zsh_profile.XXXXXXXX)
echo "logging to $logfile"
exec 3>&2 2>$logfile
setopt XTRACE
}
function stop_tracing {
unsetopt XTRACE
exec 2>&3 3>&-
zprof | tee zprof_out.log | vim -c "set buftype=nofile" -
zmodload -u zsh/zprof
zmodload -u zsh/datetime
}

18
functions/vim.zsh Normal file
View File

@ -0,0 +1,18 @@
# open vim with a scratch window that can be discarded on exit.
vimscratch() {
local args
# if running in a pipe, use stdin (-) as arg.
# -t checks if the given FD is a terminal
if [ ! -t 0 ] ; then
stdin_arg="-"
fi
set +x
if [[ -n "$1" ]]; then
filetype=$1
shift
vim -c "set buftype=nofile" -c "set filetype=$filetype" $@ $stdin_arg
else
vim -c "set buftype=nofile" $filetype_arg $@ $stdin_arg
fi
}

278
functions/z.zsh Normal file
View File

@ -0,0 +1,278 @@
# Copyright (c) 2009 rupa deadwyler. Licensed under the WTFPL license, Version 2
# maintains a jump-list of the directories you actually use
#
# INSTALL:
# * put something like this in your .bashrc/.zshrc:
# . /path/to/z.sh
# * cd around for a while to build up the db
# * PROFIT!!
# * optionally:
# set $_Z_CMD in .bashrc/.zshrc to change the command (default z).
# set $_Z_DATA in .bashrc/.zshrc to change the datafile (default ~/.z).
# set $_Z_MAX_SCORE lower to age entries out faster (default 9000).
# set $_Z_NO_RESOLVE_SYMLINKS to prevent symlink resolution.
# set $_Z_NO_PROMPT_COMMAND if you're handling PROMPT_COMMAND yourself.
# set $_Z_EXCLUDE_DIRS to an array of directories to exclude.
# set $_Z_OWNER to your username if you want use z while sudo with $HOME kept
#
# USE:
# * z foo # cd to most frecent dir matching foo
# * z foo bar # cd to most frecent dir matching foo and bar
# * z -r foo # cd to highest ranked dir matching foo
# * z -t foo # cd to most recently accessed dir matching foo
# * z -l foo # list matches instead of cd
# * z -e foo # echo the best match, don't cd
# * z -c foo # restrict matches to subdirs of $PWD
# * z -x # remove the current directory from the datafile
# * z -h # show a brief help message
[ -d "${_Z_DATA:-$HOME/.z}" ] && {
echo "ERROR: z.sh's datafile (${_Z_DATA:-$HOME/.z}) is a directory."
}
_z() {
local datafile="${_Z_DATA:-$HOME/.z}"
# if symlink, dereference
[ -h "$datafile" ] && datafile=$(readlink "$datafile")
# bail if we don't own ~/.z and $_Z_OWNER not set
[ -z "$_Z_OWNER" -a -f "$datafile" -a ! -O "$datafile" ] && return
_z_dirs () {
[ -f "$datafile" ] || return
local line
while read line; do
# only count directories
[ -d "${line%%\|*}" ] && echo "$line"
done < "$datafile"
return 0
}
# add entries
if [ "$1" = "--add" ]; then
shift
# $HOME and / aren't worth matching
[ "$*" = "$HOME" -o "$*" = '/' ] && return
# don't track excluded directory trees
if [ ${#_Z_EXCLUDE_DIRS[@]} -gt 0 ]; then
local exclude
for exclude in "${_Z_EXCLUDE_DIRS[@]}"; do
case "$*" in "$exclude"*) return;; esac
done
fi
# maintain the data file
local tempfile="$datafile.$RANDOM"
local score=${_Z_MAX_SCORE:-9000}
_z_dirs | awk -v path="$*" -v now="$(date +%s)" -v score=$score -F"|" '
BEGIN {
rank[path] = 1
time[path] = now
}
$2 >= 1 {
# drop ranks below 1
if( $1 == path ) {
rank[$1] = $2 + 1
time[$1] = now
} else {
rank[$1] = $2
time[$1] = $3
}
count += $2
}
END {
if( count > score ) {
# aging
for( x in rank ) print x "|" 0.99*rank[x] "|" time[x]
} else for( x in rank ) print x "|" rank[x] "|" time[x]
}
' 2>/dev/null >| "$tempfile"
# do our best to avoid clobbering the datafile in a race condition.
if [ $? -ne 0 -a -f "$datafile" ]; then
command rm -f "$tempfile"
else
[ "$_Z_OWNER" ] && command chown $_Z_OWNER:"$(id -ng $_Z_OWNER)" "$tempfile"
command mv -f "$tempfile" "$datafile" || command rm -f "$tempfile"
fi
# tab completion
elif [ "$1" = "--complete" -a -s "$datafile" ]; then
_z_dirs | awk -v q="$2" -F"|" '
BEGIN {
q = substr(q, 3)
if( q == tolower(q) ) imatch = 1
gsub(/ /, ".*", q)
}
{
if( imatch ) {
if( tolower($1) ~ q ) print $1
} else if( $1 ~ q ) print $1
}
' 2>/dev/null
else
# list/go
local echo fnd last list opt typ
while [ "$1" ]; do case "$1" in
--) while [ "$1" ]; do shift; fnd="$fnd${fnd:+ }$1";done;;
-*) opt=${1:1}; while [ "$opt" ]; do case ${opt:0:1} in
c) fnd="^$PWD $fnd";;
e) echo=1;;
h) echo "${_Z_CMD:-z} [-cehlrtx] args" >&2; return;;
l) list=1;;
r) typ="rank";;
t) typ="recent";;
x) sed -i -e "\:^${PWD}|.*:d" "$datafile";;
esac; opt=${opt:1}; done;;
*) fnd="$fnd${fnd:+ }$1";;
esac; last=$1; [ "$#" -gt 0 ] && shift; done
[ "$fnd" -a "$fnd" != "^$PWD " ] || list=1
# if we hit enter on a completion just go there
case "$last" in
# completions will always start with /
/*) [ -z "$list" -a -d "$last" ] && builtin cd "$last" && return;;
esac
# no file yet
[ -f "$datafile" ] || return
local cd
cd="$( < <( _z_dirs ) awk -v t="$(date +%s)" -v list="$list" -v typ="$typ" -v q="$fnd" -F"|" '
function frecent(rank, time) {
# relate frequency and time
dx = t - time
return int(10000 * rank * (3.75/((0.0001 * dx + 1) + 0.25)))
}
function output(matches, best_match, common) {
# list or return the desired directory
if( list ) {
if( common ) {
printf "%-10s %s\n", "common:", common > "/dev/stderr"
}
cmd = "sort -n >&2"
for( x in matches ) {
if( matches[x] ) {
printf "%-10s %s\n", matches[x], x | cmd
}
}
} else {
if( common && !typ ) best_match = common
print best_match
}
}
function common(matches) {
# find the common root of a list of matches, if it exists
for( x in matches ) {
if( matches[x] && (!short || length(x) < length(short)) ) {
short = x
}
}
if( short == "/" ) return
for( x in matches ) if( matches[x] && index(x, short) != 1 ) {
return
}
return short
}
BEGIN {
gsub(" ", ".*", q)
hi_rank = ihi_rank = -9999999999
}
{
if( typ == "rank" ) {
rank = $2
} else if( typ == "recent" ) {
rank = $3 - t
} else rank = frecent($2, $3)
if( $1 ~ q ) {
matches[$1] = rank
} else if( tolower($1) ~ tolower(q) ) imatches[$1] = rank
if( matches[$1] && matches[$1] > hi_rank ) {
best_match = $1
hi_rank = matches[$1]
} else if( imatches[$1] && imatches[$1] > ihi_rank ) {
ibest_match = $1
ihi_rank = imatches[$1]
}
}
END {
# prefer case sensitive
if( best_match ) {
output(matches, best_match, common(matches))
exit
} else if( ibest_match ) {
output(imatches, ibest_match, common(imatches))
exit
}
exit(1)
}
')"
if [ "$?" -eq 0 ]; then
if [ "$cd" ]; then
if [ "$echo" ]; then echo "$cd"; else builtin cd "$cd"; fi
fi
else
return $?
fi
fi
}
if command -v fzf &>/dev/null; then
# use fzf with z, from https://github.com/junegunn/fzf/wiki/Examples#integration-with-z
z() {
[ $# -gt 0 ] && _z "$*" && return
cd "$(_z -l 2>&1 | fzf --height 40% --nth 2.. --reverse --inline-info +s --tac --query "${*##-* }" | sed 's/^[0-9,.]* *//')"
}
zz() {
cd "$(_z -l 2>&1 | sed 's/^[0-9,.]* *//' | fzf -q "$_last_z_args")"
}
else
alias ${_Z_CMD:-z}='_z 2>&1'
fi
[ "$_Z_NO_RESOLVE_SYMLINKS" ] || _Z_RESOLVE_SYMLINKS="-P"
if type compctl >/dev/null 2>&1; then
# zsh
[ "$_Z_NO_PROMPT_COMMAND" ] || {
# populate directory list, avoid clobbering any other precmds.
if [ "$_Z_NO_RESOLVE_SYMLINKS" ]; then
_z_precmd() {
(_z --add "${PWD:a}" &)
: $RANDOM
}
else
_z_precmd() {
(_z --add "${PWD:A}" &)
: $RANDOM
}
fi
[[ -n "${precmd_functions[(r)_z_precmd]}" ]] || {
precmd_functions[$(($#precmd_functions+1))]=_z_precmd
}
}
_z_zsh_tab_completion() {
# tab completion
local compl
read -l compl
reply=(${(f)"$(_z --complete "$compl")"})
}
compctl -U -K _z_zsh_tab_completion _z
elif type complete >/dev/null 2>&1; then
# bash
# tab completion
complete -o filenames -C '_z --complete "$COMP_LINE"' ${_Z_CMD:-z}
[ "$_Z_NO_PROMPT_COMMAND" ] || {
# populate directory list. avoid clobbering other PROMPT_COMMANDs.
grep "_z --add" <<< "$PROMPT_COMMAND" >/dev/null || {
PROMPT_COMMAND="$PROMPT_COMMAND"$'\n''(_z --add "$(command pwd '$_Z_RESOLVE_SYMLINKS' 2>/dev/null)" 2>/dev/null &);'
}
}
fi

View File

@ -1,6 +1,6 @@
# vi:syntax=gitconfig
[core]
excludesfile = ~/.gitignore
#[core] # DEPRECATED: excludesfile should be in ~/.config/git/ignore
#excludesfile = ~/.gitignore
#[init]
# templatedir = ~/.git_template
@ -11,16 +11,17 @@ rebase = true
[merge]
ff = only
tool = vimdiff2
tool = vimdiff
[mergetool]
keepBackup = false
[diff]
tool = vimdiff2
tool = vimdiff
[difftool]
prompt=true
[rebase]
autostash = true
autosquash = true
@ -30,7 +31,9 @@ squash = true
abbrevcommit = true
[format]
#pretty = format:%C(yellow)commit %h%Cred%d %Creset%nAuthor: %Cblue%>(12)%an%n%CgreenDate: %ar%Creset%n%n%B
[alias]
showtool = "!showci () { rev=${1:-HEAD}; git difftool $rev~1 $rev; }; showci $1"
mylog = "log --pretty='format:👉 %C(yellow)commit: %h%C(auto)%d %Creset%nAuthor: %C(auto,cyan)%>(12)%an (%aE)%n%C(reset)Date: %C(auto,green)%ar%Creset%nContent: %s'"
flog = "!flog() { git log --oneline $@ | fzf --multi --preview 'git -p show --color=always {+1}' --preview-window=right,60% | awk '{print $1}'; }; flog"
taglist = "tag --list --sort=-creatordate --format=\"%(authordate:relative)%09│ %(refname:short)\""

7
gitignore Normal file
View File

@ -0,0 +1,7 @@
.venv
tags
node_modules
target
build
dist
.vagrant

View File

@ -1,189 +0,0 @@
#!/bin/bash
## brethil's dotfiles installation script
## 20 June 2016
# Get the location for the dotfiles
DOTFILES=$PWD
PACKAGES="vim zsh antibody git grc ccze bmon mtr tmux byobu htop"
function setup_git {
# set up some git stuff
git config --global include.path $DOTFILES/gitconfig
}
function install_vimrc {
# TODO: check if vim-plug is installed
if [ -f "$HOME/.vimrc" ]; then
mv "$HOME/.vimrc"{,.bak} && echo "Backed up old vimrc"
fi
ln -s "$DOTFILES/.vimrc" "$HOME/.vimrc"
}
function setup_ackrc {
ln -s "$DOTFILES/ackrc" "$HOME/.ackrc"
}
function setup_ipython {
python -m pip install pip ipython || python -m pip install --user pip ipython
ipython -c "1+1" # run ipython once so that we are sure that the profile directories exist
ln -s "$DOTFILES/ipython/profile_default/ipython_config.py" "$HOME/.ipython/profile_default/"
ln -s "$DOTFILES/ipython/profile_default/startup" "$HOME/.ipython/profile_default/startup"
}
# Add an ssh config file with:
# - Connection multiplexer for faster multiple connections
# - Keep connections alive (avoid timeout disconnections)
function create_ssh_config {
echo "# Configuring ssh..."
ssh_config="$HOME/.ssh/config"
if [ ! -f $HOME/.ssh/id_rsa ]; then
echo "Creating ssh key (4096bit)..."
echo "Enter ssh-key comment (leave empty for default: user@host)"
read comment
if [[ $comment ]]; then
ssh-keygen -t ed25519 -C "$comment"
else
ssh-keygen -t ed25519
fi
# fix permissions
chmod 0700 "$HOME/.ssh"
fi
if [[ -f $ssh_config ]]; then
until [[ $modifyssh == "y" || $modifyssh == "n" ]]; do
echo "Do you want to modify the existing ssh config? (New values will be appended) (y/n)"
read modifyssh
done
fi
exec 3>&1 # save stdout file descriptor
# add the ssh rc that symlinks the used SSH_AUTH_SOCK. This will be executed on every ssh login.
# The idea is that if the user is logging in using ssh -A, the symlink will point to the correct
# location of the ssh auth socket and the remote ssh agent will be used.
# SSH_AUTH_SOCK is declared in brethil_dotfile.sh
exec 1>>~/.ssh/rc
echo '#!/bin/bash'
echo 'if test "$SSH_AUTH_SOCK" ; then'
echo ' ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock'
echo 'fi '
chmod 755 ~/.ssh/rc
exec 1>>$ssh_config # redirect everything below to the $ssh_config file
if [[ "$modifyssh" == "n" ]]; then
echo "Did not modify $ssh_config."
exec 1>&3 # restore stdout
return
fi
echo "# brethil's dotfiles setup start"
echo 'TCPKeepAlive=yes'
echo 'ServerAliveCountMax=6'
echo
echo "## Uncomment to enable compression for all ssh sessions"
echo '#Compression=yes'
echo
echo '## Uncomment the following to enable ssh ControlMaster and ssh session persistence'
echo '#ControlMaster autoask # ask for confirmation before using a shared connection'
echo '#ControlMaster auto # do not ask for confirmation'
echo '#ControlPath ~/.ssh/%r@%h:%p'
echo '#ControlPersist yes'
echo
echo 'Host *'
echo ' ServerAliveInterval 300'
echo
echo '## Enable the following if you want to use the rmate textmate remote'
echo "#Host *"
echo "# RemoteForward 52698 localhost:52698"
echo
echo '## Enable the following if you want to use a reverse ssh tunnel to use mecp command on remote hosts'
echo "#Host *"
echo "# Remoteforward 2222 localhost:22"
echo
echo '# end of brethil dotfiles setup #'
exec 1>&3 # restore stdout
echo ".ssh/ssh_config configured. Edit it to enable custom options:"
echo "- Compression"
echo "- Remote forwarding remote:2222->localhost:22 (revere tunnel to scp back to the original host using mecp)"
echo "# End of ssh config."
}
function fix_annoyances {
## Fix scrolling in byobu
if [[ $(uname) == "Darwin" ]]; then
sed -i '' 's/set -g terminal-overrides/#set -g terminal-overrides/' /usr/share/byobu/profiles/tmux
else
sed -i 's/set -g terminal-overrides/#set -g terminal-overrides/' /usr/share/byobu/profiles/tmux
fi
# remove ls from the grc.zsh config: # TODO: fix this on MacOS
sed 's|ls \\|#ls \\|' /etc/grc.zsh
# TODO: add iptables, docker to grc.zsh
}
# First setup
function brethil_dotfiles_setup {
antibody &>/dev/null || (echo "Please install antibody then continue." 1>&2 && echo "Other useful packages: $PACKAGES" && exit)
bin="$HOME/bin"
projects="$HOME/projects"
git="$HOME/git"
mkdir -p "$bin" "$projects" "$git" && echo "Created dirs $bin, $projects, $git"
# prepare .zshrc
cp "$HOME/.zshrc"{,.pre-brethil-dotfiles}
exec 3>&1 # save stdout
exec 1>>"$HOME/.zshrc"
echo -e "\n\n# brethil's dotfiles:"
echo "export DOTFILES=$DOTFILES"
echo "source \$DOTFILES/brethil_dotfile.sh"
echo -e "# End of brethil's dotfiles\n\n"
exec 1>&3 # restore stdout
antibody bundle "$DOTFILES/antibody_plugins.txt"
antibody update
fix_annoyances
setup_vim
# Create ssh config
create_ssh_config
# git config
setup_git
# ipython profile
setup_ipython
# pdbpp rc
setup_pdbprc
# ackrc
setup_ackrc
ZSH="$(antibody path robbyrussell/oh-my-zsh)"
ln -s "$DOTFILES/brethil.zsh-theme" "${ZSH}/themes/" # TODO: improve this
ln -s "$DOTFILES/brethil-minimal.zsh-theme" "${ZSH}/themes/"
}
function main(){
set -e
set -o pipefail
# Setup
# brethil_dotfiles_setup
source "$DOTFILES/colors.sh"
echo -e "$BOLD$GREEN Install complete!"
echo ""
echo "$WHITE Set \$DOTFILES to $DOTFILES"
echo -e "$RED Functions definitions:$WHITE \$DOTFILES/functions.sh\n\tyou can add your own functions in ~/.dotfiles_functions"
echo -e "$RED Aliases definitions:$WHITE \$DOTFILES/aliases.sh\n\tyou can add your own aliases in ~/.dotfiles_aliases)"
echo -e "$RED Colors definitions:$WHITE \$DOTFILES/colors.sh"
echo -e "$CLEAR"
echo "More zsh plugins can be added using antibody, adding them at \$DOTFILES/antibody_plugins.txt"
echo "Type '. ~/.zshrc' or 'exec zsh -l' to source the new configuration."
}
main

View File

@ -1,3 +1,5 @@
c.TerminalInteractiveShell.editing_mode = "vi"
c.TerminalInteractiveShell.mouse_support = True # prevents from selecting text
c.TerminalInteractiveShell.true_color = True
config = get_config()
config.TerminalInteractiveShell.editing_mode = "vi"
config.TerminalInteractiveShell.mouse_support = True # prevents from selecting text
config.TerminalInteractiveShell.true_color = True

View File

@ -0,0 +1,3 @@
import os
os.environ["PAGER"] = "bat --style=plain"

View File

@ -1,53 +1,25 @@
import os
import pdb
if False:
from pygments.styles import get_all_styles
from pygments.styles import get_style_by_name
all_styles = get_all_styles()
all_styles = [
"default",
"emacs",
"friendly",
"colorful",
"autumn",
"murphy",
"manni",
"monokai",
"perldoc",
"pastie",
"borland",
"trac",
"native",
"fruity",
"bw",
"vim",
"vs",
"tango",
"rrt",
"xcode",
"igor",
"paraiso-light",
"paraiso-dark",
"lovelace",
"algol",
"algol_nu",
"arduino",
"rainbow_dash",
"abap",
"solarized-dark",
"solarized-light",
"sas",
"stata",
"stata-light",
"stata-dark",
"inkpot",
]
if os.getenv("THEME_PREFER_LIGHT"):
pygments_style = "gruvbox-light"
else:
pygments_style = "gruvbox-dark"
class Config(pdb.DefaultConfig):
sticky_by_default = True
pygments_formatter_class = "pygments.formatters.TerminalTrueColorFormatter"
pygments_formatter_kwargs = {"style": "solarized-dark"}
# prompt = "(Pdb++) "
use_pygments = True
pygments_formatter_class = "pygments.formatters.TerminalTrueColorFormatter"
pygments_formatter_kwargs = {"style": get_style_by_name(pygments_style)}
editor = "vim"
if __name__ == "__main__":
from pygments.styles import get_all_styles
all_styles = get_all_styles()
print(list(all_styles))

9
playbook.yml Normal file
View File

@ -0,0 +1,9 @@
---
- hosts: all
vars:
archlinux: ansible_facts['os_family'] == "Archlinux"
roles:
- dotfiles
- { role: aur_packages, when: archlinux, tags: ["aur", "aur-packages"] }

View File

@ -1,3 +1,5 @@
# vim:ft=zsh ts=2 sw=2 sts=2
local ret_status="%(?:%{$fg_bold[green]%}➜%{$reset_color%}:%{$fg[red]%}➜%{$reset_color%})"
local user="%(#:root@:)"
PROMPT='[%{$fg[red]%}${user}%M%{$reset_color%}][:%{$fg[green]%}%c%{$reset_color%}]$(git_prompt_info) ${ret_status} '

95
themes/brethil.zsh-theme Normal file
View File

@ -0,0 +1,95 @@
# vim:ft=zsh ts=2 sw=2 sts=2
# brethil oh-my-zsh theme
# See "EXPANSION OF PROMPT SEQUENCES" in `man zshmisc`
# Note: Most of the expansions/color sequences can be tested using `print -P`
# prints hostname on an orange background if on an ssh connection, adds username if root
local user='%(!.%K{160}%F{255}%B%n%b%k%f.)' # prints 'root' on a red background if user is root
local host='%K{202}%B%F{255}%m%f%k%b' # bold host name on an orange background
local open_bracket='%(!.[.)'
local close_bracket='%(!.].)'
local at='%(!.@.)'
local user_prompt
if [[ -n $SSH_CONNECTION ]]; then
user_prompt="[${user}${at}${host}]"
else
user_prompt="${open_bracket}${user}${close_bracket}"
fi
local job_prompt="%(1j.%B%K{202}%F{220} %j %k%b.)"
local shlvl_prompt
# Shows SHLVL on a magenta background if SHLVL > 1 (2 if in a tmux session)
if [[ -z "$TMUX" ]]; then
shlvl_prompt="%(2L.%K{161}%F{255}%B %L %f%b%k.)"
else
shlvl_prompt="%(3L.%K{161}%F{255}%B $((SHLVL-1)) %f%b%k.)"
fi
# Shows last 3 items in path if there are more than 4
local path_prompt='[%F{green}%(4~:…/%3~:%~)%f]'
# PREFIX/SUFFIX are added before/after `git_prompt_info`
ZSH_THEME_GIT_PROMPT_PREFIX=" %f%{$fg[yellow]%} "
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} |"
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[white]%}%{$fg[red]%}x%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[white]%}%{$fg[green]%}√%{$reset_color%}"
# The following are part of `git_prompt_status`
# Rules:
# ? : untracked
# * : modified
# + : added
# $ : stashed
ZSH_THEME_GIT_PROMPT_STASHED="%B%F{32}$%b%f" # blue
# ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[red]%}✗ " # this is equivalent to DIRTY, if DISABLE_UNTRACKED_FILES_DIRTY is set
ZSH_THEME_GIT_PROMPT_ADDED="%B%F{34}+%b%f" # green
ZSH_THEME_GIT_PROMPT_UNTRACKED="%B%F{red}?%b%f" # red
# The following are part of `git_remote_status`
# ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE="%{$fg[green]%}="
ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE=">"
ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE="<"
ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE="<>"
local BOLD_PURPLE='%B%F{5}'
local CLEAR='%f%b'
local venv
function virtualenv_info {
[ -z "$VIRTUAL_ENV" ] && return
venv="$(basename "$VIRTUAL_ENV")"
if [[ "$venv" == ".venv" ]]; then
venv="$(basename $(dirname "$VIRTUAL_ENV") )"
fi
# bold (%B) purple (%F{5})
echo -n " %B%F{5}<$venv>%b%f "
}
local git_prompt='$(git_prompt_info)$(git_prompt_status)$(git_remote_status)'
local return_code_RPS1='%(?..%B%F{88}-$?-%f%b)'
local success="%B%F{28} →%f%b"
local failure="%B%{$fg[red]%} x%b%{$reset_color%}"
local prompt_with_previous_return_status="%(?:$success:$failure) "
function prompt_too_long(){
# prints a newline if less than $COLUMNS/2 characters remain to the right margin, see end of `man zshmisc`
echo "%-$((COLUMNS/2))(l..\n)"
}
## oh-my-zsh vi-mode plugins indicators:
export MODE_INDICATOR="[%B%K{red}nav%k%b]" # red background
export INSERT_MODE_INDICATOR="[%B%K{28}ins%k%b]" # green background
# put it all together
PROMPT='$(virtualenv_info)'"${user_prompt}${path_prompt}${git_prompt}${job_prompt}${shlvl_prompt}$(prompt_too_long)${prompt_with_previous_return_status}"
# Right prompt is just return code and time
RPS1="${return_code_RPS1}"'$(vi_mode_prompt_info)[%*]'

105
tmux.conf Normal file
View File

@ -0,0 +1,105 @@
set-option -ga mouse
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf
set-option -g status-style bg=colour235,fg=colour136,default # bg=base02, fg=yellow
# default window title colors
set-window-option -g window-status-style fg=colour244,bg=default,dim # fg=base0
# active window title colors
set-window-option -g window-status-current-style fg=colour166,bg=default,bright # fg=orange
# pane border
set-option -g pane-border-style fg=colour235 #fg=base02
set-option -g pane-active-border-style fg=colour240 #fg=base01
# message text
set-option -g message-style bg=colour235,fg=colour166 # bg=base02, fg=orange
# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange
# clock
set-window-option -g clock-mode-colour green #green
set -g history-limit 10000
set -g status-interval 1
set -g status-justify centre # center align window list
set -g status-left-length 20
set -g status-right-length 140
set -g status-left '#[fg=green]#H #[fg=black]• #[fg=green,bright]#(uname -r | cut -c 1-6)#[default]'
set -g status-right '#[fg=green,bg=default,bright]#(tmux-mem-cpu-load) #[fg=red,dim,bg=default]#(uptime | cut -f 4-5 -d " " | cut -f 1 -d ",") #[fg=white,bg=default]%a%l:%M:%S %p#[default] #[fg=blue]%Y-%m-%d'
# C-b is not acceptable -- Vim uses it
set-option -g prefix C-a
bind-key C-a last-window
# # Start numbering at 1
# set -g base-index 1
# Allows for faster key repetition
set -s escape-time 0
set-option -sg escape-time 0
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on
# Allows us to use C-a a <command> to send commands to a TMUX session inside
# another TMUX session
bind-key a send-prefix
# Activity monitoring
# setw -g monitor-activity on
set -g visual-activity on
# hjkl pane traversal
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'"
# reload config
bind r source-file ~/.tmux.conf \; display-message "Config reloaded"
# auto window rename
set-window-option -g automatic-rename
# https://github.com/edkolev/dots/blob/master/tmux.conf
# Updates for tmux 1.9's current pane splitting paths.
# Colors
# How to use true colors in vim under tmux? #1246 for 2.6 and higher
# https://github.com/tmux/tmux/issues/1246:
# set -g default-terminal "tmux-256color"
# set -ga terminal-overrides ",*256col*:Tc"
# 2.5 and lower:
# set -g default-terminal "screen-256color"
# True color settings, see https://jdhao.github.io/2018/10/19/tmux_nvim_true_color/ for the details.
set -g default-terminal "xterm-256color"
# If terminal supports true color, use the following options.
set -ga terminal-overrides ",xterm-256color*:Tc"
setw -g mode-keys vi
# use vim-like keys for splits and windows
bind-key v split-window -h -c "#{pane_current_path}"
bind-key s split-window -v -c "#{pane_current_path}"
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind-key t swap-window -t +1
bind-key T swap-window -t -1
bind-key S choose-window 'join-pane -v -s "%%"'
bind-key V choose-window 'join-pane -h -s "%%"'
bind-key W choose-window 'swap-window -t "%%"'
bind A command-prompt "rename-window \"%%\""
bind C customize-mode

View File

@ -252,3 +252,5 @@ emacs -batch -l dunnet
# BINARY CLOCK!
watch -n 1 'echo "obase=2;`date +%s`" | bc'
# dbus introspection
busctl -j --user introspect org.freedesktop.Notifications "/fr/emersion/Mako"

View File

@ -10,8 +10,8 @@ function! WinZoomToggle() abort
wincmd |
let w:WinZoomIsZoomed = 1
elseif w:WinZoomIsZoomed == 1
execute "resize " . w:WinZoomOldHeight
execute "vertical resize " . w:WinZoomOldWidth
execute 'resize ' . w:WinZoomOldHeight
execute 'vertical resize ' . w:WinZoomOldWidth
let w:WinZoomIsZoomed = 0
endif
endfunction
@ -42,8 +42,8 @@ endfunction
" Don't close window, when deleting a buffer
command! Bclose call <SID>BufcloseCloseIt()
function! <SID>BufcloseCloseIt()
let l:currentBufNum = bufnr("%")
let l:alternateBufNum = bufnr("#")
let l:currentBufNum = bufnr('%')
let l:alternateBufNum = bufnr('#')
if buflisted(l:alternateBufNum)
buffer #
@ -51,30 +51,35 @@ function! <SID>BufcloseCloseIt()
bnext
endif
if bufnr("%") == l:currentBufNum
if bufnr('%') == l:currentBufNum
new
endif
if buflisted(l:currentBufNum)
execute("bdelete! ".l:currentBufNum)
execute('bdelete! '.l:currentBufNum)
endif
endfunction
function! CmdLine(str)
call feedkeys(":" . a:str)
call feedkeys(':' . a:str)
endfunction
" Call Git show on the selected text (must be a git ref)
function! GitShowVisual() range
execute 'Git show ' . @*
endfunction
function! VisualSelection(direction, extra_filter) range
let l:saved_reg = @"
execute "normal! vgvy"
execute 'normal! vgvy'
let l:pattern = escape(@", "\\/.*'$^~[]")
let l:pattern = substitute(l:pattern, "\n$", "", "")
let l:pattern = escape(@', "\\/.*'$^~[]")
let l:pattern = substitute(l:pattern, '\n$', '', '')
if a:direction == 'gv'
call CmdLine("Ack '" . l:pattern . "' " )
elseif a:direction == 'replace'
call CmdLine("%s" . '/'. l:pattern . '/')
if a:direction ==# 'ack'
call CmdLine("Ack '" . l:pattern . "' ")
elseif a:direction ==# 'replace'
call CmdLine('%s' . '/'. l:pattern . '/')
endif
let @/ = l:pattern
@ -83,5 +88,63 @@ endfunction
function! GitStatus()
let [a,m,r] = GitGutterGetHunkSummary()
return printf('+%d ~%d -%d', a, m, r)
echo printf('+%d ~%d -%d', a, m, r)
endfunction
command! GitStatus call GitStatus()
" Redirect command into scratch buffer. Stolen from romainl
function! Redir(cmd, rng, start, end)
for win in range(1, winnr('$'))
if getwinvar(win, 'scratch')
execute win . 'windo close'
endif
endfor
if a:cmd =~? '^!'
let cmd = a:cmd =~?' %'
\ ? matchstr(substitute(a:cmd, ' %', ' ' . expand('%:p'), ''), '^!\zs.*')
\ : matchstr(a:cmd, '^!\zs.*')
if a:rng == 0
let output = systemlist(cmd)
else
let joined_lines = join(getline(a:start, a:end), '\n')
let cleaned_lines = substitute(shellescape(joined_lines), "'\\\\''", "\\\\'", 'g')
let output = systemlist(cmd . ' <<< $' . cleaned_lines)
endif
else
redir => output
execute a:cmd
redir END
let output = split(output, "\n")
endif
vnew
let w:scratch = 1
setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile
call setline(1, output)
endfunction
command! -nargs=1 -complete=command -bar -range Redir silent call Redir(<q-args>, <range>, <line1>, <line2>)
" Gets the man page for the given command
function! Man(cmd)
vnew
let w:scratch=1
setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile filetype=man nonumber norelativenumber
let output = system('env COLUMNS=80 man ' . a:cmd)
call setline(1, split(output, '\n'))
endfunction
command! -nargs=1 -complete=shellcmd Vert Man silent call Man(<q-args>)
" Execute the given command and print it in a scratch buffer
function! Cmd(cmd)
let output = system(a:cmd)
vnew
let w:scratch=1
" setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile
setlocal buftype=popup bufhidden=wipe nobuflisted noswapfile
setlocal nonumber norelativenumber
call setline(1, split(output, '\n'))
endfunction
command! -nargs=1 -complete=shellcmd Cmd silent call Cmd(<q-args>)

View File

@ -1,121 +1,232 @@
"""" PLUGINS CONFIGURATION
let g:ack_default_options = " --cc --cpp --shell --python --html --js --vue"
" ALE configuration
"
let g:ale_python_auto_poetry = 1
let g:ale_set_balloons = 1 " enable tooltips
let g:ale_fixers = {
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
\ 'bash': ['shfmt'],
\ 'sh': ['shfmt'],
\ 'json': ['prettier'],
\ 'c': ['clang-format'],
\ 'cpp': ['clang-format'],
\ 'cmake': ['cmakeformat'],
\ 'css': ['prettier'],
\ 'html': ['prettier'],
\ 'kotlin': ['ktlint'],
\ 'markdown': ['prettier'],
\ 'java': ['eclipselsp'],
\ 'terraform': ['terraform'],
\ 'yaml': ['prettier'],
\ 'python': ['black', 'isort'],
\ 'go': ['gofmt', "goimports"],
\ 'python': ['ruff_format'],
\ 'go': ['gofmt', 'goimports'],
\ 'rust': ['rustfmt'],
\ "javascript": ["prettier", "eslint"],
\ "vue": ["prettier", "eslint"]
\ 'sql': ['pgformatter'],
\ 'java': ['clang-format'],
\ 'javascript': ['prettier', 'eslint'],
\ 'vue': ['prettier', 'eslint'],
\}
let g:ale_fixers_aliases = {'vue': ['vue', 'javascript']}
let g:ale_fixers_aliases = {'vue': ['vue', 'javascript'], 'arduino': 'cpp'}
let g:ale_python_bandit_options = "-c banditrc"
" let g:ale_python_pylint_options = "--rcfile pylintrc --disable=W0511" " if the rcfile does not exist, pylint will exit without linting
let g:ale_python_pylint_options = "--disable=W0511"
let g:ale_cpp_clang_options = '-std=c++17 -Wall -Wpedantic'
let g:ale_cpp_gcc_options = '-std=c++17 -Wall -Wpedantic'
let g:ale_arduino_ccls_executable = 'ccls'
let g:ale_arduino_ccls_init_options = {}
let g:ale_popup_menu_enabled = 1
let g:ale_python_bandit_options = '-c banditrc'
let g:ale_python_pylint_options = '-j0 --disable=W0511'
let g:ale_python_mypy_options = '--ignore-missing-imports'
" let g:ale_cpp_clang_options = '-std=c++17 -Wall -Wpedantic'
" let g:ale_cpp_gcc_options = '-std=c++17 -Wall -Wpedantic'
let g:ale_rust_cargo_use_clippy = 1
let g:ale_linters = {
\ 'bash': ['bashlint', "shellcheck"],
\ 'dockerfile': ["hadolint"],
\ 'zsh': ['bashlint', "shellcheck"],
\ 'python': ['pyls', 'pylint', 'bandit'],
\ 'bash': ['bash-language-server', 'bashlint', 'shellcheck'],
\ 'dockerfile': ['hadolint'],
\ 'zsh': ['bashlint', 'shellcheck'],
\ 'c': ['ccls', 'clangd'],
\ 'cpp': ['clangd'],
\ 'qml': ['qmllint'],
\ 'python': ['pylsp', 'mypy', 'ruff'],
\ 'go': ['gopls', 'gobuild'],
\ 'rust': ['analyzer', 'rustc'],
\ 'rust': ['analyzer', 'cargo'],
\ 'yaml': ['yamllint'],
\ 'javascript': ["yarn lint", "eslint", "vls"]
\ 'javascript': ['yarn lint', 'eslint'],
\ 'xml': ['android'],
\ 'groovy': ['android'],
\ 'java': ['eclipselsp', 'android'],
\ 'kotlin': ['android', 'ktlint', 'languageserver'],
\ 'vue': ['volar', 'eslint']
\}
let g:ale_linter_aliases = {'vue': ['vue', 'javascript']}
let g:ale_set_quickfix=1
let g:ale_set_loclist=0
let g:ale_linter_aliases = {'vue': ['vue', 'javascript'], 'arduino': 'cpp'}
" disable gradle signs/loclist as they conflict with ALE (vim-android)
let g:gradle_loclist_show = 0
let g:gradle_show_signs = 0
let g:ale_java_eclipselsp_path = '~/git/eclipse.jdt.ls'
let g:ale_yaml_yamllint_options = '--config .editorconfig'
let g:ale_open_list = 0
let g:ale_keep_list_window_open = 1
let g:ale_lint_on_save = 1
" let g:ale_lint_on_enter = 0 " uncomment if you do not want to lint files on open
let g:ale_lint_on_enter = 1
let g:ale_lint_on_insert_leave = 1
" let g:ale_lint_on_text_changed = 1
let g:ale_lint_on_text_changed = 0
let g:ale_lint_delay = 2500 " lint 2.5 seconds after text has changed
augroup androiddev
" avoid death by gradle
autocmd! FileType java,kotlin let g:ale_lint_on_insert_leave = 0
augroup END
let g:ale_fix_on_save = 1
let g:ale_cursor_detail=1
let g:ale_detail_to_floating_preview = 1
let g:ale_completion_enabled = 1
" let g:ale_completion_autoimport = 1
let g:ale_lsp_show_message_severity = 'information'
let g:ale_lsp_suggestions = 1
let g:ale_rename_tsserver_find_in_comment = 1
let g:ale_sign_priority = 99
let g:ale_sign_error = "xx"
let g:ale_sign_warning = ">>"
let g:ale_sign_info = "--"
let g:ale_sign_error = 'xx'
let g:ale_sign_warning = '>>'
let g:ale_sign_info = '--'
"let g:ale_sign_style_error =
"let g:ale_sign_style_warning =
highlight link ALEVirtualTextError ALEError
highlight link ALEVirtualTextWarning ALEWarning
let g:ale_virtualtext_column = "45%"
let g:ale_virtualtext_single = 0 " show all errors
let g:ale_virtualtext_prefix= "[%linter%] %code: %"
let g:ale_exclude_highlights = [
\ 'line too long',
\]
packadd termdebug "useless shit
augroup rust
autocmd!
autocmd BufRead *.rs let g:ale_set_highlights = 0
augroup END
let g:ale_completion_symbols = {
\ 'text': '',
\ 'method': '',
\ 'function': '',
\ 'constructor': '',
\ 'field': '',
\ 'variable': '',
\ 'class': '',
\ 'interface': '',
\ 'module': '',
\ 'property': '',
\ 'unit': 'unit',
\ 'value': 'val',
\ 'enum': '',
\ 'keyword': 'keyword',
\ 'snippet': '',
\ 'color': 'color',
\ 'file': '',
\ 'reference': 'ref',
\ 'folder': '',
\ 'enum member': '',
\ 'constant': '',
\ 'struct': '',
\ 'event': 'event',
\ 'operator': '',
\ 'type_parameter': 'type param',
\ '<default>': 'v'
\ }
" Fix some gitgutter stuff
let g:gitgutter_enabled = 1
let g:gitgutter_sign_allow_clobber = 0 " do not allow gitgutter to overwrite signs
let g:gitgutter_sign_priority = 50
" let g:gitgutter_set_sign_backgrounds = 1
" let g:gitgutter_override_sign_column_highlight = 0
" highlight clear GitGutterAdd GitGutterChange GitGutterModified GitGutterDelete SignColumn
highlight SignColumn ctermbg=none
highlight GitGutterAdd ctermbg=none ctermfg=2
highlight GitGutterChange ctermbg=none ctermfg=3
highlight GitGutterDelete ctermbg=none ctermfg=1
highlight GitGutterChangeDelete ctermbg=none ctermfg=1
let g:gitgutter_sign_added = '+'
let g:gitgutter_sign_modified = '~'
let g:gitgutter_sign_modified_removed = 'x'
" Improve vimdiff colors (deprecated, this was useful for the twilight256 colorscheme)
" highlight DiffAdd cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Red
" highlight DiffDelete cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Red
" highlight DiffChange cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Red
" highlight DiffText cterm=bold ctermfg=10 ctermbg=88 gui=none guifg=bg guibg=Red
" Airline config
" set laststatus=2
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#show_splits = 1
" let g:airline#extensions#tabline#tab_nr_type = 2
" Lightline config from amix's vimrc " TODO: this could be improved
let g:lightline = {
\ 'colorscheme': 'wombat',
\ 'active': {
\ 'left': [ ['mode', 'paste'],
\ ['fugitive', 'readonly', 'filename', 'modified'] ],
\ 'right': [ [ 'lineinfo' ], ['percent'] ]
\ },
\ 'component': {
\ 'readonly': '%{&filetype=="help"?"":&readonly?"¿":""}',
\ 'modified': '%{&filetype=="help"?"":&modified?"+":&modifiable?"":"-"}',
\ 'fugitive': '%{exists("*FugitiveHead")?FugitiveHead():""}'
\ },
\ 'component_visible_condition': {
\ 'readonly': '(&filetype!="help"&& &readonly)',
\ 'modified': '(&filetype!="help"&&(&modified||!&modifiable))',
\ 'fugitive': '(exists("*FugitiveHead") && ""!=FugitiveHead())'
\ },
\ 'separator': { 'left': ' ', 'right': ' ' },
\ 'subseparator': { 'left': ' ', 'right': ' ' }
\ }
let g:airline#extensions#tabline#buffer_idx_mode = 1
nmap <leader>1 <Plug>AirlineSelectTab1
nmap <leader>2 <Plug>AirlineSelectTab2
nmap <leader>3 <Plug>AirlineSelectTab3
nmap <leader>4 <Plug>AirlineSelectTab4
nmap <leader>5 <Plug>AirlineSelectTab5
nmap <leader>6 <Plug>AirlineSelectTab6
nmap <leader>7 <Plug>AirlineSelectTab7
nmap <leader>8 <Plug>AirlineSelectTab8
nmap <leader>9 <Plug>AirlineSelectTab9
nmap <leader>0 <Plug>AirlineSelectTab0
nmap <leader>- <Plug>AirlineSelectPrevTab
nmap <leader>+ <Plug>AirlineSelectNextTab
let g:airline_theme='gruvbox'
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.colnr = ':'
let g:airline_symbols.linenr = ''
let g:airline_symbols.maxlinenr = ''
let g:airline_section_y = ''
let g:airline#extensions#tagbar#enabled = 1
let g:airline_section_x=' %{tagbar#currenttag("%s", "", "f")}'
let g:airline#extensions#tagbar#flags = 's'
let g:airline#extensions#tagbar#searchmethod = 'scoped-stl'
" only these functions will only be defined when lightline#gradle#... funtions
" are defined, which happens when vim-android is loaded
if exists('lightline#gradle#running')
call airline#parts#define_function(
\ 'gradle-running',
\ 'lightline#gradle#running'
\)
call airline#parts#define_function(
\ 'gradle-errors',
\ 'lightline#gradle#errors'
\)
call airline#parts#define_function(
\ 'gradle-warnings',
\ 'lightline#gradle#warnings'
\)
call airline#parts#define_function(
\ 'gradle-project',
\ 'lightline#gradle#project'
\)
let g:airline_section_x= airline#section#create_right([
\ 'filetype',
\ 'gradle-running',
\ 'gradle-errors',
\ 'gradle-warnings'
\])
let g:gradle_glyph_gradle = ''
let g:gradle_glyph_android = ''
let g:gradle_glyph_error = ''
let g:gradle_glyph_warning = ''
let g:gradle_glyph_building = ''
endif
let g:lightline.component_expand = {
\ 'linter_checking': 'lightline#ale#checking',
\ 'linter_infos': 'lightline#ale#infos',
\ 'linter_warnings': 'lightline#ale#warnings',
\ 'linter_errors': 'lightline#ale#errors',
\ 'linter_ok': 'lightline#ale#ok',
\ }
" These are the default mappings for vim-multi-cursor
let g:multi_cursor_start_word_key = '<C-n>'
@ -134,9 +245,53 @@ let g:indent_guides_start_level = 2
let g:indent_guides_guide_size = 1
let g:ctrlp_custom_ignore = {
\ 'dir': '\v(target|build|dist|.venv)$',
\ 'file': '\v\.(exe|so|dll)$',
\ 'link': 'some_bad_symbolic_links',
\ }
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']
"" Gutentags"
let g:gutentags_cache_dir = expand('~/.vim/ctags_cache/')
let g:gutentags_file_list_command = {
\ 'markers': {
\ '.git': 'git ls-files',
\ '.hg': 'hg files',
\ },
\ }
let g:gutentags_generate_on_empty_buffer = 1
let g:gutentags_ctags_exclude = ['build', 'dist', '*css', '*json', '*yaml', '*md', '.venv', '*rst']
let g:gutentags_ctags_extra_args = ['--tag-relative=always', ]
"" nerdtree
let NERDTreeIgnore=['__pycache__']
" ultisnips
let g:UltiSnipsExpandTrigger='<tab>'
let g:UltiSnipsJumpForwardTrigger='<c-j>'
let g:UltiSnipsJumpBackwardTrigger='<c-k>'
let g:UltiSnipsEditSplit='context'
"" Fzf
let g:fzf_layout = { 'window': { 'width': 1, 'height': 0.9 } }
let g:fzf_colors =
\ { 'fg': ['fg', 'Normal'],
\ 'bg': ['bg', 'Normal'],
\ 'hl': ['fg', 'Comment'],
\ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
\ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
\ 'hl+': ['fg', 'Statement'],
\ 'info': ['fg', 'PreProc'],
\ 'border': ['fg', 'Ignore'],
\ 'prompt': ['fg', 'Conditional'],
\ 'pointer': ['fg', 'Exception'],
\ 'marker': ['fg', 'Keyword'],
\ 'spinner': ['fg', 'Label'],
\ 'header': ['fg', 'Comment'] }
autocmd! FileType fzf
autocmd FileType fzf set laststatus=0 noshowmode noruler
\| autocmd BufLeave <buffer> set laststatus=2 showmode ruler
let g:goyo_width='85%'
let g:goyo_linenr=1
" vim-go
" let g:go_doc_balloon = 1
let g:go_doc_keywordprg_enabled=0

View File

@ -11,38 +11,51 @@ call plug#begin('~/.vim/vim-plug')
Plug 'tpope/vim-sensible'
" Colorscheme
Plug 'https://github.com/morhetz/gruvbox'
" Csv files 🤦
Plug 'https://github.com/mechatroner/rainbow_csv', { 'for': 'csv' }
" Asynchronous Linting Engine
Plug 'https://github.com/dense-analysis/ale'
" Open files/recent files/tags quickly
Plug 'https://github.com/ctrlpvim/ctrlp.vim'
" Git
Plug 'https://github.com/tpope/vim-fugitive'
" Comment shit easily
Plug 'https://github.com/tpope/vim-commentary'
" Browse file system
Plug 'https://github.com/scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
" Minimal status line
Plug 'https://github.com/itchyny/lightline.vim'
" Lightline status for ALE
Plug 'maximbaz/lightline-ale'
" status line
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" Tags integration
Plug 'https://github.com/preservim/tagbar'
" Insert parentheses in pairs
Plug 'https://github.com/jiangmiao/auto-pairs'
Plug 'https://github.com/amix/open_file_under_cursor.vim'
" Multi cursor
Plug 'https://github.com/mg979/vim-visual-multi'
" Easily explore open buffers
Plug 'https://github.com/vim-scripts/bufexplorer.zip'
" Search
Plug 'https://github.com/mileszs/ack.vim'
" Yank history
Plug 'https://github.com/maxbrunsfeld/vim-yankstack'
" Mark indentation level
Plug 'https://github.com/nathanaelkane/vim-indent-guides'
" snipmate
Plug 'https://github.com/MarcWeber/vim-addon-mw-utils'
Plug 'https://github.com/tomtom/tlib_vim'
Plug 'https://github.com/garbas/vim-snipmate'
if executable('meson')
Plug 'https://github.com/igankevich/mesonic'
endif
" fzf
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
" Open tags with fzf's :Tags
if executable('ctags')
Plug 'https://github.com/ludovicchabant/vim-gutentags.git'
endif
" snippets
if has('python3')
Plug 'https://github.com/SirVer/ultisnips'
Plug 'https://github.com/honza/vim-snippets'
endif
" Git gutter line
Plug 'https://github.com/airblade/vim-gitgutter'
@ -53,15 +66,56 @@ Plug 'https://github.com/junegunn/goyo.vim'
Plug 'https://github.com/mgedmin/coverage-highlight.vim'
"Languages
Plug 'https://github.com/rust-lang/rust.vim'
Plug 'https://github.com/vim-scripts/nginx.vim'
Plug 'https://github.com/plasticboy/vim-markdown'
Plug 'https://github.com/bfrg/vim-cpp-modern', {'for': 'cpp'}
Plug 'epheien/termdbg', {'for': ['c', 'cpp']}
Plug 'epheien/termdbg'
if executable('cargo')
Plug 'https://github.com/rust-lang/rust.vim', {'for': 'rust'}
endif
Plug 'https://github.com/vim-scripts/nginx.vim', {'for': 'nginx'}
Plug 'https://github.com/plasticboy/vim-markdown', {'for': 'markdown'}
Plug 'https://github.com/cespare/vim-toml', {'for': 'toml'}
Plug 'https://github.com/vim-scripts/iptables', {'for': 'iptables'}
if executable('vite')
" TODO: check if plugin is still up-to-date
Plug 'https://github.com/leafoftree/vim-vue-plugin', {'for': 'vue'}
endif
if executable('terraform')
Plug 'https://github.com/hashivim/vim-terraform', {'for': 'terraform'}
endif
if executable('go')
Plug 'https://github.com/fatih/vim-go', {'for': 'go'}
endif
if executable('adb') && executable('gradle')
Plug 'https://github.com/udalov/kotlin-vim', {'for': 'kotlin'}
Plug 'https://github.com/hsanson/vim-android', {'for': 'java'}
endif
if executable('qml')
Plug 'https://github.com/peterhoeg/vim-qml', {'for': 'qml'}
endif
if executable('pytest')
Plug 'https://github.com/alfredodeza/pytest.vim', {'for': 'python'}
endif
" Colorize hex codes and/or color strings
Plug 'https://github.com/chrisbra/Colorizer'
" No RGB, no party
let vim_razer = expand('~/projects_razer/vim-razer')
if isdirectory(vim_razer)
Plug vim_razer
endif
if g:uname ==? 'Linux'
Plug 'https://github.com/HiPhish/info.vim'
endif
call plug#end()
" Install plugins if missing
if ! isdirectory(expand('~/.vim/vim-plug'))
PlugInstall
endif

View File

@ -1,108 +1,166 @@
"""" Leader shortcuts
let mapleader = ","
let mapleader = ','
" also use space as leader
nmap <Space> <leader>
map <Space> <leader>
nmap <leader>w :w!<CR>
command! W execute 'w !sudo tee % > /dev/null' <bar> edit!
" nmap <leader>W :w!<CR>
"Reload vimrc on config change
map <leader>e :e! ~/.vimrc<CR>
map <leader>` :ALELint<CR>
" FIXME: This results in some weird conflict with lightline
autocmd! bufwritepost ~/.vimrc source ~/.vimrc
" config editing
map <leader>e :vsplit ~/.vimrc<CR>
map <leader>ef :vsplit $DOTFILES/vim/functions.vim<CR>
map <leader>ec :vsplit $DOTFILES/vim/plugins_config.vim<CR>
map <leader>es :vsplit $DOTFILES/vim/shortcuts.vim<CR>
map <leader>ep :vsplit $DOTFILES/vim/plugs.vim<CR>
" Quickly open a markdown buffer for scribble
map <leader>x :e ~/buffer.md<CR>
map <leader>xx :e ~/projects/work/buffer.md<CR>
" Toggle paste mode on and off
nmap <leader>pp :setlocal paste!<CR>
" Re-select the text block just pasted
nnoremap <Leader>vv V`]
" Easy tab navigation with <leader>T
nmap <leader>Tn :tabnext<CR>
nmap <leader>TN :tabnew<CR>
nmap <leader>Tp :tabprev<CR>
nmap <leader>Tc :tabclose<CR>
nmap <C-W>n :tabnext<CR>
nmap <C-W>p :tabprev<CR>
nmap <C-W>N :tabnew<CR>
" move betweween functions/methods/classes definition,
" [m moves to the start of the previous method, ]m to the start of the next
" zz centers the result
map <Leader>] ]mzz
map <Leader>[ [mzz
" open quickfix
nmap <leader>cc :botright cope<CR>
" open loclist
nmap <leader>ll :botright lope<CR>
" close quickfix (also see <leader>C below)
nmap <leader>cx :hide<CR>
nmap <leader>co ggVGy:tabnew<CR>:set syntax=qf<CR>pgg
" next cope error
map <leader>cn :cn<CR>
map <leader>N :cnext<CR>
" previous cope error
map <leader>cp :cp<CR>
map <leader>P :cprevious<CR>
map <silent> <leader><CR> :noh<CR> "disable highlighting for current word
map <leader>ss :setlocal spell!<CR>
"disable highlighting current search word
map <silent> <leader><CR> :noh<CR>
map <leader>S :setlocal spell!<CR>
nnoremap <leader>mk :bel copen<bar>silent (cargo run) !<bar>redraw!<CR>
nnoremap <leader>M :bel copen<bar>silent make <bar>redraw!<CR>
nnoremap <leader>wz :call WinZoomToggle()<CR>
nmap \ :Explore<CR>
nnoremap <leader>C :close<CR>
nnoremap <leader>q :close<CR>
nnoremap <leader>B :Bclose<CR>
nnoremap <leader>k :Ack<Space>
nnoremap <leader>Q :close!<CR>
nnoremap <leader>k :Rg<CR>
"" Fugitive
nnoremap <leader>/ :Git<CR>
nnoremap <leader>g :Git<CR>
nnoremap <leader>gd :Git diff<CR>
nnoremap <leader>/ :vert Git<CR>
nnoremap <leader>\ :0Git<CR>
nnoremap <leader>d :Gvdiffsplit<CR>
nnoremap <leader>b :Git blame<CR>
nnoremap <leader>gp :Git push<CR>
nnoremap <leader>M :Git commit<CR>
nnoremap <leader>gl :Commits<CR>
nnoremap <leader>gL :BCommits<CR>
nnoremap <leader>gc :Git commit<CR>
nnoremap <leader>gpf :Git push --force-with-lease<CR>
"" Gitutter
nnoremap <leader>u :GitGutterBufferToggle<CR>
nnoremap <leader>L :GitGutterLineHighlightsToggle<CR>
nmap <leader>hn <Plug>(GitGutterNextHunk)
nmap <leader>hp <Plug>(GitGutterPrevHunk)
nnoremap <leader>gp :GitGutterPrevHunk<CR>
nnoremap <leader>gn :GitGutterNextHunk<CR>
nnoremap <leader>gs :GitGutterStageHunk<CR>
nnoremap <leader>gu :GitGutterUndoHunk<CR>
"" Ale
"" Coverage Highlight
nnoremap <leader>H :HighlightCoverageForAll<CR>
" Ale
nmap <silent> <C-k> <Plug>(ale_previous_wrap)
nmap <silent> <C-j> <Plug>(ale_next_wrap)
nmap <leader>R :ALERepeatSelection<CR>
nmap <leader>sv :ALEGoToDefinition -vsplit<CR>
nmap <leader>sh :ALEGoToDefinition -split<CR>
nmap <leader>st :ALEGoToDefinition -tab<CR>
nmap <leader>A :ALEGoToDefinition<CR>
nmap <leader>n :ALEFindReferences<CR>
nmap <leader>n :ALEFindReferences -quickfix <bar> copen<CR>
nmap <leader>h :ALEHover<CR>
nmap <leader>r :ALERename<CR>
" call ack when pressing gv in visual
vnoremap <silent> gv :call VisualSelection('gv', '')<CR>
nmap <leader>` :ALELint<CR>
nmap <leader>F :ALEFix<CR>
nmap <leader>D :ALEToggle<CR>
map <leader>nn :NERDTreeToggle<CR>
map <leader>o :BufExplorer<CR>
"" CtrlP
"" fzf.vim
" Quickly find and open a recently opened file
" let g:ctrlp_map = '<C-f>'
map <C-b> :CtrlPBuffer<CR>
map <leader>j :CtrlP<CR>
map <leader>b :CtrlPBuffer<CR>
map <leader>f :CtrlPMRUFiles<CR>
map <leader>t :CtrlPTag<CR>
map <leader>o :Buffers<CR>
map <leader>j :GFiles<CR>
map <leader>J :Files<CR>
map <leader>f :History<CR>
map <leader>T :BTags<CR>
map <leader>t :Tags<CR>
map <leader>l :Lines<CR>
" FIXME: Not using CtrlP anymore, replace this with fzf
""map <leader>c :CtrlPQuickfix<CR>
map <leader>s :Snippets<CR>
map <leader>; :Commands<CR>
map <leader>m :Maps<CR>
let s:uname=''
let s:uname = system('uname | tr -d "\n"') " Get platform name (stripping the trailing newline)
if s:uname == "Darwin"
"" Mac specific stuff
elseif s:uname == "linux"
"" Linux specific stuff
" Wayland clipboard fix https://github.com/vim/vim/issues/5157
xnoremap "+y :call system("wl-copy", @")<CR>
nnoremap "+p :let @"=substitute(system("wl-paste --no-newline"), '<C-v><C-m>', '', 'g')<cr>p
xnoremap "*y :call system("wl-copy --primary", @")<CR>
nnoremap "*p :let @"=substitute(system("wl-paste --no-newline --primary"), '<C-v><C-m>', '', 'g')<cr>p
"" Indent Guides
map <leader>I :IndentGuidesToggle<CR>
map <leader>i :set cursorcolumn!<CR>
"" Goyo
nmap <leader>zz :Goyo<CR>
""" Tagbar
nmap <F8> :TagbarToggle<CR>
""Misc stuff
if g:uname ==? 'Darwin'
"" Mac specific stuff
elseif g:uname ==? 'Linux'
"" Linux specific stuff
xnoremap "+y y:call system("wl-copy", @")<cr>
map "+p :<C-U>let @"=substitute(system('wl-paste --no-newline'), '<C-v><C-m>', '', 'g') \| exec 'normal! ' . v:count1 . 'p'<cr>
else
"" Unkown platform
"" Unknown platform
endif
" Add shortcuts to yank/paste to unnamed/unnamedplus clipboards
noremap <Leader>y "*y
noremap <Leader>p "*p
noremap <Leader>Y "+y
noremap <Leader>P "+p
map <Leader>y "+y
map <Leader>p "+p
map <Leader>yp <Plug>yankstack_substitute_older_paste
map <leader>yn <Plug>yankstack_substitute_newer_paste
" Insert a python breakpoint
let @b = 'obreakpoint(€kr€ýa0j'
" visual mode mappings
vnoremap <silent> <leader>k :call VisualSelection('LAck', '')<CR>
vnoremap <silent> <leader>gs :call GitShowVisual()<CR>
vnoremap <silent> <leader>r :call VisualSelection('replace', '')<CR>
nnoremap K :exe "Rg " . expand("<cword>")<cr>
nnoremap GL :exe "Git log -L:" . expand("<cword>") . ":" . expand("%")<cr>
autocmd FileType python nnoremap T :Pytest function --pdb<CR>
" Ultisnips
map <Leader>ue :UltiSnipsEdit<cr>
" A friggin python breakpoint. Invoke with @b "FIXME: make this decent
let @b = 'A breakpoint()€ýajkj0'
nmap <F5> <ESC>:Gradle assembleDebug<CR>
nmap <F6> <ESC>:AndroidInstall debug<CR>
nmap <F7> <ESC>:AndroidLaunch debug<CR>

129
vim/vimrc
View File

@ -1,3 +1,5 @@
let g:uname = system('uname | tr -d "\n"') " Get platform name (stripping the trailing newline)
" Install all plugins
source $DOTFILES/vim/plugs.vim
@ -5,18 +7,40 @@ source $DOTFILES/vim/plugs.vim
set encoding=utf-8
scriptencoding utf-8
" Style
set background=dark
"" Style
" enable truecolor mode
if has('termguicolors')
set termguicolors
else
let &t_8f = "\<Esc>[38:2:%lu:%lu:%lum"
let &t_8b = "\<Esc>[48:2:%lu:%lu:%lum"
endif
if !empty($THEME_PREFER_LIGHT)
set background=light
else
set background=dark
endif
let g:gruvbox_contrast_dark='hard'
let g:gruvbox_sign_column='bg0'
" Show some gui colors in term
let g:gruvbox_guisp_fallback='bg'
colorscheme gruvbox
" General stuff
set nowrap
set mouse=a
set relativenumber number
set foldlevelstart=3 foldmethod=syntax nofoldenable "without nofoldenable all folds are closed at startup"
set ttymouse=xterm2 " fix mouse when used in tmux/byobu https://unix.stackexchange.com/q/50733
set mousemodel=popup_setpos " allow for ALE code actions
if has('mouse_sgr') " fixes unclickable panes after a specific column (~220?)
set ttymouse=sgr
else
set ttymouse=xterm2
end
set nobackup nowb noswapfile " no need for backups of every file
set relativenumber number
set foldlevelstart=3 foldmethod=indent nofoldenable "without foldenable all folds are open at startup"
set nobackup nowb noswapfile " no need for backups of every file
set history=10000
set list listchars=tab:\ ,trail:•,extends:#,nbsp:.
@ -29,14 +53,87 @@ set lazyredraw
set ignorecase smartcase " ignore case on search but be smart about it
set hlsearch "highlight search results (using *)
set shiftwidth=4 tabstop=4
set expandtab shiftwidth=4 tabstop=4 "always use spaces
" Completion menu config (see :h completopt)
set completeopt=menu,menuone,noselect,noinsert
" Show completion suggestions in popups instead of preview window
set completeopt+=popup
" Highlight the line the cursor is on
set cursorline
" Minimum fold size
set foldminlines=3
" Timeout for combined keymaps (half a sec)
set timeoutlen=500
" keep history the last 1000 opened files, 200 commands and 50 search
" patterns. `h` persists bookmarks across sessions
set viminfo='1000,<200,s50,h
autocmd FileType qf,ll setlocal wrap "quickfix,loclist
"autocmd FileType markdown setlocal wrap spell spelllang=it,en
autocmd FileType yaml,yml setlocal shiftwidth=2 softtabstop=2 expandtab
autocmd FileType vue setlocal shiftwidth=2 softtabstop=2 expandtab
" Return to last edit position when opening files (from amix's vimrc)
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
autocmd FileType go setlocal noexpandtab makeprg=go\ build
autocmd FileType rust set makeprg=cargo\ build
autocmd FileType python set keywordprg="pydoc"
" Remap VIM 0 to first non-blank character
" map 0 ^
syntax match jsonComment "//.*"
syntax match jsonComment "\(/\*\)\|\(\*/\)"
hi def link jsonComment Comment
augroup dvc
au BufRead dvc.yaml let b:ale_fix_on_save=0
au BufRead *.dvc let b:ale_fix_on_save=0
au BufRead *.dvc set filetype=yaml
augroup END
augroup ansible
au BufRead,BufNewFile */playbooks/*.yml set filetype=yaml.ansible
augroup END
augroup githubactions
au BufRead,BufNewFile */.github/*/*.y{,a}ml
\ let b:ale_linters = {'yaml': ['actionlint'] }
augroup END
augroup iptables
au BufRead,BufNewFile rules.v[46],*.rules setlocal filetype=iptables
augroup END
augroup vimconfig
" Reload vimrc on config change
autocmd! bufwritepost ~/.vimrc source ~/.vimrc
autocmd! bufwritepost $DOTFILES/vim/vimrc source ~/.vimrc
autocmd! bufwritepost $DOTFILES/vim/shortcuts.vim source ~/.vimrc
" Install/Update plugs on change
autocmd! bufwritepost $DOTFILES/vim/plugs.vim PlugInstall
autocmd! bufwritepost $DOTFILES/vim/plugs.vim PlugUpdate
augroup END
if has('persistent_undo')
let undo_dir=$HOME . '/.vim/undo'
if !isdirectory(undo_dir)
call mkdir(undo_dir , 'p', 0700)
endif
let &undodir=undo_dir
set undofile
endif
augroup dotgit
" Return to last edit position when opening files (from amix's vimrc)
au BufReadPost * if ! exists('b:dotgitFolder') | if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
" set a marker to avoid returning to the previous position in .git folders
" (avoids returning to previous position for COMMIT_EDITMSG etc )
au BufReadPost */.git/* let b:dotgitFolder = 1
" do not apply fixers to patches
au BufReadPost .git/*.diff let b:ale_fix_on_save=0
augroup END
" Bash like keys for the command line
cnoremap <C-A> <Home>
@ -46,12 +143,10 @@ cnoremap <C-K> <C-U>
cnoremap <C-P> <Up>
cnoremap <C-N> <Down>
try
set undodir=~/.vim/temp_dirs/undodir
set undofile
catch
endtry
source $DOTFILES/vim/plugins_config.vim
source $DOTFILES/vim/shortcuts.vim
source $DOTFILES/vim/functions.vim
if filereadable('.vimrc.local')
source .vimrc.local
endif

24
zsh_plugins.txt Normal file
View File

@ -0,0 +1,24 @@
# vim:ft=zsh
djui/alias-tips
ohmyzsh/ohmyzsh path:lib
ohmyzsh/ohmyzsh path:plugins/ansible
ohmyzsh/ohmyzsh path:plugins/bgnotify
ohmyzsh/ohmyzsh path:plugins/colored-man-pages
ohmyzsh/ohmyzsh path:plugins/common-aliases
ohmyzsh/ohmyzsh path:plugins/docker
ohmyzsh/ohmyzsh path:plugins/docker-compose
ohmyzsh/ohmyzsh path:plugins/fzf
ohmyzsh/ohmyzsh path:plugins/git
ohmyzsh/ohmyzsh path:plugins/golang
ohmyzsh/ohmyzsh path:plugins/grc
ohmyzsh/ohmyzsh path:plugins/pip
ohmyzsh/ohmyzsh path:plugins/pyenv
ohmyzsh/ohmyzsh path:plugins/pylint
ohmyzsh/ohmyzsh path:plugins/sudo
ohmyzsh/ohmyzsh path:plugins/vagrant
ohmyzsh/ohmyzsh path:plugins/vi-mode
zsh-users/zsh-autosuggestions
zsh-users/zsh-completions
zsh-users/zsh-syntax-highlighting
joshskidmore/zsh-fzf-history-search
ryutok/rust-zsh-completions