configurations for fish, nvim, tmux and starship

This commit is contained in:
asif
2025-05-23 23:12:01 +05:30
commit 445e8a8835
16 changed files with 1077 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
# fnm
set FNM_PATH "/home/asif/.local/share/fnm"
if [ -d "$FNM_PATH" ]
set PATH "$FNM_PATH" $PATH
fnm env | source
end
# fnm
set FNM_PATH "/home/asif/.local/share/fnm"
if [ -d "$FNM_PATH" ]
set PATH "$FNM_PATH" $PATH
fnm env | source
end
# fnm
set FNM_PATH "/home/asif/.local/share/fnm"
if [ -d "$FNM_PATH" ]
set PATH "$FNM_PATH" $PATH
fnm env | source
end

View File

@@ -0,0 +1,100 @@
set -x TMUX_CONF $HOME/.config/tmux/.tmux.conf
# search and edit files
function f
set dir (count $argv) > /dev/null; and set dir $argv[1]; or set dir .
set selected (fd --type f --hidden --exclude .git . $dir | fzf --tmux --reverse)
if test -n "$selected"
nvim $selected
end
end
# initiate starship
starship init fish | source
# initiate fzf
fzf --fish | source
set -gx FZF_DEFAULT_COMMAND 'rg --files --hidden --follow --glob "!.git/*"'
set -gx FZF_CTRL_T_COMMAND 'fd --type f --hidden --follow --exclude .git'
set -gx FZF_ALT_C_COMMAND 'fd --type d --hidden --follow --exclude .git'
set -gx FZF_DEFAULT_OPTS '--tmux --layout=reverse --border --preview "bat --color=always --style=numbers {}"'
# color setting for fish prompt
set -g fish_color_command green
set -g fish_color_param cyan
set -g fish_color_error red
set -g fish_color_comment brblack
set -g fish_color_quote yellow
# neovim as editor
set -gx EDITOR nvim
set -gx VISUAL nvim
# aliases
alias v='nvim'
alias vi='nvim'
alias vim='nvim'
alias t='tmux'
alias ta='tmux attach || tmux new'
alias tl='tmux list-sessions'
alias gs='git status'
alias ga='git add'
alias gl='git log --oneline --graph --all'
alias gd='git diff'
alias gc='git commit -m'
alias gp='git push'
alias gpl='git pull'
alias gsw='git switch'
alias ls='eza --icons --group-directories-first'
alias ll='eza -l --icons --group-directories-first'
alias lt='eza -T --icons'
alias cat='bat --style=auto'
alias less='bat --style=auto --paging=always'
alias c='clear'
alias h='history'
alias df='df -h'
alias du='du -h'
alias mkdir='mkdir -p'
# quick cd to git repository root
function cdr -d "Jump to git repository root"
set -l git_root (git rev-parse --show-toplevel 2> /dev/null)
if test -n "$git_root"
cd "$git_root"
else
echo "Not in a git repository"
end
end
# quickly find and edit a file in neovim
function f -d "Search and open files in Neovim"
set -l file (rg --files --hidden --follow --glob "!.git/*" | fzf --tmux --preview "bat --color=always --style=numbers {}")
if test -n "$file"
nvim "$file"
end
end
# tmux session based on workspace directory
function tms -d "Tmux sessionizer"
set -l dir (fd --type d --hidden --follow --exclude .git | fzf --prompt="Select directory: ")
if test -n "$dir"
set -l session_name (basename "$dir" | tr . _)
if not tmux has-session -t "$session_name" 2> /dev/null
tmux new-session -d -s "$session_name" -c "$dir"
end
if test -n "$TMUX"
tmux switch-client -t "$session_name"
else
tmux attach-session -t "$session_name"
end
end
end
# disable fish greeting
set -g fish_greeting

View File

@@ -0,0 +1,34 @@
# This file contains fish universal variable definitions.
# VERSION: 3.0
SETUVAR Z_DATA_DIR:/home/asif/\x2elocal/share/z
SETUVAR __fish_initialized:3800
SETUVAR _fisher_upgraded_to_4_4:\x1d
SETUVAR fish_color_autosuggestion:brblack
SETUVAR fish_color_cancel:\x2dr
SETUVAR fish_color_command:normal
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:white\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_key_bindings:fish_default_key_bindings
SETUVAR fish_pager_color_completion:normal
SETUVAR fish_pager_color_description:yellow\x1e\x2di
SETUVAR fish_pager_color_prefix:normal\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:/home/asif/\x2esdkman/candidates/java/current/bin