diff --git a/.config/fish/conf.d/rustup.fish b/.config/fish/conf.d/rustup.fish new file mode 100644 index 0000000..e4cb363 --- /dev/null +++ b/.config/fish/conf.d/rustup.fish @@ -0,0 +1 @@ +source "$HOME/.cargo/env.fish" diff --git a/.config/fish/conf.d/z.fish b/.config/fish/conf.d/z.fish deleted file mode 100644 index 59c960f..0000000 --- a/.config/fish/conf.d/z.fish +++ /dev/null @@ -1,63 +0,0 @@ -if test -z "$Z_DATA" - if test -z "$XDG_DATA_HOME" - set -U Z_DATA_DIR "$HOME/.local/share/z" - else - set -U Z_DATA_DIR "$XDG_DATA_HOME/z" - end - set -U Z_DATA "$Z_DATA_DIR/data" -end - -if test ! -e "$Z_DATA" - if test ! -e "$Z_DATA_DIR" - mkdir -p -m 700 "$Z_DATA_DIR" - end - touch "$Z_DATA" -end - -if test -z "$Z_CMD" - set -U Z_CMD z -end - -set -U ZO_CMD "$Z_CMD"o - -if test ! -z $Z_CMD - function $Z_CMD -d "jump around" - __z $argv - end -end - -if test ! -z $ZO_CMD - function $ZO_CMD -d "open target dir" - __z -d $argv - end -end - -if not set -q Z_EXCLUDE - set -U Z_EXCLUDE "^$HOME\$" -else if contains $HOME $Z_EXCLUDE - # Workaround: migrate old default values to a regex (see #90). - set Z_EXCLUDE (string replace -r -- "^$HOME\$" '^'$HOME'$$' $Z_EXCLUDE) -end - -# Setup completions once first -__z_complete - -function __z_on_variable_pwd --on-variable PWD - __z_add -end - -function __z_uninstall --on-event z_uninstall - functions -e __z_on_variable_pwd - functions -e $Z_CMD - functions -e $ZO_CMD - - if test ! -z "$Z_DATA" - printf "To completely erase z's data, remove:\n" >/dev/stderr - printf "%s\n" "$Z_DATA" >/dev/stderr - end - - set -e Z_CMD - set -e ZO_CMD - set -e Z_DATA - set -e Z_EXCLUDE -end diff --git a/.config/fish/config.fish b/.config/fish/config.fish index d3e4872..0b79290 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -4,3 +4,9 @@ if status is-interactive end set -gx EDITOR nvim + +fx --comp fish | source + +zoxide init fish | source + +fzf --fish | source diff --git a/.config/fish/fish_plugins b/.config/fish/fish_plugins index db4d0f1..fb065ce 100644 --- a/.config/fish/fish_plugins +++ b/.config/fish/fish_plugins @@ -1,4 +1,3 @@ jorgebucaran/fisher jhillyerd/plugin-git -jethrokuan/z jorgebucaran/nvm.fish diff --git a/.config/fish/fish_variables b/.config/fish/fish_variables index 77185d3..f25e0e1 100644 --- a/.config/fish/fish_variables +++ b/.config/fish/fish_variables @@ -1,19 +1,15 @@ # This file contains fish universal variable definitions. # VERSION: 3.0 SETUVAR --export ELECTRON_OZONE_PLATFORM_HINT:auto +SETUVAR --export FZF_DEFAULT_OPTS:\x2d\x2dwalker\x2dskip\x3d\x2esteam\x2c\x2evscode\x2c\x2ecargo\x2c\x2enpm\x2c\x2envm\x2cSteam SETUVAR --export --path PATH:/usr/local/bin\x1e/usr/local/sbin\x1e/usr/bin\x1e/usr/sbin\x1e/usr/local/go/bin SETUVAR --export RANGER_LOAD_DEFAULT_RC:FALSE -SETUVAR ZO_CMD:zo -SETUVAR Z_CMD:z -SETUVAR Z_DATA:/home/foton/\x2elocal/share/z/data SETUVAR Z_DATA_DIR:/home/foton/\x2elocal/share/z -SETUVAR Z_EXCLUDE:\x5e/home/foton\x24 SETUVAR __fish_initialized:3400 -SETUVAR _fisher_jethrokuan_2F_z_files:\x7e/\x2econfig/fish/functions/__z\x2efish\x1e\x7e/\x2econfig/fish/functions/__z_add\x2efish\x1e\x7e/\x2econfig/fish/functions/__z_clean\x2efish\x1e\x7e/\x2econfig/fish/functions/__z_complete\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/z\x2efish SETUVAR _fisher_jhillyerd_2F_plugin_2D_git_files:\x7e/\x2econfig/fish/functions/__git\x2ebranch_has_wip\x2efish\x1e\x7e/\x2econfig/fish/functions/__git\x2ecurrent_branch\x2efish\x1e\x7e/\x2econfig/fish/functions/__git\x2edefault_branch\x2efish\x1e\x7e/\x2econfig/fish/functions/__git\x2edestroy\x2efish\x1e\x7e/\x2econfig/fish/functions/__git\x2einit\x2efish\x1e\x7e/\x2econfig/fish/functions/gbage\x2efish\x1e\x7e/\x2econfig/fish/functions/gbda\x2efish\x1e\x7e/\x2econfig/fish/functions/gdv\x2efish\x1e\x7e/\x2econfig/fish/functions/gignored\x2efish\x1e\x7e/\x2econfig/fish/functions/glp\x2efish\x1e\x7e/\x2econfig/fish/functions/grename\x2efish\x1e\x7e/\x2econfig/fish/functions/grt\x2efish\x1e\x7e/\x2econfig/fish/functions/gtest\x2efish\x1e\x7e/\x2econfig/fish/functions/gtl\x2efish\x1e\x7e/\x2econfig/fish/functions/gunwip\x2efish\x1e\x7e/\x2econfig/fish/functions/gwip\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/git\x2efish SETUVAR _fisher_jorgebucaran_2F_fisher_files:\x7e/\x2econfig/fish/functions/fisher\x2efish\x1e\x7e/\x2econfig/fish/completions/fisher\x2efish SETUVAR _fisher_jorgebucaran_2F_nvm_2E_fish_files:\x7e/\x2econfig/fish/functions/_nvm_index_update\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_list\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_version_activate\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_version_deactivate\x2efish\x1e\x7e/\x2econfig/fish/functions/nvm\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/nvm\x2efish\x1e\x7e/\x2econfig/fish/completions/nvm\x2efish -SETUVAR _fisher_plugins:jorgebucaran/fisher\x1ejhillyerd/plugin\x2dgit\x1ejethrokuan/z\x1ejorgebucaran/nvm\x2efish +SETUVAR _fisher_plugins:jorgebucaran/fisher\x1ejhillyerd/plugin\x2dgit\x1ejorgebucaran/nvm\x2efish SETUVAR _fisher_upgraded_to_4_4:\x1d SETUVAR fish_color_autosuggestion:4c566a SETUVAR fish_color_cancel:\x2d\x2dreverse diff --git a/.config/fish/functions/__z.fish b/.config/fish/functions/__z.fish deleted file mode 100644 index f72ff0e..0000000 --- a/.config/fish/functions/__z.fish +++ /dev/null @@ -1,174 +0,0 @@ -function __z -d "Jump to a recent directory." - function __print_help -d "Print z help." - printf "Usage: $Z_CMD [-celrth] string1 string2...\n\n" - printf " -c --clean Removes directories that no longer exist from $Z_DATA\n" - printf " -d --dir Opens matching directory using system file manager.\n" - printf " -e --echo Prints best match, no cd\n" - printf " -l --list List matches and scores, no cd\n" - printf " -p --purge Delete all entries from $Z_DATA\n" - printf " -r --rank Search by rank\n" - printf " -t --recent Search by recency\n" - printf " -x --delete Removes the current directory from $Z_DATA\n" - printf " -h --help Print this help\n\n" - end - function __z_legacy_escape_regex - # taken from escape_string_pcre2 in fish - # used to provide compatibility with fish 2 - for c in (string split '' $argv) - if contains $c (string split '' '.^$*+()?[{}\\|-]') - printf \\ - end - printf '%s' $c - end - end - - set -l options h/help c/clean e/echo l/list p/purge r/rank t/recent d/directory x/delete - - argparse $options -- $argv - - if set -q _flag_help - __print_help - return 0 - else if set -q _flag_clean - __z_clean - printf "%s cleaned!\n" $Z_DATA - return 0 - else if set -q _flag_purge - echo >$Z_DATA - printf "%s purged!\n" $Z_DATA - return 0 - else if set -q _flag_delete - sed -i -e "\:^$PWD|.*:d" $Z_DATA - return 0 - end - - set -l typ - - if set -q _flag_rank - set typ rank - else if set -q _flag_recent - set typ recent - end - - set -l z_script ' - function frecent(rank, time) { - dx = t-time - if( dx < 3600 ) return rank*4 - if( dx < 86400 ) return rank*2 - if( dx < 604800 ) return rank/2 - return rank/4 - } - - function output(matches, best_match, common) { - # list or return the desired directory - if( list ) { - cmd = "sort -nr" - for( x in matches ) { - if( matches[x] ) { - printf "%-10s %s\n", matches[x], x | cmd - } - } - } else { - if( common ) best_match = common - print best_match - } - } - - function common(matches) { - # find the common root of a list of matches, if it exists - for( x in matches ) { - if( matches[x] && (!short || length(x) < length(short)) ) { - short = x - } - } - if( short == "/" ) return - for( x in matches ) if( matches[x] && index(x, short) != 1 ) { - return - } - return short - } - - BEGIN { - hi_rank = ihi_rank = -9999999999 - } - { - if( typ == "rank" ) { - rank = $2 - } else if( typ == "recent" ) { - rank = $3 - t - } else rank = frecent($2, $3) - if( $1 ~ q ) { - matches[$1] = rank - } else if( tolower($1) ~ tolower(q) ) imatches[$1] = rank - if( matches[$1] && matches[$1] > hi_rank ) { - best_match = $1 - hi_rank = matches[$1] - } else if( imatches[$1] && imatches[$1] > ihi_rank ) { - ibest_match = $1 - ihi_rank = imatches[$1] - } - } - - END { - # prefer case sensitive - if( best_match ) { - output(matches, best_match, common(matches)) - } else if( ibest_match ) { - output(imatches, ibest_match, common(imatches)) - } - } - ' - - set -l qs - for arg in $argv - set -l escaped $arg - if string escape --style=regex '' >/dev/null 2>&1 # use builtin escape if available - set escaped (string escape --style=regex $escaped) - else - set escaped (__z_legacy_escape_regex $escaped) - end - # Need to escape twice, see https://www.math.utah.edu/docs/info/gawk_5.html#SEC32 - set escaped (string replace --all \\ \\\\ $escaped) - set qs $qs $escaped - end - set -l q (string join '.*' $qs) - - if set -q _flag_list - # Handle list separately as it can print common path information to stderr - # which cannot be captured from a subcommand. - command awk -v t=(date +%s) -v list="list" -v typ="$typ" -v q="$q" -F "|" $z_script "$Z_DATA" - return - end - - set target (command awk -v t=(date +%s) -v typ="$typ" -v q="$q" -F "|" $z_script "$Z_DATA") - - if test "$status" -gt 0 - return - end - - if test -z "$target" - printf "'%s' did not match any results\n" "$argv" - return 1 - end - - if set -q _flag_echo - printf "%s\n" "$target" - else if set -q _flag_directory - if test -n "$ZO_METHOD" - type -q "$ZO_METHOD"; and "$ZO_METHOD" "$target"; and return $status - echo "Cannot open with ZO_METHOD set to $ZO_METHOD"; and return 1 - else if test "$OS" = Windows_NT - # Be careful, in msys2, explorer always return 1 - type -q explorer; and explorer "$target" - return 0 - echo "Cannot open file explorer" - return 1 - else - type -q xdg-open; and xdg-open "$target"; and return $status - type -q open; and open "$target"; and return $status - echo "Not sure how to open file manager"; and return 1 - end - else - pushd "$target" - end -end diff --git a/.config/fish/functions/__z_add.fish b/.config/fish/functions/__z_add.fish deleted file mode 100644 index 20d5d7e..0000000 --- a/.config/fish/functions/__z_add.fish +++ /dev/null @@ -1,49 +0,0 @@ -function __z_add -d "Add PATH to .z file" - test -n "$fish_private_mode"; and return 0 - - for i in $Z_EXCLUDE - if string match -r $i $PWD >/dev/null - return 0 #Path excluded - end - end - - set -l tmpfile (mktemp $Z_DATA.XXXXXX) - - if test -f $tmpfile - set -l path (string replace --all \\ \\\\ $PWD) - command awk -v path=$path -v now=(date +%s) -F "|" ' - BEGIN { - rank[path] = 1 - time[path] = now - } - $2 >= 1 { - if( $1 == path ) { - rank[$1] = $2 + 1 - time[$1] = now - } - else { - rank[$1] = $2 - time[$1] = $3 - } - count += $2 - } - END { - if( count > 1000 ) { - for( i in rank ) print i "|" 0.9*rank[i] "|" time[i] # aging - } - else for( i in rank ) print i "|" rank[i] "|" time[i] - } - ' $Z_DATA 2>/dev/null >$tmpfile - - if test ! -z "$Z_OWNER" - chown $Z_OWNER:(id -ng $Z_OWNER) $tmpfile - end - # - # Don't use redirection here as it can lead to a race condition where $Z_DATA is clobbered. - # Note: There is a still a possible race condition where an old version of $Z_DATA is - # read by one instance of Fish before another instance of Fish writes its copy. - # - command mv $tmpfile $Z_DATA - or command rm $tmpfile - end -end diff --git a/.config/fish/functions/__z_clean.fish b/.config/fish/functions/__z_clean.fish deleted file mode 100644 index ae1721a..0000000 --- a/.config/fish/functions/__z_clean.fish +++ /dev/null @@ -1,11 +0,0 @@ -function __z_clean -d "Clean up .z file to remove paths no longer valid" - set -l tmpfile (mktemp $Z_DATA.XXXXXX) - - if test -f $tmpfile - while read line - set -l path (string split '|' $line)[1] - test -d $path; and echo $line - end <$Z_DATA >$tmpfile - command mv -f $tmpfile $Z_DATA - end -end diff --git a/.config/fish/functions/__z_complete.fish b/.config/fish/functions/__z_complete.fish deleted file mode 100644 index a626456..0000000 --- a/.config/fish/functions/__z_complete.fish +++ /dev/null @@ -1,13 +0,0 @@ -function __z_complete -d "add completions" - complete -c $Z_CMD -a "(__z -l | string replace -r '^\\S*\\s*' '')" -f -k - complete -c $ZO_CMD -a "(__z -l | string replace -r '^\\S*\\s*' '')" -f -k - - complete -c $Z_CMD -s c -l clean -d "Cleans out $Z_DATA" - complete -c $Z_CMD -s e -l echo -d "Prints best match, no cd" - complete -c $Z_CMD -s l -l list -d "List matches, no cd" - complete -c $Z_CMD -s p -l purge -d "Purges $Z_DATA" - complete -c $Z_CMD -s r -l rank -d "Searches by rank, cd" - complete -c $Z_CMD -s t -l recent -d "Searches by recency, cd" - complete -c $Z_CMD -s h -l help -d "Print help" - complete -c $Z_CMD -s x -l delete -d "Removes the current directory from $Z_DATA" -end diff --git a/.config/fish/functions/r.fish b/.config/fish/functions/r.fish new file mode 100644 index 0000000..50a5b40 --- /dev/null +++ b/.config/fish/functions/r.fish @@ -0,0 +1,4 @@ +function r --wraps=ranger --description 'alias r=ranger' + ranger $argv + +end diff --git a/.config/fish/functions/y.fish b/.config/fish/functions/y.fish new file mode 100644 index 0000000..3e2af95 --- /dev/null +++ b/.config/fish/functions/y.fish @@ -0,0 +1,8 @@ +function y + set tmp (mktemp -t "yazi-cwd.XXXXXX") + yazi $argv --cwd-file="$tmp" + if set cwd (command cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] + builtin cd -- "$cwd" + end + rm -f -- "$tmp" +end diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf index 07f3e7b..b34757c 100644 --- a/.config/kitty/kitty.conf +++ b/.config/kitty/kitty.conf @@ -2,7 +2,7 @@ map ctrl+c copy_to_clipboard map ctrl+v paste_from_clipboard map ctrl+shift+c send_text all \x03 map ctrl+space show_scrollback -font_size 16.0 +font_size 14.0 touch_scroll_multiplier 5.0 scrollback_pager bash -c 'nvim -u NORC -c "map q :qa!" -c "terminal cat "<(cat)" - " -c "map i " -c "set clipboard+=unnamedplus nonumber nolist showtabline=0 foldcolumn=0" -c "call cursor(CURSOR_LINE, CURSOR_COLUMN)"' include ./nord.conf diff --git a/.config/ranger/commands.py b/.config/ranger/commands.py deleted file mode 100644 index 97b7909..0000000 --- a/.config/ranger/commands.py +++ /dev/null @@ -1,62 +0,0 @@ -# This is a sample commands.py. You can add your own commands here. -# -# Please refer to commands_full.py for all the default commands and a complete -# documentation. Do NOT add them all here, or you may end up with defunct -# commands when upgrading ranger. - -# A simple command for demonstration purposes follows. -# ----------------------------------------------------------------------------- - -from __future__ import (absolute_import, division, print_function) - -# You can import any python module as needed. -import os - -# You always need to import ranger.api.commands here to get the Command class: -from ranger.api.commands import Command - - -# Any class that is a subclass of "Command" will be integrated into ranger as a -# command. Try typing ":my_edit" in ranger! -class my_edit(Command): - # The so-called doc-string of the class will be visible in the built-in - # help that is accessible by typing "?c" inside ranger. - """:my_edit - - A sample command for demonstration purposes that opens a file in an editor. - """ - - # The execute method is called when you run this command in ranger. - def execute(self): - # self.arg(1) is the first (space-separated) argument to the function. - # This way you can write ":my_edit somefilename". - if self.arg(1): - # self.rest(1) contains self.arg(1) and everything that follows - target_filename = self.rest(1) - else: - # self.fm is a ranger.core.filemanager.FileManager object and gives - # you access to internals of ranger. - # self.fm.thisfile is a ranger.container.file.File object and is a - # reference to the currently selected file. - target_filename = self.fm.thisfile.path - - # This is a generic function to print text in ranger. - self.fm.notify("Let's edit the file " + target_filename + "!") - - # Using bad=True in fm.notify allows you to print error messages: - if not os.path.exists(target_filename): - self.fm.notify("The given file does not exist!", bad=True) - return - - # This executes a function from ranger.core.acitons, a module with a - # variety of subroutines that can help you construct commands. - # Check out the source, or run "pydoc ranger.core.actions" for a list. - self.fm.edit_file(target_filename) - - # The tab method is called when you press tab, and should return a list of - # suggestions that the user will tab through. - # tabnum is 1 for and -1 for by default - def tab(self, tabnum): - # This is a generic tab-completion function that iterates through the - # content of the current directory. - return self._tab_directory_content() diff --git a/.config/ranger/rc.conf b/.config/ranger/rc.conf deleted file mode 100644 index fd8ac8b..0000000 --- a/.config/ranger/rc.conf +++ /dev/null @@ -1,759 +0,0 @@ -# =================================================================== -# This file contains the default startup commands for ranger. -# To change them, it is recommended to create either /etc/ranger/rc.conf -# (system-wide) or ~/.config/ranger/rc.conf (per user) and add your custom -# commands there. -# -# If you copy this whole file there, you may want to set the environment -# variable RANGER_LOAD_DEFAULT_RC to FALSE to avoid loading it twice. -# -# The purpose of this file is mainly to define keybindings and settings. -# For running more complex python code, please create a plugin in "plugins/" or -# a command in "commands.py". -# -# Each line is a command that will be run before the user interface -# is initialized. As a result, you can not use commands which rely -# on the UI such as :delete or :mark. -# =================================================================== - -# =================================================================== -# == Options -# =================================================================== - -# Which viewmode should be used? Possible values are: -# miller: Use miller columns which show multiple levels of the hierarchy -# multipane: Midnight-commander like multipane view showing all tabs next -# to each other -set viewmode miller -#set viewmode multipane - -# How many columns are there, and what are their relative widths? -set column_ratios 1,3,4 - -# Which files should be hidden? (regular expression) -set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$ - -# Show hidden files? You can toggle this by typing 'zh' -set show_hidden true - -# Ask for a confirmation when running the "delete" command? -# Valid values are "always", "never", "multiple" (default) -# With "multiple", ranger will ask only if you delete multiple files at once. -set confirm_on_delete multiple - -# Use non-default path for file preview script? -# ranger ships with scope.sh, a script that calls external programs (see -# README.md for dependencies) to preview images, archives, etc. -#set preview_script ~/.config/ranger/scope.sh - -# Use the external preview script or display simple plain text or image previews? -set use_preview_script true - -# Automatically count files in the directory, even before entering them? -set automatically_count_files true - -# Open all images in this directory when running certain image viewers -# like feh or sxiv? You can still open selected files by marking them. -set open_all_images true - -# Be aware of version control systems and display information. -set vcs_aware false - -# State of the four backends git, hg, bzr, svn. The possible states are -# disabled, local (only show local info), enabled (show local and remote -# information). -set vcs_backend_git enabled -set vcs_backend_hg disabled -set vcs_backend_bzr disabled -set vcs_backend_svn disabled - -# Truncate the long commit messages to this length when shown in the statusbar. -set vcs_msg_length 50 - -# Use one of the supported image preview protocols -set preview_images false - -# Set the preview image method. Supported methods: -# -# * w3m (default): -# Preview images in full color with the external command "w3mimgpreview"? -# This requires the console web browser "w3m" and a supported terminal. -# It has been successfully tested with "xterm" and "urxvt" without tmux. -# -# * iterm2: -# Preview images in full color using iTerm2 image previews -# (http://iterm2.com/images.html). This requires using iTerm2 compiled -# with image preview support. -# -# This feature relies on the dimensions of the terminal's font. By default, a -# width of 8 and height of 11 are used. To use other values, set the options -# iterm2_font_width and iterm2_font_height to the desired values. -# -# * terminology: -# Previews images in full color in the terminology terminal emulator. -# Supports a wide variety of formats, even vector graphics like svg. -# -# * urxvt: -# Preview images in full color using urxvt image backgrounds. This -# requires using urxvt compiled with pixbuf support. -# -# * urxvt-full: -# The same as urxvt but utilizing not only the preview pane but the -# whole terminal window. -# -# * kitty: -# Preview images in full color using kitty image protocol. -# Requires python PIL or pillow library. -# If ranger does not share the local filesystem with kitty -# the transfer method is changed to encode the whole image; -# while slower, this allows remote previews, -# for example during an ssh session. -# Tmux is unsupported. -# -# * ueberzug: -# Preview images in full color with the external command "ueberzug". -# Images are shown by using a child window. -# Only for users who run X11 in GNU/Linux. -set preview_images_method w3m - -# Delay in seconds before displaying an image with the w3m method. -# Increase it in case of experiencing display corruption. -set w3m_delay 0.02 - -# Manually adjust the w3mimg offset when using a terminal which needs this -set w3m_offset 0 - -# Default iTerm2 font size (see: preview_images_method: iterm2) -set iterm2_font_width 8 -set iterm2_font_height 11 - -# Use a unicode "..." character to mark cut-off filenames? -set unicode_ellipsis false - -# BIDI support - try to properly display file names in RTL languages (Hebrew, Arabic). -# Requires the python-bidi pip package -set bidi_support false - -# Show dotfiles in the bookmark preview box? -set show_hidden_bookmarks true - -# Which colorscheme to use? These colorschemes are available by default: -# default, jungle, snow, solarized -set colorscheme default - -# Preview files on the rightmost column? -# And collapse (shrink) the last column if there is nothing to preview? -set preview_files true -set preview_directories true -set collapse_preview true - -# Wrap long lines in plain text previews? -set wrap_plaintext_previews false - -# Save the console history on exit? -set save_console_history true - -# Draw the status bar on top of the browser window (default: bottom) -set status_bar_on_top false - -# Draw a progress bar in the status bar which displays the average state of all -# currently running tasks which support progress bars? -set draw_progress_bar_in_status_bar true - -# Draw borders around columns? (separators, outline, both, or none) -# Separators are vertical lines between columns. -# Outline draws a box around all the columns. -# Both combines the two. -set draw_borders both - -# Display the directory name in tabs? -set dirname_in_tabs false - -# Enable the mouse support? -set mouse_enabled true - -# Display the file size in the main column or status bar? -set display_size_in_main_column true -set display_size_in_status_bar true - -# Display the free disk space in the status bar? -set display_free_space_in_status_bar true - -# Display files tags in all columns or only in main column? -set display_tags_in_all_columns true - -# Set a title for the window? Updates both `WM_NAME` and `WM_ICON_NAME` -set update_title false - -# Set the tmux/screen window-name to "ranger"? -set update_tmux_title true - -# Shorten the title if it gets long? The number defines how many -# directories are displayed at once, 0 turns off this feature. -set shorten_title 3 - -# Show hostname in titlebar? -set hostname_in_titlebar true - -# Abbreviate $HOME with ~ in the titlebar (first line) of ranger? -set tilde_in_titlebar false - -# How many directory-changes or console-commands should be kept in history? -set max_history_size 20 -set max_console_history_size 50 - -# Try to keep so much space between the top/bottom border when scrolling: -set scroll_offset 8 - -# Flush the input after each key hit? (Noticeable when ranger lags) -set flushinput true - -# Padding on the right when there's no preview? -# This allows you to click into the space to run the file. -set padding_right true - -# Save bookmarks (used with mX and `X) instantly? -# This helps to synchronize bookmarks between multiple ranger -# instances but leads to *slight* performance loss. -# When false, bookmarks are saved when ranger is exited. -set autosave_bookmarks true - -# Save the "`" bookmark to disk. This can be used to switch to the last -# directory by typing "``". -set save_backtick_bookmark true - -# You can display the "real" cumulative size of directories by using the -# command :get_cumulative_size or typing "dc". The size is expensive to -# calculate and will not be updated automatically. You can choose -# to update it automatically though by turning on this option: -set autoupdate_cumulative_size false - -# Turning this on makes sense for screen readers: -set show_cursor false - -# One of: size, natural, basename, atime, ctime, mtime, type, random -set sort natural - -# Additional sorting options -set sort_reverse false -set sort_case_insensitive true -set sort_directories_first true -set sort_unicode false - -# Enable this if key combinations with the Alt Key don't work for you. -# (Especially on xterm) -set xterm_alt_key false - -# Whether to include bookmarks in cd command -set cd_bookmarks true - -# Changes case sensitivity for the cd command tab completion -set cd_tab_case sensitive - -# Use fuzzy tab completion with the "cd" command. For example, -# ":cd /u/lo/b" expands to ":cd /usr/local/bin". -set cd_tab_fuzzy false - -# Avoid previewing files larger than this size, in bytes. Use a value of 0 to -# disable this feature. -set preview_max_size 0 - -# The key hint lists up to this size have their sublists expanded. -# Otherwise the submaps are replaced with "...". -set hint_collapse_threshold 10 - -# Add the highlighted file to the path in the titlebar -set show_selection_in_titlebar true - -# The delay that ranger idly waits for user input, in milliseconds, with a -# resolution of 100ms. Lower delay reduces lag between directory updates but -# increases CPU load. -set idle_delay 2000 - -# When the metadata manager module looks for metadata, should it only look for -# a ".metadata.json" file in the current directory, or do a deep search and -# check all directories above the current one as well? -set metadata_deep_search false - -# Clear all existing filters when leaving a directory -set clear_filters_on_dir_change false - -# Disable displaying line numbers in main column. -# Possible values: false, absolute, relative. -set line_numbers false - -# When line_numbers=relative show the absolute line number in the -# current line. -set relative_current_zero false - -# Start line numbers from 1 instead of 0 -set one_indexed false - -# Save tabs on exit -set save_tabs_on_exit false - -# Enable scroll wrapping - moving down while on the last item will wrap around to -# the top and vice versa. -set wrap_scroll false - -# Set the global_inode_type_filter to nothing. Possible options: d, f and l for -# directories, files and symlinks respectively. -set global_inode_type_filter - -# This setting allows to freeze the list of files to save I/O bandwidth. It -# should be 'false' during start-up, but you can toggle it by pressing F. -set freeze_files false - -# Print file sizes in bytes instead of the default human-readable format. -set size_in_bytes false - -# Warn at startup if RANGER_LEVEL env var is greater than 0, in other words -# give a warning when you nest ranger in a subshell started by ranger. -# Special value "error" makes the warning more visible. -set nested_ranger_warning true - -# =================================================================== -# == Local Options -# =================================================================== -# You can set local options that only affect a single directory. - -# Examples: -# setlocal path=~/downloads sort mtime - -# =================================================================== -# == Command Aliases in the Console -# =================================================================== - -alias e edit -alias q quit -alias q! quit! -alias qa quitall -alias qa! quitall! -alias qall quitall -alias qall! quitall! -alias setl setlocal - -alias filter scout -prts -alias find scout -aets -alias mark scout -mr -alias unmark scout -Mr -alias search scout -rs -alias search_inc scout -rts -alias travel scout -aefklst - -# =================================================================== -# == Define keys for the browser -# =================================================================== - -# Basic -map Q quitall -map q quit -copymap q ZZ ZQ - -map R reload_cwd -map F set freeze_files! -map reset -map redraw_window -map abort -map change_mode normal -map ~ set viewmode! - -map i display_file -map scroll_preview 1 -map scroll_preview -1 -map ? help -map W display_log -map w taskview_open -map S shell $SHELL - -map : console -map ; console -map ! console shell%space -map @ console -p6 shell %%s -map # console shell -p%space -map s console shell%space -map r chain draw_possible_programs; console open_with%space -map f console find%space -map cd console cd%space - -map chain console; eval fm.ui.console.history_move(-1) - -# Change the line mode -map Mf linemode filename -map Mi linemode fileinfo -map Mm linemode mtime -map Mh linemode humanreadablemtime -map Mp linemode permissions -map Ms linemode sizemtime -map MH linemode sizehumanreadablemtime -map Mt linemode metatitle - -# Tagging / Marking -map t tag_toggle -map ut tag_remove -map " tag_toggle tag=%any -map mark_files toggle=True -map v mark_files all=True toggle=True -map uv mark_files all=True val=False -map V toggle_visual_mode -map uV toggle_visual_mode reverse=True - -# For the nostalgics: Midnight Commander bindings -map help -map rename_append -map display_file -map edit -map copy -map cut -map console mkdir%space -map console delete -#map console trash -map exit - -# In case you work on a keyboard with dvorak layout -map move up=1 -map move down=1 -map move left=1 -map move right=1 -map move to=0 -map move to=-1 -map move down=1 pages=True -map move up=1 pages=True -map move right=1 -#map console delete -map console touch%space - -# VIM-like -copymap k -copymap j -copymap h -copymap l -copymap gg -copymap G -copymap -copymap - -map J move down=0.5 pages=True -map K move up=0.5 pages=True -copymap J -copymap K - -# Jumping around -map H history_go -1 -map L history_go 1 -map ] move_parent 1 -map [ move_parent -1 -map } traverse -map { traverse_backwards -map ) jump_non - -map gh cd ~ -map ge cd /etc -map gu cd /usr -map gd cd /dev -map gl cd -r . -map gL cd -r %f -map go cd /opt -map gv cd /var -map gm cd /media -map gi eval fm.cd('/run/media/' + os.getenv('USER')) -map gM cd /mnt -map gs cd /srv -map gp cd /tmp -map gr cd / -map gR eval fm.cd(ranger.RANGERDIR) -map g/ cd / -map g? cd /usr/share/doc/ranger - -# External Programs -map E edit -map du shell -p du --max-depth=1 -h --apparent-size -map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh -map yp yank path -map yd yank dir -map yn yank name -map y. yank name_without_extension - -# Filesystem Operations -map = chmod - -map cw console rename%space -map a rename_append -map A eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%")) -map I eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"), position=7) - -map pp paste -map po paste overwrite=True -map pP paste append=True -map pO paste overwrite=True append=True -map pl paste_symlink relative=False -map pL paste_symlink relative=True -map phl paste_hardlink -map pht paste_hardlinked_subtree -map pd console paste dest= -map p` paste dest=%any_path -map p' paste dest=%any_path - -map dD console delete -map dT shell mv %s /home/${USER}/.local/share/Trash/files/ - -map dd cut -map ud uncut -map da cut mode=add -map dr cut mode=remove -map dt cut mode=toggle - -map yy copy -map uy uncut -map ya copy mode=add -map yr copy mode=remove -map yt copy mode=toggle - -# Temporary workarounds -map dgg eval fm.cut(dirarg=dict(to=0), narg=quantifier) -map dG eval fm.cut(dirarg=dict(to=-1), narg=quantifier) -map dj eval fm.cut(dirarg=dict(down=1), narg=quantifier) -map dk eval fm.cut(dirarg=dict(up=1), narg=quantifier) -map ygg eval fm.copy(dirarg=dict(to=0), narg=quantifier) -map yG eval fm.copy(dirarg=dict(to=-1), narg=quantifier) -map yj eval fm.copy(dirarg=dict(down=1), narg=quantifier) -map yk eval fm.copy(dirarg=dict(up=1), narg=quantifier) - -# Searching -map / console search%space -map n search_next -map N search_next forward=False -map ct search_next order=tag -map cs search_next order=size -map ci search_next order=mimetype -map cc search_next order=ctime -map cm search_next order=mtime -map ca search_next order=atime - -# Tabs -map tab_new -map tab_close -map tab_move 1 -map tab_move -1 -map tab_move 1 -map tab_move -1 -map gt tab_move 1 -map gT tab_move -1 -map gn tab_new -map gc tab_close -map uq tab_restore -map tab_open 1 -map tab_open 2 -map tab_open 3 -map tab_open 4 -map tab_open 5 -map tab_open 6 -map tab_open 7 -map tab_open 8 -map tab_open 9 -map tab_shift 1 -map tab_shift -1 - -# Sorting -map or set sort_reverse! -map oz set sort=random -map os chain set sort=size; set sort_reverse=False -map ob chain set sort=basename; set sort_reverse=False -map on chain set sort=natural; set sort_reverse=False -map om chain set sort=mtime; set sort_reverse=False -map oc chain set sort=ctime; set sort_reverse=False -map oa chain set sort=atime; set sort_reverse=False -map ot chain set sort=type; set sort_reverse=False -map oe chain set sort=extension; set sort_reverse=False - -map oS chain set sort=size; set sort_reverse=True -map oB chain set sort=basename; set sort_reverse=True -map oN chain set sort=natural; set sort_reverse=True -map oM chain set sort=mtime; set sort_reverse=True -map oC chain set sort=ctime; set sort_reverse=True -map oA chain set sort=atime; set sort_reverse=True -map oT chain set sort=type; set sort_reverse=True -map oE chain set sort=extension; set sort_reverse=True - -map dc get_cumulative_size - -# Settings -map zc set collapse_preview! -map zd set sort_directories_first! -map zh set show_hidden! -map set show_hidden! -copymap -copymap -map zI set flushinput! -map zi set preview_images! -map zm set mouse_enabled! -map zp set preview_files! -map zP set preview_directories! -map zs set sort_case_insensitive! -map zu set autoupdate_cumulative_size! -map zv set use_preview_script! -map zf console filter%space -copymap zf zz - -# Filter stack -map .d filter_stack add type d -map .f filter_stack add type f -map .l filter_stack add type l -map .m console filter_stack add mime%space -map .n console filter_stack add name%space -map .# console filter_stack add hash%space -map ." filter_stack add duplicate -map .' filter_stack add unique -map .| filter_stack add or -map .& filter_stack add and -map .! filter_stack add not -map .r filter_stack rotate -map .c filter_stack clear -map .* filter_stack decompose -map .p filter_stack pop -map .. filter_stack show - -# Bookmarks -map ` enter_bookmark %any -map ' enter_bookmark %any -map m set_bookmark %any -map um unset_bookmark %any - -map m draw_bookmarks -copymap m um ` ' - -# Generate all the chmod bindings with some python help: -eval for arg in "rwxXst": cmd("map +u{0} shell -f chmod u+{0} %s".format(arg)) -eval for arg in "rwxXst": cmd("map +g{0} shell -f chmod g+{0} %s".format(arg)) -eval for arg in "rwxXst": cmd("map +o{0} shell -f chmod o+{0} %s".format(arg)) -eval for arg in "rwxXst": cmd("map +a{0} shell -f chmod a+{0} %s".format(arg)) -eval for arg in "rwxXst": cmd("map +{0} shell -f chmod u+{0} %s".format(arg)) - -eval for arg in "rwxXst": cmd("map -u{0} shell -f chmod u-{0} %s".format(arg)) -eval for arg in "rwxXst": cmd("map -g{0} shell -f chmod g-{0} %s".format(arg)) -eval for arg in "rwxXst": cmd("map -o{0} shell -f chmod o-{0} %s".format(arg)) -eval for arg in "rwxXst": cmd("map -a{0} shell -f chmod a-{0} %s".format(arg)) -eval for arg in "rwxXst": cmd("map -{0} shell -f chmod u-{0} %s".format(arg)) - -# =================================================================== -# == Define keys for the console -# =================================================================== -# Note: Unmapped keys are passed directly to the console. - -# Basic -cmap eval fm.ui.console.tab() -cmap eval fm.ui.console.tab(-1) -cmap eval fm.ui.console.close() -cmap eval fm.ui.console.execute() -cmap redraw_window - -copycmap -copycmap - -# Move around -cmap eval fm.ui.console.history_move(-1) -cmap eval fm.ui.console.history_move(1) -cmap eval fm.ui.console.move(left=1) -cmap eval fm.ui.console.move(right=1) -cmap eval fm.ui.console.move(right=0, absolute=True) -cmap eval fm.ui.console.move(right=-1, absolute=True) -cmap eval fm.ui.console.move_word(left=1) -cmap eval fm.ui.console.move_word(right=1) - -copycmap -copycmap - -# Line Editing -cmap eval fm.ui.console.delete(-1) -cmap eval fm.ui.console.delete(0) -cmap eval fm.ui.console.delete_word() -cmap eval fm.ui.console.delete_word(backward=False) -cmap eval fm.ui.console.delete_rest(1) -cmap eval fm.ui.console.delete_rest(-1) -cmap eval fm.ui.console.paste() - -# And of course the emacs way -copycmap -copycmap -copycmap -copycmap -copycmap -copycmap -copycmap -copycmap -copycmap - -# Note: There are multiple ways to express backspaces. (code 263) -# and (code 127). To be sure, use both. -copycmap - -# This special expression allows typing in numerals: -cmap false - -# =================================================================== -# == Pager Keybindings -# =================================================================== - -# Movement -pmap pager_move down=1 -pmap pager_move up=1 -pmap pager_move left=4 -pmap pager_move right=4 -pmap pager_move to=0 -pmap pager_move to=-1 -pmap pager_move down=1.0 pages=True -pmap pager_move up=1.0 pages=True -pmap pager_move down=0.5 pages=True -pmap pager_move up=0.5 pages=True - -copypmap k -copypmap j -copypmap h -copypmap l -copypmap g -copypmap G -copypmap d -copypmap u -copypmap n f -copypmap p b - -# Basic -pmap redraw_window -pmap pager_close -copypmap q Q i -pmap E edit_file - -# =================================================================== -# == Taskview Keybindings -# =================================================================== - -# Movement -tmap taskview_move up=1 -tmap taskview_move down=1 -tmap taskview_move to=0 -tmap taskview_move to=-1 -tmap taskview_move down=1.0 pages=True -tmap taskview_move up=1.0 pages=True -tmap taskview_move down=0.5 pages=True -tmap taskview_move up=0.5 pages=True - -copytmap k -copytmap j -copytmap g -copytmap G -copytmap u -copytmap n f -copytmap p b - -# Changing priority and deleting tasks -tmap J eval -q fm.ui.taskview.task_move(-1) -tmap K eval -q fm.ui.taskview.task_move(0) -tmap dd eval -q fm.ui.taskview.task_remove() -tmap eval -q fm.ui.taskview.task_move(-1) -tmap eval -q fm.ui.taskview.task_move(0) -tmap eval -q fm.ui.taskview.task_remove() - -# Basic -tmap redraw_window -tmap taskview_close -copytmap q Q w diff --git a/.config/ranger/rifle.conf b/.config/ranger/rifle.conf deleted file mode 100644 index 86f53fd..0000000 --- a/.config/ranger/rifle.conf +++ /dev/null @@ -1,284 +0,0 @@ -# vim: ft=cfg -# -# This is the configuration file of "rifle", ranger's file executor/opener. -# Each line consists of conditions and a command. For each line the conditions -# are checked and if they are met, the respective command is run. -# -# Syntax: -# , , ... = command -# -# The command can contain these environment variables: -# $1-$9 | The n-th selected file -# $@ | All selected files -# -# If you use the special command "ask", rifle will ask you what program to run. -# -# Prefixing a condition with "!" will negate its result. -# These conditions are currently supported: -# match | The regexp matches $1 -# ext | The regexp matches the extension of $1 -# mime | The regexp matches the mime type of $1 -# name | The regexp matches the basename of $1 -# path | The regexp matches the absolute path of $1 -# has | The program is installed (i.e. located in $PATH) -# env | The environment variable "variable" is non-empty -# file | $1 is a file -# directory | $1 is a directory -# number | change the number of this command to n -# terminal | stdin, stderr and stdout are connected to a terminal -# X | A graphical environment is available (darwin, Xorg, or Wayland) -# -# There are also pseudo-conditions which have a "side effect": -# flag | Change how the program is run. See below. -# label