Compare commits
280 Commits
741ef20266
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 63ceb40b45 | |||
| 17792f297b | |||
| 61278b8fb3 | |||
| 85165468f5 | |||
| 3fb3b1e521 | |||
| 43f5cc701e | |||
| ffc34d78d7 | |||
| 61ac93b68f | |||
| 411986643a | |||
| 5d88ea6f11 | |||
| fa6c4d786b | |||
| a07473f125 | |||
| 7fd1b35186 | |||
| 38e27e7208 | |||
| f83d453320 | |||
| 4d1b84db3c | |||
| bb76c9fa3a | |||
| 242d0fe094 | |||
| 4567ea177b | |||
| 165c71a2a4 | |||
| f42a896d53 | |||
| c605f61445 | |||
| 783908c5eb | |||
| 966065dd30 | |||
| 01264a395d | |||
| 292a2883be | |||
| 5a50aa540f | |||
| 84e0c7f700 | |||
| a737b50284 | |||
| 608a3bc725 | |||
| 15cf8bc566 | |||
| 2943f5a371 | |||
| 24ce8f39af | |||
| e3d9612e57 | |||
| 05986a30bb | |||
| 05bc2ec59e | |||
| 128ae8ed1e | |||
| f3188f7b4b | |||
| 85d56f97d1 | |||
| afca2cae5d | |||
| d6875c97d9 | |||
| 568e45f59b | |||
| 78fa170e7a | |||
| 5216f7938b | |||
| 0f29dc3054 | |||
| c901a1cea4 | |||
| 6113c086eb | |||
| 470f69fada | |||
| d3a67ab58d | |||
| f79bc5427d | |||
| 4fe60cf861 | |||
| 211da54bcf | |||
| b6d3015559 | |||
| 139089fc9d | |||
| a54e745190 | |||
| 6e48621275 | |||
| f64b634dd8 | |||
| a4bcea8834 | |||
| ec1a76dff1 | |||
| 6c2c452fac | |||
| 6ed4de0b11 | |||
| 58df131415 | |||
| 46e7625928 | |||
| fe5ebec536 | |||
| 20914d33c7 | |||
| 060f6a2f83 | |||
| e36012e0d6 | |||
| f4a17dc0c8 | |||
| 2f29d940f2 | |||
| 4bdbfa0c0d | |||
| ee49296d41 | |||
| e35cf075bf | |||
| 05ee0bf5f1 | |||
| 46543f4eb8 | |||
| 058dc4107c | |||
| b8953fc74a | |||
| b64d22e114 | |||
| 0a50cd90b3 | |||
| 4dbeaccf51 | |||
| df7d2aca6b | |||
| 6b350ab1dd | |||
| b53f1ee586 | |||
| bd4133d5e5 | |||
| 78e6695782 | |||
| 33542630d5 | |||
| 7c44c1cd4e | |||
| bc62524451 | |||
| e70f6f6a5f | |||
| 55306b1d6f | |||
| b5b48016ef | |||
| 6760db72c5 | |||
| 28f6655e2e | |||
| 09288ce752 | |||
| 5afe069edf | |||
| 22e23ba416 | |||
| 5b08b04332 | |||
| 90725931a7 | |||
| 9e3b784168 | |||
| 1bb976d442 | |||
| 37a05500bf | |||
| e8962144e5 | |||
| ae2a439c14 | |||
| 2c7f44ce16 | |||
| b58ff906e9 | |||
| 8046bd1868 | |||
| 800ae0cbde | |||
| 8f2787f439 | |||
| a76fd5cd62 | |||
| e660a92443 | |||
| 958883c21c | |||
| fd11b48fa9 | |||
| 66714ab532 | |||
| 7fb822dbff | |||
| 5e5d88a92a | |||
| f6e525cf53 | |||
| e5fe794c41 | |||
| d576a3f8e7 | |||
| 7149917762 | |||
| 5d2cb51aee | |||
| c88c54b9ca | |||
| e36b04aaa7 | |||
| 8adb4a2add | |||
| 4e928c2306 | |||
| 87bfdb5ba2 | |||
| 21208c1afa | |||
| 80e381f62d | |||
| 0307be8d2c | |||
| a574645fa0 | |||
| d463bd7432 | |||
| 3f685d0753 | |||
| 3e71764fd8 | |||
| 3f5a4427c0 | |||
| e525ea0274 | |||
| a83d0fd28f | |||
| f858f7374b | |||
| 733b37de30 | |||
| b8694ba1c4 | |||
| 999921b86b | |||
| 650e6fc247 | |||
| d20283c8f7 | |||
| e385015238 | |||
| 82b780951d | |||
| 4ca7557e98 | |||
| 454b80aa4e | |||
| e9ad41f94f | |||
| d4ba22670a | |||
| 7e10a1c39d | |||
| 5805c9093f | |||
| ec0e06a805 | |||
| b5365da6ca | |||
| 15f1227522 | |||
| 1f192f94fa | |||
| 04d44eb8dd | |||
| 849c7e97fa | |||
| 83437bd724 | |||
| 9e7524ce5e | |||
| 8d69407d71 | |||
| 2590f238df | |||
| 6c8b99d375 | |||
| 1cdd9ecb81 | |||
| 7540945509 | |||
| 6d3ab7e6b9 | |||
| 3824bd663c | |||
|
f4b69ffd0a
|
|||
| 799dd32950 | |||
| adc550b2ed | |||
| 64b0958236 | |||
| ae567ecb58 | |||
| db5ca355b1 | |||
| 3307434f30 | |||
| 69d5463960 | |||
| 8b893257af | |||
| a758946e82 | |||
| d9603c543c | |||
| e29e6e808c | |||
|
6b444e90e2
|
|||
|
171d56150d
|
|||
|
fc08e2046b
|
|||
| 41c7740c0c | |||
| 1dd6ac51ae | |||
| 2444cba1cb | |||
| 02eab915e7 | |||
| e3517c8dc0 | |||
| 06c90adb7c | |||
| 93a76e7940 | |||
| d2ac9d3822 | |||
| 14b69eb0f8 | |||
| ce21e48fd7 | |||
|
e1f55bed1a
|
|||
|
393e2c5db5
|
|||
|
6cf696e1f6
|
|||
|
78fafd18ee
|
|||
|
ea4bb90bab
|
|||
|
620a5863a3
|
|||
|
227944b184
|
|||
|
8ed805dacf
|
|||
| 21e5d0ac86 | |||
| 0ce01efd46 | |||
| 5a29b672a2 | |||
| 2f4ed6cc51 | |||
| a6a85d1ea5 | |||
| 58478b9b15 | |||
|
0fe4662551
|
|||
|
ed44636981
|
|||
|
72629f5b98
|
|||
|
e771a09fbe
|
|||
|
b6ba9ab4ea
|
|||
|
09812befdc
|
|||
|
f98b19f0b1
|
|||
|
d2bf1ed9bd
|
|||
|
3795d10197
|
|||
|
b0df672009
|
|||
|
42df25d5cc
|
|||
|
ac066bb076
|
|||
|
01842d8f1e
|
|||
|
4b74af8b99
|
|||
|
28d1e36003
|
|||
|
4708739c66
|
|||
|
bb54ec3629
|
|||
|
e9017047cd
|
|||
|
6aefd6bd92
|
|||
|
71d8b33123
|
|||
|
93f223c1ec
|
|||
|
3d1fe7b173
|
|||
|
bab4c612f3
|
|||
|
16c87b6b4c
|
|||
|
892ab35612
|
|||
|
958de4e03c
|
|||
|
fade05a394
|
|||
|
e11085ca91
|
|||
|
4e625a45fa
|
|||
|
2793ac2349
|
|||
|
2e29cb8292
|
|||
|
5e5c5464d3
|
|||
|
f52a222230
|
|||
|
3801186f8b
|
|||
|
e5a61705ee
|
|||
|
d57cff1227
|
|||
|
5b51c48ece
|
|||
|
1ccfb2b8fe
|
|||
|
0092d0793f
|
|||
|
480d1d8434
|
|||
|
6190162e49
|
|||
|
1c8afd0690
|
|||
|
d6d23f913b
|
|||
|
24aeb3ffe3
|
|||
|
1b62acfc80
|
|||
|
ad20848d86
|
|||
|
8e468a30b8
|
|||
|
08fb963ea7
|
|||
|
371a373431
|
|||
|
12cf0754b6
|
|||
|
07c99da684
|
|||
|
7d10e4fda4
|
|||
|
9e71502574
|
|||
| 4c5607d1ed | |||
| 8c7cca7f62 | |||
| df120d9fbb | |||
| 07eec68706 | |||
| 41568b9bc6 | |||
| 54f887f7d4 | |||
| 9297830bcf | |||
| d93fb7fb2a | |||
| 37eeb40184 | |||
| 4f0106ca03 | |||
| fcb1469297 | |||
| 9ab374f38e | |||
|
|
6e091db8fa | ||
| 5a7df6bcd2 | |||
| 4849b64ea5 | |||
| 48681cfd4d | |||
| 0485edf197 | |||
| 0f8704bbb5 | |||
| e8cad0a7a5 | |||
| ea0ec29bce | |||
| 3aa1900aa2 | |||
| 378cd0c389 | |||
| 734896b483 | |||
| 538b613185 | |||
| 47b036b046 |
@@ -1,28 +0,0 @@
|
||||
window:
|
||||
padding:
|
||||
x: 0
|
||||
y: 0
|
||||
font:
|
||||
normal:
|
||||
family: Iosevka Term SS08
|
||||
white: '#d0d0d0'
|
||||
bold:
|
||||
family: Iosevka Term SS08
|
||||
style: bold
|
||||
italic:
|
||||
family: Iosevka Term SS08
|
||||
style: italic
|
||||
size: 12
|
||||
colors:
|
||||
primary:
|
||||
foreground: '0x111111'
|
||||
background: '0xcccccc'
|
||||
normal:
|
||||
black: '0x000000'
|
||||
red: '0xcc3333'
|
||||
green: '0x33cc33'
|
||||
yellow: '0x885800'
|
||||
blue: '0x3333cc'
|
||||
magenta: '0xcc33cc'
|
||||
cyan: '0x33cccc'
|
||||
white: '0xcccccc'
|
||||
@@ -1,26 +1,9 @@
|
||||
# shellcheck shell=bash
|
||||
# vim: set ft=bash :
|
||||
|
||||
# Alias aliases
|
||||
alias al=alias
|
||||
alias alf="alias | fzf"
|
||||
alias al-=unalias
|
||||
|
||||
# Edit configuration files
|
||||
alias eba="nvim ~/.bashrc"
|
||||
alias eal="nvim ~/.bash_aliasrc"
|
||||
alias ev="nvim ~/.vimrc"
|
||||
|
||||
# Navigation
|
||||
alias ..="cd .."
|
||||
alias .2="cd ../.."
|
||||
alias .3="cd ../../.."
|
||||
|
||||
# Colorize output
|
||||
alias ls="ls --color=auto"
|
||||
alias grep="grep --color=auto"
|
||||
alias ip="ip --color"
|
||||
|
||||
# Listing
|
||||
alias l="ls -1p"
|
||||
alias ll="ls -lhp"
|
||||
alias lt="ls -lhtp"
|
||||
@@ -28,7 +11,8 @@ alias la="ls -lhap"
|
||||
alias lta="ls -lhatp"
|
||||
alias ldir="ls -dp" # list directories
|
||||
|
||||
# Safety
|
||||
alias grep="grep --color=auto"
|
||||
|
||||
alias rm="rm -I --preserve-root"
|
||||
alias mv="mv -iv"
|
||||
alias cp="cp -iv"
|
||||
@@ -38,32 +22,32 @@ alias chown="chown --preserve-root"
|
||||
alias chmod="chmod --preserve-root"
|
||||
alias chgrp="chgrp --preserve-root"
|
||||
|
||||
# Clipboard
|
||||
alias clip="xclip -sel clip"
|
||||
alias srclip="clip -o | speedread -w 500"
|
||||
alias ip="ip --color"
|
||||
alias ipa="ip -brief address"
|
||||
alias ipl="ip -brief link"
|
||||
alias ipr="ip route"
|
||||
|
||||
alias clip="xclip -sel clip"
|
||||
|
||||
# Other
|
||||
alias cfg="/usr/bin/git --git-dir=/home/h/.git/ --work-tree=/home/h"
|
||||
alias df="df -kTh"
|
||||
alias fzfpac="pacman -Slq | fzf -m --preview 'pacman -Si {1}' | xargs -ro sudo pacman -S"
|
||||
alias path='echo -e ${PATH//:/\\n}' # Pretty print path variables
|
||||
|
||||
# Programs
|
||||
alias h="history"
|
||||
alias o="xdg-open"
|
||||
alias v="nvim"
|
||||
alias zk='cd ~/.zk && nvim "$(cat ~/.zk/current-zettel.txt)"'
|
||||
alias vf="fzf --bind 'enter:become(nvim {})'"
|
||||
alias g='git'
|
||||
alias t=' task'
|
||||
alias k="kubectl"
|
||||
alias t='task'
|
||||
alias tsh='tasksh'
|
||||
alias z='zathura --fork'
|
||||
alias f='fzf'
|
||||
alias fm='pcmanfm &>/dev/null &'
|
||||
alias xev='xev | grep -A2 ButtonPress' # Ignore mouse movements
|
||||
alias mm='micromamba'
|
||||
|
||||
# Languages
|
||||
alias js="node"
|
||||
alias ts="ts-node"
|
||||
alias r5="plt-r5rs --no-prim"
|
||||
alias hs="ghci"
|
||||
alias pl="swipl"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# shellcheck shell=bash
|
||||
# vim: set ft=bash :
|
||||
|
||||
reboot-to-windows ()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# shellcheck shell=bash
|
||||
# vim: set ft=bash :
|
||||
|
||||
source "$HOME/.bash_aliases/dualboot"
|
||||
|
||||
alias lm='ddcutil setvcp 10'
|
||||
|
||||
alias cuda-available='python -c "import torch; print(\"CUDA enabled:\", torch.cuda.is_available());"'
|
||||
@@ -1,3 +1,4 @@
|
||||
# shellcheck shell=bash
|
||||
# vim: set ft=bash :
|
||||
|
||||
source "$HOME/.bash_aliases/dualboot"
|
||||
35
.bash_aliases/lang-js
Normal file
35
.bash_aliases/lang-js
Normal file
@@ -0,0 +1,35 @@
|
||||
# shellcheck shell=bash
|
||||
# vim: set ft=bash :
|
||||
|
||||
alias js="node"
|
||||
alias ts="ts-node"
|
||||
|
||||
yarn() {
|
||||
if [[ -f "package-lock.json" ]]; then
|
||||
echo "WARNING: package-lock.json exists"
|
||||
read -p "Are you sure you want to run yarn? [y/N] " -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
command yarn "$@"
|
||||
else
|
||||
echo "Aborted"
|
||||
fi
|
||||
else
|
||||
command yarn "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
npm() {
|
||||
if [[ -f "yarn.lock" ]]; then
|
||||
echo "WARNING: yarn.lock exists"
|
||||
read -p "Are you sure you want to run npm? [y/N] " -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
command npm "$@"
|
||||
else
|
||||
echo "Aborted"
|
||||
fi
|
||||
else
|
||||
command npm "$@"
|
||||
fi
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
# shellcheck shell=bash
|
||||
# shellcheck disable=SC1090
|
||||
[[ -f ~/.bashrc ]] && . ~/.bashrc
|
||||
|
||||
export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR}/ssh-agent.socket"
|
||||
export _JAVA_AWT_WM_NONREPARENTING=1
|
||||
|
||||
if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
|
||||
exec startx "$HOME/.config/X11/xinitrc"
|
||||
if [[ -z "${DISPLAY}" ]] && [[ "${XDG_VTNR}" -eq 1 ]]; then
|
||||
exec startx "$HOME/.config/X11/xinitrc" >& ~/.xsession-errors
|
||||
fi
|
||||
|
||||
119
.bashrc
119
.bashrc
@@ -1,37 +1,34 @@
|
||||
# shellcheck shell=bash
|
||||
# shellcheck disable=SC1091,SC1090
|
||||
# If not running interactively, don't do anything
|
||||
[[ $- != *i* ]] && return
|
||||
|
||||
source /etc/os-release
|
||||
. /etc/os-release
|
||||
|
||||
# Editor & prompt configuration
|
||||
[ -f "$HOME/.bashrc.d/editor" ] && . "$HOME/.bashrc.d/editor"
|
||||
[ -f "$HOME/.bashrc.d/prompt" ] && . "$HOME/.bashrc.d/prompt"
|
||||
|
||||
# Aliases {{{
|
||||
# Load aliases dynamically
|
||||
[ -f "$HOME/.bash_aliases/all" ] && source "$HOME/.bash_aliases/all"
|
||||
[ -f "$HOME/.bash_aliases/$HOSTNAME" ] && source "$HOME/.bash_aliases/$HOSTNAME"
|
||||
[ -f "$HOME/.bash_aliases/private" ] && source "$HOME/.bash_aliases/private"
|
||||
[ -f "$HOME/.bash_aliases/all" ] && . "$HOME/.bash_aliases/all"
|
||||
[ -f "$HOME/.bash_aliases/hosts/$HOSTNAME" ] && . "$HOME/.bash_aliases/hosts/$HOSTNAME"
|
||||
[ -f "$HOME/.bash_aliases/private" ] && . "$HOME/.bash_aliases/private"
|
||||
[ -f "$HOME/.bash_aliases/lang-js" ] && . "$HOME/.bash_aliases/lang-js"
|
||||
|
||||
# Completions {{{
|
||||
[ -d "$HOME/.bash_completions" ] && for file in "$HOME/.bash_completions"/*; do
|
||||
[ -f "$file" ] && . "$file"
|
||||
done
|
||||
# }}}
|
||||
|
||||
# Dynamic configuration {{{
|
||||
[ -f "$HOME/.bashrc.d/$HOSTNAME" ] && source "$HOME/.bashrc.d/$HOSTNAME"
|
||||
[ -f "$HOME/.bashrc.d/private" ] && source "$HOME/.bashrc.d/private"
|
||||
# Host-specific and private configurations
|
||||
[ -f "$HOME/.bashrc.d/hosts/$HOSTNAME" ] && . "$HOME/.bashrc.d/hosts/$HOSTNAME"
|
||||
[ -f "$HOME/.bashrc.d/private" ] && . "$HOME/.bashrc.d/private"
|
||||
# }}}
|
||||
|
||||
# Prompt {{{
|
||||
get_branch_name() {
|
||||
git symbolic-ref --quiet --short HEAD 2>/dev/null \
|
||||
|| git rev-parse --short HEAD 2>/dev/null \
|
||||
|| echo 'some branch'
|
||||
}
|
||||
get_git_info() {
|
||||
git rev-parse --is-inside-work-tree &>/dev/null || return
|
||||
echo -e " $(get_branch_name)"
|
||||
}
|
||||
|
||||
PS1="\u \w ❭\[$(tput sgr0)\] "
|
||||
|
||||
# Ellipsis when deep in directory
|
||||
export PROMPT_DIRTRIM=2
|
||||
|
||||
export PS1
|
||||
[ -f "$HOME/.bashrc.d/prompt" ] && . "$HOME/.bashrc.d/prompt"
|
||||
# }}}
|
||||
|
||||
# Path {{{
|
||||
@@ -40,46 +37,30 @@ export PATH=~/.bin:$PATH
|
||||
# }}}
|
||||
|
||||
# History {{{
|
||||
export HISTSIZE=999999
|
||||
export HISTFILESIZE= # Unlimited
|
||||
export HISTCONTROL=ignoreboth:erasedups
|
||||
export HISTSIZE=500000
|
||||
# Omit `clear, ls...`; commands prepended with space
|
||||
export HISTIGNORE="clear:l: *"
|
||||
export HISTIGNORE=" *:clear:l:ls:cd" # Omit commands from history (e.g. those prepended with space)
|
||||
# }}}
|
||||
|
||||
# Man pages {{{
|
||||
# See `:h :Man` in NeoVim
|
||||
export MANWIDTH=999
|
||||
# export MANPAGER='nvim +Man!'
|
||||
export MANWIDTH=80
|
||||
export PAGER=nvimpager
|
||||
# }}}
|
||||
|
||||
# Editor {{{
|
||||
# Set vim as default editor
|
||||
export EDITOR=nvim
|
||||
export SUDO_EDITOR=nvim
|
||||
# }}}
|
||||
|
||||
# Nvm
|
||||
export PATH=~/.nvm/versions/node/v14.16.0/bin:$PATH
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
[[ -s "$NVM_DIR/nvm.sh" ]] && source "$NVM_DIR/nvm.sh" --no-use
|
||||
|
||||
# X11 {{{
|
||||
export XDG_SESSION_TYPE=X11
|
||||
export XDG_CONFIG_HOME=$HOME/.config
|
||||
export XDG_DATA_HOME=$HOME/.local/share
|
||||
# }}}
|
||||
|
||||
# Nix package manager {{{
|
||||
# Add ~/.nix-profile/bin to PATH
|
||||
export PATH=~/.nix-profile/bin:$PATH
|
||||
# }}}
|
||||
|
||||
# FZF {{{
|
||||
# Check if fzf is installed
|
||||
if [ -f "/usr/bin/fzf" ]; then
|
||||
# Fuzzy finder setup
|
||||
export FZF_COMPLETION_TRIGGER='**'
|
||||
export FZF_DEFAULT_COMMAND='ag --hidden --skip-vcs-ignores -t -g ""'
|
||||
export FZF_DEFAULT_COMMAND='ag -g ""'
|
||||
export FZF_DEFAULT_OPTS="
|
||||
--pointer='❭'
|
||||
--height 10%
|
||||
@@ -88,11 +69,11 @@ if [ -f "/usr/bin/fzf" ]; then
|
||||
export FZF_CTRL_T_OPTS="--preview='bat {} | head -500'"
|
||||
|
||||
if [[ $ID == "raspbian" ]]; then
|
||||
source /usr/share/doc/fzf/examples/completion.bash
|
||||
source /usr/share/doc/fzf/examples/key-bindings.bash
|
||||
. /usr/share/doc/fzf/examples/completion.bash
|
||||
. /usr/share/doc/fzf/examples/key-bindings.bash
|
||||
elif [[ $ID == "arch" ]]; then
|
||||
source /usr/share/fzf/completion.bash
|
||||
source /usr/share/fzf/key-bindings.bash
|
||||
. /usr/share/fzf/completion.bash
|
||||
. /usr/share/fzf/key-bindings.bash
|
||||
fi
|
||||
|
||||
_fzf_setup_completion path vim zathura xournalpp nvim mpv
|
||||
@@ -101,14 +82,8 @@ else
|
||||
fi
|
||||
# }}}
|
||||
|
||||
# Node {{{
|
||||
# Move nvm folder away from home directory
|
||||
export NVM_DIR="${XDG_CONFIG_HOME}/nvm"
|
||||
# Pretty much what is in `/usr/share/nvm/init-nvm.sh` but we add the `--no-use`
|
||||
# flag to `nvm.sh` to make it lazy
|
||||
source /usr/share/nvm/nvm.sh --no-use
|
||||
source /usr/share/nvm/bash_completion
|
||||
source /usr/share/nvm/install-nvm-exec
|
||||
# Go {{{
|
||||
export GOPATH="${XDG_DATA_HOME}/go"
|
||||
# }}}
|
||||
|
||||
# Jupyter {{{
|
||||
@@ -116,8 +91,36 @@ export JUPYTERLAB_DIR=$HOME/.local/share/jupyter/lab
|
||||
# }}}
|
||||
|
||||
# Conda {{{
|
||||
[ -f /opt/miniconda3/etc/profile.d/conda.sh ] && source /opt/miniconda3/etc/profile.d/conda.sh
|
||||
[ -f /opt/miniconda3/etc/profile.d/conda.sh ] && . /opt/miniconda3/etc/profile.d/conda.sh
|
||||
# }}}
|
||||
|
||||
# Zettelkasten {{{
|
||||
export ZK_PATH="$HOME/.zk"
|
||||
|
||||
# SSH Agent {{{
|
||||
if [[ -z "${SSH_CONNECTION}" ]]; then
|
||||
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
|
||||
fi
|
||||
# }}}
|
||||
|
||||
# pnpm
|
||||
export PNPM_HOME="/home/h/.local/share/pnpm"
|
||||
case ":$PATH:" in
|
||||
*":$PNPM_HOME:"*) ;;
|
||||
*) export PATH="$PNPM_HOME:$PATH" ;;
|
||||
esac
|
||||
# pnpm end
|
||||
|
||||
# Codi
|
||||
# Usage: codi [filetype] [filename]
|
||||
codi() {
|
||||
local syntax="${1:-python}"
|
||||
shift
|
||||
nvim -c \
|
||||
"let g:startify_disable_at_vimenter = 1 |\
|
||||
set bt=nofile ls=0 noru nonu nornu |\
|
||||
hi ColorColumn ctermbg=NONE |\
|
||||
hi VertSplit ctermbg=NONE |\
|
||||
hi NonText ctermfg=0 |\
|
||||
Codi $syntax" "$@"
|
||||
}
|
||||
|
||||
19
.bashrc.d/editor
Normal file
19
.bashrc.d/editor
Normal file
@@ -0,0 +1,19 @@
|
||||
# shellcheck shell=bash
|
||||
# vim: set ft=bash :
|
||||
|
||||
# Set NeoVim as default editor
|
||||
export EDITOR=nvim
|
||||
export SUDO_EDITOR="$EDITOR"
|
||||
|
||||
declare -A -r EDITOR_CONFIGS=(
|
||||
["nvim"]="$HOME/.config/nvim/init.lua"
|
||||
["vim"]="$HOME/.vimrc"
|
||||
)
|
||||
|
||||
edit_editor_config() {
|
||||
for editor in "${!EDITOR_CONFIGS[@]}"; do
|
||||
if [ "$EDITOR" = "$editor" ]; then
|
||||
$EDITOR "${EDITOR_CONFIGS[$editor]}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
# Laptop configuration
|
||||
19
.bashrc.d/hosts/flex-arch
Normal file
19
.bashrc.d/hosts/flex-arch
Normal file
@@ -0,0 +1,19 @@
|
||||
# shellcheck shell=bash
|
||||
# vim: set ft=bash :
|
||||
|
||||
# >>> mamba initialize >>>
|
||||
# !! Contents within this block are managed by 'mamba init' !!
|
||||
export MAMBA_EXE="/usr/bin/micromamba";
|
||||
export MAMBA_ROOT_PREFIX="/home/h/.local/share/micromamba";
|
||||
__mamba_setup="$("$MAMBA_EXE" shell hook --shell bash --prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)"
|
||||
if [ $? -eq 0 ]; then
|
||||
eval "$__mamba_setup"
|
||||
else
|
||||
if [ -f "/home/h/.local/share/micromamba/etc/profile.d/micromamba.sh" ]; then
|
||||
. "/home/h/.local/share/micromamba/etc/profile.d/micromamba.sh"
|
||||
else
|
||||
export PATH="/home/h/.local/share/micromamba/bin:$PATH" # extra space after export prevents interference from conda init
|
||||
fi
|
||||
fi
|
||||
unset __mamba_setup
|
||||
# <<< mamba initialize <<<
|
||||
22
.bashrc.d/prompt
Normal file
22
.bashrc.d/prompt
Normal file
@@ -0,0 +1,22 @@
|
||||
# shellcheck shell=bash
|
||||
# vim: set ft=bash :
|
||||
|
||||
get_branch_name() {
|
||||
git symbolic-ref --quiet --short HEAD 2>/dev/null \
|
||||
|| git rev-parse --short HEAD 2>/dev/null \
|
||||
|| echo 'some branch'
|
||||
}
|
||||
get_git_info() {
|
||||
git rev-parse --is-inside-work-tree &>/dev/null || return
|
||||
echo -e "($(get_branch_name))"
|
||||
}
|
||||
|
||||
if [[ $SSH_CONNECTION ]]; then
|
||||
PS1='\[\033[01;31m\]\u@\h\[\033[00m\] $(get_git_info)\W❭\[$(tput sgr0)\] '
|
||||
else
|
||||
PS1='\u $(get_git_info)\W❭\[$(tput sgr0)\] '
|
||||
fi
|
||||
|
||||
# Ellipsis when deep in directory
|
||||
export PROMPT_DIRTRIM=2
|
||||
export PS1
|
||||
@@ -20,7 +20,7 @@ chmod +x <script>
|
||||
## Notes
|
||||
|
||||
Statusbar scripts are prefixed with `sb` under the assumption you're using
|
||||
`dwmblocks` (scripts my need changes to be used with different statusbars).
|
||||
`polybar` (scripts my need changes to be used with different statusbars).
|
||||
|
||||
Some scripts have dependencies (e.g. `fzf`, `jq`, `xclip`, ...), make sure you
|
||||
have them installed.
|
||||
|
||||
3
.bin/calc
Executable file
3
.bin/calc
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/usr/env/bin bash
|
||||
|
||||
ipython -i /home/h/.bin/calc.py
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
options="Mouse\nHeadphones"
|
||||
|
||||
selected="$(echo -e "$options" | dmenu -i)"
|
||||
|
||||
case "$selected" in
|
||||
"Mouse") toggle-bt-device E4:19:21:56:C8:70;;
|
||||
"Headphones") toggle-bt-device 38:18:4C:D4:74:42;;
|
||||
esac
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Open pdf by title
|
||||
# Note: does not handle incorrect metadata
|
||||
|
||||
dir=/home/h/doc/books
|
||||
|
||||
ag -g ".pdf$" $dir \
|
||||
| xargs -n1 -d '\n' pdfinfo 2> /dev/null \
|
||||
| grep "Title: " \
|
||||
| awk '{for (i=2; i<NF; i++) printf $i " "; printf $NF; printf "\n"}' \
|
||||
| grep -v "Title:"\
|
||||
| dmenu -i -p "Read:"
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
options="Play\nPause\nNext\nPrevious"
|
||||
|
||||
selected=$(echo -e "$options" | dmenu -i)
|
||||
|
||||
case "$selected" in
|
||||
"Play") playerctl --player=ncspot play;;
|
||||
"Pause") playerctl --player=ncspot pause;;
|
||||
"Next") playerctl --player=ncspot next;;
|
||||
"Previous") playerctl --player=ncspot previous;;
|
||||
esac
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
options="nl:en\nen:nl\nnl:fr\nfr:nl\nen:fr\nfr:en\nnl:de\nde:nl"
|
||||
|
||||
selected=$(echo -e "$options" | dmenu -p "s?:t?" -i -l 0)
|
||||
|
||||
notify-send --app-name= -t 3000 "$(trans "$selected" -b "$(dmenu -p "$selected" &)" \
|
||||
| tr -d '\n' \
|
||||
| xclip -sel clip -f)"
|
||||
@@ -3,8 +3,12 @@
|
||||
# Generate menu of book filenames and save paths
|
||||
# Preview window contains metadata
|
||||
|
||||
function get_book_paths {
|
||||
find /home/h/doc/books/ -regex '.*\.\(pdf\|epub\|djvu\)' -type f | sort
|
||||
}
|
||||
|
||||
function select_file {
|
||||
echo "$(find /home/h/doc/books/ -regex '.*\.\(pdf\|epub\|djvu\)' -type f | sort | fzf --delimiter=/ --with-nth=-1)"
|
||||
get_book_paths | fzf --delimiter=/ --with-nth=-1
|
||||
}
|
||||
|
||||
function open {
|
||||
@@ -22,3 +26,5 @@ case "$1" in
|
||||
--help) printf "open \n" >&2 ;;
|
||||
*) open "$(select_file)" ;;
|
||||
esac
|
||||
|
||||
[[ -n "$selected" ]] && xdg-open "$selected" &> /dev/null & disown
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Find and open Xournal sketch
|
||||
|
||||
selected=$(ls ~/sketches/*.xopp | fzf)
|
||||
|
||||
xournalpp "$selected" &
|
||||
3
.bin/fzf-ssh
Executable file
3
.bin/fzf-ssh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
ssh "$(ssh-hosts | fzf)"
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
curl localhost:8765 -X POST -d '{"action": "deckNames", "version": 6}' | jq '.result[]' -r
|
||||
curl 127.0.0.1:8765 -X POST -d '{"action": "deckNames", "version": 6}' | jq '.result[]' -r
|
||||
|
||||
221
.bin/git-cb
Executable file
221
.bin/git-cb
Executable file
@@ -0,0 +1,221 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
readonly ALLOWED_MAIN_BRANCHES=("main" "master" "develop")
|
||||
readonly BRANCH_TYPES=(
|
||||
"feat For new features"
|
||||
"hotfix For urgent fixes"
|
||||
"fix For fixes"
|
||||
"release For preparing releases"
|
||||
"chore For non-code tasks"
|
||||
)
|
||||
|
||||
error() {
|
||||
echo "Error: $1" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
warn() {
|
||||
echo "Warning: $1" >&2
|
||||
}
|
||||
|
||||
check_dependencies() {
|
||||
local missing=()
|
||||
for cmd in git fzf; do
|
||||
if ! command -v "$cmd" &> /dev/null; then
|
||||
missing+=("$cmd")
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ ${#missing[@]} -gt 0 ]]; then
|
||||
error "Missing required commands: ${missing[*]}"
|
||||
fi
|
||||
}
|
||||
|
||||
check_git_repo() {
|
||||
if ! git rev-parse --git-dir &> /dev/null; then
|
||||
error "Not in a git repository"
|
||||
fi
|
||||
}
|
||||
|
||||
check_current_branch() {
|
||||
local current_branch
|
||||
current_branch=$(git branch --show-current)
|
||||
|
||||
local is_main_branch=false
|
||||
for branch in "${ALLOWED_MAIN_BRANCHES[@]}"; do
|
||||
if [[ "$current_branch" == "$branch" ]]; then
|
||||
is_main_branch=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ "$is_main_branch" == false ]]; then
|
||||
warn "Not branching from a main branch (current: $current_branch)"
|
||||
read -rp "Continue anyway? [y/N] " response
|
||||
if [[ ! "$response" =~ ^[Yy]$ ]]; then
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
get_user_email() {
|
||||
local email
|
||||
email=$(git config --get user.email 2>/dev/null)
|
||||
|
||||
if [[ -z "$email" ]]; then
|
||||
error "Git user email not configured. Run: git config user.email 'your@email.com'"
|
||||
fi
|
||||
|
||||
echo "$email"
|
||||
}
|
||||
|
||||
select_branch_type() {
|
||||
local selected
|
||||
selected=$(printf '%s\n' "${BRANCH_TYPES[@]}" | \
|
||||
fzf --prompt="Select branch type: " \
|
||||
--height=40% \
|
||||
--border \
|
||||
--info=inline) || error "Branch type selection cancelled"
|
||||
|
||||
echo "${selected%% *}"
|
||||
}
|
||||
|
||||
select_jira_ticket() {
|
||||
local email=$1
|
||||
|
||||
if ! command -v jira &> /dev/null; then
|
||||
warn "Jira CLI not found. Proceeding without ticket ID."
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "Fetching Jira tickets for $email..." >&2
|
||||
local jira_data
|
||||
jira_data=$(jira issue list --assignee="$email" --order-by=priority --plain --no-headers 2>/dev/null) || {
|
||||
warn "Could not fetch Jira tickets. Proceeding without ticket ID."
|
||||
return 0
|
||||
}
|
||||
|
||||
if [[ -z "$jira_data" ]]; then
|
||||
warn "No Jira tickets found. Proceeding without ticket ID."
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "$jira_data" >&2
|
||||
echo "" >&2
|
||||
|
||||
local formatted_tickets
|
||||
formatted_tickets=$(echo "$jira_data" | awk '{
|
||||
ticket_id = $2
|
||||
$1 = $2 = ""
|
||||
description = $0
|
||||
gsub(/^[ \t]+/, "", description)
|
||||
if (length(description) > 60) {
|
||||
description = substr(description, 1, 57) "..."
|
||||
}
|
||||
print ticket_id " - " description
|
||||
}')
|
||||
|
||||
if [[ -z "$formatted_tickets" ]]; then
|
||||
warn "No tickets to display. Proceeding without ticket ID."
|
||||
return 0
|
||||
fi
|
||||
|
||||
local selected_ticket
|
||||
selected_ticket=$(echo -e "SKIP - Create branch without ticket ID\n$formatted_tickets" | \
|
||||
fzf --prompt="Select Jira ticket (or skip): " \
|
||||
--height=40% \
|
||||
--border \
|
||||
--info=inline) || error "Ticket selection cancelled"
|
||||
|
||||
if [[ "$selected_ticket" != "SKIP"* ]]; then
|
||||
echo "${selected_ticket%% -*}"
|
||||
fi
|
||||
}
|
||||
|
||||
get_branch_description() {
|
||||
local ticket_id=$1
|
||||
local editor="${EDITOR:-vi}"
|
||||
local tmpfile
|
||||
tmpfile=$(mktemp)
|
||||
|
||||
trap "rm -f '$tmpfile'" EXIT
|
||||
|
||||
if [[ -n "$ticket_id" ]]; then
|
||||
cat > "$tmpfile" << EOF
|
||||
# Selected ticket: $ticket_id
|
||||
# Enter your branch description below in kebab-case (e.g., my-description):
|
||||
# The ticket ID will be automatically included in the branch name.
|
||||
# Lines starting with # will be ignored.
|
||||
|
||||
EOF
|
||||
else
|
||||
cat > "$tmpfile" << 'EOF'
|
||||
# Enter your branch description below in kebab-case (e.g., my-description):
|
||||
# Lines starting with # will be ignored.
|
||||
|
||||
EOF
|
||||
fi
|
||||
|
||||
"$editor" "$tmpfile" < /dev/tty > /dev/tty
|
||||
|
||||
local desc
|
||||
desc=$(grep -v '^#' "$tmpfile" | tr -d '\n' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
||||
|
||||
echo "$desc"
|
||||
}
|
||||
|
||||
validate_description() {
|
||||
local desc=$1
|
||||
|
||||
if [[ -z "$desc" ]]; then
|
||||
error "No description provided"
|
||||
fi
|
||||
|
||||
if [[ ! "$desc" =~ ^[a-z0-9]+(-[a-z0-9]+)*$ ]]; then
|
||||
error "Invalid branch description format.\nUse lowercase letters, numbers, and hyphens only.\nNo trailing or consecutive hyphens allowed.\nExample: my-feature-description"
|
||||
fi
|
||||
}
|
||||
|
||||
create_branch() {
|
||||
local type=$1
|
||||
local ticket_id=$2
|
||||
local desc=$3
|
||||
|
||||
local branch
|
||||
if [[ -n "$ticket_id" ]]; then
|
||||
branch="$type/$ticket_id-$desc"
|
||||
else
|
||||
branch="$type/$desc"
|
||||
fi
|
||||
|
||||
if git show-ref --verify --quiet "refs/heads/$branch"; then
|
||||
error "Branch '$branch' already exists"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Creating branch: $branch"
|
||||
git checkout -b "$branch"
|
||||
}
|
||||
|
||||
main() {
|
||||
check_dependencies
|
||||
check_git_repo
|
||||
check_current_branch
|
||||
|
||||
local email
|
||||
email=$(get_user_email)
|
||||
|
||||
local type
|
||||
type=$(select_branch_type)
|
||||
|
||||
echo "About to call select_jira_ticket" >&2
|
||||
local ticket_id=""
|
||||
ticket_id=$(select_jira_ticket "$email")
|
||||
local desc
|
||||
desc=$(get_branch_description "$ticket_id")
|
||||
validate_description "$desc"
|
||||
create_branch "$type" "$ticket_id" "$desc"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
101
.bin/pomo
101
.bin/pomo
@@ -1,11 +1,12 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
# vim: set filetype=python:
|
||||
"""
|
||||
Pomodoro timer
|
||||
|
||||
# Pomodoro timer
|
||||
#
|
||||
# - Writes pomodoro timer to temporary file so dwmblocks
|
||||
# statusbar can read it
|
||||
# - Notification on session finish
|
||||
# - Notification on break finish
|
||||
- Writes pomodoro timer to temporary file so statusbar can read it
|
||||
- Notification on session finish
|
||||
- Notification on break finish
|
||||
"""
|
||||
|
||||
import os
|
||||
import atexit
|
||||
@@ -13,56 +14,66 @@ from argparse import ArgumentParser
|
||||
from time import sleep
|
||||
from plyer import notification
|
||||
|
||||
POMO_PATH = os.path.join(os.getenv("XDG_DATA_HOME", os.path.expanduser("~/.local/share")), "pomo")
|
||||
|
||||
@atexit.register
|
||||
def clear():
|
||||
os.system('echo -n "" > /tmp/pomo')
|
||||
if os.path.exists(POMO_PATH):
|
||||
os.remove(POMO_PATH)
|
||||
|
||||
def format_mins_secs(mins, secs):
|
||||
return f"{mins:02d}:{secs:02d}"
|
||||
|
||||
|
||||
atexit.register(clear)
|
||||
|
||||
parser = ArgumentParser()
|
||||
|
||||
parser.add_argument('-p', '--prep-duration', type=int,
|
||||
help='Pre session duration', default=0)
|
||||
parser.add_argument('-w', '--work-duration', type=int,
|
||||
help='Session duration', default=25)
|
||||
parser.add_argument('-b', '--break-duration', type=int,
|
||||
help='Break duration', default=5)
|
||||
parser.add_argument('-r', '--repeats', type=int,
|
||||
help='Numer of sessions', default=1)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
prep_duration = args.prep_duration * 60
|
||||
work_duration = args.work_duration * 60
|
||||
break_duration = args.break_duration * 60
|
||||
repeats = args.repeats
|
||||
|
||||
|
||||
def make_countdown(color="#000000"):
|
||||
def make_countdown():
|
||||
def countdown(duration):
|
||||
while duration != 0:
|
||||
mins = duration // 60
|
||||
secs = duration % 60
|
||||
# os.system('echo -n "{:s} {:02d}:{:02d} \x01" > /tmp/pomo'.format(color, mins, secs))
|
||||
os.system(
|
||||
'echo -n "<fc={:s}> {:02d}:{:02d} </fc>" > /tmp/pomo'.format(color, mins, secs))
|
||||
time_str = format_mins_secs(mins, secs)
|
||||
os.system(f'echo -n "{time_str}" > {POMO_PATH}')
|
||||
sleep(1)
|
||||
duration -= 1
|
||||
return countdown
|
||||
|
||||
|
||||
prep_countdown = make_countdown("#0000aa")
|
||||
work_countdown = make_countdown("#aa0000")
|
||||
break_countdown = make_countdown("#00bb00")
|
||||
def main(args):
|
||||
work_duration = args.work_duration * 60
|
||||
break_duration = args.break_duration * 60
|
||||
repeats = args.repeats
|
||||
|
||||
prep_countdown(prep_duration)
|
||||
work_countdown = make_countdown()
|
||||
break_countdown = make_countdown()
|
||||
|
||||
while repeats != 0:
|
||||
notification.notify(title="Get started")
|
||||
work_countdown(work_duration)
|
||||
if break_duration != 0:
|
||||
notification.notify(title="Time for a break")
|
||||
break_countdown(break_duration)
|
||||
notification.notify(title="Break is over, back to work")
|
||||
repeats -= 1
|
||||
while repeats != 0:
|
||||
notification.notify(title="Get started")
|
||||
work_countdown(work_duration)
|
||||
if break_duration != 0:
|
||||
notification.notify(title="Time for a break")
|
||||
break_countdown(break_duration)
|
||||
notification.notify(title="Break is over, back to work")
|
||||
repeats -= 1
|
||||
|
||||
|
||||
def handle_signal(signal, frame):
|
||||
# Wait for clear to finish
|
||||
clear()
|
||||
print('Exiting')
|
||||
exit(0)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
parser = ArgumentParser()
|
||||
parser.add_argument('-w', '--work-duration', type=int,
|
||||
help='Session duration', default=25)
|
||||
parser.add_argument('-b', '--break-duration', type=int,
|
||||
help='Break duration', default=5)
|
||||
parser.add_argument('-r', '--repeats', type=int,
|
||||
help='Numer of sessions', default=1)
|
||||
parser.add_argument('-c', '--clear', action='store_true',
|
||||
help='Clear timer')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
main(args)
|
||||
|
||||
19
.bin/restore-passwddb
Executable file
19
.bin/restore-passwddb
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Backup existing password databases and
|
||||
# database keys (using date in filename date -u
|
||||
# +%Y-%m-%d_%H-%M-%S)
|
||||
|
||||
RCLONE_REMOTE="proton-drive"
|
||||
|
||||
for f in "$HOME/doc"/*.{kdbx,kdbx.key}; do
|
||||
[ -e "$f" ] || continue
|
||||
echo "Backing up $f to $f-$(date -u +%Y-%m-%d_%H-%M-%S)"
|
||||
cp "$f" "$f-$(date -u +%Y-%m-%d_%H-%M-%S)"
|
||||
done
|
||||
|
||||
echo "Restoring KeePassXC databases and database keys"
|
||||
rclone copyto \
|
||||
"$RCLONE_REMOTE:doc"/ "$HOME/doc/" \
|
||||
--progress \
|
||||
--include "/*.{kdbx,kdbx.key}"
|
||||
13
.bin/rofi-trans
Executable file
13
.bin/rofi-trans
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
options="nl:en\nen:nl\nnl:fr\nfr:nl\nen:fr\nfr:en\nnl:de\nde:nl"
|
||||
|
||||
selected=$(echo -en "$options" | rofi -dmenu -p "source?:target?" -i)
|
||||
|
||||
# notify-send --app-name= -t 3000 "$(trans "$selected" -b "$(rofi -dmenu -p "$selected" &)" \
|
||||
# | tr -d '\n' \
|
||||
# | xclip -sel clip -f)"
|
||||
|
||||
translation="$(trans "$selected" -b "$(rofi -dmenu -p "$selected" &)" | tr -d '\n')"
|
||||
|
||||
echo -e "Copy" | rofi -p "translation" -dmenu -i -mesg "$translation" | xargs -I{} echo -n "$translation" | xclip -selection clipboard
|
||||
@@ -2,15 +2,74 @@
|
||||
|
||||
# Save (encrypted) password database to cloud storage
|
||||
#
|
||||
# Can be run manually or daily by enabling the corresponding systemd user
|
||||
# service and timer, i.e.
|
||||
#
|
||||
# `systemctl --user enable save-passwddb.service`
|
||||
# `systemctl --user enable save-passwddb.timer`
|
||||
# Usage:
|
||||
# save-passwddb - Save databases to cloud
|
||||
# save-passwddb init - Restore databases from cloud (with single backup archive)
|
||||
|
||||
if [ -f "$HOME/doc/passwd.kdbx" ]; then
|
||||
rclone copy "$HOME/doc/passwd.kdbx" google-drive:
|
||||
else
|
||||
echo "Password database not found, use 'rclone copy google-drive:passwd.kdbx $HOME/doc/passwd.kdbx' to restore"
|
||||
exit 1
|
||||
fi
|
||||
RCLONE_REMOTE="proton"
|
||||
SOURCE_DIR="$HOME/doc"
|
||||
TARGET_DIR="$RCLONE_REMOTE:doc"
|
||||
BACKUP_DIR="$HOME/doc/bak"
|
||||
|
||||
function save_databases() {
|
||||
if [ 0 -lt "$(ls $SOURCE_DIR/*.kdbx 2>/dev/null | wc -w)" ]; then
|
||||
echo "[save] Saving KeePassXC databases and database keys"
|
||||
rclone copy "$SOURCE_DIR" "$TARGET_DIR" \
|
||||
--include "/*.{kdbx,kdbx.key}" \
|
||||
--progress
|
||||
echo "[save] Done"
|
||||
else
|
||||
echo "[save] No password database found, restore with:"
|
||||
echo ""
|
||||
echo " $0 init"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function backup_existing() {
|
||||
mkdir -p "$BACKUP_DIR"
|
||||
local timestamp=$(date +%Y%m%d-%H%M%S)
|
||||
local backup_file="$BACKUP_DIR/passwddb_backup_${timestamp}.tar.gz"
|
||||
|
||||
echo "[backup] Creating backup archive: ${backup_file}"
|
||||
tar -czf "$backup_file" -C "$SOURCE_DIR" $(find "$SOURCE_DIR" -maxdepth 1 -type f \( -name "*.kdbx" -o -name "*.kdbx.key" \) -printf "%f ")
|
||||
echo "[backup] Backup complete"
|
||||
}
|
||||
|
||||
function restore_databases() {
|
||||
echo "[init] Checking for existing files..."
|
||||
|
||||
local existing_files=$(find "$SOURCE_DIR" -maxdepth 1 -type f \( -name "*.kdbx" -o -name "*.kdbx.key" \) -print)
|
||||
|
||||
if [ -n "$existing_files" ]; then
|
||||
echo "[init] Found existing database files:"
|
||||
echo "$existing_files" | while read -r file; do
|
||||
echo " - $file"
|
||||
done
|
||||
read -p "[init] Create backup archive of existing files? [y/N] " -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
backup_existing
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "[init] Restoring KeePassXC databases and database keys"
|
||||
mkdir -p "$SOURCE_DIR"
|
||||
rclone copy "$TARGET_DIR" "$SOURCE_DIR" \
|
||||
--include "*.{kdbx,kdbx.key}" \
|
||||
--progress
|
||||
echo "[init] Done"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
""|save)
|
||||
save_databases
|
||||
;;
|
||||
init)
|
||||
restore_databases
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 [init|save]"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
12
.bin/save-ssh-host
Executable file
12
.bin/save-ssh-host
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
selected_hosts="$(ssh-hosts | fzf -m)"
|
||||
|
||||
for host in $selected_hosts; do
|
||||
echo "Saving $host"
|
||||
directories="$(ssh "$host" ls | fzf -m)"
|
||||
for directory in $directories; do
|
||||
echo "Saving $host:$directory"
|
||||
ssh "$host" "(tar cvzf - ~/$directory)" > "${host}_${directory}.tar.gz"
|
||||
done
|
||||
done
|
||||
@@ -5,7 +5,7 @@
|
||||
num_to_review=200
|
||||
|
||||
# Get current card count from Anki
|
||||
count=$(curl -s localhost:8765 -X POST -d '{"action": "getNumCardsReviewedToday", "version": 6}' | jq '.result')
|
||||
count=$(curl -s 127.0.0.1:8765 -X POST -d '{"action": "getNumCardsReviewedToday", "version": 6}' | jq '.result')
|
||||
|
||||
if [ -z "$count" ]
|
||||
then
|
||||
|
||||
12
.bin/sb-wg
Executable file
12
.bin/sb-wg
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# Reference: https://github.com/mil-ad/polybar-wireguard
|
||||
|
||||
connected_interfaces=$(networkctl | grep -P "\d+ .* wireguard routable" -o | cut -d" " -f2)
|
||||
|
||||
if [ -n "$connected_interfaces" ];
|
||||
then
|
||||
for interface in $connected_interfaces; do echo "$interface"; done
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
51
.bin/screen-temperature
Executable file
51
.bin/screen-temperature
Executable file
@@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
DEFAULT_TEMPERATURE = 3500
|
||||
|
||||
try:
|
||||
with open('/tmp/temperature', 'r') as temp_file:
|
||||
current_temperature = int(temp_file.read())
|
||||
except FileNotFoundError:
|
||||
current_temperature = DEFAULT_TEMPERATURE
|
||||
|
||||
# If no argument is given print the current temperature
|
||||
if len(sys.argv) == 1:
|
||||
print(current_temperature)
|
||||
sys.exit(0)
|
||||
elif len(sys.argv) != 2:
|
||||
print("""
|
||||
Usage:
|
||||
|
||||
screen-temperature
|
||||
print current temperature
|
||||
|
||||
screen-temperature <temperature>
|
||||
set screen temperature to <temperature>
|
||||
|
||||
screen-temperature <+|-><temperature>
|
||||
increase or decrease screen temperature by <temperature>
|
||||
""")
|
||||
sys.exit(1)
|
||||
|
||||
temperature_change = sys.argv[1]
|
||||
|
||||
if temperature_change.startswith("+"):
|
||||
new_temperature = current_temperature + int(temperature_change[1:])
|
||||
elif temperature_change.startswith("-"):
|
||||
new_temperature = current_temperature - int(temperature_change[1:])
|
||||
else:
|
||||
new_temperature = int(temperature_change)
|
||||
|
||||
try:
|
||||
subprocess.run(["redshift", "-O", str(new_temperature), "-P"], check=True)
|
||||
with open('/tmp/temperature', 'w') as temp_file:
|
||||
temp_file.write(str(new_temperature) + '\n')
|
||||
# Send notification
|
||||
subprocess.run(
|
||||
["notify-send", str(new_temperature) + "K"])
|
||||
except subprocess.CalledProcessError:
|
||||
print("Error: could not set screen temperature.")
|
||||
sys.exit(1)
|
||||
@@ -1,89 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Note: this script gets called from $HOME/.config/autorandr/docked/postswitch,
|
||||
# default drawing area on 4K monitor
|
||||
|
||||
# Centered draw area:
|
||||
#
|
||||
# x_offset = screen_width/2 - draw_width/2
|
||||
# y_offset = screen_height/2 - draw_height/2
|
||||
|
||||
#
|
||||
# Drawing area
|
||||
# TODO: w,h,x,y parameters w/ these defaults
|
||||
# call script from autorandr with corresponding parameters.
|
||||
#
|
||||
|
||||
# Get screen resolution (TODO: test external monitor)
|
||||
resolution=$(xrandr --current | grep "connected primary" | awk '{print $4}' | sed 's/x/ /g' | sed 's/+[0-9]//g')
|
||||
screen_w=$(echo "$resolution" | awk '{print $1}')
|
||||
screen_h=$(echo "$resolution" | awk '{print $2}')
|
||||
|
||||
w=1920 # Width
|
||||
h=1080 # Height
|
||||
x="$((screen_w - 1920))" # Horizontal offset
|
||||
y="$((screen_h - 1080))" # Vertical offset
|
||||
orientation="landscape" # Portrait/landscape
|
||||
|
||||
# Get rotation setting
|
||||
rotate=`[[ "$orientation" == "landscape" ]] && echo "half" || echo "ccw"`
|
||||
|
||||
#
|
||||
# Wacom tablet
|
||||
#
|
||||
|
||||
# Right bottom
|
||||
xsetwacom set "Wacom Intuos Pro M Pen stylus" rotate "$rotate"
|
||||
xsetwacom set "Wacom Intuos Pro M Finger touch" rotate "$rotate"
|
||||
xsetwacom set "Wacom Intuos Pro M Pen eraser" rotate "$rotate"
|
||||
xsetwacom set "Wacom Intuos Pro M Pen cursor" rotate "$rotate"
|
||||
xsetwacom set "Wacom Intuos Pro M Pen stylus" rotate "$rotate"
|
||||
xsetwacom set "Wacom Intuos Pro M Pen stylus" MapToOutput "$w"x"$h"+"$x"+"$y"
|
||||
xsetwacom set "Wacom Intuos Pro M Finger touch" MapToOutput "$w"x"$h"+"$x"+"$y"
|
||||
xsetwacom set "Wacom Intuos Pro M Pen eraser" MapToOutput "$w"x"$h"+"$x"+"$y"
|
||||
xsetwacom set "Wacom Intuos Pro M Pen cursor" MapToOutput "$w"x"$h"+"$x"+"$y"
|
||||
xsetwacom set "Wacom Intuos Pro M Pen stylus" MapToOutput "$w"x"$h"+"$x"+"$y"
|
||||
|
||||
# Centered
|
||||
# xsetwacom set "Wacom Intuos Pro M Pen stylus" MapToOutput 1920x1080+"$(w/2)"+"$(h/2)"
|
||||
# xsetwacom set "Wacom Intuos Pro M Finger touch" MapToOutput 1920x1080+"$(w/2)"+"$(h/2)"
|
||||
# xsetwacom set "Wacom HID 5214 Pen stylus" MapToOutput 1920x1080+"$(w/2)"+"$(h/2)"
|
||||
# xsetwacom set "Wacom HID 5214 Finger touch" MapToOutput 1920x1080+"$(w/2)"+"$(h/2)"
|
||||
# xsetwacom set "Wacom Intuos Pro M Pen eraser" MapToOutput 1920x1080+"$(w/2)"+"$(h/2)"
|
||||
# xsetwacom set "Wacom Intuos Pro M Pen cursor" MapToOutput 1920x1080+"$(w/2)"+"$(h/2)"
|
||||
# xsetwacom set "Wacom HID 5214 Pen eraser" MapToOutput 1920x1080+"$(w/2)"+"$(h/2)"
|
||||
# xsetwacom set "Wacom Intuos Pro M Pen stylus" MapToOutput 1920x1080+"$(w/2)"+"$(h/2)"
|
||||
|
||||
# # Rotate drawing are for vertical drawing
|
||||
# # (physical controls above drawing area)
|
||||
# xsetwacom set "Wacom Intuos Pro M Pen stylus" rotate ccw
|
||||
# xsetwacom set "Wacom Intuos Pro M Finger touch" rotate ccw
|
||||
# xsetwacom set "Wacom HID 5214 Pen stylus" rotate ccw
|
||||
# xsetwacom set "Wacom HID 5214 Finger touch" rotate ccw
|
||||
# xsetwacom set "Wacom Intuos Pro M Pen eraser" rotate ccw
|
||||
# xsetwacom set "Wacom Intuos Pro M Pen cursor" rotate ccw
|
||||
# xsetwacom set "Wacom HID 5214 Pen eraser" rotate ccw
|
||||
# xsetwacom set "Wacom Intuos Pro M Pen stylus" rotate ccw
|
||||
|
||||
# # Set drawing area to left side on 3840x2160 monitor
|
||||
# xsetwacom set "Wacom Intuos Pro M Pen stylus" MapToOutput 1080x1920+130+130
|
||||
# xsetwacom set "Wacom Intuos Pro M Finger touch" MapToOutput 1080x1920+130+130
|
||||
# xsetwacom set "Wacom HID 5214 Pen stylus" MapToOutput 1080x1920+130+130
|
||||
# xsetwacom set "Wacom HID 5214 Finger touch" MapToOutput 1080x1920+130+130
|
||||
# xsetwacom set "Wacom Intuos Pro M Pen eraser" MapToOutput 1080x1920+130+130
|
||||
# xsetwacom set "Wacom Intuos Pro M Pen cursor" MapToOutput 1080x1920+130+130
|
||||
# xsetwacom set "Wacom HID 5214 Pen eraser" MapToOutput 1080x1920+130+130
|
||||
# xsetwacom set "Wacom Intuos Pro M Pen stylus" MapToOutput 1080x1920+130+130
|
||||
|
||||
#
|
||||
# Laptop touch display
|
||||
#
|
||||
|
||||
xsetwacom set "Wacom HID 5214 Pen stylus" rotate none
|
||||
xsetwacom set "Wacom HID 5214 Finger touch" rotate none
|
||||
xsetwacom set "Wacom HID 5214 Pen eraser" rotate none
|
||||
xsetwacom set "Wacom HID 5214 Pen eraser" MapToOutput 1920x1080+0+0
|
||||
xsetwacom set "Wacom HID 5214 Pen stylus" MapToOutput 1920x1080+0+0
|
||||
xsetwacom set "Wacom HID 5214 Finger touch" MapToOutput 1920x1080+0+0
|
||||
|
||||
xsetwacom --set "Wacom Intuos Pro M Finger touch" TOUCH off
|
||||
258
.bin/setup
258
.bin/setup
@@ -1,76 +1,208 @@
|
||||
#!/bin/bash
|
||||
|
||||
pac_list=(
|
||||
at
|
||||
automake
|
||||
autopep8
|
||||
base
|
||||
base-devel
|
||||
bash-completion
|
||||
bash-language-server
|
||||
bc
|
||||
brightnessctl
|
||||
chromium
|
||||
dmidecode
|
||||
entr
|
||||
eslint_d
|
||||
feh
|
||||
firefox-developer-edition
|
||||
firefox-tridactyl
|
||||
firefox-tridactyl-native
|
||||
firefox-tridactyl-native-debug
|
||||
fzf
|
||||
gcc
|
||||
git
|
||||
haskell-language-server
|
||||
haskell-ormolu
|
||||
hsetroot
|
||||
htop
|
||||
httpie
|
||||
jq
|
||||
keepassxc
|
||||
kitty
|
||||
lua-language-server
|
||||
make
|
||||
man-db
|
||||
man-pages
|
||||
neovim
|
||||
nmap
|
||||
nodejs-lts-jod
|
||||
pacman-contrib
|
||||
pandoc-cli
|
||||
pandoc-crossref
|
||||
parallel
|
||||
pass
|
||||
pkgbuild-language-server
|
||||
pnpm
|
||||
ripgrep
|
||||
sshfs
|
||||
stylelint
|
||||
svelte-language-server
|
||||
tailwindcss-language-server
|
||||
task
|
||||
tldr
|
||||
tmux
|
||||
tmuxp
|
||||
tree
|
||||
tree-sitter-cli
|
||||
ts-node
|
||||
typescript-language-server
|
||||
unzip
|
||||
vim-language-server
|
||||
wget
|
||||
xclip
|
||||
yaml-language-server
|
||||
)
|
||||
|
||||
aurpac_list=(
|
||||
hadolint-bin
|
||||
nvm
|
||||
nvimpager
|
||||
paru
|
||||
tmux-bash-completion-git
|
||||
ttf-iosevka-term-ss08
|
||||
vim-plug
|
||||
vtsls
|
||||
xbanish
|
||||
)
|
||||
|
||||
install() {
|
||||
if pacman -Qi "$1" &> /dev/null; then
|
||||
echo ""$1" is already installed"
|
||||
local package="$1"
|
||||
if pacman -Qi "$package" &> /dev/null; then
|
||||
echo "$package is already installed"
|
||||
else
|
||||
echo "Installing " "$1"
|
||||
sudo pacman -S --noconfirm --needed "$1"
|
||||
echo "Installing " "$package"
|
||||
sudo pacman -S --noconfirm --needed "$package"
|
||||
fi
|
||||
}
|
||||
|
||||
# Packages to install from Arch repositories
|
||||
pac_list=(
|
||||
git
|
||||
vim
|
||||
)
|
||||
aurpac() {
|
||||
git clone "https://aur.archlinux.org/$1.git" "$HOME/.build/$1"
|
||||
}
|
||||
|
||||
# Packages to install from AUR
|
||||
aurpac_list=(
|
||||
xbanish
|
||||
ttf-iosevka-term-ss08
|
||||
)
|
||||
install_packages() {
|
||||
announce "Installing packages"
|
||||
local count
|
||||
for pac in "${pac_list[@]}" ; do
|
||||
count=$((count+1))
|
||||
install "$pac";
|
||||
done
|
||||
echo "$count packages installed"
|
||||
}
|
||||
|
||||
# Suckless software to build
|
||||
suckless_list=( $(ls -1 "$HOME/.suckless/") )
|
||||
install_dotfiles() {
|
||||
announce "Installing dotfiles"
|
||||
origin="https://git.hektormisplon.xyz/hektor/dots"
|
||||
git clone "$origin" "$HOME/dots"
|
||||
cp -r "$HOME/dots/.git" "$HOME/.git"
|
||||
git --git-dir="$HOME/.git" config --local status.showUntrackedFiles no
|
||||
git --git-dir="$HOME/.git" stash -m "[dots]"
|
||||
git --git-dir="$HOME/.git" stash apply
|
||||
git --git-dir="$HOME/.git" restore "$HOME"
|
||||
}
|
||||
|
||||
count=0
|
||||
install_aur_packages() {
|
||||
announce "Installing AUR packages"
|
||||
local count
|
||||
for package in "${aurpac_list[@]}" ; do
|
||||
if pacman -Qi "$1" &> /dev/null; then
|
||||
echo "$1 is already installed"
|
||||
else
|
||||
count=$((count+1))
|
||||
aurpac "$package" && makepkg -si -D "$HOME/.build/$package"
|
||||
fi
|
||||
done
|
||||
echo "$count AUR packages installed"
|
||||
}
|
||||
|
||||
echo " "
|
||||
echo "Installing required packages"
|
||||
echo " "
|
||||
setup_neovim() {
|
||||
announce "Setting up NeoVim"
|
||||
git clone --depth=1 https://github.com/savq/paq-nvim.git \
|
||||
"${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/pack/paqs/start/paq-nvim
|
||||
}
|
||||
|
||||
setup_keyboard() {
|
||||
announce "Setting up keyboard"
|
||||
install "interception-tools"
|
||||
install "interception-caps2esc"
|
||||
udevmon_config_contents="\
|
||||
- JOB: intercept -g \$DEVNODE | caps2esc -m 1 | uinput -d \$DEVNODE
|
||||
DEVICE:
|
||||
EVENTS:
|
||||
EV_KEY: [KEY_CAPSLOCK]"
|
||||
if [ -f /etc/interception/udevmon.yaml ] && diff -q <(echo "$udevmon_config_contents") /etc/interception/udevmon.yaml; then
|
||||
echo "udevmon config already exists"
|
||||
echo "$udevmon_config_contents"
|
||||
elif [ -f /etc/interception/udevmon.yaml ]; then
|
||||
echo "interception udevmon.yaml already exists"
|
||||
cat /etc/interception/udevmon.yaml
|
||||
echo "verify if this config matches the one below"
|
||||
echo "$udevmon_config_contents"
|
||||
else
|
||||
echo "interception udevmon.yaml does not exist, creating one"
|
||||
sudo bash -c "echo '$udevmon_config_contents' > /etc/interception/udevmon.yaml"
|
||||
fi
|
||||
|
||||
sudo systemctl enable --now udevmon.service
|
||||
|
||||
if pgrep -x caps2esc > /dev/null; then
|
||||
echo "caps2esc is already running"
|
||||
else
|
||||
caps2esc -m 1
|
||||
fi
|
||||
}
|
||||
|
||||
configure_gnome() {
|
||||
announce "Configuring Gnome"; setup-gnome
|
||||
}
|
||||
|
||||
setup_firewall() {
|
||||
announce "Configuring firewalld"
|
||||
install firewalld
|
||||
sudo systemctl enable --now firewalld
|
||||
}
|
||||
|
||||
setup_docker() {
|
||||
announce "Setting up Docker"
|
||||
install docker
|
||||
install docker-compose
|
||||
sudo systemctl enable --now docker.socket
|
||||
sudo usermod -aG docker "$USER"
|
||||
echo "User added to docker group, please restart your session"
|
||||
}
|
||||
|
||||
announce() {
|
||||
local message="$1"
|
||||
echo " "
|
||||
echo "[dots] $message"
|
||||
echo " "
|
||||
}
|
||||
|
||||
confirm() {
|
||||
local question="$1"
|
||||
read -r -p "[dots] $question? [y/N]" -n 1
|
||||
case "$REPLY" in y|Y ) "$2";; * ) echo "Skipping"; esac
|
||||
}
|
||||
|
||||
printf '%s\n' "${pac_list[@]}"
|
||||
|
||||
for pac in "${pac_list[@]}" ; do
|
||||
count=$[count+1]
|
||||
install "$pac";
|
||||
done
|
||||
|
||||
echo " "
|
||||
echo "Installing aur packages"
|
||||
echo " "
|
||||
|
||||
# [ ] Create aurpac installer function
|
||||
for aurpac in "${aurpac_list[@]}" ; do
|
||||
if pacman -Qi "$1" &> /dev/null; then
|
||||
echo "$1 is already installed"
|
||||
else
|
||||
count=$[count+1]
|
||||
("$HOME/.bin/aurpac" "$aurpac" && cd "$aurpac" && makepkg -si)
|
||||
fi
|
||||
done
|
||||
|
||||
echo " "
|
||||
echo "Setting up suckless tools"
|
||||
echo " "
|
||||
|
||||
printf '%s\n' "${suckless_list[@]}"
|
||||
|
||||
# for tool in "${suckless_list[@]}" ; do
|
||||
# count=$[count+1]
|
||||
# (cd "$HOME/.suckless/$tool/" && sudo make clean install);
|
||||
# done
|
||||
|
||||
# echo " "
|
||||
# echo "Setting up vim"
|
||||
# echo " "
|
||||
|
||||
# cp .vimrc $HOME/.vimrc
|
||||
# vim +PlugInstall
|
||||
|
||||
## Bluetooth setup
|
||||
# ___
|
||||
|
||||
# - [ ] Check if /etc/pulse/default.pa contains following line
|
||||
# load-module module-switch-on-connect
|
||||
confirm "Install these packages? " install_packages
|
||||
printf '%s\n' "${aurpac_list[@]}"
|
||||
confirm "Install these AUR packages? " install_aur_packages
|
||||
confirm "Setup NeoVim? " setup_neovim
|
||||
confirm "Install dotfiles? " install_dotfiles
|
||||
confirm "Setup keyboard? " setup_keyboard
|
||||
if pacman -Qi "gdm" &> /dev/null; then
|
||||
confirm "Configure Gnome? " configure_gnome
|
||||
fi
|
||||
confirm "Setup firewall? " setup_firewall
|
||||
confirm "Setup Docker? " setup_docker
|
||||
|
||||
37
.bin/setup-gnome
Executable file
37
.bin/setup-gnome
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
gsettings set org.gnome.desktop.background primary-color "#555555"
|
||||
|
||||
gsettings set org.gnome.desktop.wm.preferences workspace-names "['sh', 'www', 'dev', 'info', 'etc']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings close "['<Shift><Super>Delete']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-applications "['<Super>j']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-applications-backward "['<Super>k']"
|
||||
gsettings set org.gnome.shell.keybindings toggle-application-view "['<Super>p']"
|
||||
gsettings set org.gnome.mutter center-new-windows true
|
||||
gsettings set org.gnome.shell.keybindings toggle-quick-settings []
|
||||
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-1 "['<Super>a']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-2 "['<Super>s']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-3 "['<Super>d']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-4 "['<Super>f']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-5 "['<Super>g']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-1 "['<Super><Shift>a']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-2 "['<Super><Shift>s']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-3 "['<Super><Shift>d']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-4 "['<Super><Shift>f']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-5 "['<Super><Shift>g']"
|
||||
|
||||
gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/']"
|
||||
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ name "Kitty"
|
||||
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ command "kitty"
|
||||
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ binding "<Shift><Super>Return"
|
||||
|
||||
gsettings set org.gnome.shell.keybindings screenshot "['Print']"
|
||||
|
||||
gsettings set org.gnome.desktop.wm.preferences num-workspaces "5"
|
||||
gsettings set org.gnome.mutter dynamic-workspaces "false"
|
||||
gsettings set org.gnome.shell.extensions.window-list display-all-workspaces "true"
|
||||
gsettings set org.gnome.shell.app-switcher current-workspace-only "true"
|
||||
|
||||
gsettings set org.gnome.login-screen logo ''
|
||||
gsettings set org.gnome.shell favorite-apps "['firefox-developer-edition.desktop']"
|
||||
20
.bin/setup-zk
Executable file
20
.bin/setup-zk
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ ! -d ~/.zk ]; then
|
||||
echo "[zk] Setting up zettelkasten"
|
||||
gh repo clone zk ~/.zk
|
||||
else
|
||||
echo "[zk] Zettelkasten already set up."
|
||||
fi
|
||||
|
||||
read -p "Would you like open your zettelkasten? [y/N] " -n 1 -r
|
||||
echo
|
||||
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
if [ -x "$(command -v zk)" ]; then
|
||||
zk
|
||||
else
|
||||
echo "Error: 'zk' command not found or not executable"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
41
.bin/sketch
41
.bin/sketch
@@ -1,41 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Open xournal in wacom drawing area
|
||||
|
||||
# xdotool key "Super_L+f"
|
||||
|
||||
function start_xournal() {
|
||||
# Prevent multiple xournalpp instances
|
||||
if pgrep -x "xournalpp" > /dev/null
|
||||
then
|
||||
echo "Xournal is already running"
|
||||
else
|
||||
xournalpp &
|
||||
fi
|
||||
}
|
||||
|
||||
function resize_xournal() {
|
||||
# Resize xournalpp window to draw area
|
||||
sleep 1
|
||||
xournal_id=$(xdotool search --onlyvisible --name xournal)
|
||||
resize-for-wacom-horizontal
|
||||
|
||||
# FIXME: Automate for different resolutions
|
||||
|
||||
# Bottom centered
|
||||
# xdotool windowsize "$xournal_id" 1920 1080
|
||||
# xdotool windowmove "$xournal_id" 1920 1080
|
||||
|
||||
# Centered
|
||||
xdotool windowsize "$xournal_id" 1920 1080
|
||||
xdotool windowmove "$xournal_id" 960 540
|
||||
|
||||
# Vertical
|
||||
# xournal_id=$(xdotool search --onlyvisible --name xournal)
|
||||
# xdotool windowsize "$xournal_id" 1080 1920
|
||||
# xdotool windowmove "$xournal_id" 130 540
|
||||
}
|
||||
|
||||
set-wacom-draw-area
|
||||
start_xournal
|
||||
resize_xournal
|
||||
5
.bin/ssh-hosts
Executable file
5
.bin/ssh-hosts
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
ssh_hosts="$(grep -E 'Host [a-z0-9\-]*$' ~/.ssh/config | awk '{print $2}')"
|
||||
|
||||
echo "$ssh_hosts"
|
||||
144
.bin/taskdeps
Executable file
144
.bin/taskdeps
Executable file
@@ -0,0 +1,144 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import subprocess
|
||||
from collections import defaultdict
|
||||
|
||||
|
||||
def get_task_data():
|
||||
command = (
|
||||
"task +PENDING or +WAITING -COMPLETED -DELETED export | "
|
||||
"jq '[.[] | {uuid: .uuid, id, depends: .depends, description: .description, status: .status }]'"
|
||||
)
|
||||
output = subprocess.check_output(command, shell=True)
|
||||
return json.loads(output)
|
||||
|
||||
|
||||
def parse_task_data(data):
|
||||
dependency_graph = defaultdict(list)
|
||||
task_details = {}
|
||||
dependent_tasks = set()
|
||||
|
||||
for task in data:
|
||||
task_id = task["uuid"]
|
||||
task_details[task_id] = {
|
||||
"id": task.get("id", "?"),
|
||||
"description": task.get("description", "No description"),
|
||||
"status": task.get("status", "Unknown status"),
|
||||
}
|
||||
if task["depends"]:
|
||||
for dependency in task["depends"]:
|
||||
dependency_graph[dependency].append(task_id)
|
||||
dependent_tasks.add(task_id)
|
||||
|
||||
root_tasks = set(task_details.keys()) - dependent_tasks
|
||||
return task_details, dependency_graph, root_tasks
|
||||
|
||||
|
||||
def get_all_parents(task_id, dependency_graph):
|
||||
return [
|
||||
parent for parent, children in dependency_graph.items() if task_id in children
|
||||
]
|
||||
|
||||
|
||||
def build_ascii_dag(
|
||||
task_id,
|
||||
task_details,
|
||||
dependency_graph,
|
||||
prefix="",
|
||||
is_last=True,
|
||||
show_id=True,
|
||||
visited=None,
|
||||
):
|
||||
if visited is None:
|
||||
visited = set()
|
||||
|
||||
if task_id in visited:
|
||||
return [f"{prefix}{'└── ' if is_last else '├── '}... (cycle detected)"]
|
||||
|
||||
visited.add(task_id)
|
||||
|
||||
task_info = task_details[task_id]
|
||||
task_line = f"{prefix}{'└── ' if is_last else '├── '}{task_info['id'] + ': ' if show_id else ''}{task_info['description']} ({task_info['status']})"
|
||||
lines = [task_line]
|
||||
|
||||
children = dependency_graph.get(task_id, [])
|
||||
for idx, child in enumerate(children):
|
||||
child_is_last = idx == len(children) - 1
|
||||
child_prefix = prefix + (" " if is_last else "│ ")
|
||||
lines.extend(
|
||||
build_ascii_dag(
|
||||
child,
|
||||
task_details,
|
||||
dependency_graph,
|
||||
child_prefix,
|
||||
child_is_last,
|
||||
show_id,
|
||||
visited.copy(),
|
||||
)
|
||||
)
|
||||
|
||||
return lines
|
||||
|
||||
|
||||
def render_dependency_dag(task_details, dependency_graph, root_tasks, show_id):
|
||||
dag_lines = []
|
||||
global_visited = set()
|
||||
|
||||
def dfs(task_id, prefix="", is_last=True, visited=None):
|
||||
if visited is None:
|
||||
visited = set()
|
||||
|
||||
if task_id in visited:
|
||||
return
|
||||
|
||||
visited.add(task_id)
|
||||
global_visited.add(task_id)
|
||||
|
||||
task_info = task_details[task_id]
|
||||
task_line = f"{prefix}{'└── ' if is_last else '├── '}{str(task_info['id']) + ': ' if show_id else ''}{task_info['description']} ({task_info['status']})"
|
||||
dag_lines.append(task_line)
|
||||
|
||||
children = dependency_graph.get(task_id, [])
|
||||
for idx, child in enumerate(children):
|
||||
child_is_last = idx == len(children) - 1
|
||||
child_prefix = prefix + (" " if is_last else "│ ")
|
||||
dfs(child, child_prefix, child_is_last, visited.copy())
|
||||
|
||||
root_tasks_with_children = [
|
||||
root for root in root_tasks if dependency_graph.get(root, [])
|
||||
]
|
||||
for root in sorted(
|
||||
root_tasks_with_children,
|
||||
key=lambda x: len(dependency_graph.get(x, [])),
|
||||
reverse=True,
|
||||
):
|
||||
if root not in global_visited:
|
||||
dfs(root)
|
||||
dag_lines.append("")
|
||||
|
||||
return "\n".join(dag_lines).rstrip()
|
||||
|
||||
|
||||
def main(args):
|
||||
data = get_task_data()
|
||||
task_details, dependency_graph, root_tasks = parse_task_data(data)
|
||||
ascii_dag = render_dependency_dag(
|
||||
task_details, dependency_graph, root_tasks, show_id=args.show_id
|
||||
)
|
||||
print(ascii_dag)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Generates a task dependency DAG for Taskwarrior tasks."
|
||||
)
|
||||
parser.add_argument(
|
||||
"--show-id",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="Include task IDs in the output.",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
main(args)
|
||||
@@ -3,16 +3,11 @@
|
||||
session="main"
|
||||
|
||||
tmux attach-session -t $session || tmux new-session -s $session \; \
|
||||
rename-window todo \; \
|
||||
send-keys -t 0 "task" C-m \; \
|
||||
rename-window task \; \
|
||||
send-keys -t 1 "task" C-m \; \
|
||||
new-window -n zk \; \
|
||||
send-keys -t 0 "nvim $ZK_PATH/index.md" C-m \; \
|
||||
new-window -n music \; \
|
||||
send-keys -t 0 "ncspot" C-m \; \
|
||||
send-keys -t 2 "nvim $ZK_PATH/index.md" C-m \; \
|
||||
new-window -n term \; \
|
||||
new-window -n make \; \
|
||||
split-window -h \; \
|
||||
split-window -h \; \
|
||||
send-keys -t 0 'cd "$ZK_PATH" && ./entr' C-m \; \
|
||||
send-keys -t 1 'cd "$ZK_PATH" && live-server . --watch=*.html' C-m \; \
|
||||
select-window -t 2 \;
|
||||
new-window -n music \; \
|
||||
send-keys -t 4 "echo 'TODO: open music player'" C-m \; \
|
||||
select-window -t 1 \;
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Get local IP
|
||||
|
||||
ip addr show $@ | awk '/inet / {gsub(/\/.*/,"",$2); print $2}' | tail -n 1
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
xrandr -q --current | sed -n 's/^\([^ ]\+\) connected .*/\1/p'
|
||||
33
.bin/zk
Executable file
33
.bin/zk
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ "$TERM_PROGRAM" = tmux ]; then
|
||||
cd ~/.zk && $EDITOR "$(cat ~/.zk/current-zettel.txt)"
|
||||
else
|
||||
echo 'Not in tmux'
|
||||
echo 'Choose an option:'
|
||||
echo '1. Open in tmux'
|
||||
echo '2. Open in current terminal'
|
||||
read -r -p 'Enter your choice: ' choice
|
||||
case $choice in
|
||||
1)
|
||||
# Check if a tmux session is running with a window named zk
|
||||
if tmux list-windows -F '#{window_name}' | grep -q zk; then
|
||||
# Attach to the session containing the 'zk' window
|
||||
session="$(tmux list-windows -F '#{window_name} #{session_name}' | grep zk | head -n 1 | awk '{ print $2 }')"
|
||||
tmux attach -t "$session"
|
||||
else
|
||||
# Create session with a window named 'zk' and start nvim
|
||||
tmux new-session -s zk -n zk -d
|
||||
tmux send-keys -t zk:zk "cd ~/.zk && $EDITOR \"\$(cat ~/.zk/current-zettel.txt)\"" Enter
|
||||
tmux attach -t zk
|
||||
fi
|
||||
;;
|
||||
2)
|
||||
cd ~/.zk && $EDITOR "$(cat ~/.zk/current-zettel.txt)"
|
||||
;;
|
||||
*)
|
||||
echo 'Not opening Zettelkasten'
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
@@ -1,13 +0,0 @@
|
||||
# Atom config
|
||||
|
||||
Quick and dirty Atom config for live-coding (Tidalcycles, Hydra.js).
|
||||
|
||||
## Setup
|
||||
|
||||
Note: by default Atom uses `$HOME/.atom` as its config directory, to use
|
||||
`$HOME/.config/atom` add a global environment variable `ATOM_HOME`
|
||||
|
||||
E.g. for arch you can add `export ATOM_HOME=$HOME/.config/atom` to the
|
||||
following file
|
||||
|
||||
`/etc/profile.d/atom.sh`
|
||||
@@ -1,52 +0,0 @@
|
||||
"*":
|
||||
"atom-package-deps":
|
||||
ignored: [
|
||||
"linter-ui-default"
|
||||
]
|
||||
core:
|
||||
autoHideMenuBar: true
|
||||
disabledPackages: [
|
||||
"linter-glslify"
|
||||
"github"
|
||||
"spell-check"
|
||||
"background-tips"
|
||||
"wrap-guide"
|
||||
"whitespace"
|
||||
"welcome"
|
||||
"markdown-preview"
|
||||
"tabs"
|
||||
"git-diff"
|
||||
"go-to-line"
|
||||
"image-view"
|
||||
"language-coffee-script"
|
||||
"language-git"
|
||||
"autocomplete-glsl"
|
||||
"autocomplete-atom-api"
|
||||
"autocomplete-css"
|
||||
"autocomplete-html"
|
||||
"autocomplete-plus"
|
||||
"autocomplete-snippets"
|
||||
"notifications"
|
||||
]
|
||||
telemetryConsent: "no"
|
||||
themes: [
|
||||
"one-dark-ui"
|
||||
"dun-syntax"
|
||||
]
|
||||
editor:
|
||||
fontFamily: "Iosevka Term SS08"
|
||||
fontSize: 21
|
||||
scrollPastEnd: true
|
||||
"exception-reporting":
|
||||
userId: "6f9fc289-7b3c-4490-937e-5e58e9765c5e"
|
||||
"linter-ui-default":
|
||||
showPanel: true
|
||||
"prettier-atom":
|
||||
formatOnSaveOptions:
|
||||
enabled: true
|
||||
"status-bar":
|
||||
isVisible: false
|
||||
tabs:
|
||||
alwaysShowTabBar: false
|
||||
welcome:
|
||||
showOnStartup: false
|
||||
@@ -1 +0,0 @@
|
||||
atom.commands.dispatch(document.querySelector('atom-workspace'), 'atom-hydra:toggle')
|
||||
@@ -1,13 +0,0 @@
|
||||
'atom-text-editor.vim-mode-plus:not(.insert-mode)':
|
||||
'space s h': 'window:focus-pane-on-left'
|
||||
'space s l': 'window:focus-pane-on-right'
|
||||
'space s k': 'window:focus-pane-above'
|
||||
'space s j': 'window:focus-pane-below'
|
||||
'space s v': 'pane:split-right-and-copy-active-item'
|
||||
'space s s': 'pane:split-down-and-copy-active-item'
|
||||
'space q': 'core:close'
|
||||
's': 'unset!'
|
||||
'space p': 'fuzzy-finder:toggle-file-finder'
|
||||
|
||||
'atom-text-editor':
|
||||
'ctrl-b': 'tree-view:toggle'
|
||||
@@ -1,8 +0,0 @@
|
||||
atom-hydra@0.3.6
|
||||
autocomplete-glsl@0.2.3
|
||||
dun-syntax@0.6.0
|
||||
linter@3.4.0
|
||||
linter-glslify@1.0.0
|
||||
linter-ui-default@3.4.1
|
||||
platformio-ide-terminal@2.10.1
|
||||
vim-mode-plus@1.36.7
|
||||
@@ -1,133 +0,0 @@
|
||||
// The ui-variables file is provided by base themes provided by Atom.
|
||||
//
|
||||
// See https://github.com/atom/atom-dark-ui/blob/master/styles/ui-variables.less
|
||||
// for a full listing of what's available.
|
||||
@import "ui-variables";
|
||||
|
||||
&.hydra-flash {
|
||||
// color: @text-color-selected;
|
||||
// background-color: @background-color-selected;
|
||||
// color: #000;
|
||||
background: rgba(255, 255, 255, 0.5) !important;
|
||||
//background: #0f0 !important;
|
||||
}
|
||||
|
||||
&.evalFlash {
|
||||
// color: @text-color-selected;
|
||||
// background-color: @background-color-selected;
|
||||
// color: #000;
|
||||
background: rgba(255, 255, 255, 0.8) !important;
|
||||
//background: #0f0 !important;
|
||||
}
|
||||
|
||||
.hydra,
|
||||
.hydra canvas {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: -1;
|
||||
background: black;
|
||||
}
|
||||
|
||||
body.hydra-enabled {
|
||||
&,
|
||||
atom-workspace,
|
||||
.header *,
|
||||
.footer *,
|
||||
atom-workspace-axis,
|
||||
atom-workspace-axis
|
||||
:not(.cursor):not(autocomplete-suggestion-list):not(atom-overlay):not(span):not(.region),
|
||||
atom-workspace *:before,
|
||||
atom-workspace *:after {
|
||||
background: transparent; /*!important;*/
|
||||
border: none !important;
|
||||
text-shadow: 0 1px 1px black;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
.line > span {
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
|
||||
.cursor {
|
||||
width: 0 !important;
|
||||
box-shadow: 0 0 3px #0ff !important;
|
||||
border-left: 4px solid #0ff !important;
|
||||
}
|
||||
autocomplete-suggestion-list,
|
||||
atom-overlay {
|
||||
background: rgba(0, 0, 0, 0.9) !important;
|
||||
}
|
||||
.region {
|
||||
background: rgba(0, 255, 255, 0.4) !important;
|
||||
z-index: 9 !important;
|
||||
}
|
||||
.selected:before {
|
||||
background: #0005 !important;
|
||||
border-left: 8px #8888 solid !important;
|
||||
}
|
||||
|
||||
/* transparent background for file tabs */
|
||||
li.texteditor.tab{
|
||||
background: rgba(0, 0, 0, 0.0)!important;
|
||||
}
|
||||
}
|
||||
|
||||
/*.evalFlash > span {
|
||||
background-color: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
//styles from tidal-atom
|
||||
|
||||
atom-text-editor.editor .line {
|
||||
transition: background-color .8s ease-out;
|
||||
-webkit-transition: background-color .8s ease-out;
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
// &.line-green {
|
||||
// background-color: @green-color;
|
||||
// }
|
||||
//
|
||||
// &.line-blue {
|
||||
// background-color: @blue-color;
|
||||
// }
|
||||
|
||||
&.line-error {
|
||||
background-color: fadeout(@background-color-error, 95%);
|
||||
border: 1px solid fadeout(@background-color-error, 50%);
|
||||
}
|
||||
|
||||
&.line-highlight {
|
||||
background-color: @background-color-highlight;
|
||||
}
|
||||
|
||||
|
||||
|
||||
&.eval-success {
|
||||
color: @text-color-success;
|
||||
background-color: fadeout(@background-color-success, 50%);
|
||||
}
|
||||
|
||||
&.eval-error,
|
||||
&.eval-syntax-error {
|
||||
color: @text-color-error;
|
||||
background-color: @background-color-error;
|
||||
}
|
||||
}*/
|
||||
|
||||
.elegante {
|
||||
background-color: #f00;
|
||||
font-family: fantasy;
|
||||
}
|
||||
/*
|
||||
atom-panel div.tidalcycles.console {
|
||||
height: 100px;
|
||||
padding: 3px 10px;
|
||||
font-size: 14px;
|
||||
overflow: scroll;
|
||||
font-family: Consolas, monospace;
|
||||
|
||||
.error{
|
||||
color: @text-color-error;
|
||||
}
|
||||
}
|
||||
*/
|
||||
@@ -1,322 +0,0 @@
|
||||
@import "syntax-variables";
|
||||
@import "ui-variables";
|
||||
|
||||
// Cursor style
|
||||
// =========================
|
||||
.cursor-base () {
|
||||
border: none;
|
||||
background: none;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.underline-cursor(@bottom-width: 0.2em) {
|
||||
.cursor-base();
|
||||
border-bottom-width: @bottom-width;
|
||||
border-bottom-style: solid;
|
||||
border-bottom-color: @syntax-cursor-color;
|
||||
}
|
||||
|
||||
atom-text-editor.vim-mode-plus.normal-mode,
|
||||
atom-text-editor.vim-mode-plus.visual-mode,
|
||||
atom-text-editor.vim-mode-plus.operator-pending-mode,
|
||||
atom-text-editor.vim-mode-plus.insert-mode.replace {
|
||||
&.is-focused,
|
||||
&.vim-mode-plus-input-focused,
|
||||
&.vim-mode-plus-search-input-focused {
|
||||
.cursor {
|
||||
.cursor-base();
|
||||
background-color: @syntax-cursor-color; // block-cursor
|
||||
}
|
||||
}
|
||||
&.vim-mode-plus-input-focused.hide-cursor {
|
||||
.cursor { opacity: 0; }
|
||||
.cursors.blink-off .cursor { opacity: 0; }
|
||||
}
|
||||
}
|
||||
|
||||
atom-text-editor.vim-mode-plus.operator-pending-mode {
|
||||
&.is-focused,
|
||||
&.vim-mode-plus-search-input-focused {
|
||||
.cursor { .underline-cursor(0.6em); }
|
||||
.cursors.blink-off .cursor { opacity: 0; }
|
||||
}
|
||||
}
|
||||
|
||||
atom-text-editor.vim-mode-plus.insert-mode.replace {
|
||||
&.is-focused {
|
||||
.cursor {
|
||||
.underline-cursor(0.3em);
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// vim-mode-plus-input-focused for surround, f, F, t, T, r etc.
|
||||
atom-text-editor.vim-mode-plus.normal-mode,
|
||||
atom-text-editor.vim-mode-plus.visual-mode,
|
||||
atom-text-editor.vim-mode-plus.operator-pending-mode, {
|
||||
&.vim-mode-plus-input-focused {
|
||||
.cursor { .underline-cursor(); }
|
||||
}
|
||||
}
|
||||
|
||||
atom-text-editor.vim-mode-plus-input-char-waiting {
|
||||
&.is-focused { .cursor { .underline-cursor(); } }
|
||||
}
|
||||
|
||||
// Flash ranges e.g. flashing yanked range.
|
||||
// =========================
|
||||
.flash-animation (@animation-name, @color) {
|
||||
@keyframes @animation-name {
|
||||
from { background-color: @color; }
|
||||
to { background-color: transparent; }
|
||||
}
|
||||
}
|
||||
.flash (@animation-name; @duration) {
|
||||
animation-name: @animation-name;
|
||||
animation-duration: @duration;
|
||||
animation-iteration-count: 1;
|
||||
}
|
||||
|
||||
@flash-base-color: contrast(@syntax-background-color, darken(@syntax-selection-color, 3%), lighten(@syntax-selection-color, 3%));
|
||||
@flash-search-color: fadeout(darken(@syntax-selection-flash-color, 10%), 20%);
|
||||
@flash-added-color: fadeout(darken(@syntax-color-added, 10%), 50%);
|
||||
@flash-removed-color: fadeout(@syntax-color-removed, 50%);
|
||||
|
||||
// flashOnOperate
|
||||
.flash-animation(flash-operator, @flash-base-color);
|
||||
.flash-animation(flash-operator-occurrence, @flash-added-color);
|
||||
.flash-animation(flash-operator-remove-occurrence, @flash-removed-color);
|
||||
|
||||
// flashOnUndoRedo
|
||||
.flash-animation(flash-undo-redo, @flash-base-color);
|
||||
.flash-animation(flash-undo-redo-multiple-changes, @flash-added-color);
|
||||
.flash-animation(flash-undo-redo-multiple-deletes, @flash-removed-color);
|
||||
|
||||
// flashOnSearch
|
||||
.flash-animation(flash-search, @flash-search-color);
|
||||
.flash-animation(flash-screen, @flash-base-color);
|
||||
|
||||
atom-text-editor .vim-mode-plus-flash {
|
||||
// flashOnOperate
|
||||
&.operator .region { .flash(flash-operator, 0.5s); }
|
||||
&.operator-long .region { .flash(flash-operator, 0.8s); }
|
||||
&.operator-occurrence .region { .flash(flash-operator-occurrence, 0.8s); }
|
||||
&.operator-remove-occurrence .region { .flash(flash-operator-remove-occurrence, 0.8s); }
|
||||
|
||||
// flashOnUndoRedo
|
||||
&.undo-redo .region { .flash(flash-undo-redo, 0.5s); }
|
||||
&.undo-redo-multiple-changes .region { .flash(flash-undo-redo-multiple-changes, 0.5s); }
|
||||
&.undo-redo-multiple-deletes .region { .flash(flash-undo-redo-multiple-deletes, 0.5s); }
|
||||
|
||||
// flashOnSearch
|
||||
&.search .region { .flash(flash-search, 1.0s); z-index: 1; }
|
||||
&.screen .region { .flash(flash-screen, 0.3s); }
|
||||
|
||||
// demo-mode pkg integration to stop flash while demo-mode's hover is active
|
||||
&.operator-demo .region { background: @flash-base-color; }
|
||||
&.operator-long-demo .region { background: @flash-base-color; }
|
||||
&.operator-occurrence-demo .region { background: @flash-added-color; }
|
||||
&.operator-remove-occurrence-demo .region { background: @flash-removed-color; }
|
||||
&.undo-redo-demo .region { background: @flash-base-color; }
|
||||
&.undo-redo-multiple-changes-demo .region { background: @flash-added-color; }
|
||||
&.undo-redo-multiple-deletes-demo .region { background: @flash-removed-color; }
|
||||
}
|
||||
|
||||
// Hover Counter
|
||||
// =========================
|
||||
.vim-mode-plus-hover {
|
||||
display: block;
|
||||
color: @text-color-highlight;
|
||||
background-color: @base-background-color;
|
||||
border-radius: @component-border-radius;
|
||||
box-shadow: 0 0 1px @syntax-text-color;
|
||||
|
||||
margin-top: -3.0em;
|
||||
margin-left: -0.3em;
|
||||
padding-left: 0.2em;
|
||||
padding-right: 0.2em;
|
||||
text-align: center;
|
||||
|
||||
&.first { background-color: @background-color-info; }
|
||||
&.last { background-color: @background-color-error; }
|
||||
}
|
||||
|
||||
atom-text-editor[mini].vim-mode-plus-input {
|
||||
background-color: inherit;
|
||||
font-weight: normal;
|
||||
color: @text-color;
|
||||
line-height: 1.28;
|
||||
cursor: default;
|
||||
white-space: nowrap;
|
||||
padding-left: 10px;
|
||||
height: 0px !important;
|
||||
width: 0px !important;
|
||||
overflow: hidden !important;
|
||||
border: none !important;
|
||||
padding: 0 !important;
|
||||
display: block !important;
|
||||
position: fixed !important;
|
||||
top: -10px !important;
|
||||
left: -10px !important;
|
||||
}
|
||||
|
||||
// Search
|
||||
// =========================
|
||||
// input
|
||||
.vim-mode-plus-search-container {
|
||||
display: flex;
|
||||
> div {
|
||||
padding: @component-padding/2 @component-padding;
|
||||
border: none;
|
||||
}
|
||||
.editor-container { width: 100%; }
|
||||
}
|
||||
|
||||
atom-text-editor[mini].vim-mode-plus-search {
|
||||
border: none;
|
||||
color: @text-color;
|
||||
cursor: default;
|
||||
&.is-focused { box-shadow: none; }
|
||||
&::before {
|
||||
font-size: 1.2em;
|
||||
padding-right: 0.5em;
|
||||
content: "/";
|
||||
}
|
||||
&.backwards::before { content: "?"; }
|
||||
}
|
||||
|
||||
@search-match-base: @syntax-result-marker-color;
|
||||
@search-match: hsla(hue(@search-match-base), saturation(@search-match-base), lightness(@search-match-base), 0.4);
|
||||
@search-match-first: fadeout(@syntax-color-renamed, 60%);
|
||||
@search-match-last: fadeout(@syntax-color-removed, 60%);
|
||||
@search-match-border-current: hsla(hue(@search-match-base), saturation(@search-match-base), lightness(@search-match-base), 1.0);
|
||||
@search-match-border-first: syntax-color-renamed;
|
||||
@search-match-border-last: syntax-color-removed;
|
||||
|
||||
atom-text-editor:not(.silent) {
|
||||
.vim-mode-plus-search-match {
|
||||
.region { background-color: @search-match; }
|
||||
&.first .region { background-color: @search-match-first; }
|
||||
&.last .region { background-color: @search-match-last; }
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes flash-find-char {
|
||||
from { border-color: @syntax-color-function; }
|
||||
to { border-color: transparent; }
|
||||
}
|
||||
|
||||
// highlight
|
||||
.round-box {
|
||||
box-sizing: border-box;
|
||||
border-radius: @component-border-radius;
|
||||
}
|
||||
|
||||
atom-text-editor {
|
||||
.vim-mode-plus-search-match {
|
||||
.region {
|
||||
.round-box();
|
||||
border: 2px solid transparent;
|
||||
transition: border-color 0.2s;
|
||||
}
|
||||
&.current .region {
|
||||
border-color: @search-match-border-current;
|
||||
transition-duration: 0.1s;
|
||||
}
|
||||
&.first.current .region {
|
||||
border-color: search-match-border-first;
|
||||
}
|
||||
&.last.current .region {
|
||||
border-color: @search-match-border-last;
|
||||
}
|
||||
}
|
||||
.vim-mode-plus-highlight-search .region {
|
||||
.round-box();
|
||||
border: 1px solid fadeout(@syntax-text-color, 70%);
|
||||
background-color: @syntax-selection-color;
|
||||
}
|
||||
.vim-mode-plus-persistent-selection .region {
|
||||
background-color: @syntax-selection-color;
|
||||
}
|
||||
.vim-mode-plus-target-range .region {
|
||||
background-color: @syntax-selection-color;
|
||||
}
|
||||
.vim-mode-plus-occurrence-base .region {
|
||||
box-sizing: border-box;
|
||||
border-bottom-width: 2px;
|
||||
border-bottom-style: dotted;
|
||||
|
||||
z-index: 1;
|
||||
border-color: @syntax-color-modified;
|
||||
}
|
||||
|
||||
.vim-mode-plus-find-char {
|
||||
.region {
|
||||
box-sizing: border-box;
|
||||
border-width: 0px;
|
||||
border-bottom-width: 2px;
|
||||
border-style: solid;
|
||||
}
|
||||
&.pre-confirm .region {
|
||||
border-color: @syntax-color-modified;
|
||||
&.current { border-bottom-width: 5px; }
|
||||
}
|
||||
&.post-confirm .region {
|
||||
.flash(flash-find-char, 2.0s);
|
||||
&.long { animation-duration: 4.0s; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Maximize Pane
|
||||
// =========================
|
||||
atom-workspace.vim-mode-plus--pane-maximized {
|
||||
atom-dock.left { display: none; }
|
||||
atom-dock.right { display: none; }
|
||||
atom-dock.bottom { display: none; }
|
||||
atom-pane-container {
|
||||
position: relative;
|
||||
atom-pane-axis:not(.vim-mode-plus--active-pane-axis) { display: none; }
|
||||
atom-pane {
|
||||
.item-views { background: @syntax-background-color !important; }
|
||||
display: none;
|
||||
&.vim-mode-plus--active-pane {
|
||||
display: flex;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
z-index: 100;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.vim-mode-plus--hide-tab-bar { .tab-bar { display: none; } }
|
||||
&.vim-mode-plus--hide-status-bar { .status-bar { display: none; } }
|
||||
&.vim-mode-plus--pane-centered {
|
||||
atom-text-editor:not(.mini) {
|
||||
margin-left: 20%;
|
||||
atom-text-editor {
|
||||
// Some package embed another text-editor into normal text-editor by using block decoration.
|
||||
// But we don't want this editor in editor centered again.
|
||||
// E.g. git-diff-details, inline-git-diff
|
||||
margin-left: 0%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// SelectList Highlight matched text
|
||||
// =========================
|
||||
.vim-mode-plus-select-list .list-group .character-match {
|
||||
color: @text-color-highlight;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.demo-mode-container {
|
||||
.kind {
|
||||
color: @text-color-selected;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
output eDP
|
||||
off
|
||||
output HDMI-A-0
|
||||
crtc 0
|
||||
mode 3840x2160
|
||||
pos 0x0
|
||||
primary
|
||||
rate 60.00
|
||||
@@ -1 +0,0 @@
|
||||
HDMI-A-0 00ffffffffffff00410c8fc16d040000271c0103803c22782a67a1a5554da2270e5054bfef00d1c0b30095008180814081c0010101014dd000a0f0703e803020350055502100001aa36600a0f0701f803020350055502100001a000000fc0050484c203237364538560a2020000000fd0017501ea03c000a20202020202001a7020333f14c9004031f1301125d5e5f606123090707830100006d030c001000387820006001020367d85dc401788003e30f000c565e00a0a0a029503020350055502100001e023a801871382d40582c450055502100001e011d007251d01e206e28550055502100001e4d6c80a070703e8030203a0055502100001a000000004e
|
||||
@@ -1,8 +0,0 @@
|
||||
output eDP
|
||||
off
|
||||
output HDMI-A-0
|
||||
crtc 0
|
||||
mode 3840x2160
|
||||
pos 0x0
|
||||
primary
|
||||
rate 60.00
|
||||
@@ -1 +0,0 @@
|
||||
$HOME/.bin/set-wacom-draw-area
|
||||
@@ -1,2 +0,0 @@
|
||||
HDMI-A-0 00ffffffffffff00410c8fc16d040000271c0103803c22782a67a1a5554da2270e5054bfef00d1c0b30095008180814081c0010101014dd000a0f0703e803020350055502100001aa36600a0f0701f803020350055502100001a000000fc0050484c203237364538560a2020000000fd0017501ea03c000a20202020202001a7020333f14c9004031f1301125d5e5f606123090707830100006d030c001000387820006001020367d85dc401788003e30f000c565e00a0a0a029503020350055502100001e023a801871382d40582c450055502100001e011d007251d01e206e28550055502100001e4d6c80a070703e8030203a0055502100001a000000004e
|
||||
eDP 00ffffffffffff0009e5d60800000000251d0104a51f1178031ef5965d5b91291c505400000001010101010101010101010101010101c0398018713828403020360035ae1000001a000000000000000000000000000000000000000000fe00424f452043510a202020202020000000fe004e5631343046484d2d4e34550a0011
|
||||
@@ -1,8 +0,0 @@
|
||||
output HDMI-A-0
|
||||
off
|
||||
output eDP
|
||||
crtc 0
|
||||
mode 1920x1080
|
||||
pos 0x0
|
||||
primary
|
||||
rate 60.00
|
||||
@@ -1 +0,0 @@
|
||||
eDP 00ffffffffffff0009e5d60800000000251d0104a51f1178031ef5965d5b91291c505400000001010101010101010101010101010101c0398018713828403020360035ae1000001a000000000000000000000000000000000000000000fe00424f452043510a202020202020000000fe004e5631343046484d2d4e34550a0011
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,3 +0,0 @@
|
||||
for i in ~/.mozilla/firefox/*.*default*
|
||||
do ln -s user.js "$i/user.js"
|
||||
done
|
||||
@@ -1,14 +0,0 @@
|
||||
/*
|
||||
* Note: has to be symlinked to profile directories for your
|
||||
* firefox release
|
||||
*
|
||||
* E.g.
|
||||
*
|
||||
* ```sh
|
||||
* ln -s user.js ~/.mozilla/firefox/*.default-release/user.js
|
||||
* ```
|
||||
* Or check out the `setup` script
|
||||
*
|
||||
*/
|
||||
|
||||
user_pref('browser.download.dir', '/home/h/dl')
|
||||
@@ -15,7 +15,7 @@ TYPE_ARROW=a
|
||||
TYPE_CIRCLE=o
|
||||
TYPE_CIRCLECOUNT=Shift+o
|
||||
TYPE_COMMIT_CURRENT_TOOL=Ctrl+Return
|
||||
TYPE_COPY=Ctrl+c
|
||||
TYPE_COPY=y
|
||||
TYPE_DELETE_CURRENT_TOOL=
|
||||
TYPE_DRAWER=l
|
||||
TYPE_EXIT=q
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
git_protocol: ssh
|
||||
prompt: enabled
|
||||
aliases:
|
||||
co: pr checkout
|
||||
c: repo clone
|
||||
f: repo fork
|
||||
rc: repo create
|
||||
rv: repo view
|
||||
re: repo edit
|
||||
rm: repo remove
|
||||
rn: repo rename
|
||||
lr: repo list
|
||||
li: issue list
|
||||
al: alias
|
||||
al-: alias delete
|
||||
co: pr checkout
|
||||
c: repo clone
|
||||
f: repo fork
|
||||
rc: repo create
|
||||
rv: repo view
|
||||
re: repo edit
|
||||
rm: repo remove
|
||||
rn: repo rename
|
||||
lr: repo list
|
||||
li: issue list
|
||||
al: alias
|
||||
al-: alias delete
|
||||
version: "1"
|
||||
|
||||
167
.config/kitty/kitty.conf
Normal file
167
.config/kitty/kitty.conf
Normal file
@@ -0,0 +1,167 @@
|
||||
#: Fonts {{{
|
||||
|
||||
font_family Iosevka Term SS08
|
||||
bold_font auto
|
||||
italic_font auto
|
||||
bold_italic_font auto
|
||||
font_size 12.0
|
||||
disable_ligatures never
|
||||
|
||||
# }}}
|
||||
|
||||
#: Cursor {{{
|
||||
|
||||
cursor_shape block
|
||||
cursor_blink_interval 0
|
||||
|
||||
#: }}}
|
||||
|
||||
#: Scrollback {{{
|
||||
|
||||
scrollback_lines 8192
|
||||
scrollbar scrolled
|
||||
scrollback_pager_history_size 1024
|
||||
|
||||
#: }}}
|
||||
|
||||
#: Mouse {{{
|
||||
|
||||
mouse_hide_wait 0.0
|
||||
paste_actions quote-urls-at-prompt,confirm
|
||||
|
||||
#: }}}
|
||||
|
||||
#: Performance tuning {{{
|
||||
|
||||
repaint_delay 8
|
||||
input_delay 2
|
||||
|
||||
#: }}}
|
||||
|
||||
#: Terminal bell {{{
|
||||
|
||||
enable_audio_bell yes
|
||||
window_alert_on_bell yes
|
||||
|
||||
#: }}}
|
||||
|
||||
#: Window layout {{{
|
||||
|
||||
remember_window_size no
|
||||
remember_window_position no
|
||||
enabled_layouts *
|
||||
hide_window_decorations yes
|
||||
|
||||
#: }}}
|
||||
|
||||
#: Tab bar {{{
|
||||
|
||||
tab_bar_edge top
|
||||
tab_bar_style powerline
|
||||
tab_bar_min_tabs 1
|
||||
tab_powerline_style slanted
|
||||
tab_activity_symbol !
|
||||
tab_title_template "{index}{fmt.fg.red}{bell_symbol}{fmt.fg.tab}{activity_symbol}:{tab.last_focused_progress_percent}{title}"
|
||||
|
||||
#: }}}
|
||||
|
||||
#: Advanced {{{
|
||||
|
||||
notify_on_cmd_finish unfocused
|
||||
|
||||
#: }}}
|
||||
|
||||
#: OS specific tweaks {{{
|
||||
|
||||
linux_display_server auto
|
||||
wayland_enable_ime no
|
||||
|
||||
#: }}}
|
||||
|
||||
#: Keyboard shortcuts {{{
|
||||
|
||||
kitty_mod ctrl+shift
|
||||
map kitty_mod+c copy_to_clipboard
|
||||
map kitty_mod+v paste_from_clipboard
|
||||
map cmd+v
|
||||
# map kitty_mod+o pass_selection_to_program
|
||||
# map kitty_mod+o pass_selection_to_program firefox
|
||||
# map kitty_mod+y new_window less @selection
|
||||
map kitty_mod+z scroll_to_prompt -1
|
||||
map kitty_mod+x scroll_to_prompt 1
|
||||
map kitty_mod+h show_scrollback
|
||||
# map f1 launch --stdin-source=@screen_scrollback --stdin-add-formatting --type=overlay less +G -R
|
||||
#:: For more details on piping screen and buffer contents to external
|
||||
#:: programs, see launch <https://sw.kovidgoyal.net/kitty/launch/>.
|
||||
# map kitty_mod+g show_last_command_output
|
||||
# map kitty_mod+enter launch --cwd=current
|
||||
# map cmd+enter
|
||||
# map ctrl+n launch --location=neighbor
|
||||
# map ctrl+f launch --location=first
|
||||
map kitty_mod+n
|
||||
map cmd+n
|
||||
map kitty_mod+w
|
||||
map shift+cmd+d
|
||||
map kitty_mod+]
|
||||
map kitty_mod+[
|
||||
map kitty_mod+f
|
||||
map kitty_mod+b
|
||||
map kitty_mod+`
|
||||
map kitty_mod+r
|
||||
map cmd+r
|
||||
map kitty_mod+1
|
||||
map cmd+1
|
||||
map kitty_mod+2
|
||||
map cmd+2
|
||||
map kitty_mod+3
|
||||
map cmd+3
|
||||
map kitty_mod+4
|
||||
map cmd+4
|
||||
map kitty_mod+5
|
||||
map cmd+5
|
||||
map kitty_mod+6
|
||||
map cmd+6
|
||||
map kitty_mod+7
|
||||
map cmd+7
|
||||
map kitty_mod+8
|
||||
map cmd+8
|
||||
map kitty_mod+9
|
||||
map cmd+9
|
||||
map kitty_mod+0
|
||||
map f1 goto_tab 1
|
||||
map f2 goto_tab 2
|
||||
map f3 goto_tab 3
|
||||
map f4 goto_tab 4
|
||||
map f5 goto_tab 5
|
||||
map f6 goto_tab 6
|
||||
map f7 goto_tab 7
|
||||
map f8 goto_tab 8
|
||||
map kitty_mod+c new_tab
|
||||
map cmd+t
|
||||
map kitty_mod+q
|
||||
map cmd+w
|
||||
map kitty_mod+.
|
||||
map kitty_mod+,
|
||||
map kitty_mod+alt+t
|
||||
map shift+cmd+i
|
||||
map kitty_mod+f1
|
||||
map kitty_mod+f11
|
||||
map ctrl+cmd+f
|
||||
map kitty_mod+f10
|
||||
map opt+cmd+s
|
||||
map kitty_mod+u kitten unicode_input
|
||||
map ctrl+cmd+space
|
||||
map kitty_mod+/ kitty_shell window
|
||||
map kitty_mod+f5
|
||||
map kitty_mod+r load_config_file
|
||||
|
||||
map shift+cmd+/
|
||||
map cmd+h
|
||||
map opt+cmd+
|
||||
map cmd+m
|
||||
map cmd+q
|
||||
|
||||
#: }}}
|
||||
|
||||
include ./themes/zenwritten_dark.conf
|
||||
include ./nvim.conf
|
||||
8
.config/kitty/nvim.conf
Normal file
8
.config/kitty/nvim.conf
Normal file
@@ -0,0 +1,8 @@
|
||||
allow_remote_control socket-only
|
||||
listen_on unix:/tmp/kitty
|
||||
shell_integration enabled
|
||||
|
||||
action_alias kitty_scrollback_nvim kitten ~/.local/share/nvim/site/pack/paqs/start/kitty-scrollback.nvim/python/kitty_scrollback_nvim.py
|
||||
map kitty_mod+h kitty_scrollback_nvim
|
||||
map kitty_mod+g kitty_scrollback_nvim --config ksb_builtin_last_cmd_output
|
||||
mouse_map ctrl+shift+right press ungrabbed combine : mouse_select_command_output : kitty_scrollback_nvim --config ksb_builtin_last_visited_cmd_output
|
||||
49
.config/kitty/themes/zenwritten_dark.conf
Normal file
49
.config/kitty/themes/zenwritten_dark.conf
Normal file
@@ -0,0 +1,49 @@
|
||||
# This file is auto-generated by shipwright.nvim
|
||||
# vim:ft=kitty
|
||||
## name: zenwritten_dark
|
||||
## author: Michael Chris Lopez
|
||||
## license: MIT
|
||||
## upstream: https://github.com/mcchrish/zenbones.nvim/raw/main/extras/kitty/zenwritten_dark.conf
|
||||
## blurb: A zenbones variant with zero hue and saturation.
|
||||
foreground #BBBBBB
|
||||
background #191919
|
||||
selection_foreground #BBBBBB
|
||||
selection_background #404040
|
||||
# Cursor colors
|
||||
cursor #C9C9C9
|
||||
cursor_text_color #191919
|
||||
# URL underline color when hovering with mouse
|
||||
# kitty window border colors
|
||||
# OS Window titlebar colors
|
||||
# Tab bar colors
|
||||
active_tab_foreground #BBBBBB
|
||||
active_tab_background #65435E
|
||||
inactive_tab_foreground #BBBBBB
|
||||
inactive_tab_background #303030
|
||||
# Colors for marks (marked text in the terminal)
|
||||
# The basic 16 colors
|
||||
# black
|
||||
color0 #191919
|
||||
color8 #3D3839
|
||||
# red
|
||||
color1 #DE6E7C
|
||||
color9 #E8838F
|
||||
# green
|
||||
color2 #819B69
|
||||
color10 #8BAE68
|
||||
# yellow
|
||||
color3 #B77E64
|
||||
color11 #D68C67
|
||||
# blue
|
||||
color4 #6099C0
|
||||
color12 #61ABDA
|
||||
# magenta
|
||||
color5 #B279A7
|
||||
color13 #CF86C1
|
||||
# cyan
|
||||
color6 #66A5AD
|
||||
color14 #65B8C1
|
||||
# white
|
||||
color7 #BBBBBB
|
||||
color15 #8E8E8E
|
||||
# You can set the remaining 240 colors as color16 to color255.
|
||||
49
.config/kitty/themes/zenwritten_light.conf
Normal file
49
.config/kitty/themes/zenwritten_light.conf
Normal file
@@ -0,0 +1,49 @@
|
||||
# This file is auto-generated by shipwright.nvim
|
||||
# vim:ft=kitty
|
||||
## name: zenwritten_light
|
||||
## author: Michael Chris Lopez
|
||||
## license: MIT
|
||||
## upstream: https://github.com/mcchrish/zenbones.nvim/raw/main/extras/kitty/zenwritten_light.conf
|
||||
## blurb: A zenbones variant with zero hue and saturation.
|
||||
foreground #353535
|
||||
background #EEEEEE
|
||||
selection_foreground #353535
|
||||
selection_background #D7D7D7
|
||||
# Cursor colors
|
||||
cursor #353535
|
||||
cursor_text_color #EEEEEE
|
||||
# URL underline color when hovering with mouse
|
||||
# kitty window border colors
|
||||
# OS Window titlebar colors
|
||||
# Tab bar colors
|
||||
active_tab_foreground #353535
|
||||
active_tab_background #DEB9D6
|
||||
inactive_tab_foreground #353535
|
||||
inactive_tab_background #CFCFCF
|
||||
# Colors for marks (marked text in the terminal)
|
||||
# The basic 16 colors
|
||||
# black
|
||||
color0 #EEEEEE
|
||||
color8 #C6C3C3
|
||||
# red
|
||||
color1 #A8334C
|
||||
color9 #94253E
|
||||
# green
|
||||
color2 #4F6C31
|
||||
color10 #3F5A22
|
||||
# yellow
|
||||
color3 #944927
|
||||
color11 #803D1C
|
||||
# blue
|
||||
color4 #286486
|
||||
color12 #1D5573
|
||||
# magenta
|
||||
color5 #88507D
|
||||
color13 #7B3B70
|
||||
# cyan
|
||||
color6 #3B8992
|
||||
color14 #2B747C
|
||||
# white
|
||||
color7 #353535
|
||||
color15 #5C5C5C
|
||||
# You can set the remaining 240 colors as color16 to color255.
|
||||
@@ -13,4 +13,3 @@ K add video-pan-y 0.01
|
||||
J add video-pan-y -0.01
|
||||
|
||||
m cycle mute
|
||||
s subs
|
||||
|
||||
@@ -48,8 +48,6 @@ local user_opts = {
|
||||
seekrangeseparate = true, -- wether the seekranges overlay on the bar-style seekbar
|
||||
seekrangealpha = 210, -- transparency of seekranges
|
||||
seekbarkeyframes = true, -- use keyframes when dragging the seekbar
|
||||
title = "${media-title}", -- string compatible with property-expansion
|
||||
-- to be shown as OSC title
|
||||
tooltipborder = 1, -- border of tooltip in bottom/topbar
|
||||
tooltipfontsize = 17.5,
|
||||
tooltipseekbar = false, -- following cursor bar over the playback seekbar
|
||||
|
||||
1
.config/nix/nix.conf
Normal file
1
.config/nix/nix.conf
Normal file
@@ -0,0 +1 @@
|
||||
experimental-features = nix-command flakes
|
||||
6
.config/nvim/README.md
Normal file
6
.config/nvim/README.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# Neovim configuration
|
||||
|
||||
My neovim configuration. Available as a Nix flake [^nixcats]. When installing manually,
|
||||
`paq.nvim` is used as a fallback plugin manager.
|
||||
|
||||
[^nixcats]: Based on [this nixCats `example` template](https://github.com/BirdeeHub/nixCats-nvim/tree/77dffad8235eb77684fcb7599487c8e9f23d5b8f/templates/example)
|
||||
@@ -1,3 +1,4 @@
|
||||
vim.cmd([[
|
||||
function GetClozeNumber()
|
||||
let REGEX_CLOZE_START = '{{c\d\+::'
|
||||
|
||||
@@ -33,3 +34,4 @@ let g:sandwich#recipes += [
|
||||
\ 'nesting': 1
|
||||
\ }
|
||||
\ ]
|
||||
]])
|
||||
3
.config/nvim/after/plugin/auto-session.lua
Normal file
3
.config/nvim/after/plugin/auto-session.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
require("auto-session").setup({
|
||||
auto_session_enabled = vim.env.KITTY_SCROLLBACK_NVIM ~= "true", -- See kitty-scrollback.nvim
|
||||
})
|
||||
16
.config/nvim/after/plugin/codecompanion.nvim.lua
Normal file
16
.config/nvim/after/plugin/codecompanion.nvim.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
require("codecompanion").setup({
|
||||
extensions = {
|
||||
mcphub = {
|
||||
callback = "mcphub.extensions.codecompanion",
|
||||
opts = {
|
||||
make_vars = true,
|
||||
make_slash_commands = true,
|
||||
show_result_in_chat = true
|
||||
}
|
||||
}
|
||||
},
|
||||
strategies = {
|
||||
chat = { adapter = "openai" },
|
||||
inline = { adapter = "openai" },
|
||||
},
|
||||
})
|
||||
29
.config/nvim/after/plugin/conform.lua
Normal file
29
.config/nvim/after/plugin/conform.lua
Normal file
@@ -0,0 +1,29 @@
|
||||
require("conform").setup({
|
||||
format_after_save = {
|
||||
lsp_fallback = false,
|
||||
async = false,
|
||||
timeout_ms = 500,
|
||||
},
|
||||
formatters_by_ft = {
|
||||
awk = { "awk" },
|
||||
bash = { "shellcheck" },
|
||||
c = { "clang-format" },
|
||||
cpp = { "clang-format" },
|
||||
css = { "prettierd", "prettier", stop_after_first = true },
|
||||
gdscript = { "gdformat" },
|
||||
haskell = { "ormolu" },
|
||||
html = { "prettierd", "prettier", stop_after_first = true },
|
||||
lua = { "stylua" }, -- configured in stylua.toml
|
||||
markdown = { "prettierd", "prettier", stop_after_first = true },
|
||||
nix = { "nixfmt" },
|
||||
javascript = { "eslint_d", "eslint", "prettierd", "prettier", stop_after_first = true },
|
||||
javascriptreact = { "eslint_d", "eslint", "prettierd", "prettier", stop_after_first = true },
|
||||
json = { "prettierd", "prettier", stop_after_first = true },
|
||||
jsonc = { "prettierd", "prettier", stop_after_first = true },
|
||||
python = { "isort", "black" },
|
||||
svelte = { "eslint_d", "prettierd", "prettier", stop_after_first = true },
|
||||
typescript = { "eslint_d", "prettierd", "prettier", stop_after_first = true },
|
||||
typescriptreact = { "eslint_d", "eslint", "prettierd", "prettier", stop_after_first = true },
|
||||
-- yaml = { "prettierd", "prettier", stop_after_first = true },
|
||||
},
|
||||
})
|
||||
1
.config/nvim/after/plugin/copilot-cmp.lua
Normal file
1
.config/nvim/after/plugin/copilot-cmp.lua
Normal file
@@ -0,0 +1 @@
|
||||
require("copilot_cmp").setup()
|
||||
1
.config/nvim/after/plugin/copilot.lua
Normal file
1
.config/nvim/after/plugin/copilot.lua
Normal file
@@ -0,0 +1 @@
|
||||
require("copilot").setup({})
|
||||
7
.config/nvim/after/plugin/eyeliner.nvim.lua
Normal file
7
.config/nvim/after/plugin/eyeliner.nvim.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
require("eyeliner").setup({
|
||||
highlight_on_key = true,
|
||||
dim = true,
|
||||
})
|
||||
|
||||
vim.api.nvim_set_hl(0, "EyelinerPrimary", { bold = true, underline = true })
|
||||
vim.api.nvim_set_hl(0, "EyelinerSecondary", { underline = true })
|
||||
16
.config/nvim/after/plugin/fzf-lua.lua
Normal file
16
.config/nvim/after/plugin/fzf-lua.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
local fzf = require("fzf-lua")
|
||||
|
||||
fzf.setup({ "max-perf" })
|
||||
|
||||
vim.keymap.set("n", "<leader>f<leader>", fzf.builtin) -- Help
|
||||
vim.keymap.set("n", "<leader>fc", fzf.commands)
|
||||
vim.keymap.set("n", "<leader>ff", fzf.files)
|
||||
vim.keymap.set("n", "<leader>fg", fzf.live_grep_native)
|
||||
vim.keymap.set("n", "<leader>fb", fzf.buffers)
|
||||
vim.keymap.set("n", "<leader>fd", fzf.diagnostics_workspace)
|
||||
vim.keymap.set("n", "<leader>fhe", fzf.help_tags)
|
||||
vim.keymap.set("n", "<leader>fhi", fzf.search_history)
|
||||
vim.keymap.set("n", "<leader>fma", fzf.marks)
|
||||
vim.keymap.set("n", "<leader>fma", fzf.man_pages)
|
||||
|
||||
vim.keymap.set("i", "<c-f>", fzf.complete_path)
|
||||
12
.config/nvim/after/plugin/gitsigns.nvim.lua
Normal file
12
.config/nvim/after/plugin/gitsigns.nvim.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
local gitsigns = require("gitsigns")
|
||||
|
||||
gitsigns.setup({
|
||||
current_line_blame_formatter = "<author>, <author_time:%R> - <summary>",
|
||||
linehl = true,
|
||||
current_line_blame_opts = {
|
||||
delay = 0,
|
||||
virt_text_pos = "right_align",
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command("Blame", gitsigns.toggle_current_line_blame, { nargs = "?" })
|
||||
10
.config/nvim/after/plugin/image.nvim.lua
Normal file
10
.config/nvim/after/plugin/image.nvim.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
require("image").setup({
|
||||
backend = "kitty",
|
||||
kitty_method = "normal",
|
||||
processor = "magick_cli",
|
||||
integrations = {
|
||||
markdown = {
|
||||
filetypes = { "markdown", "pandoc" },
|
||||
},
|
||||
},
|
||||
})
|
||||
1
.config/nvim/after/plugin/kitty-scrollback.nvim.lua
Normal file
1
.config/nvim/after/plugin/kitty-scrollback.nvim.lua
Normal file
@@ -0,0 +1 @@
|
||||
require("kitty-scrollback").setup()
|
||||
7
.config/nvim/after/plugin/lsp_lines.lua
Normal file
7
.config/nvim/after/plugin/lsp_lines.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
require("lsp_lines").setup()
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
})
|
||||
|
||||
vim.keymap.set("", "<leader>dd", require("lsp_lines").toggle, { desc = "Toggle lsp_lines" })
|
||||
178
.config/nvim/after/plugin/lspconfig.lua
Normal file
178
.config/nvim/after/plugin/lspconfig.lua
Normal file
@@ -0,0 +1,178 @@
|
||||
require("neodev").setup() -- should setup before lspconfig
|
||||
|
||||
-- vim.g.coq_settings = { auto_start = 'shut-up' }
|
||||
-- local capabilities = coq.lsp_ensure_capabilities()
|
||||
|
||||
local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
||||
local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
|
||||
local servers = {
|
||||
bashls = {},
|
||||
eslint = {
|
||||
settings = {
|
||||
--Assuming prettier/prettierd will handle formatting, we don't need to see these errors
|
||||
rulesCustomizations = {
|
||||
{ rule = "prettier/prettier", severity = "off" },
|
||||
},
|
||||
format = false,
|
||||
},
|
||||
},
|
||||
emmet_language_server = {},
|
||||
gdscript = {},
|
||||
helm_ls = {
|
||||
filetypes = { "yaml", "helm", "yaml.helm-values" },
|
||||
},
|
||||
hls = { filetypes = { "haskell", "lhaskell", "cabal" } },
|
||||
html = {},
|
||||
jsonls = {
|
||||
settings = {
|
||||
json = {
|
||||
schemas = require("schemastore").json.schemas(),
|
||||
validate = { enable = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
lua_ls = {
|
||||
on_init = function(client)
|
||||
if client.workspace_folders then
|
||||
local path = client.workspace_folders[1].name
|
||||
if
|
||||
path ~= vim.fn.stdpath("config")
|
||||
and (vim.uv.fs_stat(path .. "/.luarc.json") or vim.uv.fs_stat(path .. "/.luarc.jsonc"))
|
||||
then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, {
|
||||
runtime = {
|
||||
version = "LuaJIT",
|
||||
path = {
|
||||
"lua/?.lua",
|
||||
"lua/?/init.lua",
|
||||
},
|
||||
},
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
library = {
|
||||
vim.env.VIMRUNTIME,
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
settings = {
|
||||
Lua = {},
|
||||
},
|
||||
},
|
||||
-- marksman = {},
|
||||
nixd = {},
|
||||
pyright = {},
|
||||
-- tsserver = {},
|
||||
svelte = {
|
||||
plugin = {
|
||||
svelte = {
|
||||
defaultScriptLanguage = "ts",
|
||||
},
|
||||
},
|
||||
},
|
||||
tailwindcss = {},
|
||||
-- vtsls = {},
|
||||
ts_ls = {},
|
||||
-- vtsls = {
|
||||
-- maxTsServerMemory = 16384,
|
||||
-- filetypes = {
|
||||
-- "javascript",
|
||||
-- "javascriptreact",
|
||||
-- "javascript.jsx",
|
||||
-- "typescript",
|
||||
-- "typescriptreact",
|
||||
-- "typescript.tsx",
|
||||
-- },
|
||||
-- settings = {
|
||||
-- complete_function_calls = true,
|
||||
-- vtsls = {
|
||||
-- enableMoveToFileCodeAction = true,
|
||||
-- autoUseWorkspaceTsdk = true,
|
||||
-- experimental = {
|
||||
-- completion = {
|
||||
-- enableServerSideFuzzyMatch = true,
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- typescript = {
|
||||
-- updateImportsOnFileMove = { enabled = "always" },
|
||||
-- suggest = {
|
||||
-- completeFunctionCalls = true,
|
||||
-- },
|
||||
-- inlayHints = {
|
||||
-- enumMemberValues = { enabled = true },
|
||||
-- functionLikeReturnTypes = { enabled = true },
|
||||
-- parameterNames = { enabled = "literals" },
|
||||
-- parameterTypes = { enabled = true },
|
||||
-- propertyDeclarationTypes = { enabled = true },
|
||||
-- variableTypes = { enabled = false },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
yamlls = {
|
||||
settings = {
|
||||
yaml = {
|
||||
schemaStore = {
|
||||
-- You must disable built-in schemaStore support if you want to use
|
||||
-- this plugin and its advanced options like `ignore`.
|
||||
enable = false,
|
||||
-- Avoid TypeError: Cannot read properties of undefined (reading 'length')
|
||||
url = "",
|
||||
},
|
||||
schemas = require("schemastore").yaml.schemas(),
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for server, config in pairs(servers) do
|
||||
config.capabilities = capabilities
|
||||
vim.lsp.config(server, config)
|
||||
end
|
||||
|
||||
vim.lsp.enable(vim.tbl_keys(servers))
|
||||
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
callback = function(e)
|
||||
local opts = { buffer = e.bufnr }
|
||||
local set = vim.keymap.set
|
||||
local lsp_buf = vim.lsp.buf
|
||||
set("n", "gD", lsp_buf.declaration, opts)
|
||||
set("n", "gd", lsp_buf.definition, opts)
|
||||
set("n", "K", lsp_buf.hover, opts)
|
||||
set("n", "gi", lsp_buf.implementation, opts)
|
||||
set("n", "<C-k>", lsp_buf.signature_help, opts)
|
||||
set("n", "<space>wa", lsp_buf.add_workspace_folder, opts)
|
||||
set("n", "<space>wr", lsp_buf.remove_workspace_folder, opts)
|
||||
set("n", "<space>wl", function()
|
||||
print(vim.inspect(lsp_buf.list_workspace_folders()))
|
||||
end, opts)
|
||||
set("n", "<space>D", lsp_buf.type_definition, opts)
|
||||
set("n", "<space>rn", lsp_buf.rename, opts)
|
||||
set({ "n", "v" }, "<space>ca", lsp_buf.code_action, opts)
|
||||
set("n", "gr", lsp_buf.references, opts)
|
||||
|
||||
-- Taken from https://blog.viktomas.com/graph/neovim-lsp-rename-normal-mode-keymaps/
|
||||
set("n", "<leader>r", vim.lsp.buf.rename)
|
||||
-- function()
|
||||
-- -- Automatically switch to `cmdwin` for normal mode renaming
|
||||
-- -- (normally you would have to press <C-f> to open the `cmdwin`)
|
||||
-- vim.api.nvim_create_autocmd({ "CmdlineEnter" }, {
|
||||
-- callback = function()
|
||||
-- local key = vim.api.nvim_replace_termcodes("<C-f>", true, false, true)
|
||||
-- vim.api.nvim_feedkeys(key, "c", false)
|
||||
-- vim.api.nvim_feedkeys("0", "n", false)
|
||||
-- return true
|
||||
-- end,
|
||||
-- })
|
||||
-- vim.lsp.buf.rename()
|
||||
-- end, bufoptsWithDesc("Rename symbol")
|
||||
-- )
|
||||
end,
|
||||
})
|
||||
313
.config/nvim/after/plugin/luasnip.lua
Normal file
313
.config/nvim/after/plugin/luasnip.lua
Normal file
@@ -0,0 +1,313 @@
|
||||
local ls = require("luasnip")
|
||||
|
||||
local s = ls.snippet
|
||||
local sn = ls.snippet_node
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
local f = ls.function_node
|
||||
local c = ls.choice_node
|
||||
local d = ls.dynamic_node
|
||||
local r = ls.restore_node
|
||||
local l = require("luasnip.extras").lambda
|
||||
local rep = require("luasnip.extras").rep
|
||||
local p = require("luasnip.extras").partial
|
||||
local m = require("luasnip.extras").match
|
||||
local n = require("luasnip.extras").nonempty
|
||||
local dl = require("luasnip.extras").dynamic_lambda
|
||||
local fmt = require("luasnip.extras.fmt").fmt
|
||||
local fmta = require("luasnip.extras.fmt").fmta
|
||||
local conds = require("luasnip.extras.expand_conditions")
|
||||
|
||||
ls.config.set_config({
|
||||
history = true,
|
||||
update_events = "TextChanged,TextChangedI",
|
||||
delete_check_events = "TextChanged",
|
||||
ext_prio_increase = 1,
|
||||
enable_autosnippets = true,
|
||||
store_selection_keys = "<Tab>",
|
||||
})
|
||||
|
||||
local function copy(args)
|
||||
return args[1]
|
||||
end
|
||||
|
||||
local function bash(_, _, command)
|
||||
local file = io.popen(command, "r")
|
||||
local res = {}
|
||||
if file then
|
||||
for line in file:lines() do
|
||||
table.insert(res, line)
|
||||
end
|
||||
end
|
||||
return res
|
||||
end
|
||||
|
||||
local date_input = function(args, snip, old_state, date_format)
|
||||
print(args, snip, old_state)
|
||||
return sn(nil, i(1, os.date(date_format or "%Y-%m-%d")))
|
||||
end
|
||||
|
||||
-- -- FIXME: EXAMPLE
|
||||
-- ls.add_snippets("all", {
|
||||
-- -- arg1: trigger `fn`,
|
||||
-- -- arg2: nodes to insert into buffer on expansion.
|
||||
-- s("fn", {
|
||||
-- t("//Parameters: "), -- Text.
|
||||
-- f(copy, 2), -- 1: function, 2: placeholders to copy text from
|
||||
-- t({ "", "function " }), -- placeholder/insert.
|
||||
-- i(1),
|
||||
-- t("("), -- placeholder with initial text.
|
||||
-- i(2, "int foo"), -- linebreak
|
||||
-- t({ ") {", "\t" }), -- last placeholder, snippet exit point
|
||||
-- i(0),
|
||||
-- t({ "", "}" }),
|
||||
-- }),
|
||||
-- s("class", {
|
||||
-- -- Choice: Switch between two different Nodes, first parameter is its position, second a list of nodes.
|
||||
-- c(1, {
|
||||
-- t("public "),
|
||||
-- t("private "),
|
||||
-- }),
|
||||
-- t("class "),
|
||||
-- i(2),
|
||||
-- t(" "),
|
||||
-- c(3, {
|
||||
-- t("{"),
|
||||
-- -- sn: Nested Snippet. Instead of a trigger, it has a position, just like insert-nodes. !!! These don't expect a 0-node!!!!
|
||||
-- -- Inside Choices, Nodes don't need a position as the choice node is the one being jumped to.
|
||||
-- sn(nil, {
|
||||
-- t("extends "),
|
||||
-- -- restoreNode: stores and restores nodes.
|
||||
-- -- pass position, store-key and nodes.
|
||||
-- r(1, "other_class", i(1)),
|
||||
-- t(" {"),
|
||||
-- }),
|
||||
-- sn(nil, {
|
||||
-- t("implements "),
|
||||
-- -- no need to define the nodes for a given key a second time.
|
||||
-- r(1, "other_class"),
|
||||
-- t(" {"),
|
||||
-- }),
|
||||
-- }),
|
||||
-- t({ "", "\t" }),
|
||||
-- i(0),
|
||||
-- t({ "", "}" }),
|
||||
-- }),
|
||||
-- -- Alternative printf-like notation for defining snippets. It uses format
|
||||
-- -- string with placeholders similar to the ones used with Python's .format().
|
||||
-- s(
|
||||
-- "fmt1",
|
||||
-- fmt("To {title} {} {}.", {
|
||||
-- i(2, "Name"),
|
||||
-- i(3, "Surname"),
|
||||
-- title = c(1, { t("Mr."), t("Ms.") }),
|
||||
-- })
|
||||
-- ),
|
||||
-- -- To escape delimiters use double them, e.g. `{}` -> `{{}}`.
|
||||
-- -- Multi-line format strings by default have empty first/last line removed.
|
||||
-- -- Indent common to all lines is also removed. Use the third `opts` argument
|
||||
-- -- to control this behaviour.
|
||||
-- s(
|
||||
-- "fmt2",
|
||||
-- fmt(
|
||||
-- [[
|
||||
-- foo({1}, {3}) {{
|
||||
-- return {2} * {4}
|
||||
-- }}
|
||||
-- ]],
|
||||
-- {
|
||||
-- i(1, "x"),
|
||||
-- rep(1),
|
||||
-- i(2, "y"),
|
||||
-- rep(2),
|
||||
-- }
|
||||
-- )
|
||||
-- ),
|
||||
-- -- Empty placeholders are numbered automatically starting from 1 or the last
|
||||
-- -- value of a numbered placeholder. Named placeholders do not affect numbering.
|
||||
-- s(
|
||||
-- "fmt3",
|
||||
-- fmt("{} {a} {} {1} {}", {
|
||||
-- t("1"),
|
||||
-- t("2"),
|
||||
-- a = t("A"),
|
||||
-- })
|
||||
-- ),
|
||||
-- -- The delimiters can be changed from the default `{}` to something else.
|
||||
-- s("fmt4", fmt("foo() { return []; }", i(1, "x"), { delimiters = "[]" })),
|
||||
-- -- `fmta` is a convenient wrapper that uses `<>` instead of `{}`.
|
||||
-- s("fmt5", fmta("foo() { return <>; }", i(1, "x"))),
|
||||
-- -- By default all args must be used. Use strict=false to disable the check
|
||||
-- s(
|
||||
-- "fmt6",
|
||||
-- fmt("use {} only", { t("this"), t("not this") }, { strict = false })
|
||||
-- ),
|
||||
-- -- Use a dynamic_node to interpolate the output of a
|
||||
-- -- function (see date_input above) into the initial
|
||||
-- -- value of an insert_node.
|
||||
-- s("novel", {
|
||||
-- t("It was a dark and stormy night on "),
|
||||
-- d(1, date_input, {}, { user_args = { "%A, %B %d of %Y" } }),
|
||||
-- t(" and the clocks were striking thirteen."),
|
||||
-- }),
|
||||
-- -- Parsing snippets: First parameter: Snippet-Trigger, Second: Snippet body.
|
||||
-- -- Placeholders are parsed into choices with 1. the placeholder text(as a snippet) and 2. an empty string.
|
||||
-- -- This means they are not SELECTed like in other editors/Snippet engines.
|
||||
-- ls.parser.parse_snippet(
|
||||
-- "lspsyn",
|
||||
-- "Wow! This ${1:Stuff} really ${2:works. ${3:Well, a bit.}}"
|
||||
-- ),
|
||||
|
||||
-- -- When wordTrig is set to false, snippets may also expand inside other words.
|
||||
-- ls.parser.parse_snippet(
|
||||
-- { trig = "te", wordTrig = false },
|
||||
-- "${1:cond} ? ${2:true} : ${3:false}"
|
||||
-- ),
|
||||
|
||||
-- -- When regTrig is set, trig is treated like a pattern, this snippet will expand after any number.
|
||||
-- ls.parser.parse_snippet({ trig = "%d", regTrig = true }, "A Number!!"),
|
||||
-- -- Using the condition, it's possible to allow expansion only in specific cases.
|
||||
-- s("cond", {
|
||||
-- t("will only expand in c-style comments"),
|
||||
-- }, {
|
||||
-- condition = function(line_to_cursor, matched_trigger, captures)
|
||||
-- -- optional whitespace followed by //
|
||||
-- return line_to_cursor:match("%s*//")
|
||||
-- end,
|
||||
-- }),
|
||||
-- -- there's some built-in conditions in "luasnip.extras.expand_conditions".
|
||||
-- s("cond2", {
|
||||
-- t("will only expand at the beginning of the line"),
|
||||
-- }, {
|
||||
-- condition = conds.line_begin,
|
||||
-- }),
|
||||
-- -- The last entry of args passed to the user-function is the surrounding snippet.
|
||||
-- s(
|
||||
-- { trig = "a%d", regTrig = true },
|
||||
-- f(function(_, snip)
|
||||
-- return "Triggered with " .. snip.trigger .. "."
|
||||
-- end, {})
|
||||
-- ),
|
||||
-- -- It's possible to use capture-groups inside regex-triggers.
|
||||
-- s(
|
||||
-- { trig = "b(%d)", regTrig = true },
|
||||
-- f(function(_, snip)
|
||||
-- return "Captured Text: " .. snip.captures[1] .. "."
|
||||
-- end, {})
|
||||
-- ),
|
||||
-- s({ trig = "c(%d+)", regTrig = true }, {
|
||||
-- t("will only expand for even numbers"),
|
||||
-- }, {
|
||||
-- condition = function(line_to_cursor, matched_trigger, captures)
|
||||
-- return tonumber(captures[1]) % 2 == 0
|
||||
-- end,
|
||||
-- }),
|
||||
-- -- Use a function to execute any shell command and print its text.
|
||||
-- s("bash", f(bash, {}, "ls")),
|
||||
-- -- Short version for applying String transformations using function nodes.
|
||||
-- s("transform", {
|
||||
-- i(1, "initial text"),
|
||||
-- t({ "", "" }),
|
||||
-- -- lambda nodes accept an l._1,2,3,4,5, which in turn accept any string transformations.
|
||||
-- -- This list will be applied in order to the first node given in the second argument.
|
||||
-- l(l._1:match("[^i]*$"):gsub("i", "o"):gsub(" ", "_"):upper(), 1),
|
||||
-- }),
|
||||
|
||||
-- s("transform2", {
|
||||
-- i(1, "initial text"),
|
||||
-- t("::"),
|
||||
-- i(2, "replacement for e"),
|
||||
-- t({ "", "" }),
|
||||
-- -- Lambdas can also apply transforms USING the text of other nodes:
|
||||
-- l(l._1:gsub("e", l._2), { 1, 2 }),
|
||||
-- }),
|
||||
-- s({ trig = "trafo(%d+)", regTrig = true }, {
|
||||
-- -- env-variables and captures can also be used:
|
||||
-- l(l.CAPTURE1:gsub("1", l.TM_FILENAME), {}),
|
||||
-- }),
|
||||
-- -- Set store_selection_keys = "<Tab>" (for example) in your
|
||||
-- -- luasnip.config.setup() call to populate
|
||||
-- -- TM_SELECTED_TEXT/SELECT_RAW/SELECT_DEDENT.
|
||||
-- -- In this case: select a URL, hit Tab, then expand this snippet.
|
||||
-- s("link_url", {
|
||||
-- t('<a href="'),
|
||||
-- f(function(_, snip)
|
||||
-- -- TM_SELECTED_TEXT is a table to account for multiline-selections.
|
||||
-- -- In this case only the first line is inserted.
|
||||
-- return snip.env.TM_SELECTED_TEXT[1] or {}
|
||||
-- end, {}),
|
||||
-- t('">'),
|
||||
-- i(1),
|
||||
-- t("</a>"),
|
||||
-- i(0),
|
||||
-- }),
|
||||
-- -- Shorthand for repeating the text in a given node.
|
||||
-- s("repeat", { i(1, "text"), t({ "", "" }), rep(1) }),
|
||||
-- -- Directly insert the ouput from a function evaluated at runtime.
|
||||
-- s("part", p(os.date, "%Y")),
|
||||
-- -- use matchNodes (`m(argnode, condition, then, else)`) to insert text
|
||||
-- -- based on a pattern/function/lambda-evaluation.
|
||||
-- -- It's basically a shortcut for simple functionNodes:
|
||||
-- s("mat", {
|
||||
-- i(1, { "sample_text" }),
|
||||
-- t(": "),
|
||||
-- m(1, "%d", "contains a number", "no number :("),
|
||||
-- }),
|
||||
-- -- The `then`-text defaults to the first capture group/the entire
|
||||
-- -- match if there are none.
|
||||
-- s("mat2", {
|
||||
-- i(1, { "sample_text" }),
|
||||
-- t(": "),
|
||||
-- m(1, "[abc][abc][abc]"),
|
||||
-- }),
|
||||
-- -- It is even possible to apply gsubs' or other transformations
|
||||
-- -- before matching.
|
||||
-- s("mat3", {
|
||||
-- i(1, { "sample_text" }),
|
||||
-- t(": "),
|
||||
-- m(
|
||||
-- 1,
|
||||
-- l._1:gsub("[123]", ""):match("%d"),
|
||||
-- "contains a number that isn't 1, 2 or 3!"
|
||||
-- ),
|
||||
-- }),
|
||||
-- -- `match` also accepts a function in place of the condition, which in
|
||||
-- -- turn accepts the usual functionNode-args.
|
||||
-- -- The condition is considered true if the function returns any
|
||||
-- -- non-nil/false-value.
|
||||
-- -- If that value is a string, it is used as the `if`-text if no if is explicitly given.
|
||||
-- s("mat4", {
|
||||
-- i(1, { "sample_text" }),
|
||||
-- t(": "),
|
||||
-- m(1, function(args)
|
||||
-- -- args is a table of multiline-strings (as usual).
|
||||
-- return (#args[1][1] % 2 == 0 and args[1]) or nil
|
||||
-- end),
|
||||
-- }),
|
||||
-- -- The nonempty-node inserts text depending on whether the arg-node is
|
||||
-- -- empty.
|
||||
-- s("nempty", {
|
||||
-- i(1, "sample_text"),
|
||||
-- n(1, "i(1) is not empty!"),
|
||||
-- }),
|
||||
-- -- dynamic lambdas work exactly like regular lambdas, except that they
|
||||
-- -- don't return a textNode, but a dynamicNode containing one insertNode.
|
||||
-- -- This makes it easier to dynamically set preset-text for insertNodes.
|
||||
-- s("dl1", {
|
||||
-- i(1, "sample_text"),
|
||||
-- t({ ":", "" }),
|
||||
-- dl(2, l._1, 1),
|
||||
-- }),
|
||||
-- -- Obviously, it's also possible to apply transformations, just like lambdas.
|
||||
-- s("dl2", {
|
||||
-- i(1, "sample_text"),
|
||||
-- i(2, "sample_text_2"),
|
||||
-- t({ "", "" }),
|
||||
-- dl(3, l._1:gsub("\n", " linebreak ") .. l._2, { 1, 2 }),
|
||||
-- }),
|
||||
-- }, {
|
||||
-- key = "all",
|
||||
-- })
|
||||
|
||||
require("luasnip.loaders.from_lua").lazy_load({ paths = { "~/.config/nvim/snips" } })
|
||||
require("luasnip.loaders.from_vscode").lazy_load({ paths = { "~/.config/Code - Insiders/User/snippets" } })
|
||||
1
.config/nvim/after/plugin/mcphub.nvim.lua
Normal file
1
.config/nvim/after/plugin/mcphub.nvim.lua
Normal file
@@ -0,0 +1 @@
|
||||
require("mcphub").setup({})
|
||||
5
.config/nvim/after/plugin/md-img-paste.vim.lua
Normal file
5
.config/nvim/after/plugin/md-img-paste.vim.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
vim.cmd([[
|
||||
" Paste clipboard images
|
||||
au FileType pandoc nmap <buffer><silent> <leader>v :call mdip#MarkdownClipboardImage()<CR>
|
||||
au FileType markdown nmap <buffer><silent> <leader>v :call mdip#MarkdownClipboardImage()<CR>
|
||||
]])
|
||||
95
.config/nvim/after/plugin/nvim-cmp.lua
Normal file
95
.config/nvim/after/plugin/nvim-cmp.lua
Normal file
@@ -0,0 +1,95 @@
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
-- TODO: Fix command mode completion (should behave similar to insert mode)
|
||||
|
||||
local c_j = cmp.mapping(function()
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
else
|
||||
cmp.complete()
|
||||
cmp.select_next_item()
|
||||
end
|
||||
end, { "i", "s" })
|
||||
|
||||
local c_k = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
else
|
||||
-- NOTE: Keep <C-k> fallback for digraphs
|
||||
-- ```lua
|
||||
-- cmp.complete()
|
||||
-- cmp.select_prev_item()
|
||||
-- ```
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" })
|
||||
|
||||
local c_h = cmp.mapping(function(fallback)
|
||||
if luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" })
|
||||
|
||||
local c_l = cmp.mapping(function(fallback)
|
||||
if cmp.visible() and cmp.get_active_entry() then
|
||||
cmp.confirm()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" })
|
||||
|
||||
cmp.setup({
|
||||
completion = {
|
||||
autocomplete = false,
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
-- See `:h luasnip` for the commands
|
||||
-- Note: have not added choice note mappings yet
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-j>"] = c_j,
|
||||
["<C-k>"] = c_k,
|
||||
["<C-h>"] = c_h,
|
||||
["<C-l>"] = c_l,
|
||||
["<CR>"] = c_l,
|
||||
}),
|
||||
sources = {
|
||||
{ name = "copilot", group_index = 2 },
|
||||
{ name = "zk" },
|
||||
{ name = "nvim_lsp", keyword_length = 8 },
|
||||
{ name = "luasnip", max_item_count = 16 },
|
||||
{ name = "path" },
|
||||
{ name = "buffer", max_item_count = 8 },
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered({ border = { "┌", "─", "┐", "│", "┘", "─", "└", "│" } }),
|
||||
documentation = cmp.config.window.bordered({ border = { "┌", "─", "┐", "│", "┘", "─", "└", "│" } }),
|
||||
},
|
||||
formatting = {
|
||||
fields = {
|
||||
"abbr",
|
||||
"menu",
|
||||
"kind",
|
||||
},
|
||||
format = function(entry, item)
|
||||
-- Rename kind to shorthand
|
||||
item.menu = ({
|
||||
nvim_lsp = "[lsp]",
|
||||
luasnip = "[snip]",
|
||||
path = "[path]",
|
||||
buffer = "[buf]",
|
||||
})[entry.source.name]
|
||||
|
||||
return item
|
||||
end,
|
||||
expandable_indicator = true,
|
||||
},
|
||||
})
|
||||
1
.config/nvim/after/plugin/nvim-dbee.lua
Normal file
1
.config/nvim/after/plugin/nvim-dbee.lua
Normal file
@@ -0,0 +1 @@
|
||||
require("dbee").setup()
|
||||
3
.config/nvim/after/plugin/nvim-highlight-colors.lua
Normal file
3
.config/nvim/after/plugin/nvim-highlight-colors.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
require("nvim-highlight-colors").setup({})
|
||||
38
.config/nvim/after/plugin/nvim-lint.lua
Normal file
38
.config/nvim/after/plugin/nvim-lint.lua
Normal file
@@ -0,0 +1,38 @@
|
||||
vim.env.ESLINT_D_PPID = vim.fn.getpid()
|
||||
|
||||
local eslint_linter = "eslint_d"
|
||||
|
||||
require("lint").linters_by_ft = {
|
||||
bash = { "shellcheck" },
|
||||
c = { "clangtidy", "flawfinder" },
|
||||
cmake = { "cmakelint" },
|
||||
cpp = { "clangtidy", "flawfinder" }, -- "cpplint", "cppcheck", "flawfinder"
|
||||
css = { "stylelint" },
|
||||
dockerfile = { "hadolint" },
|
||||
editorconfig = { "editorconfig-checker" },
|
||||
haskell = { "hlint" },
|
||||
-- html = { "htmlhint" },
|
||||
-- javascript = { eslint_linter },
|
||||
-- javascriptreact = { eslint_linter },
|
||||
gdscript = { "gdlint" },
|
||||
latex = { "chktex" },
|
||||
-- lua = { "luacheck", "selene" },
|
||||
make = { "checkmake" },
|
||||
-- pandoc = { "proselint", "woke" },
|
||||
-- python = { "pylint" },
|
||||
sh = { "shellcheck" },
|
||||
svelte = { eslint_linter },
|
||||
systemd = { "systemdlint" },
|
||||
-- typescript = { eslint_linter },
|
||||
-- typescriptreact = { eslint_linter },
|
||||
yaml = { "yamllint" },
|
||||
}
|
||||
|
||||
-- TODO: Wouldn't it be possible / nice to only try to load the linters when they are
|
||||
-- actually needed?
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||
callback = function()
|
||||
require("lint").try_lint()
|
||||
end,
|
||||
})
|
||||
5
.config/nvim/after/plugin/sandwich.vim.lua
Normal file
5
.config/nvim/after/plugin/sandwich.vim.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
vim.cmd([[
|
||||
nmap s <Nop>
|
||||
xmap s <Nop>
|
||||
let g:sandwich#recipes = deepcopy(g:sandwich#default_recipes)
|
||||
]])
|
||||
4
.config/nvim/after/plugin/sniprun.lua
Normal file
4
.config/nvim/after/plugin/sniprun.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
require("sniprun").setup({
|
||||
selected_interpreters = { "JS_TS_deno" },
|
||||
repl_enable = { "JS_TS_deno" },
|
||||
})
|
||||
0
.config/nvim/after/plugin/tailwind-fold.lua
Normal file
0
.config/nvim/after/plugin/tailwind-fold.lua
Normal file
1
.config/nvim/after/plugin/tailwind-fold.nvim.lua
Normal file
1
.config/nvim/after/plugin/tailwind-fold.nvim.lua
Normal file
@@ -0,0 +1 @@
|
||||
require("tailwind-fold").setup({ ft = { "html", "svelte", "tsx" } })
|
||||
131
.config/nvim/after/plugin/treesitter.lua
Normal file
131
.config/nvim/after/plugin/treesitter.lua
Normal file
@@ -0,0 +1,131 @@
|
||||
local ts = require("treesj")
|
||||
local vim = vim
|
||||
local keymap = vim.keymap
|
||||
local opt = vim.opt
|
||||
local treesitter_configs = require("nvim-treesitter.configs")
|
||||
|
||||
treesitter_configs.setup({
|
||||
-- Basically added what I might need from the docs
|
||||
-- <https://github.com/nvim-treesitter/nvim-treesitter?tab=readme-ov-file#supported-languages>
|
||||
ensure_installed = {
|
||||
"awk",
|
||||
"bash",
|
||||
"bibtex",
|
||||
"c",
|
||||
"cmake",
|
||||
"comment",
|
||||
"cpp",
|
||||
"css",
|
||||
"csv",
|
||||
"diff",
|
||||
"dockerfile",
|
||||
"dot",
|
||||
"gdscript",
|
||||
"gdshader",
|
||||
"git_config",
|
||||
"git_rebase",
|
||||
"gitattributes",
|
||||
"gitcommit",
|
||||
"gitignore",
|
||||
"glsl",
|
||||
"gnuplot",
|
||||
"go",
|
||||
"godot_resource",
|
||||
"gpg",
|
||||
"graphql",
|
||||
"haskell",
|
||||
"html",
|
||||
"java",
|
||||
"javascript",
|
||||
"jq",
|
||||
"jsdoc",
|
||||
"json",
|
||||
"jsonc",
|
||||
"latex",
|
||||
"lua",
|
||||
"luadoc",
|
||||
"make",
|
||||
"python",
|
||||
"query",
|
||||
"r",
|
||||
"racket",
|
||||
"readline",
|
||||
"regex",
|
||||
"requirements",
|
||||
"scheme",
|
||||
"scss",
|
||||
"sql",
|
||||
"ssh_config",
|
||||
"supercollider",
|
||||
"svelte",
|
||||
"tmux",
|
||||
"toml",
|
||||
"tsv",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"udev",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"xml",
|
||||
"yaml",
|
||||
"zathurarc",
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "vv",
|
||||
node_incremental = "vv",
|
||||
scope_incremental = "VV",
|
||||
node_decremental = "vd",
|
||||
},
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
sync_install = false,
|
||||
auto_install = true,
|
||||
ignore_install = {},
|
||||
modules = {},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
-- Functions
|
||||
["if"] = "@function.inner",
|
||||
["af"] = "@function.outer",
|
||||
["ip"] = "@parameter.inner",
|
||||
["ap"] = "@parameter.outer",
|
||||
},
|
||||
},
|
||||
},
|
||||
node_movement = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
move_up = "vk",
|
||||
move_down = "vj",
|
||||
move_left = "vh",
|
||||
move_right = "vl",
|
||||
swap_left = "vH",
|
||||
swap_right = "vL",
|
||||
select_current_node = "vi",
|
||||
},
|
||||
swappable_textobjects = { "@function.outer", "@parameter.inner", "@statement.outer" },
|
||||
allow_switch_parents = true,
|
||||
allow_next_parent = true,
|
||||
},
|
||||
})
|
||||
|
||||
opt.foldmethod = "expr"
|
||||
opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
opt.foldenable = false
|
||||
|
||||
-- TreeSJ
|
||||
require("treesj").setup({
|
||||
use_default_keymaps = false,
|
||||
})
|
||||
|
||||
keymap.set("n", ";", ts.toggle, { desc = "Toggle join/split (TreeTSJ)" })
|
||||
1
.config/nvim/after/plugin/trouble.lua
Normal file
1
.config/nvim/after/plugin/trouble.lua
Normal file
@@ -0,0 +1 @@
|
||||
require("trouble").setup()
|
||||
8
.config/nvim/after/plugin/vim-javascript.vim.lua
Normal file
8
.config/nvim/after/plugin/vim-javascript.vim.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
vim.cmd([[
|
||||
let g:javascript_plugin_jsdoc = 1 " jsdoc syntax highlighting
|
||||
let g:javascript_plugin_flow = 1 " flow syntax highlighting
|
||||
let g:javascript_conceal_function = "ƒ"
|
||||
let g:javascript_conceal_return = "⇖"
|
||||
let g:svelte_indent_script = 0
|
||||
let g:svelte_indent_style = 0
|
||||
]])
|
||||
17
.config/nvim/after/plugin/vim-pandoc-syntax.vim.lua
Normal file
17
.config/nvim/after/plugin/vim-pandoc-syntax.vim.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
vim.cmd([[
|
||||
let g:pandoc#syntax#conceal#urls=1
|
||||
let g:pandoc#syntax#codeblocks#embeds#langs=[
|
||||
\ 'python',
|
||||
\ 'bash',
|
||||
\ 'javascript',
|
||||
\ 'typescript',
|
||||
\ 'html',
|
||||
\ 'css',
|
||||
\ 'scss',
|
||||
\ 'json',
|
||||
\ 'yaml'
|
||||
\ ]
|
||||
let g:pandoc#syntax#style#emphases=0 " Bug workaround
|
||||
let g:pandoc#syntax#conceal#cchar_overrides = { "atx": " ", "li": "·" }
|
||||
let g:pandoc#syntax#conceal#blacklist=[]
|
||||
]])
|
||||
9
.config/nvim/after/plugin/vim-pandoc.vim.lua
Normal file
9
.config/nvim/after/plugin/vim-pandoc.vim.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
vim.cmd([[
|
||||
au FileType pandoc call pandoc#completion#Init()
|
||||
let g:pandoc#filetypes#pandoc_markdown=0
|
||||
let g:pandoc#spell#enabled=0
|
||||
let g:pandoc#spell#default_langs=['en_us', 'nl_be']
|
||||
let g:pandoc#formatting#mode='a'
|
||||
let g:pandoc#formatting#textwidth=90
|
||||
let g:pandoc#modules#disabled = ["formatting", "dashes", "yaml", "metadata"]
|
||||
]])
|
||||
16
.config/nvim/after/plugin/vim-tidal.vim.lua
Normal file
16
.config/nvim/after/plugin/vim-tidal.vim.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
vim.cmd([[
|
||||
" Tidalcycles (sclang and vim-tidal)
|
||||
let g:tidal_default_config = {"socket_name": "default", "target_pane": "tidal:1.1"}
|
||||
let g:tidal_no_mappings = 1
|
||||
|
||||
au FileType tidal nm <buffer> <leader>ep <Plug>TidalParagraphSend
|
||||
au FileType tidal nm <buffer> <leader>ee <Plug>TidalLineSend
|
||||
au FileType tidal nnoremap <buffer> <leader>h :TidalHush<cr>
|
||||
au FileType tidal com! -nargs=1 S :TidalSilence <args>
|
||||
au FileType tidal com! -nargs=1 P :TidalPlay <args>
|
||||
au FileType tidal com! -nargs=0 H :TidalHush
|
||||
|
||||
" SuperCollider
|
||||
au BufEnter,BufWinEnter,BufNewFile,BufRead *.sc,*.scd se filetype=supercollider
|
||||
au Filetype supercollider packadd scvim
|
||||
]])
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user