diff --git a/misc/.config/yazi/keymap.toml b/misc/.config/yazi/keymap.toml index 753e62e..b7acf7b 100644 --- a/misc/.config/yazi/keymap.toml +++ b/misc/.config/yazi/keymap.toml @@ -9,17 +9,23 @@ prepend_keymap = [ { on = [ "o" ], run = [ "plugin smart-enter --sync --args='list'", "escape --visual --select" ], desc = "List openers for file." }, { on = [ "l" ], run = [ "plugin smart-enter --sync", "escape --visual --select" ], desc = "Enter the child directory, or open file." }, { on = [ "L" ], run = [ "plugin smart-enter --sync --args='detatch'", "escape --visual --select" ], desc = "Open in new window." }, - { on = [ "1" ], run = [ "shell 'opener -n 1 $0' --block --confirm"], desc = "Open with program 1." }, - { on = [ "2" ], run = [ "shell 'opener -n 2 $0' --block --confirm"], desc = "Open with program 2." }, - { on = [ "3" ], run = [ "shell 'opener -n 3 $0' --block --confirm"], desc = "Open with program 3." }, - { on = [ "!" ], run = [ "shell 'opener -n 1 detatch $0' --block --confirm"], desc = "Open in new window with program 1." }, - { on = [ "@" ], run = [ "shell 'opener -n 2 detatch $0' --block --confirm"], desc = "Open in new window with program 2." }, - { on = [ "#" ], run = [ "shell 'opener -n 3 detatch $0' --block --confirm"], desc = "Open in new window with program 3." }, + # Openers + { on = [ "1" ], run = [ "shell 'opener -n 1 \"$0\"' --block --confirm"], desc = "Open with program 1." }, + { on = [ "2" ], run = [ "shell 'opener -n 2 \"$0\"' --block --confirm"], desc = "Open with program 2." }, + { on = [ "3" ], run = [ "shell 'opener -n 3 \"$0\"' --block --confirm"], desc = "Open with program 3." }, + { on = [ "!" ], run = [ "shell 'opener -n 1 detatch \"$0\"' --block --confirm"], desc = "Open in new window with program 1." }, + { on = [ "@" ], run = [ "shell 'opener -n 2 detatch \"$0\"' --block --confirm"], desc = "Open in new window with program 2." }, + { on = [ "#" ], run = [ "shell 'opener -n 3 detatch \"$0\"' --block --confirm"], desc = "Open in new window with program 3." }, + + # Better movement { on = [ "j" ], run = [ "plugin --sync arrow --args=1"], desc = "Move selection downwards, or wrap." }, { on = [ "k" ], run = [ "plugin --sync arrow --args=-1"], desc = "Move selection upwards, or wrap." }, + + { on = [ "f" ], run = [ "plugin jump-to-char" ], desc = "Jump to first occurrence of character" }, + { on = [ "F" ], run = [ "plugin jump-to-char --args='previous'" ], desc = "Jump to first occurrence of character" }, + { on = [ "T" ], run = "plugin --sync max-preview", desc = "Maximize preview pane"}, - { on = [ "n" ], run = "create", desc = "Create a file or directory (ends with / for directories)" }, { on = [ ""], run = ''' shell 'dragon -x -i -T "$1"' --confirm ''', desc = "Open file with dragon"}, diff --git a/misc/.config/yazi/yazi.toml b/misc/.config/yazi/yazi.toml index 4b022c3..05d16c9 100644 --- a/misc/.config/yazi/yazi.toml +++ b/misc/.config/yazi/yazi.toml @@ -10,7 +10,7 @@ sort_reverse = false sort_dir_first = true sort_translit = false linemode = "size" -show_hidden = true +show_hidden = false show_symlink = false # scrolloff = 5 mouse_events = [ "click", "scroll" ] diff --git a/misc/.local/bin/opener b/misc/.local/bin/opener index 1421aa5..5906230 100755 --- a/misc/.local/bin/opener +++ b/misc/.local/bin/opener @@ -93,16 +93,27 @@ case $(file --mime-type "$file" -b) in launch_term nvim "$file" fi ;; + image/x-xcf) + list_exit \ + "Gimp" + + launch_gui gimp "$file" + ;; image/*) list_exit \ - "nsxiv" - launch_gui nsxiv "$file" + "nsxiv" \ + "Gimp" + + if [ "$num" -eq 2 ]; then + launch_gui gimp "$file" + else + launch_gui nsxiv "$file" + fi ;; video/*) list_exit \ - "Neovim" \ - "Emacs GUI" \ - "Emacs TUI" + "MPV" + launch_gui mpv -quiet "$file" ;; application/epub*|\ @@ -113,12 +124,14 @@ case $(file --mime-type "$file" -b) in image/vnd.djvu) list_exit \ "Zathura" + launch_gui zathura "$file" ;; audio/*|\ video/x-ms-asf) list_exit \ "MPV" + # If it has an album cover, launch graphical mpv [ -z "$(mediainfo "$1" | grep "Cover\s*: Yes")" ] \ && (launch_term mpv --audio-display=no "$file") \