├── .aliases ├── .config ├── alacritty │ └── alacritty.yml └── nvim │ └── init.vim ├── .gitconfig ├── .gitignore ├── .macos ├── .profile ├── .tmux.conf ├── .zshrc ├── Cask ├── LICENSE ├── README.md ├── install.sh ├── programs.sh └── terminal-demo.png /.aliases: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | alias vim="nvim" 4 | alias vimdiff="nvim -d" 5 | 6 | # Git 7 | alias gitsync="git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done && git pull --all" 8 | alias gpom="git pull origin master" 9 | 10 | # Recursively delete `.DS_Store` files 11 | alias cleanup="find . -type f -name '*.DS_Store' -ls -delete" 12 | 13 | # Empty the Trash on all mounted volumes and the main HDD. 14 | # Also, clear Apple’s System Logs to improve shell startup speed. 15 | # Finally, clear download history from quarantine. https://mths.be/bum 16 | alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl; sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'delete from LSQuarantineEvent'" 17 | 18 | # Show/hide hidden files in Finder 19 | alias show="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder" 20 | alias hide="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder" 21 | 22 | # Hide/show all desktop icons (useful when presenting) 23 | alias hidedesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder" 24 | alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder" 25 | 26 | # http://xkcd.com/530/ 27 | alias stfu="osascript -e 'set volume output muted true'" 28 | alias pumpitup="osascript -e 'set volume output volume 100'" 29 | 30 | # Lock the screen (when going AFK) 31 | alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend" 32 | 33 | # Reload the shell (i.e. invoke as a login shell) 34 | alias reload="exec ${SHELL} -l" 35 | 36 | # Kill all the tabs in Chrome to free up memory 37 | # [C] explained: http://www.commandlinefu.com/commands/view/402/exclude-grep-from-your-grepped-output-of-ps-alias-included-in-description 38 | alias chromekill="ps ux | grep '[C]hrome Helper --type=renderer' | grep -v extension-process | tr -s ' ' | cut -d ' ' -f2 | xargs kill" 39 | -------------------------------------------------------------------------------- /.config/alacritty/alacritty.yml: -------------------------------------------------------------------------------- 1 | # Configuration for Alacritty, the GPU enhanced terminal emulator 2 | 3 | # Any items in the `env` entry below will be added as 4 | # environment variables. Some entries may override variables 5 | # set by alacritty it self. 6 | env: 7 | # TERM env customization. 8 | # 9 | # If this property is not set, alacritty will set it to xterm-256color. 10 | # 11 | # Note that some xterm terminfo databases don't declare support for italics. 12 | # You can verify this by checking for the presence of `smso` and `sitm` in 13 | # `infocmp xterm-256color`. 14 | TERM: xterm-256color 15 | 16 | window: 17 | # Window dimensions (changes require restart) 18 | # 19 | # Specified in number of columns/lines, not pixels. If both are zero this 20 | # setting is ignored. 21 | dimensions: 22 | columns: 0 23 | lines: 0 24 | 25 | # Window padding (changes require restart) 26 | # 27 | # Blank space added around the window in pixels. This padding is not scaled by 28 | # DPI and the specified value is always added at both opposing sides. 29 | padding: 30 | x: 5 31 | y: 5 32 | 33 | # Spread additional padding evenly around the terminal content. 34 | dynamic_padding: false 35 | 36 | # Window decorations 37 | # 38 | # Available values: 39 | # - full: borders and title bar 40 | # - none: neither borders nor title bar 41 | # - transparent: title bar, transparent background and title bar buttons 42 | # - buttonless: title bar, transparent background, but no title bar buttons 43 | decorations: full 44 | 45 | # Startup Mode (changes require restart) 46 | # 47 | # Values for `startup_mode`: 48 | # - Windowed 49 | # - Maximized 50 | # - Fullscreen 51 | # 52 | # Values for `startup_mode` (macOS only): 53 | # - SimpleFullscreen 54 | startup_mode: Maximized 55 | 56 | scrolling: 57 | # maximum number of lines in the scrollback buffer. Specifying '0' will 58 | # disable scrolling. 59 | history: 0 60 | 61 | # Number of lines the viewport will move for every line scrolled when 62 | # scrollback is enabled (history > 0). 63 | multiplier: 3 64 | 65 | # Font configuration (changes require restart) 66 | font: 67 | # The normal (roman) font face to use. 68 | # Style can be specified to pick a specific face. 69 | normal: 70 | family: "FiraCode Nerd Font" 71 | # style: Retina 72 | 73 | # The bold font face 74 | # bold: 75 | # family: "Fira Code" 76 | # family: "Source Code Pro" 77 | 78 | # The italic font face 79 | # italic: 80 | # family: "Fira Code" 81 | # family: "Source Code Pro" 82 | # style: "Medium Italic" 83 | 84 | # Point size of the font 85 | size: 12.0 86 | 87 | # Offset is the extra space around each character. offset.y can be thought of 88 | # as modifying the linespacing, and offset.x as modifying the letter spacing. 89 | offset: 90 | x: 0 91 | y: 0 92 | 93 | # Glyph offset determines the locations of the glyphs within their cells with 94 | # the default being at the bottom. Increase the x offset to move the glyph to 95 | # the right, increase the y offset to move the glyph upward. 96 | glyph_offset: 97 | x: 0 98 | y: 0 99 | 100 | # Thin stroke font rendering (macOS only) 101 | # 102 | # Thin strokes are suitable for retina displays, but for non-retina you 103 | # probably want this set to false. 104 | # 105 | # macOS >= 10.14.x: 106 | # 107 | # If the font quality on non-retina display looks bad then set 108 | # `use_thin_strokes` to `true` and enable font smoothing by running the 109 | # following command: 110 | # `defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO` 111 | # 112 | # This is a global setting and will require a log out or restart to take 113 | # effect. 114 | use_thin_strokes: true 115 | 116 | # When true, bold text is drawn using the bright variant of colors. 117 | draw_bold_text_with_bright_colors: false 118 | 119 | # Use custom cursor colors. If true, display the cursor in the cursor.foreground 120 | # and cursor.background colors, otherwise invert the colors of the cursor. 121 | # custom_cursor_colors: false 122 | 123 | # Indexed Colors 124 | # 125 | # The indexed colors include all colors from 16 to 256. 126 | # When these are not set, they're filled with sensible defaults. 127 | # 128 | # Example: 129 | # `- { index: 16, color: '0xff00ff' }` 130 | # 131 | indexed_colors: [] 132 | 133 | # Visual Bell 134 | # 135 | # Any time the BEL code is received, Alacritty "rings" the visual bell. Once 136 | # rung, the terminal background will be set to white and transition back to the 137 | # default background color. You can control the rate of this transition by 138 | # setting the `duration` property (represented in milliseconds). You can also 139 | # configure the transition function by setting the `animation` property. 140 | # 141 | # Possible values for `animation` 142 | # `Ease` 143 | # `EaseOut` 144 | # `EaseOutSine` 145 | # `EaseOutQuad` 146 | # `EaseOutCubic` 147 | # `EaseOutQuart` 148 | # `EaseOutQuint` 149 | # `EaseOutExpo` 150 | # `EaseOutCirc` 151 | # `Linear` 152 | # 153 | # To completely disable the visual bell, set its duration to 0. 154 | # 155 | bell: 156 | animation: EaseOutExpo 157 | color: '0xffffff' 158 | duration: 0 159 | 160 | # Background opacity 161 | window.opacity: 1.0 162 | 163 | # Key bindings 164 | # 165 | # Key bindings are specified as a list of objects. Each binding will specify a 166 | # key and modifiers required to trigger it, terminal modes where the binding is 167 | # applicable, and what should be done when the key binding fires. It can either 168 | # send a byte sequence to the running application (`chars`), execute a 169 | # predefined action (`action`) or fork and execute a specified command plus 170 | # arguments (`command`). 171 | # 172 | # Bindings are always filled by default, but will be replaced when a new binding 173 | # with the same triggers is defined. To unset a default binding, it can be 174 | # mapped to the `None` action. 175 | # 176 | # Example: 177 | # `- { key: V, mods: Control|Shift, action: Paste }` 178 | # 179 | # Available fields: 180 | # - key 181 | # - mods (optional) 182 | # - chars | action | command (exactly one required) 183 | # - mode (optional) 184 | # 185 | # Values for `key`: 186 | # - `A` -> `Z` 187 | # - `F1` -> `F12` 188 | # - `Key1` -> `Key0` 189 | # 190 | # A full list with available key codes can be found here: 191 | # https://docs.rs/glutin/*/glutin/enum.VirtualKeyCode.html#variants 192 | # 193 | # Instead of using the name of the keys, the `key` field also supports using 194 | # the scancode of the desired key. Scancodes have to be specified as a 195 | # decimal number. 196 | # This command will allow you to display the hex scancodes for certain keys: 197 | # `showkey --scancodes` 198 | # 199 | # Values for `mods`: 200 | # - Command 201 | # - Control 202 | # - Option 203 | # - Super 204 | # - Shift 205 | # - Alt 206 | # 207 | # Multiple `mods` can be combined using `|` like this: `mods: Control|Shift`. 208 | # Whitespace and capitalization is relevant and must match the example. 209 | # 210 | # Values for `chars`: 211 | # The `chars` field writes the specified string to the terminal. This makes 212 | # it possible to pass escape sequences. 213 | # To find escape codes for bindings like `PageUp` ("\x1b[5~"), you can run 214 | # the command `showkey -a` outside of tmux. 215 | # Note that applications use terminfo to map escape sequences back to 216 | # keys. It is therefore required to update the terminfo when 217 | # changing an escape sequence. 218 | # 219 | # Values for `action`: 220 | # - Paste 221 | # - PasteSelection 222 | # - Copy 223 | # - IncreaseFontSize 224 | # - DecreaseFontSize 225 | # - ResetFontSize 226 | # - ScrollPageUp 227 | # - ScrollPageDown 228 | # - ScrollLineUp 229 | # - ScrollLineDown 230 | # - ScrollToTop 231 | # - ScrollToBottom 232 | # - ClearHistory 233 | # - Hide 234 | # - Quit 235 | # - ClearLogNotice 236 | # - SpawnNewInstance 237 | # - ToggleFullscreen 238 | # - None 239 | # 240 | # Values for `action` (macOS only): 241 | # - ToggleSimpleFullscreen: Enters fullscreen without occupying another space 242 | # 243 | # Values for `command`: 244 | # The `command` field must be a map containing a `program` string and 245 | # an `args` array of command line parameter strings. 246 | # 247 | # Example: 248 | # `command: { program: "alacritty", args: ["-e", "vttest"] }` 249 | # 250 | # Values for `mode`: 251 | # - ~AppCursor 252 | # - AppCursor 253 | # - ~AppKeypad 254 | # - AppKeypad 255 | # 256 | key_bindings: 257 | - { key: V, mods: Control|Shift, action: Paste } 258 | - { key: C, mods: Control|Shift, action: Copy } 259 | - { key: Q, mods: Command, action: Quit } 260 | - { key: W, mods: Command, action: Quit } 261 | - { key: Insert, mods: Shift, action: PasteSelection } 262 | - { key: Key0, mods: Control, action: ResetFontSize } 263 | - { key: Equals, mods: Control, action: IncreaseFontSize } 264 | - { key: Minus, mods: Control, action: DecreaseFontSize } 265 | - { key: Home, chars: "\x1bOH", mode: AppCursor } 266 | - { key: Home, chars: "\x1b[H", mode: ~AppCursor } 267 | - { key: End, chars: "\x1bOF", mode: AppCursor } 268 | - { key: End, chars: "\x1b[F", mode: ~AppCursor } 269 | - { key: PageUp, mods: Shift, chars: "\x1b[5;2~" } 270 | - { key: PageUp, mods: Control, chars: "\x1b[5;5~" } 271 | - { key: PageUp, chars: "\x1b[5~" } 272 | - { key: PageDown, mods: Shift, chars: "\x1b[6;2~" } 273 | - { key: PageDown, mods: Control, chars: "\x1b[6;5~" } 274 | - { key: PageDown, chars: "\x1b[6~" } 275 | - { key: Tab, mods: Shift, chars: "\x1b[Z" } 276 | - { key: Back, chars: "\x7f" } 277 | - { key: Back, mods: Alt, chars: "\x1b\x7f" } 278 | - { key: Insert, chars: "\x1b[2~" } 279 | - { key: Delete, chars: "\x1b[3~" } 280 | - { key: Left, mods: Shift, chars: "\x1b[1;2D" } 281 | - { key: Left, mods: Control, chars: "\x1b[1;5D" } 282 | - { key: Left, mods: Alt, chars: "\x1b[1;3D" } 283 | - { key: Left, chars: "\x1b[D", mode: ~AppCursor } 284 | - { key: Left, chars: "\x1bOD", mode: AppCursor } 285 | - { key: Right, mods: Shift, chars: "\x1b[1;2C" } 286 | - { key: Right, mods: Control, chars: "\x1b[1;5C" } 287 | - { key: Right, mods: Alt, chars: "\x1b[1;3C" } 288 | - { key: Right, chars: "\x1b[C", mode: ~AppCursor } 289 | - { key: Right, chars: "\x1bOC", mode: AppCursor } 290 | - { key: Up, mods: Shift, chars: "\x1b[1;2A" } 291 | - { key: Up, mods: Control, chars: "\x1b[1;5A" } 292 | - { key: Up, mods: Alt, chars: "\x1b[1;3A" } 293 | - { key: Up, chars: "\x1b[A", mode: ~AppCursor } 294 | - { key: Up, chars: "\x1bOA", mode: AppCursor } 295 | - { key: Down, mods: Shift, chars: "\x1b[1;2B" } 296 | - { key: Down, mods: Control, chars: "\x1b[1;5B" } 297 | - { key: Down, mods: Alt, chars: "\x1b[1;3B" } 298 | - { key: Down, chars: "\x1b[B", mode: ~AppCursor } 299 | - { key: Down, chars: "\x1bOB", mode: AppCursor } 300 | - { key: F1, chars: "\x1bOP" } 301 | - { key: F2, chars: "\x1bOQ" } 302 | - { key: F3, chars: "\x1bOR" } 303 | - { key: F4, chars: "\x1bOS" } 304 | - { key: F5, chars: "\x1b[15~" } 305 | - { key: F6, chars: "\x1b[17~" } 306 | - { key: F7, chars: "\x1b[18~" } 307 | - { key: F8, chars: "\x1b[19~" } 308 | - { key: F9, chars: "\x1b[20~" } 309 | - { key: F10, chars: "\x1b[21~" } 310 | - { key: F11, chars: "\x1b[23~" } 311 | - { key: F12, chars: "\x1b[24~" } 312 | - { key: F1, mods: Shift, chars: "\x1b[1;2P" } 313 | - { key: F2, mods: Shift, chars: "\x1b[1;2Q" } 314 | - { key: F3, mods: Shift, chars: "\x1b[1;2R" } 315 | - { key: F4, mods: Shift, chars: "\x1b[1;2S" } 316 | - { key: F5, mods: Shift, chars: "\x1b[15;2~" } 317 | - { key: F6, mods: Shift, chars: "\x1b[17;2~" } 318 | - { key: F7, mods: Shift, chars: "\x1b[18;2~" } 319 | - { key: F8, mods: Shift, chars: "\x1b[19;2~" } 320 | - { key: F9, mods: Shift, chars: "\x1b[20;2~" } 321 | - { key: F10, mods: Shift, chars: "\x1b[21;2~" } 322 | - { key: F11, mods: Shift, chars: "\x1b[23;2~" } 323 | - { key: F12, mods: Shift, chars: "\x1b[24;2~" } 324 | - { key: F1, mods: Control, chars: "\x1b[1;5P" } 325 | - { key: F2, mods: Control, chars: "\x1b[1;5Q" } 326 | - { key: F3, mods: Control, chars: "\x1b[1;5R" } 327 | - { key: F4, mods: Control, chars: "\x1b[1;5S" } 328 | - { key: F5, mods: Control, chars: "\x1b[15;5~" } 329 | - { key: F6, mods: Control, chars: "\x1b[17;5~" } 330 | - { key: F7, mods: Control, chars: "\x1b[18;5~" } 331 | - { key: F8, mods: Control, chars: "\x1b[19;5~" } 332 | - { key: F9, mods: Control, chars: "\x1b[20;5~" } 333 | - { key: F10, mods: Control, chars: "\x1b[21;5~" } 334 | - { key: F11, mods: Control, chars: "\x1b[23;5~" } 335 | - { key: F12, mods: Control, chars: "\x1b[24;5~" } 336 | - { key: F1, mods: Alt, chars: "\x1b[1;6P" } 337 | - { key: F2, mods: Alt, chars: "\x1b[1;6Q" } 338 | - { key: F3, mods: Alt, chars: "\x1b[1;6R" } 339 | - { key: F4, mods: Alt, chars: "\x1b[1;6S" } 340 | - { key: F5, mods: Alt, chars: "\x1b[15;6~" } 341 | - { key: F6, mods: Alt, chars: "\x1b[17;6~" } 342 | - { key: F7, mods: Alt, chars: "\x1b[18;6~" } 343 | - { key: F8, mods: Alt, chars: "\x1b[19;6~" } 344 | - { key: F9, mods: Alt, chars: "\x1b[20;6~" } 345 | - { key: F10, mods: Alt, chars: "\x1b[21;6~" } 346 | - { key: F11, mods: Alt, chars: "\x1b[23;6~" } 347 | - { key: F12, mods: Alt, chars: "\x1b[24;6~" } 348 | - { key: F1, mods: Super, chars: "\x1b[1;3P" } 349 | - { key: F2, mods: Super, chars: "\x1b[1;3Q" } 350 | - { key: F3, mods: Super, chars: "\x1b[1;3R" } 351 | - { key: F4, mods: Super, chars: "\x1b[1;3S" } 352 | - { key: F5, mods: Super, chars: "\x1b[15;3~" } 353 | - { key: F6, mods: Super, chars: "\x1b[17;3~" } 354 | - { key: F7, mods: Super, chars: "\x1b[18;3~" } 355 | - { key: F8, mods: Super, chars: "\x1b[19;3~" } 356 | - { key: F9, mods: Super, chars: "\x1b[20;3~" } 357 | - { key: F10, mods: Super, chars: "\x1b[21;3~" } 358 | - { key: F11, mods: Super, chars: "\x1b[23;3~" } 359 | - { key: F12, mods: Super, chars: "\x1b[24;3~" } 360 | # Workaround for enabling the # key in a UK keyboard, see: https://github.com/alacritty/alacritty/issues/1073 361 | - { key: Key3, mods: Super, chars: "#" } 362 | 363 | # shortcuts for tmux. the leader key is control-b (0x02) 364 | 365 | mouse: 366 | # Click settings 367 | # 368 | # The `double_click` and `triple_click` settings control the time 369 | # alacritty should wait for accepting multiple clicks as one double 370 | # or triple click. 371 | double_click: { threshold: 300 } 372 | triple_click: { threshold: 300 } 373 | 374 | # If this is `true`, the cursor is temporarily hidden when typing. 375 | hide_when_typing: true 376 | 377 | # URL launcher 378 | # url: 379 | # This program is executed when clicking on a text which is recognized as a URL. 380 | # The URL is always added to the command as the last parameter. 381 | # 382 | # When set to `None`, URL launching will be disabled completely. 383 | # 384 | # Default: 385 | # - (macOS) open 386 | # - (Linux) xdg-open 387 | # - (Windows) explorer 388 | # launcher: 389 | # program: xdg-open 390 | # args: [] 391 | 392 | # These are the modifiers that need to be held down for opening URLs when clicking 393 | # on them. The available modifiers are documented in the key binding section. 394 | # modifiers: Control|Shift 395 | 396 | cursor: 397 | # Cursor style 398 | # 399 | # Values for 'style': 400 | # - ▇ Block 401 | # - _ Underline 402 | # - | Beam 403 | style: Block 404 | 405 | # If this is `true`, the cursor will be rendered as a hollow box when the 406 | # window is not focused. 407 | unfocused_hollow: true 408 | 409 | dynamic_title: true 410 | 411 | # Live config reload (changes require restart) 412 | live_config_reload: true 413 | 414 | debug: 415 | # Should display the render timer 416 | render_timer: false 417 | 418 | # Keep the log file after quitting Alacritty. 419 | persistent_logging: false 420 | 421 | # Log level 422 | # 423 | # Values for `log_level`: 424 | # - None 425 | # - Error 426 | # - Warn 427 | # - Info 428 | # - Debug 429 | # - Trace 430 | log_level: OFF 431 | 432 | # Print all received window events. 433 | print_events: false 434 | 435 | # Record all characters and escape sequences as test data. 436 | ref_test: false 437 | # vim: nospell 438 | 439 | ######################################## 440 | # Catpuccin Theme ## 441 | ######################################## 442 | 443 | color_schemes: 444 | latte: &latte # Default colors 445 | primary: 446 | background: "#EFF1F5" # base 447 | foreground: "#4C4F69" # text 448 | # Bright and dim foreground colors 449 | dim_foreground: "#4C4F69" # text 450 | bright_foreground: "#4C4F69" # text 451 | 452 | # Cursor colors 453 | cursor: 454 | text: "#EFF1F5" # base 455 | cursor: "#DC8A78" # rosewater 456 | vi_mode_cursor: 457 | text: "#EFF1F5" # base 458 | cursor: "#7287FD" # lavender 459 | 460 | # Search colors 461 | search: 462 | matches: 463 | foreground: "#EFF1F5" # base 464 | background: "#6C6F85" # subtext0 465 | focused_match: 466 | foreground: "#EFF1F5" # base 467 | background: "#40A02B" # green 468 | bar: 469 | foreground: "#EFF1F5" # base 470 | background: "#6C6F85" # subtext0 471 | 472 | # Keyboard regex hints 473 | hints: 474 | start: 475 | foreground: "#EFF1F5" # base 476 | background: "#DF8E1D" # yellow 477 | end: 478 | foreground: "#EFF1F5" # base 479 | background: "#6C6F85" # subtext0 480 | 481 | # Selection colors 482 | selection: 483 | text: "#EFF1F5" # base 484 | background: "#DC8A78" # rosewater 485 | 486 | # Normal colors 487 | normal: 488 | black: "#5C5F77" # subtext1 489 | red: "#D20F39" # red 490 | green: "#40A02B" # green 491 | yellow: "#DF8E1D" # yellow 492 | blue: "#1E66F5" # blue 493 | magenta: "#EA76CB" # pink 494 | cyan: "#179299" # teal 495 | white: "#ACB0BE" # surface2 496 | 497 | # Bright colors 498 | bright: 499 | black: "#6C6F85" # subtext0 500 | red: "#D20F39" # red 501 | green: "#40A02B" # green 502 | yellow: "#DF8E1D" # yellow 503 | blue: "#1E66F5" # blue 504 | magenta: "#EA76CB" # pink 505 | cyan: "#179299" # teal 506 | white: "#BCC0CC" # surface1 507 | 508 | # Dim colors 509 | dim: 510 | black: "#5C5F77" # subtext1 511 | red: "#D20F39" # red 512 | green: "#40A02B" # green 513 | yellow: "#DF8E1D" # yellow 514 | blue: "#1E66F5" # blue 515 | magenta: "#EA76CB" # pink 516 | cyan: "#179299" # teal 517 | white: "#ACB0BE" # surface2 518 | 519 | indexed_colors: 520 | - { index: 16, color: "#FE640B" } 521 | - { index: 17, color: "#DC8A78" } 522 | 523 | frappe: &frappe # Default colors 524 | primary: 525 | background: "#303446" # base 526 | foreground: "#C6D0F5" # text 527 | # Bright and dim foreground colors 528 | dim_foreground: "#C6D0F5" # text 529 | bright_foreground: "#C6D0F5" # text 530 | 531 | # Cursor colors 532 | cursor: 533 | text: "#303446" # base 534 | cursor: "#F2D5CF" # rosewater 535 | vi_mode_cursor: 536 | text: "#303446" # base 537 | cursor: "#BABBF1" # lavender 538 | 539 | # Search colors 540 | search: 541 | matches: 542 | foreground: "#303446" # base 543 | background: "#A5ADCE" # subtext0 544 | focused_match: 545 | foreground: "#303446" # base 546 | background: "#A6D189" # green 547 | bar: 548 | foreground: "#303446" # base 549 | background: "#A5ADCE" # subtext0 550 | 551 | # Keyboard regex hints 552 | hints: 553 | start: 554 | foreground: "#303446" # base 555 | background: "#E5C890" # yellow 556 | end: 557 | foreground: "#303446" # base 558 | background: "#A5ADCE" # subtext0 559 | 560 | # Selection colors 561 | selection: 562 | text: "#303446" # base 563 | background: "#F2D5CF" # rosewater 564 | 565 | # Normal colors 566 | normal: 567 | black: "#51576D" # surface1 568 | red: "#E78284" # red 569 | green: "#A6D189" # green 570 | yellow: "#E5C890" # yellow 571 | blue: "#8CAAEE" # blue 572 | magenta: "#F4B8E4" # pink 573 | cyan: "#81C8BE" # teal 574 | white: "#B5BFE2" # subtext1 575 | 576 | # Bright colors 577 | bright: 578 | black: "#626880" # surface2 579 | red: "#E78284" # red 580 | green: "#A6D189" # green 581 | yellow: "#E5C890" # yellow 582 | blue: "#8CAAEE" # blue 583 | magenta: "#F4B8E4" # pink 584 | cyan: "#81C8BE" # teal 585 | white: "#A5ADCE" # subtext0 586 | 587 | # Dim colors 588 | dim: 589 | black: "#51576D" # surface1 590 | red: "#E78284" # red 591 | green: "#A6D189" # green 592 | yellow: "#E5C890" # yellow 593 | blue: "#8CAAEE" # blue 594 | magenta: "#F4B8E4" # pink 595 | cyan: "#81C8BE" # teal 596 | white: "#B5BFE2" # subtext1 597 | 598 | indexed_colors: 599 | - { index: 16, color: "#EF9F76" } 600 | - { index: 17, color: "#F2D5CF" } 601 | 602 | macchiato: &macchiato # Default colors 603 | primary: 604 | background: "#24273A" # base 605 | foreground: "#CAD3F5" # text 606 | # Bright and dim foreground colors 607 | dim_foreground: "#CAD3F5" # text 608 | bright_foreground: "#CAD3F5" # text 609 | 610 | # Cursor colors 611 | cursor: 612 | text: "#24273A" # base 613 | cursor: "#F4DBD6" # rosewater 614 | vi_mode_cursor: 615 | text: "#24273A" # base 616 | cursor: "#B7BDF8" # lavender 617 | 618 | # Search colors 619 | search: 620 | matches: 621 | foreground: "#24273A" # base 622 | background: "#A5ADCB" # subtext0 623 | focused_match: 624 | foreground: "#24273A" # base 625 | background: "#A6DA95" # green 626 | bar: 627 | foreground: "#24273A" # base 628 | background: "#A5ADCB" # subtext0 629 | 630 | # Keyboard regex hints 631 | hints: 632 | start: 633 | foreground: "#24273A" # base 634 | background: "#EED49F" # yellow 635 | end: 636 | foreground: "#24273A" # base 637 | background: "#A5ADCB" # subtext0 638 | 639 | # Selection colors 640 | selection: 641 | text: "#24273A" # base 642 | background: "#F4DBD6" # rosewater 643 | 644 | # Normal colors 645 | normal: 646 | black: "#494D64" # surface1 647 | red: "#ED8796" # red 648 | green: "#A6DA95" # green 649 | yellow: "#EED49F" # yellow 650 | blue: "#8AADF4" # blue 651 | magenta: "#F5BDE6" # pink 652 | cyan: "#8BD5CA" # teal 653 | white: "#B8C0E0" # subtext1 654 | 655 | # Bright colors 656 | bright: 657 | black: "#5B6078" # surface2 658 | red: "#ED8796" # red 659 | green: "#A6DA95" # green 660 | yellow: "#EED49F" # yellow 661 | blue: "#8AADF4" # blue 662 | magenta: "#F5BDE6" # pink 663 | cyan: "#8BD5CA" # teal 664 | white: "#A5ADCB" # subtext0 665 | 666 | # Dim colors 667 | dim: 668 | black: "#494D64" # surface1 669 | red: "#ED8796" # red 670 | green: "#A6DA95" # green 671 | yellow: "#EED49F" # yellow 672 | blue: "#8AADF4" # blue 673 | magenta: "#F5BDE6" # pink 674 | cyan: "#8BD5CA" # teal 675 | white: "#B8C0E0" # subtext1 676 | 677 | indexed_colors: 678 | - { index: 16, color: "#F5A97F" } 679 | - { index: 17, color: "#F4DBD6" } 680 | 681 | mocha: &mocha # Default colors 682 | primary: 683 | background: "#1E1E2E" # base 684 | foreground: "#CDD6F4" # text 685 | # Bright and dim foreground colors 686 | dim_foreground: "#CDD6F4" # text 687 | bright_foreground: "#CDD6F4" # text 688 | 689 | # Cursor colors 690 | cursor: 691 | text: "#1E1E2E" # base 692 | cursor: "#F5E0DC" # rosewater 693 | vi_mode_cursor: 694 | text: "#1E1E2E" # base 695 | cursor: "#B4BEFE" # lavender 696 | 697 | # Search colors 698 | search: 699 | matches: 700 | foreground: "#1E1E2E" # base 701 | background: "#A6ADC8" # subtext0 702 | focused_match: 703 | foreground: "#1E1E2E" # base 704 | background: "#A6E3A1" # green 705 | bar: 706 | foreground: "#1E1E2E" # base 707 | background: "#A6ADC8" # subtext0 708 | 709 | # Keyboard regex hints 710 | hints: 711 | start: 712 | foreground: "#1E1E2E" # base 713 | background: "#F9E2AF" # yellow 714 | end: 715 | foreground: "#1E1E2E" # base 716 | background: "#A6ADC8" # subtext0 717 | 718 | # Selection colors 719 | selection: 720 | text: "#1E1E2E" # base 721 | background: "#F5E0DC" # rosewater 722 | 723 | # Normal colors 724 | normal: 725 | black: "#45475A" # surface1 726 | red: "#F38BA8" # red 727 | green: "#A6E3A1" # green 728 | yellow: "#F9E2AF" # yellow 729 | blue: "#89B4FA" # blue 730 | magenta: "#F5C2E7" # pink 731 | cyan: "#94E2D5" # teal 732 | white: "#BAC2DE" # subtext1 733 | 734 | # Bright colors 735 | bright: 736 | black: "#585B70" # surface2 737 | red: "#F38BA8" # red 738 | green: "#A6E3A1" # green 739 | yellow: "#F9E2AF" # yellow 740 | blue: "#89B4FA" # blue 741 | magenta: "#F5C2E7" # pink 742 | cyan: "#94E2D5" # teal 743 | white: "#A6ADC8" # subtext0 744 | 745 | # Dim colors 746 | dim: 747 | black: "#45475A" # surface1 748 | red: "#F38BA8" # red 749 | green: "#A6E3A1" # green 750 | yellow: "#F9E2AF" # yellow 751 | blue: "#89B4FA" # blue 752 | magenta: "#F5C2E7" # pink 753 | cyan: "#94E2D5" # teal 754 | white: "#BAC2DE" # subtext1 755 | 756 | indexed_colors: 757 | - { index: 16, color: "#FAB387" } 758 | - { index: 17, color: "#F5E0DC" } 759 | 760 | # Colors 761 | colors: *macchiato 762 | -------------------------------------------------------------------------------- /.config/nvim/init.vim: -------------------------------------------------------------------------------- 1 | """"""""""""""""""""""""""""""""""""""""""""""" 2 | " => General 3 | """"""""""""""""""""""""""""""""""""""""""""""" 4 | 5 | set encoding=utf-8 " The encoding displayed 6 | set fileencoding=utf-8 " The encoding written to file 7 | syntax on " Enable syntax highlight 8 | set ttyfast " Faster redrawing 9 | set lazyredraw " Only redraw when necessary 10 | set cursorline " Find the current line quickly. 11 | 12 | 13 | 14 | """"""""""""""""""""""""""""""""""""""""""""""" 15 | " => Plugins List 16 | """"""""""""""""""""""""""""""""""""""""""""""" 17 | 18 | call plug#begin() 19 | 20 | " catpuccin colorscheme 21 | Plug 'catppuccin/nvim', {'as': 'catppuccin'} 22 | 23 | " file-tree explorer 24 | Plug 'kyazdani42/nvim-tree.lua' 25 | Plug 'kyazdani42/nvim-web-devicons' 26 | 27 | " .editorconfig (can this use native LSP? - check) 28 | Plug 'editorconfig/editorconfig-vim' 29 | 30 | " emmet 31 | Plug 'mattn/emmet-vim' 32 | 33 | " LSP support (see :help lsp) 34 | Plug 'williamboman/mason.nvim' 35 | Plug 'williamboman/mason-lspconfig.nvim' 36 | Plug 'neovim/nvim-lspconfig' 37 | 38 | " Auto-complete for LSP 39 | Plug 'hrsh7th/nvim-cmp' 40 | 41 | " LSP source for the auto-complete 42 | Plug 'hrsh7th/cmp-nvim-lsp' 43 | 44 | " Allows auto-complete within the buffer 45 | Plug 'hrsh7th/cmp-buffer' 46 | 47 | " Allows auto-complete for filesystem paths 48 | Plug 'hrsh7th/cmp-path' 49 | 50 | " Allows auto-complete for vim (LUA) configs 51 | Plug 'hrsh7th/cmp-nvim-lua' 52 | 53 | " Snippet engine to allow for expansions 54 | Plug 'hrsh7th/cmp-vsnip' 55 | Plug 'hrsh7th/vim-vsnip' 56 | 57 | " Prettier official plugin 58 | Plug 'prettier/vim-prettier', { 'do': 'npm install --omit=dev' } 59 | 60 | " File finder 61 | Plug 'nvim-lua/plenary.nvim' 62 | Plug 'nvim-telescope/telescope.nvim' 63 | 64 | " Make telescope faster by adding native FZF sorter 65 | " https://github.com/nvim-telescope/telescope-fzf-native.nvim/issues/23#issuecomment-1174097943 66 | Plug 'lucasfcosta/telescope-fzf-native.nvim', { 'do': 'make' } 67 | 68 | " Enable live-grep capabilities on Telescope 69 | Plug 'BurntSushi/ripgrep' 70 | 71 | " Ok, Microsoft, you win 72 | Plug 'github/copilot.vim' 73 | 74 | " Helm 75 | Plug 'towolf/vim-helm' 76 | 77 | call plug#end() 78 | 79 | 80 | """"""""""""""""""""""""""""""""""""""""""""""" 81 | " => Plugin Related Configs 82 | """"""""""""""""""""""""""""""""""""""""""""""" 83 | 84 | " NvimTree 85 | map :NvimTreeToggle 86 | 87 | lua << EOF 88 | require("nvim-tree").setup { 89 | actions = { 90 | open_file = { 91 | quit_on_open = true, 92 | } 93 | }, 94 | git = { 95 | enable = true, 96 | ignore = false, 97 | timeout = 500, 98 | }, 99 | } 100 | EOF 101 | 102 | " make emmet behave well with JSX in JS and TS files 103 | let g:user_emmet_settings = { 104 | \ 'javascript' : { 105 | \ 'extends' : 'jsx', 106 | \ }, 107 | \ 'typescript' : { 108 | \ 'extends' : 'tsx', 109 | \ }, 110 | \} 111 | 112 | " Prettier 113 | let g:prettier#exec_cmd_async = 1 114 | let g:prettier#autoformat = 1 115 | let g:prettier#autoformat_require_pragma = 0 116 | 117 | 118 | """"""""""""""""""""""""""""""""""""""""""""""" 119 | " => Native Visual Related Configs 120 | """"""""""""""""""""""""""""""""""""""""""""""" 121 | 122 | " 256 colors 123 | set t_Co=256 124 | 125 | " long lines as just one line (have to scroll horizontally) 126 | set nowrap 127 | 128 | " line numbers 129 | set relativenumber 130 | set number 131 | 132 | " show the status line all the time 133 | set laststatus=2 134 | 135 | " toggle invisible characters 136 | set list 137 | set listchars=tab:¦\ ,eol:¬,trail:⋅,extends:❯,precedes:❮ 138 | set noeol 139 | 140 | " disable scrollbars (real hackers don't use scrollbars) 141 | set guioptions-=r 142 | set guioptions-=R 143 | set guioptions-=l 144 | set guioptions-=L 145 | 146 | " if hidden is not set, TextEdit might fail. 147 | set hidden 148 | 149 | " Some servers have issues with backup files, see #649 150 | set nobackup 151 | set nowritebackup 152 | 153 | " More space for displaying for messages 154 | set cmdheight=2 155 | 156 | " You will have bad experience for diagnostic messages when it's default 4000. 157 | set updatetime=300 158 | 159 | " don't give |ins-completion-menu| messages. 160 | set shortmess+=c 161 | 162 | " always show signcolumns (an extra column for err/warnings) 163 | set signcolumn=yes 164 | 165 | " show max width as 80 spaces 166 | set colorcolumn=80 167 | 168 | 169 | """"""""""""""""""""""""""""""""""""""""""""""" 170 | " => Theming comings 171 | """"""""""""""""""""""""""""""""""""""""""""""" 172 | 173 | lua << EOF 174 | require("catppuccin").setup({ 175 | integrations = { 176 | cmp = true, 177 | gitsigns = true, 178 | nvimtree = true, 179 | treesitter = false, 180 | notify = false, 181 | mini = { 182 | enabled = true, 183 | indentscope_color = "", 184 | }, 185 | native_lsp = { 186 | enabled = true, 187 | virtual_text = { 188 | errors = { "italic" }, 189 | hints = { "italic" }, 190 | warnings = { "italic" }, 191 | information = { "italic" }, 192 | }, 193 | underlines = { 194 | errors = { "underline" }, 195 | hints = { "underline" }, 196 | warnings = { "underline" }, 197 | information = { "underline" }, 198 | }, 199 | }, 200 | cmp = true, 201 | gitsigns = true, 202 | telescope = true, 203 | nvimtree = { 204 | enabled = true, 205 | show_root = true, 206 | transparent_panel = false, 207 | }, 208 | indent_blankline = { 209 | enabled = false, 210 | colored_indent_levels = false, 211 | }, 212 | dashboard = false, 213 | neogit = false, 214 | bufferline = false, 215 | markdown = true, 216 | lightspeed = false, 217 | ts_rainbow = false, 218 | hop = false, 219 | notify = false, 220 | telekasten = false, 221 | symbols_outline = false, 222 | }, 223 | }) 224 | EOF 225 | 226 | " set colorscheme 227 | let g:catppuccin_flavour = "frappe" " latte, frappe, macchiato, mocha 228 | colorscheme catppuccin 229 | 230 | 231 | """"""""""""""""""""""""""""""""""""""""""""""" 232 | " => General Key Mappings 233 | """"""""""""""""""""""""""""""""""""""""""""""" 234 | 235 | " map leaderkey to space (for namespacing user-land commands) 236 | let mapleader=" " 237 | 238 | " dont use arrowkeys 239 | noremap 240 | noremap 241 | noremap 242 | noremap 243 | 244 | " really, just dont 245 | inoremap 246 | inoremap 247 | inoremap 248 | inoremap 249 | 250 | " copy and paste to/from vIM and the clipboard 251 | nnoremap +y 252 | vnoremap +y 253 | nnoremap +P 254 | vnoremap +P 255 | 256 | " access system clipboard 257 | set clipboard=unnamed 258 | 259 | " swapfiles location 260 | set backupdir=/tmp// 261 | set directory=/tmp// 262 | 263 | 264 | """"""""""""""""""""""""""""""""""""""""""""""" 265 | " => File finder (Telescope) 266 | """"""""""""""""""""""""""""""""""""""""""""""" 267 | 268 | lua << EOF 269 | local telescope = require('telescope') 270 | local actions = require('telescope.actions') 271 | telescope.setup { 272 | defaults = { 273 | mappings = { 274 | i = { 275 | [""] = actions.move_selection_previous, 276 | [""] = actions.move_selection_next, 277 | [""] = function(bufnr) 278 | actions.send_selected_to_qflist(bufnr) 279 | vim.cmd("copen") 280 | end 281 | } 282 | }, 283 | vimgrep_arguments = { 284 | "rg", 285 | "--smart-case", 286 | "--no-heading", 287 | "--with-filename", 288 | "--line-number", 289 | "--column", 290 | "--hidden", 291 | "-g", 292 | "!.git/" 293 | } 294 | }, 295 | extensions = { 296 | fzf = { 297 | fuzzy = true, -- false will only do exact matching 298 | override_generic_sorter = true, -- override the generic sorter 299 | override_file_sorter = true, -- override the file sorter 300 | case_mode = "smart_case", -- or "ignore_case" or "respect_case" 301 | } 302 | }, 303 | } 304 | telescope.load_extension('fzf') 305 | EOF 306 | 307 | " map Telescope to ctrl+p 308 | nnoremap Telescope live_grep search="" 309 | command -nargs=1 Rg :Telescope live_grep default_text= 310 | 311 | " map other pickers 312 | nnoremap ff Telescope find_files search="" 313 | nnoremap gc Telescope git_commits search="" 314 | nnoremap gb Telescope git_branches search="" 315 | nnoremap bb Telescope buffers search="" 316 | 317 | """"""""""""""""""""""""""""""""""""""""""""""" 318 | " => Indentation 319 | """"""""""""""""""""""""""""""""""""""""""""""" 320 | 321 | " Use spaces instead of tabs 322 | set expandtab 323 | 324 | " Be smart when using tabs ;) 325 | " :help smarttab 326 | set smarttab 327 | 328 | " 1 tab == 4 spaces 329 | set shiftwidth=4 330 | set tabstop=4 331 | set softtabstop=4 332 | 333 | " Auto indent 334 | " Copy the indentation from the previous line when starting a new line 335 | set ai 336 | 337 | " Smart indent 338 | " Automatically inserts one extra level of indentation in some cases, and works for C-like files 339 | set si 340 | 341 | " search as I type 342 | set incsearch 343 | 344 | " scroll 8 rows before I reach bottom 345 | set scrolloff=8 346 | 347 | 348 | 349 | """"""""""""""""""""""""""""""""""""""""""""""" 350 | " => LSP-related configs 351 | """"""""""""""""""""""""""""""""""""""""""""""" 352 | 353 | " When to trigger completion on insert mode (see :help completeopt) 354 | set completeopt=menu,menuone 355 | 356 | lua << EOF 357 | -- Mappings. 358 | -- See `:help vim.diagnostic.*` for documentation on any of the below functions 359 | local opts = { noremap=true, silent=true } 360 | vim.keymap.set('n', 'xx', vim.diagnostic.open_float, opts) 361 | vim.keymap.set('n', 'lk', vim.diagnostic.goto_prev, opts) 362 | vim.keymap.set('n', 'lj', vim.diagnostic.goto_next, opts) 363 | vim.keymap.set('n', 'q', vim.diagnostic.setloclist, opts) 364 | 365 | -- Use an on_attach function to only map the following keys 366 | -- after the language server attaches to the current buffer 367 | local on_attach = function(client, bufnr) 368 | -- Enable completion triggered by 369 | vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') 370 | 371 | -- Mappings. 372 | -- See `:help vim.lsp.*` for documentation on any of the below functions 373 | local bufopts = { noremap=true, silent=true, buffer=bufnr } 374 | vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) 375 | vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) 376 | vim.keymap.set('n', 'gt', vim.lsp.buf.type_definition, bufopts) 377 | vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) 378 | vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) 379 | vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) 380 | vim.keymap.set('n', '', vim.lsp.buf.signature_help, bufopts) 381 | vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, bufopts) 382 | vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, bufopts) 383 | vim.keymap.set('n', 'wl', function() 384 | print(vim.inspect(vim.lsp.buf.list_workspace_folders())) 385 | end, bufopts) 386 | vim.keymap.set('n', 'rn', vim.lsp.buf.rename, bufopts) 387 | vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, bufopts) 388 | vim.keymap.set('n', 'f', vim.lsp.buf.formatting, bufopts) 389 | 390 | -- If there's a formatter available, use it on save 391 | if client.server_capabilities.documentFormattingProvider then 392 | vim.cmd("autocmd BufWritePre lua vim.lsp.buf.formatting_sync()") 393 | end 394 | end 395 | 396 | -- Setup nvim-cmp for auto-completion. 397 | local cmp = require('cmp') 398 | 399 | cmp.setup({ 400 | snippet = { 401 | expand = function(args) 402 | vim.fn["vsnip#anonymous"](args.body) 403 | end, 404 | }, 405 | window = { 406 | completion = cmp.config.window.bordered(), 407 | documentation = cmp.config.window.bordered(), 408 | }, 409 | mapping = cmp.mapping.preset.insert({ 410 | [''] = cmp.mapping.scroll_docs(-4), 411 | [''] = cmp.mapping.scroll_docs(4), 412 | [''] = cmp.mapping.complete(), 413 | [''] = cmp.mapping.abort(), 414 | [''] = cmp.mapping.confirm({ select = true }), 415 | }), 416 | formatting = { 417 | fields = { "kind", "abbr", "menu" }, 418 | format = function(entry, vim_item) 419 | vim_item.menu = ({ 420 | nvim_lsp = "[LSP]", 421 | buffer = "[Buffer]", 422 | path = "[Path]", 423 | nvim_lua = "[NVIM LUA]", 424 | })[entry.source.name] 425 | return vim_item 426 | end, 427 | }, 428 | sources = cmp.config.sources({ 429 | { name = 'nvim_lsp' }, 430 | { name = 'buffer' }, 431 | { name = 'path' }, 432 | { name = 'nvim_lua' }, 433 | }) 434 | }) 435 | 436 | require("mason").setup({ 437 | ui = { 438 | icons = { 439 | package_installed = "✓", 440 | package_pending = "➜", 441 | package_uninstalled = "✗" 442 | } 443 | } 444 | }) 445 | 446 | language_servers = { 447 | 'pyright', 'ts_ls', 'html', 'cssls', 'marksman', 'dockerls', 'yamlls', 'eslint', 448 | 'rust_analyzer', 'jsonls', 'lua_ls', 'gopls', 'terraformls', 'tflint', 449 | 'vimls' 450 | } 451 | 452 | 453 | require("mason-lspconfig").setup({ 454 | ensure_installed = language_servers, 455 | }) 456 | 457 | local capabilities = require('cmp_nvim_lsp') 458 | .default_capabilities(vim.lsp.protocol.make_client_capabilities()) 459 | 460 | local lsp_flags = { 461 | -- This is the default in Nvim 0.7+ 462 | debounce_text_changes = 150, 463 | } 464 | 465 | -- Setup server configs 466 | require'lspconfig'.tflint.setup{} 467 | 468 | require'lspconfig'.terraformls.setup{} 469 | 470 | require'lspconfig'.ts_ls.setup{} 471 | 472 | for i, ls in ipairs(language_servers) do 473 | local opts = { 474 | on_attach = function(client, bufnr) 475 | client.server_capabilities.documentFormattingProvider = false -- Valid for nvim >= 0.8 476 | on_attach(client, bufnr) 477 | end, 478 | capabilities = capabilities, 479 | flags = lsp_flags, 480 | } 481 | 482 | if ls == "ts_ls" or ls == "eslint" then 483 | -- Disable auto-formatting for TSServer and ESLint only so I can use prettier 484 | -- (unless I use fm) 485 | local tsserver_opts = { 486 | on_attach = function(client, bufnr) 487 | client.server_capabilities.documentFormattingProvider = false -- Valid for nvim >= 0.8 488 | vim.api.nvim_buf_set_keymap(bufnr, "n", "fm", "lua vim.lsp.buf.formatting()", {}) 489 | on_attach(client, bufnr) 490 | end, 491 | } 492 | opts = vim.tbl_deep_extend("keep", tsserver_opts, opts) 493 | end 494 | 495 | require('lspconfig')[ls].setup(opts) 496 | end 497 | 498 | -- Configurations for diagnostics 499 | local signs = { 500 | { name = "DiagnosticSignError", text = "" }, 501 | { name = "DiagnosticSignWarn", text = "" }, 502 | { name = "DiagnosticSignHint", text = "" }, 503 | { name = "DiagnosticSignInfo", text = "" }, 504 | } 505 | 506 | for _, sign in ipairs(signs) do 507 | vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" }) 508 | end 509 | 510 | local config = { 511 | virtual_text = false, 512 | signs = { active = signs }, 513 | update_in_insert = true, 514 | underline = true, 515 | severity_sort = true, 516 | float = { 517 | focusable = false, 518 | style = "minimal", 519 | border = "rounded", 520 | source = "always", 521 | header = "", 522 | prefix = "", 523 | } 524 | } 525 | 526 | vim.diagnostic.config(config) 527 | 528 | -- Auto diagnostics on hover 529 | vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]] 530 | 531 | -- Change border of documentation hover window, See https://github.com/neovim/neovim/pull/13998. 532 | vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { 533 | border = "rounded", 534 | }) 535 | 536 | -- Change border of signature help info 537 | vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { 538 | border = "rounded", 539 | }) 540 | 541 | EOF 542 | 543 | " Function to trim whitespace 544 | fun! TrimWhitespace() 545 | let l:save = winsaveview() 546 | keeppatterns %s/\s\+$//e 547 | call winrestview(l:save) 548 | endfun 549 | 550 | " Toggle verbose mode for debugging 551 | function! ToggleVerbose() 552 | if !&verbose 553 | set verbosefile=~/.log/vim/verbose.log 554 | set verbose=15 555 | else 556 | set verbose=0 557 | set verbosefile= 558 | endif 559 | endfunction 560 | 561 | " Automatically call a few functions when saving files 562 | augroup lucasfcosta 563 | autocmd! 564 | autocmd BufWritePre * :call TrimWhitespace() 565 | augroup END 566 | 567 | autocmd BufWritePre *.tfvars lua vim.lsp.buf.format() 568 | autocmd BufWritePre *.tf lua vim.lsp.buf.format() 569 | autocmd BufRead,BufNewFile *.mdx set filetype=markdown 570 | 571 | """"""""""""""""""""""""""""""""""""""""""""""" 572 | " => Utils (a.k.a. mess I can't categorize) 573 | """"""""""""""""""""""""""""""""""""""""""""""" 574 | -------------------------------------------------------------------------------- /.gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | name = Lucas Fernandes da Costa 3 | email = lucas@lucasfcosta.com 4 | username = lucasfcosta 5 | 6 | [core] 7 | editor = nvim 8 | whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol 9 | excludesfile = ~/.gitignore 10 | 11 | [credential] 12 | helper = store 13 | 14 | [merge] 15 | tool = vimdiff 16 | [mergetool] 17 | prompt = true 18 | [mergetool "vimdiff"] 19 | cmd = nvim -d $BASE $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J' 20 | 21 | [pull] 22 | rebase = true 23 | 24 | [push] 25 | recurseSubmodules = check 26 | 27 | [status] 28 | submodulesummary = 1 29 | 30 | 31 | [alias] 32 | a = add --all 33 | ap = add . -p 34 | ############# 35 | b = branch 36 | bd = branch -d 37 | bdd = branch -D 38 | br = branch -r 39 | ############# 40 | cm = commit -m 41 | ca = commit --amend 42 | ############# 43 | cp = cherry-pick 44 | cpa = cherry-pick --abort 45 | cpc = cherry-pick --continue 46 | ############# 47 | m = merge 48 | ma = merge --abort 49 | mc = merge --continue 50 | ms = merge --skip 51 | ############# 52 | co = checkout 53 | cob = checkout -b 54 | ############# 55 | pr = prune -v 56 | ############# 57 | ps = push 58 | psf = push -f 59 | psu = push -u 60 | pst = push --tags 61 | ############# 62 | rb = rebase 63 | rba = rebase --abort 64 | rbc = rebase --continue 65 | rbi = rebase --interactive 66 | rbs = rebase --skip 67 | ############# 68 | aliases = !git config -l | grep alias | cut -c 7- 69 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /.macos: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This has also been shamelessly copied from mathiasbynens 4 | # I tailored it according to my preferences, however 5 | 6 | # Close any open System Preferences panes, to prevent them from overriding 7 | # settings we’re about to change 8 | osascript -e 'tell application "System Preferences" to quit' 9 | 10 | # Ask for the administrator password upfront 11 | sudo -v 12 | 13 | # Keep-alive: update existing `sudo` time stamp until `.macos` has finished 14 | while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & 15 | 16 | ############################################################################### 17 | # General UI/UX # 18 | ############################################################################### 19 | 20 | # Set computer name (as done via System Preferences → Sharing) 21 | #sudo scutil --set ComputerName "0x6D746873" 22 | #sudo scutil --set HostName "0x6D746873" 23 | #sudo scutil --set LocalHostName "0x6D746873" 24 | #sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "0x6D746873" 25 | 26 | # Set standby delay to 24 hours (default is 1 hour) 27 | sudo pmset -a standbydelay 86400 28 | 29 | # Disable the sound effects on boot 30 | sudo nvram SystemAudioVolume=" " 31 | 32 | # Disable transparency in the menu bar and elsewhere on Yosemite 33 | defaults write com.apple.universalaccess reduceTransparency -bool true 34 | 35 | # Always show scrollbars 36 | defaults write NSGlobalDomain AppleShowScrollBars -string "WhenScrolling" 37 | # Possible values: `WhenScrolling`, `Automatic` and `Always` 38 | 39 | # Expand save panel by default 40 | # https://www.defaults-write.com/expand-save-panel-default 41 | defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true 42 | defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true 43 | 44 | # Automatically quit printer app once the print jobs complete 45 | defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true 46 | 47 | # Disable the “Are you sure you want to open this application?” dialog 48 | defaults write com.apple.LaunchServices LSQuarantine -bool false 49 | 50 | # Disable the crash reporter 51 | #defaults write com.apple.CrashReporter DialogType -string "none" 52 | 53 | ############################################################################### 54 | # Trackpad, mouse, keyboard, Bluetooth accessories, and input # 55 | ############################################################################### 56 | 57 | # Increase sound quality for Bluetooth headphones/headsets 58 | defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40 59 | 60 | # Set a blazingly fast keyboard repeat rate 61 | defaults write -g InitialKeyRepeat -int 10 62 | defaults write -g KeyRepeat -int 1 63 | 64 | # Show language menu in the top right corner of the boot screen 65 | sudo defaults write /Library/Preferences/com.apple.loginwindow showInputMenu -bool true 66 | 67 | ############################################################################### 68 | # Screen # 69 | ############################################################################### 70 | 71 | # Require password immediately after sleep or screen saver begins 72 | defaults write com.apple.screensaver askForPassword -int 1 73 | defaults write com.apple.screensaver askForPasswordDelay -int 0 74 | 75 | # Save screenshots to the desktop 76 | defaults write com.apple.screencapture location -string "${HOME}/Desktop" 77 | 78 | # Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF) 79 | defaults write com.apple.screencapture type -string "png" 80 | 81 | # Disable shadow in screenshots 82 | defaults write com.apple.screencapture disable-shadow -bool true 83 | 84 | ############################################################################### 85 | # Finder # 86 | ############################################################################### 87 | 88 | # Finder: allow quitting via ⌘ + Q; doing so will also hide desktop icons 89 | defaults write com.apple.finder QuitMenuItem -bool true 90 | 91 | # Finder: disable window animations and Get Info animations 92 | defaults write com.apple.finder DisableAllAnimations -bool true 93 | 94 | # Show icons for hard drives, servers, and removable media on the desktop 95 | defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true 96 | defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true 97 | defaults write com.apple.finder ShowMountedServersOnDesktop -bool true 98 | defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true 99 | 100 | # Finder: show hidden files by default 101 | #defaults write com.apple.finder AppleShowAllFiles -bool true 102 | 103 | # Finder: show all filename extensions 104 | defaults write NSGlobalDomain AppleShowAllExtensions -bool true 105 | 106 | # Finder: show status bar 107 | defaults write com.apple.finder ShowStatusBar -bool true 108 | 109 | # Finder: show path bar 110 | defaults write com.apple.finder ShowPathbar -bool true 111 | 112 | # Display full POSIX path as Finder window title 113 | defaults write com.apple.finder _FXShowPosixPathInTitle -bool true 114 | 115 | # Keep folders on top when sorting by name 116 | defaults write com.apple.finder _FXSortFoldersFirst -bool true 117 | 118 | # When performing a search, search the current folder by default 119 | defaults write com.apple.finder FXDefaultSearchScope -string "SCcf" 120 | 121 | # Disable the warning when changing a file extension 122 | defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false 123 | 124 | # Avoid creating .DS_Store files on network or USB volumes 125 | defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true 126 | defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true 127 | 128 | # Show the ~/Library folder 129 | chflags nohidden ~/Library 130 | 131 | # Show the /Volumes folder 132 | sudo chflags nohidden /Volumes 133 | 134 | ############################################################################### 135 | # Dock, Dashboard, and hot corners # 136 | ############################################################################### 137 | 138 | # Enable highlight hover effect for the grid view of a stack (Dock) 139 | defaults write com.apple.dock mouse-over-hilite-stack -bool true 140 | 141 | # Set the icon size of Dock items to 36 pixels 142 | defaults write com.apple.dock tilesize -int 36 143 | 144 | # Change minimize/maximize window effect 145 | defaults write com.apple.dock mineffect -string "scale" 146 | 147 | # Minimize windows into their application’s icon 148 | defaults write com.apple.dock minimize-to-application -bool true 149 | 150 | # Show indicator lights for open applications in the Dock 151 | defaults write com.apple.dock show-process-indicators -bool true 152 | 153 | # Don’t group windows by application in Mission Control 154 | # (i.e. use the old Exposé behavior instead) 155 | defaults write com.apple.dock expose-group-by-app -bool false 156 | 157 | # Speedup Exposé animation on Mission Control 158 | defaults write com.apple.dock expose-animation-duration -float 0.15 159 | 160 | # Remove the auto-hiding Dock delay 161 | defaults write com.apple.dock autohide-delay -float 0.0 162 | 163 | # Decrease animation time 164 | defaults write com.apple.dock autohide-time-modifier -float 0.75 165 | 166 | # Automatically hide and show the Dock 167 | defaults write com.apple.dock autohide -bool true 168 | 169 | ############################################################################### 170 | # Menu-bar # 171 | ############################################################################### 172 | 173 | # Thanks, internet 174 | # https://www.jamf.com/jamf-nation/discussions/10576/menu-bar-customization 175 | 176 | PreferredMenuExtras=( 177 | "/Applications/Utilities/Keychain Access.app/Contents/Resources/Keychain.menu" 178 | "/System/Library/CoreServices/Menu Extras/AirPort.menu" 179 | "/System/Library/CoreServices/Menu Extras/Battery.menu" 180 | "/System/Library/CoreServices/Menu Extras/Bluetooth.menu" 181 | "/System/Library/CoreServices/Menu Extras/Clock.menu" 182 | "/System/Library/CoreServices/Menu Extras/Eject.menu" 183 | ) 184 | 185 | currentUser=$( ls -l /dev/console | awk '{print $3}' ) 186 | 187 | userHome=$( dscl . read /Users/$currentUser NFSHomeDirectory | awk '{print $NF}' ) 188 | 189 | MenuExtras=$( defaults read "$userHome/Library/Preferences/com.apple.systemuiserver.plist" menuExtras | awk -F'"' '{print $2}' ) 190 | 191 | for menuExtra in "${PreferredMenuExtras[@]}"; do 192 | menuShortName=$( echo "${menuExtra}" | awk -F'/' '{print $NF}' ) 193 | if [[ !$( echo "${MenuExtras}" | grep "${menuExtra}" ) ]]; then 194 | open "${menuExtra}" 195 | fi 196 | done 197 | 198 | defaults write com.apple.menuextra.battery ShowPercent -string "YES" 199 | 200 | ############################################################################### 201 | # Safari & WebKit # 202 | ############################################################################### 203 | 204 | # Privacy: don’t send search queries to Apple 205 | defaults write com.apple.Safari UniversalSearchEnabled -bool false 206 | defaults write com.apple.Safari SuppressSearchSuggestions -bool true 207 | 208 | ############################################################################### 209 | # Terminal & iTerm 2 # 210 | ############################################################################### 211 | 212 | # Only use UTF-8 in Terminal.app 213 | defaults write com.apple.terminal StringEncodings -array 4 214 | 215 | ############################################################################### 216 | # Activity Monitor # 217 | ############################################################################### 218 | 219 | # Show the main window when launching Activity Monitor 220 | defaults write com.apple.ActivityMonitor OpenMainWindow -bool true 221 | 222 | # Visualize CPU usage in the Activity Monitor Dock icon 223 | defaults write com.apple.ActivityMonitor IconType -int 5 224 | 225 | # Show all processes in Activity Monitor 226 | defaults write com.apple.ActivityMonitor ShowCategory -int 0 227 | 228 | # Sort Activity Monitor results by CPU usage 229 | defaults write com.apple.ActivityMonitor SortColumn -string "CPUUsage" 230 | defaults write com.apple.ActivityMonitor SortDirection -int 0 231 | 232 | ############################################################################### 233 | # Mac App Store # 234 | ############################################################################### 235 | 236 | # Enable the automatic update check 237 | defaults write com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true 238 | 239 | # Check for software updates daily, not just once per week 240 | defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1 241 | 242 | # Install System data files & security updates 243 | defaults write com.apple.SoftwareUpdate CriticalUpdateInstall -int 1 244 | 245 | ############################################################################### 246 | # Photos # 247 | ############################################################################### 248 | 249 | # Prevent Photos from opening automatically when devices are plugged in 250 | defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true 251 | 252 | # Disable continuous spell checking 253 | defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "continuousSpellCheckingEnabled" -bool false 254 | 255 | ############################################################################### 256 | # Google Chrome & Google Chrome Canary # 257 | ############################################################################### 258 | 259 | # Disable the all too sensitive backswipe on trackpads 260 | defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool false 261 | defaults write com.google.Chrome.canary AppleEnableSwipeNavigateWithScrolls -bool false 262 | 263 | # Use the system-native print preview dialog 264 | defaults write com.google.Chrome DisablePrintPreview -bool true 265 | defaults write com.google.Chrome.canary DisablePrintPreview -bool true 266 | 267 | # Expand the print dialog by default 268 | defaults write com.google.Chrome PMPrintingExpandedStateForPrint2 -bool true 269 | defaults write com.google.Chrome.canary PMPrintingExpandedStateForPrint2 -bool true 270 | 271 | ############################################################################### 272 | # Transmission.app # 273 | ############################################################################### 274 | 275 | # Use `~/Documents/Torrents` to store incomplete downloads 276 | defaults write org.m0k.transmission UseIncompleteDownloadFolder -bool true 277 | defaults write org.m0k.transmission IncompleteDownloadFolder -string "${HOME}/Documents/Torrents" 278 | 279 | # Use `~/Downloads` to store completed downloads 280 | defaults write org.m0k.transmission DownloadLocationConstant -bool true 281 | 282 | # Trash original torrent files 283 | defaults write org.m0k.transmission DeleteOriginalTorrent -bool true 284 | 285 | # Hide the donate message 286 | defaults write org.m0k.transmission WarningDonate -bool false 287 | 288 | # Hide the legal disclaimer 289 | defaults write org.m0k.transmission WarningLegal -bool false 290 | 291 | # IP block list. 292 | # Source: https://giuliomac.wordpress.com/2014/02/19/best-blocklist-for-transmission/ 293 | defaults write org.m0k.transmission BlocklistNew -bool true 294 | defaults write org.m0k.transmission BlocklistURL -string "http://john.bitsurge.net/public/biglist.p2p.gz" 295 | defaults write org.m0k.transmission BlocklistAutoUpdate -bool true 296 | 297 | # Randomize port on launch 298 | defaults write org.m0k.transmission RandomPort -bool true 299 | 300 | ############################################################################### 301 | # Kill affected applications # 302 | ############################################################################### 303 | 304 | for app in "Activity Monitor" \ 305 | "Address Book" \ 306 | "Calendar" \ 307 | "cfprefsd" \ 308 | "Contacts" \ 309 | "Dock" \ 310 | "Finder" \ 311 | "Google Chrome Canary" \ 312 | "Google Chrome" \ 313 | "Mail" \ 314 | "Messages" \ 315 | "Photos" \ 316 | "Safari" \ 317 | "SystemUIServer" \ 318 | "Terminal" \ 319 | "Transmission" \ 320 | "iCal"; do 321 | killall "${app}" &> /dev/null 322 | done 323 | echo "Done. Note that some of these changes require a logout/restart to take effect." 324 | -------------------------------------------------------------------------------- /.profile: -------------------------------------------------------------------------------- 1 | export SHELL=`which zsh` 2 | [ -z "$ZSH_VERSION" ] && exec "$SHELL" -l 3 | -------------------------------------------------------------------------------- /.tmux.conf: -------------------------------------------------------------------------------- 1 | ################################################################### 2 | # General 3 | ################################################################### 4 | 5 | # Workaround to allow acessing OSX pasteboard 6 | set-option -g default-command "reattach-to-user-namespace -l zsh" 7 | 8 | # Appropriate terminal colors 9 | set -g default-terminal "xterm-256color" 10 | set -ga terminal-overrides ",xterm-256color:Tc" 11 | 12 | # Start tabs at index 1 13 | set -g base-index 1 14 | 15 | # Make pane numbering consistent with windows 16 | setw -g pane-base-index 1 17 | 18 | # Renumber windows when a window is closed 19 | set -g renumber-windows on 20 | 21 | # Automatically set window title 22 | set-window-option -g automatic-rename on 23 | set-option -g set-titles on 24 | 25 | ################################################################### 26 | # Key-bindings 27 | ################################################################### 28 | 29 | # Free the original `Ctrl-b` prefix keybinding. 30 | unbind C-b 31 | 32 | # set prefix key to ctrl-a 33 | set -g prefix C-a 34 | 35 | # set -g default-terminal screen-256color 36 | set -g status-keys vi 37 | set -g history-limit 10000 38 | 39 | # mouse? real hackers don't use a mouse 40 | set-option -g mouse off 41 | 42 | # vi keys for switching panes 43 | bind-key h select-pane -L 44 | bind-key j select-pane -D 45 | bind-key k select-pane -U 46 | bind-key l select-pane -R 47 | 48 | # Splitting panes. 49 | bind | split-window -h 50 | bind - split-window -v 51 | 52 | # # Vi copypaste 53 | setw -g mode-keys vi 54 | unbind p 55 | bind p paste-buffer 56 | bind-key -T copy-mode-vi v send-keys -X begin-selection 57 | bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel 58 | 59 | # shift-movement keys will resize panes 60 | bind J resize-pane -D 5 61 | bind K resize-pane -U 5 62 | bind H resize-pane -L 5 63 | bind L resize-pane -R 5 64 | 65 | bind M-j resize-pane -D 66 | bind M-k resize-pane -U 67 | bind M-h resize-pane -L 68 | bind M-l resize-pane -R 69 | 70 | # No delay for escape key press 71 | set -sg escape-time 0 72 | 73 | # Reload the file with Prefix r. 74 | bind r source-file ~/.tmux.conf \; display "Reloaded .tmux.conf!" 75 | 76 | 77 | ################################################################### 78 | # Plugins 79 | ################################################################### 80 | 81 | # Thanks @gfarrell! 82 | # https://github.com/gfarrell/dotfiles/blob/master/tmux/tmux.conf#L61 83 | 84 | # plugins 85 | set -g @plugin 'lucasfcosta/catpuccin-tmux' # tmux theme <3 86 | set -g @plugin 'tmux-plugins/tmux-cpu' # shows cpu status in status bar 87 | set -g @plugin 'tmux-plugins/tmux-battery' # shows battery stats in status bar 88 | set -g @plugin 'tmux-plugins/tmux-online-status' # shows internet status in status bar 89 | set -g @plugin 'tmux-plugins/tmux-pain-control' # better control of panes 90 | set -g @plugin 'tmux-plugins/tmux-resurrect' # persists sessions between shutdowns/restarts 91 | set -g @plugin 'tmux-plugins/tmux-continuum' # continuous save/reload sessions 92 | set -g @plugin 'robhurring/tmux-spotify' # spotify songs 93 | 94 | # Initialize tpm 95 | run '~/.tmux/plugins/tpm/tpm' 96 | -------------------------------------------------------------------------------- /.zshrc: -------------------------------------------------------------------------------- 1 | # If you come from bash you might have to change your $PATH. 2 | # export PATH=$HOME/bin:/usr/local/bin:$PATH 3 | 4 | # This is a workaround for having a system node and NVM node 5 | PATH="/usr/local/bin:$(getconf PATH)" 6 | 7 | # Use gnu-sed instead of MacOS's sed 8 | PATH="/usr/local/opt/sed/libexec/gnubin:$PATH" 9 | 10 | GOPATH="$HOME/go" 11 | GOROOT="/usr/local/opt/go/libexec" 12 | GOBIN="$GOPATH/bin" 13 | PATH="$PATH:$GOPATH" 14 | PATH="$PATH:$GOROOT/bin" 15 | PATH="$PATH:$GOBIN" 16 | 17 | # Add brew to path 18 | export PATH=/opt/homebrew/bin:$PATH 19 | 20 | # Path to your oh-my-zsh installation. 21 | export ZSH=/Users/${USER}/.oh-my-zsh 22 | 23 | # Set name of the theme to load. Optionally, if you set this to "random" 24 | # it'll load a random theme each time that oh-my-zsh is loaded. 25 | # See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes 26 | ZSH_THEME="spaceship" 27 | 28 | # Disable bi-weekly auto-update checks. 29 | DISABLE_AUTO_UPDATE="true" 30 | 31 | # How often to auto-update (in days). 32 | # export UPDATE_ZSH_DAYS=13 33 | 34 | # Display red dots whilst waiting for completion. 35 | # COMPLETION_WAITING_DOTS="true" 36 | 37 | # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) 38 | # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ 39 | # Example format: plugins=(rails git textmate ruby lighthouse) 40 | # Add wisely, as too many plugins slow down shell startup. 41 | plugins=( 42 | z 43 | git 44 | osx 45 | chucknorris # ¯\_(ツ)_/¯ 46 | ) 47 | 48 | source $ZSH/oh-my-zsh.sh 49 | 50 | # User configuration 51 | 52 | # export MANPATH="/usr/local/man:$MANPATH" 53 | 54 | # You may need to manually set your language environment 55 | # export LANG=en_US.UTF-8 56 | 57 | # Preferred editor for local and remote sessions 58 | # if [[ -n $SSH_CONNECTION ]]; then 59 | # export EDITOR='vim' 60 | # else 61 | # export EDITOR='mvim' 62 | # fi 63 | 64 | # ssh 65 | export SSH_KEY_PATH="~/.ssh/rsa_id" 66 | 67 | # Load aliases 68 | if [ -f ~/.aliases ]; then 69 | . ~/.aliases 70 | fi 71 | 72 | # Add RVM to PATH for scripting. Make sure this is the last PATH variable change. 73 | export NVM_DIR="$HOME/.nvm" 74 | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm 75 | [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion 76 | 77 | # Set Node's max heap size to 4096 78 | export NODE_OPTIONS=" --max_old_space_size=4096" 79 | 80 | # Add cargo to the PATH 81 | source $HOME/.cargo/env 82 | 83 | # Use nvim as the default editor 84 | export EDITOR=nvim 85 | -------------------------------------------------------------------------------- /Cask: -------------------------------------------------------------------------------- 1 | docker 2 | tunnelblick 3 | google-chrome 4 | firefox 5 | rocket 6 | slack 7 | spotify 8 | flux 9 | virtualbox 10 | virtualbox-extension-pack 11 | vlc 12 | rocket 13 | alacritty 14 | notion 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dotfiles - [Lucas F. Costa](https://lucasfcosta.com) 2 | 3 | The best dotfiles in the entire universe. 4 | 5 | ![my terminal using the dotfiles in this repo](./terminal-demo.png) 6 | 7 | These dotfiles should work straight out-of-the box on MacOS. For other operating systems you will need to update a few files, mainly `programs.sh`. 8 | 9 | 10 | ## Quickstart 11 | 12 | 1. Install `brew` following the instructions at [Homebrew's official website](https://brew.sh). 13 | 2. Install `git` using `brew install git` and clone this repository suing `git clone https://github.com/lucasfcosta/dotfiles`. 14 | 3. Execute `./install.sh` to transfer configuration files to your home directory. 15 | 4. Execute `programs.sh` to install all programs. 16 | 17 | 18 | ## Usage Guidelines 19 | 20 | ### Terminal applications 21 | 22 | Programs like `docker`, `neovim`, and the alike are installed through `programs.sh` using `brew` itself, which you must have installed _before_ executing `programs.sh`. 23 | 24 | 25 | ### Casks 26 | 27 | Casks are GUI applications packaged to be installed through [Homebrew Cask](https://github.com/Homebrew/homebrew-cask). 28 | 29 | These are installed from the list of programs in the `Casks` file. 30 | 31 | To install these programs separately from the other ones in `programs.sh`, use `brew bundle --file=Cask`. 32 | 33 | 34 | ### Utilities 35 | 36 | Utilities like [the `zsh-spaceship` prompt](https://github.com/denysdovhan/spaceship-prompt) and `rustup` are also installed through `programs.sh`. 37 | 38 | 39 | ### MacOS Defaults 40 | 41 | These are my favourite configurations for MacOS and I highly recommend you to at least take a look at this file and figure out what are yours. 42 | 43 | Having all these set up in a single script is a huge life-quality improvement. Being able to setup simple things like showing file extensions, menu extras, dock settings, update checks and etc at the speed of a command has definitely changed my life for the better. 44 | 45 | To run the script which sets those up just run `.macos`: 46 | 47 | ```console 48 | $ ./dotfiles/.macos 49 | ``` 50 | 51 | 52 | ### Dotfiles 53 | 54 | Well, this repository could not be called `dotfiles` if it didn't actually have any dotfiles, right? 55 | 56 | These contain configs for `nvim`, `zsh`, `tmux` and `git`. 57 | 58 | To copy them to their correct places just run `install.sh`: 59 | 60 | ```console 61 | $ . ./dotfiles/install.sh 62 | ``` 63 | 64 | 65 | ## Things you will have to do manually 66 | 67 | Unfortunately, life has not yet given me the opportunity to make everything in this repo automatic, so here's a few things you will have to do by yourself: 68 | 69 | 70 | ### Install tmux plugins 71 | 72 | Once you have ran `install.sh` to copy dotfiles to their right places (including `.tmux.conf`), open `tmux` and press `prefix` (ctrl + a) + I (capital I, as in **I**nstall) to fetch the plugin. 73 | 74 | 75 | ### Set Iterm's color preset (if you use iTerm) 76 | 77 | Open Iterm configs by pressing command + ,, go to `Profiles` and then `Colors`. 78 | 79 | Choose the `Nord.itermcolors` color preset. 80 | 81 | ⚠️ **I am now using [Alacritty](https://github.com/alacritty/alacritty) instead of iTerm**, but I've kept the color presets here in case you still want to use iTerm. 82 | 83 | 84 | ### Install NERD fonts 85 | 86 | For the icons in `vim` and `tmux` to appear, you'll have to install [NERD fonts](https://www.nerdfonts.com/). 87 | 88 | Given how big the NERD fonts repo is, you'll have to install fonts manually so that you can pick only the ones you want. That's why I didn't automate the installation process in this repository. 89 | 90 | Once you've installed your preferred font, update Alacritty's configuration file with the name of the chosen font. 91 | 92 | 93 | ## Related Content 94 | 95 | * [How I'm still not using GUIs in 2019: A guide to the terminal](https://lucasfcosta.com/2019/02/10/terminal-guide-2019.html) 96 | * [In Praise of Plain Text](https://lucasfcosta.com/2018/08/05/In-Praise-of-Plaintext.html) 97 | * [Vim Tips (outdated)](https://lucasfcosta.com/2017/01/23/Quick-vIM-Tips-That-Will-Save-Your-Life.html) 98 | * [My first blog post about vim (outdated)](https://lucasfcosta.com/2016/09/25/How-I-Learned-to-Stop-Worrying-and-Love-vIM.html) 99 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This has been shamelessly copied from mathiasbynens/dotfiles 4 | # https://github.com/mathiasbynens/dotfiles/blob/b22c32290e1518c0f228afba254ee6a3f6ab6d7a/bootstrap.sh 5 | 6 | cd "$(dirname "${BASH_SOURCE}")"; 7 | 8 | git pull origin master; 9 | 10 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 11 | 12 | function doIt() { 13 | rsync --exclude ".git/" \ 14 | --exclude ".DS_Store" \ 15 | --exclude "install.sh" \ 16 | --exclude "README.md" \ 17 | --exclude "LICENSE" \ 18 | --exclude "terminal-demo.png" \ 19 | -avh --no-perms . ~; 20 | 21 | if test -f "~/.bash_profile"; then 22 | source ~/.bash_profile; 23 | fi 24 | 25 | if test -f "~/.zsh_profile"; then 26 | source ~/.zsh_profile; 27 | fi 28 | } 29 | 30 | if [ "$1" == "--force" -o "$1" == "-f" ]; then 31 | doIt; 32 | else 33 | read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1; 34 | echo ""; 35 | if [[ $REPLY =~ ^[Yy]$ ]]; then 36 | doIt; 37 | fi; 38 | fi; 39 | unset doIt; 40 | -------------------------------------------------------------------------------- /programs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Like the other install script, this is from Mathias Bynens with slight modifications by me 4 | # https://github.com/mathiasbynens/dotfiles/blob/bb6c76e410bf7b1693edfe60239461fc9205ec02/brew.sh 5 | 6 | # Installing oh-my-zsh 7 | sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" 8 | 9 | # Make sure we’re using the latest Homebrew. 10 | brew update 11 | 12 | # Upgrade any already-installed formulae. 13 | brew upgrade 14 | 15 | # Save Homebrew’s installed location. 16 | BREW_PREFIX=$(brew --prefix) 17 | 18 | # Use arch -arm64 if using an arm64 chip 19 | INSTALL_CHIP_PREFIX="arch -arm64" 20 | [[ $(uname -m) != "arm64" ]] && INSTALL_CHIP_PREFIX="" 21 | 22 | # ------------------------------- 23 | # Essential programs 24 | # ------------------------------- 25 | 26 | # Utils 27 | $(INSTALL_CHIP_PREFIX) brew install wget 28 | $(INSTALL_CHIP_PREFIX) brew install curl 29 | 30 | # Alacritty 31 | $(INSTALL_CHIP_PREFIX) brew install alacritty 32 | 33 | # Git 34 | $(INSTALL_CHIP_PREFIX) brew install git 35 | $(INSTALL_CHIP_PREFIX) brew install git-lfs 36 | 37 | $(INSTALL_CHIP_PREFIX) brew install docker 38 | $(INSTALL_CHIP_PREFIX) brew install docker-compose 39 | $(INSTALL_CHIP_PREFIX) brew install docker-machine 40 | 41 | # Install more recent versions of some macOS tools. 42 | $(INSTALL_CHIP_PREFIX) brew install grep 43 | $(INSTALL_CHIP_PREFIX) brew install openssh 44 | $(INSTALL_CHIP_PREFIX) brew install ssh-copy-id 45 | $(INSTALL_CHIP_PREFIX) brew install gnu-sed 46 | 47 | # Install GNU `find`, `locate`, `updatedb`, and `xargs`, `g`-prefixed. 48 | $(INSTALL_CHIP_PREFIX) brew install findutils 49 | 50 | # Install GnuPG to enable PGP-signing commits. 51 | $(INSTALL_CHIP_PREFIX) brew install gnupg 52 | 53 | # This is needed for Telescope to be able to do live greps 54 | # It is also a good CLI tool (faster than ag in many cases) 55 | $(INSTALL_CHIP_PREFIX) brew install ripgrep 56 | 57 | # Remove outdated versions from the cellar. 58 | brew cleanup 59 | 60 | # ------------------------------- 61 | # Text editing 62 | # ------------------------------- 63 | 64 | # Change the user's life forever 65 | # God bless the best text editor on earth 66 | $(INSTALL_CHIP_PREFIX) brew install neovim 67 | 68 | # Install vim-plug before installing plugins themselves 69 | sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \ 70 | https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' 71 | 72 | # Install nvim plugins 73 | nvim +PlugClean! +qall 74 | nvim +GoInstallBinaries 75 | nvim +silent +PlugInstall +qall 76 | 77 | # vim's best friend 78 | $(INSTALL_CHIP_PREFIX) brew install tmux 79 | 80 | # install what's necessary for tmux to use 81 | $(INSTALL_CHIP_PREFIX) brew install reattach-to-user-namespace 82 | 83 | # install tmux plugin manager 84 | git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm 85 | 86 | 87 | 88 | 89 | # ------------------------------- 90 | # JS-related 91 | # ------------------------------- 92 | 93 | # Install nvm and Node 94 | curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash 95 | export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" 96 | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" 97 | nvm install node 98 | 99 | 100 | # ------------------------------- 101 | # Rust-related 102 | # ------------------------------- 103 | 104 | # Installing rustup (for managing Rust) 105 | curl https://sh.rustup.rs -sSf | sh 106 | source $HOME/.cargo/env 107 | 108 | # Add necessary extensions for CoC support 109 | rustup component add rls rust-analysis rust-src 110 | 111 | 112 | # ------------------------------- 113 | # ZSH-related 114 | # ------------------------------- 115 | 116 | # This installs the spaceship theme for zsh 117 | # https://github.com/denysdovhan/spaceship-prompt 118 | if [ -d "$ZSH/custom/themes/spaceship-prompt" ] 119 | then 120 | echo "spaceship-prompt is already installed, skipping..." 121 | else 122 | git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH/custom/themes/spaceship-prompt" 123 | ln -s "$ZSH/custom/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH/custom/themes/spaceship.zsh-theme" 124 | fi 125 | 126 | 127 | # ------------------------------- 128 | # Casks 129 | # ------------------------------- 130 | 131 | for i in $(cat ./Cask); do $(INSTALL_CHIP_PREFIX) brew install "$i"; done 132 | -------------------------------------------------------------------------------- /terminal-demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucasfcosta/dotfiles/83641e2ed522a41bf05134c6b0887a55fc186036/terminal-demo.png --------------------------------------------------------------------------------