CLIFM(1)
CLIFM(1) โ the Clifm Manual, bestie edition ๐
okay so you opened the manual for clifm, and honestly? you're about to have a great time. this is the full Clifm Manual, section by section, no skips, no "etc." cop-outs. let's go ๐ฆ
โจ NAME โจ
clifm โ The Command-Line File Manager ๐
๐ธ SYNOPSIS ๐ธ
clifm [OPTION]... [DIR]...
๐ INDEX ๐
like a table of contents but make it cute:
- Getting help
- Description
- Parameters
- Positional parameters
- Options
- Commands
- File Filters (by filename, file type, and MIME type)
- Keyboard shortcuts
- Theming
- Built-in expansions
- Tab completion
- File opener (third-party openers are supported)
- Shotgun, the file previewer
- Auto-suggestions (including a warning prompt for invalid command names)
- Shell functions
- Plugins
- Autocommands
- File tags
- Virtual directories
- Note on speed
- Kangaroo frecency algorithm
- Environment
- Security
- Miscellaneous notes
- Files
- Examples
1. ๐ GETTING HELP ๐
so there are, like, several ways to get help in clifm and we love options. once you're inside the program, type ? or help for some basic usage examples, or hit F1 to open this very manpage, F2 to jump straight to the COMMANDS section of this manpage, or F3 to yeet yourself to the KEYBOARD SHORTCUTS section. shortcuts = iconic behavior fr fr.
want help on one specific thing? type help <TAB> and boom, you get a list of available help topics. pick the one you want and press Enter. that's it. that's the whole vibe.
for a list of available commands with brief descriptions, type cmd<TAB>. yes bestie, just type it.
you can also get help for internal commands with the -h/--help flag. for example, to get help about the selection function, enter s -h or s --help. easy.
a super convenient way to get comprehensive info about clifm commands is through the ih action, which is bound by default to the interactive help plugin (ihelp.sh). enter ih to run the plugin (heads up: it requires fzf(1)) and then select the command you wanna learn more about. chef's kiss ๐ซถ
for a quick intro, go look at the EXAMPLES section at the end of this document. we'll get there, don't worry.
2. ๐ DESCRIPTION ๐
Clifm is a Command-Line-Interface File Manager. its whole main feature and strength is that all input and interaction happen through commands typed directly into a prompt. in other words, clifm runs as a Read-Eval-Print Loop (REPL), following this basic structure:
- Read โ user input via the command line
- Evaluate/Execute the command
- Print the results
- Loop โ repeat the process
unlike most terminal file managers out there, clifm literally replaces the traditional Text User Interface (TUI) โ the thing people usually call a curses or text-menu based interface โ with a straightforward command-line interface (REPL). and because of that design, it doesn't just work as a file manager, it also works as a shell extension. so you can search for files, copy them, rename them, remove them, and also do system tasks like updating or upgrading your system, adding cron jobs, stopping services, and launching text editors like nano, vi, or emacs. multitasking queen behavior ๐
in summary: clifm keeps the command line visible and accessible, and then enhances it with functionalities specifically tailored for file management. periodt.
3. ๐ฆ PARAMETERS ๐ฆ
๐ POSITIONAL PARAMETERS ๐
if you specify a directory as the first non-option parameter, clifm will start in that directory. and the subsequent directory names? they're used to initialize subsequent workspaces. for example, the command clifm /etc ~/Downloads tells clifm to start in the /etc directory (in the first workspace) and to set the second workspace to ~/Downloads. up to 8 positional parameters are supported (any further parameters are just ignored, sorry bestie).
if no workspace is specified, clifm will use the first workspace. to start in a specific workspace, use the -w option followed by the workspace number. for instance, clifm -w4 /etc ~/Downloads will start clifm in the /etc directory within workspace 4, setting workspace 5 to ~/Downloads.
if no positional parameter is provided and the -w option is not used, clifm will start in the last visited directory (and in the last active workspace). you can disable this behavior with the --no-restore-last-path command-line switch (or by setting the RestoreLastPath option to false in the configuration file) โ in which case the current directory gets used as the starting path and all workspaces will be unset.
and if you want to always start in one specific directory, disregarding the current directory entirely, use the StartingPath option in the configuration file. set it and forget it ๐
โญ OPTIONS โญ
Note: if compiled in POSIX mode, the following list of options does not apply. in that case, runclifm -hto get the actual list of options. (to make sure, runclifm -v: if compiled in POSIX mode the version number is followed by-POSIX.) so double-check before you come for me ๐ญ
-a,--show-hidden[=VAL]โ show hidden files (filenames starting with.). supported values are:first,last,true, andfalse. if no value is specified, it defaults totrue.-A,--no-hiddenโ do not show hidden files.-b,--bookmarks-file=FILEโ set an alternative bookmarks file.-c,--config-file=FILEโ set an alternative configuration file.-D,--config-dir=DIRโ set an alternative configuration directory (if configuration files do not already exist, they will be created in DIR).-e,--no-elnโ do not display Entry List Numbers (ELNs) to the left of filenames (note that while ELNs are not printed, they remain accessible and can still be used as usual). sneaky but valid.-E,--eln-use-workspace-colorโ color ELNs using the current workspace color. aesthetic โจ-f,--dirs-firstโ list directories first.-F,--no-dirs-firstโ do not list directories first.-g,--pagerโ enable Mas, the built-in pager for file listing.-G,--no-pagerโ disable the file pager.-h,--helpโ print this help and exit.-H,--horizontal-listโ list files horizontally (instead of vertically).-i,--no-case-sensitiveโ ignore case distinctions when listing files.-I,--case-sensitiveโ do not ignore case distinctions when listing files.-k,--keybindings-file=FILEโ set an alternative keybindings file.-l,--long-viewโ print file extended metadata next to filenames (long view). the displayed fields can be customized using--prop-fields(or thePropFieldsoption in the configuration file). set a custom time/date format with--time-style(or theTimeStyleoption in the configuration file).-L,--no-follow-symlinksโ do not follow symbolic links when listing files (overrides--colorize-symlinks-as-target).-m,--dirhist-mapโ enable the directory history map to keep in view previous, current, and next entries in the directory history list.-o,--autolsโ automatically list files when changing the current directory with thecdcommand.-O,--no-autolsโ do not automatically list files when changing the current directory with thecdcommand.-P,--profile=PROFILEโ use PROFILE as profile. if PROFILE does not exist, it will be created. the default profile isdefault.-r,--no-refresh-on-empty-lineโ do not refresh the current list of files when pressing Enter on an empty line.-s,--splashโ display the splash screen at startup.-S,--stealth-modeโ in stealth mode (also known as incognito or private mode), no trace is left on the host system. no files are read or created, and all settings revert to their default values. however, most settings can still be controlled via command-line options and dedicated environment variables (see the ENVIRONMENT section below). additionally, refer to thehistorycommand and the--no-historycommand-line switch for more options. ghost mode activated ๐-t,--disk-usage-analyzerโ run in disk usage analyzer mode. this is equivalent to using--sort=size --long-view --full-dir-size --no-dirs-first. the recursive size of the current directory will be displayed after the list of files. you can toggle this mode in place by pressing Alt+Tab (or Ctrl+Alt+i).-T,--trash-dir=DIRโ set an alternative trash directory.-v,--versionโ print version details and exit.-w,--workspace=NUMโ start in workspace NUM. by default, clifm will recover the last visited directory for each workspace. you can override this behavior using positional parameters to start in workspace NUM and in the specified directory (e.g.,clifm -w4 /etc). consult the POSITIONAL PARAMETERS section above for more information.-x,--no-ext-cmdsโ disallow the use of external (shell) commands.-y,--light-modeโ enable the light mode to speed up clifm (see the NOTE ON SPEED section below).-z,--sort=METHODโ sort files by METHOD, where METHOD is one of:0= none,1= name,2= size,3= atime,4= btime,5= ctime,6= mtime,7= version,8= extension,9= inode,10= owner,11= group,12= blocks,13= links, or14= type. both numbers and names are accepted. for example, you can use--sort=9or--sort=inode.--bell=TYPEโ set the terminal bell type, where TYPE is one of:0= none,1= audible,2= visible (requiresreadline >= 8.1), and3= flash. defaults to2(visible), and, if not available,0(none). only numbers are allowed.--case-sens-dirjumpโ do not ignore case when consulting the jump database (via thejcommand).--case-sens-path-compโ enable case sensitive path completion.--cd-on-quitโ write the last visited directory to$XDG_CONFIG_HOME/clifm/.lastfor later access by the corresponding shell function at program exit. consult the SHELL FUNCTIONS section below for more information.--color-scheme=NAMEโ use the color scheme specified by NAME.--colorize-symlinks-as-targetโ colorize symbolic links using the color of the target file (an@character is prepended to the filename to mark it as a symbolic link).--data-dir=DIRโ load data files, such as plugins, color schemes, and default configuration files, from DIR (this is by default the installation directory, usually/usr/share/clifm).--desktop-notifications[=STYLE]โ enable desktop notifications. the notification style can be optionally specified:kitty(requires the Kitty terminal or a terminal supporting the Kitty Notifications Protocol),system, orfalse. if STYLE is omitted, it defaults tosystem. enterhelp desktop-notificationsin clifm for more information.
okay bestie that's the first chunk ๐ more parts coming, don't go anywhere โจ
--disk-usageโ shows you the disk usage of the filesystem where your current directory lives, formatted likeFREE % (FREE/TOTAL) TYPE DEVICE. receipts for your storage, bestie ๐พ--full-dir-sizeโ displays recursive directory sizes. Heads up: this only works in long view, no cap.--fuzzy-algo=VERโ picks your fuzzy matching algorithm, where VER is either1(faster, but not Unicode aware) or2(slower, Unicode aware). But bestie, plot twist: the second algorithm (which is the default) will fall back to the first one (because it's faster) whenever your query string has only ASCII characters in it โ all to keep the performance penalty as tiny as possible. she's efficient ๐--fuzzy-matchingโ turns on fuzzy matching for filename/path completions and suggestions. vibe-based searching, slay โจ--fzfpreview-hiddenโ enables file previews for tab completion (fzf mode only) but with the preview window hidden. Toggle it by pressingAlt+p. it's giving peekaboo ๐ซฃ--iconsโ enables icons. that's it, that's the whole thing ๐--icons-use-file-colorโ instead of using some specific color, your icons take on the color of the corresponding filename. Super useful when you're building custom color schemes. This option implies--icons, and it only works when compiled with support for icons-in-terminal or Nerdfonts (the default). Note: when compiled with emoji-icons support, this option is just ignored, because Unicode icons have their own built-in colors. they don't need your help, they're booked and busy ๐--int-varsโ allows the use of internal variables (e.g.,VAR=/bin; cd $VAR). variables in the wild, iconic--list-and-quitโ lists files and then bounces. Super handy with positional parameters (e.g.,clifm --list-and-quit /etc). If you don't provide a positional parameter, it just uses the current directory instead. in and out, no small talk ๐จ--lsโ short for--list-and-quit. same energy, less typing ๐ฆ--lscolorsโ reads your file colors from theLS_COLORSenvironment variable (the FreeBSDLSCOLORSformat is supported too). Note that clifm-specific colors (like empty directories or inaccessible files) get disabled. Also note that colors for specific filenames, as defined inLS_COLORS, are not supported. Want more info onLS_COLORS? Consultdircolors(1), or check thels(1)FreeBSD manpage forLSCOLORS. doing it the old-school way, respect--max-dirhistโ the maximum number of visited directories to remember. memory lane, but with a limit--max-files=NUMโ lists only up to NUM files. Use-1or leave it unset to remove this limit (that's the default). See themfcommand for a more detailed description.--mimelist-file=FILEโ sets FILE as Lira's configuration file (peep the FILE OPENER section below for more on that). ๐๏ธ--mnt-udisks2โ usesudisks2(1)instead ofudevil(1)(the default) for themediacommand. swapping out the machinery--no-boldโ disables bold colors. This applies to all color schemes, no exceptions. ๐--no-cd-autoโ by default, clifm changes directories when you just type a directory's filename. This option forces you to actually use thecdcommand. no shortcuts, bestie--no-classifyโ by default, clifm appends a file type indicator character to filenames when running without colors (see--no-colorbelow), and a directory indicator (plus a file counter) when running with colors. The classification characters are as follows:
/n: directory (n = file counter)
@: symbolic link
!: broken symbolic link
|: FIFO/pipe
=: socket
*: executable file
+: block device
-: character device
?: unknown file type
Use this option to disable file type classification. Note that this also disables the file counter.
--no-clear-screenโ does not clear the screen before listing files. your scrollback is safe ๐ซถ--no-colorโ disables colors. monochrome era--no-columnsโ disables the columned file listing, so you get a single column instead. one at a time, like a queen--no-file-capโ skips checking file capabilities when listing files. This is only meaningful for performance reasons, ngl.--no-file-extโ skips checking file extensions when listing files (extensions are mostly used to colorize specific filenames). ๐จ--no-file-counterโ disables the file counter for directories, which speeds up the listing process: counting files in directories is particularly expensive. ๐--no-fzfpreviewโ disables file previews for tab completion (fzf mode only). closing the curtains--no-highlightโ disables syntax highlighting. Want to customize your highlighting colors? See the COLOR CODES section below. ๐--no-historyโ doesn't write commands to the history file. Also peep theHistIgnoreoption in the configuration file. what happens in the shell stays in the shell--no-open-autoโ by default, clifm opens files (using the default associated application) when you just type their filenames. Use this option to force the use of theopencommand instead. Consult themimecommand and the FILE OPENER section for more info about default associated applications.--no-refresh-on-resizeโ doesn't attempt to refresh the list of files when you resize the window. resize away, she's unbothered--no-restore-last-pathโ by default, clifm saves the last visited directory for each workspace so it can restore it next session. Use this option to disable that behavior. fresh start energy--no-suggestionsโ disables the auto-suggestions system. no hints, we're rawdogging the command line โจ--no-tipsโ doesn't display startup tips. we know everything already--no-truncate-namesโ doesn't truncate filenames (see theMaxFilenameLenoption in the configuration file). full names, full drama--no-unicodeโ doesn't use Unicode decorations. plain and simple ๐--no-warning-promptโ disables the warning prompt, which is the thing that highlights invalid command names. typo protection, off the table--no-welcome-messageโ disables the welcome message. no greeting, straight to business--only-dirsโ lists directories only. ๐๏ธโจ--open=FILEโ runs clifm as a standalone file opener: opens FILE and exits. FILE can be a regular file or a directory, and you can use either standard notation (/dir/file), the file URI scheme (file:///dir/file), or a URL (www.domainorhttps://domain). one job, done flawlessly ๐--opener=APPLICATIONโ uses APPLICATION (e.g.,rifleorxdg-open) as your file opener/launcher, instead of Lira, clifm's default opener. ๐ซถ--pager-view=MODEโ lists files in the pager according to MODE. Supported values are:auto(uses the current listing mode โ this is the default),long(lists files in long view), andshort(lists files in short view).--physical-sizeโ displays physical file sizes (device usage) instead of logical sizes (apparent size). what it really takes up vs. what it claims--preview=FILEโ displays a preview of FILE (via Shotgun) and exits. Use--shotgun-fileto set an alternative configuration file. Consult the SHOTGUN section below for more. ๐--print-selโ prints the list of selected files after the file list. You can cap the maximum number of selected files printed with theMaxPrintSelfilesoption in the configuration file. By default that option is set to0(auto), which means it will never exceed half the terminal height. ๐--prop-fields=FORMATโ sets the fields to be displayed in long view. For info on how to construct this format string, consult thePropFieldsoption in the configuration file. ๐--ptime-style=STYLEโ the time/date style used by thep/ppcommand and the--stat/--stat-fullcommand-line switches. Available styles:default,iso,long-iso,full-iso,full-iso-nano, and+FORMAT(FORMAT is interpreted like instrftime(3)). Nano-second precision is available via the%Nmodifier, like indate(1). timestamps, but make it couture--readonlyโ runs in read-only mode, meaning internal commands that can modify the filesystem are disabled. The disabled commands are:ac,ad,bb,bl/bleach,br/bulk,c,dup,l,le,m,md,n/new,oc,paste,pc,r,rr,t/trash,tag,te,u/untrash, andvv, plus the shell commandscp,rm,mv,ln,mkdir,rmdir,link, andunlink. look, don't touch, bestie ๐ซ--report-cwdโ reports the current directory to the underlying terminal using theOSC-7escape sequence. Note: not supported by all terminals. ๐ฅ๏ธ--rl-vi-modeโ sets readline to vi editing mode (it defaults to emacs editing mode). vi girlies rise--secure-cmdsโ sanitizes commands passed to the OS to mitigate command injection attacks (--secure-envis implied). Consult the SECURITY section below for more. ๐--secure-envโ runs clifm in a secure environment (regular mode). Consult the SECURITY section below. ๐ก๏ธ--secure-env-fullโ runs clifm in a secure environment (full mode). Consult the SECURITY section below. maximum protection, main character security detail--sel-file=FILEโ sets FILE as the selections file. ๐--share-selboxโ by default, each user profile has a private Selection Box. Use this option to make the Selection Box common to all user profiles. sharing is caring ๐--shotgun-file=FILEโ sets FILE as the shotgun configuration file. See the SHOTGUN section below for more. ๐ซโจ--siโ displays file sizes in SI units (powers of1000) instead of IEC units (powers of1024). metric girlies, this one's for you--sort-reverseโ sorts files in reverse order (e.g.,z-ainstead ofa-z). backwards, but make it intentional--stat FILE...โ runs thepcommand on FILE(s) and exits. This must be the last option on the command line. Use--ptime-styleto set a custom date/time format. ๐--stat-full FILE...โ same as--stat, but it runs theppcommand (instead ofp) on FILE(s). the deluxe version--tabmode=MODEโ sets the tab completion mode. Available modes:fzf,fnf,smenu, andstandard. ๐--time-style=STYLEโ the time/date style used in long view. Available styles:default,relative,iso,long-iso,full-iso,+FORMAT(FORMAT is interpreted like instrftime(3)). โฐ--trash-as-rmโ makes thercommand move files to the trash instead of removing them. safety net, slay ๐๏ธ--unicodeโ by default, Unicode decorations are used if Unicode support is detected for the running terminal. If no support is detected, you can use this option to force the use of Unicode decorations. forcing the aesthetic, respectfully โจ--virtual-dir=PATHโ uses PATH as clifm's virtual directory. ๐ธ--virtual-dir-full-pathsโ prints filenames in virtual directories as absolute paths instead of just basenames. full addresses only--vt100โ runs in VT100 compatibility mode. Use this option if you're running on a really ancient terminal emulator. grandma terminal, we love her ๐ต๐
Options precedence order: 1) command-line flags; 2) configuration file; 3) default values. flags win, always ๐
โจ 4. COMMANDS โจ
Okay bestie, this is the big one. Every command listed down here has its own lil help page, and you get to it with the -h/--help options. Like, literally just do p --help and boom, you get the whole rundown on the properties function. ๐
Note 1: ELN = Entry List Number. So when you see a line like12 chocolatebox(that's what it looks like when you're listing files), the12is the ELN, and it belongs to the file namedchocolatebox. And that slash-plus-a-number thing (/xx) that shows up after directories and symlinks-to-directories? That's the file counter โ it tells you how many files are chillin' inside that directory, and nope, it doesn't count self and parent ("."and".."respectively). ๐
Note 2: When an ELN and a filename are beefing (aka ELN-filename conflict), you can use the backslash to stop ELN expansion. Example time: if there are at least two files and one of them is literally named2, clifm cannot possibly know in advance whether your command means the ELN2or the filename2. To say "I mean the ELN", just write the ELN number, likes 2. To say "I mean the filename", escape it with the backslash character:s \2. ๐ฆ
Note 3: Clifm supports fused parameters for internal commands that take an ELN or a range of ELNs as parameters. Think of it like short options for command-line programs โ you can ditch the space between the internal command and the ELN argument. So instead ofCMD ELNyou can just writeCMDELN. That meanso12works instead ofo 12, ands1-5works instead ofs 1-5. BUT โ heads up โ omitting that space character turns OFF tab completion and suggestions for ELNs. And if there happens to be a file namedo12(or more generally,CMDELN) and you actually want that file instead of the clifm command, escape the filename so it doesn't get split:\o12. ๐ง
๐ FILE/DIR
If the autocd and/or auto-open functions are enabled (they are by default, bestie), this opens FILE or changes directory to DIR. In other words: FILE is giving open FILE (or o FILE), and DIR is giving cd DIR. ELNs are obviously allowed here too. For example: 12. โจ
๐ /PATTERN [-FILETYPE] [-x] [DIR]
This right here is the quick search function. Type / followed by a glob or an (extended) regular expression, and clifm will list every single match in the current directory. So both /*.pdf and /.pdf$ will list all the PDF files in the current directory โ the first one using wildcards, and the second one being a regular expression. ๐ธ
You can also pull up previously used search patterns with the TAB key: /*<TAB>.
Note 1: By default, the search function tries to resolve a pattern as a glob first, and then, if nothing matches, as a regular expression. You can customize this behavior in the configuration file using the SearchStrategy option.
Note 2: If you don't provide any further parameter and it's just a glob pattern (wildcards), you can expand that pattern into the actual matches by hitting the TAB key. Example: to list every C file in the current directory, do /*.c<TAB>.
Note 3: Expressions with no pattern metacharacter get automatically transformed into a glob/regular expression (which one depends on the value of theSearchStrategyoption). Like,/testbecomes*test*or/.*test.*. ๐ฆ
1. Case sensitivity
Regular expressions are case insensitive by default (glob expressions, on the other hand, are always case sensitive, no cap). But you can turn on case sensitive search by setting the CaseSensitiveSearch option to true in the configuration file. ๐
2. Destination directory
Wanna search somewhere other than the current directory? Just pass the directory name as a further parameter (DIR). For example, enter /^A 7 to search for all files starting with ยดAยด in the directory corresponding to ELN 7. ๐
3. File type filter
You can filter those search results even more by specifying a filter type: -b, -c, -d, -f, -l, -p, -s, -O, and -P โ which are block device, character device, directory, regular file, symbolic link, FIFO/pipe, socket, door (Solaris), and port (Solaris) respectively. For example, /[.-].*d$ -d Documents/ lists all directories containing a dot or a dash and ending with ยดdยด in the directory named Documents. ๐ฅ
4. Invert matching
Slap an exclamation mark (!) at the front to invert what a search pattern means. For example: !.*s$ -d /etc matches all directories in /etc that don't end with ยดsยด, and !D* matches all files in the current directory that don't start with ยดDยด. ๐
5. Recursive search
For a recursive search, use the -x parameter, plus optionally a search path (DIR) โ and note that a file type filter is not allowed here. The search runs using find(1) like this: find DIR MODE PATTERN. If you don't give a search path, the search starts in the current directory. Otherwise, it starts in DIR. And MODE is one of these:
-name: ifSearchStrategyis not regex-only andCaseSensitiveSearchis set totrue-iname: ifSearchStrategyis not regex-only andCaseSensitiveSearchis set tofalse-regex: ifSearchStrategyis regex-only andCaseSensitiveSearchis set totrue-iregex: ifSearchStrategyis regex-only andCaseSensitiveSearchis set tofalse
๐ ;[CMD], :[CMD]
If CMD isn't specified, this runs the system shell in the current directory. If CMD is specified, clifm skips all its expansions (peep the BUILT-IN EXPANSIONS section below) and runs the input string (CMD) as-is via the default system shell โ and if you wanna know the deets on how shell commands get executed, check the MISCELLANEOUS NOTES section. ๐
๐๏ธ ac, ad FILE...
Archive/compress and dearchive/decompress one or multiple files and/or directories. โจ
The archiver function has two modes: ac, to generate archives or compressed files, and ad, to decompress or dearchive files โ whether that's just listing, extracting, recompressing, or mounting their content. In that last case, the mountpoint used automatically is $HOME/.config/clifm/PROFILE/mounts/ARCHIVE_NAME.
Example: ac sel, ac 4-25 myfile, or ad *.tar.gz.
So here's the tea: with ZIP-based files like .odt, .docx, .apk, and so on, clifm will attempt to dearchive them using either unzip(1) or 7z (in that order). If neither one is found, the operation gets skipped entirely. Files are extracted into a directory named like the archive plus the -extracted suffix, in the current directory. For example, the contents of the file named document.odt get extracted into the directory document.odt-extracted. ๐
Multiple archive/compression formats are supported, Zstandard included. Note that when it comes to ISO 9660 files, only a single file is supported.
The archive mount function for non-ISO files depends on archivemount, while the remaining functions depend on atool and other third-party utilities for archive formats support โ for example, p7zip. p7zip is also used to manage most decompressing options for ISO 9660 files, except for mount, in which case mount(8) is used. Creation of ISO files is done via genisoimage(1). Want more info? Consult atool(1), archivemount(1), zstd(1), and 7z(1). ๐ฆ
๐ acd, autocd [on | off | status]
Toggle the autocd function. If set to on, then DIR amounts to cd DIR. Simple as that, bestie. ๐
๐ฎ actions [list | edit [APP]]
To list available actions (or plugins), use the list subcommand. And since list is the default action, you can totally just omit it. ๐
Use the edit subcommand to add, remove or modify custom actions โ using APP if you specify one, or the default associated application for text files otherwise.
The whole point of this function is to let you easily add custom commands and functions to clifm. In other words: the actions function is a plugins capability. Periodt.
Here's the general procedure: a) edit the actions file (by running actions edit) and bind a custom action name to an executable file โ written in whatever language you want, be it a shell or Python script, a C program, or whatever you're feeling. For example, "myaction=myscript.sh". b) Drop the corresponding script (in our example, myscript.sh) into the plugins directory, usually ~/.config/clifm/plugins (see the FILES section below). 3) Call the script using the custom action name you defined before, as if it were any other command: run myaction, and myscript.sh will be executed. ๐
Note that all arguments passed to the action command (myaction) get passed along to the script or program as well (myscript.sh), which is executed via the system shell (consult the MISCELLANEOUS NOTES section for info on how shell commands are executed). ๐ฅ
To help you out when writing plugins, clifm's state information is exported via environment variables while running plugins. For example, CLIFM_LONG_VIEW is set to 1 if you're currently running in long view (see the ENVIRONMENT section for the complete list of exported values). ๐ซถ
The plugins bundled with clifm (take a look at the plugins directory) can be used as a starting point to create new plugins. ๐
๐ท๏ธ alias [import FILE | ls, list | NAME]
With no argument (or with the ls,list parameters), it prints the list of available aliases. To get the description of a specific alias, enter alias followed by the alias name. To write a new alias, simply enter edit (or press F10) to open the configuration file and add a line like this: "alias name=ยดcommand args...ยด" or "alias name=ยดdirectoryยด". โจ
To import aliases from a file โ provided it contains aliases in the specified form (i.e. the POSIX syntax for the alias shell command) โ use the import parameter. Heads up though: aliases that conflict with some of the internal commands will not be imported. ๐
Okay so the actual galaxy-brain way to use aliases isn't even binding short keys to commands โ it's binding them to files and directories you visit all the time ๐. Like, you can bind as many files or directories as you want, no matter how deep they're buried in the filesystem, to super short strings โ even single characters. Example: alias w=ยด/some/file/deep/in/the/filesystemยด. Now, wherever you are, you just type w and โ provided autocd and/or the auto-open function is enabled โ boom, you're at the file or directory you wanted. Theoretically you can keep doing this until the system memory is exhausted ๐.
Wanna create multiple aliases for files all at once? This is the recommended procedure, bestie:
- Select all the files you want to alias with the
selcommand:s file1 file2 file3 ... - Export the selected files into a temporary file by running
exp sel - Edit this file so it contains only valid alias lines:
alias a1=ยดfile1ยด
alias b1=ยดfile2ยด
alias c1=ยดfile3ยด
Note: make sure alias names do not conflict with other commands, either internal or external. To bypass the conflicts check โ which is performed automatically by the alias import command โ you can edit the aliases file manually (F10).
- Finally, import this file with the alias command:
alias import tmp_file. Now you can access any of these files by entering just a few characters:a1,b1, andc1โจ.
๐ auto [list | none | unset | OPTION=VALUE...]
Sets a temporary autocommand for the current directory ๐ฆ.
Unlike permanent autocommands โ those are defined in the configuration file via the autocmd keyword (see the AUTOCOMMANDS section below) โ options set via the auto command are temporary, meaning they're valid only for the current directory and the current session.
Options set via this command take precedence over both permanent autocommands and regular options (whether those were set via the command line or the configuration file). Precedence queen ๐.
Examples
List available autocommands
auto list
List files in the current directory in long view
auto lv=1
List only PDF files, set the color scheme to nord, and sort files by size
auto ft=.*.pdf$,cs=nord,st=size
The same list of options can be specified sequentially (i.e., previous options are preserved)
auto ft=.*.pdf$
auto cs=nord
auto st=size
Unset the files filter and the color scheme, and change sort to blocks
auto ft=,cs=,st=blocks
Unset all temporary autocommands previously set for the current directory
auto unset
Reload the current directory ignoring all autocommands (including permanent autocommands)
auto none
For the list of available option codes, consult the AUTOCOMMANDS section or enter help autocommands ๐.
๐ ao, auto-open [on | off | status]
Toggles the auto-open function โจ. If it's set to on, then FILE basically amounts to open FILE.
๐
b, back [h, hist | clear | !ELN]
Unlike cd .., which changes to the parent directory of the current directory, this command (with no argument) changes to the previously visited directory ๐ฆ. You can also use Alt+j or Shift-Left.
Clifm keeps a record of all visited directories (and to stop a directory from being added to the directory history list, use the DirhistIgnore option in the main configuration file). You can see this list by typing b hist or b h, and you can access any element in this list by simply passing the corresponding ELN in this list โ preceded by an exclamation mark โ to the back command. Example:
:) > ~ $ bh
1 /home/user
2 /etc
3 /proc
:) > ~ $ b !3
:) > /proc $
Note: the highlighted line (by default printed in bold cyan) indicates the current position of the back function in the directory history list.
And you can also clear this history list by entering b clear ๐ง.
The best way of navigating the directory history list, though? That's the directory jumper function (invoked by the j command) ๐. You can also take a look at the dh command.
Use the f (or forth) command to move forward, instead of backward, in the directory history list.
๐ธ bb, bleach FILE...
Bleach is a built-in filenames sanitizer (based on detox, https://github.com/dharple/detox), and its whole goal is renaming filenames using only ASCII characters ๐
.
Bleach sanitizes filenames either by removing extended-ASCII/Unicode characters that don't have an ASCII alternative/similar character, or by translating those characters into an alternative ASCII character based on familiarity/similarity.
These following simple rules are used to compose sanitized filenames:
- NUL (
\0) and slash (/) characters are completely disallowed - Only characters from the POSIX Portable Filename Character Set (
a-zA-Z0-9._-) are allowed { [ ( ) ] }are replaced by a dash (-). Everything else is replaced by an underscore (_)- Unicode characters are translated, whenever possible, into an ASCII replacement. Otherwise, they are just ignored. For example, an upper case A with diacritic (accent, umlaut, diaresis, and so on) will be replaced by an ASCII A, but the smiley face emoji will be simply ignored ๐. A few special signs will be translated into text, for instance, the pound sign will be replaced by
_pound_and the Euro symbol byEUR. Translations are made via a translation table (see thecleaner_table.hin the source code). - Filenames never start with a dash (
-) - Files named
.and..are not allowed - Append
.bleachto single character filenames - Do not let a replacement filename start with a dot (hidden) if the original does not
- Max filename length is
NAME_MAX(usually 255)
Modified filenames will be listed on the screen asking the user for confirmation, and besides that it lets you edit (by pressing 'e') the list of modified filenames via a text editor โจ.
If the replacement filename already exists, a dash and a number (starting from 1) will be appended: e.g., file-3.
๐ bd [NAME]
bd is the backdir function: it takes you back to the parent directory matching NAME ๐ฆ.
With no arguments, bd lists all parent directories relative to the current directory, letting the user select an entry. Otherwise, it checks the absolute current directory against the provided query string (NAME): if only one match is found, it automatically changes to this directory; if multiple matches are found, the list of matches is presented to the user in a selection menu. And if NAME is a directory name, bd just changes to this directory โ whether it's a parent of the current directory or not ๐
.
Tab completion and suggestions are available for this function โจ.
Example:
Provided the current directory is /home/user/git/repositories/lambda, entering bd git will take you immediately to /home/user/git.
Note that there's no need to type the entire directory name; if the query is unambiguous, only a few characters โ even just one โ suffices to match the appropriate directory ๐. In our example, bd g is enough to take you to /home/user/git, just as bd h will take you to /home.
The query string can match any part of a directory name: bd er, for instance, will take you to /home/user, since it is an unambiguous query ๐.
๐ bl FILE...
Creates symbolic links (in the current directory) for each specified file ๐ฅ. For example, to create symbolic links in the directory dir for all PNG files in the current directory, issue these commands: s *.png, cd dir, and then bl sel.
๐ bm, bookmarks [a, add FILENAME NAME [SHORTCUT] | d, del NAME | e, edit [APP] | NAME, SHORTCUT]
Bookmarks can be managed either from the bookmark manager screen or from the command line ๐ฆ.
1. The bookmark manager screen
To access the bookmark manager screen, enter bm. Here you can cd to the desired bookmark by entering either ELN or filename (regular files can be bookmarked as well โจ). In this screen you can also add, remove, or edit your bookmarks by entering 'e' to edit the bookmarks file (which is simply a list of lines with this format: NAME:PATH. E.g., "docs:/home/user/documents"). Make your changes, save, and exit ๐
.
2. The command line ๐ฌ
okay so here's the group chat of bookmark commands, all in one place:
bm add /media/mount mntโ bookmark the/media/mountdirectory as "mnt"bm mntโ change to / open the bookmark named "mnt"bm del mntโ delete the bookmark named "mnt"bm editโ edit your bookmarks
A handy use for the bookmarks function is to create bookmarks using short names, which will be later easily accessible via tab completion. โจ like, name them cute and short and future-you will be so grateful.
The b: prefix ๐
The b: prefix is used as a way to quickly access/operate on bookmarks. A few examples:
b:<TAB>โ list available bookmarksb:netโ change to the bookmark named "net" (1)p b:bm1 b:bm2โ print file properties of the bookmarks named "bm1" and "bm2"s b:โ select all bookmarks at once
(1) If you're not sure about where a bookmark points to, type b:NAME<TAB>. iykyk ๐
br, bulk FILE... [:EDITOR]
Bulk rename FILE(s). ๐
Each filename will be copied to a temporary file, which will be opened via EDITOR (default associated application for plain text files if omitted), letting the user modify it. Once the file has been modified and saved, the modified names are printed on the screen and the user is asked for confirmation.
This built-in bulk rename function will not deal with deletions, replacements, filename conflicts and the like. For a smarter alternative use qmv(1).
ngl, it's the "vibes only" version of bulk renaming. For the real thing, qmv(1) ate. ๐
c, m, md, r
Short for the following shell commands respectively: cp -iRp, mv -i, mkdir -p, and rm (for files) or rm -r (for directories).
By default, the c, m, and r commands ask for confirmation before operations. Since this might sometimes be quite intrusive (specially when operating on large number of files), it is possible to turn interactivity off in two different ways:
- a) For the current command only: via the
-f/--forceswitch. For example:c -f sel,m -f sel, orr -f *. - b) Permanently. Use the
cpCmd,mvCmd, andrmForceoptions in the configuration file to permanently set any of these commands to non-interactive mode.
To use these commands without any of these options, or with any other option you want, use the appropriate shell command, for instance, cp instead of c. Of course, you can also create aliases to use your preferred commands, for example, "c=ยดcp -adpยด". Consult the alias command above for more information.
The l command allows the use of the e, edit option to modify the destination of a symbolic link. For example: l edit 12 (or le 12) to relink the symbolic link corresponding to the file whose ELN is 12.
When using the sel keyword and no destination is provided, c and m will copy/move selected files to the current directory.
When renaming a file with the m command, filename validation is performed for the new filename. See the new command below for more information.
Whenever sel is not used, but just a source filename (and no destination is provided), the m command behaves much like the imv(1) shell command (from the ยดrenameutilsยด package), providing an interactive renaming function: it prompts the user to enter a new name using the source filename as base, so that it does not need to be typed twice. For this alternative prompt, only tab completion for filenames is available.
Clifm supports advcp(1), wcp, and rsync(1) to copy files (they include a progress bar ๐). To use them instead of cp(1) set the corresponding option (cpCmd) in the configuration file. If advcp is selected, the command used is advcp -giRp (or advcp -gRp, for non-interactive mode). If rsync, the command is rsync -avP. wcp takes no argument.
advmv(1) is also supported to move files (to add a progress bar to the move command). Use the mvCmd option in the configuration file to choose this alternative implementation of mv. In this case, the command used is advmv -gi (or advmv -g for non-interactive mode).
cd [DIR]
Change the current working directory. ๐ฆ
Directory check order:
- If no argument is provided, change to the home directory (
$HOME, or, if not set, the sixth field of the entry corresponding to the current user in/etc/passwd) - If the argument is an absolute path (begins with a slash character), or the first component is dot (
.) or dot-dot (..), convert to canonical form (viarealpath(3)) and, if a valid directory, change to this directory. - Check the
CDPATHenvironment variable and append/DIRto each of the paths specified here. If the result of the concatenation is a valid directory, change to it. - Check directories in the current working directory. If a matching directory is found, change to it.
You can use either ELNs or a string to indicate the directory you want. E.g., cd 12 or cd ~/media. If autocd is enabled (default), cd 12 and cd ~/media can be written as 12 and ~/media respectively as well. the way that you can just type the directory and it goes there?? main character energy fr. ๐
Unlike the shell cd command, clifm's built-in cd command not only changes the current directory, but also lists its content (provided the option AutoLs is enabled, which is the default) according to a comprehensive list of color codes. By default, the output of cd is much like this shell command:
cd DIR && ls --color=auto --group-directories-first
Automatic file listing can be disabled by either setting AutoLs to false in the configuration file or running clifm with the -O/--no-autols option.
cl, columns [on | off]
Toggle columned file listing. ๐
cmd, commands
Show this list of commands.
An alternative way of getting information about clifm commands is via the interactive help plugin (depends on fzf), by default bound to the ih action name.
colors
Preview the current color scheme (same as cs preview). ๐
config [edit [APP] | reset | reload | dump]
Manage the main configuration file. ๐
To edit the configuration file use the edit subcommand. If an application is specified (config edit APP), APP will be used to open the file (otherwise, the default associated program will be used). Edit settings to your liking, save, and quit the editor (changes are automatically applied). Note that, since edit is the default action, it can be omitted. Enter just config to open the configuration file, or config APP to open it using APP.
Use the reload subcommand to reload the main configuration file and update settings accordingly.
Use the reset subcommand to generate a fresh configuration file and create a backup copy of the old one (named clifmrc.YYYYMMDD@HH:MM:SS).
The dump subcommand prints the list of settings (as defined in the main configuration file) with their current value. Those differing from the default values are highlighted, and the default value for the corresponding option is displayed in brackets.
cs, colorschemes [edit [APP] | n, name | p, preview | check-ext | NAME]
With no arguments, list available color schemes (use cs name to print the current color scheme name). ๐
To get a peek at the current color scheme, use the preview subcommand: cs preview. โจ
Use the check-ext subcommand to check for file extension conflicts: cs check-ext. ๐ต๏ธ
Use the edit subcommand to open/edit the configuration file of the current color scheme (it opens with APP if you specify one, or with the default associated application otherwise).
To switch color schemes, just say the name: cs NAME. (Hit the TAB key to list all the available ones: cs <TAB>). ๐
๐ d, dup FILE...
Duplicate the files you pass as parameters โ directories or regular files, both are fine. The user gets asked for a destination directory. Duplicated filenames are generated by appending ".copy" to the basename of each source file. So for example, d /my/file copies /my/file into the directory the user selected as file.copy. And if file.copy already exists, an extra suffix gets added like this: file.copy-N, where N is a positive integer (starting at 1). ๐ซถ
If rsync(1) is found, it'll be used like this: rsync -aczvAXHS --progress. Otherwise, cp(1) steps in: cp -a.
๐ dh [STRING] [PATH] [!ELN]
With no parameters at all, it prints the directory history list. Want to filter that list? Just pass a query string, and only the entries matching it get displayed. Tab completion is available in both cases, btw. For example: dh down<TAB> lists only the entries matching down (fuzzily, if fuzzy-matching is enabled). ๐ธ
To access one specific entry, pass the entry number preceded by an exclamation mark. Like, if you want entry number 12, enter dh !12 and it changes to the corresponding directory.
Finally, if an absolute path is passed as the first parameter, dh works just like the cd command.
Note: take a look at thejcommand as well, bestie. Both commands deal with the list of visited directories, just in slightly different ways: whiledhdeals with the list of the last MaxDirhist entries (see the configuration file), thejcommand deals with the ranked list of visited directories.
๐ฆ ds, desel [*, a, all | FILE]...
Deselect one or more files.
If no parameter is passed, the user is prompted to either mark the selected files to be deselected, or to edit the selections file (entering e) via a text editor to manually deselect files.
Use *, a or all to deselect all selected entries at once. E.g., ds *.
You can also pass the filename(s) (or ELNs) to be deselected as a parameter. For example: ds myfile 24.
Tab completion is available for this command: ds <TAB> lists all currently selected files.
โจ exp [FILE]...
With no argument, export the list of files in the current directory to a temporary file. Otherwise, export only the ones specified as further arguments: they can be directories, filenames, ELNs, or some search expression like "*.c".
๐ ext [on | off | status]
Toggle the ability to execute external commands.
๐ซ f, forth [h, hist | clear | !ELN]
This command works just like the back command, except it goes forward instead of backward in the history record.
Run f to change to the next visited directory (you can also just press Alt+k or Shift+Right).
And of course you can use f hist, f h, and f !ELN (go consult the back command for the details).
๐ fc [on | off | status]
By default, clifm prints the number of files contained by listed directories right next to the directory names. But since this is an expensive feature, it might be desirable to turn it off (for example, when you're listing files on a remote machine). Use the off subcommand to disable it. To permanently disable it, use the FileCounter option in the configuration file.
โญ ff, dirs-first [on | off | status]
Toggle list directories first.
๐ง ft, filter [unset] [[!]REGEX,=FILE-TYPE-CHAR]
Filter the current list of files, either by filename (via a regular expression) or by file type (via a file type character).
With no argument, ft prints the current filter. To remove the current filter use the unset option. To set a new filter, enter ft followed by a filter expression (use the exclamation mark to reverse the meaning of a filter). Examples, bestie:
Exclude hidden files:
ft !^.
List only files ending with .pdf:
ft .*\.pdf$
List only symbolic links:
ft =l
Exclude socket files:
ft !=s
The list of file type characters is included in the FILE FILTERS section below.
Heads up: the filter will be lost at program exit. To permanently set a filter use the Filter option (in the configuration file) or the CLIFM_FILTER environment variable (consult the ENVIRONMENT and the FILE FILTERS sections below).
๐ fz [on | off]
Toggle recursive directory sizes (long view only).
๐ hf, hh, hidden [on | off | first | last | status]
Turn hidden files on/off (use first/last to sort hidden files before/after non-hidden files respectively).
๐ฅ history [edit [APP] | clear | -N | on | off | status | show-time]
With no arguments, it prints the commands history list (use show-time to print timestamps as well). If clear is passed as argument, it deletes all entries in the history file. Use edit to open the history file and modify it however you need (the file opens with APP, if specified, or with the default associated application otherwise). -N tells the history command to list only the last 'N' commands in the history list. And finally, you can disable history (subsequent entries will not be written into the history file) via history off โ you can also use the HistIgnore option in the configuration file to prevent specific command lines from being added to the history list. ๐
You can use the exclamation mark (!) to perform some history commands:
!<TAB>: List history entries!!: Execute the last command.!n: Execute the command numbernin the history list.!-n: Execute thelast - ncommand in the history list.!STRING: Execute the command starting with STRING. Tab completion is available in this case:!STRING<TAB>.
๐ icons [on | off]
Toggle icons.
Note: depending on how the terminal renders icons, the apparent space between icons and filenames may not be the most appropriate. This space can be adjusted using the IconsGap option in the configuration file (valid values:0,1,2).
๐ฆ j [--purge [NUM] | --edit], jc, jl, jp [STR]..., je
j is the fastest way of using Kangaroo, a directory jumper function used to quickly navigate through the jump database (i.e. a database of visited directories). ๐ซถ
With no argument, j just lists the entries in the jump database (1)(2), printing: a) order number of the corresponding entry, b) total sum of visits, c) days since the first visit, d) hours since the last visit, e) the rank value, and f) the directory name itself. An asterisk next to the rank value means the corresponding directory will not be removed from the database, despite its rank โ either because it has been visited in the last 24 hours, or because it is bookmarked, pinned, or currently active in some workspace.
- To prevent a directory from being added to the jump database use the DirhistIgnore option in the main configuration file.
- To prevent a directory from being removed from the jump database, edit the database (
j edit) and prepend a plus sign (+) to the corresponding line.
Otherwise, if a query string is provided as parameter, it searches for this string in the database and cds to the best ranked matching entry. Example: j Down will probably take you to /home/user/Downloads, provided this directory has already been visited and is the best ranked match in the database. For a more detailed description of the matching algorithm see the KANGAROO FRECENCY ALGORITHM section below.
Multiple query strings can be passed to the function. For example, j et mo will first check for "et" in the jump database and then will further filter the search using the second parameter: "mo". It will most probably take you (again, provided the directory has already been visited and is the best ranked match) to /etc/modprobe.d. Bear in mind that if STR is an actual directory, jump will just cd to it without performing any query. ๐
The backslash (\) and the slash (/) can be used to instruct Kangaroo to search for the string query only in the first or last path segment of each entry in the database respectively. Let's suppose we have two entries matching src in the database: /media/src/images and /home/user/Downloads/clifm/src. If the first entry is better ranked than the second, j src will match this first entry. However, if what we really want is the second entry, appending a slash to the query string instructs Kangaroo to only match entries having src in the last path segment, here /home/user/Downloads/clifm/src. ๐ฏ
Since it is not always obvious or easy to know where exactly a query string will take you, clifm (if the suggestions system is enabled) will print, at the right of the cursor, the path matched by Kangaroo. If that is the actually intended path, press the Right arrow key to accept the suggestion. Otherwise, it will be ignored. You can also use tab completion to print the list of matches for the current query string. For example: j - c<TAB> to list all entries in the directory history list containing a dash (-) and a c. ๐
The j command takes four modifiers: e, p, c, and l โ bestie, they stand for "edit", "parent", "child", and "list" respectively. So:
je(orj --edit) โ opens the jump database so you can edit it however you need โ๏ธjcโ searches for files by querying only child directories relative to the current working directoryjpโ same energy, but for parent directoriesjlโ just prints the matches for the given query string(s), no cd-ing, no drama ๐
Examples, because examples are the moment:
jp fooโ Change to the best ranked parent directory containing the string "foo".jc bar testโ Change to the best ranked child directory containing the string "bar" and "test"jl fooโ Print all entries in the database containing the word "foo"
Use the --purge option to shrink the database ๐ซถ Without any further parameters, --purge removes all non-existent (un-statยดable) directories from the database. But if you pass a numeric parameter instead? Then every entry ranked below that number gets yeeted from the database. Like, j --purge 100 will remove all entries ranked below 100. Periodt.
You can also manually edit the database file with the je (or j --edit) command: edit whatever needs editing, save your changes, close the editor. Genuinely useful for, say, removing one specific entry/directory from the database โ however, bear in mind that if the directory is in the directory history, it will not be removed from the jump database. No cap, that one sneaks up on people.
Wanna mark an entry as permanent (aka prevent it from being removed from the database)? Any of these procedures works:
- Bookmark it. ๐
- Edit the jump database (
jeorj --edit) and prepend a plus sign (+) to the corresponding entry.
An alternative way of navigating the jump database is using the jumper plugin (located in the plugins directory and bound by default to the ++ action name), which uses fzf to enable fuzzy searches. Enter ++ to perform a fuzzy search over the jump database. Obsessed with this one, ngl ๐ธ
Take a look at the dh command as well. iykyk.
๐ซ k
Toggle follow-simbolic-links (Alt+Plus is also available). See the -L/--no-follow-symlinks command-line switch.
๐ฆ kk
Toggle max-filename-len (Ctrl+Alt+l is also available)
๐ kb, keybinds
kb, keybinds [list | bind FUNCTION | edit [APP] | conflict | reset | readline]
With no argument (or if the argument is list), it prints the current keybindings and their associated functions. Your whole keyboard lore, right there ๐
To change a keybinding, use the bind subcommand.
Type kb bind <TAB> to get the list of bindable functions.
Enter kb bind FUNCTION to set a new keybinding for FUNCTION. For example, to bind the function previous-dir to a new key, enter kb bind previous-dir. You'll see a little prompt: press the key combination you want to associate to the specified function and then press Enter. (While in this prompt, press Ctrl+d to abort or Ctrl+c to clear the current line. Escape hatches, we love them ๐)
To manually edit your keybindings use the edit option โ the keybindings file will be opened with APP, if specified, or with the default associated application otherwise.
If you somehow messed up your keybindings ๐ญ you can check for keybinding conflicts with the conflict option, or use the reset option to create a fresh keybindings file with the default values. Clean slate, main character energy.
To unbind a function, run kb edit and comment out the corresponding entry. Note that some functions may have several entries, associating them to multiple keybindings: comment them out all if required. Yes, all of them. Every last one.
To list readline keybindings (defined in ~/.config/clifm/readline.clifm), use the readline option. The syntax is the same as the one used by readline's .inputrc file (consult http://tiswww.case.edu/php/chet/readline/readline.html#SEC9 for more information.)
๐ l, le
Create (l) or edit (le) symbolic links.
The syntax for the l command is: l TARGET [LINK_NAME]. Note that if LINK_NAME is omitted, the symbolic link is created as TARGET_BASENAME.link in the current directory.
By default, the link target is created relative to the link location. The link creation mode can be set using the LinkCreationMode option in the configuration file. Available modes are: absolute, and relative (like ln -rs), and literal (like ln -s).
To edit the target of a symbolic link use the le command followed by the desired link name. The user will be prompted to enter a new link target, using the current target as template. So helpful of it ๐
๐ ll, lv
ll, lv [on | off]
Toggle the long view.
โญ lm
lm [on | off]
Toggle the light mode. This option, aimed at making file listing faster than the default mode, is especially useful for really old hardware or when working on remote machines (for more information see the NOTE ON SPEED section below). Old laptop girlies, this one's for you ๐ซถ
๐ง log
log [cmd | msg] [list | on | off | status | clear]
Enable, disable, clear, list or check the status of the program logs, either message (errors and warnings) or command logs. Example: log cmd on, to enable command logs, or log msg clear, to clear/remove message logs.
Consult the FILES section below for information about how logs are written to the logs file.
๐ media
Note: This command is Linux-specific
List available storage devices and mount/unmount the selected one using either udevil or udisks2 (at least one of these must be installed. udevil will be preferred over udisks2). If the device is unmounted, it will be automatically mounted, and if mounted, it will be automatically unmounted. Flip-flop icon behavior, honestly โจ
Though mountpoints are determined by the mounting application itself (udevil or udisks2), clifm will automatically cd to the corresponding mountpoint whenever the mount operation was successful. Slay.
When unmounting, and if the current directory is inside the mountpoint, clifm will attempt to cd to the previous visited directory, and, if none, to the home directory, before unmounting the device. It's got your back ๐
To get information about a device, enter iELN, for example, i12, provided ยด12ยด is the ELN of the device you want.
๐ฅ mf
mf [NUM | unset]
List only up to NUM files (valid range: >= 0). Use unset to list all files (default). An indicator (listed_files/total_files) will be printed below the list of files whenever some file is excluded from the current list (e.g., 20/310). Note, however, that though some files are excluded, all of them are loaded anyway, so that you can still perform any valid operation on them. For example, even if only 10 files are listed, you can still search for all symbolic links in the corresponding directory using the appropriate command: /* -l. The list is a lie, the files are all there ๐ธ
๐ mm, mime
mm, mime [open FILE | info FILE | edit [APP] | import]
This is Lira, clifm's file opener.
Use the open subcommand to open a file with the default associated application. Note that, since open is the default action, it can be omitted. For example: mm file.pdf. The same can be achieved more easily using the open command: open file.pdf (or using the short command, o file.pdf). Or, even shorter, just file.pdf. Iconic laziness, we stan ๐
The info subcommand displays metadata and application matches for the file FILE: its name and MIME type, the application chosen to open it, and the preview application. Each application line includes a "(match: ...)" tag showing whether the selection was made by the file name or by its MIME type. The output is intended to help users understand why a particular app was selected and to make it easy to verify or troubleshoot association rules. Detective mode: activated ๐
The edit subcommand allows the user to edit and customize the MIME list file. For example, if a file has no default associated application, first get its MIME info or its file extension (running mm info FILE), and then add a value for it to the MIME list file using the edit option (mm edit or F6). Check the FILE OPENER section below for information about the mimelist file syntax.
Finally, with the import subcommand clifm will try to import MIME associations from the system looking for mimeapps.list files in those paths specified by the Freedesktop specification (see https://specifications.freedesktop.org/mime-apps-spec/mime-apps-spec-latest.html). If at least one MIME association is successfully imported, it will be stored as mimelist.clifm.XXXXXX (where XXXXXX is a random six digits alphanumerical string). You can add these new associations to your mimelist file using the mime edit command. Free associations, no strings attached ๐
mp</p>, mountpoints</p> ๐
Lists all the mountpoints you've got going on, and then โ plot twist โ it changes your current working directory to whichever mountpoint you picked. Like, it's a cd but make it discovery. โจ
msg, messages [clear] ๐ฌ
With zero arguments, it prints out the list of messages from the current session. Bestie, it's your receipts. ๐งพ
If you pass the clear option, clifm empties the messages list. Gone. Poof. ๐ซง
n, new [FILE[@TEMPLATE]]... [DIR/]... ๐
Creates new regular files and/or directories. Baby's first filesystem, but make it iconic. ๐
Here's the tea on how it decides what you're making:
- If a filename ends with a slash (
/), it's taken as a directory name. - Otherwise, it's created as a regular file.
So like, n myfile mydir/ creates a file named myfile and a directory named mydir. Two for one, slay. โจ
If you provide no filename at all, the user gets prompted to enter one. No silent failures here, we communicate. ๐
Automatic templates ๐ช
New regular files will be created from a template file if:
- The file to be created has a filename extension (e.g.,
file.html). - A file named like this extension โ here,
htmlโ exists in the templates directory (1).
If both conditions are met, running n file.html will create a new file named file.html which is a copy of the html file sitting in the templates directory. Copy-paste but it's โจinheritanceโจ.
Note that template names are not limited to actual file extensions: you can name your templates whatever you like (with any content you want) provided new files are created using the template name as extension. E.g., n file.my_super_cool_template. ๐
Explicit templates ๐ธ
If a filename is followed by the expression @TEMPLATE, where TEMPLATE is any regular file found in the templates directory (1), the file will be created as a copy of the corresponding file template. E.g., n file.sh@my_script.sh. Chef's kiss. ๐
Tab completion is available for explicit templates too:
n file@<TAB>
(1) The templates directory is $CLIFM_TEMPLATES_DIR, $XDG_TEMPLATES_DIR, or ~/Templates, in this precedence order. First one wins, no cap. ๐
Filename validation ๐จ
Filename validation is performed on new filenames before creation/modification, using a set of different checks. If a name fails any check, the user is warned and asked to confirm. It's giving concerned friend energy. ๐ซถ
Available checks:
- Starts with a dash (
-): command option flags collision. - Is a reserved keyword/expression (internal use): fastback (
...), ELN/range (12,1-45), and MIME/file type expansion (@query,=x). - Contains leading or trailing whitespace.
- Contains leading tilde.
- Contains embedded control characters (
0x00-0x1fin the ASCII table). - Contains invalid UTF-8 bytes (
0xc0,0xc1, and0xf5-0xff). - It is too long (longer than
NAME_MAX, usually255bytes). - Contains embedded shell metacharacters (
*?[]<>|(){}&=`!\;$). - Contains characters outside the POSIX Portable Filename Character Set (
a-zA-Z0-9._-).
The set of checks to be performed is controlled by the SafeFilenames option in the configuration file. This option supports the following values:
false: No check is performed. YOLO mode, be careful bestie. ๐basic: Only basic checks (1-7 above) are performed (this is the default).strict: Basic + disallow shell metacharacters (check 8).posix: Basic + allow only characters in the POSIX Portable Filename Character Set (check 9).
For more information about safe filenames consult https://dwheeler.com/essays/fixing-unix-linux-filenames.html. ๐
net [NAME | list | edit | m, mount NAME | u, unmount NAME] ๐
1. The configuration file ๐
The net command manages connections to remote systems via a simple samba-like configuration file ($HOME/.config/clifm/profiles/PROFILE/nets.clifm). Here you can specify multiple remotes and options for each of these remotes.
Syntax example for this file:
[remote_name]
Comment=A nice descriptive comment
Mountpoint=/path/to/mountpoint
MountCmd=sudo mount.cifs //192.168.0.12/share %m -o OPTIONS
UnmountCmd=sudo umount %m
AutoUnmount=true (Auto-unmount this remote at exit)
AutoMount=false (Auto-mount this remote at startup)
Note:%mcan be used as a placeholder forMountpoint.%mwill be replaced by the value ofMountpoint. It's a little variable doing big things. ๐ฆ
1.a. Mounting remote filesystems ๐ฐ๏ธ
A Samba share:
[samba_share]
Comment=My samba share
Mountpoint="~/.config/clifm/mounts/smb_share"
MountCmd=sudo mount.cifs //192.168.0.26/samba_share %m -o mapchars,credentials=/etc/samba/credentials/samba_share
UnmountCmd=sudo umount %m
AutoUnmount=false
AutoMount=false
A SSH filesystem (sshfs):
[ssh_share]
Comment=My ssh share
Mountpoint="/media/ssh"
MountCmd=sshfs user@192.168.0.26: %m -C -p 22
UnmountCmd=fusermount3 -u %m
AutoUnmount=true
AutoMount=false
1.b. Mounting local filesystems ๐พ
Though originally intended to manage remote filesystems, net can also manage local filesystems. Just provide the appropriate mount and unmount commands. Since the device name assigned by the kernel might change across reboots (specially when it comes to removable drives), it is recommended to mount using the device's UUID (Universal Unique Identifier) instead of the drive name. Main character move: be stable. ๐
For example:
MountCmd=sudo mount -U c98d91g4-6781... %m
Here's an example of how to set up net to mount USB devices, one with a FAT filesystem, and another with an ISO9660 filesystem:
[Sandisk USB]
Comment=Sandisk USB drive
Mountpoint="/media/usb"
MountCmd=sudo mount -o gid=1000,fmask=113,dmask=002 -U 5847-xxxx %m
UnmountCmd=sudo umount %m
AutoUnmount=false
AutoMount=false
[Kingston USB]
Comment=Kingston USB drive
Mountpoint="/media/usb2"
MountCmd=sudo mount -t iso9660 -U 2020-10-01-15-xx-yy-zz %m
UnmountCmd=sudo umount %m
AutoUnmount=false
AutoMount=false
Note: Thegid,fmask, anddmaskoptions are used to allow the user to access the mountpoint without elevated privileges. Basically: access without the sudo drama. ๐
If the device data is unknown, as it often happens when it comes to removable devices, you should use the media command instead. Different tool, different vibe. โจ
2. Command syntax โจ๏ธ
Without arguments (or via the list subcommand), net lists the configuration for each remote available in the configuration file.
Use the edit option to edit the remotes configuration file. If no further argument is specified, the file will be opened with the current file opener. However, you can pass an application as second parameter to open the configuration file. For example: net edit nano.
If not already mounted, the m, mount option mounts the specified remote using the mount command and the mountpoint specified in the configuration file, and automatically cds to the corresponding mountpoint. For example: net mount smb_work. And since mount is the default action, it can be omitted: net smb_work. Efficiency, we love her. ๐
The u, unmount option unmounts the specified remote using the unmount command specified in the configuration file. For example: net unmount smb_work. Tab completion is also available for this function. ๐
Note: If you only need to copy some files to a remote location (including mobile phones) without the need to mount the resource, you can make use of thecprm.shplugin, bound by default to thecraction. Set up your remotes (cr --edit) and then send the file you want (cr FILE). So convenient fr fr. ๐ซถ
o, open FILE [APPLICATION] ๐
Opens FILE, which can be either:
- a directory (in which case it works just like the
cdcommand), - a regular file,
- or a symbolic link to either of the two.
For example: o 12, o filename, o /path/to/filename. Versatile icon. ๐
By default, the open command will open files with the default application associated to them via Lira, the built-in file opener (see the mime command above). However, if you want to open a file with a different application, add the application name as second argument: e.g., o 12 leafpad or o12 leafpad. You're the boss. ๐
If you want to run the program in the background, simply add the ampersand character, as usual: o 12 &, o 12&, o12& or (if auto-open is enabled) just 12&. Background baddie behavior. ๐
If the file to be opened is an archive/compressed file, the archive function (see the ad command above) will be executed instead. Surprise feature! โจ
oc FILE... ๐
Interactively change file ownership.
A new prompt is displayed using the user and primary group common to all files passed as parameters as ownership template. Teamwork, but for permissions. ๐ซถ
Ownership (both user and primary group, if specified) is changed for all files passed as parameters. If the file is a symbolic link, the operation is performed on the target file, and not on the symbolic link itself. And bear in mind: recursion is not supported โ use chown(1) (with the -R option) instead.
โ ๏ธ Not recursive, bestie. Don't assume it'll go digging through your whole tree, because it will not. ๐ณ๐ซ
Both names and ID numbers are allowed (Tab completion for names is available). โจ
If only a name/number is entered, it is taken as the user who owns the file(s).
Use the pc command to edit file permissions. (Sibling command, different job. ๐)
opener [default | APPLICATION] ๐
With no argument, prints the currently used file opener (by default, Lira, clifm's built-in opener). Otherwise, set APPLICATION (say rifle or xdg-open) as opener or, if default is passed instead, use Lira. Pick your fighter. ๐
ow FILE [APPLICATION] ๐ฆ
If APPLICATION is specified, open FILE with APPLICATION. In case you need to add parameters to APPLICATION, it is recommended to quote the expression: ow FILE "APP ARG...".
If APPLICATION is not specified, the list of available applications associated to FILE (either via its MIME type or its file extension) is printed, allowing the user to choose one of these applications, and then open the file with the selected application. A whole menu of options, and you get to pick. Menu-era energy. ๐
This command supports tab completion. Type ow FILE <TAB> and the list of applications able to open FILE will be displayed. ๐
Okay bestie, we're back and we're doing file inspection now. Buckle up ๐
p, pp, prop FILE... โ prints the properties of FILE. The output is lowkey giving "ls -l and stat had a baby" โ it's like the combined output of those two shell commands.
By default, directory sizes are not shown. Use pp instead of plain p if you want directory sizes too (heads up: it could take longer, depending on how much stuff is in that directory). But flip side, and unlike p, pp gives you info about the dereferenced symlinks โ meaning the symlink target โ instead of the symlink itself. That said, plot twist for symbolic links to directories: p will give you info about the link target if the filename you passed ends with a slash. Otherwise you get info about the link itself. ๐
The time format used for all the time info is customizable via the PTimeStyle option in the configuration file. It defaults to "%Y-%m-%d %H:%M:%S.%N %z", where %N stands for nanosecond precision. Yeah. Nanoseconds. She's precise. ๐
If you need to list properties of all the files in the current directory, try the long view (ll or Alt+l). The fields shown in that mode can be customized with the PropFields option in the configuration file. And for custom timestamp formats, use the TimeStyle option.
Want more tea about file details? Consult the file-details help topic: help file-details. ๐ซถ
pc FILE... โ interactively change file permissions. (Only traditional Unix permissions are supported, no cap.)
A new prompt pops up using the actual permissions of the file you're editing โ in symbolic notation โ as the template. If you're editing multiple files with different sets of permissions, only the shared permission bits get set in the permissions template. Sharing is caring โจ
Bear in mind that if you edit multiple files at once โ say pc sel or pc *.c โ the new permissions set gets applied to all of them. All of them. Every single one. No takebacks.
Both symbolic and octal notation are allowed for the new permissions set. Slay.
Recursively setting file permissions is not supported. Usechmod(1)with the-Rflag instead. That's the whole vibe.
If all you need is to toggle the executable permission bit on a file, you can use the te command. And use the oc command to edit file ownership.
pf, profile [ls, list | set, add, del PROFILE | rename PROFILE NEW_NAME] โ with no arguments, this prints the name of the currently used profile. Use the ls or list option to see what profiles are available. Wanna switch, add, delete, or rename a profile? That's set, add, del, and rename respectively. Simple as.
pg, pager [on | off | once | status | NUM] โ run or set Mas, clifm's built-in file pager. ๐
With no parameter, it just runs the pager (Alt+0 is also available, iykyk).
- Set it to
onand the pager runs whenever the list of files doesn't fit on the screen. - Set it to any positive integer greater than 1 to run the pager whenever the number of files in the current directory is greater than or equal to that value โ say
1000. (0amounts tooff, and1amounts toon.) - Set it to
onceto run the pager only a single time (this overwrites whatever its previous value was).
While you're paging, here's your key arsenal:
?,h: Help- Down arrow, Enter, Space: Advance one line
- Page down: Advance one page
q: Stop paging (without printing remaining files)c: Stop paging (printing remaining files)
Note: to scroll lines up, use whatever your terminal emulator has to offer (like mouse scrolling or some keybinding). Not our department, bestie.
By default the pager lists files using the current listing mode (long or short). Use PagerView in the configuration file (or --pager-view on the command line) to force a specific mode. Possible values:
auto: use the current listing mode (this is the default)long: list files in long viewshort: list files in short view
pin [FILE/DIR] โ pin a file or directory so you can grab it later via the comma (,) keyword. For example, run pin mydir and then access mydir like this: cd , โ the comma automatically expands to the pinned file, which in this case is mydir. And the comma keyword works with any command, internal or external, e.g. ls ,. Versatile queen. ๐
With no arguments, pin prints the current pinned file, if there is one. If you give it an argument, that's taken as the filename to pin. Run it again and it frees the previous pinned file and sets a new one. In other words: only one pin at a time. Monogamous pinning.
An easy alternative if you want as many pins or shortcuts as you want, however you want them, is to use the alias function. Bookmarks could also get you a very similar result.
At program exit, the pinned file gets written to a file in the configuration directory (as .pin) so it can be loaded in the next session. She remembers. ๐
prompt [set NAME | list | edit [APP] | unset | reload] โ manage clifm's prompts. Use the set subcommand to temporarily change the current prompt to the prompt named NAME (and use unset to unset the current prompt and go back to the default one). The available prompts โ which you can list with prompt list or prompt set <TAB> โ are defined in the prompts file ($HOME/.config/clifm/prompts.clifm). To set a prompt permanently, edit your color scheme file (via the cs edit command) and set Prompt to either a prompt code or a prompt name (as defined in the prompts file).
q, quit, exit โ quit clifm. Bye bestie ๐
rf, refresh โ refresh the screen, meaning it reprints the files in the current directory and updates the prompt. And if the current directory isn't accessible for any reason, rf will go up and up until it finds one that is accessible, and then it changes to that directory. Self-preservation icon. โจ
rl, reload โ reload all settings from the configuration file, except those that were passed as command-line arguments. Those stay. Periodt.
rr [DIR] [EDITOR] โ remove files and/or directories in bulk using a text editor. Chaotic but efficient, honestly iconic.
rr writes all the filenames in DIR (or in the current directory if DIR is omitted) to a temporary file and opens it using EDITOR โ or the default associated application for the text/plain MIME type, if EDITOR is omitted.
Once you're in the editor, delete the lines corresponding to the files you want to delete. Save your changes and close the editor. The removed files will be listed and you'll be asked for confirmation. Safety first, always. ๐ซถ
s, sel [--invert] FILE... [(!)PATTERN] [-(d|f|l|s|p|b|c)] [:PATH] โ mark one or more files (regular files or directories) as selected (a.k.a. send them to the Selection Box). sel accepts individual elements, ranges of elements โ say 1-6 โ filenames and paths, plus wildcards (globbing) and regular expressions. For example: s 1 4-10 ^r file* filename /path/to/filename.
If you're not in light mode, once a file is selected โ and if that file is in the current directory โ the corresponding filename gets highlighted with a mark at the left of the filename (and at the right of its ELN). The mark is colored according to the value of li in the color scheme file (by default, bold green). ๐
Just like in the search function, you can further filter the list of matches by indicating the file type you want. For instance, s ^ -d will select all directories in the current directory. For the available file type filters, see the search function above.
By default, the selection function operates on the current working directory. To select files in any other directory, use the :PATH expression. For example, to select all regular files with a .conf extension in the /etc directory, the command would be: s .*\.conf$ -f :/etc, or using wildcards: s *.conf -f :/etc. And of course, you can also just do s -f /etc/*.conf.
Just as with the search function, inverse matching is supported for patterns โ wildcards or regular expressions. To invert the meaning and action of a pattern, prepend an exclamation mark (!). E.g., to select all non-hidden regular files in the Documents directory, issue this command: s !^. -f :Documents. Or, to select all directories in /etc except those ending with .d: s !*.d -d :/etc.
Glob and regular expressions can be used together. For example: s ^[r|R].*d$ /etc/*.conf will select all files starting with either r or R and ending with d in the current directory, plus all .conf files in the /etc directory. However, this use is discouraged if both patterns refer to the same directory, since the second one will probably override the result of the first one. ๐ญ
It is important to note that glob expressions are evaluated before regular expressions โ in such a way that any pattern that could be understood by both kinds of pattern matching mechanisms will be evaluated first according to the former, that is, as a glob expression. For example, .*, as a regular expression, should match all files. But since glob expressions are evaluated first, it will only match hidden files. To select all files using a glob expression, try ยด.* *ยด, or, with a regular expression: ยด^ยด or ยด(.*?)ยด. The keyboard shortcut Alt+a is also available to perform the same operation.
The Selection Box is accessible from different instances of the program, provided they use the same profile (see the profile command below). By default, indeed, each profile keeps a private Selection Box, and it's therefore not accessible to other profiles. You can nonetheless modify this behavior via the ShareSelbox option in the configuration file. If ShareSelbox is enabled, selected files are stored in /tmp/clifm/username/.selbox.clifm. Otherwise, /tmp/clifm/username/.selbox_profilename.clifm is used (and this is the default).
To invert selected files in the current directory, use the --invert option (or press Shift+Tab). Note that selected files that don't fall under the current directory are not affected.
๐ Operating on selected files ๐
okay bestie, so like โ if you wanna operate on one or more selected files, that's what the sel keyword is for (s: works too, same energy). Wanna print the file properties of literally every selected file? Just hit p sel (or p s:). And if you wanna see what's selected, s:<TAB> lists them for you โ and yes, multi-selection is available if you're running in fzf mode. ๐
โจ Listing selected files โจ
To list selected files use the sb command (standing for Selection Box). You can also type s:<TAB> and get the same little treat. ๐
โจ Deselecting files โจ
To deselect files use the ds command (see above, bestie). You can also press Alt+d to deselect all the files at once โ one tap, clean slate. ๐ฆ
Note: If there is a file namedselin the current directory, use./selto distinguish it from theselkeyword. For example, enterp ./selto tell clifm that you want to get the properties of the file namedselrather than the properties of the currently selected files. (the ambiguity is real, don't let it catch you slippin')
For more information consult the BUILT-IN EXPANSIONS section below. ๐
sb, selbox
Print the elements currently contained in the Selection Box. That's it, that's the whole job, and it does it flawlessly. โจ
st, sort [METHOD] [rev]
With no argument, print the current sort order. Else, sort files by METHOD, where METHOD is one of: 0=none, 1=name, 2=size, 3=atime, 4=btime, 5=ctime, 6=mtime, 7=version, 8=extension, 9=inode, 10=owner, 11=group, 12=blocks, 13=links, or 14=type (e.g., st atime or st 3). Methods 10 and 11 sort by owner and group ID names if using ID names in long view (see the PropFields option in the configuration file). Else, ID numbers are used. The default order is version. ๐
By default, files are sorted from less to more (e.g., from ยดaยด to ยดzยด if sorting by name). Use the rev subcommand to invert this order. E.g., st rev or st inode rev. Switch back to the previous state by running st rev again. ๐
Take a look at the configuration file for extra sort options (ListDirsFirst, PrioritySortChar, ShowHiddenFiles).
stats
Print file statistics for files in the current directory (not available in light mode, sorry bestie ๐ญ).
t, trash [FILE... | ls, list | clear, empty | del [FILE]...]
Move specified files to the trash can (e.g., t file1 file2). ๐๏ธโจ
With no argument (or by passing the ls option), it prints the list of currently trashed files. The clear (or empty) subcommand removes all files from the trash can, while the del subcommand lists trashed files allowing the user to permanently remove one or more trashed files. If using del, tab completion to list/select currently trashed files is available. ๐ซถ
The trash directory is $XDG_DATA_HOME/Trash, falling back to $HOME/.local/share/Trash. To set an alternative trash directory use the -T/--trash-dir command-line option.
Since this trash system follows the Freedesktop specification, it is able to handle files trashed by different Trash implementations. interoperability, we love to see it ๐
To restore trashed files (to their original location) see the untrash command below.
tag [add | del | list | list-full | new | merge | rename | untag] [FILE]... [[:]TAG]
tag is the main Etiqueta command, clifm's built-in file-tagging system. See the FILE TAGS section for a complete description of this command. ๐ท๏ธ
te FILE...
Toggle the executable bit (on user, group, and others) on FILE(s). It is equivalent to the -x and +x options for the chmod(1) command. ๐ฅ
tips
Print the list of clifm tips. Little gift, every time. ๐
u, untrash [*, a, all | FILE]...
If filenames are passed as parameters, restore them to their original location. Otherwise, this function prints a list of currently trashed files allowing the user to choose one or more of these files to be restored. Use the *, a or all parameters to restore all trashed files at once. Tab completion to list/select currently trashed files is available. ๐
unpin
This command takes no argument. It just frees the current pin and, if it exists, deletes the .pin file generated by the pin command. ๐โก๏ธ๐ซ
vv FILE... DIR
Copy FILE(s) to DIR and bulk rename them at once. bulk rename! at once! โจ
ver, version
Show clifm version details. ๐
view [edit [APP] | purge]
Preview files in the current directory (full screen). Requires fzf(1). Alt+- is also available. ๐
By pressing Enter or Right, the currently highlighted file will be selected and view closed. To select multiple files, mark them with the TAB key and then press Enter or Right to confirm. To quit view press Escape or the Left arrow key.
Run view purge to purge the thumbnails directory ($XDG_CACHE_HOME/clifm/thumbnails) of dangling thumbnails. ๐งน
To edit the previewer configuration file enter view edit, or view edit vi to open it with a specific application, in this case, vi(1).
For image previews consult the Wiki (https://github.com/leo-arch/clifm/tree/master/misc/tools/imgprev) or enter help image-previews. ๐ผ๏ธ
For further information consult the SHOTGUN section below.
ws [NUM/NAME | unset | + | -]
Clifm offers up to eight workspaces, each with its own independent path. ๐๏ธโจ
With no argument, the ws command prints the list of workspaces and its corresponding paths, highlighting the current workspace.
Use NUM to switch to the workspace number NUM, NAME to switch to the workspace named NAME, the plus sign (+) to switch to the next workspace, and the minus sign (-) to switch to the previous workspace.
To unset a workspace use the unset subcommand preceded by the workspace (either number or name) to be unset. For example: ws 2 unset.
Four keyboard shortcuts are available to easily switch workspaces: Alt+[1-8].
Every time an empty workspace is created, it starts in the current working directory.
Though by default workspaces are unnamed, you can name them however you like using the WorkspaceNames option in the configuration file. ๐ท๏ธ
Use autocommands to persistently set options per workspace, for example, to always list files in the third workspace in long view. See the AUTOCOMMANDS section below for more information.
Make local settings private to the current workspace by setting the PrivateWorkspaceSettings option to true in the configuration file: settings changed via either the command line or keyboard shortcuts (say Alt+l, to toggle the long view) will apply only to the current workspace and will be remembered even when switching workspaces. ๐
To directly operate on a workspace (namely, the path it points to) you can use the w: prefix followed by a workspace number or name. For example, to copy all .png files in the current directory to the third workspace, enter c *.png w:3. Press TAB immediately after w: to get the list of available workspaces. ๐
x, X [DIR]
Open DIR, or the current working directory if DIR is not specified, in a new instance of clifm (as root if X, as the current unprivileged user if x) using the value of TerminalCmd (from the configuration file) as terminal emulator. If this value is not set, xterm will be used as fallback terminal emulator. This function is only available for graphical environments. ๐ฅ๏ธ
โจ Shell built-in implementations โจ
These are the lil shell built-ins clifm has got baked in, no cap. ๐ง
pwd [-LP]
Print the current working directory. ๐
export NAME=VALUE...
Export variables to the environment. ๐
umask [VALUE]
Print/set the current umask value. ๐ญ
unset NAME
Remove a variable from the environment. ๐จ
๐ 5. FILE FILTERS ๐
okay bestie, clifm hands you multiple ways to filter the current list of files, and honestly the flexibility is giving main character energy ๐
- a) Hidden files โ you do this via the
-Aand-acommand-line flags, thehhcommand, and theAlt+.keybinding. โจ
Files listed in a file named .hidden in the current directory will be hidden as well whenever hidden files are not shown (wildcards are supported).
- b) Directories โ via the
--only-dirscommand-line switch and theAlt+,keybinding. ๐ - c) Filenames and file types โ either via a regular expression or a file type character (see below) using the
ftcommand (theFilteroption in the configuration file and theCLIFM_FILTERenvironment variable are also available). For example, to exclude backup files (ending with a tilde):
CLIFM_FILTER=ยด!.*~$ยด clifm
or (in the configuration file):
Filter="!.*~$"
or (via the ft command):
ft !.*~$
See the ft command for a few more examples. ๐
- d) Filtering files via the
TABkey โ ๐ฆ
You can filter files by name using wildcards. For example: p *.mp3<TAB> (or /*.mp3<TAB>) to get a list of MP3 files in the current directory.
Files can also be filtered by MIME-type using the @ prefix. Type @<TAB> to list all MIME-types found in the current directory, or @query<TAB> to list all files whose MIME-type includes the string "query". For example, @image<TAB> will list all files in the current directory whose MIME type includes the string "image".
Finally, files can be filtered as well by file type using the = prefix followed by a file type character (see below). For example, =l<TAB> to get a list of symbolic links in the current directory.
Note: If using tab completion in fzf mode, multi-selection is allowed (except in the case of @<TAB>). ๐ญ no group-grab for the MIME-type one, sorry bestie
Available file type characters: ๐
bโ Block devicescโ Character devicesCโ Files with capabilities (1)(2)dโ DirectoriesDโ Empty directoriesfโ Regular filesFโ Empty regular filesgโ SGID files (2)hโ Multi-hardlink files (directories excluded)lโ Symbolic linksLโ Broken symbolic linksoโ Other-writable files (2)pโ FIFO/pipes (2)sโ Sockets (2)Oโ Doors (Solaris only)Pโ Event ports (Solaris only)tโ Files with the sticky bit set (2)uโ SUID files (2)xโ Executable files (2)
(1) Only for tab completion (2) Not available in light mode
- e) Grouping files (via automatic expansion) โ ๐ซถ
By means of the above features, you can easily group and operate on groups of files. For example, this command:
vt b: @image =x sel t:work *.txt
opens a virtual directory (see the VIRTUAL DIRECTORIES section below) automatically expanding the above expressions as follows:
b:โ All your bookmarks (paths)@imageโ All image files (CWD)=xโ All executable files (CWD)selโ All selected filest:workโ All files tagged as work*.txtโ All.txtfiles (CWD)
likeโฆ one line and you just summoned six whole groups of files?? ate, no crumbs ๐ฅ
โจ๏ธ 6. KEYBOARD SHORTCUTS โจ๏ธ
The following is the list of default keyboard shortcuts:
okay bestie, time for the keybindings that make you feel like a hacker in a movie ๐ปโจ
Key โ Description
Ctrl+Alt+jโ toggles the vi editing mode, so you can edit like it's 1976 ๐งRight,Ctrl+fโ accepts the current suggestion, like saying "yes queen" to autocomplete ๐Alt+Right,Alt+fโ accepts the first suggested word (up to the first slash or space), so you get a lil piece of the suggestion ๐ฐAlt+cโ clears the current command-line buffer, poof, gone ๐จAlt+qโ deletes the last word (up to the last slash or space), backspace but smarter โจAlt+i,Alt+.โ toggles hidden-files, so you can see the secret stuff ๐Alt+lโ toggles long-view, for when you want all the deets ๐Alt++โ toggles follow-symlinks, so you can chase those links ๐Alt+gโ toggles list-directories-first, because directories are the main characters ๐Alt+,โ toggles list-only-directories, no files allowed ๐ซCtrl+Alt+lโ toggles max-filename-length, so you can decide how much name you can handle ๐Ctrl+Alt+i,Alt+Tabโ toggles disk-usage-analyzer, for when you need to see what's eating your storage ๐Alt+wโ toggles full-path-filenames (virtual directories), so you see the whole path, not just the name ๐ฃ๏ธCtrl+lโ refreshes the screen (reprints the list of files in the current directory), like a lil reset button ๐Alt+tโ clears program messages, so you can start fresh ๐งผAlt+mโ lists mountpoints, so you can see what's mounted where โฐ๏ธAlt+bโ launches the Bookmark Manager, for all your saved faves ๐Alt+hโ shows the directory history, so you can see where you've been ๐ฐ๏ธAlt+nโ creates a new file or directory, because you're a creator ๐Alt+sโ opens the Selection Box, so you can pick and choose ๐Alt+-โ launches the file previewer (theviewcommand), so you can peek before you commit ๐Alt+aโ selects all files in the current directory, select all the things โจAlt+dโ deselects all files, because sometimes you need a clean slate ๐งฝAlt+0โ runs MAS, the file pager, for when you need to page through files ๐Alt+pโ changes to the pinned directory, your home away from home ๐Alt+[1-8]โ switches to workspace 1-8, so you can multitask like a boss ๐ผ
Key โ Description
Alt+/โ bounce to the root directoryAlt+e,Homeโ bounce to the home directoryAlt+u,Shift+Upโ bounce to the parent directoryAlt+j,Shift+Leftโ bounce to the directory you were in before this oneAlt+k,Shift+Rightโ bounce to the next directory in your visit historyCtrl+Alt+oโ switch to the previous profileCtrl+Alt+pโ switch to the next profileCtrl+Alt+aโ archive the selected filesCtrl+Alt+eโ export the selected filesCtrl+Alt+rโ rename the selected filesCtrl+Alt+dโ remove the selected filesCtrl+Alt+tโ trash the selected filesCtrl+Alt+vโ copy the selected files into the current directoryAlt+yโ toggle light-modeAlt+zโ switch to the previous sort methodAlt+xโ switch to the next sort methodAlt+rโ sort in reverse orderCtrl+Alt+xโ launch a brand new instance ofclifmCtrl+yโ copy the contents of the line buffer to the clipboard (1)F1โ go to the manpageF2โ list commandsF3โ list keybindingsF6โ open the MIME list fileF7โ open the shotgun configuration fileF8โ open the current color scheme fileF9โ open the keybindings fileF10โ open the main configuration fileF11โ open the bookmarks fileF12โ quit
(1) bestie this shortcut is bound to the xclip plugin, so it's not just vibing on its own. Peep the PLUGINS section below for the full tea ๐
Customizing keybindings ๐
Okay so everything you just read? That's just the default lineup, gorgeous, but fully changeable. Use the kb bind command to remix them however you want โ head back up to the kb command description for all the deets.
You can also just open the keybindings configuration file and hand-edit it like a scribe โ๏ธ โ that's the kb edit command. The file itself explains how to do it, so read it, it's literally telling you what to do.
Readline keybindings โจ
Readline keybindings for command-line editing โ like Ctrl+a to yeet the cursor to the start of the line, or Ctrl+e to yeet it to the end โ should just work out of the box. No setup, no drama, it's giving plug-and-play ๐
But of course you can customize them if you want. Edit the ~/.config/clifm/readline.clifm file, following the exact same rules readline itself uses for the ~/.inputrc file. Need more? Consult the readline documentation, aka readline(3). It's all there, iykyk ๐ฆ
Keybindings for plugins ๐ง
So here's the exciting part: clifm hands you sixteen customizable keybindings just for your custom plugins. Sixteen!! Custom slots!! For your own little creations!! ๐
Wanna claim one? Here's the procedure, step by step:
- Copy your plugin into the plugins directory (or honestly just use any of the plugins already chillin' in there, they're cute)
๐ธ to be continued...
- Link plugin*x* (where ยด*x*ยด is the plugin number [1-16]) to your plugin using the
actions editcommand. Like, e.g.,"plugin1=myplugin.sh"โ that's the whole vibe. - Set a keybinding for plugin*x* using the
kb editcommand. E.g.,"plugin1:\M-7"and boom, you're wired up. ๐
Kitty keyboard protocol support ๐ฑโจ
The Kitty Keyboard Protocol is a major glow-up over how terminals usually handle keyboard events. It uses CSI u escape sequences and unlocks extra modifier keys like Super, Meta, and Hyper. It's giving upgrade, fr fr.
To enable the Kitty Keyboard Protocol, do this:
- Download the specially crafted keybindings configuration file built to handle CSI u escape sequences (
https://github.com/leo-arch/clifm/blob/master/misc/kitty/keybindings.clifm). - Tell clifm to use this new file instead of the default one (
~/.config/clifm/keybindings.clifm) by using the-kcommand-line switch. Or, alternatively, you can just replace the default file with the new one. Either way works, bestie. - If your terminal isn't already set up to send CSI u sequences, use the
--kitty-keyscommand-line switch.
So tl;dr โ once you've got the replacement keybindings file in place, run this:
clifm -k /path/to/keybindings/file --kitty-keys
Important ๐จ When you're using the Kitty Keyboard Protocol, theCtrl+dshortcut (the one used to quit secondary prompts) will no longer work. Not me losing a whole keybinding ๐ญ. To fix this, add the following line to yourkitty.conffile:map control+d send_text kitty \x04This forces the terminal to emit the old value for this specific key binding, which is the workaround for the issue. Slay.
Troubleshooting ๐ง
Some of these default keybindings may not work on your console/terminal emulator, depending on your system. Here are some genuinely useful tips on that front:
- Haiku terminal: Most of these keybindings will not work on the Haiku terminal, because Alt plays the role Ctrl usually plays on most other systems over there (check the Haiku documentation for the receipts). To fix this, set your custom keybindings.
- Kernel built-in console: Key sequences involving the Shift key (Shift-Up, Shift-Left, and Shift-Right in our case) will simply not work. Use the alternative key sequences instead:
Alt+u,Alt+j, andAlt+krespectively. - NetBSD (wsvt25) and OpenBSD (vt220) kernel consoles: Key sequences involving the Alt key will not work out of the box. Here's how to make them work:
On OpenBSD:
1) Copy /etc/examples/wsconsctl.conf to /etc (if it does not already exist)
2) Add the metaesc flag to your current keyboard encoding. For example: keyboard.encoding=us.metaesc
You may need to reboot the machine for changes to take effect.
On NetBSD:
Add the metaesc flag to your current encoding in /etc/wscons.conf. For example: encoding us.metaesc
You may need to reboot the machine for changes to take effect.
- Konsole: If
Shift+leftandShift+rightare not already bound to any function, you need to bind them manually. Go toSettings -> Edit current profile -> Keyboard -> Default (Xfree4), and add these values:
Left+Shift \E[1;2D
Right+Shift \E[1;2C
If they are already bound, by contrast, you only need to unbind them. Go to "Settings -> Configure keyboard shortcuts", click on the corresponding keybinding, and set it to "Custom (none)".
- Terminology/Yakuake:
Shift+leftandShift+rightare already bound to other functions, so you only need to unbind them or rebind the corresponding functions to different key sequences.
Of course, the above two procedures should be similar in case of keybinding issues in other terminal emulators. iykyk. ๐ซ
If some of these keybindings are already used by your Window Manager, you only need to unbind the key or rebind the corresponding function to another key. Since each Window Manager uses its own mechanisms to set/unset keybindings, you should consult the appropriate manual. No cap.
7. THEMING ๐๐
All customization settings (theming, bestie!) are made from a single configuration file โ the color scheme file โ installed by default in $XDG_DATA_DIRS/clifm/colors (usually /usr/local/share/clifm/colors or /usr/share/clifm/colors), though color scheme files found in $XDG_CONFIG_HOME/clifm/colors (usually $HOME/.config/clifm/colors) take precedence. Your local ones always win, periodt.
Note: Color scheme files are copied automatically to the local colors directory when running the cs edit command.
Each color scheme may include any (or all) of the below options:
FiletypeColorsโ Colors for different file types, such as directory, regular files, and so on. See the COLORS section below.InterfaceColorsโ Colors for clifm's interface, such as ELNs, file properties bits, suggestions, syntax highlighting, etc. See the COLORS section below.ExtColorsโ Colors for files based on filename extensions. See the COLORS section below.DateShadesโ A comma delimited list of colors used to print timestamps (long view). Consult the default color scheme file for more information.SizeShadesโ A comma delimited list of colors used to print file sizes (long view). Consult the default color scheme file for more information.DirIconColorโ Color for the directory icon (when icons are enabled). See the COLORS section below. Only when using icons-in-terminal or Nerfonts (default). If using rather emoji-icons, this option is ignored.Promptโ Define clifm's prompt. See the THE PROMPT section below.DividingLineโ The line dividing the current list of files and the prompt. See the THE DIVIDING LINE below.FzfTabOptionsโ Options to be passed to fzf when using the fzf mode for tab completion, including colors. See the TAB COMPLETION section below.
The color scheme (or just theme) can be set either via the command line (--color-scheme=NAME), via the ColorScheme option in the main configuration file, or using the cs command, for instance, cs mytheme. Enter just cs to list available color schemes (tab completion is available, obviously ๐
). To edit the current color scheme enter cs edit.
1. COLORS ๐จ
If 256 colors support is detected for the current terminal, and not set in any other way (either via the ColorScheme option in the configuration file or the --color-scheme command-line switch), clifm will attempt to load the 256-color version of the default color scheme: default-256. Otherwise, it falls back to the 16 colors version. Fingers crossed for the pretty one ๐ค.
All color codes are specified in the corresponding color scheme file (by default ~/.config/clifm/colors/default.clifm). You can edit this file pressing F8 or entering cs edit.
a. Color codes ๐๏ธ
Colors are specified using the same format used by dircolors(1) and the LS_COLORS environment variable, namely, a colon separated list of codes with this general format: NAME=VALUE, where NAME refers to an interface element, and VALUE to the color to be used by this element.
This is the list of file type codes (you will find them in the FiletypeColors section of the current color scheme file):
di= directoryed= empty directorynd= directory with no read/exec permission (1)fi= regular fileef= empty regular filenf= file with no read permission (1)ln= symlinkmh= multi-hardlink fileor= orphaned or broken symlinkbd= block devicecd= character devicepi= FIFO, pipeso= socketsu= SUID filesg= SGID filetw= sticky and other writable directoryst= sticky and not other writable directoryow= other writable directoryex= executable fileee= empty executable fileca= file with capabilitiesoo= door/port (Solaris only)no= unknown file typeuf= inaccessible files (fstatat(3)error)
(1) If unset, the corresponding file type color is used and an exclamation mark is printed before the filename in the file list (provided icons are disabled -otherwise the lock icon is used- and clifm is not running in light mode -in light mode access checks are not performed). The color used for the exclamation mark is xf (see below).
The following codes are used for different interface elements (in the InterfaceColors section of the current color scheme file):
Suggestions ๐ญ
sb= shell builtinssc= aliases and shell command namessd= internal commands descriptionsf= ELNs, bookmarks, tag, and filenamessh= commands history entriessx= suggestions for clifm's internal commands and parameterssp= suggestions pointer (e.g.,56 > filename, where>is the suggestion pointer)sz= filenames (fuzzy)
Syntax highlighting โจ
hb= brackets ยด()[]{}ยดhc= comments (lines starting with#)hd= slasheshe= expansion chars ยด~*ยดhn= numbershp= option parameters (starting with ยด-ยด)hq= quoted strings (both single and double quotes)hr= process redirection (>)hs= process separators (;&|)hv= variable names (starting with ยด$ยด)hw= Backslash (aka whack)
Prompt elements ๐
li= selected filesti= trash indicatorac= autocommand indicatorem= error message indicatorwm= warning message indicatornm= notice message indicatorro= read-only mode indicatorsi= stealth mode indicatortx= command-line text (regular prompt)
File properties ๐
db= file allocated blocksdd= last access/change/modification time (1)de= file inode number (long view only)dg= group ID (provided the user has access to the file)dk= number of links (long view only)dn= dash (unset property)do= octal value for file propertiesdp= SUID, SGID, sticky bitdr= read permission bitdt= timestamp identification mark (2)du= user ID (provided the user has access to the file)dw= write permission bitdxd= executable permission bit (directories)dxr= executable permission bit (regular files)dz= size (1)
(1) If unset (default), gradient colors are used (based on file size and file age). (2) If unset (default), a dimmed version of the current timestamp color is used.
Note, bestie: for a better graphical representation of file properties, clifm uses 256 colors if it possibly can. If it can't? It falls back to 16 colors. That's it, that's the tea. ๐
๐ Miscellaneous interface elements
okay so these are all the lil interface bits you can paint, and here's what each code means:
fcโ the file counterdfโ default colordlโ dividing lineelโ ELN colorlcโ symbolic link indicator (ColorizeSymlinksAsTargetonly)miโ misc indicators (disk usage, sort method, bulk rename, jump database list)tsโ matching suffix for possible tab completed entriesttโ tilde for truncated filenameswcโ welcome messagewsNโ color for workspace N (1-8)xsโ exit code: successxfโ exit code: failure
๐ b. Supported colors ๐
4-bit, 8-bit (256-color), and 24-bit (true-color) specs are all supported. periodt.
Colors are defined basically as SGR sequences (excluding the initial escape character and the ending m) โ literally the same sequences the LS_COLORS environment variable uses. But listen, there are shortcuts for 8-bit (256-color) and 24-bit (true-color) specs, because typing the long form is giving carpal tunnel. For example:
31 4-bit
38;5;160 8-bit
@160 8-bit (short)
38;2;255;0;0 24-bit
#ff0000 24-bit (short, HEX) (1)
(1) Both three and six digit hexadecimal colors work (lowercase or uppercase, we don't judge). So like, #f00 amounts to #ff0000. ๐
A single attribute can be added to hex colors and 256 colors (in the form @NUM) using a dash and an attribute number (#RRGGBB-[1-9] or @NUM-[1-9]), where 1-9 is:
- Bold or increased intensity
- Faint, decreased intensity or dim
- Italic (Not widely supported)
- Underline
- Slow blink
- Rapid blink
- Reverse video or invert
- Conceal or hide (Not widely supported)
- Crossed-out or strike
Note: some of these attributes may just... not be supported by every terminal emulator out there. Not their fault, not yours. ๐
So for example, bold red in hex is #ff0000-1, while the 256-color version is @160-1. (want more lore on SGR sequences? go read https://en.wikipedia.org/wiki/ANSI_escape_code, iykyk.)
๐ฆ c. Color names ๐ฆ
Xterm-like color names are supported too, bestie. For example: ex=DodgerBlue2.
Here's the whole list of color names (as defined by vifm(1)):
0 Black 86 Aquamarine1 172 Orange3
1 Red 87 DarkSlateGray2 173 LightSalmon3_2
2 Green 88 DarkRed_2 174 LightPink3
3 Yellow 89 DeepPink4_2 175 Pink3
4 Blue 90 DarkMagenta 176 Plum3
5 Magenta 91 DarkMagenta_2 177 Violet
6 Cyan 92 DarkViolet 178 Gold3_2
7 White 93 Purple 179 LightGoldenrod3
8 LightBlack 94 Orange4_2 180 Tan
9 LightRed 95 LightPink4 181 MistyRose3
10 LightGreen 96 Plum4 182 Thistle3
11 LightYellow 97 MediumPurple3 183 Plum2
12 LightBlue 98 MediumPurple3_2 184 Yellow3_2
13 LightMagenta 99 SlateBlue1 185 Khaki3
14 LightCyan 100 Yellow4 186 LightGoldenrod2
15 LightWhite 101 Wheat4 187 LightYellow3
16 Grey0 102 Grey53 188 Grey84
17 NavyBlue 103 LightSlateGrey 189 LightSteelBlue1
18 DarkBlue 104 MediumPurple 190 Yellow2
19 Blue3 105 LightSlateBlue 191 DarkOliveGreen1
20 Blue3_2 106 Yellow4_2 192 DarkOliveGreen1_2
21 Blue1 107 DarkOliveGreen3 193 DarkSeaGreen1_2
22 DarkGreen 108 DarkSeaGreen 194 Honeydew2
23 DeepSkyBlue4 109 LightSkyBlue3 195 LightCyan1
24 DeepSkyBlue4_2 110 LightSkyBlue3_2 196 Red1
25 DeepSkyBlue4_3 111 SkyBlue2 197 DeepPink2
26 DodgerBlue3 112 Chartreuse2_2 198 DeepPink1
27 DodgerBlue2 113 DarkOliveGreen3_2 199 DeepPink1_2
28 Green4 114 PaleGreen3_2 200 Magenta2_2
29 SpringGreen4 115 DarkSeaGreen3 201 Magenta1
30 Turquoise4 116 DarkSlateGray3 202 OrangeRed1
31 DeepSkyBlue3 117 SkyBlue1 203 IndianRed1
32 DeepSkyBlue3_2 118 Chartreuse1 204 IndianRed1_2
33 DodgerBlue1 119 LightGreen_2 205 HotPink
34 Green3 120 LightGreen_3 206 HotPink_2
35 SpringGreen3 121 PaleGreen1 207 MediumOrchid1_2
36 DarkCyan 122 Aquamarine1_2 208 DarkOrange
37 LightSeaGreen 123 DarkSlateGray1 209 Salmon1
38 DeepSkyBlue2 124 Red3 210 LightCoral
39 DeepSkyBlue1 125 DeepPink4_3 211 PaleVioletRed1
40 Green3_2 126 MediumVioletRed 212 Orchid2
41 SpringGreen3_2 127 Magenta3 213 Orchid1
42 SpringGreen2 128 DarkViolet_2 214 Orange1
43 Cyan3 129 Purple_2 215 SandyBrown
44 DarkTurquoise 130 DarkOrange3 216 LightSalmon1
45 Turquoise2 131 IndianRed 217 LightPink1
46 Green1 132 HotPink3 218 Pink1
47 SpringGreen2_2 133 MediumOrchid3 219 Plum1
48 SpringGreen1 134 MediumOrchid 220 Gold1
49 MediumSpringGreen 135 MediumPurple2 221 LightGoldenrod2_2
50 Cyan2 136 DarkGoldenrod 222 LightGoldenrod2_3
51 Cyan1 137 LightSalmon3 223 NavajoWhite1
52 DarkRed 138 RosyBrown 224 MistyRose1
53 DeepPink4 139 Grey63 225 Thistle1
54 Purple4 140 MediumPurple2_2 226 Yellow1
55 Purple4_2 141 MediumPurple1 227 LightGoldenrod1
56 Purple3 142 Gold3 228 Khaki1
57 BlueViolet 143 DarkKhaki 229 Wheat1
58 Orange4 144 NavajoWhite3 230 Cornsilk1
59 Grey37 145 Grey69 231 Grey100
60 MediumPurple4 146 LightSteelBlue3 232 Grey3
61 SlateBlue3 147 LightSteelBlue 233 Grey7
62 SlateBlue3_2 148 Yellow3 234 Grey11
63 RoyalBlue1 149 DarkOliveGreen3_3 235 Grey15
64 Chartreuse4 150 DarkSeaGreen3_2 236 Grey19
65 DarkSeaGreen4 151 DarkSeaGreen2 237 Grey23
66 PaleTurquoise4 152 LightCyan3 238 Grey27
67 SteelBlue 153 LightSkyBlue1 239 Grey30
68 SteelBlue3 154 GreenYellow 240 Grey35
69 CornflowerBlue 155 DarkOliveGreen2 241 Grey39
70 Chartreuse3 156 PaleGreen1_2 242 Grey42
71 DarkSeaGreen4_2 157 DarkSeaGreen2_2 243 Grey46
72 CadetBlue 158 DarkSeaGreen1 244 Grey50
73 CadetBlue_2 159 PaleTurquoise1 245 Grey54
74 SkyBlue3 160 Red3_2 246 Grey58
75 SteelBlue1 161 DeepPink3 247 Grey62
76 Chartreuse3_2 162 DeepPink3_2 248 Grey66
77 PaleGreen3 163 Magenta3_2 249 Grey70
78 SeaGreen3 164 Magenta3_3 250 Grey74
79 Aquamarine3 165 Magenta2 251 Grey78
80 MediumTurquoise 166 DarkOrange3_2 252 Grey82
81 SteelBlue1_2 167 IndianRed_2 253 Grey85
82 Chartreuse2 168 HotPink3_2 254 Grey89
83 SeaGreen2 169 HotPink2 255 Grey93
84 SeaGreen1 170 Orchid
85 SeaGreen1_2 171 MediumOrchid1
Just like with hex colors, you can stick a single attribute onto a color name too. For example, SteelBlue1-1 gets you the bold version of that color. slay. โจ
๐ d. Color variables ๐
You can have up to 128 custom color variables, declared with the define keyword, so your theme files are easier to build and actually readable. Example:
define FTYPE_DIR=31
define IFACE_ELN=4;38;2;255;255;0;48;2;0;14;191
FiletpeColors="di=FTPYE_DIR:"
InterfaceColors="el=IFACE_ELN:"
Heads up though: these variables can only be used for FiletypeColors, InterfaceColors, ExtColors, and DirIconColor. The Prompt line (if you're using a prompt code) uses full SGR sequences or prompt-specific color codes instead. No shortcuts there, sorry babe. ๐ญ
โญ e. Examples โญ
A few examples to put all this together, bestie:
fi=4;31 (regular files are 4-bit underlined red)
di=@33-1 (directories are 8-bit bold light-blue)
ln=#5fd7ff (symbolic links are 24-bit light cyan)
so=Yellow3 (socket files are Yellow3)
More complex combos can be achieved using complete SGR sequences (say, if you wanna add a background color). E.g.,
fi=4;38;2;245;76;48;2;0;0;255
will print regular files underlined and using a bold orange color on a blue background. In this case, just make sure to use a terminal emulator that supports true colors, otherwise it's giving ๐. To test your terminal's color capabilities use the colors.sh script (it lives in the plugins directory).
Note: sometimes โ for some reason โ you might need to forceclifmto use colors despite whatever theTERMvariable says. Like, the OpenBSD console setsTERMtovt220by default, which, according to the terminfo database, doesn't support color. But plot twist: the OpenBSD console does actually support color. In that case, you can set theCLIFM_FORCE_COLORa specific value even if the value ofTERMsays otherwise. Supported values are:8,16,256,truecolor(or24bit).
To see a colored list of the currently used colors, run the cs preview command. ๐
To run without colors use the --no-color command-line option, or set either the CLIFM_NO_COLOR or NO_COLOR environment variables to any value. Wanna read up on the whole no-color initiative? It's at https://no-color.org/ ๐
And for a full no-color experience, bestie, remember to edit your prompt and strip out all the color codes. Fr fr.
โจ 2. THE PROMPT โจ
๐ธ 2.a. Description ๐ธ
Clifm's prompt gets pulled from the Prompt line in the color scheme file, and it references a prompt name defined in the prompts file. Like, for example, Prompt="security-scanner".
Every prompt is built using basically the same escape codes and rules the Bash prompt uses, with one exception: it does not accept shell functions (so no conditionals, no loops, sorry babe ๐ญ). But you can use command substitution (written as $(cmd)), prompt modules (written as ${module}), color codes (written as %{color}), string literals, and escape sequences to build your prompt. Slay.
Go look at the prompts file (just run prompt edit) for the detailed tea and examples on how to build one. ๐
By default, for instance, clifm's prompt line is this:
"%{reset}\I[\S%{reset}]\l \A \u:\H %{cyan}\w%{reset}\n<\z%{reset}> %{blue}\$%{reset} "
which, once decoded, should look something like this:
[1] 13:45 user:hostname /my/path
<0> $
with the workspace number printed in blue, the path in cyan, the last exit status in green (or red if there was an error), and the dollar sign in blue. Iconic.
Wanna go more "classic" with it? You can generate that like this:
"\u@\U \w> "
or, using command substitution now:
"$(whoami)@$(hostname) $(pwd)> "
๐ 2.b. Prompt notifications ๐
A bold red R hanging out at the left of the prompt is clifm reminding you that the program is running as root. A bold green S means there are elements sitting in the Selection Box. In the same way, a cyan T means there are currently files in the trash can, and a bold blue S means the program is running in stealth mode. ๐ฅท
And finally, clifm uses three kinds of messages: errors (a red E at the left of the prompt), warnings (a yellow W), and simple notices (a green N).
If Notifications is set to false in the prompts file, none of those notifications will be printed by the prompt โ but they're still available to you as escape codes (see above) and environment variables (see the ENVIRONMENT section below) so you can build your own custom prompts. ๐
๐ 2.c. The Warning Prompt ๐
The suggestions system comes with a secondary, warning prompt, used to highlight wrong/invalid/non-existent command names. Once you enter an invalid command, the regular prompt switches over to the warning prompt. Not me getting caught slipping ๐
The wrong-command-name check is omitted if the input string:
- Is quoted (e.g.,
"string"or'string') - Is bracketed (e.g.,
(string),[string], or{string}) - It starts with a stream redirection character (e.g.:
<stringor>string) - Is a comment (e.g.,
#string) - It starts with one or more spaces
- Is an assignment (e.g.,
foo=var) - It is escaped (e.g.,
\string)
You can customize the warning prompt using the exact same rules as the regular prompt. To use a custom one, just modify the WarningPrompt line in the prompts file (via the prompt edit command). It defaults to
"%{reset}%{b:red}(!)%{n:dim} > "
and the last line of the regular prompt becomes "(!) > ", with "(!)" printed in bold red. ๐ฅ
To disable this whole feature, use the --no-warning-prompt command-line switch, or set the EnableWarningPrompt option to false in the prompts file.
Note: keep in mind that the warning prompt depends on the suggestions system, so it will not be available if that system is disabled.
๐ฆ 2.d. The Right Prompt ๐ฆ
The right prompt is literally just like the regular prompt, except it's printed on the right side of the screen. Main character energy, honestly.
Use the RightPrompt option in the prompts file to set one. For a concrete usage example, peep the info prompt in the prompts file.
A few caveats though, bestie:
- Right prompts only work with multiline regular prompts (if your regular prompt is a single line, the right prompt is not printed).
- Multiple lines are not supported by right prompts (only the first line will be printed).
- If the decoded right prompt exceeds the number of available terminal columns, the prompt is not printed.
๐ 3. THE DIVIDING LINE ๐
That's the line dividing the current list of files and the prompt. You can customize it with the DividingLine option in the color scheme file, so it matches your prompt design and/or color scheme. ๐
DividingLine accepts one or more ASCII or Unicode characters (in both cases you only need to type/paste the character(s) you picked). If you specify just one character (by default, -), it gets printed over and over to fill the current line all the way up to the right edge of the screen or terminal window. But if you don't want it covering the whole line, specify two or more characters โ in that case only those characters (and no more) get used as the dividing line. For example: "------->". ๐น
Wanna use an empty line? Set DividingLineChar to "0" (that's as a character, not as a number, okay?). And finally, if this value isn't set at all, a special line drawn with box-drawing characters gets used (heads up: box-drawing characters aren't supported by all terminal emulators).
The color of this line is set via the dl color code in the color scheme file. Consult the COLOR CODE section above for more info. โจ
โญ 4. FZF WINDOW โญ
Refer to the TAB COMPLETION section below. That's it, that's the section. ๐
๐ 8. BUILT-IN EXPANSIONS ๐
๐ 1. ELNs ๐
A number representing the Entry List Number (ELN) of a listed file is expanded to its corresponding filename. You can type ELN<TAB> to convert the ELN into the filename. ELN ranges are supported too. For example, t 1-3 10 24 will move the files with ELNs 1 through 3, 10 and 24 to the trash. ๐๏ธ
Bear in mind that ELNs will only be expanded provided some filename is listed on the screen under the corresponding numbers.
For example: diff 1 118 will only expand '1', but not '118', if there is no ELN 118. In the same way, the range 1-118 will only be expanded provided there are 118 or more filenames listed on the screen. And note that the second field of a range can be omitted, in which case the ELN of the last listed file is assumed (e.g., provided there are 100 listed files, 12- is equivalent to 12-100). โจ
Since ranges can be a bit tricky, tab completion is available to make sure the range actually includes the filenames you wanted. ๐ซถ
If this feature somehow conflicts with the command you want to run โ say, chmod 644 ... โ because the current number of files is equal to or larger than 644 (in which case clifm will expand that number ๐ญ), then you can simply run the command as external: ;chmod 644 ...
๐ 2. Selected files ๐
The s: prefix expands to all selected files (as absolute paths). To get the list of selected files, type s:<TAB>. The sel keyword can be used as well, but, unlike s:, it can only be used after the first word, i.e., as a command parameter. For example, m sel (or m s:) will move all selected files to the current directory. To trash or remove selected files, simply run t sel or r sel respectively. Easy. ๐
๐ 3. Bookmarks ๐
The b: prefix expands to all bookmarked files (as absolute paths). Enter b: followed by a bookmark name to expand to the absolute path referred to by that bookmark. To get the list of available bookmarks, type b:<TAB>. For example, p b:work will print the file properties of the bookmark named work. ๐ฆ
๐ธ 4. Tagged files ๐ธ
The t: prefix is used to access tagged files. Type t:<TAB> to get the list of available tags. Type t:TAG<TAB> to get the list of files tagged as TAG. t:TAG expands to all files tagged as TAG (as absolute paths). For example, s t:old will select all files tagged as "old". Obsessed. ๐
๐ 5. Workspaces ๐
The w: prefix expands to a specific workspace (as absolute path). For example, c sel w:3 will copy all selected files to the third workspace. โจ
โญ 6. File types โญ
The = (equal) prefix is used to filter files according to their type. Type =<TAB> to get the list of available file types in the current directory. Also, type =x<TAB> to get the list of executable files in the current directory. For example, r =D =F =L will remove all empty directories, empty regular files, and broken symbolic links in the current directory. ๐
๐ง 7. MIME types ๐ง
The @ (at sign) prefix is used to filter files according to their MIME type. Type @<TAB> to get the list of MIME types available in the current directory. For example, br @image will bulk rename all files in the current directory whose MIME type includes the word "image". ๐ฅ
๐ 8. Pinned directory ๐
A single comma (,) expands to the currently pinned directory (see the pin command for more information). For example, the command c =o , will copy all other-writable files in the current directory to the pinned directory. ๐
๐ 9. Parent directories ๐
Via the fastback function, you can quickly change to any parent directory using a series of dots. A single dot (.) refers to the current directory, and two dots (..) refer to the parent directory. This pattern continues, so three dots (...) refer to the parent of the parent directory, four dots (....) refer to the parent of the parent of the parent directory, and so on. In general, n dots refer to the nth level of parent directories. โจ
Needless to say, combinations are possible. ๐
For example, the command c sel b:work @image =L 1-3 , will copy all selected files, the bookmark named work, all images, broken symbolic links in the current directory, and files with ELNs 1 through 3 to the pinned directory. Ate and left no crumbs, honestly. ๐
Note: If using thefzfmode for Tab completion (which is the default), you can operate on some files of any of these groups of files using theTABkey to mark files in the list. For example, you can typeCMD sel<TAB>to get the list of selected files, then use theTABkey to mark the desired files. PressEnterorRightto insert the marked files into the current command line. ๐ซถ
9. TAB COMPLETION ๐
okay bestie, listen, tab completion here comes in four modes and you're gonna be obsessed:
standardโ the interface provided byreadlinefzfโ depends onfzf(https://github.com/junegunn/fzf) (version 0.18.0 or later)fnfโ (https://github.com/leo-arch/fnf)smenuโ (https://github.com/p-gen/smenu)
By default, if any of fzf, fnf, or smenu (in this order) is installed (found in $PATH), clifm will attempt to use the corresponding mode to display completions. You can force the use of a specific mode with --tabmode=[fzf|fnf|smenu|standard]. The TabCompletionMode option in the configuration file can be used to permanently set the tab completion mode.
If using the fzf mode, the completions interface can be customized using the FzfTabOptions option in the color scheme file. --height, --margin, +i/-i, --read0, --query, and --ansi will be appended to set up some details of the completions interface. Set this value to none to pass no option, to the empty string to load the default values, or to any other custom value. Unless set to none, any option specified here will override FZF_DEFAULT_OPTS.
Default values for this option are:
--color=16,prompt:6,fg+:-1,pointer:4,hl:5,hl+:5,gutter:-1,marker:2,border:7:dim
--bind tab:accept,right:accept,left:abort,alt-p:toggle-preview
--inline-info --layout=reverse-list --preview-window=wrap,border-
left
Consult fzf(1) for more information.
If set neither in FzfTabOptions nor in FZF_DEFAULT_OPTS (in this order), the height of the fzf window is set to the default value: 40% of the current terminal number of line/rows.
To use fzf global values (defined in FZF_DEFAULT_OPTS), set FzfTabOptions to none.
File previews are available in fzf mode via shotgun. See the SHOTGUN section above.
Image previews are available via the clifmimg plugin. Run help image-previews for more information.
If using the smenu mode, the interface can be customized using the CLIFM_SMENU_OPTIONS environment variable. For example:
export CLIFM_SMENU_OPTIONS="-a t:2,b b:4 c:r ct:2,r sf:6,r st:5,r mt:5,b"
Consult smenu(1) for more information.
For information about how to customize fnf consult fnf(1).
Clifm can perform fuzzy tab completion (just as suggestions) for filenames and paths (e.g., "dwn" is completed/suggested as "Downloads"). To enable this feature use the --fuzzy-matching command-line switch or set FuzzyMatching to true in the configuration file.
10. FILE OPENER ๐ซถ
As clifmยดs built-in file opener, Lira takes care of opening files when no opening application has been specified in the command line (or when running as a standalone file opener, via the --open command-line switch). It does this by automatically parsing a MIME list file (see the FILES section below): it looks first for a matching pattern (either a MIME type or a filename), then checks the existence of the command associated to this pattern, and finally executes it.
Lira is controlled using the mime command. File associations are stored in the MIME list file and can be edited using the mime edit command.
When running for the first time, or whenever the MIME list file cannot be found, clifm will copy the MIME definitions file from the DATADIR directory (usually /usr/share/clifm/mimelist.clifm) to the local configuration directory.
Lira will check the file line by line, and if a matching line is found, and if at least one of the specified applications exists, this application will be used to open the corresponding associated file. Else, the next line will be checked. In other words, the precedence order is top to bottom (for lines) and left to right (for applications).
Note: In case of directories (whose MIME type isinode/directory), the entry will be used only for theopen-withcommand (ow).
A note about MIME types ๐ง
File MIME types are determined using libmagic โthe same library used by file(1)โ, which, although highly reliable, is not bullet-proof. Sometimes it fails, either because the appropriate MIME type is not in its database, or because the database is just wrong. In either case, you can manually map file extensions to MIME types using a specific file: ~/.config/clifm/mime.types or ~/.mime.types.(1)
For example, libmagic knows nothing about ILBM image files, and returns application/zip for OpenRaster images. Create ~/.config/clifm/mime.types with the following content:
image/x-ilbm iff lbm
image/openraster ora
Restart clifm and these MIME types will be immediately associated to all files having the specified extensions (to test it, run mm info on any of these files).(2)
If required, edit the mimelist and the preview files (mm edit and view edit, to specify how files are opened and previewed respectively), and add a new line handling the corresponding MIME types (e.g., "image/x-ilbm=APP" and "image/openraster=APP"). See below for more information.
(1) To use a custom location, set $CLIFM_MIMETYPES_FILE to the desired file path: e.g., CLIFM_MIMETYPES_FILE=/etc/mime.types clifm. Note that Shared MIME-info XML files are supported as well: e.g., CLIFM_MIMETYPES_FILE=/usr/share/mime/packages/freedesktop.org.xml clifm. For more information about this file consult https://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec/.
(2) In case of issues, bear in mind that the mime.types file is read top to bottom, and that, in case of conclicts (mostly duplicate extensions), only the last entry is effective.
Important: Though sometimes convenient, determining file types by means of filename extensions alone is unreliable: a file, no matter its type, can bear any file extension, without restriction. Because of this, you might end up executing a command that was not intended due to wrong file identification. Be extra careful when doing this.
1. Syntax โจ
In its most basic form, each line in the MIME list file consists of:
a) A left value: this is just a regular expression indicating what we are trying to match (it can be a filename, a file extension, or a MIME type).
b) A right value: a semicolon separated list of commands to be used as the opening application (the first existing program found in this list will be used).
For example:
^text/.*=leafpad
which is to be read as follows: Open text files (in this case we are partially matching a MIME type) using leafpad.
As explained below, this basic rule can be modified to get much more control on what we are matching and how we execute the opening application.
The syntax is this:
[!][X:][N:]REGEX=CMD [ARGS] [%[f,x]] [![E,O]] [&]; ...
Note that this syntax departs from the Freedesktop specification in that we do not rely on desktop files (mostly used by desktop environments), but rather on commands and parameters.
2. The left value (REGEX) ๐
2.1. The X prefix
Without any prefixes, the rule will attempt to match MIME types, disregarding if we are running on a graphical or non-graphical environment. For example,
^text/.*=leafpad
instructs lira to open all text files using leafpad, no matter if we are running on a graphical or non-graphical environment.
However, we usually do not want to use leafpad if we are not running on a graphical environment. In this case, we can write a double rule as follows:
X:^text/.*=leafpad
!X:^text/.*=nano
where the first rule (via the X prefix) is intended for use on graphical environments, where we can use leafpad, and the second one (via the !X prefix) for non-graphical environments, where we rather prefer to use nano.
2.2. The N prefix
Sometimes MIME types are not enough to identify a file, or we just want to match a specific filename. In this case, we can use the N prefix to tell Lira that we want to match a filename instead of a MIME type. For example:
X:N:^filename.txt$=leafpad
in which case we want to match exactly the filename filename.txt (no matter its MIME type).
If we want to match file extensions, instead of entire filenames, we can use a regular expression, as follows:
X:N:.*.txt$=leafpad
Here, we are not matching a specific filename, but a specific file extension, so that the rule reads as follows: open all files ending with .txt using leafpad.
3. The right value (CMD) ๐ซ
The right value is a semicolon separated list of commands, each of which contains a command, and optionally, command arguments and modifiers. For example:
X:N:.*.txt$=leafpad --sync,geany,mousepad,nano
which means: Open .txt files (graphical environments only) using leafpad --sync, or, if not found, geany, mousepad, or nano, in this order. The file to be opened will be appended to the command string, say leafpad --sync FILE.
3.1. The %f placeholder
Use the %f placeholder to specify the position of the file to be opened in the command, for example:
mpv %f --terminal=no
will be translated into: mpv FILE --terminal=no
If the placeholder is not specified, the file to be opened will be appended to the command string. Thus, this: mpv --terminal=no amounts to this: mpv --terminal=no FILE.
3.2. STDERR and STDOUT
Sometimes we might need to silence either standard error (STDERR), standard output (STDOUT), or both. Use !E and !O to silence them respectively. Both can be used together: !EO. Example: leafpad %f !EO, or, to silence only STDERR: leafpad %f !E.
3.3. Run in the background
The ampersand character (&) can be used, as usual, to run the opening application in the background. Example: leafpad %f &.
3.4. The %x flag
The %x flag is a shortcut for "%f !EO &": the command will be executed in the background and both STDOUT and STDERR will be silenced. As a plus, the command is executed in a new session, i.e. detached from the running terminal (via setsid(3)). This flag is recommended to open files via graphical applications. Examples:
For GUI applications:
APP %x
For terminal applications:
TERM -e APP %x
Replace TERM and APP by the appropriate values (say, xterm and vi respectively). The -e option might vary depending on the terminal emulator used.
Note: In case of archives, the built-in ad command can be used as opening application.
3.5. Environment variables ๐
Environment variables (e.g., $EDITOR, $VISUAL, $BROWSER, and even $PAGER) are also recognized by Lira. You can even set custom environment variables to be used exclusively by clifm. For example, you can set CLIFM_TERM, CLIFM_EDITOR, and CLIFM_PDF, and then use them to define some associations:
X:text/plain=$CLIFM_TERM -e $CLIFM_EDITOR %f &
X:N:.*\.pdf$=$CLIFM_PDF %f &
3.6. Using shell scripts ๐
Bestie, real talk: commands get run directly, no shell in between. So none of the shell goodies are available โ no pipes, no conditions, no loops, none of it. ๐ญ
If you need something fancier than a single command (aka you do want shell capabilities), write your own script and drop the path to that script where the command would go. Like:
X:^text/.*:~/scripts/my_cool_script.sh
4. Examples: โจ
Match a complete filename:
X:N:some_filename=nano;vim;vi;emacs
Note: if the filename contains a dot, quote it like this: some_filename\.ext (so the REGEX parser doesn't go feral and read that dot as a regex dot).
Open video files with mpv in the foreground and silence STDERR:
^video/.*=mpv %f !E
Open video files with gmplayer in the background and silence both STDERR and STDOUT:
^video/.*=gmplayer %f !EO & (or 'gmplayer %x')
Match multiple filenames (starting with "str"):
X:N:^str.*=leafpad %x;mousepad %x;kate %x;gedit %x
Match a single extension:
X:N:.*\.txt$=leafpad %x;mousepad %x;kate %x;gedit %x
!X:N:.*\.^txt$=nano;vim;vi;emacs
Match multiple extensions:
X:N:.*\.(sh|c|py|pl)$:geany %x;leafpad %x;nano
Match a single mimetype:
!X:^audio/mp3$=mpv %f --terminal=no;ffplay -nodisp -autoexit;mpv;mplayer
Match multiple mimetypes:
X:^audio/.*=mplayer;mplayer2;vlc %x;gmplayer %x;smplayer %x;totem %x
And with MIME types you can also write the whole expression with zero regular expressions, no regex energy required:
!X:text/plain=$TERM -e $EDITOR %x
Wanna know more? Go look at the mimelist file itself (hit F6 or run mm edit) ๐ซถ
5. Using a third-party opener
Two ways to do this, bestie, pick your fighter:
a. Set Opener in the configuration file to the name of the opener you want. Say you wanna use Ranger's rifle(1):
Opener=rifle
or, if xdg-open(1) is more your vibe:
Opener=xdg-open
b. Tell Lira to open all files โ every MIME type, every filename, no questions asked โ via the opener you want. For example:
.*=rifle
6. Using Clifm as a standalone file opener
Okay so even though clifm is a file manager, it can lowkey just be a simple file opener through the --open command-line option. Like:
clifm --open /path/to/my_file.jpg
clifm --open /path/to/my_dir
clifm --open https://some_domain
Note: when opening web resources,clifmqueries the mimelist file usingtext/htmlas the MIME type. Whatever association it finds for that specific MIME type is what gets used to open the web resource. Periodt. ๐
๐ธ 11. SHOTGUN ๐ธ
1. Tab completion with file previews
Shotgun is clifm's built-in file previewer ๐ And yeah, as we're about to get into, it can be used as a standalone, general purpose file previewer (kinda like pistol(1) in that regard), but its main character job is being used by clifm's tab completion function running in fzf mode: every time tab completion is invoked for files, shotgun gets executed with the currently highlighted file as its argument (exactly like shown below) to generate the preview. Set the FzfPreview option in the configuration file to false (or run with --no-fzfpreview) to disable this feature.
Shotgun is also what the view command uses to show file previews full screen. Iconic. โจ
2. Running as a standalone files previewer
Run it via the --preview command-line switch and shotgun does file preview for any file you hand it as an argument. For example:
clifm --preview myfile.txt
This command generates a preview of the file myfile.txt and then quits clifm. That's it, that's the whole thing ๐
3. Customization
Previewing applications (based on either MIME type or filename) are defined in a configuration file $XDG_CONFIG_HOME/clifm/profiles/PROFILE/preview.clifm, using the exact same syntax as Lira (the built-in file opener). Go check the FILE OPENER section above, bestie.
You can set an alternative configuration file with the --shotgun-file command-line switch:
clifm --shotgun-file=/path/to/shotgun/config/file --preview=myfile.txt
To customize how the preview window looks, use the --preview-window option in the FzfTabOptions line of your current color scheme file. So if you want the preview window down the file list instead of off to the right:
--preview-window=down
Default keybindings for the preview window, no cap:
Alt+p: Toggle the preview window
Ctrl+Up / Shift+Up: Scroll the preview window up one line
Ctrl+Down / Shift+Down: Scroll the preview window down one line
Alt+Up: Scroll the preview window up one page
Alt+Down: Scroll the preview window down one page
You can customize those keybindings using the --bind option in the FzfTabOptions field in the color scheme file. ๐
Consult fzf(1) for more info.
4. Image previews
Image previews are available via the clifmimg plugin ๐ผ๏ธ Run help image-previews or go consult the Wiki for more:
https://github.com/leo-arch/clifm/tree/master/misc/tools/imgprev
๐ 12. AUTO-SUGGESTIONS ๐
Gemini is a built-in suggestion system (similar to what the Fish shell does). As you type, Gemini suggests possible completions right after wherever your cursor is. It's giving psychic bestie energy, honestly. ๐ฎ
The following checks are available (and yes, the order can be customized, keep reading):
a. ELNs
b. clifm commands and parameters
c. Entries in the command history list (commands you already used)
d. Filenames in the current working directory and paths (1)
e. Entries in the jump database
f. Aliases names
g. Bookmarks names
h. Program names in PATH
i. Shell builtins (2)
(1) Fuzzy suggestions are supported. For example: dwn > Downloads. Turn this on with the --fuzzy-marching command-line switch, or by setting FuzzyMatching to true in the configuration file.
(2) The shell name is taken from /bin/sh. These shells are supported: bash, dash, fish, ksh, tcsh, and zsh. Command names get checked in this order: clifm internal commands, commands in PATH, and shell builtins.
Note: By default, a brief description for internal commands is suggested. You can turn that off via the SuggestCmdDesc option in the configuration file.
To accept the entire suggestion press Right or Ctrl+f: the cursor moves to the end of the suggested command and the suggestion color switches to the color of the typed text; then you just press Enter to execute the command like normal. If you don't accept the suggestion, no biggie โ it's simply ignored and you can keep editing your command line however you want.
To accept only the first suggested word (up to the first slash or space), press Alt+Right or Alt+f instead. Not available for ELNs, aliases and bookmarks names, sadly.
Bear in mind that suggestions for ELNs, aliases, bookmarks names, the jump function (invoked by the j command), and also filenames and paths (if fuzzy-suggestions are enabled) do not work like the other suggestions: they don't suggest possible completions for your current input, they suggest the value that input points to. For example, if you type "12" and the current file list has a filename whose ELN is 12, that filename gets printed next to "12" like this: 12_ > filename (where the underscore is your current cursor position). Press Right or Ctrl+f to accept it, and the text you typed so far gets replaced by the suggestion. ๐
The order of the suggestion checks can be customized with the SuggestionStrategy option in the configuration file. Each check gets a lowercase character:
a = Aliases names
c = Possible completions
e = ELNs
f = Files in the current directory
h = Entries in the commands history
j = Entries in the jump database
The value of SuggestionStrategy is a string containing one or more of those characters. The order of the characters in that string is the order the suggestion checks get performed in. So like, to do all checks in the same order listed above, the string should be acefhj (no quotes). Or if you'd rather run the history check first: hacefj. And you can skip one or more checks by just omitting the matching character (to skip all checks, set the option value to a single dash (-)). So to ignore the aliases and the ELN checks, set SuggestionStrategy to hcfj. The default value for this option is ehfjac.
Note: The check for program names inPATHalways runs last, except when theExternalCommandsoption is disabled โ in which case suggestions for them just don't show up at all.
Suggestions get printed using one of these color codes (peep the COLOR CODES section above):
sf: Used for file and directory names. This includes suggestions for ELNs, bookmarks names, files in the current directory, and possible completions. Default value:2;4;36(dimmed underlined cyan)sh: Used for entries in the commands history.sc: Used for aliases and program names inPATH.sx: Used forclifminternal commands and parameters.sp: Greater-than sign (>) used when suggesting ELNs, bookmarks, and aliases names.
You can set SuggestFiletypeColor to true in the configuration file to use the color of the file type of the current filename (as set in the color scheme file) instead of the value of sf. For example, if a suggestion is printed for a file that's a symbolic link, ln or or (if it's a broken link) will be used instead of sf. ๐
๐ง 13. SHELL FUNCTIONS ๐ง
clifm ships a few shell functions for specific actions (cd-on-quit, and subshell-notice). Go take a look at the corresponding files in /usr/share/clifm/functions and follow the instructions. And needless to say, you can absolutely write your own functions, bestie. ๐
๐ 14. PLUGINS ๐
Plugins are just scripts or programs (written in literally any language) meant to add, extend or improve clifm's functionalities. They're linked to action names defined in a dedicated configuration file: $XDG_CONFIG_HOME/clifm/profiles/PROFILE/actions.clifm. ๐ฆ
Note: In stealth mode, since access to configuration files is not allowed, plugins are disabled.
To list available actions and the plugins they're linked to, run actions.
To execute a given plugin, enter the corresponding action name (plus parameters if it needs them).
To get info about a specific plugin, enter the action name followed by --help.
bestie, here's the tea on writing your own plugins ๐ซถ
So clifm ships a whole bunch of plugins at installation time (they live in the plugins directory, obviously), but that's just the starter pack, okay? You can write your own, in any language you want, for whatever purpose you want. Writing plugins is generally pretty easy โ like, genuinely, it's giving beginner-friendly ๐
โ but your mileage may vary depending on what you're trying to achieve. The best place to start? Go snoop on the plugins that already ship with it, and read the actions command description. Also hit up the ENVIRONMENT and FILES sections below, they're lowkey essential. ๐
๐ง The plugins-helper script (iykyk)
There's a convenient little helper script that keeps everything looking consistent across all your plugins โ especially the ones running fzf, because nothing ruins a vibe like mismatched output, fr fr.
It lives here:
DATADIR/clifm/plugins/plugins-helper
โฆbut it gets overridden by this if it's found:
$XDG_CONFIG_HOME/clifm/plugins/plugins-helper
And the way clifm does you a solid: it sets the location of this file itself, in the CLIFM_PLUGINS_HELPER environment variable, so your plugins can just use it. โจ
So to write a new fzf plugin, you source the file and then use any of the functions and variables it hands you:
# Source our plugins helper
if [ -z "$CLIFM_PLUGINS_HELPER" ] || ! [ -f "$CLIFM_PLUGINS_HELPER" ]; then
printf "clifm: Unable to find plugins-helper file\n" >&2
exit 1
fi
# shellcheck source=/dev/null
. "$CLIFM_PLUGINS_HELPER"
Slay. That's literally it for the setup. ๐
๐ Talking to clifm: the CLIFM_BUS pipe
Okay this part is the main character energy of the whole section, pay attention bestie.
Plugins can talk back to clifm through a dedicated pipe that exists for exactly this purpose, and it's exposed via an environment variable: CLIFM_BUS. You write to that pipe, and clifm will hear you and handle the message immediately after the plugin's execution. ๐ฆ
Now here's how clifm interprets what you sent:
- If the message is a path, clifm runs the
openfunction โ meaning it changes the current directory to that new path if it's a directory, or opens it with the default associated application if it's a file. - Otherwise, if the message is not a path, it just gets taken and executed as a command. ๐
Examples, because examples >>> everything:
echo "/tmp" > "$CLIFM_BUS"
โ this one tells clifm to change the current directory to /tmp โจ
echo "s *.png" > "$CLIFM_BUS"
โ and this one makes clifm select all the files in the current directory ending with ".png" ๐ฅ
โ ๏ธ Heads up: the pipe (CLIFM_BUS) is deleted immediately after the execution of its content, and then recreated before running any other plugin. So don't go thinking it's just sitting there forever waiting for you โ it's a one-shot situation, no cap. ๐
Okay bestie, here's the roster of plugins that ship ready to go ๐ โ every one of these is an action name you can call, plus what it does and what it needs installed to work:
bnโ create files in batch. deps:-bcpโ copy files in batch. deps:-bmiโ import your bookmarks. deps:-clipโ talk to the system clipboard, like, actually interact with it. deps:(1)unsetโ test what colors your terminal can actually do. deps:(2)crโ copy files off to a remote location. deps:fzf, andscp,ffsend, orcrocdaโ disk usage analyzer, the vibe check for your storage. deps:du,fzfdrโ drag and drop files. deps:dragonordragon-drag-and-dropfdupsโ find (and yeet) duplicate files. deps:(3)+โ find files in the current directory. deps:fzforrofi_(underscore, yes really) โ quickly change directory. deps:fzfhโ browse through your commands history. deps:fzf-(yes, just a dash ๐ ) โ navigate/select/preview files. deps: see the section below*โ select files (flat view included, no cap). deps:fzf,find**โ deselect files. deps:fzfunsetโ show git repo status. deps:git(4)ihโ browse clifm's manpage (meta, iconic, obsessed). deps:fzfiโ image thumbnails previewer. deps:sxiv,fehorlsix++โ jump to a directory in the jump database. deps:fzforrofikdโ decrypt a GnuPG encrypted file. deps:gpg,tar,sed,grepkeโ encrypt files/dirs using GnuPG. deps:gpg,tar,sed,fzf,awk,xargsmlโ list files by a given MIME type. deps:fzf,filemusicโ create a music playlist ๐ง. deps:mplayerggโ pipe the files in the CWD through a pager. deps:less,columnptotโ preview PDF files as text. deps:pdftotextrrmโ recursively remove files (careful, bestie ๐ญ). deps:find,fzf//โ search files by content. deps:fzf,ripgrepunsetโ update plugins ยท dep:(5)vidโ preview video files thumbnails ยท dep:ffmpegthumbnailervtโ virtual directory for sets of files ยท dep:sedwallโ set image as wallpaper ยท dep:(6)unsetโ pick/select files via clifm ยท dep:(7)Ctrl+yโ copy the line buffer to the clipboard ยท dep:(8)
okay bestie, now the footnote lore ๐ these little numbers are doing SO much work:
xcliporxsel(Xorg),wl-copy/wl-paste(Wayland),clipboard(Haiku),clip(Cygwin),pbcopy/pbget(MacOS),termux-clipboard-get/termux-clipboard-set(Termux),cb(cross-platform: https://github.com/Slackadays/Clipboard)colors.sh(by default unset)find,md5sum,sort,uniq,xargs,sed,stat- The
git_status.shplugin is not intended to be used as a normal plugin โ like, you don't run it via an action name, periodt. Instead it's meant to be run as a prompt command (so it fires right before every single prompt ๐ธ). Drop this line into the main configuration file:
promptcmd /usr/share/clifm/plugins/git_status.sh
And yeah, this plugin gives you basic Git integration, but it's genuinely so easy to modify (it's literally just a few lines long) that you can add whatever git function you're craving. ๐
update.sh(by default unset)feh,xloadimage,hsetroot, ornitrogen(for X);swwworswaybg(for Wayland)file_picker.sh(by default unset). Usage example:ls -ld $(file_picker.sh)- Dependencies:
cb,wl-copy,xclip,xsel,pbcopy,termux-clipboard-set,clipboard, orclip. Go peek at the plugin file itself (xclip.sh) for more info ๐ซถ
โจ Dependencies of the previewer plugin (fzfnav.sh) โจ
- archives:
atool,bsdtar, ortar - images:
kittyterminal,imagemagick, andueberzugorviuorcatimgorimg2txtorpixterm - fonts:
fontprevieworfontforge - docs:
libreoffice,catdoc,odt2txt,pandoc - PDF:
pdftoppm,pdftotextormutool - epub:
epub-thumbnailer - DjVu:
djvulibreordjvutxt - postscript:
ghostscript - videos:
ffmpegthumbnailer - audio:
ffmpeg,mplayer, ormpv - web:
w3m,links,elinks, orpandoc - markdown:
glow - highlight:
bat,highlight, orpygmentize - torrent:
transmission-cli - json:
pythonorpq - file info:
exiftool,mediainfo, orfile
So like, to run the pager.sh plugin for example? You literally just type the matching action name, which in this case is gg ๐. And if you ever get lost, every single plugin ships a -h/--help switch that gives you a quick usage rundown. iykyk ๐
Note: thefzfnavplugin usesfzf(1)to navigate your filesystem andBFG(a script that lives in the plugins directory) to show previews โ and btw, to display image previews, BFG needsueberzug(1)or the Kitty protocol via the Kitty terminal ๐ฑ. There's a config file (BFG.cfg, sitting right there in the plugins directory) so you can customize how the previewer behaves. Obsessed. ๐
Note 2: there's an alternative file previewing function โ built-in, and therefore faster than BFG โ provided by shotgun. Peep the SHOTGUN section above for the deets. ๐
On top of the built-in BFG previewer, fzfnav also supports both Rangerยดs scope.sh script and pistol(1) ๐. Wanna use scope? Edit the BFG configuration file and set USE_SCOPE to 1 and SCOPE_FILE to the correct path to the scope.sh file (normally $HOME/.config/ranger/scope.sh). Wanna use pistol instead? Just set USE_PISTOL to 1. That's it, that's the whole vibe โจ
Go take a look at the Wiki for more info, bestie: https://github.com/clifm/wiki/Advanced#plugins
15. AUTOCOMMANDS ๐
Okay bestie, this one is a whole vibe and honestly kinda iconic. Autocommands are heavily inspired by Vifm, and they hand you fine-grained control over clifm's settings. The main reason they exist? Performance on remote filesystems (which are usually slower than local ones, no cap) โ you can switch off stuff like the file counter that can wreck performance under some circumstances (like remote connections, obviously). But don't let that fool you: the autocommands function is not restricted to this specific use case. Use it for whatever purpose you find useful. Main character energy only.
Note: what we're describing here are permanent autocommands, which need to be defined in the configuration file. Temporary autocommands (set via the command line, valid only for the current directory and the current session) are also available via the auto command. See above. ๐
So how do you do it? Add a line preceded by the autocmd keyword to the main configuration file. The general syntax is:
autocmd TARGET cmd,cmd,cmd
TARGET specifies the object to which subsequent commands will apply. It can match either directory names (paths) or workspaces.
- To match directory names use a glob pattern (as specified by
glob(7)). If no glob metacharacter is provided, the string will be compared as is to the current working directory. To invert the meaning of a pattern, prepend an exclamation mark. To match all directories under a specific directory (including this directory itself) use the double asterisk (**). A few examples:~/Downloadsโ match exactly the Downloads directory (and only this directory) in your home directory~/Downloads/*โ recursively match all subdirectories in~/Downloads(excluding the Downloads directory itself)/~/Downloads/**โ recursively match all subdirectories in~/Downloads(including the Downloads directory itself)~/Downloads/*.dโ match all subdirectories in~/Downloadsending with.d(excluding the Downloads directory itself)!~/Downloadsโ match everything except the~/Downloadsdirectory
- You can match workspaces using the ampersand character (
@) followed by thewskeyword and then the workspace number. For example, to match the third workspace:@ws3, or, to match the first workspace,@ws1. To match instead all workspaces except the second one:!@ws2.
TARGET is followed by a comma separated list of commands:
!CMDโ the exclamation mark allows you to run shell commands, custom binaries or scripts
The following codes are used to control clifm's file list:
csโ Color scheme โcs=zenburnfcโ File counter โfc=0ftโ Files filter โft=.*\.pdf$fzโ Recursive dir sizes โfz=1hf,hhโ Hidden files โhf=0lmโ Light mode โlm=1lv,llโ Long view โlv=0mfโ Max files โmf=100(1)mnโ Max filename length โmn=20(1)odโ Only directories โod=1pgโ Pager โpg=0stโ Sort method โst=5srโ Reverse sort โsr=1
To remove a value, set the option to an empty value. For example, to remove the files filter and the color scheme: ft=,cs=
(1) This option supports the unset keyword to remove the corresponding limit. E.g., mf=unset,mn=unset
Examples โจ
- Run in light mode and disable the file counter for the remotes directory:(1)
autocmd /media/remotes/** lm=1,fc=0
- Just a friendly reminder:
autcomd ~/important !printf "Important: keep your fingers outta here!\n" && read -n1
- This directory has thousands of files. Show only the first hundred and enable the pager:
autocmd /usr/bin mf=100,pg=1
- Lots of media files (with large filenames). Truncate filenames to 20 chars max and run the files previewer:(2)
autocmd ~/Downloads mn=20,!~/.config/clifm/plugins/fzfnav.sh
- I want the second workspace, no matter what the current directory is, to list files in long view:
autocmd @ws2 lv=1
- Mmm, just because I can. Be creative!
autocmd /home/user hf=0,cs=nord,lv=1
autocmd / lv=1,fc=0,cs=solarized,st=5
(1) This is the recommended configuration for remote filesystems.
(2) As seen here, plugins can be used as well: in this case, we want to run fzfnav (to make use of the files preview capability) whenever we enter the Downloads directory, usually containing videos, music, and images.
NOTE: If you decide to use a plugin, bear in mind that it will not be able to communicate with clifm, because the autocommand function always executes commands as external applications using the system shell. ๐ซถ
Bear in mind that autocmd directives are evaluated from top to bottom, so that subsequent matching entries will overwrite options set by previous entries. Order matters, bestie. ๐
Autocommand notifications ๐
By default, a gray A is printed to the left of the prompt whenever an autocommand is active for the current directory.
The behavior of this indicator can be customized via the InformAutocmd option in the configuration file.
The color code used to colorize this indicator is ac (see the COLORS section above).
Autocommand files: .cfm.in and .cfm.out ๐
To use this feature, you must first set ReadAutocmdFiles to true in the main configuration file. However, bear in mind that autocommand files will never be read if running on an untrusted environment (i.e. if running with --secure-cmds, --secure-env, or --secure-env-full). Safety first, babes. ๐ก๏ธ
Two files are specifically checked by the autocommands function: .cfm.in and .cfm.out (they must be non-empty regular files of at most PATH_MAX (usually 4096) bytes, and no NUL byte must be contained in them).
The content of these files is a single instruction, either a shell command or, if you need more elaborated stuff, a script (or custom binary). Note that codes to modify clifm's settings (as described above) are not available here.
If a directory contains a file named .cfm.in, clifm will execute (via the system shell) its content when entering this directory (before listing files). If the file is named rather .cfm.out, its content will be executed immediately after leaving this directory (and before listing the new directory's content).
For example, if you want a simple notification whenever you enter or leave your home directory, create both .cfm.in and .cfm.out files in the home directory with the following content:
For .cfm.in:
printf "Entering %s ..." "$PWD" && read -n1 && clear
For .cfm.out:
printf "Leaving %s ..." "$OLDPWD" && read -n1
16. FILE TAGS ๐ท๏ธ
Etiqueta is clifm's built-in file-tagging system. Slay.
1. How does Etiqueta work? ๐ฆ
File tags are created via symlinks using a specific directory under the user's profile:
${XDG_CONFIG_DIR:-/home/USER/.config}/clifm/profiles/USER/tags
Every time a new tag is created, a new directory named as the tag itself is created in the tags directory. Tagged files are just symbolic links to the actual files created in the appropriate directory. For example, if you tag ~/myfile.txt as work, a symbolic link to ~/myfile.txt, named myfile.txt will be created in tags/work. It's giving organized, it's giving efficient. ๐
2. Handling file tags ๐ธ
tag is the main Etiqueta command and is used to handle file tags. Its syntax is as follows:
tag [add, del, list, list-full, new, merge, rename, untag] [FILE]... [[:]TAG]
Note: The:TAGnotation is used for commands taking both file and tag names:tag add FILES(s) :TAG ..., to tag files, andtag untag :TAG file1 file2, to untag files. Otherwise,TAGis used (without the leading colon). For example:tag new docs, to create a new tag nameddocs, ortag del png, to delete the tag namedpng.
Both short and long command format can be used:
ta/tag addโ Tag filestd/tag delโ Delete tag(s)tl/tag listโ List tags or tagged filestm/tag renameโ Rename tagstn/tag newโ Create new tag(s)tu/tag untagโ Untag file(s)ty/tag mergeโ Merge two tags
3. Usage examples
tl/tag listโ list every available tag ๐-/tag list-fullโ list all the available tags plus every single tagged file ๐ซถtl work/tag list workโ list every file that's tagged asworktl file.txt/tag list file.txtโ list the tags applied to the filefile.txttn dogs cats/tag new dogs catsโ create two empty tags:dogsandcatsta *.png :images :png/tag add *.png :images :pngโ tag PNG files as bothimagesandpng(1) (2)ta sel :special/tag add sel :specialโ tag all selected files asspecialtr documents docs/tag rename documents docsโ rename the tagdocumentsasdocsty png images/tag merge png imagesโ merge the tagpngintoimages(3)td images/tag del imagesโ remove the tagimages(4)tu :work file1 dir2/tag untag :work file1 dir2โ untag a few files fromwork(5)
okay bestie, the lil' footnotes, don't skip them, they're lowkey the whole plot ๐
- Tags are created if they do not exist
- Since
addis the default action, it can be omitted:tag *.png :images :png. - All files tagged as
pngwill be now tagged asimages, and thepngtag will be removed. - Untag all files tagged as
imagesand remove the tag itself - Tab completion is available to complete tagged files. If using the fzf mode, multiple files can be selected using the the TAB key.
4. Operating on tagged files ๐ฅ
The t:TAG expression is used to operate on tagged files via any command, be it internal or external. A few examples:
p t:docsโ print properties of files tagged asdocsr t:imagesโ remove all files tagged asimagesstat t:docs t:workโ runstat(1)over all files tagged asdocsand all files tagged aswork
4.1 Operating on specific tagged files ๐
Note: this feature, as always when multi-selection is involved, is only available when tab completion mode is set to fzf. See the TAB COMPLETION section above. โจ
So like, maybe you don't wanna operate on all the files tagged as some specific tag โ say work โ but rather on some files tagged as work. Tab completion is the girl for the job, no cap.
Let's suppose you have a tag named work which contains ten tagged files, but you need to operate (say, print the file properties) only on two of them, say, work1.odt and work2.odt:
p t:work<TAB>
The list of files tagged as work will be displayed via fzf. Now mark the two files you need using the TAB key, press Enter or Right, and the absolute path to both files will be inserted into the command line. So, p t:work will be replaced by p /path/to/work1.odt /path/to/work2.odt. ๐ฆ
๐ฆ 17. VIRTUAL DIRECTORIES ๐ฆ
okay bestie, this one is SO cool. Clifm can literally read and list files straight from the standard input stream (STDIN). ๐
Every file in that list has to be an absolute path, terminated with a new line character (\n), and stripped of any extra characters that don't belong to the path itself. Clean it up, babe. The size of the input stream buffer is 262MiB (65536 paths, assuming each path takes PATH_MAX bytes โ usually 4096). Big brain capacity, no cap.
Every file you pass via standard input gets stored as a symbolic link pointing to the original file, inside a temporary directory (we call it the virtual directory) with read-only (0500) permissions. And the way this whole directory plus everything in it gets deleted at program exit? iconic. ๐
Use the --virtual-dir command-line flag to pick a custom directory instead of the default one (and if it doesn't exist, it will be created โ she's accommodating like that). The default lives in the system temporary directory, usually /tmp/clifm/USER/vdir.XXXXXX, where XXXXXX is a random six digits string. ๐
The user can operate on these files as if they were any other regular file, because all operations performed on these symbolic links (as long as the current working directory is the virtual directory where all these files are stored) are performed on the target files and NOT on the symbolic links themselves. Read that twice, bestie, it matters.
Once you're in the virtual directory, files are listed by default using only the base name of the target file. So like, if the target file is /home/user/Downloads/myfile.tar.gz, it shows up as myfile.tar.gz. But if that file already exists in the virtual directory (because there's another target file with the same base name, say /home/user/Documents/tars/myfile.tar.gz), a random six digits suffix gets appended โ for instance, myfile.tar.gz.12Rgj6. Problem solved, slay. โจ
Now, since this listing mode doesn't let the user get a clear idea of the actual location of each listed file, there's a keybinding available (by default Alt+w) to toggle between short (base names only) and long filenames. In the long case, filenames are listed using the absolute path to the target file, with slashes replaced by colons (:). Example: if the target file is /home/user/Downloads/myfile.tar.gz, it'll be listed in the virtual directory as home:user:Downloads:myfile.tar.gz. Obsessed with the consistency. ๐ซถ
If you prefer the long names approach, you can just use the --virtual-dir-full-paths command-line flag. Done and done.
Note: Bear in mind that the restore last path function is disabled when listing in this way. Just so you know, bestie. ๐ญ
Clifm provides two ways of using virtual directories:
- Reading files from the standard input
- Listing sets of files via the
virtualize.shplugin (which is in fact a special use case of point 1)
1. Standard input ๐
Examples:
ls -Ad /var/* | clifm
This command will pass all files in the directory /var to clifm. Simple as that.
If you need to perform more specific queries, you can use find(1) as follows:
find -maxdepth 1 -size +500k -print0 | tr ยด\0ยด ยด\nยด | sed ยดs/.//gยด |
clifm
The above command will pass all files in the current directory bigger than 500KiB to clifm. Filtering queen behavior. ๐
You can also use stream redirection:
ls -Ad $PWD/* > list.txt
clifm < list.txt
2. The virtualization plugin ๐ง
The virtualize.sh plugin, bound by default to the vt action name, is intended to provide an easy way of listing sets or collections of files โ like selected, tagged, or bookmarked files. For example, to send all selected files to a virtual directory, you can issue this command:
vt sel
and, if you want rather files tagged as PDF:
vt t:PDF
Of course, individual files can also be used:
vt file1 file2 file3
Once executed, the vt plugin will launch a new instance of clifm (on a new terminal emulator window) where you can operate on the specified files as if they were just normal files. Once you're done, quit this new instance (via the q command) to return to the primary instance of clifm. Cute little round trip. ๐ธ
Note: By default, the terminal emulator used isxterm(1), but it can be changed by editing the plugin script (virtualize.sh).
When navigating the filesystem, you can quickly go back to the virtual directory using the -d option: vt -d. The navigation keys (see the KEYBOARD SHORTCUTS section above) and the CLIFM_VIRTUAL_DIR environment variable are also available (Shift+Left/Shift+Right or cd $CLIFM_VIRTUAL_DIR). ๐ซ
Tip: Write an alias to make this even easier:
alias vtd=ยดcd $CLIFM_VIRTUAL_DIRยด
๐ฅ 18. NOTE ON SPEED ๐ฅ
Clifm is by itself quite fast by default, but if speed is still an issue, it is possible to get some extra performance. Let's go, bestie, we're optimizing. โก
The two most time consuming features are:
- The file counter, used to print the number of files contained by listed directories. Disabling this option produces a nice performance boost.
- In normal mode,
fstatat(3)is used to gather information about listed files. Since this function, especially when executed hundreds (and even thousands) of times, is quite time consuming, the light mode was implemented as an alternative listing process omitting all calls to this function (this does not apply, however, to the long view: since we need to display files information,fstatat(3)is required). No skipping that one, sadly. ๐ญ
When running in light mode, however, a few features are lost:
- Only basic file classification is performed, namely, that provided by the
d_typefield of adirentstruct (seereaddir(3)). Bear in mind, nonetheless, that whenever_DIRENT_HAVE_D_TYPEwas not set at compile time, or in case of aDT_UNKNOWNvalue for a given entry (we may be facing a filesystem not returning thed_typevalue, for example, loop devices), clifm will fall back tostat(3)to get basic files classification. She always has a backup plan. ๐ - Color per file extension is disabled for performance reasons.
- The marker for selected files (
*) is lost as well: to keep track of selected files and thus recognize them in the current list of files, we make use of files device and inode number, which is provided byfstatat(3). So like, no marker without it. ๐
Besides these two features, a few more things can be disabled to get some extra speed (though perhaps unnoticeable): icons (if enabled), columns, colors, and, if already running without colors, file type indicators. Because listing lots of files could be expensive and time consuming, you can also try to limit the number of files printed for each visited directory (see the mf command above). ๐
Despite the above, however, it is important to bear in mind that listing speed does not only depend on the program's code and enabled features, but also on the terminal emulator used. Old, basic terminal emulators like Xterm, Aterm, and the kernel built-in console are really slow compared to more modern ones like Urxvt, Lxterminal, ST, and Terminator, to name just a few. Upgrade your setup, bestie, your eyes and your CPU will thank you. โจ
If using Xterm, a nice speed boost is provided by the fast scroll option: set fastScroll to true in your ~/.Xresources file. See xterm(1). ๐
๐ฆ 19. KANGAROO FRECENCY ALGORITHM ๐ฆ
Okay bestie, this is the part where the directory jumper literally learns you. The whole thing is designed to pick up on your navigation habits, and it stores all that tea in a database (peep the FILES section below ๐) which it uses to serve you the best match for whatever string you throw at it. So yeah, Kangaroo is basically a quick, smart, evolved cd function โ main character energy fr fr.
๐ What gets stored in the database
Everything is tracked per directory, and here's the full breakdown:
- a) Permanent entry (
'+') โ this directory will not be removed from the database, no matter its rank - b) Number of visits
- c) Date of first visit (seconds since the Unix epoch)
- d) Date of the last visit (seconds since Unix epoch)
- e) The absolute path to each visited directory
With all of that, it can build a ranking of directories and hand you the most accurate matches for each query string. The matching algorithm cares about mainly two things: frequency and recency โ which is literally why this kind of algorithm is called a frecency algorithm. ๐
โจ The ranking math (yes there's math)
Once it gets an initial list of matches from the query string(s) you typed, the frequency algorithm gets applied to every entry in that list. It's pretty simple, no cap:
(visits * VISIT-CREDIT) / days-since-first-visit
That gives you the average number of visits per day since the first visit โ what we call the directory rank. ๐
Note:VISIT-CREDITis a hardcoded value:200.
๐ฅ Bonus points, because of course
There are some further steps in the ranking process: Bonus points. Extra credits or penalties get assigned based on each directory's last access time, according to these simple algorithms:
- Within last hour:
rank * 4 - Within last day:
rank * 2 - Within last week:
rank / 2 - More than a week:
rank / 4
If the last query string matches the basename of a directory, that entry gets 300 extra credits. Why? Because users normally use directory basenames as query strings โ they're just easier to remember, bestie. ๐ง โจ
Same energy for the rest:
- Pinned directories โ 1000 extra credits
- Bookmarked directories โ 500 credits
- Directories active in a workspace โ 300 credits
- Directories marked as permanent โ 300 credits
๐ The example (this one's iconic)
Say your query string is "test" โ then /media/data/test will be matched. Now, if that directory was accessed within the last hour, and its rank was 200, it becomes 800. But because the search string matches its basename, it grabs 300 extra credits, and if this directory is also bookmarked, pinned, and marked as permanent, it gets 1800 extra credits. So the total rank of this directory in the matching process is 2900. ๐
Doing it this way means we have way more chances of matching what the user actually wanted to match.
Once all the entries in that initial list of matches have been filtered through the above procedure and ranked, we can return the best ranked entry. The higher rank a directory has, the more priority it has over the remaining entries in the initial list. Periodt.
๐ Automatic maintenance
The database keeps itself cute with a few simple procedures:
- a) If
PurgeJumpDBis set totrue(see the main configuration file), each entry in the database is checked at startup to remove non-existent directories. This option is set tofalseby default, to avoid removing paths pointing to unmounted filesystems (like removable devices or remote locations) which you still might want to keep. Non-existent directories, however, will be removed sooner or later anyway due to their low rank value (see below). - b) Once the rank of a directory falls below
MinJumpRank(by default10), it is forgotten and deleted from the database. TheMinJumpRankvalue can be customized in the configuration file. To make non-frequently visited directories disappear quicker from the database, increase this value. If set to0, by contrast, directories will never be removed from the database. - c) Once the sum total of ranks reaches
MaxJumpTotalRank(by default100000), each individual rank is divided by a dynamic factor so that the total rank becomes less than or equal toMaxJumpTotalRank. If some rank falls in the process belowMinJumpRank(and provided this latter is not0), it is removed from the database.MaxJumpTotalRankcan be modified in the configuration file. The higher the value ofMaxJumpTotalRank, the more time directories will be kept in the database.
Note: Directories visited in the last 24 hours โ just like pinned, bookmarked directories, and directories currently used in some workspace โ will not be removed from the database, no matter what their rank is. In other words, if you want to indefinitely keep a given directory in the jump database, bookmark it, or mark it as permanent (edit the database, viajeorj --edit, and prepend a plus sign (+) to the corresponding entry).
๐ธ Where frecency came from
The idea of 'frecency' was, as far as I know, first devised and designed by Mozilla. See
https://wiki.mozilla.org/User:Mconnor/Past/PlacesFrecency
However, it is also implemented, though using different algorithms, by different projects like autojump, z.lua, and zoxide. Iykyk. ๐ฆ
โจ 20. ENVIRONMENT โจ
okay bestie, this is the part where clifm reads the vibes of your shell before it even says hi ๐ these are the env vars it peeks at at initialization time:
NO_COLORโ set this to literally anything and clifm runs with no colors. bye bye rainbows ๐ญCLIFM_NO_COLORโ same energy asNO_COLOR, but it's clifm's own special version.CLICOLOR_FORCEโ forces colors to show up even when your terminal swears it can't do color support. gaslighting the terminal, iconic.CLIFM_FORCE_COLORโ same asCLICOLOR_FORCE, except you can also hand it a specific color value:8,16,256,truecolor, or24bit.CLIFM_FILE_COLORSโ a colon separated list of file type color codes, in the exact same form described up in the COLOR CODES section.CLIFM_EXT_COLORSโ same as above, but for file extensions.CLIFM_IFACE_COLORSโ same as above, but for the different elements of clifm's interface.CLIFM_DATE_SHADESโ a comma separated list of colors used to print timestamps based on age. cute little time-based gradient โจCLIFM_SIZE_SHADESโ same asCLIFM_DATE_SHADES, but for file sizes instead.CLIFM_PREVIEW_MAX_SIZEโ if you're running with--preview, orPreviewMaxSizeisn't set in the config file, then no preview gets generated for files bigger than this value. The value has to be in KiB: so like,2048reads as 2 MiB, bestie. don't get it twisted ๐CLIFM_TEMPLATES_DIRโ your custom file templates directory.CLIFM_HISTFILEโ your custom commands history file.CLIFM_FILTERโ defines a file filter. If you set it, this variable overrides theFilteroption in the config file. she said I'm the boss now ๐CLIFM_SUDO_CMDโ the name of the authenticator program. Used by theXcommand (to launch a new clifm instance as root), by theAlt+vkeybinding (to prepend the authenticator program name to the current command line), and for some operations on archives (ISO files). Defaults tosudo(ordoasif compiled on OpenBSD). Example:
CLIFM_SUDO_CMD=doas clifm
SHELLโ an absolute path to the shell clifm uses to run external commands. Only values found in/etc/shellsare allowed. rules are rules ๐ซถCLIFM_SHELLโ same asSHELL, but clifm-specific (and it takes precedence overSHELL).TMPDIRโ path to a directory where temporary files get created.CLIFM_TMPDIRโ same asTMPDIR, but clifm-specific (takes precedence overTMPDIR).TERMโ the terminal type that output is prepared for.FZF_DEFAULT_OPTSโ a quoted list of options passed tofzf(if you're using it for tab completion).TIME_STYLEโ if it's set from neither--time-stylenorTimeStyle(in the config file), use this time style for the long view.CLIFM_TIME_STYLEโ same asTIME_STYLE, but clifm-specific (takes precedence overTIME_STYLE).PTIME_STYLEโ if it's set from neither--ptime-stylenorPTimeStyle(in the config file), use this time style for thep/ppcommand and the--stat/--stat-fullcommand-line switches.CLIFM_COLUMNSโ the number of terminal columns.CLIFM_LINESโ the number of terminal lines.CLIFM_MIMETYPES_FILEโ set a custommime.typesfile (instead of the default,~/.config/clifm/mime.typesor~/.mime.types). Go check the FILE OPENER section for more info.
Except when running in stealth mode, clifm sets these environment variables for you:
CLIFMโ path to the configuration directory. Other programs can peek at this variable to figure out whether they were spawned by clifm. You can also use it to yeet yourself straight to the config dir:cd $CLIFMor just$CLIFM. main character shortcut energy ๐CLIFMRCโ path to the main configuration file (by default~/.config/clifm/profiles/default/clifmrc).CLIFM_PIDโ the PID number of clifm's running instance.CLIFM_VERSIONโ the version number of clifm's running instance.CLIFM_VIRTUAL_DIRโ path to the currently used virtual directory, but only if (and while) the virtual directory function is executed. See the VIRTUAL DIRECTORIES section above.SHLVLโ incremented by one every time a new shell is started.CLIFMLVLโ same asSHLVL, but clifm-specific.
And if Notifications is set to false for the current prompt, these get exported to the environment so your custom prompt can use them if it wants ๐:
CLIFM_STAT_SELโ current number of selected files.CLIFM_STAT_TRASHโ current number of trashed files.CLIFM_STAT_AUTOCMDโ set to1if there's an autocommand for the current directory. Otherwise it's0.CLIFM_STAT_ERROR_MSGSโ current number of error messages.CLIFM_STAT_WARNING_MSGSโ current number of warning messages.CLIFM_STAT_NOTICE_MSGSโ current number of notice messages.CLIFM_STAT_WSโ current workspace number.CLIFM_STAT_EXITโ exit code of the last executed command.CLIFM_STAT_ROOTโ1if the user is root (UID = 0),0otherwise.CLIFM_STAT_STEALTHโ1if running in stealth mode,0otherwise.
When you run a plugin, these variables get set (and then immediately unset right after the plugin finishes executing, so don't get attached ๐):
CLIFM_BUSโ the path to a pipe that plugins can use to talk to clifm. See the PLUGINS section for more.CLIFM_COLOR_SCHEMEโ set to the name of the current color scheme.CLIFM_COLORLESSโ set to1if running without colors. Unset otherwise.CLIFM_CUR_WSโ set to the current workspace number.CLIFM_DIRS_FIRSTโ set to1iflist-dirs-firstis enabled. Unset otherwise.CLIFM_FILE_COUNTERโ set to1iffiles-counteris enabled. Unset otherwise.CLIFM_FILE_FILTERโ set to the file filter string. Unset if no file filter is set.CLIFM_FILTER_REVERSEโ set to1iffilter-reverseis set. Unset otherwise (or if no file filter is set).CLIFM_FOLLOW_LINKSโ set to1iffollow-symbolic-linksis enabled. Unset otherwise.CLIFM_LIGHT_MODEโ set to1iflight-modeis enabled. Unset otherwise.CLIFM_LINEโ when you run a plugin via a keybinding, this holds the content of the current line buffer. For a usage example, go look at thexclip.shplugin ๐CLIFM_LONG_VIEWโ set to1iflong-viewis enabled. Unset otherwise.CLIFM_MAX_FILESโ set toMAX_FILESifmax-filesis set. Unset otherwise.CLIFM_ONLY_DIRSโ set to1ifonly-dirsis enabled. Unset otherwise.CLIFM_PLUGINS_HELPERโ set to the absolute path to theplugins-helperscript used by several plugins.CLIFM_PROFILEโ set to the name of the current profile.CLIFM_SEL_FILESโ set to the number of currently selected files (unset if there are no selected files).CLIFM_SELFILEโ set to the path to the current selection file.CLIFM_SHOW_HIDDENโ set to1-3(true,first, andlastrespectively) ifshow-hiddenis enabled. Unset otherwise.CLIFM_SORT_REVERSEโ set to1ifsort-reverseis enabled. Unset otherwise.CLIFM_SORT_STYLEโ set to the current sort method.CLIFM_TRASH_FILESโ set to the number of currently trashed files (unset if there are no trashed files).CLIFM_TRUNCATE_NAMESโ set to1iftruncate-namesis enabled. Unset otherwise.
๐ 21. SECURITY ๐
okay bestie, listen up because this one actually matters ๐
clifm runs OS commands, so it has to have a way to run them securely, especially when you're in an untrusted environment. Two features handle this: secure environment and secure commands. No cap. ๐ก๏ธ
Both of these exist to protect the program and the system itself from malicious input โ either from environment variables, or from indirect input, aka input that doesn't come from the command line (where we just assume it's you, the user, typing the command) but from files. Which files, you ask? We're talking default associated applications (the mime command), autocommands, aliases, plugins, (un)mount commands (via the net command), and also profile and prompt commands. yeah. all of those. ๐ซถ
So in an untrusted environment, an attacker could make stuff behave unexpectedly and insecurely (even do command injection) using environment variables, or inject malicious commands through that indirect input โ commands that clifm would then run later without your consent (i.e. automatically ๐ญ). That's exactly why this mechanism exists: if you're running in an untrusted environment, secure environment and secure commands are there to prevent (at least as much as possible) this kind of attack. periodt.
๐ A) Secure environment ๐
Programs inherit the environment from their parent process. But if that inherited environment is not trusted, not secure, it's always a good idea to sanitize it using only sane values โ that way you block undesired, uncontrolled input that might put the program (and the system) in danger. โจ
The secure-environment function forces clifm to run on exactly that kind of sanitized environment.
There are two secure-environment modes: the regular one and the full one. For regular mode, launch clifm with the --secure-env command-line option. Otherwise, turn on full mode with --secure-env-full.
๐ธ a) Regular ๐ธ
In this mode, the inherited environment is cleared, though a few variables are preserved to keep clifm running as stable as possible. The preserved ones are: TERM, DISPLAY, LANG, TZ, and โ if fzf tab completion mode is enabled โ FZF_DEFAULT_OPTS.
The following variables are set in an environment agnostic way (aka securely, bestie ๐):
HOME,SHELL, andUSERare retrieved usinggetpwuid(3)PATHis set consulting_PATH_STDPATH(or_CS_PATHif the former is not available)IFSis set to a sane, hard-coded value:" \n\t"(space, new line char, and horizontal TAB)
And as a lil bonus โจ:
- core dumps are disabled
- the
umaskvalue is set to0077at startup, and the creation mode (when using thenewcommand) is forced to0700for directories and0600for files - non-standard file descriptors (
>2) are closed - SUID/SGID privileges, if any, are dropped
- autocommand files are not read at all (even if
ReadAutocmdFilesis set totrue)
๐ฆ b) Full ๐ฆ
Full mode is just like regular mode, except nothing is imported from the environment at all, and only PATH, HOME, USER, SHELL, and IFS are set (as described above ๐). Everything else stays unset, and it's your responsibility to set environment variables (via the export function) as needed. In this case you might wanna set at least TERM, and โ if you're running in a graphical environment โ DISPLAY.
โ ๏ธ heads up: enabling secure-environment might break some functions, depending on your system configuration. ๐
๐ B) Secure commands ๐
Some commands get executed by clifm automatically: (un)mount commands (via the net command), opening applications (via Lira), aliases, and plugins, plus prompt, profile, and autocommands. These commands are read from a configuration file and then executed. Nowโฆ if an attacker has access to any of those files, she might force clifm to run any arbitrary command, and thereby possibly expose the whole entire system. ๐
So every time a command is automatically executed via the system shell (i.e. without your direct consent), the secure commands function does four different, though intrinsically related tasks, all aimed at mitigating command injection and/or unexpected behavior:
๐ง a) Plugins are disabled.
That's it. That's the item. Plugins: off. ๐
โญ b) Only command base names are allowed
nano, for instance, is allowed โ but /usr/bin/nano is not. This way we guarantee that only commands found in a sanitized PATH (see point d below) will be executed. It's done to prevent the execution of custom binaries/scripts, like for example: /tmp/exec_file.
๐ c) Commands are validated using a whitelist of safe characters
Mostly to prevent stream redirection, conditional execution, and so on โ for example, 'your_command;some_injected_command'. This set of safe characters varies slightly depending on the command being executed (because they use different syntaxes):
Net command:a-zA-Z -_.,/=Prompt, profile, autocommands:a-zA-Z -_.,/"'Mime command:a-zA-Z -_.,%&
Commands containing at least one unsafe character will be rejected. Of course, we cannot (and should not) prevent what looks like legitimate, benign commands from being executed. But we can stop commands that, in an untrusted environment, look suspicious. This is specially the case of stream redirection (>), pipes (|), sequential (;) and conditional execution (&&, ||), command substitution ($(cmd)), and environment variables ($VAR).
๐ d) A secure environment is set
--secure-env is implied here. To run on a fully sanitized environment, run it like this: --secure-cmds --secure-env-full.
โจ 22. MISCELLANEOUS NOTES โจ
๐ฅ Sequential and conditional execution of commands ๐ฅ
For each of the internal commands (see the COMMANDS section above ๐) you can use the semicolon to execute them sequentially and/or the double ampersand to execute them conditionally. For example: cmd1; cmd2 && cmd3.
Though you can use external commands here as well, bear in mind that whenever at least one internal command is involved in a chained list of commands, clifm will take care of executing this list (simply because the system shell is not able to understand any of these commands), so that no shell inter-process function (like pipes), nor any stream redirection or shell expression (like IF blocks or FOR loops) will be available. However, the shell is still used to run single external commands found in the chained list โ just in isolation from the remaining commands in that list.
โ ๏ธ as a rule of thumb: when using chained commands, always expand ELNs to avoid undesired consequences. If, for instance, you issue this command:touch aaa && r 3, you will end up deleting a file you were not intending to delete โ simply because after the successful execution of the first command, the ELN3now corresponds to a different file. ๐ญ
๐ External commands ๐
clifm is not limited to its own set of internal commands, like open, sel, trash, etc. It can run external commands too โ provided external commands are allowed (see the -x option, the ext command, and the ExternalCommands option in the configuration file).
External commands are executed using the system shell (say, /bin/sh), which clifm specifies like this:
- If the
CLIFM_SHELLenvironment variable is set, this value is used. - If the
SHELLenvironment variable is set, this value is used. - If none of the above, the value is taken from the
passwddatabase (viagetpwuid(3)).
The shell is invoked as follows: SHELL -c 'CMD ARG...', for example, /bin/sh -c 'ls -l'.
By beginning the external command with a colon or a semicolon (':', ';') you tell clifm not to parse the input string, but instead to let the system shell handle that task. ๐ซถ
๐ซง bear in mind that clifm is not intended to be used as a shell, but as the file manager it is. iykyk.
๐ Terminal emulators and non-ASCII characters ๐
It depends on the terminal emulator you use whether non-ASCII characters and characters from the extended ASCII charset display correctly. If, for example, you create a file named "รฑandรบ" (the Spanish word for ยดrheaยด), it will be correctly displayed by the Linux console, Lxterminal, and Urxvt โ but not thus by more basic terminal emulators like Aterm.
๐ธ Spaces and filenames ๐ธ
When dealing with filenames containing spaces, you can use both single and double quotes (e.g., "this file" or 'this file') plus the backslash character (e.g., this\ file).
๐ฆ Default profile ๐ฆ
clifm's default profile is default. To create alternative profiles, use the -P command-line option or the pf add command (see above).
๐ 23. FILES ๐พ
๐๏ธ CONFIGURATION FILE
Okay bestie, so the main config file gets hunted down in this exact order, no skipping:
- the
-c,--config-fileswitch - the
$CLIFMRCvariable - the
$XDG_CONFIG_HOME/clifm/profiles/PROFILE/clifmrcdirectory
If $XDG_CONFIG_HOME isn't set, then $HOME/.config gets used instead. And if you're running with secure-environment (so that's either --secure-cmds, --secure-env, or --secure-env-full) then no environment variable is read at all, so the home directory comes from the password database instead (via getpwuid(3)). ๐
PROFILE is default by default โ unless you set it with -P/--profile.
You can reach the config file either with the config command or by pressing F10. โจ
And every option in the config file has a lil description right there inside the config file itself. Self-documenting queen. ๐
๐ฆ PROFILE FILE
The profile file lives at $XDG_CONFIG_HOME/clifm/profiles/PROFILE/profile.clifm. In here you can drop the commands you want run at startup. You can also permanently set custom variables here, like dir="/path/to/dir". That variable can then act as a shortcut to that directory, for instance: cd $dir. ๐
Custom variables can also be defined temporarily right at the command prompt: e.g., user@hostname ~ $ var="This is a test". Temporary variables get yeeted at program exit, fr. And heads up: internal variables are disabled by default โ turn them on with the --int-vars command-line switch.
๐ธ PROMPTS FILE
This file holds your prompt definitions and it's chillin' at DATADIR/clifm/prompts.clifm. It gets copied automatically to $XDG_CONFIG_HOME/clifm/prompts.clifm if it doesn't already exist. The Prompt line in the color scheme file should point to one of the prompt names defined in this file. More deets in the PROMPT section. ๐
โจ๏ธ KEYBINDINGS FILE
The keybindings file is $XDG_CONFIG_HOME/clifm/keybindings,cfm. It gets copied from DATADIR/clifm (usually /usr/share/clifm), and if it's not found, it gets created fresh with default values. This file is where you specify the keyboard shortcuts for some of ClifM's functions. The format for each keybinding is always "keyseq:function", where keyseq is an escape sequence in GNU emacs style. There's a more detailed explanation inside the keybindings file itself. ๐ซถ
๐งฉ PLUGINS DIRECTORY
The directory where programs or scripts pointed to by actions live (in other words, plugins, bestie) is DATADIR/clifm/plugins (usually /usr/share/clifm/plugins). Wanna edit these plugins? Copy them to $XDG_CONFIG_HOME/clifm/plugins and edit away to your heart's content. Plugins in this local directory take precedence over the ones in the system one. ๐
๐ COLORS DIRECTORY
This directory, $DATADIR/clifm/colors, is packed with available color schemes (or just themes, we're chill like that) as files with a .clifm extension. You can copy these themes to the local colors directory ($XDG_CONFIG_HOME/clifm/colors) and edit them however you like โ or build brand new themes from the ground up, main character energy. โจ
Themes in the local colors directory take precedence over those in the system directory. And you can make as many themes as you want just by dropping them into the local colors directory. The default color scheme file (default.clifm) works as your guide. ๐
โก ACTIONS FILE
The file used to define custom actions is $XDG_CONFIG_HOME/clifm/profiles/PROFILE/actions.clifm. It gets copied from DATADIR/clifm (usually /usr/share/clifm), and if it's not found, it gets created anew with default values. ๐
๐ MIMELIST FILE
The mimelist file is $XDG_CONFIG_HOME/clifm/profiles/PROFILE/mimelist.clifm. It's a list of file types and name/extensions plus their associated applications, used by lira. It gets copied from DATADIR/clifm (usually /usr/share/clifm). ๐
๐ PREVIEW FILE
The preview file is $XDG_CONFIG_HOME/clifm/profiles/PROFILE/preview.clifm and it's shotgun's configuration file. It uses the exact same syntax as the mimelist file. It gets copied from DATADIR/clifm (usually /usr/share/clifm). ๐ฅ
๐ BOOKMARKS FILE
The bookmarks file is $XDG_CONFIG_HOME/clifm/profiles/PROFILE/bookmarks.clifm. Just the list of the user's bookmarks, used by the bookmarks function. Simple as that. โญ
๐ฐ๏ธ HISTORY FILE
The history file is ~/.config/clifm/profiles/PROFILE/history.clifm. A list of commands entered by the user, used by the history function. ๐
๐ COMMANDS LOG FILE
The commands log file is $XDG_CONFIG_HOME/clifm/profiles/PROFILE/cmdlogs.clifm. Command logs keep track of the commands you enter on the command line. These logs look like this: "[date] current_working_directory:command". ๐
๐ฌ MESSAGES LOG FILE
The messages log file is $XDG_CONFIG_HOME/clifm/profiles/PROFILE/msglogs.clifm. Message logs are a record of errors and warnings, and they look like this: "[date] message". ๐
๐ฆ KANGAROO DATABASE
The directory jumper database is stored in $XDG_CONFIG_HOME/clifm/profiles/PROFILE/jump.clifm. ๐ฆโจ
Note: If$XDG_CONFIG_HOMEis not set,$HOME/.config/is used instead.
โจ 24. EXAMPLES โจ
Note 1: Always try TAB. Tab completion is available for so many things, bestie, use it. ๐
Note 2: Suggestions for possible completions are printed next to the text you've typed so far. To accept the given suggestion, press Right (or Alt+f to accept only the first/next suggested word). Otherwise, the suggestion is just ignored. ๐
Get help: F1: manpage F2: keybindings F3: commands
๐งญ 1. NAVIGATION
the cheat sheet โจ โ type the thing on the left, get the thing on the right, periodt:
/etcโ change directory to/etc(1)5โ change to the directory whose ELN is5(2)j <TAB>(alsodh <TAB>) โ navigate through visited directories ๐ฆj xprojโ jump to~/media/data/docs/work/mike/xproject(3)b(Shift+Left,Alt+j) โ go back in the directory history listf(Shift+Right,Alt+k) โ go forth in the directory history list..(Shift+Up,Alt+u) โ change to the parent directory...โ change to the parent directory of the current parent directory (4)bd wโ change to the parent directory matching"w"(5)ws2(Alt+2) โ switch to the second workspace (6)/*.pdf<TAB>โ list PDF files (current dir)=x<TAB>โ list executable files (current dir) (7)@gzip<TAB>โ list files (current dir) whose MIME type includes"gzip"pin mydirโ pin the directory namedmydir,โ change to pinned directory ๐view(Alt+-) โ preview files (current dir) (8)pg(Alt+0) โ run MAS, the file pager, on the current directory
(1) cd /etc also works, bestie ๐
(2) press TAB to make sure 5 is the file you actually want, or just pay attention to the suggestion. Press Right to accept the given suggestion.
(3) this depends on the database ranking, so it's giving โจvibesโจ. For more accuracy: j mike xproj. Tab completion is available too: j xproj<TAB>
(4) this is the fastback function: each subsequent dot after the two first dots is understood as an extra "/.."
(5) type bd <TAB> to list all parent directories
(6) Alt+[1-4] is available for workspaces 1-4
(7) type =<TAB> to get the list of available file type characters. Consult the FILE FILTERS section above for more information
(8) this feature depends on fzf(1)
๐๏ธ 2. FILE OPERATIONS ๐๏ธ
myfile.txtโ openmyfile.txtwith whatever app it's associated with by default ๐myfile.txt viโ openmyfile.txtusingvi(1) โจ24&โ open the file whose ELN is 24, but in the background (the&is doing the heavy lifting bestie)n myfile mydir/โ create a new file calledmyfileand a new directory calledmydir(2)(3) ๐p4โ print the properties of the file whose ELN is 4pc myfile.txtโ edit the permission set ofmyfile.txt(and if you wanna mess with ownership instead, that'soc's job) ๐s *.cโ select every.cfile chillin' in the current directorys /media/*<TAB>โ interactively select files inside the directory/media(4) ๐ฆs 1-4 8 19-26โ select a whole bunch of files in the current directory by ELN, ranges and allsb (sel<TAB> or s:<TAB>)โ list out the selected files (5) ๐ds (ds <TAB>)โ selectively deselect files through a menu, no capbm add mydir/ mybmโ bookmark the directorymydir/under the namemybm๐bm mybm (b:mybm)โ jump to the bookmark namedmybm(6)bm del mybmโ yeet the bookmark namedmybmout of existencebm (Alt+b or b:<TAB>)โ open the bookmark manager, periodtt 1-3 *.oldโ trash a few files at once ๐๏ธu (u <TAB>)โ selectively restore trashed files using a menu, giving them their main character moment backt del (t del <TAB>)โ selectively remove files from the trash can using a menut emptyโ empty the trash can entirely ๐ta *.pdf :mypdfsโ tag every PDF in the current directory asmypdfs๐ท๏ธp t:mypdfsโ print the file properties of all the files taggedmypdfs/*.pdfโ search for all PDF files in the current directory ๐c selโ copy the selected files into the current directoryc *.txt 2โ copy all txt files to the directory whose ELN is 2r selโ remove all the selected files (7) ๐ญm4โ rename the file whose ELN is 4 (8) โ๏ธ
Okay so, the little footnotes from that table, bestie โ they matter, don't skip them ๐
- Use the
owcommand to select the opening application from a menu:ow myfile.txtorow myfile.txt <TAB> - Note the ending slash in the directory name
- Since clifm is integrated to the system shell, you can also use any of the shell commands you usually use to create new files. E.g.,
touch myfileornano myfile - Only for non-standard tab completion: fzf, fnf, smenu
- You can also TAB expand the sel keyword:
p sel<TAB>to list selected files (and optionally mark multiple selected files to operate on) - Type
bm <TAB>to get the list of available bookmark names - To remove files in bulk use the rr command
- To rename files in bulk use the br command
๐ 3. MISC ๐
hh(Alt+.) โ toggle hidden files ๐ll(Alt+l) โ toggle long-viewrf(Enter-on empty line- orCtrl+l) โ clear/refresh the screenAlt+,โ toggle list-directories-onlyAlt+Tab,Ctrl+Alt+iโ toggle disk usage analyzer mode!<TAB>โ navigate through the command historyconfig(F10) โ view/edit the main configuration filepf set testโ change to profiletestactionsโ list available actions/pluginsicons onโ want icons? ๐cs(cs <TAB>) โ list available color schemesprompt(prompt <TAB>) โ list available promptsqโ Iยดm tired, quit ๐ญ
There is a lot more you can do, but this should be enough to get started. no cap, you're literally already a clifm girlie now ๐
โจ EXIT STATUS โจ
Clifm returns the exit status of the last executed command. periodt โ that's the whole vibe check.
๐ LICENSE ๐
This program is distributed under the terms of the GNU GPL version 2 or later <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. like, none, bestie, it's giving "you break it, you bought it" energy ๐
๐ BUG AND FEATURE REQUESTS ๐
Report at <https://github.com/leo-arch/clifm/issues> โ the devs genuinely want to hear it, so spill ๐ซถ
๐ AUTHOR ๐
L. M. Abramovich <leo.clifm@outlook.com>
For additional contributors, run git shortlog -s on the clifm.git repository. the whole squad, honored โจ
And that's the whole page, bestie!! ๐ clifm 1.28, dated May 28, 2026, living its best life as CLIFM(1). Now go open a terminal and slay ๐
๐ฆ๐ธ
๐ฆ where this page comes from
- alpine 3.24: clifm-doc 1.28-r0 ยท GPL-2.0-or-later
- epel 10: clifm 1.28-1.el10_3 ยท GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only
- epel 9: clifm 1.28-1.el9 ยท GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only
- fedora 44: clifm 1.28-1.fc44 ยท GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only
- ubuntu stonking: clifm 1.28-1 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms