summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2022-03-14 17:31:20 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2022-03-14 17:31:20 +0100
commit8f6be4a9861d29cd189b07f332a56cb83bd86abd (patch)
tree939dee5ffc664dab13293551022ede10a1ffdffa
parentUpdate (diff)
downloaddotfiles-bsd-8f6be4a9861d29cd189b07f332a56cb83bd86abd.tar.gz
dotfiles-bsd-8f6be4a9861d29cd189b07f332a56cb83bd86abd.tar.bz2
dotfiles-bsd-8f6be4a9861d29cd189b07f332a56cb83bd86abd.tar.xz
dotfiles-bsd-8f6be4a9861d29cd189b07f332a56cb83bd86abd.tar.zst
dotfiles-bsd-8f6be4a9861d29cd189b07f332a56cb83bd86abd.zip
In progress
-rw-r--r--.config/emacs/org/config.org3
-rw-r--r--.config/lf/icons267
-rw-r--r--.config/lf/lfrc62
-rw-r--r--.config/zsh/.zshrc12
-rwxr-xr-x.local/bin/rotdir14
5 files changed, 357 insertions, 1 deletions
diff --git a/.config/emacs/org/config.org b/.config/emacs/org/config.org
index 5bff1f7..30a397f 100644
--- a/.config/emacs/org/config.org
+++ b/.config/emacs/org/config.org
@@ -754,7 +754,8 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
*** undo-tree
#+BEGIN_SRC emacs-lisp
- (require 'undo-tree)
+ (require 'undo-tree)
+ (setq undo-tree-auto-save-history nil)
#+END_SRC
** Compilation
diff --git a/.config/lf/icons b/.config/lf/icons
new file mode 100644
index 0000000..249ada9
--- /dev/null
+++ b/.config/lf/icons
@@ -0,0 +1,267 @@
+fi=
+di=
+ln=
+pi=|
+so=ﯲ
+db=
+cd=c
+or=
+su=
+sg=
+tw=
+ow=w
+st=
+ex=
+*.7z=
+*.a=
+*.aac=
+*.ace=
+*.ai=
+*.alz=
+*.apk=
+*.arc=
+*.arj=
+*.asf=
+*.asm=
+*.asp=
+*.au=
+*.aup=
+*.avi=
+*.avi=
+*.bash=
+*.bat=
+*.bmp=
+*.bz2=
+*.bz=
+*.c++=
+*.c=
+*.cab=
+*.cbr=
+*.cbz=
+*.cc=
+*.cgm=
+*.class=
+*.clj=
+*.cljc=
+*.cljs=
+*.cmake=
+*.cmd=
+*.coffee=
+*.conf=
+*.cp=
+*.cpio=
+*.cpp=
+*.cs=
+*.css=
+*.cue=
+*.cvs=
+*.cxx=
+*.d=
+*.dart=
+*.db=
+*.deb=
+*.diff=
+*.dl=
+*.dll=
+*.doc=
+*.docx=
+*.dump=
+*.dwm=
+*.dz=
+*.ear=
+*.edn=
+*.eex=
+*.efi=
+*.ejs=
+*.elf=
+*.elm=
+*.emf=
+*.epub=
+*.erl=
+*.esd=
+*.ex=
+*.exe=
+*.exs=
+*.f#=
+*.fifo=|
+*.fish=
+*.flac=
+*.flc=
+*.fli=
+*.flv=
+*.flv=
+*.fs=
+*.fsi=
+*.fsscript=
+*.fsx=
+*.gem=
+*.gif=
+*.git=
+*.gl=
+*.go=
+*.gz=
+*.gzip=
+*.h=
+*.hbs=
+*.hh=
+*.hpp=
+*.hrl=
+*.hs=
+*.htaccess=
+*.htm=
+*.html=
+*.htpasswd=
+*.ico=
+*.img=
+*.ini=
+*.iso=
+*.jar=
+*.java=
+*.jl=
+*.jpeg=
+*.jpg=
+*.js=
+*.json=
+*.jsx=
+*.key=
+*.less=
+*.lha=
+*.lhs=
+*.log=
+*.lrz=
+*.lua=
+*.lz4=
+*.lz=
+*.lzh=
+*.lzma=
+*.lzo=
+*.m2v=
+*.m4a=
+*.m4v=
+*.markdown=
+*.md=
+*.mid=
+*.midi=
+*.mjpeg=
+*.mjpg=
+*.mka=
+*.mkv=
+*.ml=λ
+*.mli=λ
+*.mng=
+*.mov=
+*.mp3=
+*.mp4=
+*.mp4v=
+*.mpc=
+*.mpeg=
+*.mpg=
+*.msi=
+*.mustache=
+*.nix=
+*.nuv=
+*.o=
+*.oga=
+*.ogg=
+*.ogm=
+*.ogv=
+*.ogx=
+*.opus=
+*.pbm=
+*.pcx=
+*.pdf=
+*.pgm=
+*.php=
+*.pl=
+*.pm=
+*.png=
+*.ppk=
+*.ppm=
+*.ppt=
+*.pptx=
+*.pro=
+*.ps1=
+*.psb=
+*.psd=
+*.pub=
+*.py=
+*.pyc=
+*.pyd=
+*.pyo=
+*.qt=
+*.ra=
+*.rar=
+*.rb=
+*.rc=
+*.rlib=
+*.rm=
+*.rmvb=
+*.rom=
+*.rpm=
+*.rs=
+*.rss=
+*.rtf=
+*.rz=
+*.s=
+*.sar=
+*.scala=
+*.scss=
+*.sh=
+*.slim=
+*.sln=
+*.so=
+*.spx=
+*.sql=
+*.styl=
+*.suo=
+*.svg=
+*.svgz=
+*.swm=
+*.t7z=
+*.t=
+*.tar=
+*.taz=
+*.tbz2=
+*.tbz=
+*.tga=
+*.tgz=
+*.tif=
+*.tiff=
+*.tlz=
+*.ts=
+*.twig=
+*.txz=
+*.tz=
+*.tzo=
+*.tzst=
+*.vim=
+*.vimrc=
+*.vob=
+*.war=
+*.wav=
+*.wav=
+*.webm=
+*.wim=
+*.wmv=
+*.xbm=
+*.xbps=
+*.xcf=
+*.xhtml=
+*.xls=
+*.xlsx=
+*.xml=
+*.xpm=
+*.xspf=
+*.xul=
+*.xwd=
+*.xz=
+*.yaml=
+*.yml=
+*.yuv=
+*.z=
+*.zip=
+*.zoo=
+*.zsh=
+*.zst=
+*.src=
+*.ebuild= \ No newline at end of file
diff --git a/.config/lf/lfrc b/.config/lf/lfrc
new file mode 100644
index 0000000..e800495
--- /dev/null
+++ b/.config/lf/lfrc
@@ -0,0 +1,62 @@
+# Basic vars
+set shellopts '-eu'
+set ifs "\n"
+set scrolloff 10
+set icons
+set period 1
+set previewer '~/.config/lf/scope'
+set hiddenfiles ".*:*.aux:*.log:*.bbl:*.bcf:*.blg:*.run.xml"
+
+# cmds/functions
+cmd open ${{
+ case $(file --mime-type "$(readlink -f $f)" -b) in
+ application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) localc $fx ;;
+ image/vnd.djvu|application/pdf|application/octet-stream|application/postscript) bsdsetsid zathura $fx >/dev/null 2>&1 ;;
+ text/*|application/json|inode/x-empty) $EDITOR $fx;;
+ image/x-xcf) bsdsetsid gimp $f >/dev/null 2>&1 ;;
+ image/svg+xml) display -- $f ;;
+ image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|tif\|ico\)\(_large\)*$" |
+ bsdsetsid sxiv -aibo 2>/dev/null | while read -r file; do
+ [ -z "$file" ] && continue
+ lf -remote "send select \"$file\""
+ lf -remote "send toggle"
+ done &
+ ;;
+ audio/*) bsdsetsid st -e mpv --no-audio-display --audio-channels=stereo $f ;;
+ video/*) bsdsetsid mpv --fullscreen --really-quiet --audio-channels=stereo $f >/dev/null 2>&1 ;;
+ application/pdf|application/vnd*|application/epub*) bsdsetsid zathura $fx >/dev/null 2>&1 ;;
+ application/pgp-encrypted) $EDITOR $fx ;;
+ *) for f in $fx; do bsdsetsid xdg-open $f >/dev/null 2>&1; done;;
+ esac
+}}
+
+cmd mkdir $mkdir -p "$(echo $* | tr ' ' '\ ')"
+cmd bulkrename $vidir $fx
+
+map gr cd /
+map gm cd ~/hdd
+map za set hidden!
+map zh set info size:time
+map <c-f> $lf -remote "send $id select '$(fzf)'"
+map <enter> open
+map D delete
+map S $$SHELL
+map <c-n> push :mkdir<space>
+map <f-7> push :mkdir<space>
+map <c-r> reload
+map x $$f
+map X !$f
+map o &mimeopen $f
+map O $mimeopen --ask $f
+
+map A rename # at the very end
+map c push A<c-u> # new rename
+map I push A<c-a> # at the very beginning
+map i push A<a-b><a-b><a-f> # before extention
+map a push A<a-b> # after extention
+map B bulkrename
+map <f-2> bulkrename
+
+map <c-e> down
+map <c-y> up
+map V push :!nvim<space>
diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc
index a437d68..977be7b 100644
--- a/.config/zsh/.zshrc
+++ b/.config/zsh/.zshrc
@@ -81,6 +81,18 @@ globalias() {
zle -N globalias
+# Use lf to switch directories and bind it to ctrl-o
+lfcd () {
+ tmp="$(mktemp)"
+ lf -last-dir-path="$tmp" "$@"
+ if [ -f "$tmp" ]; then
+ dir="$(cat "$tmp")"
+ rm -f "$tmp" >/dev/null
+ [ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir"
+ fi
+}
+bindkey -s '^o' '^ulfcd\n'
+
bindkey -v "^ " globalias
bindkey -v " " magic-space
bindkey -M isearch " " magic-space
diff --git a/.local/bin/rotdir b/.local/bin/rotdir
new file mode 100755
index 0000000..013ef86
--- /dev/null
+++ b/.local/bin/rotdir
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Courtesy of Luke Smith
+
+# When I open an image from the file manager in sxiv (the image viewer), I want
+# to be able to press the next/previous keys to key through the rest of the
+# images in the same directory. This script "rotates" the content of a
+# directory based on the first chosen file, so that if I open the 15th image,
+# if I press next, it will go to the 16th etc. Autistic, I know, but this is
+# one of the reasons that sxiv is great for being able to read standard input.
+
+[ -z "$1" ] && echo "usage: rotdir regex 2>&1" && exit 1
+base="$(basename "$1")"
+exa "$PWD" | awk -v BASE="$base" 'BEGIN { lines = ""; m = 0; } { if ($0 == BASE) { m = 1; } } { if (!m) { if (lines) { lines = lines"\n"; } lines = lines""$0; } else { print $0; } } END { print lines; }'