diff options
| author | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-07-15 20:02:29 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-07-15 20:03:04 +0530 |
| commit | 01aaa7ad39c1fe8af6ffbca31abbab27dbfefc95 (patch) | |
| tree | 88560b79fa71e3b83d9d9aca6d1bb40673a1a170 /modules/file-management/lf | |
| parent | 2c573bb0c437b83fe629a9a5b818c976d2dfd796 (diff) | |
| download | home-manager-config-01aaa7ad39c1fe8af6ffbca31abbab27dbfefc95.tar.gz home-manager-config-01aaa7ad39c1fe8af6ffbca31abbab27dbfefc95.zip | |
refactor: organized the modules into better categories
Instead of lumping everything in modules/programs we are separating them
into separate directories in modules/
Diffstat (limited to 'modules/file-management/lf')
| -rw-r--r-- | modules/file-management/lf/default.nix | 56 | ||||
| -rw-r--r-- | modules/file-management/lf/icons | 342 | ||||
| -rw-r--r-- | modules/file-management/lf/lfrc | 168 |
3 files changed, 566 insertions, 0 deletions
diff --git a/modules/file-management/lf/default.nix b/modules/file-management/lf/default.nix new file mode 100644 index 0000000..47a950f --- /dev/null +++ b/modules/file-management/lf/default.nix @@ -0,0 +1,56 @@ +{ + pkgs, + lib, + config, + ... +}: + +# lf - terminal file manager +{ + config = lib.mkIf config.programs.lf.enable { + xdg.mimeApps.defaultApplications = { + "inode/directory" = "lf.desktop"; + }; + + home.packages = with pkgs; [ + busybox + ]; + + programs.lf = { + package = pkgs.lf.overrideAttrs (old: { + dontWrapQtApps = true; + dontPatchShebangs = true; + }); + + settings = { + number = true; + icons = true; + drawbox = true; + hidden = true; + preview = true; + + shell = "sh"; + 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/file-management/lf/icons b/modules/file-management/lf/icons new file mode 100644 index 0000000..8697cf2 --- /dev/null +++ b/modules/file-management/lf/icons @@ -0,0 +1,342 @@ +# 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/file-management/lf/lfrc b/modules/file-management/lf/lfrc new file mode 100644 index 0000000..7ae847c --- /dev/null +++ b/modules/file-management/lf/lfrc @@ -0,0 +1,168 @@ +# ========================= +# BASIC MOVEMENT (nvim-like) +# ========================= + +map j down +map k up +map h updir +map l open + +map gg top +map G bottom + +map <c-u> half-up +map <c-d> half-down + +map <c-b> page-up +map <c-f> page-down + +# ========================= +# SELECTION +# ========================= + +map <space> toggle +map v invert +map V select + +# ========================= +# OPENING +# ========================= + +map o open +map <enter> open +map L open + +# ========================= +# DIRECTORY NAVIGATION +# ========================= + +map H cd .. +map gh cd ~ +map ge cd / + +# ========================= +# FILE OPERATIONS +# ========================= + +map y copy +map x cut +map p paste + +map d delete + +map a :push %mkdir<space> +map A :push %touch<space> + +map r rename + +# ========================= +# SEARCH +# ========================= + +map / search +map n search-next +map N search-prev + +map f find +map F find-back + +# ========================= +# FILTER +# ========================= + +map zf filter +map zc clear + +# ========================= +# MARKS (vim-style) +# ========================= + +map m mark-save +map ' mark-load + +# ========================= +# HISTORY +# ========================= + +map <c-o> history-prev +map <c-i> history-next + +# ========================= +# RELOAD +# ========================= + +map R reload + +# ========================= +# SHELL / COMMANDS +# ========================= + +map ! shell +map : read + +map & shell-async + +# ========================= +# VISUAL MODES / TAGGING +# ========================= + +map t tag +map T tag-toggle + +# ========================= +# SORTING +# ========================= + +map sn set sortby name +map ss set sortby size +map st set sortby time +map se set sortby ext + +# ========================= +# TOGGLES +# ========================= + +map zh set hidden! +map zr set reverse! + +# ========================= +# VIEW +# ========================= + +map zi set info +map zs set preview + +# ========================= +# JUMPS +# ========================= + +map [ jump-prev +map ] jump-next + +# ========================= +# CLIPBOARD-LIKE +# ========================= + +map c clear +map u unselect + +# ========================= +# MULTI-SELECTION NAV +# ========================= + +map J down-select +map K up-select + +# ========================= +# COMMAND MODE SHORTCUTS +# ========================= + +map w :write +map q quit +map Q quit! + +# ========================= +# FILE INFO +# ========================= + +map i info |
