aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.config/dircolors177
-rw-r--r--.config/fzmp/conf3
-rw-r--r--.config/lf/lfrc20
-rwxr-xr-x.local/share/bin/addtoqueue2
-rwxr-xr-x.local/share/bin/fv2
-rwxr-xr-x.local/share/bin/open12
-rwxr-xr-x.local/share/bin/preview40
-rw-r--r--.profile19
-rw-r--r--.zshrc47
9 files changed, 292 insertions, 30 deletions
diff --git a/.config/dircolors b/.config/dircolors
new file mode 100644
index 0000000..9997fcf
--- /dev/null
+++ b/.config/dircolors
@@ -0,0 +1,177 @@
+# vim:ft=conf
+TERM Eterm
+TERM ansi
+TERM *color*
+TERM con[0-9]*x[0-9]*
+TERM cons25
+TERM console
+TERM cygwin
+TERM dtterm
+TERM gnome
+TERM hurd
+TERM jfbterm
+TERM konsole
+TERM kterm
+TERM linux
+TERM linux-c
+TERM mlterm
+TERM putty
+TERM rxvt*
+TERM screen*
+TERM st
+TERM terminator
+TERM tmux*
+TERM vt100
+TERM xterm*
+
+NORMAL 00 # no color code at all
+# FILE 00 # regular file: use no color at all
+RESET 0 # reset to "normal" color
+DIR 01;37 # directory
+# LINK 01;36 # symbolic link. (If you set this to 'target' instead of a
+MULTIHARDLINK 00 # regular file with more than one link
+FIFO 40;33 # pipe
+SOCK 01;35 # socket
+DOOR 01;35 # door
+BLK 40;33;01 # block device driver
+CHR 40;33;01 # character device driver
+ORPHAN 40;31;01 # symlink to nonexistent file, or non-stat'able file ...
+MISSING 00 # ... and the files they point to
+SETUID 37;41 # file that is setuid (u+s)
+SETGID 30;43 # file that is setgid (g+s)
+CAPABILITY 30;41 # file with capability
+STICKY_OTHER_WRITABLE 0;47 # dir that is sticky and other-writable (+t,o+w)
+OTHER_WRITABLE 01;34 # dir that is other-writable (o+w) and not sticky
+STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable
+EXEC 0;37
+
+# List any file extensions like '.gz' or '.tar' that you would like ls
+# to colorize below. Put the extension, a space, and the color init string.
+# (and any comments you want to add after a '#')
+# If you use DOS-style suffixes, you may want to uncomment the following:
+#.cmd 01;32 # executables (bright green)
+#.exe 01;32
+#.com 01;32
+#.btm 01;32
+#.bat 01;32
+# Or if you want to colorize scripts even if they do not have the
+# executable bit actually set.
+#.sh 01;32
+#.csh 01;32
+ # archives or compressed (bright red)
+.tar 01;31
+.tgz 01;31
+.arc 01;31
+.arj 01;31
+.taz 01;31
+.lha 01;31
+.lz4 01;31
+.lzh 01;31
+.lzma 01;31
+.tlz 01;31
+.txz 01;31
+.tzo 01;31
+.t7z 01;31
+.zip 01;31
+.z 01;31
+.dz 01;31
+.gz 01;31
+.lrz 01;31
+.lz 01;31
+.lzo 01;31
+.xz 01;31
+.zst 01;31
+.tzst 01;31
+.bz2 01;31
+.bz 01;31
+.tbz 01;31
+.tbz2 01;31
+.tz 01;31
+.deb 01;31
+.rpm 01;31
+.jar 01;31
+.war 01;31
+.ear 01;31
+.sar 01;31
+.rar 01;31
+.alz 01;31
+.ace 01;31
+.zoo 01;31
+.cpio 01;31
+.7z 01;31
+.rz 01;31
+.cab 01;31
+.wim 01;31
+.swm 01;31
+.dwm 01;31
+.esd 01;31
+# image formats
+.jpg 01;35
+.jpeg 01;35
+.mjpg 01;35
+.mjpeg 01;35
+.gif 01;35
+.bmp 01;35
+.pbm 01;35
+.pgm 01;35
+.ppm 01;35
+.tga 01;35
+.xbm 01;35
+.xpm 01;35
+.tif 01;35
+.tiff 01;35
+.png 01;35
+.svg 01;35
+.svgz 01;35
+.mng 01;35
+.pcx 01;35
+.mov 01;35
+.mpg 01;35
+.mpeg 01;35
+.m2v 01;35
+.mkv 01;35
+.webm 01;35
+.webp 01;35
+.ogm 01;35
+.mp4 01;35
+.m4v 01;35
+.mp4v 01;35
+.vob 01;35
+.qt 01;35
+.nuv 01;35
+.wmv 01;35
+.asf 01;35
+.rm 01;35
+.rmvb 01;35
+.flc 01;35
+.avi 01;35
+.fli 01;35
+.flv 01;35
+.gl 01;35
+.dl 01;35
+.xcf 01;35
+.xwd 01;35
+.yuv 01;35
+.cgm 01;35
+.emf 01;35
+# https://wiki.xiph.org/MIME_Types_and_File_Extensions
+.ogv 01;35
+.ogx 01;35
+# audio formats
+.aac 00;36
+.au 00;36
+.flac 00;36
+.m4a 00;36
+.mid 00;36
+.midi 00;36
+.mka 00;36
+.mp3 00;36
+.mpc 00;36
+.ogg 00;36
+.ra 00;36
+.wav 00;36
+# https://wiki.xiph.org/MIME_Types_and_File_Extensions
+.oga 00;36
+.opus 00;36
+.spx 00;36
+.xspf 00;36
diff --git a/.config/fzmp/conf b/.config/fzmp/conf
new file mode 100644
index 0000000..22439c3
--- /dev/null
+++ b/.config/fzmp/conf
@@ -0,0 +1,3 @@
+default_view songs
+full_song_format [[[%artist% - %album% / ][%title%]]|%file%]
+fzf_options --ignore-case
diff --git a/.config/lf/lfrc b/.config/lf/lfrc
new file mode 100644
index 0000000..88560a8
--- /dev/null
+++ b/.config/lf/lfrc
@@ -0,0 +1,20 @@
+set shell sh
+set shellopts '-eu'
+set scrolloff 10
+
+set previewer preview
+cmd open $open $fx
+
+set cursorpreviewfmt ""
+set errorfmt "\033[31m"
+set promptfmt "\033[34;1m%d\033[0m\033[1m%f\033[0m"
+set statfmt "\033[36m%p\033[0m| %S| -> %l"
+
+map v :toggle ; down
+map V invert
+map <backspace> set hidden! # <C-h>
+
+cmd bulkrename $renamer $fx
+
+# vim:ft=cfg
+
diff --git a/.local/share/bin/addtoqueue b/.local/share/bin/addtoqueue
index c021c95..535e250 100755
--- a/.local/share/bin/addtoqueue
+++ b/.local/share/bin/addtoqueue
@@ -1,3 +1,3 @@
#!/bin/sh
-st -T "[floating]" -g 120x20 -e fzmp -A
+exec st -T "[floating]" -g 120x20 -e fzmp
diff --git a/.local/share/bin/fv b/.local/share/bin/fv
new file mode 100755
index 0000000..5ce4f2e
--- /dev/null
+++ b/.local/share/bin/fv
@@ -0,0 +1,2 @@
+#!/bin/sh
+fzf --multi --print0 | exec xargs -r0 $EDITOR
diff --git a/.local/share/bin/open b/.local/share/bin/open
new file mode 100755
index 0000000..7856488
--- /dev/null
+++ b/.local/share/bin/open
@@ -0,0 +1,12 @@
+#!/bin/sh
+case "$(file --mime-type -Lb "$1")" in
+ text/*)
+ exec $EDITOR -- "$@"
+ ;;
+ *)
+ for file in "$@"; do
+ fork xdg-open "$file"
+ done
+ ;;
+esac
+
diff --git a/.local/share/bin/preview b/.local/share/bin/preview
new file mode 100755
index 0000000..0225848
--- /dev/null
+++ b/.local/share/bin/preview
@@ -0,0 +1,40 @@
+#!/bin/sh
+[ $# -ne 5 ] && exit 1
+FILE="$1"
+WIDTH="$2"
+HEIGHT="$3"
+POS_X="$4"
+POS_Y="$5"
+
+MIMETYPE="$(file --mime-type -Lb "$FILE")"
+
+case "$MIMETYPE" in
+ image/*)
+ echo '{
+ "action": "add",
+ "x": 0,
+ "y": 0,
+ "path": "/home/loek/docs/frob.jpg"
+ }' | ueberzug layer --parser json
+ ;;
+ text/*)
+ bat \
+ --terminal-width="$WIDTH" \
+ --paging=never \
+ --color=always \
+ -- "$FILE"
+ ;;
+ application/x-tar|\
+ application/x-bzip|\
+ application/x-bzip2|\
+ application/zip|\
+ application/x-7z-compressed|\
+ application/vnd.rar)
+ bsdtar -tf "$FILE"
+ ;;
+ *)
+ echo "$MIMETYPE"
+ file -b "$FILE" | fold --width="$WIDTH" --spaces
+ ;;
+esac
+
diff --git a/.profile b/.profile
index f193fa5..9b8dc1e 100644
--- a/.profile
+++ b/.profile
@@ -8,19 +8,15 @@
export LANG='ja_JP.UTF-8'
# aliases
-alias cls='clear'
alias vim='nvim'
-alias copy='xclip -selection c'
-alias dnd='dragon-drag-and-drop -a -x'
+alias copy='xclip -selection clipboard'
+alias dnd='dragon-drop --all --and-exit'
alias sl='sl -w'
-alias vv='neovide'
-alias today='khal list today today'
alias bctl='bluetoothctl'
alias sctl='systemctl --user'
-alias fv='nvim "$(fzf)"'
# one letters
-alias r='ranger'
+alias r='cd "$(lf -print-last-dir | head -n1)"'
alias v='nvim'
alias m='neomutt'
alias y='yay'
@@ -30,6 +26,7 @@ alias f='fork'
alias p='pass'
alias b='bluetoothctl'
alias s='systemctl --user'
+alias g='git'
# force colorterm
export COLORTERM="truecolor"
@@ -57,15 +54,19 @@ if [ -z "$PATH_EXTENDED" ] ; then
fi
# other stuff
-export EDITOR="nvim"
+export EDITOR="nvim -p"
export PAGER="less"
export FZF_DEFAULT_COMMAND="find . -name '.?*' -prune -o -print"
-export FZF_DEFAULT_OPTS="--color=16"
+export FZF_DEFAULT_OPTS="--color=bw,fg:7,scrollbar:8,info:8 --layout=reverse --info=inline-right --no-separator --marker='*' --pointer=''"
export GOPATH="$HOME/.local/go"
[ -e "$XDG_CONFIG_HOME/gtk-4.0/env" ] && . "$XDG_CONFIG_HOME/gtk-4.0/env"
export PASSWORD_STORE_ENABLE_EXTENSIONS=true
export PASSWORD_STORE_EXTENSIONS_DIR="$XDG_DATA_HOME/pass-extensions"
+# LS_COLORS
+[ ! -e "$XDG_CACHE_HOME/dircolors" ] || [ "$XDG_CONFIG_HOME/dircolors" -nt "$XDG_CACHE_HOME/dircolors" ] && dircolors "$XDG_CONFIG_HOME/dircolors" > "$XDG_CACHE_HOME/dircolors"
+. "$XDG_CACHE_HOME/dircolors"
+
# use .config/ instead of home directory
export ANDROID_SDK_HOME="$XDG_CONFIG_HOME/android"
export ADB_VENDOR_KEY="$XDG_CONFIG_HOME/android"
diff --git a/.zshrc b/.zshrc
index 4a30d2c..4d2d0b1 100644
--- a/.zshrc
+++ b/.zshrc
@@ -1,28 +1,35 @@
-ZSH_THEME="loek"
+#!/bin/zsh
-# no
-zstyle ':omz:update' mode disabled
-DISABLE_AUTO_UPDATE=true
-DISABLE_UPDATE_PROMPT=true
+# # oh-my-zsh
+# zstyle ':omz:update' mode disabled
+# DISABLE_AUTO_UPDATE=true
+# DISABLE_UPDATE_PROMPT=true
+# plugins=(zsh-syntax-highlighting)
+# export ZSH="$XDG_DATA_HOME/oh-my-zsh"
+# export ZSH_COMPDUMP="$XDG_CACHE_HOME/zcompdump"
+# source "$ZSH/oh-my-zsh.sh"
-plugins=(
- git
- zsh-syntax-highlighting
-)
+# prompt
+source "$XDG_CONFIG_HOME/zsh/prompt"
-# oh-my-zsh
-export ZSH="$HOME/.local/share/oh-my-zsh"
-export ZSH_COMPDUMP="$XDG_CACHE_HOME/zcompdump-$HOST"
-source "$ZSH/oh-my-zsh.sh"
+# do not glob for calculator command
+aliases[=]="noglob ="
+
+autoload -U compinit
+
+# completion
+zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
+zstyle ':completion:*:*:*:*:*' menu select
+zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|=*' 'l:|=* r:|=*'
+zstyle ':completion:*' special-dirs true
+setopt auto_menu
+setopt complete_in_word
+setopt always_to_end
-# shift-tab fix
+# keybinds
+bindkey -e # emacs bindings
bindkey '^[[Z' reverse-menu-complete
-# <esc> e to open vim
-bindkey '^[e' edit-command-line
# zsh autocompletion
-compinit -D
-
-# do not glob for calculator command
-aliases[=]="noglob ="
+compinit -d "$ZSH_COMPDUMP"