mirror of
https://gitlab.com/thebiblelover7/dotfiles.git
synced 2025-09-13 15:13:49 +00:00
initial commit
This commit is contained in:
8
.config/fish/config.fish
Normal file
8
.config/fish/config.fish
Normal file
@@ -0,0 +1,8 @@
|
||||
export PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/android-sdk/platform-tools:/var/lib/flatpak/exports/bin:/opt/flutter/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin:$HOME/scripts:$HOME/.local/bin:$PATH
|
||||
alias ls="echo ewwww\newwww\newwww"
|
||||
alias l="exa"
|
||||
alias v="nvim"
|
||||
if status is-interactive
|
||||
# Commands to run in interactive sessions can go here
|
||||
|
||||
end
|
32
.config/fish/fish_variables
Normal file
32
.config/fish/fish_variables
Normal file
@@ -0,0 +1,32 @@
|
||||
# This file contains fish universal variable definitions.
|
||||
# VERSION: 3.0
|
||||
SETUVAR __fish_initialized:3100
|
||||
SETUVAR fish_color_autosuggestion:4c566a
|
||||
SETUVAR fish_color_cancel:\x2dr
|
||||
SETUVAR fish_color_command:81a1c1
|
||||
SETUVAR fish_color_comment:434c5e
|
||||
SETUVAR fish_color_cwd:green
|
||||
SETUVAR fish_color_cwd_root:red
|
||||
SETUVAR fish_color_end:88c0d0
|
||||
SETUVAR fish_color_error:ebcb8b
|
||||
SETUVAR fish_color_escape:00a6b2
|
||||
SETUVAR fish_color_history_current:\x2d\x2dbold
|
||||
SETUVAR fish_color_host:normal
|
||||
SETUVAR fish_color_host_remote:yellow
|
||||
SETUVAR fish_color_match:\x2d\x2dbackground\x3dbrblue
|
||||
SETUVAR fish_color_normal:normal
|
||||
SETUVAR fish_color_operator:00a6b2
|
||||
SETUVAR fish_color_param:eceff4
|
||||
SETUVAR fish_color_quote:a3be8c
|
||||
SETUVAR fish_color_redirection:b48ead
|
||||
SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack
|
||||
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:\x1d
|
||||
SETUVAR fish_key_bindings:fish_default_key_bindings
|
||||
SETUVAR fish_pager_color_completion:normal
|
||||
SETUVAR fish_pager_color_description:B3A06D\x1eyellow
|
||||
SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
|
||||
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
|
139
.config/fish/functions/fish_prompt.fish
Normal file
139
.config/fish/functions/fish_prompt.fish
Normal file
@@ -0,0 +1,139 @@
|
||||
function fish_prompt
|
||||
# This prompt shows:
|
||||
# - green lines if the last return command is OK, red otherwise
|
||||
# - your user name, in red if root or yellow otherwise
|
||||
# - your hostname, in cyan if ssh or blue otherwise
|
||||
# - the current path (with prompt_pwd)
|
||||
# - date +%X
|
||||
# - the current virtual environment, if any
|
||||
# - the current git status, if any, with fish_git_prompt
|
||||
# - the current battery state, if any, and if your power cable is unplugged, and if you have "acpi"
|
||||
# - current background jobs, if any
|
||||
|
||||
# It goes from:
|
||||
# ┬─[nim@Hattori:~]─[11:39:00]
|
||||
# ╰─>$ echo here
|
||||
|
||||
# To:
|
||||
# ┬─[nim@Hattori:~/w/dashboard]─[11:37:14]─[V:django20]─[G:master↑1|●1✚1…1]─[B:85%, 05:41:42 remaining]
|
||||
# │ 2 15054 0% arrêtée sleep 100000
|
||||
# │ 1 15048 0% arrêtée sleep 100000
|
||||
# ╰─>$ echo there
|
||||
|
||||
set -l retc red
|
||||
test $status = 0; and set retc green
|
||||
|
||||
set -q __fish_git_prompt_showupstream
|
||||
or set -g __fish_git_prompt_showupstream auto
|
||||
|
||||
function _nim_prompt_wrapper
|
||||
set retc $argv[1]
|
||||
set -l field_name $argv[2]
|
||||
set -l field_value $argv[3]
|
||||
|
||||
set_color normal
|
||||
set_color $retc
|
||||
echo -n '─'
|
||||
set_color -o green
|
||||
echo -n '['
|
||||
set_color normal
|
||||
test -n $field_name
|
||||
and echo -n $field_name:
|
||||
set_color $retc
|
||||
echo -n $field_value
|
||||
set_color -o green
|
||||
echo -n ']'
|
||||
end
|
||||
|
||||
set_color $retc
|
||||
echo -n '┬─'
|
||||
set_color -o green
|
||||
echo -n [
|
||||
|
||||
if functions -q fish_is_root_user; and fish_is_root_user
|
||||
set_color -o red
|
||||
else
|
||||
set_color -o yellow
|
||||
end
|
||||
|
||||
echo -n $USER
|
||||
set_color -o white
|
||||
echo -n @
|
||||
|
||||
if [ -z "$SSH_CLIENT" ]
|
||||
set_color -o blue
|
||||
else
|
||||
set_color -o cyan
|
||||
end
|
||||
|
||||
echo -n (prompt_hostname)
|
||||
set_color -o white
|
||||
echo -n :(prompt_pwd)
|
||||
set_color -o green
|
||||
echo -n ']'
|
||||
|
||||
# Date
|
||||
_nim_prompt_wrapper $retc '' (date +%X)
|
||||
|
||||
# Vi-mode
|
||||
# The default mode prompt would be prefixed, which ruins our alignment.
|
||||
function fish_mode_prompt
|
||||
end
|
||||
|
||||
if test "$fish_key_bindings" = fish_vi_key_bindings
|
||||
or test "$fish_key_bindings" = fish_hybrid_key_bindings
|
||||
set -l mode
|
||||
switch $fish_bind_mode
|
||||
case default
|
||||
set mode (set_color --bold red)N
|
||||
case insert
|
||||
set mode (set_color --bold green)I
|
||||
case replace_one
|
||||
set mode (set_color --bold green)R
|
||||
echo '[R]'
|
||||
case replace
|
||||
set mode (set_color --bold cyan)R
|
||||
case visual
|
||||
set mode (set_color --bold magenta)V
|
||||
end
|
||||
set mode $mode(set_color normal)
|
||||
_nim_prompt_wrapper $retc '' $mode
|
||||
end
|
||||
|
||||
|
||||
# Virtual Environment
|
||||
set -q VIRTUAL_ENV_DISABLE_PROMPT
|
||||
or set -g VIRTUAL_ENV_DISABLE_PROMPT true
|
||||
set -q VIRTUAL_ENV
|
||||
and _nim_prompt_wrapper $retc V (basename "$VIRTUAL_ENV")
|
||||
|
||||
# git
|
||||
set -l prompt_git (fish_git_prompt '%s')
|
||||
test -n "$prompt_git"
|
||||
and _nim_prompt_wrapper $retc G $prompt_git
|
||||
|
||||
# Battery status
|
||||
type -q acpi
|
||||
and test (acpi -a 2> /dev/null | string match -r off)
|
||||
and _nim_prompt_wrapper $retc B (acpi -b | cut -d' ' -f 4- | tail -n 1)
|
||||
|
||||
# New line
|
||||
echo
|
||||
|
||||
# Background jobs
|
||||
set_color normal
|
||||
|
||||
for job in (jobs)
|
||||
set_color $retc
|
||||
echo -n '│ '
|
||||
set_color brown
|
||||
echo $job
|
||||
end
|
||||
|
||||
set_color normal
|
||||
set_color $retc
|
||||
echo -n '╰─>'
|
||||
set_color -o red
|
||||
echo -n '$ '
|
||||
set_color normal
|
||||
end
|
Reference in New Issue
Block a user