From 320ed288a5d68c22e0d3d399df77f31f123ea88c Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 6 Aug 2023 14:58:30 +0200 Subject: [nvim] added one buffer keymap --- config/essentials/nvim/lua/user/remap.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'config/essentials') diff --git a/config/essentials/nvim/lua/user/remap.lua b/config/essentials/nvim/lua/user/remap.lua index 7c6d87f..e59b81a 100644 --- a/config/essentials/nvim/lua/user/remap.lua +++ b/config/essentials/nvim/lua/user/remap.lua @@ -15,6 +15,8 @@ vim.keymap.set("i", "\\\\", "\\", { noremap = true }) vim.keymap.set("n", "gb", "buffers:buffer", { noremap = true }) vim.keymap.set("n", "q", "q!", { noremap = true }) vim.keymap.set("n", "Q", "qa!", { noremap = true }) +-- close all except focused buffer +vim.keymap.set("n", "1", "%bd|e#", { noremap = true }) -- Windows vim.keymap.set("n", "", "h", { noremap = true }) -- cgit v1.2.3 From cb110575144beb4125fd1d8204c8204e6bca280f Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 7 Aug 2023 18:59:08 +0200 Subject: [goo] added option to give search query as second paramater I noticed by mistake sometimes I would type the query already. --- bin/common/goo | 9 +++++++-- config/essentials/zsh/functions.zsh | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'config/essentials') diff --git a/bin/common/goo b/bin/common/goo index cfd03ec..2a5faad 100755 --- a/bin/common/goo +++ b/bin/common/goo @@ -15,9 +15,14 @@ VisualParadigm intellij arduino15" +if [ -n "$2" ] +then + [ -d "$2" ] && dest="$2" || opt="-q $2" +fi + for dir in $exclude; do dirs="$dirs -name \"$dir\" -o " done -cmd="find ${2:-$HOME} \(${dirs} -false \) -prune -o -type ${1:-f} -mindepth 1 -print" +cmd="find ${dest:-$HOME} \(${dirs} -false \) -prune -o -type ${1:-f} -mindepth 1 -print" -eval "$cmd" 2>/dev/null +eval "$cmd" 2>/dev/null | fzf $opt diff --git a/config/essentials/zsh/functions.zsh b/config/essentials/zsh/functions.zsh index 671e6fb..053ce8e 100644 --- a/config/essentials/zsh/functions.zsh +++ b/config/essentials/zsh/functions.zsh @@ -39,9 +39,9 @@ nnn() { test -z "$NNNLVL" && /usr/bin/nnn "$@" || exit } ranger() { test -z "$RANGER_LEVEL" && /usr/bin/ranger "$@" || exit } # googoo aliases -ff () { goo f "$1" | fzf } -fd () { goo d "$1" | fzf } -fdf () { goo f "$1" | fzf | xargs -I {} dirname "{}" } +ff () { goo f "$1" } +fd () { goo d "$1" } +fdf () { goo f "$1" | xargs -I {} dirname "{}" } o () { f="$(ff $1)" -- cgit v1.2.3 From 557b4e5d5bb85919c6dc0f87d27d7df07616f7fd Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 7 Aug 2023 19:00:29 +0200 Subject: [aliases] updated the gdate alias --- config/essentials/zsh/aliases.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/essentials') diff --git a/config/essentials/zsh/aliases.sh b/config/essentials/zsh/aliases.sh index 3df6234..b1d4a50 100644 --- a/config/essentials/zsh/aliases.sh +++ b/config/essentials/zsh/aliases.sh @@ -181,7 +181,7 @@ alias wf='doas wipefs -a' alias dmci="doas make clean install" alias rmd='rm -f *.{orig,rej}' alias cdzot='mkdir -p /tmp/zottesite && cd /tmp/zottesite' -alias gdate="date +%y%m%d_%H%M%S" +alias gdate='date +%y_%m_%d-%T' alias tpid='tail -f /dev/null --pid' alias vbm='vboxmanage' -- cgit v1.2.3 From b3f42fec8739d1d23ec6d64ff35c9db022c5adca Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 13 Aug 2023 20:15:52 +0200 Subject: [googoo] removed functions and updated behaviour removed functions that where unneed as they were only called once, changed behaviour to not implement fzf in goo but in the functions itself, this makes goo easier to implement in other commands. Also ported over the funcitonality of setting the query with the first argument --- bin/common/goo | 7 +------ config/essentials/zsh/functions.zsh | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 13 deletions(-) (limited to 'config/essentials') diff --git a/bin/common/goo b/bin/common/goo index 2a5faad..a56cbaf 100755 --- a/bin/common/goo +++ b/bin/common/goo @@ -15,14 +15,9 @@ VisualParadigm intellij arduino15" -if [ -n "$2" ] -then - [ -d "$2" ] && dest="$2" || opt="-q $2" -fi - for dir in $exclude; do dirs="$dirs -name \"$dir\" -o " done cmd="find ${dest:-$HOME} \(${dirs} -false \) -prune -o -type ${1:-f} -mindepth 1 -print" -eval "$cmd" 2>/dev/null | fzf $opt +eval "$cmd" 2>/dev/null diff --git a/config/essentials/zsh/functions.zsh b/config/essentials/zsh/functions.zsh index 053ce8e..c4999db 100644 --- a/config/essentials/zsh/functions.zsh +++ b/config/essentials/zsh/functions.zsh @@ -39,23 +39,30 @@ nnn() { test -z "$NNNLVL" && /usr/bin/nnn "$@" || exit } ranger() { test -z "$RANGER_LEVEL" && /usr/bin/ranger "$@" || exit } # googoo aliases -ff () { goo f "$1" } -fd () { goo d "$1" } -fdf () { goo f "$1" | xargs -I {} dirname "{}" } +_googoo_fzf_opt () +{ + if [ "$1" ] + then + [ -d "$1" ] && dest="$1" || opt="-q $1" + fi +} o () { - f="$(ff $1)" + _googoo_fzf_opt "$1" + f="$(goo f "dest" | fzf $opt)" test "$1" && shift - test -n "$f" && $EDITOR $@ "$f" + test -f "$f" && $EDITOR $@ "$f" } go () { - d="$(fd $1)" + _googoo_fzf_opt "$1" + d="$(goo d "$dest" | fzf $opt)" test -d "$d" && cd "$d" } ogo () { - d="$(fdf $1)" + _googoo_fzf_opt "$1" + d="$(dirname "$(goo f "$dest")" | fzf $opt)" test -d "$d" && cd "$d" } -- cgit v1.2.3 From 93d3613febfb869d5f30d74c25b2fbc0b20170ca Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 13 Aug 2023 20:17:48 +0200 Subject: [aliases] added diff alias --- config/essentials/zsh/aliases.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'config/essentials') diff --git a/config/essentials/zsh/aliases.sh b/config/essentials/zsh/aliases.sh index b1d4a50..9849b93 100644 --- a/config/essentials/zsh/aliases.sh +++ b/config/essentials/zsh/aliases.sh @@ -128,6 +128,7 @@ alias xrandr-default='xrandr --auto --output VGA-1 --mode 1920x1080 --left-of HD alias d='du -d 0 -h' alias dud='du .* * -d 0 -h 2>/dev/null | sort -h' alias df='df -h' +alias diff='diff -u --color' alias shred='shred -uz' alias lsblk='lsblk -o name,type,fsused,fsavail,size,fstype,label,mountpoint' alias floc='doas find / -type "f" 2> /dev/null | grep' -- cgit v1.2.3 From 02a5c5ddf55986666335e2d5a16c4635f0b6ca80 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 13 Aug 2023 20:17:59 +0200 Subject: [functions] use grouping in calc, added psgrep --- config/essentials/zsh/functions.zsh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'config/essentials') diff --git a/config/essentials/zsh/functions.zsh b/config/essentials/zsh/functions.zsh index c4999db..3c5f11f 100644 --- a/config/essentials/zsh/functions.zsh +++ b/config/essentials/zsh/functions.zsh @@ -76,7 +76,13 @@ ipc () fi } -calc () { echo "$@" | bc -l } +calc () { echo "$@" | bc -l | numfmt --grouping; } + +psgrep () +{ + [ $# -eq 0 ] && return 1 + pgrep "$@" | xargs ps +} unique () { local f -- cgit v1.2.3 From 949d2f7025cbfe4db316a3fc13199ac5c82d4b5b Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 13 Aug 2023 20:18:46 +0200 Subject: [zshrc] use exec and keychain identity Add keychain identity on startup, this is more useful because with suspend I will only type the password once per day. Also it makes adding with keyadd faster. Also use exec to have less processes, don't know if it works though... --- bin/guiscripts/startw | 1 + config/essentials/zsh/.zshrc | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'config/essentials') diff --git a/bin/guiscripts/startw b/bin/guiscripts/startw index 768f401..9b35556 100755 --- a/bin/guiscripts/startw +++ b/bin/guiscripts/startw @@ -1,5 +1,6 @@ #!/bin/sh eval "$(keychain --dir "$XDG_CONFIG_HOME/keychain" --eval --quiet --agents gpg,ssh)" +eval "$(keychain --dir "$XDG_CONFIG_HOME/keychain" --eval --quiet --agents gpg 3A626DD20A32EB2E5DD9CE71CFD9ABC97158CD5D 2> /dev/null)" Hyprland diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index d8675d4..0665533 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -5,9 +5,9 @@ then clear if [ "/dev/tty1" = "$TTY" ] then - startw > /dev/null 2>&1 + exec startw > /dev/null 2>&1 else - startx > /dev/null 2>&1 + exec startx > /dev/null 2>&1 fi exit fi -- cgit v1.2.3