Testing Vimjoyer's lf configuration

This commit is contained in:
Thai Noodles 2024-01-10 20:47:29 -08:00
parent 2817659814
commit 48f6cf3aed
3 changed files with 420 additions and 4 deletions

View File

@ -66,8 +66,67 @@
endif endif
''; '';
}; };
xdg.configFile."lf/icons".source = ./dots/icons;
programs.lf = { programs.lf = {
enable = true; enable = true;
commands = {
dragon-out = ''%${pkgs.xdragon}/bin/xdragon -a -x "$fx"'';
editor-open = ''$$EDITOR $f'';
mkdir = ''
''${{
printf "Directory Name: "
read DIR
mkdir $DIR
}}
'';
};
keybindings = {
"\\\"" = "";
o = "";
c = "mkdir";
"." = "set hidden!";
"`" = "mark-load";
"\\'" = "mark-load";
"<enter>" = "open";
do = "dragon-out";
"g~" = "cd";
gh = "cd";
"g/" = "/";
ee = "editor-open";
V = ''''$${pkgs.bat}/bin/bat --paging=always "$f"'';
};
settings = {
preview = true;
hidden = true;
drawbox = true;
icons = true;
ignorecase = true;
};
extraConfig =
let
previewer =
pkgs.writeShellScriptBin "pv.sh" ''
file=$1
w=$2
h=$3
x=$4
y=$5
if [[ "$( ${pkgs.file}/bin/file -Lb --mime-type "$file")" =~ ^image ]]; then
${pkgs.kitty}/bin/kitty +kitten icat --silent --stdin no --transfer-mode file --place "''${w}x''${h}@''${x}x''${y}" "$file" < /dev/null > /dev/tty
exit 1
fi
${pkgs.pistol}/bin/pistol "$file"
'';
cleaner = pkgs.writeShellScriptBin "clean.sh" ''
${pkgs.kitty}/bin/kitty +kitten icat --clear --stdin no --silent --transfer-mode file </dev/null > /dev/tty
'';
in
''
set cleaner ${cleaner}/bin/clean.sh
set previewer ${previewer}/bin/pv.sh
'';
}; };
programs.password-store = { programs.password-store = {
enable = true; enable = true;

357
home-manager/dots/icons Normal file
View File

@ -0,0 +1,357 @@
# vim:ft=conf
# These examples require Nerd Fonts or a compatible font to be used.
# See https://www.nerdfonts.com for more information.
# default values from lf (with matching order)
# ln l # LINK
# or l # ORPHAN
# tw t # STICKY_OTHER_WRITABLE
# ow d # OTHER_WRITABLE
# st t # STICKY
# di d # DIR
# pi p # FIFO
# so s # SOCK
# bd b # BLK
# cd c # CHR
# su u # SETUID
# sg g # SETGID
# ex x # EXEC
# fi - # FILE
# file types (with matching order)
ln  # LINK
or  # ORPHAN
tw t # STICKY_OTHER_WRITABLE
ow  # OTHER_WRITABLE
st t # STICKY
di  # DIR
pi p # FIFO
so s # SOCK
bd b # BLK
cd c # CHR
su u # SETUID
sg g # SETGID
ex  # EXEC
fi  # FILE
# file extensions (vim-devicons)
*.styl 
*.sass 
*.scss 
*.htm 
*.html 
*.slim 
*.haml 
*.ejs 
*.css 
*.less 
*.md 
*.mdx 
*.markdown 
*.rmd 
*.json 
*.webmanifest 
*.js 
*.mjs 
*.jsx 
*.rb 
*.gemspec 
*.rake 
*.php 
*.py 
*.pyc 
*.pyo 
*.pyd 
*.coffee 
*.mustache 
*.hbs 
*.conf 
*.ini 
*.yml 
*.yaml 
*.toml 
*.bat 
*.mk 
*.jpg 
*.jpeg 
*.bmp 
*.png 
*.webp 
*.gif 
*.ico 
*.twig 
*.cpp 
*.c++ 
*.cxx 
*.cc 
*.cp 
*.c 
*.cs 󰌛
*.h 
*.hh 
*.hpp 
*.hxx 
*.hs 
*.lhs 
*.nix 
*.lua 
*.java 
*.sh 
*.fish 
*.bash 
*.zsh 
*.ksh 
*.csh 
*.awk 
*.ps1 
*.ml λ
*.mli λ
*.diff 
*.db 
*.sql 
*.dump 
*.clj 
*.cljc 
*.cljs 
*.edn 
*.scala 
*.go 
*.dart 
*.xul 
*.sln 
*.suo 
*.pl 
*.pm 
*.t 
*.rss 
'*.f#' 
*.fsscript 
*.fsx 
*.fs 
*.fsi 
*.rs 
*.rlib 
*.d 
*.erl 
*.hrl 
*.ex 
*.exs 
*.eex 
*.leex 
*.heex 
*.vim 
*.ai 
*.psd 
*.psb 
*.ts 
*.tsx 
*.jl 
*.pp 
*.vue 
*.elm 
*.swift 
*.xcplayground 
*.tex 󰙩
*.r 󰟔
*.rproj 󰗆
*.sol 󰡪
*.pem 
# file names (vim-devicons) (case-insensitive not supported in lf)
*gruntfile.coffee 
*gruntfile.js 
*gruntfile.ls 
*gulpfile.coffee 
*gulpfile.js 
*gulpfile.ls 
*mix.lock 
*dropbox 
*.ds_store 
*.gitconfig 
*.gitignore 
*.gitattributes 
*.gitlab-ci.yml 
*.bashrc 
*.zshrc 
*.zshenv 
*.zprofile 
*.vimrc 
*.gvimrc 
*_vimrc 
*_gvimrc 
*.bashprofile 
*favicon.ico 
*license 
*node_modules 
*react.jsx 
*procfile 
*dockerfile 
*docker-compose.yml 
*rakefile 
*config.ru 
*gemfile 
*makefile 
*cmakelists.txt 
*robots.txt 󰚩
# file names (case-sensitive adaptations)
*Gruntfile.coffee 
*Gruntfile.js 
*Gruntfile.ls 
*Gulpfile.coffee 
*Gulpfile.js 
*Gulpfile.ls 
*Dropbox 
*.DS_Store 
*LICENSE 
*React.jsx 
*Procfile 
*Dockerfile 
*Docker-compose.yml 
*Rakefile 
*Gemfile 
*Makefile 
*CMakeLists.txt 
# file patterns (vim-devicons) (patterns not supported in lf)
# .*jquery.*\.js$ 
# .*angular.*\.js$ 
# .*backbone.*\.js$ 
# .*require.*\.js$ 
# .*materialize.*\.js$ 
# .*materialize.*\.css$ 
# .*mootools.*\.js$ 
# .*vimrc.* 
# Vagrantfile$ 
# file patterns (file name adaptations)
*jquery.min.js 
*angular.min.js 
*backbone.min.js 
*require.min.js 
*materialize.min.js 
*materialize.min.css 
*mootools.min.js 
*vimrc 
Vagrantfile 
# archives or compressed (extensions from dircolors defaults)
*.tar 
*.tgz 
*.arc 
*.arj 
*.taz 
*.lha 
*.lz4 
*.lzh 
*.lzma 
*.tlz 
*.txz 
*.tzo 
*.t7z 
*.zip 
*.z 
*.dz 
*.gz 
*.lrz 
*.lz 
*.lzo 
*.xz 
*.zst 
*.tzst 
*.bz2 
*.bz 
*.tbz 
*.tbz2 
*.tz 
*.deb 
*.rpm 
*.jar 
*.war 
*.ear 
*.sar 
*.rar 
*.alz 
*.ace 
*.zoo 
*.cpio 
*.7z 
*.rz 
*.cab 
*.wim 
*.swm 
*.dwm 
*.esd 
# image formats (extensions from dircolors defaults)
*.jpg 
*.jpeg 
*.mjpg 
*.mjpeg 
*.gif 
*.bmp 
*.pbm 
*.pgm 
*.ppm 
*.tga 
*.xbm 
*.xpm 
*.tif 
*.tiff 
*.png 
*.svg 
*.svgz 
*.mng 
*.pcx 
*.mov 
*.mpg 
*.mpeg 
*.m2v 
*.mkv 
*.webm 
*.ogm 
*.mp4 
*.m4v 
*.mp4v 
*.vob 
*.qt 
*.nuv 
*.wmv 
*.asf 
*.rm 
*.rmvb 
*.flc 
*.avi 
*.fli 
*.flv 
*.gl 
*.dl 
*.xcf 
*.xwd 
*.yuv 
*.cgm 
*.emf 
*.ogv 
*.ogx 
# audio formats (extensions from dircolors defaults)
*.aac 
*.au 
*.flac 
*.m4a 
*.mid 
*.midi 
*.mka 
*.mp3 
*.mpc 
*.ogg 
*.ra 
*.wav 
*.oga 
*.opus 
*.spx 
*.xspf 
# other formats
*.pdf 

View File

@ -28,6 +28,7 @@ riverctl map normal Super H focus-view previous
riverctl map normal Super J focus-view next riverctl map normal Super J focus-view next
riverctl map normal Super K focus-view previous riverctl map normal Super K focus-view previous
riverctl map normal Super L focus-view next riverctl map normal Super L focus-view next
riverctl map normal Super Tab focus-output next
riverctl map normal Super Bracketright focus-output next riverctl map normal Super Bracketright focus-output next
riverctl map normal Super Bracketleft focus-output previous riverctl map normal Super Bracketleft focus-output previous
@ -36,8 +37,9 @@ riverctl map normal Super+Shift H zoom
riverctl map normal Super+Shift J swap next riverctl map normal Super+Shift J swap next
riverctl map normal Super+Shift K swap previous riverctl map normal Super+Shift K swap previous
riverctl map normal Super+Shift L swap next riverctl map normal Super+Shift L swap next
riverctl map normal Super+Shift Bracketleft send-to-output previous riverctl map normal Super+Shift Tab send-to-output next
riverctl map normal Super+Shift Bracketright send-to-output next riverctl map normal Super+Shift Bracketright send-to-output next
riverctl map normal Super+Shift Bracketleft send-to-output previous
# Layout Controls # Layout Controls
riverctl map normal Super+Alt H send-layout-cmd rivertile "main-ratio -0.05" riverctl map normal Super+Alt H send-layout-cmd rivertile "main-ratio -0.05"
@ -67,6 +69,7 @@ riverctl map-pointer normal Super BTN_LEFT move-view
riverctl map-pointer normal Super BTN_RIGHT resize-view riverctl map-pointer normal Super BTN_RIGHT resize-view
# Close focused view # Close focused view
riverctl map normal Super W close
riverctl map normal Super Q close riverctl map normal Super Q close
# Exit River # Exit River
riverctl map normal Super+Shift Q exit riverctl map normal Super+Shift Q exit
@ -88,9 +91,6 @@ do
riverctl map normal Super+Shift+Control $i toggle-view-tags $tags riverctl map normal Super+Shift+Control $i toggle-view-tags $tags
done done
riverctl map normal Super Tab focus-previous-tags
riverctl map normal Super+Shift Tab send-to-previous-tags
# Super+0 to focus all tags # Super+0 to focus all tags
# Super+Shift+0 to tag focused view with all tags # Super+Shift+0 to tag focused view with all tags
all_tags=$(((1 << 32) - 1)) all_tags=$(((1 << 32) - 1))