Compare commits
270 Commits
48681cfd4d
...
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 |
@@ -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 :
|
# 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 ..="cd .."
|
||||||
alias .2="cd ../.."
|
|
||||||
alias .3="cd ../../.."
|
|
||||||
|
|
||||||
# Colorize output
|
|
||||||
alias ls="ls --color=auto"
|
alias ls="ls --color=auto"
|
||||||
alias grep="grep --color=auto"
|
|
||||||
alias ip="ip --color"
|
|
||||||
|
|
||||||
# Listing
|
|
||||||
alias l="ls -1p"
|
alias l="ls -1p"
|
||||||
alias ll="ls -lhp"
|
alias ll="ls -lhp"
|
||||||
alias lt="ls -lhtp"
|
alias lt="ls -lhtp"
|
||||||
@@ -28,7 +11,8 @@ alias la="ls -lhap"
|
|||||||
alias lta="ls -lhatp"
|
alias lta="ls -lhatp"
|
||||||
alias ldir="ls -dp" # list directories
|
alias ldir="ls -dp" # list directories
|
||||||
|
|
||||||
# Safety
|
alias grep="grep --color=auto"
|
||||||
|
|
||||||
alias rm="rm -I --preserve-root"
|
alias rm="rm -I --preserve-root"
|
||||||
alias mv="mv -iv"
|
alias mv="mv -iv"
|
||||||
alias cp="cp -iv"
|
alias cp="cp -iv"
|
||||||
@@ -38,32 +22,32 @@ alias chown="chown --preserve-root"
|
|||||||
alias chmod="chmod --preserve-root"
|
alias chmod="chmod --preserve-root"
|
||||||
alias chgrp="chgrp --preserve-root"
|
alias chgrp="chgrp --preserve-root"
|
||||||
|
|
||||||
# Clipboard
|
alias ip="ip --color"
|
||||||
alias clip="xclip -sel clip"
|
alias ipa="ip -brief address"
|
||||||
alias srclip="clip -o | speedread -w 500"
|
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 df="df -kTh"
|
||||||
alias fzfpac="pacman -Slq | fzf -m --preview 'pacman -Si {1}' | xargs -ro sudo pacman -S"
|
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
|
alias path='echo -e ${PATH//:/\\n}' # Pretty print path variables
|
||||||
|
|
||||||
# Programs
|
# Programs
|
||||||
|
alias h="history"
|
||||||
alias o="xdg-open"
|
alias o="xdg-open"
|
||||||
alias v="nvim"
|
alias v="nvim"
|
||||||
alias zk='cd ~/.zk && nvim "$(cat ~/.zk/current-zettel.txt)"'
|
alias vf="fzf --bind 'enter:become(nvim {})'"
|
||||||
alias g='git'
|
alias g='git'
|
||||||
alias t=' task'
|
alias k="kubectl"
|
||||||
|
alias t='task'
|
||||||
alias tsh='tasksh'
|
alias tsh='tasksh'
|
||||||
alias z='zathura --fork'
|
alias z='zathura --fork'
|
||||||
alias f='fzf'
|
alias f='fzf'
|
||||||
alias fm='pcmanfm &>/dev/null &'
|
alias fm='pcmanfm &>/dev/null &'
|
||||||
alias xev='xev | grep -A2 ButtonPress' # Ignore mouse movements
|
|
||||||
alias mm='micromamba'
|
alias mm='micromamba'
|
||||||
|
|
||||||
# Languages
|
# Languages
|
||||||
alias js="node"
|
|
||||||
alias ts="ts-node"
|
|
||||||
alias r5="plt-r5rs --no-prim"
|
alias r5="plt-r5rs --no-prim"
|
||||||
alias hs="ghci"
|
alias hs="ghci"
|
||||||
alias pl="swipl"
|
alias pl="swipl"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
# shellcheck shell=bash
|
||||||
# vim: set ft=bash :
|
# vim: set ft=bash :
|
||||||
|
|
||||||
reboot-to-windows ()
|
reboot-to-windows ()
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
# shellcheck shell=bash
|
||||||
# vim: set ft=bash :
|
# vim: set ft=bash :
|
||||||
|
|
||||||
source "$HOME/.bash_aliases/dualboot"
|
source "$HOME/.bash_aliases/dualboot"
|
||||||
|
|
||||||
alias lm='ddcutil setvcp 10'
|
alias lm='ddcutil setvcp 10'
|
||||||
|
|
||||||
alias cuda-available='python -c "import torch; print(\"CUDA enabled:\", torch.cuda.is_available());"'
|
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 :
|
# vim: set ft=bash :
|
||||||
|
|
||||||
source "$HOME/.bash_aliases/dualboot"
|
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
|
||||||
|
}
|
||||||
@@ -3,7 +3,8 @@
|
|||||||
[[ -f ~/.bashrc ]] && . ~/.bashrc
|
[[ -f ~/.bashrc ]] && . ~/.bashrc
|
||||||
|
|
||||||
export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR}/ssh-agent.socket"
|
export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR}/ssh-agent.socket"
|
||||||
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
||||||
|
|
||||||
if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
|
if [[ -z "${DISPLAY}" ]] && [[ "${XDG_VTNR}" -eq 1 ]]; then
|
||||||
exec startx "$HOME/.config/X11/xinitrc"
|
exec startx "$HOME/.config/X11/xinitrc" >& ~/.xsession-errors
|
||||||
fi
|
fi
|
||||||
|
|||||||
119
.bashrc
119
.bashrc
@@ -1,39 +1,34 @@
|
|||||||
|
# shellcheck shell=bash
|
||||||
|
# shellcheck disable=SC1091,SC1090
|
||||||
# If not running interactively, don't do anything
|
# If not running interactively, don't do anything
|
||||||
[[ $- != *i* ]] && return
|
[[ $- != *i* ]] && return
|
||||||
|
|
||||||
export INPUTRC="$XDG_CONFIG_HOME"/readline/inputrc
|
. /etc/os-release
|
||||||
|
|
||||||
source /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 {{{
|
# Aliases {{{
|
||||||
# Load aliases dynamically
|
# Load aliases dynamically
|
||||||
[ -f "$HOME/.bash_aliases/all" ] && source "$HOME/.bash_aliases/all"
|
[ -f "$HOME/.bash_aliases/all" ] && . "$HOME/.bash_aliases/all"
|
||||||
[ -f "$HOME/.bash_aliases/$HOSTNAME" ] && source "$HOME/.bash_aliases/$HOSTNAME"
|
[ -f "$HOME/.bash_aliases/hosts/$HOSTNAME" ] && . "$HOME/.bash_aliases/hosts/$HOSTNAME"
|
||||||
[ -f "$HOME/.bash_aliases/private" ] && source "$HOME/.bash_aliases/private"
|
[ -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 {{{
|
# Host-specific and private configurations
|
||||||
[ -f "$HOME/.bashrc.d/$HOSTNAME" ] && source "$HOME/.bashrc.d/$HOSTNAME"
|
[ -f "$HOME/.bashrc.d/hosts/$HOSTNAME" ] && . "$HOME/.bashrc.d/hosts/$HOSTNAME"
|
||||||
[ -f "$HOME/.bashrc.d/private" ] && source "$HOME/.bashrc.d/private"
|
[ -f "$HOME/.bashrc.d/private" ] && . "$HOME/.bashrc.d/private"
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# Prompt {{{
|
# Prompt {{{
|
||||||
get_branch_name() {
|
[ -f "$HOME/.bashrc.d/prompt" ] && . "$HOME/.bashrc.d/prompt"
|
||||||
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
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# Path {{{
|
# Path {{{
|
||||||
@@ -42,46 +37,30 @@ export PATH=~/.bin:$PATH
|
|||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# History {{{
|
# History {{{
|
||||||
|
export HISTSIZE=999999
|
||||||
|
export HISTFILESIZE= # Unlimited
|
||||||
export HISTCONTROL=ignoreboth:erasedups
|
export HISTCONTROL=ignoreboth:erasedups
|
||||||
export HISTSIZE=500000
|
export HISTIGNORE=" *:clear:l:ls:cd" # Omit commands from history (e.g. those prepended with space)
|
||||||
# Omit `clear, ls...`; commands prepended with space
|
|
||||||
export HISTIGNORE="clear:l: *"
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# Man pages {{{
|
# Man pages {{{
|
||||||
# See `:h :Man` in NeoVim
|
# See `:h :Man` in NeoVim
|
||||||
export MANWIDTH=999
|
export MANWIDTH=80
|
||||||
# export MANPAGER='nvim +Man!'
|
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 {{{
|
# X11 {{{
|
||||||
export XDG_SESSION_TYPE=X11
|
export XDG_SESSION_TYPE=X11
|
||||||
export XDG_CONFIG_HOME=$HOME/.config
|
export XDG_CONFIG_HOME=$HOME/.config
|
||||||
export XDG_DATA_HOME=$HOME/.local/share
|
export XDG_DATA_HOME=$HOME/.local/share
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# Nix package manager {{{
|
|
||||||
# Add ~/.nix-profile/bin to PATH
|
|
||||||
export PATH=~/.nix-profile/bin:$PATH
|
|
||||||
# }}}
|
|
||||||
|
|
||||||
# FZF {{{
|
# FZF {{{
|
||||||
# Check if fzf is installed
|
# Check if fzf is installed
|
||||||
if [ -f "/usr/bin/fzf" ]; then
|
if [ -f "/usr/bin/fzf" ]; then
|
||||||
# Fuzzy finder setup
|
# Fuzzy finder setup
|
||||||
export FZF_COMPLETION_TRIGGER='**'
|
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="
|
export FZF_DEFAULT_OPTS="
|
||||||
--pointer='❭'
|
--pointer='❭'
|
||||||
--height 10%
|
--height 10%
|
||||||
@@ -90,11 +69,11 @@ if [ -f "/usr/bin/fzf" ]; then
|
|||||||
export FZF_CTRL_T_OPTS="--preview='bat {} | head -500'"
|
export FZF_CTRL_T_OPTS="--preview='bat {} | head -500'"
|
||||||
|
|
||||||
if [[ $ID == "raspbian" ]]; then
|
if [[ $ID == "raspbian" ]]; then
|
||||||
source /usr/share/doc/fzf/examples/completion.bash
|
. /usr/share/doc/fzf/examples/completion.bash
|
||||||
source /usr/share/doc/fzf/examples/key-bindings.bash
|
. /usr/share/doc/fzf/examples/key-bindings.bash
|
||||||
elif [[ $ID == "arch" ]]; then
|
elif [[ $ID == "arch" ]]; then
|
||||||
source /usr/share/fzf/completion.bash
|
. /usr/share/fzf/completion.bash
|
||||||
source /usr/share/fzf/key-bindings.bash
|
. /usr/share/fzf/key-bindings.bash
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_fzf_setup_completion path vim zathura xournalpp nvim mpv
|
_fzf_setup_completion path vim zathura xournalpp nvim mpv
|
||||||
@@ -103,14 +82,8 @@ else
|
|||||||
fi
|
fi
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# Node {{{
|
# Go {{{
|
||||||
# Move nvm folder away from home directory
|
export GOPATH="${XDG_DATA_HOME}/go"
|
||||||
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
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# Jupyter {{{
|
# Jupyter {{{
|
||||||
@@ -118,8 +91,36 @@ export JUPYTERLAB_DIR=$HOME/.local/share/jupyter/lab
|
|||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# Conda {{{
|
# 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 {{{
|
# Zettelkasten {{{
|
||||||
export ZK_PATH="$HOME/.zk"
|
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
|
## Notes
|
||||||
|
|
||||||
Statusbar scripts are prefixed with `sb` under the assumption you're using
|
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
|
Some scripts have dependencies (e.g. `fzf`, `jq`, `xclip`, ...), make sure you
|
||||||
have them installed.
|
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
|
# Generate menu of book filenames and save paths
|
||||||
# Preview window contains metadata
|
# Preview window contains metadata
|
||||||
|
|
||||||
|
function get_book_paths {
|
||||||
|
find /home/h/doc/books/ -regex '.*\.\(pdf\|epub\|djvu\)' -type f | sort
|
||||||
|
}
|
||||||
|
|
||||||
function select_file {
|
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 {
|
function open {
|
||||||
@@ -22,3 +26,5 @@ case "$1" in
|
|||||||
--help) printf "open \n" >&2 ;;
|
--help) printf "open \n" >&2 ;;
|
||||||
*) open "$(select_file)" ;;
|
*) open "$(select_file)" ;;
|
||||||
esac
|
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" &
|
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
#!/usr/bin/env bash
|
#!/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 statusbar can read it
|
||||||
#
|
- Notification on session finish
|
||||||
# - Writes pomodoro timer to temporary file so dwmblocks
|
- Notification on break finish
|
||||||
# statusbar can read it
|
"""
|
||||||
# - Notification on session finish
|
|
||||||
# - Notification on break finish
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import atexit
|
import atexit
|
||||||
@@ -13,56 +14,66 @@ from argparse import ArgumentParser
|
|||||||
from time import sleep
|
from time import sleep
|
||||||
from plyer import notification
|
from plyer import notification
|
||||||
|
|
||||||
|
POMO_PATH = os.path.join(os.getenv("XDG_DATA_HOME", os.path.expanduser("~/.local/share")), "pomo")
|
||||||
|
|
||||||
|
@atexit.register
|
||||||
def clear():
|
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)
|
def make_countdown():
|
||||||
|
|
||||||
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 countdown(duration):
|
def countdown(duration):
|
||||||
while duration != 0:
|
while duration != 0:
|
||||||
mins = duration // 60
|
mins = duration // 60
|
||||||
secs = duration % 60
|
secs = duration % 60
|
||||||
# os.system('echo -n "{:s} {:02d}:{:02d} \x01" > /tmp/pomo'.format(color, mins, secs))
|
time_str = format_mins_secs(mins, secs)
|
||||||
os.system(
|
os.system(f'echo -n "{time_str}" > {POMO_PATH}')
|
||||||
'echo -n "<fc={:s}> {:02d}:{:02d} </fc>" > /tmp/pomo'.format(color, mins, secs))
|
|
||||||
sleep(1)
|
sleep(1)
|
||||||
duration -= 1
|
duration -= 1
|
||||||
return countdown
|
return countdown
|
||||||
|
|
||||||
|
|
||||||
prep_countdown = make_countdown("#0000aa")
|
def main(args):
|
||||||
work_countdown = make_countdown("#aa0000")
|
work_duration = args.work_duration * 60
|
||||||
break_countdown = make_countdown("#00bb00")
|
break_duration = args.break_duration * 60
|
||||||
|
repeats = args.repeats
|
||||||
|
|
||||||
prep_countdown(prep_duration)
|
work_countdown = make_countdown()
|
||||||
|
break_countdown = make_countdown()
|
||||||
|
|
||||||
while repeats != 0:
|
while repeats != 0:
|
||||||
notification.notify(title="Get started")
|
notification.notify(title="Get started")
|
||||||
work_countdown(work_duration)
|
work_countdown(work_duration)
|
||||||
if break_duration != 0:
|
if break_duration != 0:
|
||||||
notification.notify(title="Time for a break")
|
notification.notify(title="Time for a break")
|
||||||
break_countdown(break_duration)
|
break_countdown(break_duration)
|
||||||
notification.notify(title="Break is over, back to work")
|
notification.notify(title="Break is over, back to work")
|
||||||
repeats -= 1
|
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
|
# Save (encrypted) password database to cloud storage
|
||||||
#
|
#
|
||||||
# Can be run manually or daily by enabling the corresponding systemd user
|
# Usage:
|
||||||
# service and timer, i.e.
|
# save-passwddb - Save databases to cloud
|
||||||
#
|
# save-passwddb init - Restore databases from cloud (with single backup archive)
|
||||||
# `systemctl --user enable save-passwddb.service`
|
|
||||||
# `systemctl --user enable save-passwddb.timer`
|
|
||||||
|
|
||||||
if [ -f "$HOME/doc/passwd.kdbx" ]; then
|
RCLONE_REMOTE="proton"
|
||||||
rclone copy "$HOME/doc/passwd.kdbx" google-drive:
|
SOURCE_DIR="$HOME/doc"
|
||||||
else
|
TARGET_DIR="$RCLONE_REMOTE:doc"
|
||||||
echo "Password database not found, use 'rclone copy google-drive:passwd.kdbx $HOME/doc/passwd.kdbx' to restore"
|
BACKUP_DIR="$HOME/doc/bak"
|
||||||
exit 1
|
|
||||||
fi
|
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
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
num_to_review=200
|
num_to_review=200
|
||||||
|
|
||||||
# Get current card count from Anki
|
# 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" ]
|
if [ -z "$count" ]
|
||||||
then
|
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
|
||||||
@@ -43,6 +43,9 @@ try:
|
|||||||
subprocess.run(["redshift", "-O", str(new_temperature), "-P"], check=True)
|
subprocess.run(["redshift", "-O", str(new_temperature), "-P"], check=True)
|
||||||
with open('/tmp/temperature', 'w') as temp_file:
|
with open('/tmp/temperature', 'w') as temp_file:
|
||||||
temp_file.write(str(new_temperature) + '\n')
|
temp_file.write(str(new_temperature) + '\n')
|
||||||
|
# Send notification
|
||||||
|
subprocess.run(
|
||||||
|
["notify-send", str(new_temperature) + "K"])
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
print("Error: could not set screen temperature.")
|
print("Error: could not set screen temperature.")
|
||||||
sys.exit(1)
|
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
|
#!/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() {
|
install() {
|
||||||
if pacman -Qi "$1" &> /dev/null; then
|
local package="$1"
|
||||||
echo ""$1" is already installed"
|
if pacman -Qi "$package" &> /dev/null; then
|
||||||
|
echo "$package is already installed"
|
||||||
else
|
else
|
||||||
echo "Installing " "$1"
|
echo "Installing " "$package"
|
||||||
sudo pacman -S --noconfirm --needed "$1"
|
sudo pacman -S --noconfirm --needed "$package"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Packages to install from Arch repositories
|
aurpac() {
|
||||||
pac_list=(
|
git clone "https://aur.archlinux.org/$1.git" "$HOME/.build/$1"
|
||||||
git
|
}
|
||||||
vim
|
|
||||||
)
|
|
||||||
|
|
||||||
# Packages to install from AUR
|
install_packages() {
|
||||||
aurpac_list=(
|
announce "Installing packages"
|
||||||
xbanish
|
local count
|
||||||
ttf-iosevka-term-ss08
|
for pac in "${pac_list[@]}" ; do
|
||||||
)
|
count=$((count+1))
|
||||||
|
install "$pac";
|
||||||
|
done
|
||||||
|
echo "$count packages installed"
|
||||||
|
}
|
||||||
|
|
||||||
# Suckless software to build
|
install_dotfiles() {
|
||||||
suckless_list=( $(ls -1 "$HOME/.suckless/") )
|
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 " "
|
setup_neovim() {
|
||||||
echo "Installing required packages"
|
announce "Setting up NeoVim"
|
||||||
echo " "
|
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[@]}"
|
printf '%s\n' "${pac_list[@]}"
|
||||||
|
confirm "Install these packages? " install_packages
|
||||||
for pac in "${pac_list[@]}" ; do
|
printf '%s\n' "${aurpac_list[@]}"
|
||||||
count=$[count+1]
|
confirm "Install these AUR packages? " install_aur_packages
|
||||||
install "$pac";
|
confirm "Setup NeoVim? " setup_neovim
|
||||||
done
|
confirm "Install dotfiles? " install_dotfiles
|
||||||
|
confirm "Setup keyboard? " setup_keyboard
|
||||||
echo " "
|
if pacman -Qi "gdm" &> /dev/null; then
|
||||||
echo "Installing aur packages"
|
confirm "Configure Gnome? " configure_gnome
|
||||||
echo " "
|
fi
|
||||||
|
confirm "Setup firewall? " setup_firewall
|
||||||
# [ ] Create aurpac installer function
|
confirm "Setup Docker? " setup_docker
|
||||||
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
|
|
||||||
|
|||||||
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
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
ssh_hosts=$(grep -E 'Host [a-z0-9\-]*$' ~/.ssh/config | awk '{print $2}')
|
ssh_hosts="$(grep -E 'Host [a-z0-9\-]*$' ~/.ssh/config | awk '{print $2}')"
|
||||||
|
|
||||||
echo "$ssh_hosts"
|
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"
|
session="main"
|
||||||
|
|
||||||
tmux attach-session -t $session || tmux new-session -s $session \; \
|
tmux attach-session -t $session || tmux new-session -s $session \; \
|
||||||
rename-window todo \; \
|
rename-window task \; \
|
||||||
send-keys -t 0 "task" C-m \; \
|
send-keys -t 1 "task" C-m \; \
|
||||||
new-window -n zk \; \
|
new-window -n zk \; \
|
||||||
send-keys -t 0 "nvim $ZK_PATH/index.md" C-m \; \
|
send-keys -t 2 "nvim $ZK_PATH/index.md" C-m \; \
|
||||||
new-window -n music \; \
|
|
||||||
send-keys -t 0 "ncspot" C-m \; \
|
|
||||||
new-window -n term \; \
|
new-window -n term \; \
|
||||||
new-window -n make \; \
|
new-window -n music \; \
|
||||||
split-window -h \; \
|
send-keys -t 4 "echo 'TODO: open music player'" C-m \; \
|
||||||
split-window -h \; \
|
select-window -t 1 \;
|
||||||
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 \;
|
|
||||||
|
|||||||
@@ -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,15 +0,0 @@
|
|||||||
output eDP
|
|
||||||
off
|
|
||||||
output HDMI-A-0
|
|
||||||
crtc 0
|
|
||||||
mode 3840x2160
|
|
||||||
pos 0x0
|
|
||||||
primary
|
|
||||||
rate 60.00
|
|
||||||
x-prop-max_bpc 8
|
|
||||||
x-prop-non_desktop 0
|
|
||||||
x-prop-scaling_mode None
|
|
||||||
x-prop-tearfree auto
|
|
||||||
x-prop-underscan off
|
|
||||||
x-prop-underscan_hborder 0
|
|
||||||
x-prop-underscan_vborder 0
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
HDMI-A-0 00ffffffffffff00410c8fc16d040000271c0103803c22782a67a1a5554da2270e5054bfef00d1c0b30095008180814081c0010101014dd000a0f0703e803020350055502100001aa36600a0f0701f803020350055502100001a000000fc0050484c203237364538560a2020000000fd0017501ea03c000a20202020202001a7020333f14c9004031f1301125d5e5f606123090707830100006d030c001000387820006001020367d85dc401788003e30f000c565e00a0a0a029503020350055502100001e023a801871382d40582c450055502100001e011d007251d01e206e28550055502100001e4d6c80a070703e8030203a0055502100001a000000004e
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
output HDMI-A-0
|
|
||||||
crtc 0
|
|
||||||
mode 3840x2160
|
|
||||||
pos 0x0
|
|
||||||
primary
|
|
||||||
rate 60.00
|
|
||||||
x-prop-max_bpc 8
|
|
||||||
x-prop-non_desktop 0
|
|
||||||
x-prop-scaling_mode None
|
|
||||||
x-prop-tearfree auto
|
|
||||||
x-prop-underscan off
|
|
||||||
x-prop-underscan_hborder 0
|
|
||||||
x-prop-underscan_vborder 0
|
|
||||||
output eDP
|
|
||||||
crtc 1
|
|
||||||
mode 1920x1080
|
|
||||||
pos 960x2160
|
|
||||||
rate 60.00
|
|
||||||
x-prop-max_bpc 16
|
|
||||||
x-prop-non_desktop 0
|
|
||||||
x-prop-scaling_mode None
|
|
||||||
x-prop-tearfree auto
|
|
||||||
x-prop-underscan off
|
|
||||||
x-prop-underscan_hborder 0
|
|
||||||
x-prop-underscan_vborder 0
|
|
||||||
@@ -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,5 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
for i in ~/.mozilla/firefox/*.*default*
|
|
||||||
do ln -s "$XDG_CONFIG_HOME"/firefox/user.js "$i/user.js"
|
|
||||||
done
|
|
||||||
@@ -1,15 +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
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Set default download directory
|
|
||||||
user_pref("browser.download.dir", "/home/h/dl");
|
|
||||||
@@ -15,7 +15,7 @@ TYPE_ARROW=a
|
|||||||
TYPE_CIRCLE=o
|
TYPE_CIRCLE=o
|
||||||
TYPE_CIRCLECOUNT=Shift+o
|
TYPE_CIRCLECOUNT=Shift+o
|
||||||
TYPE_COMMIT_CURRENT_TOOL=Ctrl+Return
|
TYPE_COMMIT_CURRENT_TOOL=Ctrl+Return
|
||||||
TYPE_COPY=Ctrl+c
|
TYPE_COPY=y
|
||||||
TYPE_DELETE_CURRENT_TOOL=
|
TYPE_DELETE_CURRENT_TOOL=
|
||||||
TYPE_DRAWER=l
|
TYPE_DRAWER=l
|
||||||
TYPE_EXIT=q
|
TYPE_EXIT=q
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
git_protocol: ssh
|
git_protocol: ssh
|
||||||
prompt: enabled
|
prompt: enabled
|
||||||
aliases:
|
aliases:
|
||||||
co: pr checkout
|
co: pr checkout
|
||||||
c: repo clone
|
c: repo clone
|
||||||
f: repo fork
|
f: repo fork
|
||||||
rc: repo create
|
rc: repo create
|
||||||
rv: repo view
|
rv: repo view
|
||||||
re: repo edit
|
re: repo edit
|
||||||
rm: repo remove
|
rm: repo remove
|
||||||
rn: repo rename
|
rn: repo rename
|
||||||
lr: repo list
|
lr: repo list
|
||||||
li: issue list
|
li: issue list
|
||||||
al: alias
|
al: alias
|
||||||
al-: alias delete
|
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.
|
||||||
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()
|
function GetClozeNumber()
|
||||||
let REGEX_CLOZE_START = '{{c\d\+::'
|
let REGEX_CLOZE_START = '{{c\d\+::'
|
||||||
|
|
||||||
@@ -33,3 +34,4 @@ let g:sandwich#recipes += [
|
|||||||
\ 'nesting': 1
|
\ '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
|
||||||
|
]])
|
||||||
6
.config/nvim/after/plugin/vimtex.vim.lua
Normal file
6
.config/nvim/after/plugin/vimtex.vim.lua
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
vim.cmd([[
|
||||||
|
let g:vimtex_view_method='zathura'
|
||||||
|
let g:tex_flavor='latex'
|
||||||
|
let g:tex_conceal='abdmgs'
|
||||||
|
let g:vimtex_quickfix_mode=0
|
||||||
|
]])
|
||||||
110
.config/nvim/after/plugin/wiki.vim.lua
Normal file
110
.config/nvim/after/plugin/wiki.vim.lua
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
vim.cmd([[
|
||||||
|
" Change local buffer to directory of current file after the plugin has loaded
|
||||||
|
autocmd VimEnter * lcd %:p:h
|
||||||
|
|
||||||
|
" " Override wiki index mapping to also cd into the wiki
|
||||||
|
nm <leader>ww <plug>(wiki-index)
|
||||||
|
" nm <leader>l <plug>(wiki-next-link)
|
||||||
|
" nm <leader>h <plug>(wiki-prev-link)
|
||||||
|
" nm <leader>j <plug>(wiki-link-follow)
|
||||||
|
" nm <leader>k <plug>(wiki-link-return)
|
||||||
|
" nm <leader>s <plug>(wiki-link-follow-split)
|
||||||
|
" nm <leader>v <plug>(wiki-link-follow-vsplit)
|
||||||
|
|
||||||
|
autocmd BufEnter *.md if expand('%:t') =~ '_' | echo 'hierarchical relation' | endif
|
||||||
|
autocmd BufEnter *.md if expand('%:t') =~ '--' | echo 'relation' | endif
|
||||||
|
autocmd BufEnter *.md if expand('%:t') =~ '<>' | echo 'dichotomy' | endif
|
||||||
|
autocmd BufEnter *.md if expand('%:t') =~ 'my-' | echo 'personal file' | endif
|
||||||
|
autocmd BufEnter *.md if expand('%:t') =~ 'project_' | echo 'project file' | endif
|
||||||
|
|
||||||
|
" Only load wiki.vim for zk directory
|
||||||
|
let g:wiki_index_name='index'
|
||||||
|
|
||||||
|
" Links
|
||||||
|
let g:wiki_link_extension=''
|
||||||
|
" Do not automatically transform to link, use `<leader>wf` for this
|
||||||
|
let g:wiki_link_target_type='md'
|
||||||
|
|
||||||
|
vmap <leader>wf <plug>(wiki-link-toggle-visual)
|
||||||
|
|
||||||
|
"
|
||||||
|
" Links
|
||||||
|
"
|
||||||
|
|
||||||
|
"
|
||||||
|
" Options
|
||||||
|
"
|
||||||
|
|
||||||
|
"
|
||||||
|
" Events
|
||||||
|
"
|
||||||
|
|
||||||
|
"
|
||||||
|
" Mappings and commands
|
||||||
|
"
|
||||||
|
|
||||||
|
"
|
||||||
|
" Completion
|
||||||
|
"
|
||||||
|
|
||||||
|
let g:wiki_completion_enabled=1
|
||||||
|
let g:wiki_completion_case_sensitive=0
|
||||||
|
|
||||||
|
"
|
||||||
|
" Tags
|
||||||
|
"
|
||||||
|
|
||||||
|
"
|
||||||
|
" Templates
|
||||||
|
"
|
||||||
|
|
||||||
|
let g:wiki_templates = [
|
||||||
|
\ { 'match_re': '^my-',
|
||||||
|
\ 'source_filename': '.my.md'},
|
||||||
|
\ { 'match_re': '^project[-_]',
|
||||||
|
\ 'source_filename': '.project.md'},
|
||||||
|
\ { 'match_re': '^blog[-_]',
|
||||||
|
\ 'source_filename': '.blog.md'},
|
||||||
|
\ { 'match_re': '^journal[-_]',
|
||||||
|
\ 'source_filename': '.journal.md'},
|
||||||
|
\ { 'match_func': { x -> v:true },
|
||||||
|
\ 'source_filename': '.md'},
|
||||||
|
\]
|
||||||
|
|
||||||
|
"
|
||||||
|
" Advanced configuration
|
||||||
|
"
|
||||||
|
|
||||||
|
let g:wiki_filetypes=['md']
|
||||||
|
let g:wiki_root='~/.zk'
|
||||||
|
let g:wiki_global_load=0
|
||||||
|
let g:wiki_link_creation = {
|
||||||
|
\ 'md': {
|
||||||
|
\ 'link_type': 'md',
|
||||||
|
\ 'url_extension': '',
|
||||||
|
\ 'url_transform': { x -> substitute(tolower(x), '\s\+', '-', 'g') },
|
||||||
|
\ },
|
||||||
|
\ '_': {
|
||||||
|
\ 'link_type': 'wiki',
|
||||||
|
\ 'url_extension': '',
|
||||||
|
\ },
|
||||||
|
\}
|
||||||
|
|
||||||
|
" let g:wiki_link_default_schemes
|
||||||
|
" let g:wiki_link_schemes
|
||||||
|
let g:wiki_link_toggle_on_follow=0
|
||||||
|
" let g:wiki_link_transforms
|
||||||
|
" let g:wiki_mappings_use_defaults
|
||||||
|
" let g:wiki_mappings_global
|
||||||
|
" let g:wiki_mappings_local
|
||||||
|
" let g:wiki_mappings_local_journal
|
||||||
|
" ... tags
|
||||||
|
" let g:wiki_template_month_names
|
||||||
|
" let g:wiki_template_title_month =
|
||||||
|
" let g:wiki_template_title_week
|
||||||
|
" let g:wiki_ui_method
|
||||||
|
let g:wiki_write_on_nav=1
|
||||||
|
let g:wiki_zotero_root='~/.local/share/zotero'
|
||||||
|
" ... mappings and commands
|
||||||
|
" ...
|
||||||
|
]])
|
||||||
1
.config/nvim/after/plugin/zenbones.lua
Normal file
1
.config/nvim/after/plugin/zenbones.lua
Normal file
@@ -0,0 +1 @@
|
|||||||
|
vim.cmd("colorscheme zenwritten")
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
|
vim.cmd([[
|
||||||
syn match Todo /TODO/
|
syn match Todo /TODO/
|
||||||
syn match Todo /FIXME/
|
syn match Todo /FIXME/
|
||||||
syn match Todo /FIX/
|
syn match Todo /FIX/
|
||||||
syn match Todo /QUESTION/
|
syn match Todo /QUESTION/
|
||||||
syn match Todo /NOTE/
|
syn match Todo /NOTE/
|
||||||
|
]])
|
||||||
19
.config/nvim/after/syntax/pandoc.lua
Normal file
19
.config/nvim/after/syntax/pandoc.lua
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
vim.cmd([[
|
||||||
|
" Override the pandoc-syntax highlighting colors for more subtle citations
|
||||||
|
hi! link pandocPCite Comment
|
||||||
|
hi! link pandocICite Comment
|
||||||
|
hi! link pandocCiteKey Comment
|
||||||
|
hi! link pandocCiteAnchor Comment
|
||||||
|
hi! link pandocCiteLocator Comment
|
||||||
|
|
||||||
|
" Match cloze delimiters e.g. `{{c1::` and `}}`
|
||||||
|
syn match ClozeDelimiter /{{c\d\+::/ conceal containedin=pandocUListItem,pandocListItem
|
||||||
|
syn match ClozeDelimiter /}}/ conceal containedin=pandocUListItem,pandocListItem
|
||||||
|
" Match text between cloze delimiters
|
||||||
|
syn match Cloze /\({{c\d\+::\)\@<=\(\_[A-Za-z0-9$\ \\\-\*,_`()]*\)\(}}\)\@=/ containedin=pandocUListItem,pandocListItem
|
||||||
|
|
||||||
|
hi! link ClozeDelimiter Special
|
||||||
|
hi! link Cloze Special
|
||||||
|
]])
|
||||||
|
|
||||||
|
vim.cmd.runtime("syntax/_comment_keywords.lua")
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
|
vim.cmd([[
|
||||||
syn keyword Operator \+ conceal cchar=¬
|
syn keyword Operator \+ conceal cchar=¬
|
||||||
syn keyword Operator , conceal cchar=∧
|
syn keyword Operator , conceal cchar=∧
|
||||||
syn keyword Operator ; conceal cchar=∨
|
syn keyword Operator ; conceal cchar=∨
|
||||||
|
]])
|
||||||
|
|
||||||
:runtime! syntax/_comment_keywords.vim
|
vim.cmd.runtime("syntax/_comment_keywords.lua")
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
vim.cmd([[
|
||||||
syntax keyword Statement define conceal cchar=≔
|
syntax keyword Statement define conceal cchar=≔
|
||||||
|
|
||||||
syn keyword Operator not conceal cchar=¬
|
syn keyword Operator not conceal cchar=¬
|
||||||
@@ -35,5 +36,6 @@ syn keyword Operator phi conceal cchar=φ
|
|||||||
syn keyword Operator chi conceal cchar=χ
|
syn keyword Operator chi conceal cchar=χ
|
||||||
syn keyword Operator psi conceal cchar=ψ
|
syn keyword Operator psi conceal cchar=ψ
|
||||||
syn keyword Operator omega conceal cchar=ω
|
syn keyword Operator omega conceal cchar=ω
|
||||||
|
]])
|
||||||
|
|
||||||
:runtime! syntax/_comment_keywords.vim
|
vim.cmd.runtime("syntax/_comment_keywords.lua")
|
||||||
162
.config/nvim/flake.lock
generated
Normal file
162
.config/nvim/flake.lock
generated
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"nixCats": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1759730664,
|
||||||
|
"narHash": "sha256-boRlBQ/c4CaHsK/z04QL6+t81mcar37Io94HBX2GflY=",
|
||||||
|
"owner": "BirdeeHub",
|
||||||
|
"repo": "nixCats-nvim",
|
||||||
|
"rev": "77dffad8235eb77684fcb7599487c8e9f23d5b8f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "BirdeeHub",
|
||||||
|
"repo": "nixCats-nvim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1760256791,
|
||||||
|
"narHash": "sha256-uTpzDHRASEDeFUuToWSQ46Re8beXyG9dx4W36FQa0/c=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "832e3b6db48508ae436c2c7bfc0cf914eac6938e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"plugins-beancount-nvim": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1707748314,
|
||||||
|
"narHash": "sha256-LuACGVB3kiaiJqoGtvFy6kbPNtqoGliKLDeR+Z7Wzbw=",
|
||||||
|
"owner": "polarmutex",
|
||||||
|
"repo": "beancount.nvim",
|
||||||
|
"rev": "869564aba3087ee5df8f282aa37555e314aa2152",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "polarmutex",
|
||||||
|
"repo": "beancount.nvim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"plugins-crazy-node-movement": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1693654676,
|
||||||
|
"narHash": "sha256-hQcQEp39zFN2zphMfcr97yRVcuHhBsSkzKO7XNloDpQ=",
|
||||||
|
"owner": "theHamsta",
|
||||||
|
"repo": "crazy-node-movement",
|
||||||
|
"rev": "d5cf01cc44c5715501d3d6fe439af7c8b7fa5df2",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "theHamsta",
|
||||||
|
"repo": "crazy-node-movement",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"plugins-helm-ls-nvim": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1757598429,
|
||||||
|
"narHash": "sha256-nzuJxAAaEmuVYg9k0B8OKslxsihhg6RKlhz6E7xJTQU=",
|
||||||
|
"owner": "qvalentin",
|
||||||
|
"repo": "helm-ls.nvim",
|
||||||
|
"rev": "f36ecbd3e7b0b2ac8358a9d6a3213888e29943db",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "qvalentin",
|
||||||
|
"repo": "helm-ls.nvim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"plugins-mcphub-nvim": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1759035242,
|
||||||
|
"narHash": "sha256-I6EbgY/2sAdtrxtmH0qbAAQvMCHhOsfolJfblV0fXOk=",
|
||||||
|
"owner": "ravitemer",
|
||||||
|
"repo": "mcphub.nvim",
|
||||||
|
"rev": "8ff40b5edc649959bb7e89d25ae18e055554859a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "ravitemer",
|
||||||
|
"repo": "mcphub.nvim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"plugins-nvimkit-nvim": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1721393835,
|
||||||
|
"narHash": "sha256-MdmrhLHMxrn6upu1chjKyitPZ5WkCQtpI465AKJXDOA=",
|
||||||
|
"owner": "jamesblckwell",
|
||||||
|
"repo": "nvimkit.nvim",
|
||||||
|
"rev": "af363d22699760f66988e8d36539a5753039217a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "jamesblckwell",
|
||||||
|
"repo": "nvimkit.nvim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"plugins-shipwright-nvim": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1711725275,
|
||||||
|
"narHash": "sha256-xh/2m//Cno5gPucjOYih79wVZj3X1Di/U3/IQhKXjc0=",
|
||||||
|
"owner": "rktjmp",
|
||||||
|
"repo": "shipwright.nvim",
|
||||||
|
"rev": "e596ab48328c31873f4f4d2e070243bf9de16ff3",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "rktjmp",
|
||||||
|
"repo": "shipwright.nvim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"plugins-tailwind-fold-nvim": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1752559116,
|
||||||
|
"narHash": "sha256-8uefZIVsn9USEd6FyiO3m3TRKAS/vigU4t9Tk5ijd3c=",
|
||||||
|
"owner": "razak17",
|
||||||
|
"repo": "tailwind-fold.nvim",
|
||||||
|
"rev": "d9e7ca11691d252b35795726dff087bf013b2ebf",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "razak17",
|
||||||
|
"repo": "tailwind-fold.nvim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"nixCats": "nixCats",
|
||||||
|
"nixpkgs": "nixpkgs",
|
||||||
|
"plugins-beancount-nvim": "plugins-beancount-nvim",
|
||||||
|
"plugins-crazy-node-movement": "plugins-crazy-node-movement",
|
||||||
|
"plugins-helm-ls-nvim": "plugins-helm-ls-nvim",
|
||||||
|
"plugins-mcphub-nvim": "plugins-mcphub-nvim",
|
||||||
|
"plugins-nvimkit-nvim": "plugins-nvimkit-nvim",
|
||||||
|
"plugins-shipwright-nvim": "plugins-shipwright-nvim",
|
||||||
|
"plugins-tailwind-fold-nvim": "plugins-tailwind-fold-nvim"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
226
.config/nvim/flake.nix
Normal file
226
.config/nvim/flake.nix
Normal file
@@ -0,0 +1,226 @@
|
|||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||||
|
nixCats.url = "github:BirdeeHub/nixCats-nvim";
|
||||||
|
|
||||||
|
plugins-shipwright-nvim = {
|
||||||
|
url = "github:rktjmp/shipwright.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
plugins-crazy-node-movement = {
|
||||||
|
url = "github:theHamsta/crazy-node-movement";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
plugins-beancount-nvim = {
|
||||||
|
url = "github:polarmutex/beancount.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
plugins-tailwind-fold-nvim = {
|
||||||
|
url = "github:razak17/tailwind-fold.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
plugins-nvimkit-nvim = {
|
||||||
|
url = "github:jamesblckwell/nvimkit.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
plugins-mcphub-nvim = {
|
||||||
|
url = "github:ravitemer/mcphub.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
plugins-helm-ls-nvim = {
|
||||||
|
url = "github:qvalentin/helm-ls.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs =
|
||||||
|
{
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
nixCats,
|
||||||
|
...
|
||||||
|
}@inputs:
|
||||||
|
let
|
||||||
|
inherit (nixCats) utils;
|
||||||
|
luaPath = ./.;
|
||||||
|
forEachSystem = utils.eachSystem nixpkgs.lib.platforms.all;
|
||||||
|
extra_pkg_config = { };
|
||||||
|
|
||||||
|
dependencyOverlays = [
|
||||||
|
(utils.standardPluginOverlay inputs)
|
||||||
|
];
|
||||||
|
|
||||||
|
categoryDefinitions =
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
lspsAndRuntimeDeps = with pkgs; {
|
||||||
|
general = [
|
||||||
|
black
|
||||||
|
clang
|
||||||
|
clang-tools
|
||||||
|
gawk
|
||||||
|
gdtoolkit_4
|
||||||
|
isort
|
||||||
|
tree-sitter
|
||||||
|
ormolu
|
||||||
|
nodePackages.prettier
|
||||||
|
nixd
|
||||||
|
nixfmt
|
||||||
|
prettierd
|
||||||
|
shellcheck-minimal
|
||||||
|
stylua
|
||||||
|
vscode-langservers-extracted
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
startupPlugins = {
|
||||||
|
general = with pkgs.vimPlugins; [
|
||||||
|
eyeliner-nvim
|
||||||
|
fzf-lua
|
||||||
|
ltex_extra-nvim
|
||||||
|
nvim-lspconfig
|
||||||
|
lsp_lines-nvim
|
||||||
|
lsp-progress-nvim
|
||||||
|
neodev-nvim
|
||||||
|
SchemaStore-nvim
|
||||||
|
nvim-lint
|
||||||
|
conform-nvim
|
||||||
|
luasnip
|
||||||
|
cmp_luasnip
|
||||||
|
nvim-cmp
|
||||||
|
cmp-nvim-lsp
|
||||||
|
cmp-buffer
|
||||||
|
cmp-path
|
||||||
|
plenary-nvim
|
||||||
|
nui-nvim
|
||||||
|
trouble-nvim
|
||||||
|
pkgs.neovimPlugins.shipwright-nvim
|
||||||
|
lush-nvim
|
||||||
|
zenbones-nvim
|
||||||
|
pkgs.neovimPlugins.crazy-node-movement
|
||||||
|
nvim-treesitter.withAllGrammars
|
||||||
|
nvim-treesitter-textobjects
|
||||||
|
# nvim-treesitter-context
|
||||||
|
nvim-ts-context-commentstring
|
||||||
|
treesj
|
||||||
|
sniprun
|
||||||
|
gitsigns-nvim
|
||||||
|
nvim-highlight-colors
|
||||||
|
pkgs.neovimPlugins.tailwind-fold-nvim
|
||||||
|
auto-session
|
||||||
|
nvim-dbee
|
||||||
|
image-nvim
|
||||||
|
pkgs.neovimPlugins.beancount-nvim
|
||||||
|
pkgs.neovimPlugins.nvimkit-nvim
|
||||||
|
codecompanion-nvim
|
||||||
|
pkgs.neovimPlugins.mcphub-nvim
|
||||||
|
copilot-lua
|
||||||
|
copilot-cmp
|
||||||
|
pkgs.neovimPlugins.helm-ls-nvim
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
optionalPlugins = {
|
||||||
|
general = with pkgs.vimPlugins; [
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
sharedLibraries = {
|
||||||
|
general = [ ];
|
||||||
|
};
|
||||||
|
|
||||||
|
environmentVariables = { };
|
||||||
|
};
|
||||||
|
|
||||||
|
packageDefinitions = {
|
||||||
|
nvim =
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
settings = {
|
||||||
|
suffix-path = true;
|
||||||
|
suffix-LD = true;
|
||||||
|
wrapRc = true;
|
||||||
|
aliases = [ "vim" ];
|
||||||
|
};
|
||||||
|
categories = {
|
||||||
|
general = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
defaultPackageName = "nvim";
|
||||||
|
in
|
||||||
|
|
||||||
|
forEachSystem (
|
||||||
|
system:
|
||||||
|
let
|
||||||
|
nixCatsBuilder = utils.baseBuilder luaPath {
|
||||||
|
inherit
|
||||||
|
nixpkgs
|
||||||
|
system
|
||||||
|
dependencyOverlays
|
||||||
|
extra_pkg_config
|
||||||
|
;
|
||||||
|
} categoryDefinitions packageDefinitions;
|
||||||
|
defaultPackage = nixCatsBuilder defaultPackageName;
|
||||||
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
in
|
||||||
|
{
|
||||||
|
packages = utils.mkAllWithDefault defaultPackage;
|
||||||
|
|
||||||
|
devShells = {
|
||||||
|
default = pkgs.mkShell {
|
||||||
|
name = defaultPackageName;
|
||||||
|
packages = [ defaultPackage ];
|
||||||
|
inputsFrom = [ ];
|
||||||
|
shellHook = '''';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
)
|
||||||
|
// (
|
||||||
|
let
|
||||||
|
nixosModule = utils.mkNixosModules {
|
||||||
|
moduleNamespace = [ defaultPackageName ];
|
||||||
|
inherit
|
||||||
|
defaultPackageName
|
||||||
|
dependencyOverlays
|
||||||
|
luaPath
|
||||||
|
categoryDefinitions
|
||||||
|
packageDefinitions
|
||||||
|
extra_pkg_config
|
||||||
|
nixpkgs
|
||||||
|
;
|
||||||
|
};
|
||||||
|
homeModule = utils.mkHomeModules {
|
||||||
|
moduleNamespace = [ defaultPackageName ];
|
||||||
|
inherit
|
||||||
|
defaultPackageName
|
||||||
|
dependencyOverlays
|
||||||
|
luaPath
|
||||||
|
categoryDefinitions
|
||||||
|
packageDefinitions
|
||||||
|
extra_pkg_config
|
||||||
|
nixpkgs
|
||||||
|
;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
|
||||||
|
overlays = utils.makeOverlays luaPath {
|
||||||
|
inherit nixpkgs dependencyOverlays extra_pkg_config;
|
||||||
|
} categoryDefinitions packageDefinitions defaultPackageName;
|
||||||
|
|
||||||
|
nixosModules.default = nixosModule;
|
||||||
|
homeModules.default = homeModule;
|
||||||
|
|
||||||
|
inherit utils nixosModule homeModule;
|
||||||
|
inherit (utils) templates;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
1
.config/nvim/ftplugin/javascript.lua
Normal file
1
.config/nvim/ftplugin/javascript.lua
Normal file
@@ -0,0 +1 @@
|
|||||||
|
vim.opt.matchpairs:append("=:;")
|
||||||
19
.config/nvim/ftplugin/json.lua
Normal file
19
.config/nvim/ftplugin/json.lua
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
local json_newline = function()
|
||||||
|
local line = vim.api.nvim_get_current_line()
|
||||||
|
if line == "" then
|
||||||
|
print("line is empty")
|
||||||
|
return "o"
|
||||||
|
elseif string.byte(line, -1) == string.byte(",") then
|
||||||
|
return "o"
|
||||||
|
elseif string.byte(line, -1) == string.byte("{") then
|
||||||
|
print("line ends with '{'")
|
||||||
|
return "o"
|
||||||
|
elseif string.byte(line, -1) == string.byte("}") then
|
||||||
|
print("line ends with '}'")
|
||||||
|
return "o"
|
||||||
|
else
|
||||||
|
return "A,<CR>"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.keymap.set("n", "o", json_newline, { buffer = true, expr = true })
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
vim.cmd([[
|
||||||
" Anki helper functions
|
" Anki helper functions
|
||||||
|
|
||||||
" Convert cloze note to regular text
|
" Convert cloze note to regular text
|
||||||
@@ -20,3 +21,4 @@
|
|||||||
|
|
||||||
au FileType pandoc com! -range AnkiRemoveAllClozes :%s/\%V{{c\d\+:://ge | :%s/\%V}}//ge | :%s/\%VSTART\nCloze\n//ge | :%s/\%VEND\n//ge
|
au FileType pandoc com! -range AnkiRemoveAllClozes :%s/\%V{{c\d\+:://ge | :%s/\%V}}//ge | :%s/\%VSTART\nCloze\n//ge | :%s/\%VEND\n//ge
|
||||||
au FileType pandoc com! -range AnkiRemoveSelectedClozes :%s/\%V{{c\d\+:://ge | :%s/\%V}}//ge | :%s/\%VSTART\nCloze\n//ge | :%s/\%VEND\n//ge
|
au FileType pandoc com! -range AnkiRemoveSelectedClozes :%s/\%V{{c\d\+:://ge | :%s/\%V}}//ge | :%s/\%VSTART\nCloze\n//ge | :%s/\%VEND\n//ge
|
||||||
|
]])
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user