config: little shortcut adjustments
This commit is contained in:
parent
07e7109fa9
commit
c647431f4e
|
@ -148,6 +148,7 @@
|
||||||
(let ((current-prefix-arg '(4))) (call-interactively 'org-export-dispatch))
|
(let ((current-prefix-arg '(4))) (call-interactively 'org-export-dispatch))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
;; TODO name file according to subtree headline
|
||||||
(defun org-export-dispatch-custom-date ()
|
(defun org-export-dispatch-custom-date ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((org-time-stamp-custom-formats
|
(let ((org-time-stamp-custom-formats
|
||||||
|
@ -176,6 +177,7 @@
|
||||||
"t" 'org-todo-or-insert
|
"t" 'org-todo-or-insert
|
||||||
"e" 'org-export-dispatch-custom-date
|
"e" 'org-export-dispatch-custom-date
|
||||||
"E" 'org-export-repeat
|
"E" 'org-export-repeat
|
||||||
|
"n" 'org-add-note
|
||||||
"d=" 'org-timestamp-up-week
|
"d=" 'org-timestamp-up-week
|
||||||
"rt" 'org-change-todo-in-region
|
"rt" 'org-change-todo-in-region
|
||||||
"ra" 'org-change-tag-in-region
|
"ra" 'org-change-tag-in-region
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
.Trash-1000/
|
.*Trash-1000/
|
||||||
lost+found/
|
lost+found/
|
||||||
|
|
||||||
.sync/
|
.sync/
|
||||||
.stversions/
|
.stfolder/
|
||||||
|
|
||||||
.gradle/
|
.gradle/
|
||||||
cache/
|
cache/
|
||||||
cmake_build/
|
cmake_build/
|
||||||
dist_newstyle/
|
dist_newstyle/
|
||||||
|
node_modules/
|
||||||
build/
|
build/
|
||||||
|
generated/
|
||||||
|
out/
|
||||||
|
|
|
@ -26,10 +26,16 @@ which lsb_release >/dev/null && export DIST=$(lsb_release --id | cut -d' ' -f2)
|
||||||
|
|
||||||
unalias rd 2>/dev/null
|
unalias rd 2>/dev/null
|
||||||
rd() {
|
rd() {
|
||||||
test -d "$1" && find "$1" -type d -empty -printf "Removing %p\n" -delete || rm "$@"
|
while test $# -gt 0
|
||||||
|
do
|
||||||
|
test -d "$1" && find "$1" -maxdepth 1 -type d -empty -printf "Removing %p\n" -delete || rm -iv "$@"
|
||||||
|
shift
|
||||||
|
done
|
||||||
}
|
}
|
||||||
rr() { mv "$@" /tmp }
|
rr() { mv "$@" /tmp }
|
||||||
|
|
||||||
|
calc='rlwrap -a bc -l'
|
||||||
|
|
||||||
alias j='jrnl'
|
alias j='jrnl'
|
||||||
jn() { jrnl -to today "$@" | bat --style=plain --pager="less +G" }
|
jn() { jrnl -to today "$@" | bat --style=plain --pager="less +G" }
|
||||||
alias jnc='jn -contains'
|
alias jnc='jn -contains'
|
||||||
|
@ -51,6 +57,12 @@ alias edpart='sudoedit /etc/fstab && sudo findmnt --verify'
|
||||||
highlight() { echo "[4m$1[0m" }
|
highlight() { echo "[4m$1[0m" }
|
||||||
|
|
||||||
alias dedup='awk '"'"'!a[$0]++'"'"
|
alias dedup='awk '"'"'!a[$0]++'"'"
|
||||||
|
listconf() {
|
||||||
|
{ cat "$conf_cache"; test -f "$conf_extra" && cat "$conf_extra";
|
||||||
|
fd --hidden --type file --size -1m --max-depth 1 . ~;
|
||||||
|
fd --hidden --type file --size -1m --max-depth 3 . --full-path "$XDG_CONFIG_HOME" /etc } | dedup
|
||||||
|
}
|
||||||
|
|
||||||
edconf() {
|
edconf() {
|
||||||
conf_cache_dir="$XDG_CACHE_HOME/edconf"
|
conf_cache_dir="$XDG_CACHE_HOME/edconf"
|
||||||
conf_cache="$conf_cache_dir/files"
|
conf_cache="$conf_cache_dir/files"
|
||||||
|
@ -58,11 +70,8 @@ edconf() {
|
||||||
conf_extra="$XDG_CONFIG_HOME/edconf-extra"
|
conf_extra="$XDG_CONFIG_HOME/edconf-extra"
|
||||||
mkdir -p "$conf_cache_dir"
|
mkdir -p "$conf_cache_dir"
|
||||||
touch "$conf_cache"
|
touch "$conf_cache"
|
||||||
|
sel=$(listconf | fzf -1 -0 --tiebreak=end,length --preview 'bat --color=always --style=numbers --line-range :200 {}' --query="$1" --history "$conf_cache_dir/searches")
|
||||||
# | xargs file | grep text | cut -d':' -f1 # this filters out non-text files, but it's ridiculously slow
|
# | xargs file | grep text | cut -d':' -f1 # this filters out non-text files, but it's ridiculously slow
|
||||||
sel="$({ cat "$conf_cache"; test -f "$conf_extra" && cat "$conf_extra";
|
|
||||||
fd --hidden --type file --size -1m --max-depth 1 . ~;
|
|
||||||
fd --hidden --type file --size -1m --max-depth 3 . --full-path "$XDG_CONFIG_HOME" /etc } |
|
|
||||||
dedup | fzf -1 -0 --tiebreak=end,length --preview 'bat --color=always --style=numbers --line-range :200 {}' --query="$1" --history "$conf_cache_dir/searches")"
|
|
||||||
test "$sel" && ((echo "$sel" | cat - "$conf_cache" | head -30 >"$conf_tmp" && mv "$conf_tmp" "$conf_cache") & edit "$sel")
|
test "$sel" && ((echo "$sel" | cat - "$conf_cache" | head -30 >"$conf_tmp" && mv "$conf_tmp" "$conf_cache") & edit "$sel")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +97,7 @@ edbin() {
|
||||||
|
|
||||||
alias l="ls -l --almost-all --human-readable --group-directories-first --file-type"
|
alias l="ls -l --almost-all --human-readable --group-directories-first --file-type"
|
||||||
cd() {
|
cd() {
|
||||||
test ! -d "$1" && test $# -eq 1 && dir=$(find "$DATA" -maxdepth 2 -type d -name "$1*" | head -1) &&
|
test ! -d "$1" && test $# -eq 1 && dir=$(f --glob "$1*" "$DATA" --maxdepth 2 --type d --max-results 1) &&
|
||||||
test -n "$dir" && cd "$dir" && return
|
test -n "$dir" && cd "$dir" && return
|
||||||
builtin cd $1 &&
|
builtin cd $1 &&
|
||||||
command ls --file-type --group-directories-first --color=always --format=vertical -w $COLUMNS | head -3
|
command ls --file-type --group-directories-first --color=always --format=vertical -w $COLUMNS | head -3
|
||||||
|
@ -269,7 +278,7 @@ cl() {
|
||||||
|
|
||||||
# FILES
|
# FILES
|
||||||
|
|
||||||
alias f="noglob $(test -x "$(which fd)" && echo fd || echo "fdfind") --hidden --no-ignore-vcs --one-file-system"
|
alias f="noglob $(which fd >/dev/null && echo fd || echo fdfind) --hidden --no-ignore-vcs --one-file-system"
|
||||||
#alias f='find -not -path "*.sync*" -and -not \( -name daten -prune \)'
|
#alias f='find -not -path "*.sync*" -and -not \( -name daten -prune \)'
|
||||||
#alias f1='find -mindepth 1 -maxdepth 1'
|
#alias f1='find -mindepth 1 -maxdepth 1'
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,13 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
if test "$#" -gt 0
|
||||||
|
then
|
||||||
dif "$(st-unarchive "$1")" "$@"
|
dif "$(st-unarchive "$1")" "$@"
|
||||||
test "$?" -eq "2" && exit 1
|
test "$?" -eq "2" && exit 1
|
||||||
echo "y to restore"
|
echo "y|r to restore, n|d to delete"
|
||||||
read answer
|
read reply
|
||||||
test "$answer" = "y" && st-restore "$1" || exit 0
|
case "$reply" in
|
||||||
|
(y|r) st-restore "$1";;
|
||||||
|
(n|d) rm -v "$1";;
|
||||||
|
esac
|
||||||
|
else find -name '*sync-conflict*' -exec st-diff '{}' \;
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue