diff --git a/conf.d/myabbrs.fish b/conf.d/myabbrs.fish index 4560f35..34d557c 100644 --- a/conf.d/myabbrs.fish +++ b/conf.d/myabbrs.fish @@ -1,4 +1,4 @@ -abbr -a -- cd z +#abbr -a -- cd z abbr -a -- opc opencode abbr -a -- opcc opencode -c abbr -a -- cl clear @@ -7,6 +7,8 @@ abbr -a -- l ezals abbr -a -- ll 'ezals -TL2' abbr -a -- q exit abbr -a -- v nvim +abbr -a -- vs nvim --server /tmp/nvim-server.sock +abbr -a -- vo nvim --server /tmp/nvim-server.sock --remote-tab abbr -a -- kc kubectl abbr -a -- kcc kubectl ctx abbr -a -- zj zellij diff --git a/config.fish b/config.fish index fe33bd6..2a864cb 100644 --- a/config.fish +++ b/config.fish @@ -5,6 +5,9 @@ set -gx EDITOR nvim set -gx KUBE_EDITOR nvim set -g TERM xterm-256color +# For enable nvim server, first instance become the listener +#set -gx NVIM_LISTEN_ADDRESS /tmp/nvim-server.sock + # Set correct TERM and TERMINAL for kitty set -gx TERM xterm-kitty set -gx TERMINAL kitty @@ -13,6 +16,12 @@ if status is-interactive # Commands to run in interactive sessions can go here fish_vi_key_bindings + # Disable flow control (Ctrl+S/Ctrl+Q) to prevent terminal freeze + # stty -ixon + + # Handle spurious cursor position reports that might appear in prompt + # This happens when background jobs query the terminal + # Ctrl-o Find a file. # Ctrl-r Search through command history. # Alt-c cd into sub-directories (recursively searched). @@ -20,24 +29,31 @@ if status is-interactive # Alt-o Open a file/dir using default editor ($EDITOR) # Alt-Shift-o Open a file/dir using xdg-open or open command - set -g fish_sequence_key_delay_ms 200 - bind -M insert -m default j,k cancel repaint-mode - bind -M insert \cn \\t - set -q KREW_ROOT; and set -gx PATH $PATH $KREW_ROOT/.krew/bin; or set -gx PATH $PATH $HOME/.krew/bin + set -g fish_sequence_key_delay_ms 200 + bind -M insert -m default j,k cancel repaint-mode + bind -M insert \cn \\t + set -q KREW_ROOT; and set -gx PATH $PATH $KREW_ROOT/.krew/bin; or set -gx PATH $PATH $HOME/.krew/bin - # Check max tmux window in the Home session and open the Home session in a new tmux window - # Find max window number in the Home session - #if test -z "$TMUX"; - # # set name "$(date '+%Y%m%d_%H%M%S')" - # # exec flock -w 1 -F -n "/tmp/zellij-$name" zellij -s "$name" - # exec tmux - #end - # if test -z "$ZELLIJ"; - # # set name "$(date '+%Y%m%d_%H%M%S')" - # # exec flock -w 1 -F -n "/tmp/zellij-$name" zellij -s "$name" - # exec zellij - # end + set -U autovenv_enable yes + set -U autovenv_announce no + set -U autovenv_dir .venv + # Check max tmux window in the Home session and open the Home session in a new tmux window + # Find max window number in the Home session + #if test -z "$TMUX"; + # # set name "$(date '+%Y%m%d_%H%M%S')" + # # exec flock -w 1 -F -n "/tmp/zellij-$name" zellij -s "$name" + # exec tmux + #end + # if test -z "$ZELLIJ"; + # # set name "$(date '+%Y%m%d_%H%M%S')" + # # exec flock -w 1 -F -n "/tmp/zellij-$name" zellij -s "$name" + # exec zellij + # end end fish_add_path /home/df/.opencode/bin + +# Added by LM Studio CLI (lms) +set -gx PATH $PATH /home/df/.lmstudio/bin +# End of LM Studio CLI section diff --git a/functions/ezals.fish b/functions/ezals.fish index e2e052d..c632b10 100644 --- a/functions/ezals.fish +++ b/functions/ezals.fish @@ -1,3 +1,3 @@ function ezals --wraps='eza --icons --git --no-user --octal-permissions --no-permissions --group-directories-first -s name -lah' --description 'Base exa' - eza --icons --git --no-user --octal-permissions --no-permissions --group-directories-first -s name -lah $argv + eza --icons --git --no-user --octal-permissions --no-permissions --group-directories-first -s name --hyperlink -lah $argv end diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index f3ec966..5199d0a 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -51,11 +51,19 @@ function fish_prompt --description 'Write out the prompt' printf '%s ' (fish_vcs_prompt) - set -l status_color (set_color $fish_color_status) - set -l statusb_color (set_color --bold $fish_color_status) - set -l prompt_status (__fish_print_pipestatus "[" "]" "|" "$status_color" "$statusb_color" $last_pipestatus) - echo -n $prompt_status - set_color normal - - echo -n "$suffix " + set -l status_color (set_color $fish_color_status) + set -l statusb_color (set_color --bold $fish_color_status) + set -l prompt_status (__fish_print_pipestatus "[" "]" "|" "$status_color" "$statusb_color" $last_pipestatus) + echo -n $prompt_status + set_color normal + + # Background jobs counter + set -l jobs_count (count (jobs -p)) + if test $jobs_count -gt 0 + set_color yellow + echo -n "[$jobs_count] " + set_color normal + end + + echo -n "$suffix " end