···1+# This is `bat`s configuration file. Each line either contains a comment or
2+# a command-line option that you want to pass to `bat` by default. You can
3+# run `bat --help` to get a list of all possible configuration options.
4+5+# Specify desired highlighting theme (e.g. "TwoDark"). Run `bat --list-themes`
6+# for a list of all available themes
7+--theme="TwoDark"
8+9+# Enable this to use italic text on the terminal. This is not supported on all
10+# terminal emulators (like tmux, by default):
11+#--italic-text=always
12+13+# Uncomment the following line to disable automatic paging:
14+#--paging=never
15+16+# Uncomment the following line if you are using less version >= 551 and want to
17+# enable mouse scrolling support in `bat` when running inside tmux. This might
18+# disable text selection, unless you press shift.
19+#--pager="less --RAW-CONTROL-CHARS --quit-if-one-screen --mouse"
20+21+# Syntax mappings: map a certain filename pattern to a language.
22+# Example 1: use the C++ syntax for Arduino .ino files
23+# Example 2: Use ".gitignore"-style highlighting for ".ignore" files
24+--map-syntax "*.ino:C++"
25+#--map-syntax ".ignore:Git Ignore"
···1+complete --command nvm --exclusive --long version --description "Print version"
2+complete --command nvm --exclusive --long help --description "Print help"
3+4+complete --command nvm --exclusive --condition __fish_use_subcommand --arguments install --description "Download and activate the specified Node version"
5+complete --command nvm --exclusive --condition __fish_use_subcommand --arguments use --description "Activate a version in the current shell"
6+complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list --description "List installed versions"
7+complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list-remote --description "List versions available to install matching optional regex"
8+complete --command nvm --exclusive --condition __fish_use_subcommand --arguments current --description "Print the currently-active version"
9+complete --command nvm --exclusive --condition "__fish_seen_subcommand_from install" --arguments "(
10+ test -e $nvm_data && string split ' ' <$nvm_data/.index
11+)"
12+complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use" --arguments "(_nvm_list | string split ' ')"
13+complete --command nvm --exclusive --condition __fish_use_subcommand --arguments uninstall --description "Uninstall a version"
14+complete --command nvm --exclusive --condition "__fish_seen_subcommand_from uninstall" --arguments "(
15+ _nvm_list | string split ' ' | string replace system ''
16+)"
17+complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use uninstall" --arguments "(
18+ set --query nvm_default_version && echo default
19+)"
+28
fish/conf.d/nvm.fish
···0000000000000000000000000000
···1+function _nvm_install --on-event nvm_install
2+ set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share
3+ set --universal nvm_data $XDG_DATA_HOME/nvm
4+ set --query nvm_mirror || set --universal nvm_mirror https://nodejs.org/dist
5+6+ test ! -d $nvm_data && command mkdir -p $nvm_data
7+ echo "Downloading the Node distribution index..." 2>/dev/null
8+ _nvm_index_update $nvm_mirror $nvm_data/.index
9+end
10+11+function _nvm_update --on-event nvm_update
12+ set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share
13+ set --universal nvm_data $XDG_DATA_HOME/nvm
14+ set --query nvm_mirror || set --universal nvm_mirror https://nodejs.org/dist
15+end
16+17+function _nvm_uninstall --on-event nvm_uninstall
18+ command rm -rf $nvm_data
19+20+ set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version
21+22+ set --names | string replace --filter --regex -- "^nvm" "set --erase nvm" | source
23+ functions --erase (functions --all | string match --entire --regex -- "^_nvm_")
24+end
25+26+if status is-interactive && set --query nvm_default_version && ! set --query nvm_current_version
27+ nvm use $nvm_default_version >/dev/null
28+end
+23
fish/config.fish
···00000000000000000000000
···1+if status is-interactive
2+ # Commands to run in interactive sessions can go here
3+ starship init fish | source
4+ zoxide init fish | source
5+6+ # Aliases
7+ alias ls="exa"
8+ alias lt="exa -T"
9+ alias lT="exa -Tlh --no-user --no-time"
10+ alias ll="exa -lh --no-user"
11+ alias la="exa -lha --git --no-user"
12+13+ # Global Variables
14+15+ # Languages
16+ ## Go
17+ set -x GOROOT "$(brew --prefix golang)/libexec"
18+ set -x GOPATH $HOME/go
19+ set -x PATH $PATH $GOROOT/bin $GOPATH/bin
20+21+ ## Flutter
22+ set -x PATH $PATH "/opt/homebrew/Caskroom/flutter/2.10.4/flutter/bin"
23+end
···1+function _nvm_list
2+ set --local versions $nvm_data/*
3+ set --query versions[1] &&
4+ string match --entire --regex -- (string match --regex -- "v\d.+" $versions |
5+ string escape --style=regex |
6+ string join "|"
7+ ) <$nvm_data/.index
8+9+ command --all node |
10+ string match --quiet --invert --regex -- "^$nvm_data" && echo system
11+end
+4
fish/functions/_nvm_version_activate.fish
···0000
···1+function _nvm_version_activate --argument-names v
2+ set --global --export nvm_current_version $v
3+ set --prepend PATH $nvm_data/$v/bin
4+end
+5
fish/functions/_nvm_version_deactivate.fish
···00000
···1+function _nvm_version_deactivate --argument-names v
2+ test "$nvm_current_version" = "$v" && set --erase nvm_current_version
3+ set --local index (contains --index -- $nvm_data/$v/bin $PATH) &&
4+ set --erase PATH[$index]
5+end
···1+# interpreter for shell commands
2+set shell sh
3+4+# set '-eu' options for shell commands
5+# These options are used to have safer shell commands. Option '-e' is used to
6+# exit on error and option '-u' is used to give error for unset variables.
7+# Option '-f' disables pathname expansion which can be useful when $f, $fs, and
8+# $fx variables contain names with '*' or '?' characters. However, this option
9+# is used selectively within individual commands as it can be limiting at
10+# times.
11+set shellopts '-eu'
12+13+# set internal field separator (IFS) to "\n" for shell commands
14+# This is useful to automatically split file names in $fs and $fx properly
15+# since default file separator used in these variables (i.e. 'filesep' option)
16+# is newline. You need to consider the values of these options and create your
17+# commands accordingly.
18+set ifs "\n"
19+20+# leave some space at the top and the bottom of the screen
21+set scrolloff 10
22+23+# == previewer ==
24+set previewer ~/.config/lf/previewer.sh
25+26+# use enter for shell commands
27+map <enter> shell
28+29+# execute current file (must be executable)
30+map x $$f
31+map X !$f
32+33+# dedicated keys for file opener actions
34+map o &mimeopen $f
35+map O $mimeopen --ask $f
36+37+# define a custom 'open' command
38+# This command is called when current file is not a directory. You may want to
39+# use either file extensions and/or mime types here. Below uses an editor for
40+# text files and a file opener for the rest.
41+cmd open ${{
42+ test -L $f && f=$(readlink -f $f)
43+ case $(file --mime-type $f -b) in
44+ text/*) $EDITOR $fx;;
45+ *) for f in $fx; do setsid $OPENER $f > /dev/null 2> /dev/null & done;;
46+ esac
47+}}
48+49+# define a custom 'rename' command without prompt for overwrite
50+# cmd rename %[ -e $1 ] && printf "file exists" || mv $f $1
51+# map r push :rename<space>
52+53+# make sure trash folder exists
54+# %mkdir -p ~/.trash
55+56+# move current file or selected files to trash folder
57+# (also see 'man mv' for backup/overwrite options)
58+cmd trash %set -f; mv $fx ~/.trash
59+60+# define a custom 'delete' command
61+# cmd delete ${{
62+# set -f
63+# printf "$fx\n"
64+# printf "delete?[y/n]"
65+# read ans
66+# [ "$ans" = "y" ] && rm -rf $fx
67+# }}
68+69+# use '<delete>' key for either 'trash' or 'delete' command
70+# map <delete> trash
71+# map <delete> delete
72+73+# extract the current file with the right command
74+# (xkcd link: https://xkcd.com/1168/)
75+cmd extract ${{
76+ set -f
77+ case $f in
78+ *.tar.bz|*.tar.bz2|*.tbz|*.tbz2) tar xjvf $f;;
79+ *.tar.gz|*.tgz) tar xzvf $f;;
80+ *.tar.xz|*.txz) tar xJvf $f;;
81+ *.zip) unzip $f;;
82+ *.rar) unrar x $f;;
83+ *.7z) 7z x $f;;
84+ esac
85+}}
86+87+# compress current file or selected files with tar and gunzip
88+cmd tar ${{
89+ set -f
90+ mkdir $1
91+ cp -r $fx $1
92+ tar czf $1.tar.gz $1
93+ rm -rf $1
94+}}
95+96+# compress current file or selected files with zip
97+cmd zip ${{
98+ set -f
99+ mkdir $1
100+ cp -r $fx $1
101+ zip -r $1.zip $1
102+ rm -rf $1
103+}}
+9
lf/previewer.sh
···000000000
···1+#!/bin/sh
2+3+# check here : https://www.youtube.com/watch?v=50BMBT05Wk0
4+5+case ${1##*.} in
6+ 7z|zip) 7z l -p -- "$1" && exit 1;;
7+ jpeg|jpg|png|gif) chafa --clear --animate=off --symbols space -s "$2x$3" "$1" && exit 1;;
8+ *) bat --style=plain --color=always "$1" || cat "$1" && exit 1;;
9+esac