diff --git a/.aerospace.toml b/.aerospace.toml index cd1e895..760e52f 100644 --- a/.aerospace.toml +++ b/.aerospace.toml @@ -16,7 +16,7 @@ enable-normalization-opposite-orientation-for-nested-containers = true # See: https://nikitabobko.github.io/AeroSpace/guide#layouts # The 'accordion-padding' specifies the size of accordion padding # You can set 0 to disable the padding feature -accordion-padding = 300 +accordion-padding = 90 # Possible values: tiles|accordion default-root-container-layout = 'tiles' diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua index 727a938..571bd89 100644 --- a/nvim/lua/config/keymaps.lua +++ b/nvim/lua/config/keymaps.lua @@ -9,4 +9,18 @@ local wk = require("which-key") wk.add({ { "N", group = "Notes" }, { "Nt", ":Journal", desc = "Today" }, + { "C", group = "ChatGPT" }, + { "CC", ":ChatGPT", desc = "ChatGPT" }, + { "Ce", "ChatGPTEditWithInstruction", desc = "Edit with instruction", mode = { "n", "v" } }, + { "Cg", "ChatGPTRun grammar_correction", desc = "Grammar Correction", mode = { "n", "v" } }, + -- t = { "ChatGPTRun translate", "Translate", mode = { "n", "v" } }, + -- k = { "ChatGPTRun keywords", "Keywords", mode = { "n", "v" } }, + -- d = { "ChatGPTRun docstring", "Docstring", mode = { "n", "v" } }, + -- a = { "ChatGPTRun add_tests", "Add Tests", mode = { "n", "v" } }, + { "Co", "ChatGPTRun optimize_code", desc = "Optimize Code", mode = { "n", "v" } }, + -- s = { "ChatGPTRun summarize", "Summarize", mode = { "n", "v" } }, + { "Cf", "ChatGPTRun fix_bugs", desc = "Fix Bugs", mode = { "n", "v" } }, + -- x = { "ChatGPTRun explain_code", "Explain Code", mode = { "n", "v" } }, + -- r = { "ChatGPTRun roxygen_edit", "Roxygen Edit", mode = { "n", "v" } }, + -- l = { "ChatGPTRun code_readability_analysis", "Code Readability Analysis", mode = { "n", "v" } }, }) diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua index 999d2ae..4980d60 100644 --- a/nvim/lua/config/lazy.lua +++ b/nvim/lua/config/lazy.lua @@ -38,7 +38,7 @@ require("lazy").setup({ version = false, -- always use the latest git commit -- version = "*", -- try installing the latest stable version for plugins that support semver }, - install = { colorscheme = { "tokyonight", "habamax" } }, + install = { colorscheme = { "catppuccin" } }, checker = { enabled = true, -- check for plugin updates periodically notify = false, -- notify on update diff --git a/nvim/lua/plugins.disable/chatgpt.lua b/nvim/lua/plugins.disable/chatgpt.lua deleted file mode 100644 index 2186a34..0000000 --- a/nvim/lua/plugins.disable/chatgpt.lua +++ /dev/null @@ -1,17 +0,0 @@ -return { - "jackMort/ChatGPT.nvim", - event = "VeryLazy", - config = function() - require("chatgpt").setup({ - openai_params = { - model = "gpt-4.1" - } - }) - end, - dependencies = { - "MunifTanjim/nui.nvim", - "nvim-lua/plenary.nvim", - "folke/trouble.nvim", -- optional - "nvim-telescope/telescope.nvim" - } -} diff --git a/nvim/lua/plugins/blink.lua b/nvim/lua/plugins/blink.lua index 6877da9..ca88d12 100644 --- a/nvim/lua/plugins/blink.lua +++ b/nvim/lua/plugins/blink.lua @@ -1,6 +1,9 @@ return { { "saghen/blink.cmp", + dependencies = { + "Kaiser-Yang/blink-cmp-avante", + }, opts = { completion = { ghost_text = { @@ -16,6 +19,20 @@ return { auto_show = true, }, }, + sources = { + -- Add 'avante' to the list + -- NOTE Disbable adding this until I can properly figure it out + -- default = { "avante", "lsp", "path", "buffer" }, + providers = { + avante = { + module = "blink-cmp-avante", + name = "Avante", + opts = { + -- options for blink-cmp-avante + }, + }, + }, + }, }, }, } diff --git a/tmux/tmux.conf b/tmux/tmux.conf index b9e033e..5716ba0 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -1,6 +1,6 @@ +# Load catppuccin run ~/.config/tmux/plugins/catppuccin/tmux/catppuccin.tmux - # Options to make tmux more pleasant #set -g mouse on set -g default-terminal "tmux-256color" @@ -10,9 +10,9 @@ set -g renumber-windows on # Configure the catppuccin plugin set -g @catppuccin_flavor "mocha" set -g @catppuccin_window_status_style "slanted" +set -g @catppuccin_window_current_text " #{window_name} #{b:pane_current_path}" +set -g @catppuccin_window_text " #{window_name} #{b:pane_current_path}" -# Load catppuccin -run ~/.config/tmux/plugins/catppuccin/tmux/catppuccin.tmux # Make the status line pretty and add some modules set-option -g status-position top @@ -23,10 +23,8 @@ set -g status-left "#[fg=#{@thm_teal},bg=#{@thm_crust}]#[fg=#{@thm_crust},bg= #set -g status-left "#[fg=$thm_green,bg=$thm_bg,nobold,nounderscore,noitalics]#[fg=$thm_bg,bg=$thm_green,nobold,nounderscore,noitalics] #[fg=$thm_fg,bg=$thm_bg]#(hostname -s) " set -g status-right "#{E:@catppuccin_status_application}" -#set -agF status-right "#{E:@catppuccin_status_cpu}" set -ag status-right "#{E:@catppuccin_status_session}" -#set -ag status-right "#{E:@catppuccin_status_uptime}" -#set -agF status-right "#{E:@catppuccin_status_battery}" -#run ~/.config/tmux/plugins/tmux-plugins/tmux-cpu/cpu.tmux -#run ~/.config/tmux/plugins/tmux-plugins/tmux-battery/battery.tmux +# +#set -g pane-border-status top +#set -g pane-border-format "#{pane_index} #{pane_current_command}" diff --git a/zshrc b/zshrc index aaf0522..a4af6bd 100644 --- a/zshrc +++ b/zshrc @@ -1,4 +1,109 @@ -export PATH="${HOMEBREW_PREFIX}/opt/openssl/bin:$PATH" +# ~~~ Minh Config +# Optimized .zshrc for improved startup time +# Enable profiling when needed: zmodload zsh/zprof + +# ~~~~~~~~~~~~~~~~~~~~~~ Environment Setup ~~~~~~~~~~~~~~~~~~~~~~ +# XDG Base Directory Specification +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_CACHE_HOME="$HOME/.cache" +export XDG_DATA_HOME="$HOME/.local/share" + +# Language and compilation +export LANG=en_US.UTF-8 + +# ~~~~~~~~~~~~~~~~~~~~~~ Homebrew Setup ~~~~~~~~~~~~~~~~~~~~~~ +if [[ -f "/opt/homebrew/bin/brew" ]]; then + eval "$(/opt/homebrew/bin/brew shellenv)" +fi + +# ~~~~~~~~~~~~~~~~~~~~~~ Core Zsh Configuration ~~~~~~~~~~~~~~~~~~~~~~ +# Enable completion system (call compinit only once) +autoload -Uz compinit + +# Check if compinit needs to be run (once per day for performance) +for dump in ~/.zcompdump(N.mh+24); do + compinit + break +done +[[ -z "$dump" ]] && compinit -C + +# Enhanced completion styling for better UX +zstyle ':completion:*' menu select +zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*' +zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} +zstyle ':completion:*' completer _complete _match _approximate +zstyle ':completion:*:match:*' original only +zstyle ':completion:*:approximate:*' max-errors 1 numeric +zstyle ':completion:*' use-cache on +zstyle ':completion:*' cache-path ~/.zsh/cache + +# Ensure cache directory exists +[[ ! -d ~/.zsh/cache ]] && mkdir -p ~/.zsh/cache + +# Group completions by category +zstyle ':completion:*' group-name '' +zstyle ':completion:*:descriptions' format '%B%d%b' +zstyle ':completion:*:messages' format '%d' +zstyle ':completion:*:warnings' format 'No matches for: %d' + +# Process completion improvements +zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01' +zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w" + +# ~~~~~~~~~~~~~~~~~~~~~~ Plugin Loading (Conditional) ~~~~~~~~~~~~~~~~~~~~~~ +# Function to load plugins if they exist +load_plugin() { + [[ -f "$1" ]] && source "$1" +} + +# Load zsh plugins +load_plugin "$HOMEBREW_PREFIX/share/zsh-autosuggestions/zsh-autosuggestions.zsh" +load_plugin "$HOMEBREW_PREFIX/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" +load_plugin "$HOMEBREW_PREFIX/share/zsh-history-substring-search/zsh-history-substring-search.zsh" +load_plugin "$XDG_CONFIG_HOME/zsh-z/zsh-z.plugin.zsh" + +# ~~~~~~~~~~~~~~~~~~~~~~ Zsh-Autosuggestions Configuration ~~~~~~~~~~~~~~~~~~~~~~ +# Configure autosuggestions for seamless history integration +ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#555555,bold" +ZSH_AUTOSUGGEST_STRATEGY=(history completion) +ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20 +ZSH_AUTOSUGGEST_USE_ASYNC=true +ZSH_AUTOSUGGEST_MANUAL_REBIND=1 + +# History-based suggestions prioritization +ZSH_AUTOSUGGEST_HISTORY_IGNORE="(ls|cd|pwd|exit|clear)" + +# ~~~~~~~~~~~~~~~~~~~~~~ Completion Setup ~~~~~~~~~~~~~~~~~~~~~~ +# Add homebrew completions if available +if command -v brew &>/dev/null; then + fpath+="$HOMEBREW_PREFIX/share/zsh-completions" + fpath+="$HOMEBREW_PREFIX/share/zsh/site-functions" +fi + +# ~~~~~~~~~~~~~~~~~~~~~~ Editor & Shell Configuration ~~~~~~~~~~~~~~~~~~~~~~ +if [[ -n $SSH_CONNECTION ]]; then + export EDITOR='vim' +else + export EDITOR='nvim' +fi + +# ~~~~~~~~~~~~~~~~~~~~~ History Configuration ~~~~~~~~~~~~~~~~~~~~~~ +HISTFILE=~/.zsh_history +HISTSIZE=100000 +SAVEHIST=100000 + +# Enhanced history options for better autosuggestions +setopt HIST_IGNORE_SPACE +setopt HIST_IGNORE_DUPS +setopt HIST_IGNORE_ALL_DUPS +setopt HIST_SAVE_NO_DUPS +setopt HIST_REDUCE_BLANKS +setopt HIST_VERIFY + +# ~~~ Bas Config + + +export PATH="${HOME}/bin:${HOMEBREW_PREFIX}/opt/openssl/bin:$PATH" eval "$(direnv hook zsh)" @@ -23,6 +128,8 @@ git_info() { } setopt PROMPT_SUBST PROMPT='%F{green}%n@%m %F{blue}%~ %F{yellow}$(git_info)%f %# ' +export OPENAI_API_KEY=$(cat ~/.openai.key) +export KAGI_API_KEY=$(cat ~/.kagi.key) eval "$(zoxide init zsh)" alias cd=z @@ -32,3 +139,6 @@ Reminders: Use z EOF + +export SSH_AUTH_SOCK=~/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock +source ~/.zsh/zsh-vim-mode/zsh-vim-mode.plugin.zsh