├── .config ├── alacritty │ └── alacritty.toml ├── nvim │ └── init.lua └── zsh │ ├── .zshenv │ └── .zshrc ├── README.md └── assets ├── c-demo.png └── demo.png /.config/alacritty/alacritty.toml: -------------------------------------------------------------------------------- 1 | # Alacritty Configuration File 2 | 3 | [window] 4 | # Set the background opacity (from 0.0 to 1.0, where 1.0 is opaque) 5 | opacity = 0.9 6 | 7 | # Window padding in pixels (scaled by DPI) 8 | padding = { x = 25, y = 25 } 9 | 10 | # Window decorations, can be "full", "none", "transparent", or "buttonless" 11 | decorations = "full" 12 | 13 | [shell] 14 | program = "/usr/local/bin/zsh" 15 | 16 | [font] 17 | size = 14.0 18 | 19 | normal = { family = "JetBrains Mono" } 20 | 21 | [colors] 22 | [colors.primary] 23 | background = "#1D1F21" 24 | foreground = "#C5C8C6" 25 | 26 | [colors.cursor] 27 | text = "CellBackground" 28 | cursor = "CellForeground" 29 | 30 | [colors.normal] 31 | black = "#1D1F21" 32 | red = "#CC6666" 33 | green = "#B5BD68" 34 | yellow = "#F0C674" 35 | blue = "#81A2BE" 36 | magenta = "#B294BB" 37 | cyan = "#8ABEB7" 38 | white = "#C5C8C6" 39 | 40 | [colors.bright] 41 | black = "#969896" 42 | red = "#FF3333" 43 | green = "#9EC400" 44 | yellow = "#F0C674" 45 | blue = "#81A2BE" 46 | magenta = "#B77EE0" 47 | cyan = "#8ABEB7" 48 | white = "#FFFFFF" 49 | 50 | [cursor] 51 | # Set the cursor to be thin 52 | style = "Beam" 53 | -------------------------------------------------------------------------------- /.config/nvim/init.lua: -------------------------------------------------------------------------------- 1 | -- init.lua 2 | vim.g.mapleader = " " 3 | vim.g.maplocalleader = " " 4 | 5 | local opt = vim.opt 6 | local g = vim.g 7 | 8 | -- Speed up startup 9 | g.loaded_python3_provider = 0 10 | g.loaded_node_provider = 0 11 | g.loaded_perl_provider = 0 12 | g.loaded_ruby_provider = 0 13 | g.loaded_gzip = 1 14 | g.loaded_zip = 1 15 | g.loaded_zipPlugin = 1 16 | g.loaded_tar = 1 17 | g.loaded_tarPlugin = 1 18 | 19 | -- Basic settings 20 | opt.hidden = true 21 | opt.number = true 22 | opt.relativenumber = true 23 | opt.termguicolors = true 24 | opt.updatetime = 100 25 | opt.timeoutlen = 300 26 | opt.scrolloff = 8 27 | opt.shortmess:append("sIc") 28 | opt.lazyredraw = true 29 | opt.showmode = false 30 | 31 | -- Additional UI improvements 32 | opt.cursorline = true -- Highlight current line 33 | opt.signcolumn = "yes" -- Always show sign column 34 | opt.colorcolumn = "80" -- Show line length marker 35 | opt.list = true -- Show invisible characters 36 | opt.listchars = { -- Define invisible characters 37 | tab = "→ ", 38 | trail = "·", 39 | extends = "▶", 40 | precedes = "◀", 41 | } 42 | opt.splitright = true -- Open vertical splits to the right 43 | opt.splitbelow = true -- Open horizontal splits below 44 | opt.wrap = false -- Disable line wrapping 45 | 46 | -- Indentation settings (global) 47 | opt.expandtab = true -- Use spaces instead of tabs 48 | opt.shiftwidth = 2 -- Size of an indent 49 | opt.tabstop = 2 -- Size of a tab 50 | opt.softtabstop = 2 -- Size of a soft tab 51 | opt.autoindent = true -- Copy indent from current line when starting new line 52 | opt.smartindent = true -- Smart autoindenting on new lines 53 | 54 | -- Transparency settings 55 | vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) 56 | vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) 57 | 58 | -- Better completion performance 59 | opt.complete:remove({ 'i' }) 60 | opt.completeopt = 'menuone,noselect' 61 | 62 | -- File settings 63 | opt.backup = false 64 | opt.writebackup = false 65 | opt.undofile = true 66 | opt.swapfile = false 67 | 68 | -- Search 69 | opt.ignorecase = true 70 | opt.smartcase = true 71 | opt.hlsearch = true -- Highlight search results 72 | opt.incsearch = true -- Show search matches as you type 73 | 74 | -- Mouse and clipboard integration 75 | opt.mouse = "a" -- Enable mouse support 76 | opt.clipboard = "unnamedplus" -- Use system clipboard 77 | 78 | -- Create in a function to ensure all dependencies are loaded 79 | local function setup_keymaps() 80 | -- Clear the space key first 81 | vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) 82 | 83 | -- Essential keymaps with descriptive names for which-key 84 | vim.keymap.set('n', 'w', ':w', { silent = true, desc = "Save file" }) 85 | vim.keymap.set('n', 'q', ':q', { silent = true, desc = "Quit" }) 86 | vim.keymap.set('n', 'h', ':nohl', { silent = true, desc = "Clear highlights" }) 87 | 88 | -- Additional keymaps 89 | vim.keymap.set('n', '', ':w', { silent = true, desc = "Save file" }) 90 | vim.keymap.set('n', '', 'h', { desc = "Move to left window" }) 91 | vim.keymap.set('n', '', 'j', { desc = "Move to bottom window" }) 92 | vim.keymap.set('n', '', 'k', { desc = "Move to top window" }) 93 | vim.keymap.set('n', '', 'l', { desc = "Move to right window" }) 94 | vim.keymap.set('n', '', ':bnext', { silent = true, desc = "Next buffer" }) 95 | vim.keymap.set('n', '', ':bprevious', { silent = true, desc = "Previous buffer" }) 96 | end 97 | 98 | setup_keymaps() 99 | 100 | -- Install lazy.nvim 101 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 102 | if not vim.loop.fs_stat(lazypath) then 103 | vim.fn.system({ 104 | "git", "clone", "--filter=blob:none", 105 | "https://github.com/folke/lazy.nvim.git", 106 | "--branch=stable", lazypath, 107 | }) 108 | end 109 | vim.opt.rtp:prepend(lazypath) 110 | 111 | -- Fast plugins setup 112 | require("lazy").setup({ 113 | -- Essential plugins 114 | { 115 | 'nvim-treesitter/nvim-treesitter', 116 | build = ':TSUpdate', 117 | priority = 1000, 118 | config = function() 119 | require('nvim-treesitter.configs').setup({ 120 | sync_install = true, 121 | ensure_installed = { "lua", "rust", "python", "bash" }, 122 | highlight = { 123 | enable = true, 124 | additional_vim_regex_highlighting = { "bash" } 125 | }, 126 | indent = { enable = true }, 127 | -- Enable additional modules 128 | incremental_selection = { 129 | enable = true, 130 | keymaps = { 131 | init_selection = "gnn", 132 | node_incremental = "grn", 133 | scope_incremental = "grc", 134 | node_decremental = "grm", 135 | }, 136 | }, 137 | textobjects = { 138 | enable = true, 139 | select = { 140 | enable = true, 141 | lookahead = true, 142 | keymaps = { 143 | ["af"] = "@function.outer", 144 | ["if"] = "@function.inner", 145 | ["ac"] = "@class.outer", 146 | ["ic"] = "@class.inner", 147 | }, 148 | }, 149 | }, 150 | }) 151 | end, 152 | dependencies = { 153 | 'nvim-treesitter/nvim-treesitter-textobjects', 154 | }, 155 | }, 156 | 157 | -- Better UI 158 | { 159 | "folke/which-key.nvim", 160 | event = "VeryLazy", 161 | config = function() 162 | require("which-key").setup() 163 | end, 164 | }, 165 | 166 | -- LSP Support 167 | { 168 | 'neovim/nvim-lspconfig', 169 | dependencies = { 170 | 'williamboman/mason.nvim', 171 | 'williamboman/mason-lspconfig.nvim', 172 | { 173 | 'j-hui/fidget.nvim', 174 | opts = {} 175 | }, 176 | }, 177 | }, 178 | 179 | -- Fast completion 180 | { 181 | 'hrsh7th/nvim-cmp', 182 | dependencies = { 183 | 'hrsh7th/cmp-nvim-lsp', 184 | 'hrsh7th/cmp-buffer', 185 | 'hrsh7th/cmp-path', 186 | 'L3MON4D3/LuaSnip', 187 | }, 188 | config = function() 189 | local cmp = require('cmp') 190 | local luasnip = require('luasnip') 191 | 192 | cmp.setup({ 193 | snippet = { 194 | expand = function(args) 195 | luasnip.lsp_expand(args.body) 196 | end, 197 | }, 198 | mapping = cmp.mapping.preset.insert({ 199 | [''] = cmp.mapping.scroll_docs(-4), 200 | [''] = cmp.mapping.scroll_docs(4), 201 | [''] = cmp.mapping.complete(), 202 | [''] = cmp.mapping.confirm({ select = true }), 203 | }), 204 | sources = { 205 | { name = 'nvim_lsp' }, 206 | { name = 'luasnip' }, 207 | { name = 'buffer', keyword_length = 5 }, 208 | { name = 'path' }, 209 | }, 210 | performance = { 211 | max_view_entries = 30, 212 | }, 213 | }) 214 | end 215 | }, 216 | 217 | -- Modern fuzzy finder 218 | { 219 | 'nvim-telescope/telescope.nvim', 220 | dependencies = { 221 | 'nvim-lua/plenary.nvim', 222 | 'nvim-telescope/telescope-fzf-native.nvim', 223 | }, 224 | cmd = 'Telescope', 225 | config = function() 226 | require('telescope').setup({ 227 | defaults = { 228 | file_ignore_patterns = { "node_modules", ".git/", "dist/" }, 229 | mappings = { 230 | i = { 231 | [""] = "move_selection_next", 232 | [""] = "move_selection_previous", 233 | }, 234 | }, 235 | }, 236 | }) 237 | -- Key bindings for Telescope 238 | local builtin = require('telescope.builtin') 239 | vim.keymap.set('n', 'ff', builtin.find_files, { desc = "Find files" }) 240 | vim.keymap.set('n', 'fg', builtin.live_grep, { desc = "Live grep" }) 241 | vim.keymap.set('n', 'fb', builtin.buffers, { desc = "Find buffers" }) 242 | vim.keymap.set('n', 'fh', builtin.help_tags, { desc = "Help tags" }) 243 | end, 244 | }, 245 | 246 | -- Auto-pairs 247 | { 248 | "windwp/nvim-autopairs", 249 | event = "InsertEnter", 250 | config = function() 251 | require("nvim-autopairs").setup() 252 | end, 253 | }, 254 | 255 | -- Better commenting 256 | { 257 | 'numToStr/Comment.nvim', 258 | event = "VeryLazy", 259 | config = function() 260 | require('Comment').setup() 261 | end, 262 | }, 263 | 264 | -- Git signs (lazy loaded) 265 | { 266 | 'lewis6991/gitsigns.nvim', 267 | event = { "BufReadPre", "BufNewFile" }, 268 | opts = { 269 | signs = { 270 | add = { text = '+' }, 271 | change = { text = '~' }, 272 | delete = { text = '_' }, 273 | topdelete = { text = '‾' }, 274 | changedelete = { text = '~' }, 275 | }, 276 | numhl = false, 277 | linehl = false, 278 | watch_gitdir = { 279 | interval = 1000, 280 | follow_files = true 281 | }, 282 | sign_priority = 6, 283 | update_debounce = 100, 284 | status_formatter = nil, 285 | } 286 | }, 287 | 288 | -- ZSH support 289 | { 290 | "chrisbra/vim-zsh", 291 | ft = "zsh", 292 | config = function() 293 | -- Ensure proper ZSH file detection 294 | vim.filetype.add({ 295 | extension = { 296 | zsh = "zsh", 297 | }, 298 | filename = { 299 | [".zshrc"] = "zsh", 300 | [".zshenv"] = "zsh", 301 | [".zprofile"] = "zsh", 302 | [".zlogin"] = "zsh", 303 | [".zlogout"] = "zsh", 304 | }, 305 | }) 306 | end 307 | }, 308 | }) 309 | 310 | -- LSP Configuration 311 | require("mason").setup({ 312 | ui = { 313 | border = "none", 314 | icons = { 315 | package_installed = "✓", 316 | package_pending = "➜", 317 | package_uninstalled = "✗" 318 | } 319 | } 320 | }) 321 | 322 | require("mason-lspconfig").setup({ 323 | ensure_installed = { "lua_ls", "rust_analyzer", "pyright" }, 324 | automatic_installation = true, 325 | }) 326 | 327 | local capabilities = require('cmp_nvim_lsp').default_capabilities() 328 | local lspconfig = require('lspconfig') 329 | 330 | local servers = { 'rust_analyzer', 'pyright', 'lua_ls' } 331 | for _, lsp in ipairs(servers) do 332 | lspconfig[lsp].setup({ 333 | capabilities = capabilities, 334 | flags = { 335 | debounce_text_changes = 150, 336 | } 337 | }) 338 | end 339 | 340 | -- Optimize Lazy loading 341 | vim.api.nvim_create_autocmd("User", { 342 | pattern = "LazyDone", 343 | callback = function() 344 | vim.schedule(function() 345 | local stats = require("lazy").stats() 346 | print(stats.details) 347 | end) 348 | end 349 | }) 350 | 351 | -- Performance optimizations for large files 352 | local group = vim.api.nvim_create_augroup("large_file", { clear = true }) 353 | vim.api.nvim_create_autocmd("BufReadPre", { 354 | pattern = "*", 355 | group = group, 356 | callback = function() 357 | local buffer = vim.fn.expand("") 358 | local size = vim.fn.getfsize(buffer) 359 | if size > 1024 * 1024 then -- 1MB 360 | vim.opt_local.foldmethod = "manual" 361 | vim.opt_local.spell = false 362 | vim.opt_local.undofile = false 363 | vim.opt_local.swapfile = false 364 | vim.opt_local.relativenumber = false 365 | vim.opt_local.number = false 366 | end 367 | end, 368 | }) 369 | 370 | -- Restore cursor position 371 | local cursor_position = vim.api.nvim_create_augroup("cursor_position", { clear = true }) 372 | vim.api.nvim_create_autocmd("BufReadPost", { 373 | pattern = "*", 374 | group = cursor_position, 375 | callback = function() 376 | local mark = vim.api.nvim_buf_get_mark(0, '"') 377 | local lcount = vim.api.nvim_buf_line_count(0) 378 | if mark[1] > 0 and mark[1] <= lcount then 379 | pcall(vim.api.nvim_win_set_cursor, 0, mark) 380 | end 381 | end, 382 | }) 383 | 384 | -- ZSH specific settings 385 | local zsh_group = vim.api.nvim_create_augroup("zsh_config", { clear = true }) 386 | vim.api.nvim_create_autocmd("FileType", { 387 | pattern = "zsh", 388 | group = zsh_group, 389 | callback = function() 390 | vim.bo.commentstring = '# %s' 391 | vim.bo.expandtab = true 392 | vim.bo.shiftwidth = 2 393 | vim.bo.tabstop = 2 394 | vim.bo.softtabstop = 2 395 | end, 396 | }) 397 | 398 | 399 | -- Performance optimizations for position restoration 400 | vim.opt.shada = "!,'1000,<50,s10,h" -- Optimize shada file settings for faster loading 401 | -------------------------------------------------------------------------------- /.config/zsh/.zshenv: -------------------------------------------------------------------------------- 1 | export ZDOTDIR="$HOME/.config/zsh" 2 | -------------------------------------------------------------------------------- /.config/zsh/.zshrc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | ################### 4 | # INSTANT PROMPT # 5 | ################### 6 | # Enable Powerlevel10k instant prompt (must stay at top of zshrc) 7 | # Makes the prompt appear immediately while the rest of configs load 8 | if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then 9 | source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" 10 | fi 11 | 12 | ####################### 13 | # PERFORMANCE TWEAKS # 14 | ####################### 15 | # Reduce startup time by disabling features until needed 16 | skip_global_compinit=1 # Skip global compinit 17 | DISABLE_MAGIC_FUNCTIONS=true # Disable zsh magic functions 18 | ZSH_DISABLE_COMPFIX=true # Disable completion fixing 19 | 20 | # Additional optimizations for faster startup 21 | CASE_SENSITIVE="false" # Case-insensitive completion 22 | HYPHEN_INSENSITIVE="true" # Treat - and _ as same in completion 23 | DISABLE_AUTO_UPDATE="true" # Disable auto-updates for faster startup 24 | COMPLETION_WAITING_DOTS="true" # Show dots during completion 25 | 26 | ################### 27 | # HISTORY CONFIG # 28 | ################### 29 | # History settings for better command line navigation 30 | # Usage: 31 | # - Up/Down arrows to navigate history 32 | # - Ctrl+R to search history 33 | # - Type command with space prefix to exclude from history 34 | HISTFILE="${XDG_DATA_HOME:-$HOME/.local/share}/zsh/history" 35 | HISTSIZE=1000000 36 | SAVEHIST=1000000 37 | setopt BANG_HIST # Enable ! history expansion 38 | setopt EXTENDED_HISTORY # Save timestamp and duration 39 | setopt INC_APPEND_HISTORY # Immediate history saving 40 | setopt SHARE_HISTORY # Share history between sessions 41 | setopt HIST_EXPIRE_DUPS_FIRST # Remove duplicates first when trimming 42 | setopt HIST_IGNORE_DUPS # Don't save immediate duplicates 43 | setopt HIST_IGNORE_ALL_DUPS # Remove older duplicate entries 44 | setopt HIST_FIND_NO_DUPS # Don't show duplicates in search 45 | setopt HIST_IGNORE_SPACE # Don't save commands starting with space 46 | setopt HIST_SAVE_NO_DUPS # Don't write duplicate entries 47 | setopt HIST_REDUCE_BLANKS # Remove extra blanks 48 | setopt HIST_VERIFY # Show command before executing from history 49 | 50 | ######################## 51 | # DIRECTORY NAVIGATION # 52 | ######################## 53 | # Enhanced directory movement features 54 | # Usage: 55 | # - Just type directory name to cd into it 56 | # - cd - to go back to previous directory 57 | # - dirs -v to see directory stack 58 | setopt AUTO_CD 59 | setopt AUTO_PUSHD 60 | setopt PUSHD_IGNORE_DUPS 61 | setopt PUSHD_MINUS 62 | 63 | ################## 64 | # PATH SETTINGS # 65 | ################## 66 | # Fast path setup with common development directories 67 | typeset -U PATH path 68 | path=( 69 | $HOME/.local/bin # Local binaries 70 | $HOME/.cargo/bin # Rust binaries 71 | /usr/local/bin # Homebrew binaries 72 | $HOME/.npm/bin # NPM global binaries 73 | $HOME/.poetry/bin # Poetry binaries 74 | /usr/bin 75 | /bin 76 | /usr/sbin 77 | /sbin 78 | $HOME/go/bin # Go binaries 79 | $HOME/.deno/bin # Deno binaries 80 | $path 81 | ) 82 | 83 | ############# 84 | # EXPORTS # 85 | ############# 86 | # Essential environment variables 87 | export PATH EDITOR='nvim' VISUAL='nvim' \ 88 | DOCKER_HOST=unix:///Users/willlane/.docker/run/docker.sock 89 | 90 | #################### 91 | # PLUGIN MANAGER # 92 | #################### 93 | # Fast zinit setup for plugin management 94 | ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git" 95 | [[ -d $ZINIT_HOME ]] || { 96 | mkdir -p "$(dirname $ZINIT_HOME)" 97 | git clone --depth 1 https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME" 98 | } 99 | source "${ZINIT_HOME}/zinit.zsh" 100 | 101 | # Load essential plugins in turbo mode for faster startup 102 | zinit wait lucid light-mode for \ 103 | atinit"zicompinit; zicdreplay" \ 104 | zdharma-continuum/fast-syntax-highlighting \ 105 | atload"_zsh_autosuggest_start" \ 106 | zsh-users/zsh-autosuggestions 107 | 108 | # Git integration plugins 109 | zinit wait lucid for \ 110 | OMZ::lib/git.zsh \ 111 | OMZ::plugins/git/git.plugin.zsh 112 | 113 | # Directory jumping plugin 114 | zinit wait"1" lucid light-mode for \ 115 | agkozak/zsh-z 116 | 117 | #################### 118 | # AUTOSUGGESTIONS # 119 | #################### 120 | # Settings for command suggestions 121 | export ZSH_AUTOSUGGEST_USE_ASYNC=true 122 | export ZSH_AUTOSUGGEST_MANUAL_REBIND=true 123 | export ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20 124 | export ZSH_AUTOSUGGEST_STRATEGY=(history completion) 125 | 126 | ############# 127 | # FUNCTIONS # 128 | ############# 129 | # Create directory and cd into it 130 | # Usage: mcdir my/new/directory 131 | mcdir() { mkdir -p "$@" && cd "$@" } 132 | 133 | ############# 134 | # ALIASES # 135 | ############# 136 | # Quick shortcuts for common commands 137 | alias c='clear' 138 | alias ..='cd ..' 139 | alias ...='cd ../..' 140 | alias ....='cd ../../..' 141 | alias :q='exit' 142 | alias :o='nvim' 143 | alias :e='vim' 144 | alias vim='nvim' 145 | alias vi='nvim' 146 | alias rm='trash' # Safer alternative to rm 147 | 148 | ################## 149 | # GIT & HUB # 150 | ################## 151 | # Hub integration for GitHub features 152 | # Usage: hub commands work automatically with git 153 | git() { 154 | unfunction git 155 | eval "$(hub alias -s)" 156 | git "$@" 157 | } 158 | 159 | # Git shortcuts 160 | alias g='git' 161 | alias ga='git add' 162 | alias gc='git commit -S' # Signed commits 163 | alias gp='git push' 164 | alias gpu='git pull' 165 | alias gs='git status -sb' # Short status 166 | alias gd='git diff' 167 | 168 | # GitHub-specific commands through hub 169 | alias gh='git browse' # Open repo in browser 170 | alias gpr='git pull-request' # Create PR 171 | alias gf='git fork' # Fork repo 172 | 173 | unalias gp gpu 2>/dev/null # Prevent conflicts 174 | 175 | ################## 176 | # FILE LISTING # 177 | ################## 178 | # Modern ls replacement with eza 179 | # Usage: ls, ll, la, lt 180 | alias ls='eza --group-directories-first --color=always --color-scale size \ 181 | -a \ 182 | --git \ 183 | -l \ 184 | --time-style=long-iso \ 185 | --group \ 186 | --header \ 187 | --binary \ 188 | --classify \ 189 | --color-scale-mode=gradient' 190 | 191 | alias ll='ls' 192 | alias lt='ls --tree' 193 | 194 | export EZA_COLORS="di=34:ex=31:ur=33:uw=31:ux=32:ue=32:gr=33:gw=31:gx=32:tr=33:tw=31:tx=32" 195 | 196 | ################## 197 | # PYENV CONFIG # 198 | ################## 199 | export PYENV_ROOT="$HOME/.pyenv" 200 | export PATH="$PYENV_ROOT/bin:$PATH" 201 | function pyenv() { 202 | unfunction pyenv 203 | eval "$(command pyenv init -)" 204 | pyenv "$@" 205 | } 206 | 207 | ################# 208 | # COMPLETIONS # 209 | ################# 210 | FPATH="/opt/homebrew/share/zsh/site-functions:$FPATH" 211 | 212 | # Fast completion initialization 213 | autoload -Uz compinit 214 | if [[ -n ${ZDOTDIR}/.zcompdump(#qN.mh+24) ]]; then 215 | compinit 216 | else 217 | compinit -C 218 | fi 219 | 220 | # Completion settings 221 | zstyle ':completion:*' accept-exact '*(N)' 222 | zstyle ':completion:*' use-cache on 223 | zstyle ':completion:*' cache-path ~/.zsh/cache 224 | zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' 225 | zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31' 226 | zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd' 227 | zstyle ':completion:*' menu select 228 | _comp_options+=(globdots) 229 | 230 | ####################### 231 | # SEARCH FUNCTIONS # 232 | ####################### 233 | # Fast file search with fd 234 | # Usage: f pattern 235 | f() { fd --color always "$@" } 236 | 237 | # Fast content search with ripgrep 238 | # Usage: r "search pattern" 239 | r() { rg --color always --smart-case --line-number "$@" } 240 | 241 | # Quick directory jumping with z 242 | # Usage: j partial-dirname 243 | j() { z "$@" } 244 | 245 | # Fuzzy file opening 246 | # Usage: fo (then select file) 247 | fo() { ${EDITOR:-nvim} "$(fd --type file --hidden --exclude .git --exclude node_modules . | fzf)" } 248 | 249 | ####################### 250 | # PRODUCTIVITY # 251 | ####################### 252 | # Quick note taking 253 | # Usage: note "Something to remember" 254 | note() { 255 | echo "$(date '+%Y-%m-%d %H:%M:%S'): $*" >> ~/notes.md 256 | } 257 | 258 | # Quick timer 259 | # Usage: timer 5m 260 | timer() { 261 | local time=$1 262 | shift 263 | sleep $time && terminal-notifier -message "${*:-Timer is done!}" 264 | } 265 | 266 | ####################### 267 | # KEYBOARD SHORTCUTS # 268 | ####################### 269 | # Add after your current key bindings 270 | # macOS compatible key bindings 271 | # Alacritty specific key bindings 272 | bindkey "\e[1;3D" backward-word # Alt + Left 273 | bindkey "\e[1;3C" forward-word # Alt + Right 274 | bindkey "\e[H" beginning-of-line # Home 275 | bindkey "\e[F" end-of-line # End 276 | bindkey "\e[3~" delete-char # Delete 277 | bindkey "^?" backward-delete-char # Backspace 278 | bindkey "^[[A" history-beginning-search-backward # Up arrow 279 | bindkey "^[[B" history-beginning-search-forward # Down arrow 280 | 281 | # Additional Alacritty conveniences 282 | bindkey "^U" kill-whole-line # Ctrl + U 283 | bindkey "^K" kill-line # Ctrl + K 284 | bindkey "^W" backward-kill-word # Ctrl + W 285 | bindkey "^A" beginning-of-line # Ctrl + A 286 | bindkey "^E" end-of-line # Ctrl + E 287 | 288 | ################### 289 | # BAT CONFIG # 290 | ################### 291 | 292 | # Set bat as the default pager 293 | export MANPAGER="sh -c 'col -bx | bat -l man -p'" 294 | export BAT_PAGER="less -RF" 295 | 296 | # Bat theme and style settings 297 | export BAT_STYLE="numbers,changes,header" 298 | 299 | # Bat aliases for different use cases 300 | alias cat='bat --paging=never' # Replace cat with bat 301 | alias less='bat --paging=always' # Use bat instead of less 302 | alias bathelp='bat --plain --language=help' # Special help viewing 303 | alias batdiff='git diff --name-only --relative | xargs bat --diff' # Show git changes 304 | 305 | # Preview function using bat 306 | # Usage: preview file.txt 307 | preview() { 308 | fzf --preview 'bat --color=always --style=numbers --line-range=:500 {}' --preview-window=right:60% 309 | } 310 | 311 | ####################### 312 | # HELP FUNCTION # 313 | ####################### 314 | # Show command categories and their usage 315 | # Usage: help [category] 316 | help() { 317 | local category=${1} 318 | 319 | print_category() { 320 | echo "\033[1;34m${1}\033[0m" 321 | echo "\033[90m${(r:40::-:)}\033[0m" 322 | } 323 | 324 | # If no category specified, show available categories 325 | if [[ -z $category ]]; then 326 | print_category "Available Categories" 327 | echo "\033[33mfiles\033[0m - File operations and listings" 328 | echo "\033[33mgit\033[0m - Git and GitHub commands" 329 | echo "\033[33mnav\033[0m - Directory navigation" 330 | echo "\033[33msearch\033[0m - File and content search tools" 331 | echo "\033[33mutils\033[0m - Utility functions" 332 | echo 333 | echo "Usage: \033[32mhelp\033[0m \033[33m\033[0m" 334 | return 335 | fi 336 | 337 | case $category in 338 | "files") 339 | print_category "File Operations" 340 | echo "\033[33mls\033[0m - Enhanced file listing with git status" 341 | echo "\033[33mll\033[0m - Same as ls" 342 | echo "\033[33mla\033[0m - List all files including hidden" 343 | echo "\033[33mlt\033[0m - Tree view of directory" 344 | echo "\033[33mcat\033[0m - Better cat with syntax highlighting" 345 | echo "\033[33mless\033[0m - Enhanced file viewer" 346 | echo "\033[33mbathelp\033[0m - Show help pages with highlighting" 347 | echo "\033[33mbatdiff\033[0m - Show git changes with syntax highlighting" 348 | echo "\033[33mpreview\033[0m - Preview files with fzf and bat" 349 | ;; 350 | "git") 351 | print_category "Git Commands" 352 | echo "\033[33mga\033[0m - git add" 353 | echo "\033[33mgc\033[0m - git commit (signed)" 354 | echo "\033[33mgp\033[0m - git push" 355 | echo "\033[33mgpu\033[0m - git pull" 356 | echo "\033[33mgs\033[0m - git status (short format)" 357 | echo "\033[33mgd\033[0m - git diff" 358 | echo "\033[33mgh\033[0m - Open repo in browser" 359 | echo "\033[33mgpr\033[0m - Create pull request" 360 | echo "\033[33mgf\033[0m - Fork repository" 361 | ;; 362 | "nav") 363 | print_category "Navigation" 364 | echo "\033[33mmcdir\033[0m - Create directory and cd into it" 365 | echo "\033[33mj\033[0m - Jump to frequently used directory" 366 | echo "\033[33m..\033[0m - Go up one directory" 367 | echo "\033[33m...\033[0m - Go up two directories" 368 | echo "\033[33m....\033[0m - Go up three directories" 369 | ;; 370 | "search") 371 | print_category "Search Tools" 372 | echo "\033[33mf\033[0m - Fast file search (fd)" 373 | echo "\033[33mr\033[0m - Fast content search (ripgrep)" 374 | echo "\033[33mfo\033[0m - Fuzzy find and open file" 375 | ;; 376 | "utils") 377 | print_category "Utilities" 378 | echo "\033[33mnote\033[0m - Quick note taking (saves to ~/notes.md)" 379 | echo "\033[33mtimer\033[0m - Set countdown timer with notification" 380 | echo "\033[33mpreview\033[0m - Preview files with syntax highlighting" 381 | ;; 382 | esac 383 | } 384 | 385 | alias h='help' 386 | 387 | 388 | ################# 389 | # THEME # 390 | ################# 391 | # Load powerlevel10k theme 392 | source ~/powerlevel10k/powerlevel10k.zsh-theme 393 | [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh 394 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dotfiles 2 | 3 | Optimized dotfiles focused on zsh/nvim startup speed while maintaining functionality. 4 | 5 | ### No install instructions - patch it together as needed 6 | 7 | ![demo](assets/demo.png) 8 | ![c-demo](assets/c-demo.png) -------------------------------------------------------------------------------- /assets/c-demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/willdoescode/dotfiles/af9e37394a4c2959874bcd5017395d0c689025ae/assets/c-demo.png -------------------------------------------------------------------------------- /assets/demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/willdoescode/dotfiles/af9e37394a4c2959874bcd5017395d0c689025ae/assets/demo.png --------------------------------------------------------------------------------