···11+# This is `bat`s configuration file. Each line either contains a comment or
22+# a command-line option that you want to pass to `bat` by default. You can
33+# run `bat --help` to get a list of all possible configuration options.
44+55+# Specify desired highlighting theme (e.g. "TwoDark"). Run `bat --list-themes`
66+# for a list of all available themes
77+--theme="TwoDark"
88+99+# Enable this to use italic text on the terminal. This is not supported on all
1010+# terminal emulators (like tmux, by default):
1111+#--italic-text=always
1212+1313+# Uncomment the following line to disable automatic paging:
1414+#--paging=never
1515+1616+# Uncomment the following line if you are using less version >= 551 and want to
1717+# enable mouse scrolling support in `bat` when running inside tmux. This might
1818+# disable text selection, unless you press shift.
1919+#--pager="less --RAW-CONTROL-CHARS --quit-if-one-screen --mouse"
2020+2121+# Syntax mappings: map a certain filename pattern to a language.
2222+# Example 1: use the C++ syntax for Arduino .ino files
2323+# Example 2: Use ".gitignore"-style highlighting for ".ignore" files
2424+--map-syntax "*.ino:C++"
2525+#--map-syntax ".ignore:Git Ignore"
···11+if status is-interactive
22+ # Commands to run in interactive sessions can go here
33+ starship init fish | source
44+ zoxide init fish | source
55+66+ # Aliases
77+ alias ls="exa"
88+ alias lt="exa -T"
99+ alias lT="exa -Tlh --no-user --no-time"
1010+ alias ll="exa -lh --no-user"
1111+ alias la="exa -lha --git --no-user"
1212+1313+ # Global Variables
1414+1515+ # Languages
1616+ ## Go
1717+ set -x GOROOT "$(brew --prefix golang)/libexec"
1818+ set -x GOPATH $HOME/go
1919+ set -x PATH $PATH $GOROOT/bin $GOPATH/bin
2020+2121+ ## Flutter
2222+ set -x PATH $PATH "/opt/homebrew/Caskroom/flutter/2.10.4/flutter/bin"
2323+end
···11+function _nvm_version_deactivate --argument-names v
22+ test "$nvm_current_version" = "$v" && set --erase nvm_current_version
33+ set --local index (contains --index -- $nvm_data/$v/bin $PATH) &&
44+ set --erase PATH[$index]
55+end
···11+# interpreter for shell commands
22+set shell sh
33+44+# set '-eu' options for shell commands
55+# These options are used to have safer shell commands. Option '-e' is used to
66+# exit on error and option '-u' is used to give error for unset variables.
77+# Option '-f' disables pathname expansion which can be useful when $f, $fs, and
88+# $fx variables contain names with '*' or '?' characters. However, this option
99+# is used selectively within individual commands as it can be limiting at
1010+# times.
1111+set shellopts '-eu'
1212+1313+# set internal field separator (IFS) to "\n" for shell commands
1414+# This is useful to automatically split file names in $fs and $fx properly
1515+# since default file separator used in these variables (i.e. 'filesep' option)
1616+# is newline. You need to consider the values of these options and create your
1717+# commands accordingly.
1818+set ifs "\n"
1919+2020+# leave some space at the top and the bottom of the screen
2121+set scrolloff 10
2222+2323+# == previewer ==
2424+set previewer ~/.config/lf/previewer.sh
2525+2626+# use enter for shell commands
2727+map <enter> shell
2828+2929+# execute current file (must be executable)
3030+map x $$f
3131+map X !$f
3232+3333+# dedicated keys for file opener actions
3434+map o &mimeopen $f
3535+map O $mimeopen --ask $f
3636+3737+# define a custom 'open' command
3838+# This command is called when current file is not a directory. You may want to
3939+# use either file extensions and/or mime types here. Below uses an editor for
4040+# text files and a file opener for the rest.
4141+cmd open ${{
4242+ test -L $f && f=$(readlink -f $f)
4343+ case $(file --mime-type $f -b) in
4444+ text/*) $EDITOR $fx;;
4545+ *) for f in $fx; do setsid $OPENER $f > /dev/null 2> /dev/null & done;;
4646+ esac
4747+}}
4848+4949+# define a custom 'rename' command without prompt for overwrite
5050+# cmd rename %[ -e $1 ] && printf "file exists" || mv $f $1
5151+# map r push :rename<space>
5252+5353+# make sure trash folder exists
5454+# %mkdir -p ~/.trash
5555+5656+# move current file or selected files to trash folder
5757+# (also see 'man mv' for backup/overwrite options)
5858+cmd trash %set -f; mv $fx ~/.trash
5959+6060+# define a custom 'delete' command
6161+# cmd delete ${{
6262+# set -f
6363+# printf "$fx\n"
6464+# printf "delete?[y/n]"
6565+# read ans
6666+# [ "$ans" = "y" ] && rm -rf $fx
6767+# }}
6868+6969+# use '<delete>' key for either 'trash' or 'delete' command
7070+# map <delete> trash
7171+# map <delete> delete
7272+7373+# extract the current file with the right command
7474+# (xkcd link: https://xkcd.com/1168/)
7575+cmd extract ${{
7676+ set -f
7777+ case $f in
7878+ *.tar.bz|*.tar.bz2|*.tbz|*.tbz2) tar xjvf $f;;
7979+ *.tar.gz|*.tgz) tar xzvf $f;;
8080+ *.tar.xz|*.txz) tar xJvf $f;;
8181+ *.zip) unzip $f;;
8282+ *.rar) unrar x $f;;
8383+ *.7z) 7z x $f;;
8484+ esac
8585+}}
8686+8787+# compress current file or selected files with tar and gunzip
8888+cmd tar ${{
8989+ set -f
9090+ mkdir $1
9191+ cp -r $fx $1
9292+ tar czf $1.tar.gz $1
9393+ rm -rf $1
9494+}}
9595+9696+# compress current file or selected files with zip
9797+cmd zip ${{
9898+ set -f
9999+ mkdir $1
100100+ cp -r $fx $1
101101+ zip -r $1.zip $1
102102+ rm -rf $1
103103+}}