diff options
| author | Arpit Chakladar <arpitchakladar@proton.me> | 2026-04-24 01:48:30 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar@proton.me> | 2026-04-24 01:48:30 +0530 |
| commit | 3e232a2bc7f5c8ea33804be1ea071a91c5f98055 (patch) | |
| tree | f772b5d7d393cacf708d845acb75b55c12d3e625 /modules/tools/lf | |
| parent | 606716e0a4b8cbeb9076fb88b6b92664a5a24081 (diff) | |
| download | home-manager-config-3e232a2bc7f5c8ea33804be1ea071a91c5f98055.tar.gz home-manager-config-3e232a2bc7f5c8ea33804be1ea071a91c5f98055.zip | |
replacing tools with programs to be more consistent with config options
Diffstat (limited to 'modules/tools/lf')
| -rw-r--r-- | modules/tools/lf/default.nix | 53 | ||||
| -rw-r--r-- | modules/tools/lf/icons | 342 | ||||
| -rw-r--r-- | modules/tools/lf/lfrc | 279 |
3 files changed, 0 insertions, 674 deletions
diff --git a/modules/tools/lf/default.nix b/modules/tools/lf/default.nix deleted file mode 100644 index 9ce31d4..0000000 --- a/modules/tools/lf/default.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ - pkgs, - lib, - config, - ... -}: - -# lf - terminal file manager -{ - options.tools.lf = { - enable = lib.mkEnableOption "Enables lf."; - }; - - config = lib.mkIf config.tools.lf.enable { - home.packages = with pkgs; [ - ctpv - ]; - - programs.lf = { - enable = true; - settings = { - number = true; - icons = true; - drawbox = true; - hidden = true; - preview = true; - - shell = if config.tools.zsh.enable then lib.getExe pkgs.zsh else "bash"; - shellopts = "'-eu'"; - ifs = "\n"; - scrolloff = "4"; - period = "1"; - incsearch = true; - smartcase = true; - info = "size"; - sortby = "natural"; - dirfirst = true; - - cleaner = lib.getExe config.scripts.file-preview-clean.package; - }; - - previewer = { - source = lib.getExe config.scripts.file-preview.package; - }; - - extraConfig = '' - ${builtins.readFile ./lfrc} - ''; - }; - - home.file.".config/lf/icons".source = ./icons; - }; -} diff --git a/modules/tools/lf/icons b/modules/tools/lf/icons deleted file mode 100644 index 8697cf2..0000000 --- a/modules/tools/lf/icons +++ /dev/null @@ -1,342 +0,0 @@ -# vim:ft=conf - -# 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 -*docker-compose.yaml -*compose.yml -*compose.yaml -*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 -*Docker-compose.yaml -*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 diff --git a/modules/tools/lf/lfrc b/modules/tools/lf/lfrc deleted file mode 100644 index 11a9959..0000000 --- a/modules/tools/lf/lfrc +++ /dev/null @@ -1,279 +0,0 @@ -# ─── lf config — nvim-tree style keybindings ─────────────────────────────── - -# ─── Colors (optional — remove if you use a color scheme plugin) ────────────── -# set color256 true - -# ─── Custom commands ────────────────────────────────────────────────────────── - -# Create a new file (like nvim-tree 'a' with no trailing /) -cmd touch %{{ - printf "New file name: " - read -r name - touch "$name" - lf -remote "send $id select '$name'" -}} - -# Create a new directory (like nvim-tree 'a' with trailing /) -cmd mkdir %{{ - printf "New directory name: " - read -r name - mkdir -p "$name" - lf -remote "send $id select '$name'" -}} - -# Rename — full name (like nvim-tree 'r') -cmd rename ${{ - printf "Rename '%s' to: " "$f" - read -r newname - mv -- "$f" "$(dirname "$f")/$newname" - lf -remote "send $id select '$newname'" -}} - -# Rename — only basename without extension (like nvim-tree 'e' in some configs) -cmd rename_stem ${{ - stem="${f##*/}" - stem="${stem%.*}" - printf "Rename stem to: " - read -r newname - ext="${f##*.}" - if [ "${f##*/}" = "$stem" ]; then - mv -- "$f" "$(dirname "$f")/$newname" - else - mv -- "$f" "$(dirname "$f")/$newname.$ext" - fi -}} - -# Delete — trash (safe) using trash-cli if available, else rm -cmd trash %{{ - set -f - files=$(printf '%s\n' $fx | wc -l) - printf "Trash $files item(s)? [y/N] " - read -r ans - [ "$ans" = "y" ] || [ "$ans" = "Y" ] || exit 0 - if command -v trash-put >/dev/null 2>&1; then - printf '%s\n' $fx | xargs trash-put -- - else - printf '%s\n' $fx | xargs rm -rf -- - fi -}} - -# Delete — permanent, no confirmation prompt (use carefully) -cmd delete ${{ - set -f - printf "Permanently delete? [y/N] " - read -r ans - [ "$ans" = "y" ] || [ "$ans" = "Y" ] || exit 0 - rm -rf -- $fx -}} - -# Paste (move or copy depending on operation) -cmd paste &{{ - set -f - load=$(lf -remote 'load') - mode=$(echo "$load" | sed -n '1p') - list=$(echo "$load" | sed -n '2,$p') - if [ "$mode" = "copy" ]; then - cp -rn -- $list . - elif [ "$mode" = "move" ]; then - mv -n -- $list . - lf -remote 'send clear' - fi - lf -remote 'send reload' - lf -remote 'send clear' -}} - -# Paste with overwrite -cmd paste_overwrite &{{ - set -f - load=$(lf -remote 'load') - mode=$(echo "$load" | sed -n '1p') - list=$(echo "$load" | sed -n '2,$p') - if [ "$mode" = "copy" ]; then - cp -r -- $list . - elif [ "$mode" = "move" ]; then - mv -- $list . - lf -remote 'send clear' - fi - lf -remote 'send reload' - lf -remote 'send clear' -}} - -# Open in nvim -cmd edit $nvim "$f" - -# Open with xdg-open (GUI apps) -cmd open_gui &xdg-open "$f" - -# Toggle hidden files (like nvim-tree 'H') -cmd toggle_hidden :{{ - set hidden! - set info -}} - -# Bulk rename with $EDITOR (like vimv / nvim-tree mass rename) -cmd bulk_rename ${{ - index=$(mktemp /tmp/lf-bulk-index.XXXXXX) - names=$(mktemp /tmp/lf-bulk-names.XXXXXX) - printf '%s\n' $fx > "$index" - sed 's|.*/||' "$index" > "$names" - $EDITOR "$names" - paste "$index" "$names" | while IFS=$'\t' read -r old new; do - if [ "$old" != "$(dirname "$old")/$new" ]; then - mv -- "$old" "$(dirname "$old")/$new" - fi - done - rm -- "$index" "$names" - lf -remote 'send reload' -}} - -# Create symlink (relative) -cmd symlink %{{ - printf "Symlink target name: " - read -r name - ln -s "$f" "$name" -}} - -# Copy path to clipboard (needs xclip / xsel / wl-copy) -cmd copy_path &{{ - printf '%s' "$f" | xclip -selection clipboard 2>/dev/null \ - || printf '%s' "$f" | xsel --clipboard --input 2>/dev/null \ - || printf '%s' "$f" | wl-copy 2>/dev/null -}} - -# Show file info (like nvim-tree 'i') -cmd info %{{ - stat -- "$f" - printf '\nPress ENTER...' - read -r _ -}} - -# Jump to bookmarks (requires fzf) -cmd bookmark_jump ${{ - bm="$HOME/.config/lf/bookmarks" - [ -f "$bm" ] || touch "$bm" - dest=$(cat "$bm" | fzf --prompt "Jump to: ") - [ -n "$dest" ] && lf -remote "send $id cd '$dest'" -}} - -# Add bookmark -cmd bookmark_add %{{ - bm="$HOME/.config/lf/bookmarks" - printf '%s\n' "$PWD" >> "$bm" - sort -u "$bm" -o "$bm" - echo "Bookmarked: $PWD" -}} - -# fzf-based fuzzy find & cd/select -cmd fzf_cd ${{ - dest=$(find . -type d 2>/dev/null | fzf --prompt "cd: ") - [ -n "$dest" ] && lf -remote "send $id cd '$dest'" -}} - -cmd fzf_file ${{ - file=$(find . -type f 2>/dev/null | fzf --prompt "open: ") - [ -n "$dest" ] && lf -remote "send $id select '$file'" -}} - -# ─── Keybindings — clear defaults and remap ─────────────────────────────────── - -# Unmap keys we'll remap -map d -map y -map p -map c -map r -map a -map e -map f -map g -map G -map i -map o -map H -map m - -# ── Navigation ──────────────────────────────────────────────────────────────── -map h updir # go up one dir -map l open # open file/dir (maps to $EDITOR for files) -map j down -map k up -map J half-down -map K half-up -map gg top -map G bottom -map gd cd ~/Downloads -map gh cd ~ -map gc cd ~/.config -map gp cd ~/projects - -# Page navigation (nvim-style) -map <c-d> half-down -map <c-u> half-up -map <c-f> page-down -map <c-b> page-up - -# ── Opening / editing ───────────────────────────────────────────────────────── -map <enter> open # open with default -map o open_gui # open with GUI app -map e edit # open in nvim explicitly - -# ── File / dir creation ─────────────────────────────────────────────────────── -map af touch # a → file (like nvim-tree 'a' without /) -map ad mkdir # a → dir (like nvim-tree 'a' with /) - -# ── Rename ──────────────────────────────────────────────────────────────────── -map r rename # full rename (like nvim-tree 'r') -map R bulk_rename # bulk rename in $EDITOR -map cw rename # alias: cw like vim's 'change word' -map I rename # alias: go to start (lf positions cursor) -map A rename # alias: go to end - -# ── Delete ──────────────────────────────────────────────────────────────────── -map dd trash # move to trash (safe delete — like nvim-tree 'd') -map dD delete # permanent delete (no trash) - -# ── Yank / Copy / Cut / Paste ───────────────────────────────────────────────── -map yy copy # yank/copy selection (like nvim-tree 'c') -map yn copy_path # yank path to clipboard -map dd cut # cut selection (like nvim-tree 'x') — overrides trash above; - # uncomment the trash line below if you prefer separate keys -# map dt trash # use 'dt' for trash if 'dd' is used for cut -map pp paste # paste (like nvim-tree 'p') -map po paste_overwrite # paste with overwrite -map P paste # alias - -# ── Marking / selection ─────────────────────────────────────────────────────── -map <space> toggle # toggle mark on current item (like nvim-tree space) -map v invert # invert selection -map V invert # alias -map u unselect # clear all marks -map * glob-select '*' # select all via glob - -# ── Search ──────────────────────────────────────────────────────────────────── -map / search # incremental search forward -map n search-next -map N search-prev -map f fzf_file # fuzzy find file (requires fzf) -map F fzf_cd # fuzzy cd into dir (requires fzf) - -# ── View toggles ────────────────────────────────────────────────────────────── -map H toggle_hidden # toggle hidden files (like nvim-tree 'H') -map zi set icons! -map zr set reverse! -map zh set hidden! -map zn set sortby natural -map zs set sortby size -map zm set sortby modified -map ze set sortby ext - -# ── Info / misc ─────────────────────────────────────────────────────────────── -map i info # show stat info (like nvim-tree 'i') -map <c-r> reload # reload directory -map <esc> clear # clear selection -map q quit -map Q quit -map m bookmark_add # add bookmark -map ' bookmark_jump # jump to bookmark (requires fzf) - -# Symlink -map S symlink |
