first commit
This commit is contained in:
1
fish/conf.d/rustup.fish
Normal file
1
fish/conf.d/rustup.fish
Normal file
@@ -0,0 +1 @@
|
||||
source "$HOME/.cargo/env.fish"
|
||||
130
fish/config.fish
Normal file
130
fish/config.fish
Normal file
@@ -0,0 +1,130 @@
|
||||
set -x MANROFFOPT "-c"
|
||||
set -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
|
||||
|
||||
# Set settings for https://github.com/franciscolourenco/done
|
||||
set -U __done_min_cmd_duration 10000
|
||||
set -U __done_notification_urgency_level low
|
||||
|
||||
## Environment setup
|
||||
# Apply .profile: use this to put fish compatible .profile stuff in
|
||||
if test -f ~/.fish_profile
|
||||
source ~/.fish_profile
|
||||
end
|
||||
|
||||
# Add ~/.local/bin to PATH
|
||||
if test -d ~/.local/bin
|
||||
if not contains -- ~/.local/bin $PATH
|
||||
set -p PATH ~/.local/bin
|
||||
end
|
||||
end
|
||||
|
||||
# Add depot_tools to PATH
|
||||
if test -d ~/Applications/depot_tools
|
||||
if not contains -- ~/Applications/depot_tools $PATH
|
||||
set -p PATH ~/Applications/depot_tools
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
## Functions
|
||||
# Functions needed for !! and !$ https://github.com/oh-my-fish/plugin-bang-bang
|
||||
function __history_previous_command
|
||||
switch (commandline -t)
|
||||
case "!"
|
||||
commandline -t $history[1]; commandline -f repaint
|
||||
case "*"
|
||||
commandline -i !
|
||||
end
|
||||
end
|
||||
|
||||
function __history_previous_command_arguments
|
||||
switch (commandline -t)
|
||||
case "!"
|
||||
commandline -t ""
|
||||
commandline -f history-token-search-backward
|
||||
case "*"
|
||||
commandline -i '$'
|
||||
end
|
||||
end
|
||||
|
||||
if [ "$fish_key_bindings" = fish_vi_key_bindings ];
|
||||
bind -Minsert ! __history_previous_command
|
||||
bind -Minsert '$' __history_previous_command_arguments
|
||||
else
|
||||
bind ! __history_previous_command
|
||||
bind '$' __history_previous_command_arguments
|
||||
end
|
||||
|
||||
# Fish command history
|
||||
function history
|
||||
builtin history --show-time='%F %T '
|
||||
end
|
||||
|
||||
function backup --argument filename
|
||||
cp $filename $filename.bak
|
||||
end
|
||||
|
||||
# Copy DIR1 DIR2
|
||||
function copy
|
||||
set count (count $argv | tr -d \n)
|
||||
if test "$count" = 2; and test -d "$argv[1]"
|
||||
set from (echo $argv[1] | trim-right /)
|
||||
set to (echo $argv[2])
|
||||
command cp -r $from $to
|
||||
else
|
||||
command cp $argv
|
||||
end
|
||||
end
|
||||
|
||||
## Useful aliases
|
||||
# Replace ls with eza
|
||||
|
||||
# Common use
|
||||
alias grubup="sudo grub-mkconfig -o /boot/grub/grub.cfg"
|
||||
alias fixpacman="sudo rm /var/lib/pacman/db.lck"
|
||||
alias tarnow='tar -acf '
|
||||
alias untar='tar -zxvf '
|
||||
alias wget='wget -c '
|
||||
alias psmem='ps auxf | sort -nr -k 4'
|
||||
alias psmem10='ps auxf | sort -nr -k 4 | head -10'
|
||||
alias ..='cd ..'
|
||||
alias ...='cd ../..'
|
||||
alias ....='cd ../../..'
|
||||
alias .....='cd ../../../..'
|
||||
alias ......='cd ../../../../..'
|
||||
alias dir='dir --color=auto'
|
||||
alias vdir='vdir --color=auto'
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
alias hw='hwinfo --short' # Hardware Info
|
||||
alias big="expac -H M '%m\t%n' | sort -h | nl" # Sort installed packages according to size in MB
|
||||
alias gitpkg='pacman -Q | grep -i "\-git" | wc -l' # List amount of -git packages
|
||||
alias update='sudo pacman -Syu'
|
||||
|
||||
# Get fastest mirrors
|
||||
alias mirror="sudo cachyos-rate-mirrors"
|
||||
|
||||
# Help people new to Arch
|
||||
alias apt='man pacman'
|
||||
alias apt-get='man pacman'
|
||||
alias please='sudo'
|
||||
alias tb='nc termbin.com 9999'
|
||||
|
||||
# Cleanup orphaned packages
|
||||
alias cleanup='sudo pacman -Rns (pacman -Qtdq)'
|
||||
|
||||
# Get the error messages from journalctl
|
||||
alias jctl="journalctl -p 3 -xb"
|
||||
|
||||
# Recent installed packages
|
||||
alias rip="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -200 | nl"
|
||||
starship init fish | source
|
||||
|
||||
set -x EZA_COLORS "da=38;5;244:uu=38;5;244:ug=38;5;244:su=38;5;244:di=1;37:ln=36:b=33:c=33:p=33:s=1;31:fi=0:gm=33:ga=32:gd=31:gR=34:gt=34:lp=36:hd=4:*.md=38;5;220:*.gradle=38;5;220"
|
||||
|
||||
# Также создадим удобные алиасы для eza
|
||||
alias ls='eza --icons --git'
|
||||
alias ll='eza -l --icons --git'
|
||||
alias la='eza -la --icons --git'
|
||||
alias llt='eza --tree --level=2 --long --icons --git'
|
||||
38
fish/fish_variables
Normal file
38
fish/fish_variables
Normal file
@@ -0,0 +1,38 @@
|
||||
# This file contains fish universal variable definitions.
|
||||
# VERSION: 3.0
|
||||
SETUVAR __done_min_cmd_duration:10000
|
||||
SETUVAR __done_notification_urgency_level:low
|
||||
SETUVAR __fish_initialized:3800
|
||||
SETUVAR _fisher_jorgebucaran_2F_fisher_files:\x7e/\x2econfig/fish/functions/fisher\x2efish\x1e\x7e/\x2econfig/fish/completions/fisher\x2efish
|
||||
SETUVAR _fisher_plugins:jorgebucaran/fisher
|
||||
SETUVAR _fisher_upgraded_to_4_4:\x1d
|
||||
SETUVAR fish_color_autosuggestion:555\x1ebrblack
|
||||
SETUVAR fish_color_cancel:\x2dr
|
||||
SETUVAR fish_color_command:blue
|
||||
SETUVAR fish_color_comment:red
|
||||
SETUVAR fish_color_cwd:green
|
||||
SETUVAR fish_color_cwd_root:red
|
||||
SETUVAR fish_color_end:green
|
||||
SETUVAR fish_color_error:brred
|
||||
SETUVAR fish_color_escape:brcyan
|
||||
SETUVAR fish_color_history_current:\x2d\x2dbold
|
||||
SETUVAR fish_color_host:normal
|
||||
SETUVAR fish_color_host_remote:yellow
|
||||
SETUVAR fish_color_normal:normal
|
||||
SETUVAR fish_color_operator:brcyan
|
||||
SETUVAR fish_color_param:cyan
|
||||
SETUVAR fish_color_quote:yellow
|
||||
SETUVAR fish_color_redirection:cyan\x1e\x2d\x2dbold
|
||||
SETUVAR fish_color_search_match:\x2d\x2dbackground\x3d111
|
||||
SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
|
||||
SETUVAR fish_color_status:red
|
||||
SETUVAR fish_color_user:brgreen
|
||||
SETUVAR fish_color_valid_path:\x2d\x2dunderline
|
||||
SETUVAR fish_greeting:
|
||||
SETUVAR fish_key_bindings:fish_default_key_bindings
|
||||
SETUVAR fish_pager_color_completion:normal
|
||||
SETUVAR fish_pager_color_description:B3A06D\x1eyellow\x1e\x2di
|
||||
SETUVAR fish_pager_color_prefix:cyan\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
|
||||
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
|
||||
SETUVAR fish_pager_color_selected_background:\x2dr
|
||||
SETUVAR fish_user_paths:/var/lib/flatpak/exports/bin\x1e/home/hadvart/\x2espicetify
|
||||
43
fish/functions/fish_prompt.fish
Normal file
43
fish/functions/fish_prompt.fish
Normal file
@@ -0,0 +1,43 @@
|
||||
function fish_prompt
|
||||
# Сохраняем код последней выполненной команды
|
||||
set -l last_status $status
|
||||
|
||||
# --- Левая (черная) часть ---
|
||||
# Устанавливаем черный фон и белый цвет текста
|
||||
set_color -b black white
|
||||
# Выводим текущую директорию. prompt_pwd - это встроенная функция fish для сокращенного пути
|
||||
echo -n ' '(prompt_pwd)' '
|
||||
|
||||
# --- Разделитель и правая (белая) часть ---
|
||||
# Используем символ powerline для плавного перехода
|
||||
set_color -b white black
|
||||
echo -n '' # Символ-разделитель
|
||||
|
||||
# Получаем информацию о Git
|
||||
set -l git_info (fish_git_prompt)
|
||||
|
||||
# Если мы находимся в Git-репозитории, отображаем информацию
|
||||
if test -n "$git_info"
|
||||
# Устанавливаем белый фон и черный цвет текста
|
||||
set_color -b white black
|
||||
echo -n $git_info' '
|
||||
set_color -b normal # Сбрасываем фон
|
||||
echo -n ' '
|
||||
else
|
||||
# Если не в репозитории, просто завершаем белую часть
|
||||
set_color -b normal
|
||||
echo -n ' '
|
||||
|
||||
|
||||
# --- Завершение командной строки ---
|
||||
# Возвращаем стандартные цвета
|
||||
set_color normal
|
||||
|
||||
# Отображаем символ '>' красным цветом, если последняя команда завершилась с ошибкой
|
||||
if test $last_status -ne 0
|
||||
set_color red
|
||||
end
|
||||
echo -n '> '
|
||||
set_color normal
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user