Setup neovim, alacritty and fish for dms
This commit is contained in:
+29
-26
@@ -4,6 +4,8 @@
|
||||
# Disable fish greeting
|
||||
set -g fish_greeting
|
||||
|
||||
alias nvim='/usr/local/nvim_012/bin/nvim'
|
||||
|
||||
# Core settings
|
||||
set -gx EDITOR nvim
|
||||
set -gx VISUAL nvim
|
||||
@@ -21,6 +23,9 @@ set -gx GOCACHE "$HOME/.go/cache"
|
||||
set -gx GOROOT /usr/local/go
|
||||
set -gx PATH /usr/local/go/bin $GOPATH/bin $PATH
|
||||
|
||||
# Direnv
|
||||
direnv hook fish | source
|
||||
|
||||
# ==============================================================================
|
||||
# FZF configuration
|
||||
# ==============================================================================
|
||||
@@ -191,32 +196,30 @@ set -g __fish_git_prompt_char_dirtystate '+'
|
||||
set -g __fish_git_prompt_char_stagedstate '●'
|
||||
set -g __fish_git_prompt_char_untrackedfiles ''
|
||||
|
||||
direnv hook fish | source
|
||||
|
||||
# Auto-attach to tmux on interactive shell start
|
||||
if status is-interactive && not set -q TMUX
|
||||
# Get all session names matching shell, shell-2, shell-3 etc
|
||||
set sessions (tmux list-sessions -F '#S' 2>/dev/null)
|
||||
# if status is-interactive && not set -q TMUX
|
||||
# # Get all session names matching shell, shell-2, shell-3 etc
|
||||
# set sessions (tmux list-sessions -F '#S' 2>/dev/null)
|
||||
|
||||
if test (count $sessions) -eq 0
|
||||
tmux new-session -s shell
|
||||
else
|
||||
# Check if any shell session is unattached and attach it
|
||||
set target (tmux list-sessions -F '#{session_name} #{session_attached}' 2>/dev/null \
|
||||
| grep '^shell' | grep ' 0$' | head -1 | awk '{print $1}')
|
||||
# if test (count $sessions) -eq 0
|
||||
# tmux new-session -s shell
|
||||
# else
|
||||
# # Check if any shell session is unattached and attach it
|
||||
# set target (tmux list-sessions -F '#{session_name} #{session_attached}' 2>/dev/null \
|
||||
# | grep '^shell' | grep ' 0$' | head -1 | awk '{print $1}')
|
||||
|
||||
if test -n "$target"
|
||||
tmux attach -t $target
|
||||
else
|
||||
# All shell sessions attached — find next number
|
||||
set nums 1
|
||||
for s in $sessions
|
||||
if string match -rq '^shell-(\d+)$' $s
|
||||
set nums $nums (string replace 'shell-' '' $s)
|
||||
end
|
||||
end
|
||||
set next (math (string join \n $nums | sort -n | tail -1) + 1)
|
||||
tmux new-session -s shell-$next
|
||||
end
|
||||
end
|
||||
end
|
||||
# if test -n "$target"
|
||||
# tmux attach -t $target
|
||||
# else
|
||||
# # All shell sessions attached — find next number
|
||||
# set nums 1
|
||||
# for s in $sessions
|
||||
# if string match -rq '^shell-(\d+)$' $s
|
||||
# set nums $nums (string replace 'shell-' '' $s)
|
||||
# end
|
||||
# end
|
||||
# set next (math (string join \n $nums | sort -n | tail -1) + 1)
|
||||
# tmux new-session -s shell-$next
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
|
||||
Reference in New Issue
Block a user