better structure
This commit is contained in:
6
config/fish/prev.d/.gitignore
vendored
Normal file
6
config/fish/prev.d/.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
*
|
||||
!.gitignore
|
||||
!prompt.fish
|
||||
!theme.fish
|
||||
!alias.fish
|
||||
!env.fish
|
||||
54
config/fish/prev.d/alias.fish
Normal file
54
config/fish/prev.d/alias.fish
Normal file
@@ -0,0 +1,54 @@
|
||||
# fzf
|
||||
if type -q fzf
|
||||
fzf --fish | source
|
||||
|
||||
if type -q wl-copy
|
||||
function fzc
|
||||
fzf $argv | string collect | wl-copy
|
||||
end
|
||||
end
|
||||
|
||||
if type -q bat
|
||||
alias fz="fzf --preview 'bat --style=numbers --color=always {}'"
|
||||
end
|
||||
end
|
||||
|
||||
# cd
|
||||
if type -q zoxide
|
||||
zoxide init fish | source
|
||||
alias cd=z
|
||||
end
|
||||
|
||||
# rm
|
||||
if type -q trash
|
||||
alias rm="echo \"use 'trash' instead :)\" && sh -c \"exit 42\" && echo why do you see this line :O"
|
||||
end
|
||||
|
||||
# ls
|
||||
if type -q eza
|
||||
alias ll="eza -lh --group-directories-first --icons=auto"
|
||||
alias la="eza -lh --group-directories-first --icons=auto --all"
|
||||
alias lt="eza --tree --level=2 --long --icons --git"
|
||||
else
|
||||
alias ll="ls -lh --group-directories-first --color=auto"
|
||||
alias la="ls -lah --group-directories-first --color=auto"
|
||||
end
|
||||
|
||||
# directories
|
||||
alias ..='cd ..'
|
||||
alias ...='cd ../..'
|
||||
alias ....='cd ../../..'
|
||||
|
||||
# grep
|
||||
alias grep="grep --color=auto"
|
||||
|
||||
# nvim
|
||||
if type -q nvim
|
||||
set -x -g EDITOR nvim
|
||||
set -x -g VISUAL nvim
|
||||
end
|
||||
|
||||
# others
|
||||
if type -q tty-clock
|
||||
alias clock="tty-clock -c -C 4"
|
||||
end
|
||||
11
config/fish/prev.d/env.fish
Normal file
11
config/fish/prev.d/env.fish
Normal file
@@ -0,0 +1,11 @@
|
||||
# PATH
|
||||
fish_add_path $HOME/.local/scripts
|
||||
fish_add_path $HOME/.local/bin
|
||||
fish_add_path $HOME/.cargo/bin
|
||||
fish_add_path $HOME/go/bin
|
||||
|
||||
# man
|
||||
if type -q bat
|
||||
set -x -g MANPAGER "sh -c 'col -bx | bat -l man -p'"
|
||||
set -x -g MANROFFOPT -c
|
||||
end
|
||||
12
config/fish/prev.d/prompt.fish
Normal file
12
config/fish/prev.d/prompt.fish
Normal file
@@ -0,0 +1,12 @@
|
||||
function fish_prompt -d "Write out the prompt"
|
||||
# This shows up as USER@HOST /home/user/ >, with the directory colored
|
||||
# $USER and $hostname are set by fish, so you can just use them
|
||||
# instead of using `whoami` and `hostname`
|
||||
printf '%s@%s %s%s%s > ' $USER $hostname \
|
||||
(set_color $fish_color_cwd) (prompt_pwd) (set_color normal)
|
||||
end
|
||||
|
||||
# oh-my-posh
|
||||
if test -f $HOME/.config/posh_theme.omp.json; and type -q oh-my-posh
|
||||
oh-my-posh init fish --config $HOME/.config/posh_theme.omp.json | source
|
||||
end
|
||||
6
config/fish/prev.d/theme.fish
Normal file
6
config/fish/prev.d/theme.fish
Normal file
@@ -0,0 +1,6 @@
|
||||
set -l theme 'Catppuccin Mocha'
|
||||
|
||||
if not set -q fish_current_theme; or not string match -q "$theme" "$fish_current_theme"
|
||||
set -U fish_current_theme "$theme"
|
||||
fish_config theme save "$theme"
|
||||
end
|
||||
Reference in New Issue
Block a user