1
0
mirror of https://github.com/alrayyes/server-dotfiles synced 2023-11-14 15:56:25 +00:00
server-dotfiles/fish/.config/omf/init.fish
2020-08-24 14:22:39 +02:00

258 lines
3.9 KiB
Fish

function fish_greeting
neofetch
end
function path_if_exists
if [ -d "$argv" ]
set PATH $PATH "$argv"
end
end
# Add paths
path_if_exists ~/.config/yarn/global/node_modules/.bin
path_if_exists ~/.local/bin
path_if_exists ~/.emacs.d/bin
path_if_exists ~/.local/share/go/bin
path_if_exists ~/.local/share/cargo/bin
# Set GPG TTY
set GPG_TTY (tty)
# editor
set -xg EDITOR "nvim"
# bobthefish
set -xg theme_nerd_fonts yes
set -xg theme_color_scheme gruvbox
# sudope
set -xg sudope_sequence \e\e
# Set tmux tmpdir to proper directory
set -xg TMUX_TMPDIR "$XDG_RUNTIME_DIR"
# Rust
set -xg CARGO_HOME ~/.local/share/cargo
set -xg RUSTUP_HOME ~/.local/share/rustup
# Golang
set -xg GOPATH ~/.local/share/go
# nvim alias
abbr --add v 'nvim'
abbr --add sv 'sudo nvim'
# ls alias
abbr --add ls 'exa'
abbr --add l 'exa -al'
# git alaises
abbr --add gpoat "git push origin --all && git push origin --tags"
abbr --add gs "git status"
abbr --add gd "git diff"
abbr --add g "git"
# Prevent mv & rm oopsies
abbr --add mv "mv -i"
abbr --add rm "rm -i"
# Colorize diff
abbr --add diff "diff --color"
# Load lfcd wiith proper icons
function lf
set -lx LF_ICONS "\
di=:\
fi=:\
ln=:\
or=:\
ex=:\
*.c=:\
*.cc=:\
*.clj=:\
*.coffee=:\
*.cpp=:\
*.css=:\
*.d=:\
*.dart=:\
*.erl=:\
*.exs=:\
*.fs=:\
*.go=:\
*.h=:\
*.hh=:\
*.hpp=:\
*.hs=:\
*.html=:\
*.java=:\
*.jl=:\
*.js=:\
*.json=:\
*.lua=:\
*.md=:\
*.php=:\
*.pl=:\
*.pro=:\
*.py=:\
*.rb=:\
*.rs=:\
*.scala=:\
*.ts=:\
*.vim=:\
*.cmd=:\
*.ps1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batcat"
# Set fzf keybindings here for now as they don't work with stable version of omf https://github.com/jethrokuan/fzf/issues/109
bind \co '__fzf_find_file'
bind \cr '__fzf_reverse_isearch'
bind \ec '__fzf_cd'
bind \eC '__fzf_cd --hidden'
bind \eO '__fzf_open'
bind \eo '__fzf_open --editor'
if bind -M insert >/dev/null 2>/dev/null
bind -M insert \co '__fzf_find_file'
bind -M insert \cr '__fzf_reverse_isearch'
bind -M insert \ec '__fzf_cd'
bind -M insert \eC '__fzf_cd --hidden'
bind -M insert \eO '__fzf_open'
bind -M insert \eo '__fzf_open --editor'
end
if set -q FZF_COMPLETE
bind \t '__fzf_complete'
if bind -M insert >/dev/null 2>/dev/null
bind -M insert \t '__fzf_complete'
end
end
# Make fzf use ripgrep if available
if type rg &> /dev/null
export FZF_DEFAULT_COMMAND='rg --files'
export FZF_DEFAULT_OPTS='-m --height 50% --border'
end