Back to Superfile

superfile config

website/src/content/docs/configure/superfile-config.mdx

1.5.07.7 KB
Original Source

import CodeBlock from "../../../components/code.astro";

You can edit your superfile config file with the following command:

bash
$EDITOR config_path

:::tip To see the path locations of your superfile files, use the command spf pl. :::

Setting

  • theme

Click here for instructions to edit the theme.

  • editor

The editor your files will be opened with (Leave blank to use the EDITOR environment variable. If EDITOR environment variable is not set, it will default to nano for macOS/Linux, and notepad for Windows.

  • dir_editor

The editor your directories will be opened with (Leave blank to use defaults : vi - Linux, open - macOS, explorer - Windows).

  • auto_check_update

true => Checks whether updates are needed when you exit superfile (only checks once a day).

false => No checks performed.

  • cd_on_quit

true => When you exit superfile, changes the terminal path to the last file panel you used.

false => When you exit superfile, the terminal path remains the same prior to superfile.

After setting to true, you need to update your shell config file. Sample changes :

macOS/Linux (bash or fish)
Bash

Open the file:

bash
$EDITOR ~/.bashrc

Copy the following code into the file:

<CodeBlock file="cd_on_quit/cd_on_quit.sh" />

Save, exit, and reload your .bashrc file:

bash
source ~/.bashrc
Fish

Open the file:

bash
$EDITOR ~/.config/fish/config.fish

If you suspect your config.fish file is located somewhere else, read the Fish shell documentation

Copy the following code into the file:

<CodeBlock file="cd_on_quit/cd_on_quit.fish" />

Save, exit, and reload config.fish:

bash
source ~/.config/fish/config.fish
Windows (Powershell)

Open the file:

powershell
notepad $PROFILE

Copy the following code into the file:

<CodeBlock file="cd_on_quit/cd_on_quit.ps1" />

Save, exit, and reload your profile.

powershell
. $PROFILE

:::note You need to make sure powershell is allowed to execute script. If you get error like running scripts is disabled on this system. You need to allow it.

Example command to enable - Set-ExecutionPolicy -ExecutionPolicy RemoteSigned :::

  • default_open_file_preview

true => Shows the file preview window when you run superfile.

false => Hides the file preview window when you run a superfile.

  • show_image_preview

true => Shows the image preview in file preview panel when an image file is selected.

false => Does not show the image preview.

  • show_panel_footer_info

true => Shows additional footer info for file panel like panel mode and sort type.

false => Does not show additional footer info for file panel

  • file_size_use_si

true => Displays the file/directory sizes using powers of 1000 (kB, MB, GB).

false => Displays the file/directory sizes using powers of 1024 (KiB, MiB, GiB).

  • default_directory

The default location every time superfile is opened. Supports ~ and .

  • default_sort_type

File panel sorting type. Directories will always be displayed at the top.

0 => Name

1 => Size

2 => Date Modified

3 => Type

4 => Natural

  • sort_order_reversed

File panel sorting order.

false => Ascending (a-z)

true => Descending (z-a)

  • case_sensitive_sort

File panel sorting case sensitivity (if true, uppercase letters come before lowercase letters).

true => Case sensitive ("B" comes before "a")

false => Case insensitive ("a" comes before "B")

  • debug

Whether to enable debug mode. (if true, more verbose logs are written in log file).

true => DEBUG, INFO, WARN, ERROR logs are written to log file

false => INFO, WARN, ERROR logs are written to log file

  • ignore_missing_fields

Controls whether warnings about missing fields in the config file are displayed.

true => No warnings will be shown when fields are missing from the config file

false => Warnings will be shown for any missing fields in the config file

  • page_scroll_size

Number of lines to scroll when using PgUp/PgDown keys.

0 => Full page scroll (default behavior)

n (where n > 0) => Scroll exactly n lines

  • file_panel_extra_columns

Count of extra columns in file panel in addition to file name.

0 => Extra columns feature is disabled 1 => Also show size column 2 => Also show modify date 3 => Also show permission column

:::caution Even though the extra columns are enabled, they will be hidden if the size of the filepanel is small. Please either increase the size or adjust the file_panel_name_percent config if you don't see the columns. :::

  • file_panel_name_percent

Percentage of file panel width allocated to file names (25-100). Higher values give more space to names, less to extra columns.

Style

  • code_previewer

'' => Use the builtin syntax highlighting for code files with chroma. 'bat' => Use syntax highlighting provided by the bat command line tool.

  • nerdfont

true => Use nerdfont for directories and file icons.

false => Dont use nerdfont. If you don't have or don't want Nerdfont installed you can turn this off

  • show_select_icons

true => Show checkbox icons in select mode.

false => Don't show checkbox icons in select mode.

:::note This setting is ignored unless nerdfont = true. Both nerdfont and show_select_icons must be true for checkbox icons to appear. :::

  • transparent_background

true => The background color is not rendered (transparent). This is useful if your terminal background is transparent.

false => The background is rendered (with color) to maintain theme consistency.

  • file_preview_width

This setting is an integer.

0 => The width of the file preview window is the same as the file panel.

X => The width of the file preview window is 1/X of the terminal width (minus the sidebar width). It is calculated as: (terminal width - sidebar width) / X

:::caution X must be from 2 to 10. :::

  • enable_file_preview_border

true => Enable border around the file preview panel

false => Disable border around the file preview panel

  • sidebar_width

This setting is an integer.

0 => The sidebar will not display.

X => The width of the sidebar(excluding borders).

:::caution X must be from 5 to 20. :::

  • sidebar_sections

Order of sidebar sections.

["home", "pinned", "disks"] => Default order.

Only sections included in this list will be displayed. You can remove sections or change their order, for example: ["pinned", "home"].

  • Border style

Here are a few suggested styles, of course you can change them to your own:

:::caution Make sure to add strings exactly one character wide. Use ' ' for borderless :::

toml
# ...
border_top = "━"
border_bottom = "━"
border_left = "┃"
border_right = "┃"
border_top_left = "┏"
border_top_right = "┓"
border_bottom_left = "┗"
border_bottom_right = "┛"
border_middle_left = "┣"
border_middle_right = "┫"
#...
toml
# ...
border_top = "─"
border_bottom = "─"
border_left = "│"
border_right = "│"
border_top_left = "╭"
border_top_right = "╮"
border_bottom_left = "╰"
border_bottom_right = "╯"
border_middle_left = "├"
border_middle_right = "┤"
#...
  • open_with

Allows users to map file extensions to commands used to open them. The file path will be appended as the last argument.

:::caution Must be at the very end of the file :::

toml
[open_with]
xopp = "xournalpp"
conf = "nvim"

Default superfile config

<CodeBlock file="src/superfile_config/config.toml" />