Giter Club home page Giter Club logo

fm.awk's Introduction

fm.awk

File manager written in awk

Preview

asciicast

Browsing

  • cd on exit: cd $(command fm.awk)
  • last path: export LASTPATH="$HOME/.cache/lastpath"; cd $(cat -u $LASTPATH) && $TERMINAL -e fm.awk

Key bindings

NUMBERS:
	[num] - move cursor to entry [num]
	[num]+G - Go to page [num]

NAVIGATION:
	k/↑ - up                      j/↓ - down
	l/→ - right                   h/← - left
	n/PageDown - PageDown         p/PageUp - PageUp
	g/Home - first page           G/End - last page
	H - first entry               L - last entry
	M - middle entry

MODES:
	/ - search
	: - commandline mode

SELECTION:
	␣ - bulk (de-)selection       V - bulk (de-)selection all

PREVIEW:
	v - toggle preview
	> - more directory ratio      < - less directory ratio

MISC:
	r - refresh                   a - actions
	- - previous directory        ! - spawn shell
	? - show keybinds             q - quit

Actions

  • Bulk selection
  • Bulk selection all
  • Directory / File preview
  • Actions:
    • History
    • mv
    • cp -R
    • ln -sf
    • rm -rf && yes-no prompt

Configuration

edit fm.awk, modify the first configuration section:

    ###################
    #  Configuration  #
    ###################

    OPENER = ( ENVIRON["OSTYPE"] ~ /darwin.*/ ? "open" : "xdg-open" )
    LASTPATH = ( ENVIRON["LASTPATH"] == "" ? ( ENVIRON["HOME"] "/.cache/lastpath" ) : ENVIRON["LASTPATH"] )
    HISTORY = ( ENVIRON["HISTORY"] == "" ? ( ENVIRON["HOME"] "/.cache/history" ) : ENVIRON["HISTORY"] )
    CMDHIST = ( ENVIRON["CMDHIST"] == "" ? ( ENVIRON["HOME"] "/.cache/cmdhist" ) : ENVIRON["CMDHIST"] )
    PREVIEW = 0
    RATIO = 0.35
    HIST_MAX = 5000
  • OPENER is the default file opener.
  • LASTPATH is path which fm.awk were last time.
  • HISTORY is the history for directory visited.
  • CMDHIST is the command line history, which only the unique command will be left.
  • PREVIEW is a boolean value which toggles preview or not.
  • RATIO is the ratio for directory / preview.
  • HIST_MAX is the maximum number of HISTORY.

cmd mode

  • :cd /path/to/destination
    • can be relative: :cd ../../ goes to parents two tiers
  • :cmd on each selected item.
    • e.g., After selection, :chmod +x to give execution permission on selected entries.
  • :cmd {} destination to replace {} with each selected item and execute the whole command.
    • e.g., After selection, :mv {} ~ will move selected item to $HOME directory.
  • cmd can be shell alias (bash and zsh confirmed. fish not sure).
  • tab completion on :cd and search (/)
  • tab completion on command line mode based on command line history.
  • left / right arrow to move cursor; up / down arrow to access command line history.

TODO

  • Image preview (start using ueberzug)
  • Make preview script be independent
  • Make cmd bottom line can be scrollable horizontally even when the string is over the dimension
  • Eliminate action menu by implementing all of those in cmd mode
  • Fix some bugs

fm.awk's People

Contributors

huijunchen9260 avatar magpie514 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.