many updates

This commit is contained in:
Solomon Laing 2023-02-04 19:18:17 +10:30
parent d938676e9f
commit c1ead62c03
6 changed files with 88 additions and 41 deletions

View File

@ -27,11 +27,30 @@ shopt -s checkwinsize
# colored GCC warnings and errors # colored GCC warnings and errors
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
# some more ls aliases # use lf to switch directories and bind it to ctrl-o
alias lsa='ls -lah' function lfcd() {
alias ll='ls -alF' tmp="$(mktemp -uq)"
alias la='ls -A' trap 'rm -f $tmp >/dev/null 2>&1' HUP INT QUIT TERM PWR EXIT
alias l='ls -CF' lf -last-dir-path="$tmp" "$@"
if [ -f "$tmp" ]; then
dir="$(cat "$tmp")"
[ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir"
fi
}
function pomo() {
arg1=$1
shift
args="$*"
min=${arg1:?Example: pomo 25 Take a break}
sec=$((min * 60))
msg="${args:?Example: pomo 25 Take a break}"
while true; do
date '+%H:%M' && sleep "${sec:?}" && notify-send -u critical -t 0 -a pomo "${msg:?}"
done
}
# Alias definitions. # Alias definitions.
# You may want to put all your additions into a separate file like # You may want to put all your additions into a separate file like

View File

@ -179,10 +179,10 @@ map gcs cd ~/.config/shell
map gcz cd ~/.config/zsh map gcz cd ~/.config/zsh
map gcx1 cd ~/.config/x11 map gcx1 cd ~/.config/x11
map gw cd ~/work map gw cd ~/work
map gNN cd ~/notes/zk/ map gNN cd ~/notes/
map gNi cd ~/notes/zk/inbox/
map gNw cd ~/notes/zk/work/ map gNw cd ~/notes/zk/work/
map gNn cd ~/notes/zk/notes/ map gNz cd ~/notes/zk/zettel/
map gNZ cd ~/notes/zk/zet/
map gNj cd ~/notes/zk/journal/ map gNj cd ~/notes/zk/journal/
map A rename # at the very end map A rename # at the very end

View File

@ -131,13 +131,16 @@ return {
end, end,
}, },
{ {
"echasnovski/mini.pairs", "windwp/nvim-autopairs",
event = "VeryLazy", event = "VeryLazy",
opts = {
disable_filetype = { "TelescopePrompt", "spectre_panel" },
ignored_next_char = "[%w%.*]", -- don't place autopairs when cursor sits infront of any character.
},
config = function(_, opts) config = function(_, opts)
require("mini.pairs").setup(opts) require("nvim-autopairs").setup(opts)
end, end,
}, },
{ {
"preservim/vim-markdown", "preservim/vim-markdown",
}, },

View File

@ -28,6 +28,11 @@ alias \
ccat="highlight --out-format=ansi" \ ccat="highlight --out-format=ansi" \
ip="ip -color=auto" ip="ip -color=auto"
alias \
l="ls" \
ll="ls -l" \
lsa="ls -la"
# These common commands are just too long! Abbreviate them. # These common commands are just too long! Abbreviate them.
alias \ alias \
ka="killall" \ ka="killall" \

View File

@ -1,4 +1,9 @@
$include /etc/inputrc $include /etc/inputrc
Control-o: lfcd
Control-t: tms
Control-n: zk edit --interactive --sort modified-
set editing-mode vi set editing-mode vi
$if mode=vi $if mode=vi

View File

@ -76,7 +76,7 @@ bindkey -M menuselect 'l' vi-forward-char
bindkey -M menuselect 'j' vi-down-line-or-history bindkey -M menuselect 'j' vi-down-line-or-history
bindkey -v '^?' backward-delete-char bindkey -v '^?' backward-delete-char
# use lf to switch directories and bind it to ctrl-l # use lf to switch directories and bind it to ctrl-o
lfcd() { lfcd() {
tmp="$(mktemp -uq)" tmp="$(mktemp -uq)"
trap 'rm -f $tmp >/dev/null 2>&1' HUP INT QUIT TERM PWR EXIT trap 'rm -f $tmp >/dev/null 2>&1' HUP INT QUIT TERM PWR EXIT
@ -96,18 +96,19 @@ bindkey -s '^t' '^utms\n'
# zk related things # zk related things
bindkey -s '^n' '^uzk edit --interactive --sort modified-\n' bindkey -s '^n' '^uzk edit --interactive --sort modified-\n'
function pomo() {
arg1=$1
shift
args="$*"
if [ -f /etc/hostname ]; then min=${arg1:?Example: pomo 25 Take a break}
HOST=$(cat /etc/hostname) sec=$((min * 60))
else msg="${args:?Example: pomo 25 Take a break}"
HOST=$(hostname)
fi
if [ "$HOST" = "holocene" ] ; then while true; do
source /usr/share/zsh/site-functions/zsh-syntax-highlighting.zsh date '+%H:%M' && sleep "${sec:?}" && notify-send -u critical -t 0 -a pomo "${msg:?}"
else done
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh }
fi
# Dracula Theme (for zsh-syntax-highlighting) # Dracula Theme (for zsh-syntax-highlighting)
# #
@ -200,6 +201,20 @@ ZSH_HIGHLIGHT_STYLES[arg0]='fg=#F8F8F2'
ZSH_HIGHLIGHT_STYLES[default]='fg=#F8F8F2' ZSH_HIGHLIGHT_STYLES[default]='fg=#F8F8F2'
ZSH_HIGHLIGHT_STYLES[cursor]='standout' ZSH_HIGHLIGHT_STYLES[cursor]='standout'
if [ -f /etc/hostname ]; then
HOST=$(cat /etc/hostname)
else
HOST=$(hostname)
fi
if [ "$HOST" = "holocene" ] ; then
source /usr/share/zsh/site-functions/zsh-syntax-highlighting.zsh
else
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
fi
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! #THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="$HOME/.sdkman" export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh" [[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"