├── .chezmoi.toml.tmpl ├── .chezmoiignore ├── .chezmoitemplates └── ruff.toml ├── README.md ├── dot_Xmodmap ├── dot_Xresources ├── dot_bash_profile ├── dot_bashrc ├── dot_config ├── alacritty │ └── alacritty.toml ├── atuin │ └── config.toml ├── bat │ ├── config │ └── syntaxes │ │ └── tmux.sublime-syntax ├── bspwm │ ├── executable_bspwmrc_darwin │ ├── executable_bspwmrc_linux │ └── symlink_bspwmrc.tmpl ├── conky-gpu │ ├── README.md │ ├── conky_draw_config.lua │ ├── conkyrc │ └── executable_gpu.sh ├── dive │ └── dive.yml ├── dunst │ └── dunstrc ├── fzf │ ├── dot_fzf.zsh.tmpl │ ├── executable_fstash │ ├── executable_rfv │ └── fzf_aliases ├── iterm2 │ ├── Default.itermcolors │ ├── com.googlecode.iterm2.plist │ ├── ember.copy.dark.itermcolors │ ├── executable_adwaita.itermcolors │ ├── executable_blaziken.itermcolors │ ├── executable_xdefaults2iterm.pl │ ├── gruvbox.itermcolors │ └── koe.itermcolors ├── kitty │ └── kitty.conf ├── libinput-gestures.conf ├── mozilla │ ├── README.md │ └── notes.md ├── neofetch │ └── config ├── nvim │ ├── after │ │ └── queries │ │ │ ├── python │ │ │ └── injections.scm │ │ │ └── ruby │ │ │ └── injections.scm │ ├── ftplugin │ │ └── python │ │ │ ├── python_black.vim │ │ │ └── python_match.vim │ ├── init.lua │ ├── lazy-lock.json │ ├── lua │ │ ├── configs │ │ │ ├── cmp.lua │ │ │ ├── gitsigns.lua │ │ │ ├── jdtls.lua │ │ │ ├── lsp │ │ │ │ ├── config.lua │ │ │ │ ├── servers.lua │ │ │ │ └── view.lua │ │ │ ├── lualine.lua │ │ │ ├── portal.lua │ │ │ ├── snippets.lua │ │ │ ├── telescope.lua │ │ │ ├── treesitter.lua │ │ │ └── treesj.lua │ │ ├── core │ │ │ ├── autocmds.lua │ │ │ ├── highlights.lua │ │ │ ├── mappings.lua │ │ │ ├── options.lua │ │ │ └── plugins_lazy.lua │ │ └── plugins │ │ │ ├── languages.lua │ │ │ ├── lsp.lua │ │ │ ├── movement.lua │ │ │ ├── repl.lua │ │ │ ├── text-manipulation.lua │ │ │ ├── treesitter.lua │ │ │ ├── ui.lua │ │ │ └── ux.lua │ ├── plugin │ │ ├── colorize-border.vim │ │ └── colorize-cursor.vim │ ├── syntax │ │ └── applescript.vim │ └── templates │ │ ├── LICENSE │ │ ├── Apache20 │ │ ├── GNUGPLv3 │ │ ├── MIT │ │ └── Unlicensed │ │ ├── python │ │ └── main.py │ │ └── sh │ │ └── main.sh ├── packages │ ├── Brewfile │ ├── Brewfile-personal │ ├── Brewfile-work │ ├── pipx.txt │ └── windows.bat ├── picom │ └── picom.conf ├── polybar │ └── config ├── private_karabiner │ └── scripts │ │ ├── README.md │ │ ├── executable_caps_shift.py │ │ ├── executable_create_vi_mode.py │ │ ├── executable_dual_keys.json.rb │ │ ├── executable_enter_shift.rb │ │ └── executable_fn_keys.py ├── private_spicetify │ └── config.ini.tmpl ├── ranger │ ├── executable_scope.sh │ └── rc.conf ├── rofi │ └── config ├── ruff │ └── ruff.toml.tmpl ├── scripts │ ├── doap │ │ ├── README.md │ │ ├── executable_encrypt.sh │ │ ├── executable_network.sh │ │ ├── executable_spinner.sh │ │ ├── executable_upload.sh │ │ └── executable_utils.sh │ ├── executable_cols.sh │ └── executable_lock.sh ├── simple-rc │ ├── dot_bashrc │ ├── dot_inputrc │ ├── dot_shell_aliases │ ├── dot_tmux.conf │ ├── dot_vim │ │ └── colors │ │ │ └── zenburn.vim │ ├── dot_vimrc │ └── executable_install.sh ├── sxhkd │ ├── sxhkdrc_darwin │ ├── sxhkdrc_linux │ └── symlink_sxhkdrc.tmpl ├── themes │ ├── Grafikartes-Flat-Retro-Modern-2-Chrome.icns │ ├── Sublime Text.icns │ ├── firefox_dock_icon_replacement_by_sacrificials-d6ed9ra.png │ └── injector.txt ├── ubersicht │ └── widgets │ │ └── README.md ├── wal │ └── templates │ │ └── colors-alacritty.yml └── xresources │ └── gruvbox-dark.xresources.tmpl ├── dot_gdbinit ├── dot_gitconfig.tmpl ├── dot_gitignore_global ├── dot_ipython └── profile_default │ └── ipython_config.py ├── dot_nvidia-xinitrc ├── dot_p10k.zsh ├── dot_profile ├── dot_shell_aliases.tmpl ├── dot_skhdrc ├── dot_tigrc ├── dot_tmux.conf.tmpl ├── dot_tokens.tmpl ├── dot_urxvt └── ext │ ├── clipboard │ └── keyboard-select ├── dot_zsh └── completions │ ├── _rr │ └── _tmux-a ├── dot_zsh_plugins.txt ├── dot_zshrc ├── encrypted_dot_pypirc.asc ├── encrypted_private_dot_gist.asc ├── executable_dot_xinitrc ├── executable_dot_xprofile ├── executable_dot_yabairc ├── private_Library └── private_Application Support │ ├── private_Abricotine │ └── app │ │ └── themes │ │ └── gruvbox │ │ ├── theme.json │ │ └── theme.less │ ├── private_ruff │ └── ruff.toml.tmpl │ └── pypoetry │ └── private_config.toml ├── private_dot_gnupg └── gpg-agent.conf.tmpl ├── run_once_after_30-plugin-installation.sh.tmpl ├── run_once_after_50-karabiner.sh.tmpl ├── run_once_after_60-python.sh.tmpl ├── run_once_after_70-mac-defaults.sh.tmpl ├── run_once_after_80-work-mac.py.tmpl └── run_once_before_10-package-installation.sh.tmpl /.chezmoi.toml.tmpl: -------------------------------------------------------------------------------- 1 | {{- $email := promptStringOnce . "email" "Email address" -}} 2 | {{- $git_user := promptStringOnce . "git_user" "Git User" -}} 3 | {{- $work := promptBoolOnce . "work" "work" -}} 4 | 5 | {{- $server_shortname := promptStringOnce . "server_shortname" "Server (shortname)" -}} 6 | {{- $server_name := promptStringOnce . "server_name" "Server FQDN" -}} 7 | {{- $server_port := promptIntOnce . "server_port" "Server Port" -}} 8 | 9 | [data] 10 | encryption = "gpg" 11 | 12 | email = {{ $email | quote }} 13 | git_user = {{ $git_user | quote }} 14 | work = {{ $work }} 15 | server_shortname = {{ $server_shortname | quote }} 16 | server_name = {{ $server_name | quote }} 17 | server_port = {{ $server_port }} 18 | {{ if $work }} 19 | {{- $pypi_artifactory := promptStringOnce . "pypi_artifactory" "PyPI Artifactory" -}} 20 | {{- $imap_user := promptStringOnce . "imap_user" "imap_user" }} 21 | {{- $imap_folder := promptStringOnce . "imap_folder" "imap_folder" }} 22 | pypi_artifactory = {{ $pypi_artifactory | quote }} 23 | imap_user = {{ $imap_user | quote }} 24 | imap_folder = {{ $imap_folder | quote }} 25 | {{- end }} 26 | 27 | [gpg] 28 | recipient = "Amar Paul" 29 | 30 | [diff] 31 | pager = "less -FX" 32 | 33 | [edit] 34 | hardlink = false 35 | -------------------------------------------------------------------------------- /.chezmoiignore: -------------------------------------------------------------------------------- 1 | README.md 2 | .bash* 3 | .config/simple-rc 4 | .config/packages 5 | 6 | # ignore stuff for a simple provisional system. 7 | {{- if (and (len .chezmoi.osRelease) (eq .chezmoi.osRelease.id "ubuntu")) }} 8 | # stuff that requires gpg 9 | .gist 10 | .pypirc 11 | .tokens 12 | 13 | # probably a headless server; ignore any GUI stuff. 14 | .X* 15 | .config/alacritty 16 | .config/bspwm 17 | .config/conky* 18 | .config/dunst 19 | .config/kitty 20 | .config/libinput-gestures.conf 21 | .config/mozilla 22 | .config/picom 23 | .config/polybar 24 | .config/rofi 25 | .config/sxhkd 26 | .config/xresources 27 | .gnupg 28 | .nvidia* 29 | .urxvt 30 | .xprofile 31 | 32 | # ignore some startup scripts 33 | 70-mac* 34 | 80-work-mac.py 35 | {{ end }} 36 | 37 | {{- if ne .chezmoi.os "darwin" }} 38 | 39 | Library/ 40 | .config/bspwm/bspwmrc_darwin 41 | .config/sxhkd/sxhkd_darwin 42 | .config/karabiner 43 | .config/iterm2 44 | .config/ubersicht 45 | .chunkwmrc 46 | .skhdrc 47 | .yabairc 48 | 49 | {{ else if ne .chezmoi.os "linux" }} 50 | 51 | .config/bspwm/bspwmrc_linux 52 | .config/sxhkd/sxhkdrc_linux 53 | .config/conky-gpu 54 | .config/dunst 55 | .config/libinput-gestures.conf 56 | .config/picom 57 | .config/polybar 58 | .config/rofi 59 | .config/scripts/lock.sh 60 | .config/xresources 61 | .config/ruff 62 | .nvidia-xinitrc 63 | .urxvt 64 | .Xmodmap 65 | .Xresources 66 | .xinitrc 67 | .xprofile 68 | 69 | {{ end }} 70 | -------------------------------------------------------------------------------- /.chezmoitemplates/ruff.toml: -------------------------------------------------------------------------------- 1 | # don't bother with fiddling, just select ALL errors. 2 | # select = ["E", "F", "C90", "I", "N", "ICN"] 3 | lint.select = ["ALL"] 4 | 5 | lint.ignore = [ 6 | "ANN101", # Missing type annotation for `self` in method 7 | "ERA001", # Found commented-out code 8 | "COM812", # missing trailing commas (conflicts with formatter) 9 | "D100", # missing docstring in public module 10 | "D105", # Missing docstring in magic method 11 | "D203", # one-blank-line-before-class (prefer D212 no-blank-line-before-class) 12 | "D213", # multi-line-summary-second-line (prefer D212 multi-line-summary-first-line) 13 | "ISC001", # single line implicit str concat (conflicts with formatter) 14 | "T20", # flake8-print 15 | "UP006", # deprecated-collection-type (e.g. use `list` instead of `typing.List`) 16 | ] 17 | 18 | line-length = 100 19 | 20 | [lint.per-file-ignores] 21 | "test_*.py" = [ 22 | "D103", # Missing docstring in public function 23 | "ANN201", # Missing return type annotation for public function `{}` 24 | "INP001", # File `{}` is part of an implicit namespace package. Add an `__init__.py`. 25 | "S101", # Use of `assert` detected 26 | "PLR2004", # Magic value used in comparison, consider replacing 526 with a constant variable 27 | ] 28 | 29 | "__init__.py" = [ 30 | "F401", # imported but unused 31 | ] 32 | 33 | "*.ipynb" = [ 34 | "I", # import order 35 | "F401", # imported but unused 36 | "B018", # useless expression 37 | ] 38 | 39 | # can i make this set noexpandtab for this file? 40 | # vim:tw=78:ts=8:noet:ft=toml:norl: 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Amar's Dotfiles 2 | 3 | ``` 4 | sh -c "$(curl -fsLS git.io/chezmoi)" -- init --apply Amar1729 5 | ``` 6 | 7 | These dotfiles are managed by [`chezmoi`](https://github.com/twpayne/chezmoi/). I used to use git manually, but tracking changes across multiple branches for different operating systems/flavors became a huge pain once I was frequently cherry-picking and tagging to avoid merging. See the homepage for more details! 8 | 9 | One benefit of `chezmoi` is that this repo - the "source state" - is managed directly renaming certain files in a specific way. "Dot" files (such as `.bashrc`) in the target state are named as `dot_bashrc` in the source state. 10 | 11 | Another benefit is that all files can be managed in one branch, using `chezmoi`'s [template logic](https://github.com/twpayne/chezmoi/blob/master/docs/HOWTO.md#manage-machine-to-machine-differences). So files for both macOS/linux are kept in the default branch of this repo, and synced into the "target state" (your home directory) based on the value of variables from `chezmoi data` - such as `.chezmoi.os` - or the settings in [`.chezmoiignore`](./.chezmoiignore). 12 | 13 | 14 | ## Miscellaneous 15 | 16 | * [atuin](https://atuin.sh) 17 | * [fzf](https://github.com/junegunn/fzf) 18 | * [fd](https://github.com/sharkdp/fd) 19 | * [ripgrep](https://github.com/BurntSushi/ripgrep) 20 | * [pywal](https://github.com/dylanaraps/pywal) 21 | 22 | 23 | ## Window Management 24 | 25 | * [`.skhdrc`](./dot_skhdrc) 26 | * [`.yabairc`](./executable_dot_yabairc) 27 | * [`.config/ubersicht/widgets/`](./dot_config/ubersicht/widgets/) 28 | 29 | ### macOS 30 | 31 | * [yabai](https://github.com/koekeishiya/yabai/) and the hotkey daemon [`skhd`](https://github.com/koekeishiya/skhd) 32 | * [Uebersicht](http://tracesof.net/uebersicht/), a neat tool for the display of html/css/js widgets directly on the desktop. This program is managing the custom toolbar you might see in a lot of Mac OS rices (and mine!) 33 | 34 | ### linux 35 | 36 | < todo: bspwm/sxhkd/conky > 37 | 38 | 39 | ## Shell 40 | 41 | * `atuin` for syncing/backing up shell history, as well as granular searching of history 42 | * [`.zshrc`](./dot_zshrc) 43 | * [`.zsh_plugins.txt`](./dot_zsh_plugins.txt) 44 | * [`.profile`](./dot_profile) 45 | * [`.shell_aliases`](./dot_shell_aliases.tmpl) 46 | * [fzf bindings](./dot_config/fzf) 47 | 48 | `zsh` plugins are managed by [antibody](https://getantibody.github.io/): 49 | ``` 50 | antibody bundle < ~/.zsh_plugins.txt > ~/.zsh_plugins.zsh 51 | ``` 52 | 53 | Most shell aliases are in `.shell_aliases` and are `zsh`/`bash`-compatible. 54 | 55 | I also use a repository of small scripts I write myself: [bin](https://github.com/Amar1729/bin). 56 | 57 | 58 | ## Terminal Emulator 59 | * [kitty](https://github.com/kovidgoyal/kitty) 60 | * [alacritty](https://github.com/alacritty/alacritty/) 61 | 62 | 63 | ## Workflow 64 | 65 | * [Neovim](https://github.com/neovim/neovim), with [my config](./dot_config/nvim) 66 | * Plugin manager: [lazy](https://github.com/folke/lazy.nvim) 67 | * [Tmux](https://github.com/tmux/tmux), with my [`.tmux.conf`](./dot_tmux.conf.tmpl) 68 | * Git, with my [`.gitconfig`](./dot_gitconfig.tmpl) 69 | * [Pass](https://www.passwordstore.org/) for password management 70 | 71 | 72 | ## Browsers 73 | 74 | #### Userstyles, Extensions, Plugins, and Apps 75 | 76 | ##### userstyles/scripts 77 | * [dark-gitlab-theme](https://userstyles.org/styles/164877/dark-gitlab-theme) 78 | * dark bg: `3c3836` 79 | * darker bg: `282828` 80 | * light text: `ebdbb2` 81 | * lighter text: `f1fbc7` 82 | * accent color: `98971a` 83 | * or `b8bb26` for lighter green? 84 | * Firefox (Stylus) and [GreaseMonkey](https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/)) 85 | 86 | * [Github Dark Wide Transparent](https://userstyles.org/styles/126131/github-dark-wide-transparent) 87 | * [userstyles.org - blue custom](https://userstyles.org/styles/118410/userstyles-org-blue-custom) 88 | * [reddit - hide sidebar](https://userstyles.org/styles/142862/reddit-hide-sidebar-for-low-screen-width) 89 | 90 | * [Github Dark Wide Transparent](https://userstyles.org/styles/126131/github-dark-wide-transparent) 91 | * [Reddit Slate Nights (Fixed, Custom Fork) - Dark](https://userstyles.org/styles/123908/reddit-slate-nights-fixed-custom-fork-dark) 92 | * [SOUNDCLOUD NIGHTMODE REIMAGINED](https://userstyles.org/styles/136523/soundcloud-nightmode-reimagined) 93 | * [userstyles.org - blue custom](https://userstyles.org/styles/118410/userstyles-org-blue-custom) 94 | 95 | ##### Extensions, Plugins, Apps 96 | * [nightTab](https://addons.mozilla.org/en-US/firefox/addon/nighttab/) - really nice homepage 97 | * [uBlock Origin](https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/) - opensource ad-blocking 98 | * Imagus - blow up images on mouseover 99 | * tampermonkey/greasemonkey - run custom js on specific webpages 100 | * browserpass - browser extension for `pass`, the unix password manager 101 | * Pushbullet - sync messages between Android and laptop 102 | * cliget (turns a link into a `curl` command with correct flags for cookies) 103 | -------------------------------------------------------------------------------- /dot_Xmodmap: -------------------------------------------------------------------------------- 1 | ! rebind caps lock -> escape 2 | ! rebind shift + caps lock -> caps lock 3 | clear Lock 4 | keycode 0x42 = Escape Caps_Lock 5 | 6 | ! Stop! so, keys cant belong two two different mod groups at once? 7 | ! And bspwm group 'super' seems to pull from the default group for Super/Hper: mod4 8 | ! So I can't clear that and set left/right keys differently, otherwise base 'super' 9 | ! doesn't work in bspwm? figure out a compromise to this ... 10 | !clear mod1 11 | !clear mod2 12 | !clear mod3 13 | !clear mod4 14 | ! 15 | !keycode 133 = Super_L 16 | !keycode 134 = Super_R 17 | !keycode 207 = Hyper_L 18 | !keycode 208 = Hyper_R 19 | ! 20 | !add mod3 = Super_L Hyper_L 21 | !add mod4 = Super_R Hyper_R 22 | -------------------------------------------------------------------------------- /dot_Xresources: -------------------------------------------------------------------------------- 1 | ! .Xresources config ! 2 | ! removed a lot of stuff from here in favor of alacritty 3 | 4 | ! using pywal for colors (keep gruvbox as backup) 5 | #include ".cache/wal/colors.Xresources" 6 | !#include ".config/xresources/gruvbox-dark.xresources" 7 | 8 | ! maybe this doesn't work on my '09 mbp because of weird resolution? 9 | ! finally figured out font naming (use fc-match) 10 | !URxvt.font: xft:Fantasque Sans Mono:size=18:antialias=true 11 | URxvt.font: xft:Iosevka:size=18 12 | 13 | *transparent: true 14 | *shading: 30 15 | 16 | *scrollBar: false 17 | *internalBorder: 40 18 | 19 | ! backward/forward a word (alt) 20 | ! be wary of changing these - i think lack of oh-my-zsh may mess things up? not sure tbh 21 | !URxvt.keysym.M-Left: \033[1;5D 22 | URxvt.keysym.M-Left: \033b 23 | !URxvt.keysym.M-Right: \033[1;5C 24 | URxvt.keysym.M-Right: \033f 25 | -------------------------------------------------------------------------------- /dot_bash_profile: -------------------------------------------------------------------------------- 1 | # Amar Paul's .bash_profile 2 | 3 | # Source .bashrc for aliases and everything 4 | [[ -r ~/.bashrc ]] && . ~/.bashrc 5 | -------------------------------------------------------------------------------- /dot_bashrc: -------------------------------------------------------------------------------- 1 | # Amar Paul's .bashrc 2 | # Login shells: .bash_profile 3 | # nonlogin (i.e. open shell once in): .bashrc 4 | # On Mac (Terminal and iTerm2) all shells are login shells 5 | # good explanation: http://www.joshstaiger.org/archives/2005/07/bash_profile_vs.html 6 | # 7 | # For Mac, file hierarchy is: 8 | # .bash_profile > .bash_login > .profile 9 | # 10 | # This .bashrc is sourced from .bash_profile (wanted to keep everything together) 11 | 12 | # read .profile 13 | [[ -r ~/.profile ]] && source ~/.profile 14 | 15 | # shell aliases 16 | [[ -r ~/.shell_aliases ]] && source ~/.shell_aliases 17 | 18 | # and temporary aliases 19 | [[ -r ~/.bash_aliases_tmp ]] && source ~/.bash_aliases_tmp 20 | 21 | #### 22 | ## bash-specific settings 23 | #### 24 | 25 | # expand argument callbacks in shell with space (e.g. !![space]) 26 | bind Space:magic-space 27 | 28 | #### 29 | ## moar history plz 30 | #### 31 | 32 | shopt -s histappend 33 | export HISTCONTROL=ignoreboth 34 | export HISTSIZE=9999 35 | export HISTFILESIZE=100000 36 | 37 | #### 38 | ## Change prompt: PS1 and pre/post command 39 | #### 40 | 41 | # Helpful: http://blog.taylormcgann.com/tag/prompt-color/ 42 | # white name, red directory 43 | export PS1="\[\033[1;37m\]\u\[\033[1m\] : \[\033[1;31m\]\W\[\033[0m\] $ " 44 | 45 | # hack for printing a newline after command but before output 46 | # From: https://seasonofcode.com/posts/debug-trap-and-prompt_command-in-bash.html 47 | # This will run before any command is executed. 48 | function PreCommand() { 49 | if [ -z "$AT_PROMPT" ]; then 50 | return 51 | fi 52 | unset AT_PROMPT 53 | echo "" 54 | } 55 | trap "PreCommand" DEBUG 56 | 57 | # This will run after the execution of the previous full command line. We don't 58 | # want it PostCommand to execute when first starting a bash session (i.e., at 59 | # the first prompt). 60 | FIRST_PROMPT=1 61 | function PostCommand() { 62 | AT_PROMPT=1 63 | if [ -n "$FIRST_PROMPT" ]; then 64 | unset FIRST_PROMPT 65 | return 66 | fi 67 | echo "" 68 | } 69 | PROMPT_COMMAND="PostCommand" 70 | -------------------------------------------------------------------------------- /dot_config/atuin/config.toml: -------------------------------------------------------------------------------- 1 | # https://atuin.sh/docs/config/ 2 | # i use the defaults for most keys 3 | 4 | ## address of the sync server 5 | sync_address = "http://192.168.0.101:8888" 6 | 7 | ## prevent commands matching any of these regexes from being written to history. 8 | ## https://docs.rs/regex/latest/regex/#syntax 9 | ## these settings are separate from zshaddhistory, right? 10 | history_filter = [ 11 | # common shell commands that don't need to be saved 12 | # use z for hopping around dirs (unless we cd to a #rare path?) 13 | "^cd -", 14 | "^cd \\.\\.", 15 | "^cd$", 16 | "^bd", 17 | "^z$", 18 | "^clear$", 19 | "^ls$", 20 | "^ll$", 21 | 22 | "^builtin", 23 | 24 | # don't care about full-resolved source-type cmds 25 | "^source \"", 26 | "^source /", 27 | "^emulate /", 28 | "^/Users", 29 | "^/home", 30 | 31 | # searching? 32 | "^brew search", 33 | 34 | # "sensitive" commands 35 | "^pass", 36 | ] 37 | -------------------------------------------------------------------------------- /dot_config/bat/config: -------------------------------------------------------------------------------- 1 | --theme="ansi" 2 | --map-syntax="*.tmux.conf":Tmux 3 | --map-syntax="Dockerfile*":Dockerfile 4 | -------------------------------------------------------------------------------- /dot_config/bat/syntaxes/tmux.sublime-syntax: -------------------------------------------------------------------------------- 1 | %YAML 1.2 2 | --- 3 | # http://www.sublimetext.com/docs/3/syntax.html 4 | name: Tmux 5 | hidden: false 6 | file_extensions: 7 | - tmux.conf 8 | - tmux 9 | - .tmux.conf 10 | - .tmux 11 | scope: source.tmux 12 | contexts: 13 | main: 14 | - match: \bC\-[a-z]\b 15 | scope: support.constant.tmux 16 | - match: \b[1-9][0-9]*\b 17 | scope: constant.numeric.tmux 18 | - match: |- 19 | (?x)^( 20 | 21 | bind| 22 | split-window| 23 | send-keys| 24 | set-(window-)?option| 25 | set| 26 | unbind 27 | 28 | )\b 29 | scope: support.function.tmux 30 | - match: |- 31 | (?x)\b( 32 | 33 | base-index| 34 | (begin|copy)-selection| 35 | copy-(mode|pipe)| 36 | display| 37 | default-terminal| 38 | escape-time| 39 | mode-(keys|mouse)| 40 | mouse| 41 | pane-base-index| 42 | paste-buffer| 43 | prefix| 44 | renumber-windows| 45 | resize-pane| 46 | select-pane| 47 | send-prefix| 48 | set-titles-string| 49 | set-titles| 50 | source-file| 51 | split-window| 52 | status-(fg|bg|keys)| 53 | status-(left|right)(-length)?| 54 | terminal-overrides| 55 | vi-copy| 56 | window-status(-(format|separator|current(-(bg|format))))?| 57 | xterm-keys 58 | )\b 59 | scope: entity.other.tmux 60 | - include: scope:source.shell 61 | -------------------------------------------------------------------------------- /dot_config/bspwm/executable_bspwmrc_darwin: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # macOS - issues ? 4 | # on macOS, whatever is `exec`ing bspwmrc is just not finding bspc in PATH 5 | # workflow: 6 | # open xQuartz.app (i.e. do not call `startx`) 7 | 8 | PATH="/usr/local/bin:$PATH" 9 | 10 | # why doesn't this work properly? 11 | # notes: 12 | # if sxhkd is started from here, new urxvts are fcked up 13 | # if it's killed and started manually, they seem (inconsistent?) fine 14 | # they have to be spawned from a terminal outside of X 15 | sxhkd -c ~/.config/sxhkd/sxhkdrc 16 | #sxhkd -c ~/.config/sxhkd/sxhkdrc >>~/.sxhkd_logs 2>&1 & 17 | 18 | # necessary for xquartz? 19 | #bspc monitor -d I II III IV V VI VII VIII IX X 20 | 21 | bspc config focused_border_color "#fbf1c7" 22 | bspc config active_border_color "#ebdbb2" 23 | bspc config presel_feedback_color "#fb4934" 24 | 25 | bspc config border_width 2 26 | bspc config window_gap 10 27 | 28 | bspc config top_padding 45 29 | bspc config bottom_padding 15 30 | bspc config left_padding 15 31 | bspc config right_padding 15 32 | 33 | bspc config split_ratio 0.50 34 | 35 | bspc config focus_follows_pointer true 36 | 37 | bspc config single_monocle true 38 | bspc config gapless_monocle true 39 | bspc config borderless_monocle true 40 | -------------------------------------------------------------------------------- /dot_config/bspwm/executable_bspwmrc_linux: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | bspc monitor -d I II III IV V VI VII VIII IX X 4 | 5 | bspc config border_width 0 6 | bspc config window_gap 25 #tentatively large to support new zenbar 7 | bspc config top_padding 20 8 | bspc config presel_feedback_color "#ff6666" 9 | 10 | bspc config split_ratio 0.52 11 | 12 | bspc config single_monocle false 13 | bspc config gapless_monocle true 14 | bspc config borderless_monocle true 15 | 16 | # bspc rule -a firefox desktop=^2 17 | # url-launcher /Applications/Firefox.app/Contents/MacOS/firefox 18 | 19 | # panel & 20 | -------------------------------------------------------------------------------- /dot_config/bspwm/symlink_bspwmrc.tmpl: -------------------------------------------------------------------------------- 1 | ./bspwmrc_{{ .chezmoi.os }} 2 | -------------------------------------------------------------------------------- /dot_config/conky-gpu/README.md: -------------------------------------------------------------------------------- 1 | # conky set up 2 | 3 | This conky set up isn't necessarily very robust and might require some tweaking to be ported onto other machines. 4 | 5 | In particular, the specific network interfaces my computer has, the mount points of my disks, and the entire GPU row may need to be changed. 6 | 7 | For drawing shapes in conky without the hassle, I use [`conky-draw`](https://github.com/fisadev/conky-draw.git), a lua script that offers boilerplate, parametrized code for general shapes such as bar/ring/ellipse graphs. 8 | 9 | Note the location of this directory - any `lua_load` calls or import statements in lua scripts should be updated to use it rather than the default `~/.conky`. 10 | 11 | ## usage 12 | 13 | I don't expect this rc will be used elsewhere very much, but to use it make sure to download `./conky_draw.lua` from the `conky-draw` repo and place it here. 14 | 15 | After that, adding `conky -c $HOME/.config/conky-gpu/conkyrc` should be sufficient. If not, the error messages may point towards missing import of lua or script files. 16 | -------------------------------------------------------------------------------- /dot_config/conky-gpu/conkyrc: -------------------------------------------------------------------------------- 1 | --[[ 2 | Conky, a system monitor, based on torsmo 3 | 4 | Any original torsmo code is licensed under the BSD license 5 | 6 | All code written since the fork of torsmo is licensed under the GPL 7 | 8 | Please see COPYING for details 9 | 10 | Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen 11 | Copyright (c) 2005-2019 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS) 12 | All rights reserved. 13 | 14 | This program is free software: you can redistribute it and/or modify 15 | it under the terms of the GNU General Public License as published by 16 | the Free Software Foundation, either version 3 of the License, or 17 | (at your option) any later version. 18 | 19 | This program is distributed in the hope that it will be useful, 20 | but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | GNU General Public License for more details. 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | ]] 26 | 27 | conky.config = { 28 | color4 = 'EF5A29', 29 | 30 | alignment = 'top_right', 31 | background = true, 32 | border_width = 1, 33 | cpu_avg_samples = 2, 34 | default_color = 'white', 35 | default_outline_color = 'white', 36 | default_shade_color = 'white', 37 | draw_borders = false, 38 | draw_graph_borders = false, 39 | draw_outline = false, 40 | draw_shades = false, 41 | use_xft = true, 42 | font = 'Iosevka:size=14', 43 | gap_x = 40, 44 | gap_y = 20, 45 | minimum_height = 600, 46 | minimum_width = 400, 47 | net_avg_samples = 2, 48 | no_buffers = true, 49 | out_to_console = false, 50 | out_to_ncurses = false, 51 | out_to_stderr = false, 52 | out_to_x = true, 53 | extra_newline = false, 54 | own_window = true, 55 | own_window_class = 'Conky', 56 | own_window_type = 'desktop', 57 | stippled_borders = 0, 58 | update_interval = 1.0, 59 | uppercase = false, 60 | use_spacer = 'none', 61 | show_graph_scale = false, 62 | show_graph_range = false, 63 | lua_load = '~/.config/conky-gpu/conky_draw.lua', 64 | lua_draw_hook_pre = 'main' 65 | } 66 | 67 | conky.text = [[ 68 | ${color4}SYSTEM ${hr 2} 69 | ${voffset 200}${goto 240}TEMP 70 | ${goto 200}${alignr}${execgraph "~/.config/conky-gpu/gpu.sh --temp" 20,200 4B1B0C FF5C2B 100} 71 | ${voffset 40}${goto 240}MEM 72 | ${goto 200}${alignr}${execgraph "~/.config/conky-gpu/gpu.sh --mem" 20,200 4B1B0C FF5C2B 100} 73 | ${voffset 160} 74 | ${if_up wlp2s0}WIFI ${alignr}${addr wlp2s0} 75 | ${color1}UP${alignr}$color2${upspeed wlp2s0} / ${totalup wlp2s0} ${upspeedgraph wlp2s0 20,210 4B1B0C FF5C2B 100 -l} 76 | ${color1}DOWN${alignr}$color2${downspeed wlp2s0} / ${totaldown wlp2s0} ${downspeedgraph wlp2s0 20,210 324D23 77B753 100 -l} 77 | ${endif} 78 | ${if_up enp3s0f1}ETHERNET - ${addr enp3s0f1} 79 | ${color1}UP${alignr}$color2${upspeed enp3s0f1} / ${totalup enp3s0f1} ${upspeedgraph enp3s0f1 20,210 4B1B0C FF5C2B 100 -l} 80 | ${color1}DOWN${alignr}$color2${downspeed enp3s0f1} / ${totaldown enp3s0f1} ${downspeedgraph enp3s0f1 20,210 324D23 77B753 100 -l} 81 | ${endif} 82 | ${color4}${hr 2} 83 | ]] 84 | -------------------------------------------------------------------------------- /dot_config/conky-gpu/executable_gpu.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # various gpu measurements for conky 4 | 5 | current_perf () { 6 | # return the current perf level 7 | nvidia-settings -q '[gpu:0]/GPUCurrentPerfLevel' -t 8 | } 9 | 10 | perf_str () { 11 | # return the settings string for the current perf level 12 | nvidia-settings -q '[gpu:0]/GPUPerfModes' -t \ 13 | | grep -o "perf=$1[^;]*" \ 14 | | tr ',' '\n' 15 | } 16 | 17 | gpu_freq () { 18 | # get GPU frequency and scale to 0-100 based on max 19 | 20 | perf=$(current_perf) 21 | output="$(perf_str $perf)" 22 | 23 | curr=$(grep 'nvclock=' <<< $output | grep -o '[0-9]*') 24 | min=$(grep 'nvclockmin=' <<< $output | grep -o '[0-9]*') 25 | max=$(grep 'nvclockmax=' <<< $output | grep -o '[0-9]*') 26 | 27 | echo -e "$perf \n $curr \n $min \n $max" 28 | } 29 | 30 | graph () { 31 | # 0-100 - corrected scale for gpu frequency 32 | nums=($(gpu_freq)) 33 | 34 | # uncorrected (slightly prettier visually, but is this less accurate? 35 | echo "100 * ${nums[1]} / ${nums[3]}" \ 36 | | bc -l 37 | 38 | # corrected 39 | # echo "100 * ( ${nums[1]} - ${nums[2]} ) / ( ${nums[3]} - ${nums[2]} )" \ 40 | # | bc -l 41 | } 42 | 43 | temp () { 44 | # 0-100 - corrected scale for gpu frequency 45 | 46 | curr=$(nvidia-settings -q '[gpu:0]/GPUCoreTemp' -t) 47 | max=$(nvidia-settings -q '[gpu:0]/GPUMaxOperatingTempThreshold' -t) 48 | 49 | echo "100 * $curr / $max" | bc -l 50 | } 51 | 52 | mem () { 53 | perf=$(current_perf) 54 | 55 | case $perf in 56 | 0) echo 5 ;; 57 | 1) echo 25 ;; 58 | 2) echo 50 ;; 59 | 3) echo 75 ;; 60 | 4) echo 100 ;; 61 | esac 62 | } 63 | 64 | display () { 65 | # get a string to display in the counter 66 | nums=($(gpu_freq)) 67 | 68 | echo "${nums[0]}: ${nums[1]} / ${nums[3]}" 69 | } 70 | 71 | if [[ "$1" == "--graph" ]]; then 72 | graph 73 | elif [[ "$1" == "--temp" ]]; then 74 | temp 75 | elif [[ "$1" == "--mem" ]]; then 76 | mem 77 | else 78 | display 79 | fi 80 | -------------------------------------------------------------------------------- /dot_config/dive/dive.yml: -------------------------------------------------------------------------------- 1 | diff: 2 | hide: 3 | - unmodified 4 | -------------------------------------------------------------------------------- /dot_config/dunst/dunstrc: -------------------------------------------------------------------------------- 1 | [global] 2 | ### Display ### 3 | 4 | # Which monitor should the notifications be displayed on. 5 | monitor = 0 6 | 7 | # Display notification on focused monitor 8 | follow = mouse 9 | 10 | # The geometry of the window 11 | geometry = "250-50+10" 12 | 13 | # Show how many messages are currently hidden (because of geometry). 14 | indicate_hidden = yes 15 | 16 | # Shrink window if it's smaller than the width. Will be ignored if 17 | # width is 0. 18 | shrink = no 19 | 20 | # The transparency of the window. Range: [0; 100]. 21 | transparency = 0 22 | 23 | notification_height = 0 24 | 25 | # Draw a line of "separator_height" pixel height between two 26 | # notifications. 27 | separator_height = 10 28 | 29 | # Padding between text and separator. 30 | padding = 8 31 | 32 | # Horizontal padding. 33 | horizontal_padding = 10 34 | 35 | # Defines width in pixels of frame around the notification window. 36 | # Set to 0 to disable. 37 | frame_width = 2 38 | 39 | # Defines color of the frame around the notification window. 40 | frame_color = "#fbf1c7" 41 | 42 | # Define a color for the separator. 43 | # possible values are: 44 | # * auto: dunst tries to find a color fitting to the background; 45 | # * foreground: use the same color as the foreground; 46 | # * frame: use the same color as the frame; 47 | # * anything else will be interpreted as a X color. 48 | separator_color = frame 49 | 50 | # Sort messages by urgency. 51 | sort = yes 52 | 53 | # Don't remove messages, if the user is idle (no mouse or keyboard input) 54 | # for longer than idle_threshold seconds. 55 | # Set to 0 to disable. 56 | # Transient notifications ignore this setting. 57 | idle_threshold = 120 58 | 59 | ### Text ### 60 | 61 | font = Iosevka 16 62 | 63 | # The spacing between lines. If the height is smaller than the 64 | # font height, it will get raised to the font height. 65 | line_height = 0 66 | 67 | markup = full 68 | 69 | # The format of the message. Possible variables are: 70 | # %a appname 71 | # %s summary 72 | # %b body 73 | # %i iconname (including its path) 74 | # %I iconname (without its path) 75 | # %p progress value if set ([ 0%] to [100%]) or nothing 76 | # %n progress value if set without any extra characters 77 | # %% Literal % 78 | # Markup is allowed 79 | format = "%s\n%b" 80 | 81 | # Alignment of message text. 82 | alignment = left 83 | 84 | show_age_threshold = 60 85 | 86 | # Split notifications into multiple lines if they don't fit into 87 | # geometry. 88 | word_wrap = yes 89 | 90 | # When word_wrap is set to no, specify where to ellipsize long lines. 91 | # Possible values are "start", "middle" and "end". 92 | ellipsize = middle 93 | 94 | # Ignore newlines '\n' in notifications. 95 | ignore_newline = no 96 | 97 | # Merge multiple notifications with the same content 98 | stack_duplicates = true 99 | 100 | # Hide the count of merged notifications with the same content 101 | hide_duplicate_count = false 102 | 103 | # Display indicators for URLs (U) and actions (A). 104 | show_indicators = yes 105 | 106 | ### Icons ### 107 | 108 | # Align icons left/right/off 109 | icon_position = off 110 | 111 | # Scale larger icons down to this size, set to 0 to disable 112 | max_icon_size = 32 113 | 114 | # Paths to default icons. 115 | icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/ 116 | 117 | ### History ### 118 | 119 | # Should a notification popped up from history be sticky or timeout 120 | # as if it would normally do. 121 | sticky_history = yes 122 | 123 | # Maximum amount of notifications kept in history 124 | history_length = 20 125 | 126 | ### Misc/Advanced ### 127 | 128 | # dmenu path. 129 | dmenu = /usr/bin/dmenu -p dunst: 130 | 131 | # Browser for opening urls in context menu. 132 | browser = /usr/bin/firefox -new-tab 133 | 134 | # Always run rule-defined scripts, even if the notification is suppressed 135 | always_run_script = true 136 | 137 | # Define the title of the windows spawned by dunst 138 | title = Dunst 139 | 140 | # Define the class of the windows spawned by dunst 141 | class = Dunst 142 | 143 | # Print a notification on startup. 144 | # This is mainly for error detection, since dbus (re-)starts dunst 145 | # automatically after a crash. 146 | startup_notification = false 147 | 148 | ### Legacy 149 | 150 | # Use the Xinerama extension instead of RandR for multi-monitor support. 151 | # This setting is provided for compatibility with older nVidia drivers that 152 | # do not support RandR and using it on systems that support RandR is highly 153 | # discouraged. 154 | # 155 | # By enabling this setting dunst will not be able to detect when a monitor 156 | # is connected or disconnected which might break follow mode if the screen 157 | # layout changes. 158 | force_xinerama = false 159 | 160 | # Experimental features that may or may not work correctly. Do not expect them 161 | # to have a consistent behaviour across releases. 162 | [experimental] 163 | # Calculate the dpi to use on a per-monitor basis. 164 | # If this setting is enabled the Xft.dpi value will be ignored and instead 165 | # dunst will attempt to calculate an appropriate dpi value for each monitor 166 | # using the resolution and physical size. This might be useful in setups 167 | # where there are multiple screens with very different dpi values. 168 | per_monitor_dpi = false 169 | 170 | [shortcuts] 171 | # Available modifiers are "ctrl", "mod1" (the alt-key), "mod2", "mod3" and "mod4" (windows-key). 172 | 173 | close = Escape 174 | close_all = shift+Escape 175 | 176 | # Redisplay last message(s). 177 | history = ctrl+grave 178 | 179 | # Context menu. 180 | context = ctrl+shift+period 181 | 182 | [urgency_low] 183 | # IMPORTANT: colors have to be defined in quotation marks. 184 | # Otherwise the "#" and following would be interpreted as a comment. 185 | background = "#1e070f" 186 | foreground = "#B26F4A" 187 | timeout = 10 188 | # Icon for notifications with low urgency, uncomment to enable 189 | #icon = /path/to/icon 190 | 191 | [urgency_normal] 192 | background = "#1e070f" 193 | foreground = "#B26F4A" 194 | timeout = 10 195 | # Icon for notifications with normal urgency, uncomment to enable 196 | #icon = /path/to/icon 197 | 198 | [urgency_critical] 199 | background = "#1e070f" 200 | foreground = "#B26F4A" 201 | frame_color = "#ff0000" 202 | timeout = 0 203 | # Icon for notifications with critical urgency, uncomment to enable 204 | #icon = /path/to/icon 205 | -------------------------------------------------------------------------------- /dot_config/fzf/dot_fzf.zsh.tmpl: -------------------------------------------------------------------------------- 1 | # Setup fzf 2 | 3 | {{ if (eq .chezmoi.os "darwin") -}} 4 | {{ if (eq .chezmoi.arch "arm64") -}} 5 | PREFIX=/opt/homebrew/opt/fzf/shell 6 | {{ else -}} 7 | PREFIX=/usr/local/opt/fzf/shell 8 | {{- end }} 9 | {{ else if (eq .chezmoi.os "linux") -}} 10 | PREFIX=/usr/share/fzf 11 | {{- end }} 12 | 13 | # Auto-completion 14 | # --------------- 15 | [[ $- == *i* ]] && \ 16 | [[ -f $PREFIX/completion.zsh ]] && source "$PREFIX/completion.zsh" 2>/dev/null 17 | 18 | # Key bindings 19 | # ------------ 20 | [[ -f $PREFIX/key-bindings.zsh ]] && source "$PREFIX/key-bindings.zsh" 21 | -------------------------------------------------------------------------------- /dot_config/fzf/executable_fstash: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | # fstash - easier way to deal with stashes 4 | # type fstash to get a list of your stashes 5 | # enter shows you the contents of the stash 6 | # ctrl-d shows a diff of the stash against your current HEAD 7 | # ctrl-b checks the stash out as a branch, for easier merging 8 | __fstash() { 9 | local out key msg sha ref 10 | while out=$( 11 | git stash list --color=always \ 12 | --pretty="%C(yellow)%h | %C(red)%gd | %Cgreen%cr %C(blue)%gs" | 13 | fzf --ansi --multi \ 14 | --preview="git stash show {1} -p --color=always" \ 15 | --expect=ctrl-b,ctrl-d,ctrl-a 16 | ); 17 | do 18 | key=$(head -1 <<< "$out") 19 | msg=$(head -2 <<< "$out" | tail -1) 20 | IFS="| " read -r -a msg <<< "$msg" 21 | sha="${msg[0]}" 22 | sha="${sha%% *}" 23 | ref="${msg[1]}" 24 | 25 | [[ -z "$sha" ]] && continue 26 | 27 | if [[ "$key" == 'ctrl-b' ]]; then 28 | git stash branch "stash-$sha" "$sha" 29 | break 30 | elif [[ "$key" == 'ctrl-d' ]]; then 31 | git stash drop "$ref" 32 | sleep 0.5 33 | elif [[ "$key" == 'ctrl-a' ]]; then 34 | git stash apply "$ref" 35 | break 36 | else 37 | git stash show -p "$sha" 38 | break 39 | fi 40 | done 41 | } 42 | 43 | __fstash 44 | -------------------------------------------------------------------------------- /dot_config/fzf/executable_rfv: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 1. Search for text in files using Ripgrep 4 | # 2. Interactively restart Ripgrep with reload action 5 | # 3. Open the file in $EDITOR 6 | RG_PREFIX="rg --column --line-number --no-heading --color=always --smart-case " 7 | INITIAL_QUERY="${*:-}" 8 | IFS=: read -ra selected < <( 9 | FZF_DEFAULT_COMMAND="$RG_PREFIX $(printf %q "$INITIAL_QUERY")" \ 10 | fzf --ansi \ 11 | --disabled --query "$INITIAL_QUERY" \ 12 | --bind "change:reload:sleep 0.1; $RG_PREFIX {q} || true" \ 13 | --delimiter : \ 14 | --preview 'bat --color=always {1} --highlight-line {2}' \ 15 | --preview-window 'up,60%,border-bottom,+{2}+3/3,~3' 16 | ) 17 | [ -n "${selected[0]}" ] && $EDITOR "${selected[0]}" "+${selected[1]}" 18 | -------------------------------------------------------------------------------- /dot_config/iterm2/executable_xdefaults2iterm.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # Convert .Xdefaults or similar terminal colors to iTerm2 scheme 4 | # Only supports simple hex colors, no funny stuff 5 | 6 | use strict; 7 | 8 | print < 10 | 11 | 12 | 13 | eof 14 | 15 | my %cols = ( 16 | 2 => "Blue", 17 | 1 => "Green", 18 | 0 => "Red", 19 | ); 20 | 21 | while (<>) { 22 | if(/^[^!]*color(\d+):\s+#(\w{6})/) { 23 | print "\tAnsi $1 Color\n\t\n"; 24 | print &do_color($2); 25 | print "\t\n"; 26 | } elsif(/^[^!]*(fore|back)ground:\s+#(\w{6})/) { 27 | my $fb = $1; 28 | $fb =~ tr/fb/FB/; 29 | print "\t" . $fb . "ground Color\n\t\n"; 30 | print &do_color($2); 31 | print "\t\n"; 32 | } 33 | } 34 | 35 | print "\n"; 36 | 37 | sub do_color { 38 | my $i = 0; 39 | my $ret = ''; 40 | for (shift =~ m/.{2}/gs) { 41 | $ret .= "\t\t$cols{$i} Component\n\t\t"; 42 | $ret .= sprintf("%.16f", hex($_)/255); 43 | $ret .= "\n"; 44 | $i++; 45 | } 46 | return $ret; 47 | } -------------------------------------------------------------------------------- /dot_config/kitty/kitty.conf: -------------------------------------------------------------------------------- 1 | # vim:fileencoding=utf-8:foldmethod=marker 2 | 3 | #: Fonts {{{ 4 | 5 | font_family Fantasque Sans Mono 6 | 7 | # https://sw.kovidgoyal.net/kitty/faq/#kitty-is-not-able-to-use-my-favorite-font 8 | # no need to use a patched font in kitty. 9 | # it should auto-recognize symbols, but if it doesn't, can explicitly map the following to be provided by nerd font: 10 | # Nerd Fonts v2.3.3 11 | symbol_map U+23FB-U+23FE,U+2665,U+26A1,U+2B58,U+E000-U+E00A,U+E0A0-U+E0A3,U+E0B0-U+E0D4,U+E200-U+E2A9,U+E300-U+E3E3,U+E5FA-U+E6AA,U+E700-U+E7C5,U+EA60-U+EBEB,U+F000-U+F2E0,U+F300-U+F32F,U+F400-U+F4A9,U+F500-U+F8FF,U+F0001-U+F1AF0 Symbols Nerd Font Mono 12 | 13 | font_size 14.0 14 | 15 | modify_font underline_position 2 16 | modify_font cell_height 110% 17 | 18 | # disable ligatures only under cursor to help with editing 19 | disable_ligatures cursor 20 | 21 | #: }}} 22 | 23 | #: Cursor customization {{{ 24 | 25 | cursor #ebdbb2 26 | cursor_shape block 27 | cursor_blink_interval 0 28 | 29 | #: }}} 30 | 31 | #: Scrollback {{{ 32 | 33 | # (no custom settings) 34 | 35 | #: }}} 36 | 37 | #: Mouse {{{ 38 | 39 | mouse_hide_wait 2.0 40 | 41 | copy_on_select yes 42 | 43 | paste_actions quote-urls-at-prompt 44 | 45 | #: Mouse actions {{{ 46 | 47 | # select output of a command by right-clicking 48 | mouse_map right press ungrabbed mouse_select_command_output 49 | 50 | #: }}} 51 | 52 | #: }}} 53 | 54 | #: Performance tuning {{{ 55 | 56 | # (no custom settings) 57 | 58 | #: }}} 59 | 60 | #: Terminal bell {{{ 61 | 62 | enable_audio_bell no 63 | 64 | #: }}} 65 | 66 | #: Window layout {{{ 67 | 68 | window_padding_width 10 69 | 70 | # active_border_color #00ff00 71 | 72 | #: The color for the border of the active window. Set this to none to 73 | #: not draw borders around the active window. 74 | 75 | # inactive_border_color #cccccc 76 | 77 | #: The color for the border of inactive windows. 78 | 79 | hide_window_decorations yes 80 | 81 | confirm_os_window_close 0 82 | 83 | #: }}} 84 | 85 | #: Tab bar {{{ 86 | 87 | # (no custom settings) 88 | 89 | #: }}} 90 | 91 | #: Color scheme {{{ 92 | 93 | # pywal colors 94 | include ~/.cache/wal/colors-kitty.conf 95 | 96 | background_opacity 0.8 97 | 98 | #: The color table {{{ 99 | 100 | # kitty also supports marks, but the pywal template doesn't set those. 101 | # should i use them? 102 | 103 | #: }}} 104 | 105 | #: }}} 106 | 107 | #: Advanced {{{ 108 | 109 | # do i need remote control? 110 | allow_remote_control no 111 | 112 | #: }}} 113 | 114 | #: OS specific tweaks {{{ 115 | 116 | macos_option_as_alt yes 117 | 118 | macos_quit_when_last_window_closed yes 119 | 120 | #: }}} 121 | 122 | #: Keyboard shortcuts {{{ 123 | 124 | # ensure alt-left/right do the correct thing within tmux 125 | map alt+left send_text all \x1b\x62 126 | map alt+right send_text all \x1b\x66 127 | 128 | # unmap default ctrl+shift+left/right so it works in tmux 129 | map ctrl+shift+left 130 | map ctrl+shift+right 131 | 132 | #: Clipboard {{{ 133 | 134 | #: }}} 135 | 136 | #: Scrolling {{{ 137 | 138 | #: }}} 139 | 140 | #: Window management {{{ 141 | 142 | # auto-decides horizontal/vertical based on remaining area. 143 | map ctrl+shift+enter launch --location=split --cwd=current 144 | 145 | # move focus to adjacent windows. 146 | map ctrl+left neighboring_window left 147 | map ctrl+up neighboring_window up 148 | map ctrl+down neighboring_window down 149 | map ctrl+right neighboring_window right 150 | 151 | #: }}} 152 | 153 | #: Tab management {{{ 154 | 155 | #: }}} 156 | 157 | #: Layout management {{{ 158 | 159 | #: }}} 160 | 161 | #: Font sizes {{{ 162 | 163 | #: }}} 164 | 165 | #: Select and act on visible text {{{ 166 | 167 | # amar - these all seem super useful (in fact, kind of like leap-spooky). 168 | # keeping most of them here for reference. 169 | 170 | #: Open URL 171 | 172 | # map kitty_mod+e open_url_with_hints 173 | 174 | #:: Open a currently visible URL using the keyboard. The program used 175 | #:: to open the URL is specified in open_url_with. 176 | 177 | #: Insert selected path 178 | 179 | # map kitty_mod+p>f kitten hints --type path --program - 180 | 181 | #:: Select a path/filename and insert it into the terminal. Useful, 182 | #:: for instance to run git commands on a filename output from a 183 | #:: previous git command. 184 | 185 | #: Open selected path 186 | 187 | # map kitty_mod+p>shift+f kitten hints --type path 188 | 189 | #:: Select a path/filename and open it with the default open program. 190 | 191 | #: Insert selected line 192 | 193 | # map kitty_mod+p>l kitten hints --type line --program - 194 | 195 | #:: Select a line of text and insert it into the terminal. Useful for 196 | #:: the output of things like: `ls -1`. 197 | 198 | #: Insert selected word 199 | 200 | # map kitty_mod+p>w kitten hints --type word --program - 201 | 202 | #:: Select words and insert into terminal. 203 | 204 | #: Insert selected hash 205 | 206 | # map kitty_mod+p>h kitten hints --type hash --program - 207 | 208 | #:: Select something that looks like a hash and insert it into the 209 | #:: terminal. Useful with git, which uses SHA1 hashes to identify 210 | #:: commits. 211 | 212 | #: Open the selected file at the selected line 213 | 214 | # map kitty_mod+p>n kitten hints --type linenum 215 | 216 | #:: Select something that looks like filename:linenum and open it in 217 | #:: vim at the specified line number. 218 | 219 | #: Open the selected hyperlink 220 | 221 | # map kitty_mod+p>y kitten hints --type hyperlink 222 | 223 | #:: Select a hyperlink (i.e. a URL that has been marked as such by 224 | #:: the terminal program, for example, by `ls --hyperlink=auto`). 225 | 226 | 227 | #: The hints kitten has many more modes of operation that you can map 228 | #: to different shortcuts. For a full description see hints kitten 229 | #: . 230 | #: }}} 231 | 232 | #: Miscellaneous {{{ 233 | 234 | #: Unicode input 235 | 236 | # map kitty_mod+u kitten unicode_input 237 | # map ctrl+cmd+space kitten unicode_input 238 | 239 | #: Increase background opacity 240 | 241 | # map kitty_mod+a>m set_background_opacity +0.1 242 | 243 | #: Decrease background opacity 244 | 245 | # map kitty_mod+a>l set_background_opacity -0.1 246 | 247 | #: Make background fully opaque 248 | 249 | # map kitty_mod+a>1 set_background_opacity 1 250 | 251 | #: Reset background opacity 252 | 253 | # map kitty_mod+a>d set_background_opacity default 254 | 255 | #: Reload kitty.conf 256 | 257 | # map kitty_mod+f5 load_config_file 258 | # map ctrl+cmd+, load_config_file 259 | 260 | #: }}} 261 | 262 | #: }}} 263 | -------------------------------------------------------------------------------- /dot_config/libinput-gestures.conf: -------------------------------------------------------------------------------- 1 | # Configuration file for libinput-gestures. 2 | # 3 | # Default: /etc/libinput-gestures.conf 4 | # Note: xdotool does not work with native Wayland clients. 5 | # Note: 2 fingers are handled by DE (?) 6 | 7 | # 8 | # SWIPE GESTURES: 9 | # 10 | 11 | # Browser back/forward 12 | gesture swipe left 3 xdotool key alt+Left 13 | gesture swipe right 3 xdotool key alt+Right 14 | 15 | # Move between desktops 16 | gesture swipe left 4 xdotool key super+Left 17 | gesture swipe right 4 xdotool key super+Right 18 | 19 | # Next/previous browser tabs 20 | gesture swipe right_up 3 xdotool key control+Tab 21 | gesture swipe left_up 3 xdotool key control+shift+Tab 22 | 23 | # KILL browser tabs 24 | gesture swipe up 3 xdotool key control+shift+t 25 | gesture swipe down 3 xdotool key control+w 26 | -------------------------------------------------------------------------------- /dot_config/mozilla/README.md: -------------------------------------------------------------------------------- 1 | # Firefox Theming 2 | 3 | - [minimal-functional-fox](https://github.com/mut-ex/minimal-functional-fox) for restyling Firefox 4 | - using modified colors based on dotfiles from [kharann](https://github.com/kharann/dotfiles/tree/master/firefox) and [szorfein](https://github.com/szorfein/dotfiles) 5 | - to set up, make sure to link `chrome` into your Firefox profile 6 | - macOS: profiles under `~/Library/Application Support/Firefox/Profiles/` 7 | - [nightTab](https://github.com/zombieFox/nightTab) for new tab page 8 | -------------------------------------------------------------------------------- /dot_config/mozilla/notes.md: -------------------------------------------------------------------------------- 1 | # Debugging 2 | 3 | Some tools for debugging this setup if you want to change how things look: 4 | 5 | https://developer.mozilla.org/en-US/docs/Tools/Browser_Toolbox 6 | 7 | `devtools.chrome.enabled = true` 8 | `devtools.debugger.remote-enabled = true` 9 | -------------------------------------------------------------------------------- /dot_config/nvim/after/queries/python/injections.scm: -------------------------------------------------------------------------------- 1 | ;; extends 2 | 3 | ; apply sql syntax highlight to any var whose name matches QUERY_ or SQL_ 4 | (assignment 5 | left: (identifier) @_id (#match? @_id "QUERY_|SQL_") 6 | right: (string (string_content) @injection.content) 7 | (#set! injection.language "sql") 8 | (#offset! @injection.content 0 0 0 0) 9 | (#set! injection.include-children)) 10 | 11 | ;; TODO? 12 | ; https://github.com/tree-sitter/tree-sitter/discussions/1577 13 | 14 | ; capture that highlights the _first_ string inside any function named foo.execute() as SQL 15 | ; (typically cur.execute()) 16 | (call 17 | function: (attribute attribute: (identifier) @id (#match? @id "execute")) 18 | arguments: (argument_list . (string (string_content) @injection.content)) 19 | (#set! injection.language "sql") 20 | (#offset! @injection.content 0 0 0 0) 21 | (#set! injection.include-children)) 22 | -------------------------------------------------------------------------------- /dot_config/nvim/after/queries/ruby/injections.scm: -------------------------------------------------------------------------------- 1 | ; extends 2 | 3 | ;; apply bash syntax highlighting to shell heredocs in Vagrantfiles 4 | ( 5 | (call 6 | method: (identifier) @_method (#eq? @_method "provision") 7 | arguments: (argument_list (string (string_content) @_str)) 8 | ) 9 | (heredoc_body (heredoc_content) @bash) 10 | (#eq? @_str "shell") 11 | (#offset! @bash 0 0 0 0) 12 | ) 13 | 14 | -------------------------------------------------------------------------------- /dot_config/nvim/ftplugin/python/python_black.vim: -------------------------------------------------------------------------------- 1 | " -*- vim -*- 2 | " FILE: python_black.vim 3 | 4 | " Run black-macchiato on a section of python code 5 | " This tool uses `black`, a code formatter for python, to transform stdin > 6 | " stdout. 7 | 8 | vmap l :!black-macchiato 9 | -------------------------------------------------------------------------------- /dot_config/nvim/init.lua: -------------------------------------------------------------------------------- 1 | -- Amar Paul's init.lua (for Neovim) 2 | 3 | -- install and set up plugins 4 | require "core.plugins_lazy" 5 | 6 | -- settings / bindings (note that some are dependent on loaded plugins, e.g. bindings/highlights) 7 | require "core.options" 8 | require "core.autocmds" 9 | require "core.mappings" 10 | require "core.highlights" 11 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/configs/cmp.lua: -------------------------------------------------------------------------------- 1 | -- required for nvim-cmp 2 | vim.opt.completeopt = "menu,menuone,noselect" 3 | 4 | -- Setup nvim-cmp. 5 | local cmp = require("cmp") 6 | local map = cmp.mapping 7 | local luasnip = require("luasnip") 8 | local cmp_autopairs = require("nvim-autopairs.completion.cmp") 9 | 10 | local t = function (str) 11 | return vim.api.nvim_replace_termcodes(str, true, true, true) 12 | end 13 | 14 | -- defined by nvim-cmp's example mappings for luasnip 15 | -- i don't really understand the point of this function 16 | local has_words_before = function() 17 | local line, col = unpack(vim.api.nvim_win_get_cursor(0)) 18 | return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil 19 | end 20 | 21 | -- annotate completion candidates in Pmenu (vscode-like) 22 | -- https://github.com/hrsh7th/nvim-cmp/wiki/Menu-Appearance#how-to-add-visual-studio-code-codicons-to-the-menu 23 | -- had to install nerd-fonts-patched FantasqueSansMono to get this to work: 24 | -- https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/FantasqueSansMono 25 | local kind_icons = { 26 | Text = "  ", 27 | Method = "  ", 28 | Function = "  ", 29 | Constructor = "  ", 30 | Field = "  ", 31 | Variable = "  ", 32 | Class = "  ", 33 | Interface = "  ", 34 | Module = "  ", 35 | Property = "  ", 36 | Unit = "  ", 37 | Value = "  ", 38 | Enum = "  ", 39 | Keyword = "  ", 40 | Snippet = "  ", 41 | Color = "  ", 42 | File = "  ", 43 | Reference = "  ", 44 | Folder = "  ", 45 | EnumMember = "  ", 46 | Constant = "  ", 47 | Struct = "  ", 48 | Event = "  ", 49 | Operator = "  ", 50 | TypeParameter = "  ", 51 | DataBase = "  ", 52 | } 53 | 54 | cmp.setup({ 55 | snippet = { 56 | expand = function(args) 57 | luasnip.lsp_expand(args.body) 58 | end, 59 | }, 60 | 61 | -- cmp.mapping.preset.{insert,cmdline} sets some default bindings. 62 | -- see: https://github.com/hrsh7th/nvim-cmp/issues/231#issuecomment-1098175017 63 | -- and: https://github.com/hrsh7th/nvim-cmp/commit/93cf84f7deb2bdb640ffbb1d2f8d6d412a7aa558 64 | -- TODO - in light of this removal, this bindings could probably be cleaned up in the future. 65 | mapping = map.preset.insert({ 66 | [""] = map(map.scroll_docs(-4), { "i", "c" }), 67 | [""] = map(map.scroll_docs(4), { "i", "c" }), 68 | [""] = map(map.complete(), { "i", "c" }), 69 | [""] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `` mapping. 70 | [""] = map({ 71 | i = map.abort(), 72 | c = map.close(), 73 | }), 74 | [""] = map.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. 75 | 76 | [""] = map(function (fallback) 77 | if luasnip.expand_or_jumpable() then 78 | luasnip.expand_or_jump() 79 | elseif has_words_before() then 80 | cmp.complete() 81 | else 82 | fallback() 83 | end 84 | end, { "i", "s", "c" }), 85 | 86 | [""] = map(function (fallback) 87 | if luasnip.jumpable(-1) then 88 | luasnip.jump(-1) 89 | else 90 | fallback() 91 | end 92 | end, { "i", "s", "c" }), 93 | 94 | }), 95 | 96 | sources = cmp.config.sources({ 97 | { name = "path" }, 98 | { name = "nvim_lsp", keyword_length = 3 }, 99 | { name = "buffer", keyword_length = 3 }, 100 | { name = "luasnip", keyword_length = 2 }, 101 | { name = "otter" }, 102 | }), 103 | 104 | formatting = { 105 | format = function(entry, vim_item) 106 | local kind_menu = { 107 | path = "[Path]", 108 | buffer = "[Buffer]", 109 | nvim_lsp = "[LSP]", 110 | luasnip = "[luasnip]", 111 | nvim_lua = "[Lua]", 112 | latex_symbols = "[LaTeX]", 113 | otter = "[otter]", 114 | } 115 | 116 | -- README says it marks completion items, but it's not showing up for me 117 | kind_menu["vim-dadbod-completion"] = "[DB]" 118 | 119 | if entry.source.name == "vim-dadbod-completion" then 120 | vim_item.kind = "DataBase" 121 | end 122 | 123 | -- Kind icons 124 | -- Concatenate the icons with the name of the item kind 125 | vim_item.kind = string.format("%s %s", kind_icons[vim_item.kind], vim_item.kind) 126 | -- Source 127 | vim_item.menu = kind_menu[entry.source.name] 128 | return vim_item 129 | end 130 | } 131 | }) 132 | 133 | -- Use buffer source for `/` (if you enabled `native_menu`, this won"t work anymore). 134 | cmp.setup.cmdline("/", { 135 | sources = { 136 | { name = "buffer" } 137 | }, 138 | mapping = map.preset.cmdline({}), 139 | }) 140 | 141 | -- triggered by input() (e.g. LSP renames, conditional breakpoints, etc) 142 | cmp.setup.cmdline("@", { 143 | sources = { 144 | { name = "nvim_lsp" }, 145 | { name = "buffer" }, 146 | { name = "path" }, 147 | }, 148 | mapping = map.preset.cmdline({}), 149 | }) 150 | 151 | -- Use cmdline & path source for ":" (if you enabled `native_menu`, this won"t work anymore). 152 | cmp.setup.cmdline(":", { 153 | sources = cmp.config.sources({ 154 | { name = "path" } 155 | }, { 156 | { name = "cmdline" } 157 | }), 158 | mapping = map.preset.cmdline({}), 159 | }) 160 | 161 | -- Ensure we still have buffer completion in SQL files opened without DBUI 162 | vim.api.nvim_create_autocmd("FileType", { 163 | pattern = { "sql", "mysql", "plsql" }, 164 | callback = function() 165 | cmp.setup.buffer({ 166 | sources = { 167 | { name = "vim-dadbod-completion" }, 168 | { name = "buffer" }, 169 | { name = "luasnip" }, 170 | } 171 | }) 172 | end, 173 | }) 174 | 175 | -- mute diagnostics by default, too noisy 176 | vim.diagnostic.config({ 177 | virtual_text = false, 178 | severity_sort = true, 179 | }) 180 | 181 | cmp.event:on( 182 | "confirm_done", 183 | cmp_autopairs.on_confirm_done() 184 | ) 185 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/configs/gitsigns.lua: -------------------------------------------------------------------------------- 1 | require("gitsigns").setup({ 2 | numhl = true, 3 | current_line_blame = true, 4 | current_line_blame_opts = { delay = 500 }, 5 | 6 | on_attach = function(bufnr) 7 | local gs = package.loaded.gitsigns 8 | 9 | local function map(mode, lhs, rhs, opts) 10 | opts = opts or {} 11 | opts.buffer = bufnr 12 | vim.keymap.set(mode, lhs, rhs, opts) 13 | end 14 | 15 | -- navigation 16 | map("n", "]h", function() 17 | if vim.wo.diff then return "]h" end 18 | vim.schedule(function() 19 | gs.next_hunk() 20 | vim.api.nvim_feedkeys("zz", "n", false) 21 | end) 22 | return "" 23 | end, {expr=true}) 24 | 25 | map("n", "[h", function() 26 | if vim.wo.diff then return "[h" end 27 | vim.schedule(function() 28 | gs.prev_hunk() 29 | vim.api.nvim_feedkeys("zz", "n", false) 30 | end) 31 | return "" 32 | end, {expr=true}) 33 | 34 | -- actions 35 | map({"n", "v"}, "hs", ":Gitsigns stage_hunk") 36 | map({"n", "v"}, "hr", ":Gitsigns reset_hunk") 37 | map("n", "hS", gs.stage_buffer) 38 | map("n", "hu", gs.undo_stage_hunk) 39 | map("n", "hR", gs.reset_buffer) 40 | map("n", "hp", gs.preview_hunk) 41 | map("n", "hd", gs.diffthis) 42 | map("n", "hD", function() gs.diffthis("~") end) 43 | map("n", "yog", gs.toggle_current_line_blame) 44 | 45 | -- text object 46 | map({"o", "x"}, "ih", ":Gitsigns select_hunk") 47 | end 48 | }) 49 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/configs/jdtls.lua: -------------------------------------------------------------------------------- 1 | -- note: this file requires my lspconfig_config.on_attach 2 | 3 | local project_name = vim.fn.fnamemodify(vim.fn.getcwd(), ":p:h:t") 4 | local workspace_dir = vim.fn.expand("$HOME") .. "/.cache/nvim/jdtls/" .. project_name 5 | 6 | -- TODO: maybe glob this for os and arch? 7 | -- see: brew --prefix 8 | local install_path = '/opt/homebrew/opt/jdtls/libexec/' 9 | local jdtls_platform = "mac_arm" 10 | 11 | local plugin_path = install_path .. 'plugins' 12 | local config_path = install_path .. 'config_' .. jdtls_platform 13 | 14 | -- TODO: make this robust if >1 or 0 matches are found 15 | local jar_path = vim.fs.find(function(name, path) 16 | return name:match('org.eclipse.equinox.launcher_.*.jar$') 17 | end, {limit = 1, type = 'file', path = plugin_path})[1] 18 | 19 | require("jdtls").start_or_attach({ 20 | cmd = { 21 | -- explicitly using (at least) java 17. 22 | vim.fn.expand("$HOME") .. "/.sdkman/candidates/java/17.0.6-tem/bin/java", 23 | 24 | "-Declipse.application=org.eclipse.jdt.ls.core.id1", 25 | "-Dosgi.bundles.defaultStartLevel=4", 26 | "-Declipse.product=org.eclipse.jdt.ls.core.product", 27 | "-Dlog.protocol=true", 28 | "-Dlog.level=ALL", 29 | "-Xmx1g", 30 | "--add-modules=ALL-SYSTEM", 31 | "--add-opens", "java.base/java.util=ALL-UNNAMED", 32 | "--add-opens", "java.base/java.lang=ALL-UNNAMED", 33 | 34 | "-jar", 35 | jar_path, 36 | 37 | "-configuration", 38 | config_path, 39 | 40 | "-data", 41 | workspace_dir, 42 | }, 43 | root_dir = vim.fs.dirname(vim.fs.find({ "gradlew", ".git", "mvnw" }, { upward = true })[1]), 44 | settings = { 45 | java = { 46 | configuration = { 47 | runtimes = { 48 | { 49 | name = "JavaSE-11", 50 | path = vim.fn.expand("$HOME") .. "/.sdkman/candidates/java/11.0.18-tem", 51 | }, 52 | { 53 | name = "JavaSE-17", 54 | path = vim.fn.expand("$HOME") .. "/.sdkman/candidates/java/17.0.6-tem", 55 | }, 56 | }, 57 | }, 58 | }, 59 | }, 60 | capabilities = require("cmp_nvim_lsp").default_capabilities(), 61 | on_attach = require("configs.lsp.config").on_attach, 62 | }) 63 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/configs/lsp/config.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | -- only map the following keys after LSP attaches to the current buffer 4 | vim.api.nvim_create_autocmd("LspAttach", { 5 | group = vim.api.nvim_create_augroup("UserLspConfig", {}), 6 | callback = function (ev) 7 | vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc" 8 | 9 | local keymap = function (mode, key, cb, desc) 10 | local opts = vim.tbl_deep_extend("force", { noremap=true, silent=true, buffer=ev.buf }, { desc = desc }) 11 | vim.keymap.set(mode, key, cb, opts) 12 | end 13 | 14 | keymap("n", "gD", vim.lsp.buf.declaration, "LSP: Go to declaration") 15 | keymap("n", "gd", vim.lsp.buf.definition, "LSP: Go to definition") 16 | keymap("n", "K", vim.lsp.buf.hover, "LSP: Hover documentation") 17 | keymap("n", "gi", vim.lsp.buf.implementation, "LSP: Go to implementation") 18 | keymap("n", "wa", vim.lsp.buf.add_workspace_folder, "LSP: Add workspace folder") 19 | keymap("n", "wr", vim.lsp.buf.remove_workspace_folder, "LSP: Remove workspace folder") 20 | keymap("n", "wl", function() 21 | print(vim.inspect(vim.lsp.buf.list_workspace_folders())) 22 | end, "LSP: List workspace folders") 23 | keymap("n", "D", vim.lsp.buf.type_definition, "LSP: Show type definition") 24 | keymap("n", "rn", vim.lsp.buf.rename, "LSP: Rename symbol") 25 | keymap("n", "ca", vim.lsp.buf.code_action, "LSP: Code action") 26 | 27 | -- built-in LSP / telescope / glance ? 28 | keymap("n", "gR", "Glance references", "LSP: Glance references") 29 | keymap("n", "gr", function() require("telescope.builtin").lsp_references() end, "LSP: Find references") 30 | 31 | keymap("n", "f", function() vim.lsp.buf.format { async = true } end, "LSP: Format") 32 | 33 | -- for lvimuser/lsp-inlayhints.nvim 34 | local client = vim.lsp.get_client_by_id(ev.data.client_id) 35 | require("lsp-inlayhints").on_attach(client, ev.buf) 36 | end 37 | }) 38 | 39 | -- restrain a language server (in the case that i"m using multiple for same language) 40 | function M.on_attach_restrained(client, buffer) 41 | client.server_capabilities.documentFormattingProvider = false 42 | client.server_capabilities.hoverProvider = false 43 | client.server_capabilities.renameProvider = false 44 | client.server_capabilities.signatureHelpProvider = false 45 | end 46 | 47 | return M 48 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/configs/lsp/servers.lua: -------------------------------------------------------------------------------- 1 | local capabilities = require("cmp_nvim_lsp").default_capabilities() 2 | local lspconfig = require("lspconfig") 3 | 4 | local lspconfig_config = require("configs.lsp.config") 5 | local on_attach = lspconfig_config.on_attach 6 | local on_attach_restrained = lspconfig_config.on_attach_restrained 7 | 8 | local M = {} 9 | 10 | function M.setup() 11 | 12 | -- Use a loop to conveniently call "setup" on multiple servers and 13 | -- map buffer local keybindings when the language server attaches 14 | local servers = { 15 | -- bash 16 | "bashls", 17 | -- python 18 | -- needs custom flags 19 | -- "pylsp", 20 | -- "pyright", 21 | -- ruby 22 | "solargraph", 23 | -- lua 24 | -- "lua_ls", 25 | -- java 26 | -- needs custom flags 27 | -- "java_language_server", 28 | -- use nvim-jdtls plugin for java support instead 29 | -- "jdtls", 30 | -- c/c++ 31 | -- ccls/clangd both rely on JSON compilation databases 32 | -- requires running `bear -- ` first 33 | -- "ccls", 34 | "clangd", 35 | -- rust 36 | "rust_analyzer", 37 | -- go 38 | "gopls", 39 | } 40 | for _, lsp in pairs(servers) do 41 | lspconfig[lsp].setup { 42 | on_attach = on_attach, 43 | capabilities = capabilities, 44 | flags = { 45 | -- This will be the default in neovim 0.7+ 46 | debounce_text_changes = 150, 47 | }, 48 | } 49 | end 50 | 51 | -- python 52 | lspconfig["pyright"].setup({ 53 | -- disable several capabilities in favor of pylsp 54 | on_attach = on_attach_restrained, 55 | capabilities = capabilities, 56 | }) 57 | 58 | -- lua 59 | -- should be mostly configured by lazydev.nvim plugin. 60 | lspconfig.lua_ls.setup({ 61 | capabilities = capabilities, 62 | settings = { 63 | Lua = { 64 | hint = { 65 | enable = true, 66 | setType = true, 67 | }, 68 | telemetry = { enable = false }, 69 | }, 70 | }, 71 | }) 72 | 73 | lspconfig["pylsp"].setup({ 74 | enable = true, 75 | on_attach = on_attach, 76 | settings = { 77 | pylsp = { 78 | configurationSources = { "ruff", "mypy" }, 79 | plugins = { 80 | ruff = { enabled = true }, 81 | mypy = { enabled = true }, 82 | }, 83 | }, 84 | }, 85 | }) 86 | end 87 | 88 | return M 89 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/configs/lsp/view.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | -- Overrides floating window look with other border symbols. 4 | function M.override() 5 | -- assign border -> border_chars 6 | -- override all floating windows with our new explicitly-defined border 7 | local border_chars = { "┌", "─", "┐", "│", "┘", "─", "└", "│" } 8 | local border = {} 9 | for i, char in pairs(border_chars) do 10 | border[i] = { char, "FloatBorder" } 11 | end 12 | 13 | local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview 14 | function vim.lsp.util.open_floating_preview(contents, syntax, fp_opts, ...) 15 | fp_opts = fp_opts or {} 16 | fp_opts.border = fp_opts.border or border 17 | return orig_util_open_floating_preview(contents, syntax, fp_opts, ...) 18 | end 19 | end 20 | 21 | M.override() 22 | 23 | return M 24 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/configs/lualine.lua: -------------------------------------------------------------------------------- 1 | -- ---- customize some theme colors 2 | local custom_pywal = require("lualine.themes.pywal") 3 | 4 | custom_pywal.normal.a.bg = 2 5 | custom_pywal.normal.b.bg = 0 6 | 7 | -- ---- customize some functions for display 8 | local mode_map = { 9 | ['n'] = 'normie', 10 | ['s'] = 'do >', 11 | ['i'] = 'hardcore hacking', 12 | ['R'] = 'swappity swip', 13 | ['v'] = 'look', 14 | ['V'] = 'line look', 15 | [''] = 'block look', 16 | ['c'] = 'commando', 17 | ['t'] = 'powershell', 18 | ['nt'] = 'powershell ...', 19 | } 20 | 21 | local has_multiple_buffers = function () 22 | local found = false 23 | for buffer = 1, vim.fn.bufnr('$') do 24 | if vim.fn.buflisted(buffer) == 1 then 25 | -- early exit if we've already found a buffer (i.e. have more than 1) 26 | if found == true then return found end 27 | found = true 28 | end 29 | end 30 | return false 31 | end 32 | 33 | local set_tabline = function () 34 | if has_multiple_buffers() then 35 | vim.opt.showtabline = 2 36 | else 37 | vim.opt.showtabline = 1 38 | end 39 | end 40 | 41 | -- TODO: for some reason, the bufenter event doesn't seem to happen until after a buffer 42 | -- gets unloaded (???). so, the tabline won't go away until after some other buffer event 43 | -- happens, eg a help page or a command 44 | -- hacky solution for now by also proccing this cmd on CmdlineEnter, and i just type ':' 45 | -- after closing buffers down to only 1. 46 | -- 47 | -- also, it seems like cmp-cmd is a buffer, so can i filter on stuff like that? 48 | -- i guess it doesn't really matter cause that's not a visible buffer 49 | -- but it causes this autocmd to run more often, which may be unwanted 50 | vim.api.nvim_create_autocmd({ 51 | -- events that should hide tabline 52 | "CmdlineEnter", "BufEnter", "BufDelete", 53 | -- events that might create multiple buffers (show tabline) 54 | "VimEnter", "BufNew", 55 | }, { 56 | pattern = "*", 57 | callback = set_tabline, 58 | }) 59 | 60 | -- ---- setup 61 | require("lualine").setup { 62 | options = { 63 | theme = custom_pywal, 64 | section_separators = { 65 | left = '▊▌▎▏', 66 | right = '▏▎▌▊' 67 | }, 68 | component_separators = { 69 | right = '▏▎', 70 | left = '▎▏', 71 | }, 72 | }, 73 | sections = { 74 | -- override a, b, x, y 75 | -- leave defaults for c (filename), z (row/col) 76 | lualine_a = { 77 | { 78 | -- rename our modes 79 | function () 80 | return mode_map[vim.api.nvim_get_mode().mode] or "__" 81 | end 82 | } 83 | }, 84 | lualine_b = { 85 | -- default, with on_click overrides for branch/diff(?)/diagnostics 86 | { 87 | "branch", 88 | on_click = function() require("telescope.builtin").git_branches() end, 89 | }, 90 | { 91 | "diff", 92 | on_click = function() package.loaded.gitsigns.diffthis() end, 93 | }, 94 | { 95 | "diagnostics", 96 | on_click = function() vim.diagnostic.setloclist() end, 97 | }, 98 | { 99 | function () 100 | local bookmark = " " 101 | if require("grapple").exists() then 102 | return bookmark .. require("grapple").key() 103 | end 104 | return bookmark 105 | end, 106 | -- cond = require("grapple").exists, 107 | cond = function () return pcall(require, "grapple") end, 108 | on_click = function() require("grapple").popup_tags() end, 109 | }, 110 | }, 111 | lualine_x = { 112 | { 113 | -- show statusline mode msgs in component x 114 | -- should this be pcall? 115 | require("noice").api.statusline.mode.get, 116 | cond = require("noice").api.statusline.mode.has, 117 | color = { fg = 3 }, 118 | } 119 | }, 120 | lualine_y = { 121 | { 122 | function() return '' end, 123 | cond = function() 124 | return vim.bo.readonly 125 | end, 126 | }, 127 | }, 128 | }, 129 | tabline = { 130 | lualine_a = { 131 | { 132 | -- show buffers if we have > 1 133 | 'buffers', 134 | -- default max length (2/3) too short 135 | max_length = function () return vim.o.columns * 95 / 100 end, 136 | cond = has_multiple_buffers, 137 | }, 138 | }, 139 | lualine_z = { 140 | { 141 | -- show tabs if we have > 1 142 | 'tabs', 143 | cond = function() 144 | return vim.fn.tabpagenr('$') > 1 145 | end, 146 | }, 147 | }, 148 | }, 149 | } 150 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/configs/portal.lua: -------------------------------------------------------------------------------- 1 | -- maps and functionality for portal and associated movement plugins (grapple, and maybe harpoon?) 2 | local portal = require("portal") 3 | local builtin = require("portal.builtin") 4 | 5 | -- grapple 6 | vim.keymap.set("n", "t", require("grapple").toggle, { desc = "GrappleToggle a file" }) 7 | 8 | -- portal 9 | 10 | -- in general, four labels are enough. 11 | -- (however, we might override this for searches that need more labels) 12 | portal.setup({ 13 | labels = { "j", "k", "l", "h" }, 14 | }) 15 | 16 | local project_filter = function (v) 17 | local root_files = vim.fs.find({ ".git" }, { upward = true }) 18 | if #root_files > 0 then 19 | local root_dir = vim.fs.dirname(root_files[1]) 20 | if root_dir == nil then return false end 21 | local file_path = vim.api.nvim_buf_get_name(v.buffer) 22 | -- don't match git commit messages (sometimes i make this via fugitive or git commit -a) 23 | if string.match(file_path, "%.git/COMMIT_EDITMSG$") ~= nil then return false end 24 | return string.find(file_path, root_dir, 1, true) ~= nil 25 | end 26 | return true 27 | end 28 | 29 | -- provide jumplist, quickfix, and grapple results in one action. 30 | -- this function might take some tweaking: 31 | -- i'm still not sure about how many quickfixes to include (or whether to limit them to the same file?) 32 | local full_query = function (direction) 33 | local jumplist_query = builtin.jumplist.query({ 34 | direction = direction, 35 | filter = project_filter, 36 | labels = { "j", "k", "l" }, 37 | max_results = 3, 38 | }) 39 | 40 | local quickfix_query = builtin.quickfix.query({ 41 | direction = direction, 42 | filter = function (v) 43 | -- filter results to current buffer and/or tagged by grapple 44 | 45 | -- can i filter to only quickfix entries that are later in the file than 46 | -- current cursor location? (get with :call line('.')) 47 | 48 | local buf_ok = function(bufnr) 49 | if vim.fn.buflisted(bufnr) == 1 then 50 | return true 51 | end 52 | 53 | if require("grapple").exists({ buffer = bufnr }) then 54 | return true 55 | end 56 | 57 | return false 58 | end 59 | 60 | if not buf_ok(v.buffer) then return false end 61 | 62 | -- ignore any entries that are before where our cursor currently is 63 | if v.buffer == vim.fn.bufnr() and v.cursor.row <= vim.fn.line('.') then 64 | return false 65 | end 66 | 67 | -- filter only for results that are severity E(rror) 68 | for _, err in ipairs(vim.fn.getqflist()) do 69 | if err.bufnr == v.buffer and err.col == v.cursor.col and err.lnum == v.cursor.row then 70 | if err.type == "E" then 71 | return true 72 | end 73 | end 74 | end 75 | 76 | return false 77 | end, 78 | labels = { "f", "d", "s" }, 79 | max_results = 2, 80 | }) 81 | 82 | local grapple_query = builtin.grapple.query({ labels = { "g", "h" }, max_results = 2 }) 83 | 84 | portal.setup({ 85 | labels = { "j", "k", "l", "f", "d", "s", "g", "h" }, 86 | }) 87 | portal.tunnel( 88 | { 89 | jumplist_query, 90 | quickfix_query, 91 | grapple_query, 92 | } 93 | ) 94 | end 95 | 96 | vim.keymap.set( 97 | "n", 98 | "o", 99 | function () 100 | builtin.jumplist.tunnel_backward({ filter = project_filter }) 101 | end, 102 | { desc = "Portal: backward (in project)" } 103 | ) 104 | 105 | vim.keymap.set( 106 | "n", 107 | "i", 108 | function () 109 | builtin.jumplist.tunnel_forward({ filter = project_filter }) 110 | end, 111 | {desc = "Portal: forward (in project)" } 112 | ) 113 | 114 | vim.keymap.set( 115 | "n", 116 | "o", 117 | function () 118 | full_query("backward") 119 | end, 120 | { desc = "Portal: backward (jumplist + quickfix + grapple)" } 121 | ) 122 | 123 | vim.keymap.set( 124 | "n", 125 | "i", 126 | function () 127 | full_query("forward") 128 | end, 129 | { desc = "Portal: forward (jumplist + quickfix + grapple)" } 130 | ) 131 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/configs/snippets.lua: -------------------------------------------------------------------------------- 1 | -- personal snippets 2 | 3 | local ls = require('luasnip') 4 | local s = ls.snippet 5 | local t = ls.text_node 6 | local i = ls.insert_node 7 | 8 | -- custom snippet for work copyright statement 9 | -- TODO: is there a way to get 'commentstring' and insert it before every line? 10 | ls.add_snippets("all", { 11 | s("COPYRIGHT", { 12 | t("COPYRIGHT NOTICE"), 13 | t({"", "", ""}), 14 | t("Copyright (C) "), 15 | i(1, "YEAR"), 16 | t(" The Johns Hopkins University Applied Physics Laboratory LLC."), 17 | t({"", ""}), 18 | t("All Rights Reserved."), 19 | t({"", "", ""}), 20 | t("For permission to use, modify, or reproduce, contact the"), 21 | t({"", ""}), 22 | t("Office of Technology Transfer at JHU/APL."), 23 | }), 24 | }) 25 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/configs/telescope.lua: -------------------------------------------------------------------------------- 1 | -- telescope searching 2 | 3 | local actions = require("telescope.actions") 4 | local telescope = require("telescope") 5 | 6 | telescope.setup { 7 | defaults = { 8 | prompt_prefix = "󰼛 ", 9 | selection_caret = "󱞩 ", 10 | path_display = { filename_first = { reverse_directories = false } }, 11 | 12 | -- trim leading space from matches 13 | vimgrep_arguments = { 14 | "rg", 15 | "--color=never", 16 | "--no-heading", 17 | "--with-filename", 18 | "--line-number", 19 | "--column", 20 | "--smart-case", 21 | "--trim" -- add this value 22 | }, 23 | 24 | mappings = { 25 | i = { 26 | [""] = actions.close, 27 | [""] = false 28 | }, 29 | }, 30 | 31 | extensions = { 32 | -- i dont think this needs to be specified? 33 | -- fzf, 34 | -- fzf = {}, 35 | 36 | advanced_git_search = {}, 37 | }, 38 | }, 39 | 40 | pickers = { 41 | git_files = { 42 | mappings = { 43 | i = { [""] = actions.to_fuzzy_refine } 44 | } 45 | } 46 | } 47 | } 48 | 49 | telescope.load_extension("fzf") 50 | telescope.load_extension("egrepify") 51 | telescope.load_extension("before") 52 | telescope.load_extension("neoclip") 53 | telescope.load_extension("advanced_git_search") 54 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/configs/treesitter.lua: -------------------------------------------------------------------------------- 1 | -- tree-sitter 2 | 3 | -- for compiling TS grammar for justfiles 4 | require("nvim-treesitter.install").compilers = { "gcc-11" } 5 | 6 | require("nvim-treesitter.configs").setup { 7 | -- "all" | {"list of languages"} 8 | ensure_installed = { 9 | "bash", 10 | "c", 11 | "cmake", 12 | "cpp", 13 | "dockerfile", 14 | "git_config", 15 | "git_rebase", 16 | "gitattributes", 17 | "gitcommit", 18 | "gitignore", 19 | "go", 20 | "graphql", 21 | "groovy", 22 | "hjson", 23 | "html", 24 | "http", 25 | "java", 26 | "javascript", 27 | "jq", 28 | "json", 29 | -- "just", 30 | "luadoc", 31 | "make", 32 | "markdown", 33 | "markdown_inline", 34 | "mermaid", 35 | "nix", 36 | -- norg fails 11/22/23 because of a compilation error in nvim-treesitter compile script 37 | -- "norg", 38 | "ocaml", 39 | "perl", 40 | "puppet", 41 | "python", 42 | -- for ts playground (:InspectTree) 43 | "query", 44 | "regex", -- ?? 45 | "rst", 46 | "ruby", 47 | "rust", 48 | "sql", 49 | "toml", 50 | "typescript", 51 | "vimdoc", 52 | "yaml", 53 | }, 54 | -- ignore_install = { "d", "julia", "phpdoc", "php", "t32" }, 55 | sync_install = false, 56 | 57 | highlight = { 58 | enable = true, 59 | disable = {}, 60 | additional_vim_regex_highlighting = false, 61 | }, 62 | 63 | -- Note: i use another plugin (currently, syntax-tree-surfer) for moving through nodes once 64 | -- a selection has been started. 65 | incremental_selection = { 66 | enable = true, 67 | keymaps = { 68 | init_selection = "", 69 | node_incremental = "", 70 | scope_incremental = "", 71 | node_decremental = "", 72 | } 73 | }, 74 | 75 | indent = { 76 | enable = false, 77 | }, 78 | 79 | -- provided by nvim-treesitter-textobjects plugin 80 | textobjects = { 81 | select = { 82 | enable = true, 83 | 84 | -- automatically jump forward to textobj 85 | lookahead = true, 86 | 87 | keymaps = { 88 | ["aF"] = "@function.outer", 89 | ["iF"] = "@function.inner", 90 | ["ac"] = "@class.outer", 91 | ["ic"] = "@class.inner", 92 | ["ip"] = "@parameter.inner", 93 | ["ap"] = "@parameter.outer", 94 | 95 | ["iv"] = "@assignment.rhs", 96 | ["ik"] = "@assignment.lhs", 97 | ["in"] = "@number.inner", 98 | }, 99 | }, 100 | 101 | -- TODO: neovim provides mappings for jumping over functions 102 | -- [[, ]], [m, ]M, 103 | -- should i add these as text object movements, or keep them as nvim-provided? 104 | move = { 105 | enable = true, 106 | set_jumps = true, 107 | 108 | goto_next_start = { 109 | ["]a"] = "@parameter.inner", 110 | }, 111 | goto_next_end = { 112 | ["]A"] = "@parameter.outer", 113 | }, 114 | goto_previous_start = { 115 | ["[a"] = "@parameter.inner", 116 | }, 117 | goto_previous_end = { 118 | ["[A"] = "@parameter.outer", 119 | }, 120 | }, 121 | 122 | swap = { 123 | enable = true, 124 | 125 | swap_next = { 126 | ["a"] = "@parameter.inner", 127 | }, 128 | swap_previous = { 129 | ["A"] = "@parameter.inner", 130 | }, 131 | }, 132 | }, 133 | 134 | -- provided by p00f/nvim-ts-rainbow 135 | rainbow = { 136 | enable = true, 137 | extended_mode = true, 138 | }, 139 | 140 | -- built-in (:Inspect, :InspectTree, and :EditQuery) 141 | playground = { 142 | enable = true, 143 | disable = {}, 144 | updatetime = 25, 145 | persist_queries = false, 146 | keybindings = { 147 | toggle_query_editor = "o", 148 | toggle_hl_groups = "i", 149 | toggle_injected_languages = "t", 150 | toggle_anonymous_nodes = "a", 151 | toggle_language_display = "I", 152 | focus_language = "f", 153 | unfocus_language = "F", 154 | update = "R", 155 | goto_node = "", 156 | show_help = "?", 157 | }, 158 | }, 159 | 160 | -- lint playground queries 161 | query_linter = { 162 | enable = true, 163 | use_virtual_text = true, 164 | lint_events = { "InsertLeave" }, 165 | }, 166 | } 167 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/configs/treesj.lua: -------------------------------------------------------------------------------- 1 | local tsj = require("treesj") 2 | local tsj_utils = require("treesj.langs.utils") 3 | 4 | local opts = { 5 | both = { 6 | last_separator = false, 7 | }, 8 | join = { 9 | space_in_brackets = false, 10 | }, 11 | } 12 | 13 | tsj.setup({ 14 | langs = { 15 | python = { 16 | -- override defaults: when splitting params/args, ensure last arg 17 | -- has a trailing comma (cleaner diffs) 18 | parameters = tsj_utils.set_preset_for_list(opts), 19 | argument_list = tsj_utils.set_preset_for_list(opts), 20 | }, 21 | }, 22 | }) 23 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/core/autocmds.lua: -------------------------------------------------------------------------------- 1 | local cmd = vim.api.nvim_create_autocmd 2 | local group = vim.api.nvim_create_augroup 3 | local opts = { clear = true } 4 | 5 | -- ---- ---- ---- ---- ---- ---- ---- ---- 6 | -- ---- Vanilla autocmds 7 | -- ---- ---- ---- ---- ---- ---- ---- ---- 8 | 9 | -- copy unnamed register to system "+" reg after leaving vim 10 | -- this is better than clipboard+=unnamedplus: 11 | -- 1. Avoids copying register over every time it's written (slight perf hit) 12 | -- 2. Don't want my system clipboard copied **into** vim (can just meta-v paste) 13 | cmd({ "FocusLost", "VimLeavePre" }, 14 | { 15 | pattern = "*", 16 | callback = function () 17 | vim.fn.setreg('+', vim.fn.getreginfo('"')) 18 | end 19 | } 20 | ) 21 | cmd({ "FocusGained", "VimEnter" }, 22 | { 23 | pattern = "*", 24 | callback = function () 25 | -- somewhat of a WIP but mostly works as i want right now 26 | -- save the current unnamed register so we don't silently overwrite it 27 | -- hacky: 28 | local pre = "" 29 | local incoming = "" 30 | if vim.fn.getreginfo('"').regcontents then 31 | for _, k in pairs(vim.fn.getreginfo('"').regcontents) do 32 | pre = k 33 | end 34 | end 35 | if vim.fn.getreginfo('+').regcontents then 36 | for _, k in pairs(vim.fn.getreginfo('+').regcontents) do 37 | incoming = k 38 | end 39 | end 40 | 41 | if pre ~= incoming then 42 | vim.fn.setreg('h', vim.fn.getreginfo('"')) 43 | vim.fn.setreg('"', vim.fn.getreginfo('+')) 44 | end 45 | end 46 | } 47 | ) 48 | 49 | -- terminal behavior 50 | local group_term = group("TerminalBehavior", opts) 51 | cmd("TermOpen", 52 | { 53 | group = group_term, 54 | pattern = { "*" }, 55 | command = "setlocal nospell listchars= nonumber norelativenumber nowrap winfixheight winfixwidth noruler noshowmode", 56 | } 57 | ) 58 | cmd("TermOpen", 59 | { 60 | group = group_term, 61 | pattern = { "*" }, 62 | command = "startinsert", 63 | } 64 | ) 65 | cmd("TermClose", 66 | { 67 | group = group_term, 68 | pattern = { "*" }, 69 | command = "set showmode ruler", 70 | } 71 | ) 72 | -- EASYQUIT: quit help docs with just q 73 | cmd("FileType", 74 | { 75 | pattern = { "help" }, 76 | callback = function() 77 | vim.api.nvim_buf_set_keymap( 78 | 0, "n", "q", ":q", 79 | { noremap = true, silent = true } 80 | ) 81 | end, 82 | } 83 | ) 84 | 85 | -- save view, restore on open 86 | local group_view = group("SaveView", opts) 87 | cmd("BufWinLeave", 88 | { 89 | group = group_view, 90 | pattern = { "*.*" }, 91 | command = "mkview", 92 | } 93 | ) 94 | cmd("BufWinEnter", 95 | { 96 | group = group_view, 97 | pattern = { "*.*" }, 98 | command = "silent! loadview", 99 | } 100 | ) 101 | 102 | -- re-equalize splits on terminal resize 103 | cmd("VimResized", 104 | { 105 | pattern = {"*"}, 106 | command = "wincmd =", 107 | } 108 | ) 109 | 110 | -- test if this is still necessary - explicitly set rc file ft 111 | cmd("BufWinLeave", 112 | { 113 | pattern = "*rc", 114 | command = "set syntax=config", 115 | } 116 | ) 117 | 118 | 119 | -- ---- ---- ---- ---- ---- ---- ---- ---- 120 | -- ---- Plugin-provided autocmds 121 | -- ---- ---- ---- ---- ---- ---- ---- ---- 122 | 123 | -- update quickfix 124 | -- in addition to nvim-cmp []d bindings for moving, can still use []q from 125 | -- vim-unimpaired if that's more comfortable (see mappings) 126 | cmd("DiagnosticChanged", 127 | { 128 | pattern = "*", 129 | callback = function() vim.diagnostic.setqflist({open = false}) end, 130 | } 131 | ) 132 | 133 | -- auto-write changes to chezmoi files 134 | cmd("BufWritePost", 135 | { 136 | pattern = os.getenv('HOME') .. "/.local/share/chezmoi/*", 137 | -- :p resolves full path of file, :S does shell escape 138 | command = "!chezmoi apply --source-path :p:S", 139 | } 140 | ) 141 | 142 | 143 | local group_antlr = group("SetAntlr", { clear = true }) 144 | cmd({"BufRead", "BufNewFile"}, 145 | { 146 | group = group_antlr, 147 | pattern = {"*.g"}, 148 | command = "set filetype=antlr3", 149 | } 150 | ) 151 | cmd({"BufRead", "BufNewFile"}, 152 | { 153 | group = group_antlr, 154 | pattern = {"*.g4"}, 155 | command = "set filetype=antlr4", 156 | } 157 | ) 158 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/core/highlights.lua: -------------------------------------------------------------------------------- 1 | local highlight = function(name, val) 2 | vim.api.nvim_set_hl(0, name, val) 3 | end 4 | 5 | -- ---- ---- ---- ---- ---- ---- ---- ---- 6 | -- ---- Vanilla highlights 7 | -- ---- ---- ---- ---- ---- ---- ---- ---- 8 | 9 | -- for almost-quiet statusbar 10 | -- clear out the status line so it's not gray when we e.g. run a cmd with multi-line output 11 | highlight("StatusLine", { ctermfg = 1 }) 12 | 13 | -- see plugin/colorize-border.vim for augroups that recolor CursorLineNr on 14 | -- insert enter/leave 15 | highlight("CursorLineNr", { ctermfg = "white" }) 16 | 17 | highlight("Pmenu", { ctermbg = "black" }) 18 | -- " switch these two around 19 | highlight("PmenuSbar", { ctermfg = 8, ctermbg = 8, bg = "white" }) 20 | highlight("PmenuThumb", { ctermfg = 7, ctermbg = 7, bg = "grey" }) 21 | 22 | -- ---- ---- ---- ---- ---- ---- ---- ---- 23 | -- ---- Plugin-provided highlights 24 | -- ---- ---- ---- ---- ---- ---- ---- ---- 25 | 26 | -- noice 27 | -- by default these are linked to NonText, which is black text on a dark bg 28 | highlight("NoiceLspProgressTitle", { link = "String" }) 29 | 30 | -- nvim-treesitter 31 | -- wal colorscheme: https://github.com/dylanaraps/wal.vim/pull/34/files 32 | highlight("TSInclude", { ctermbg = "NONE", ctermfg = 5, bg = "NONE", fg = 5 }) 33 | highlight("TSNamespace", { ctermbg = "NONE", ctermfg = 4, bg = "NONE", fg = 4 }) 34 | highlight("TSRepeat", { ctermbg = "NONE", ctermfg = 5, bg = "NONE", fg = 5 }) 35 | highlight("TSOperator", { ctermbg = "NONE", ctermfg = 4, bg = "NONE", fg = 4 }) 36 | 37 | -- border color for any (mostly LSP) floating windows 38 | highlight("FloatBorder", { ctermbg = 0, ctermfg = 2 }) 39 | 40 | -- nvim-cmp 41 | -- Color settings for nvim-cmp completion menu items 42 | 43 | highlight("CmpItemAbbrDeprecated", { strikethrough = true, ctermfg = 7 }) 44 | 45 | highlight("CmpItemAbbrMatch", { ctermfg = 9 }) 46 | highlight("CmpItemAbbrMatchFuzzy", { ctermfg = 9 }) 47 | 48 | highlight("CmpItemKindFile", { link = "Constant" }) 49 | highlight("CmpItemKindFolder", { link = "Constant" }) 50 | highlight("CmpItemKindValue", { link = "Number" }) 51 | 52 | highlight("CmpItemKindConstant", { link = "Constant" }) 53 | highlight("CmpItemKindKeyword", { link = "Keyword" }) 54 | highlight("CmpItemKindProperty", { link = "Keyword" }) 55 | highlight("CmpItemKindOperator", { link = "TSOperator" }) 56 | 57 | highlight("CmpItemKindClass", { link = "Type" }) 58 | highlight("CmpItemKindModule", { link = "Type" }) 59 | highlight("CmpItemKindStruct", { link = "Type" }) 60 | 61 | highlight("CmpItemKindEnum", { link = "Structure" }) 62 | highlight("CmpItemKindEnumMember", { ctermfg = 1 }) 63 | 64 | -- link: Identifier but not bold 65 | highlight("CmpItemKindFunction", { ctermfg = 1 }) 66 | highlight("CmpItemKindMethod", { ctermfg = 1 }) 67 | highlight("CmpItemKindConstructor", { ctermfg = 1 }) 68 | highlight("CmpItemKindField", { ctermfg = 1 }) 69 | 70 | highlight("CmpItemKindVariable", { link = "String" }) 71 | highlight("CmpItemKindInterface", { link = "String" }) 72 | highlight("CmpItemKindText", { link = "String" }) 73 | 74 | highlight("CmpItemKindTypeParameter", { link = "Label" }) 75 | 76 | -- what this? 77 | highlight("CmpItemKindUnit", { ctermfg = 15 }) 78 | 79 | -- TODO? 80 | -- highlight link CmpItemKindSnippet 81 | -- highlight link CmpItemKindColor 82 | -- highlight link CmpItemKindReference 83 | -- highlight link CmpItemKindEvent 84 | 85 | -- colorful-winsep 86 | highlight("NvimSeparator", { ctermfg = 2 }) 87 | 88 | -- gitsigns 89 | -- make a changed line more obvious when diagnostics are on that line 90 | -- (this changes the line number color of the line) 91 | highlight("GitSignsChangeNr", { ctermfg = "white" }) 92 | highlight("GitSignsCurrentLineBlame", { link = "String" }) 93 | 94 | -- leap 95 | highlight("LeapBackdrop", { link = "Comment" }) 96 | highlight("LeapLabelPrimary", { ctermfg = "white", ctermbg = "black" }) 97 | highlight("LeapLabelSecondary", { ctermfg = "Red", ctermbg = "white" }) 98 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/core/options.lua: -------------------------------------------------------------------------------- 1 | -- from old dein plugins file (do i still want these settings?): 2 | -- set nocompatible 3 | -- filetype plugin on 4 | 5 | local options = { 6 | g = { 7 | -- vim-dadbod-ui 8 | db_ui_tmp_query_location = '~/.cache/nvim/queries/', 9 | }, 10 | 11 | opt = { 12 | relativenumber = true, 13 | number = true, 14 | 15 | expandtab = true, 16 | tabstop = 4, 17 | softtabstop = 4, 18 | shiftwidth = 4, 19 | 20 | -- allow mouse control 21 | mouse = "a", 22 | 23 | -- case-insensitive, smart search for /, ? 24 | ignorecase = true, 25 | smartcase = true, 26 | 27 | -- hide modified buffers (allow opening of new buffers if current is edited) 28 | hidden = true, 29 | 30 | -- autoread changes made outside vim 31 | autoread = true, 32 | 33 | -- persistent undo! 34 | undofile = true, 35 | 36 | -- spell check 37 | -- treesitter is used to only spell-check comments/strings 38 | spell = true, 39 | spelllang = "en_us", 40 | 41 | splitbelow = true, 42 | splitright = true, 43 | 44 | -- identify cursor line number visually 45 | -- cursorlineopt=both (line and number) is too much 46 | cursorline = true, 47 | cursorlineopt = "number", 48 | 49 | -- use system clipboard for + / * registers 50 | -- see autocmds for how clipboard is actually managed. 51 | -- clipboard = "unnamedplus", 52 | 53 | -- use conceal.nvim to hide keywords 54 | conceallevel = 2, 55 | }, 56 | } 57 | 58 | 59 | -- LSP Diagnostics - better signs 60 | local signs = { 61 | DiagnosticSignError = "x", 62 | DiagnosticSignWarn = "!", 63 | DiagnosticSignInfo = ">", 64 | DiagnosticSignHint = "?", 65 | } 66 | 67 | for name, icon in pairs(signs) do 68 | vim.fn.sign_define(name, { text = icon, texthl = name }) 69 | end 70 | 71 | 72 | --- Set vim options with a nested table like API with the format vim... 73 | -- @param options the nested table of vim options 74 | for scope, table in pairs(options) do 75 | for setting, value in pairs(table) do 76 | vim[scope][setting] = value 77 | end 78 | end 79 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/core/plugins_lazy.lua: -------------------------------------------------------------------------------- 1 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 2 | if not vim.loop.fs_stat(lazypath) then 3 | vim.fn.system({ 4 | "git", 5 | "clone", 6 | "--filter=blob:none", 7 | "https://github.com/folke/lazy.nvim.git", 8 | "--branch=stable", -- latest stable release 9 | lazypath, 10 | }) 11 | end 12 | vim.opt.rtp:prepend(lazypath) 13 | 14 | -- set mapleader before plugins are defined 15 | vim.g.mapleader = "," 16 | 17 | require("lazy").setup("plugins") 18 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/languages.lua: -------------------------------------------------------------------------------- 1 | -- ---- Language-specific syntax support, completions: 2 | 3 | local check_os = function(target) 4 | local uname = vim.api.nvim_command_output("!uname -s") 5 | if uname:find(target) then 6 | return true 7 | else 8 | return false 9 | end 10 | end 11 | 12 | return { 13 | -- vim wiki 14 | { 15 | "vimwiki/vimwiki", 16 | keys = { 17 | { "ww" }, 18 | { "2ww" }, 19 | }, 20 | init = function() 21 | vim.cmd([[ 22 | let wiki_1 = {} 23 | let wiki_1.path = '~/Dropbox/wiki/' 24 | "let wiki_1.html_template = '~/public_html/template.tpl' 25 | "let wiki_1.nested_syntaxes = {'python': 'python', 'c++': 'cpp'} 26 | 27 | let wiki_2 = {} 28 | let wiki_2.path = '~/Documents/Personal/work_wiki/' 29 | "let wiki_2.index = 'main' 30 | 31 | let g:vimwiki_list = [wiki_1, wiki_2] 32 | ]]) 33 | end, 34 | }, 35 | 36 | -- chezmoi templating/support 37 | "alker0/chezmoi.vim", 38 | 39 | -- sxhkd 40 | { 41 | "kovetskiy/sxhkd-vim", 42 | cond = check_os("Linux"), 43 | }, 44 | 45 | -- skhd 46 | { 47 | "amar1729/skhd-vim-syntax", 48 | ft = { "skhd" }, 49 | cond = check_os("Darwin"), 50 | }, 51 | 52 | -- database access + ui 53 | "tpope/vim-dadbod", 54 | "kristijanhusak/vim-dadbod-ui", 55 | 56 | -- nice completion of xhtml tags 57 | "tpope/vim-ragtag", 58 | 59 | -- antlr files (.g4 and .g3) 60 | "dylon/vim-antlr", 61 | 62 | -- powershell (ugh) 63 | { 64 | "PProvost/vim-ps1", 65 | ft = { "ps1" }, 66 | }, 67 | 68 | { 69 | "mfussenegger/nvim-jdtls", 70 | ft = { "java" }, 71 | config = function () require("configs.jdtls") end, 72 | }, 73 | } 74 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/lsp.lua: -------------------------------------------------------------------------------- 1 | -- ---- Language-Server Protocol (LSP) plugins + Completions (nvim-cmp) 2 | -- Some other language-specific things, such as snippets/skeletons 3 | -- Note: LSP functionality is built-in to neovim. these plugins simply enhance its ux 4 | -- ---- ---- ---- ---- ---- ---- 5 | 6 | return { 7 | -- standard configs for popular LSP servers 8 | { 9 | "neovim/nvim-lspconfig", 10 | dependencies = { 11 | { 12 | -- development settings for lua files under nvim root 13 | "folke/lazydev.nvim", 14 | ft = "lua", 15 | dependencies = { 16 | -- this is only for some vim submodules 17 | { "Bilal2453/luvit-meta", lazy = true }, 18 | { "justinsgithub/wezterm-types", lazy = true }, 19 | }, 20 | opts = { 21 | -- make sure to remove the .luarc.json, if you've created one from an older luals helper. 22 | library = { 23 | { path = "luvit-meta/library", words = { "vim%.uv" } }, 24 | { path = "wezterm-types", mods = { "wezterm" } }, 25 | }, 26 | }, 27 | }, 28 | { 29 | -- completion candidates for nvim-cmp 30 | "hrsh7th/cmp-nvim-lsp", 31 | }, 32 | -- provide virtual text inline type hints 33 | { 34 | "lvimuser/lsp-inlayhints.nvim", 35 | -- config = true, 36 | opts = { 37 | inlay_hints = { 38 | type_hints = { 39 | prefix = "<= ", 40 | }, 41 | highlight = "Comment", 42 | }, 43 | }, 44 | }, 45 | }, 46 | config = function () 47 | require("configs.lsp.view") 48 | require("configs.lsp.servers").setup() 49 | end, 50 | }, 51 | 52 | -- use vscode snips from friendly-snippets 53 | { 54 | "L3MON4D3/LuaSnip", 55 | event = { "InsertEnter", "CmdlineEnter" }, 56 | version = "v1.*", 57 | dependencies = { 58 | "rafamadriz/friendly-snippets", 59 | }, 60 | config = function() 61 | require("luasnip.loaders.from_vscode").lazy_load() 62 | 63 | -- custom snips 64 | require("configs.snippets") 65 | end, 66 | }, 67 | 68 | { 69 | "hrsh7th/nvim-cmp", 70 | event = { "InsertEnter", "CmdlineEnter" }, 71 | dependencies = { 72 | "hrsh7th/cmp-buffer", 73 | "hrsh7th/cmp-path", 74 | "hrsh7th/cmp-cmdline", 75 | "saadparwaiz1/cmp_luasnip", 76 | "kristijanhusak/vim-dadbod-completion", 77 | }, 78 | config = function() require("configs.cmp") end, 79 | }, 80 | 81 | -- skeleton files for common fts 82 | { 83 | "cvigilv/esqueleto.nvim", 84 | -- require dressing (nicer wrapper for vim.ui.select) 85 | -- but only when creating a new file 86 | dependencies = { "dressing.nvim" }, 87 | event = { "BufNewFile" }, 88 | opts = { 89 | directories = { "~/.config/nvim/templates/" }, 90 | patterns = { 91 | "LICENSE", 92 | "python", 93 | "sh", 94 | }, 95 | }, 96 | }, 97 | 98 | -- auto-popup signature_help while in insert mode inside a method's param list 99 | { 100 | "ray-x/lsp_signature.nvim", 101 | opts = { bind = true }, 102 | }, 103 | 104 | -- LSP-based previews, jumping 105 | { 106 | "DNLHC/glance.nvim", 107 | opts = { 108 | preview_win_opts = { 109 | relativenumber = false, 110 | }, 111 | border = { 112 | enable = true, 113 | } 114 | }, 115 | }, 116 | } 117 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/movement.lua: -------------------------------------------------------------------------------- 1 | -- ---- Movement 2 | 3 | return { 4 | -- many consistent bindings for movement and simple manipulations 5 | "tpope/vim-unimpaired", 6 | 7 | -- tmux/vim interop 8 | "christoomey/vim-tmux-navigator", 9 | 10 | -- move through CamelCase, snake_case words better 11 | { 12 | "chrisgrieser/nvim-spider", 13 | keys = { 14 | { 15 | "w", 16 | "lua require('spider').motion('w')", 17 | mode = { "n", "o", "x" }, 18 | }, 19 | { 20 | "e", 21 | "lua require('spider').motion('e')", 22 | mode = { "n", "o", "x" }, 23 | }, 24 | { 25 | "b", 26 | "lua require('spider').motion('b')", 27 | mode = { "n", "o", "x" }, 28 | }, 29 | { 30 | "ge", 31 | "lua require('spider').motion('ge')", 32 | mode = { "n", "o", "x" }, 33 | }, 34 | }, 35 | }, 36 | 37 | -- movement over treesitter nodes. 38 | -- very experimental, but seems promising. 39 | { 40 | "ziontee113/syntax-tree-surfer", 41 | config = true, 42 | }, 43 | 44 | -- digraph-based search through visible buffer 45 | { 46 | "ggandor/leap.nvim", 47 | config = function() 48 | -- bidirectional leap from normal mode 49 | vim.keymap.set('n', 's', '(leap)') 50 | vim.keymap.set('n', 'S', '(leap-from-window)') 51 | vim.keymap.set({'x', 'o'}, 's', '(leap-forward)') 52 | -- interferes with vim-surround 53 | -- vim.keymap.set({'x', 'o'}, 'S', '(leap-backward)') 54 | 55 | -- enter always repeats last search forward, backspace backward. 56 | require("leap.user").set_repeat_keys("", "") 57 | 58 | -- spoOky 59 | vim.keymap.set({ "n", "x", "o" }, "gs", function () 60 | require("leap.remote").action() 61 | end) 62 | 63 | -- auto-paste after spoOky yank 64 | vim.api.nvim_create_augroup('LeapRemote', {}) 65 | vim.api.nvim_create_autocmd('User', { 66 | pattern = 'RemoteOperationDone', 67 | group = 'LeapRemote', 68 | callback = function (event) 69 | -- Do not paste if some special register was in use. 70 | if vim.v.operator == 'y' and event.data.register == '"' then 71 | vim.cmd('normal! p') 72 | end 73 | end, 74 | }) 75 | 76 | vim.keymap.set({ "n", "x", "o" }, "ga", function () 77 | require("leap.treesitter").select() 78 | end, { desc = "Leap over TS Nodes" }) 79 | 80 | vim.keymap.set({ "n", "x", "o" }, "gA", 81 | 'Vlua require("leap.treesitter").select()', 82 | { desc = "Leap over TS Nodes (linewise)" } 83 | ) 84 | end, 85 | }, 86 | 87 | -- multi-line f/t 88 | { 89 | "ggandor/flit.nvim", 90 | opts = { 91 | labeled_modes = "n", 92 | special_keys = { 93 | repeat_search = { "" }, 94 | }, 95 | opts = { 96 | special_keys = { 97 | repeat_search = { "" }, 98 | } 99 | }, 100 | }, 101 | }, 102 | 103 | -- cool searching 104 | { 105 | "kevinhwang91/nvim-hlslens", 106 | keys = { 107 | "n", 108 | "N", 109 | "*", 110 | "#", 111 | "/", 112 | "?", 113 | }, 114 | opts = { 115 | calm_down = false, 116 | nearest_only = true, 117 | virt_priority = 10, 118 | }, 119 | }, 120 | 121 | -- easier movement through locations 122 | { 123 | "cbochs/portal.nvim", 124 | config = function () require("configs.portal") end, 125 | dependencies = { 126 | "cbochs/grapple.nvim", 127 | "ThePrimeagen/harpoon", 128 | }, 129 | }, 130 | } 131 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/repl.lua: -------------------------------------------------------------------------------- 1 | -- REPL / code-runner plugins. 2 | 3 | return { 4 | { 5 | "akinsho/toggleterm.nvim", 6 | version = "*", 7 | opts = { 8 | open_mapping = [[]] 9 | -- TODO: maybe add bindings for sending lines over? 10 | -- e.g. python to ipython, or bash lines in markdown 11 | }, 12 | }, 13 | 14 | { 15 | "rest-nvim/rest.nvim", 16 | dependencies = { 17 | "nvim-lua/plenary.nvim", 18 | "rcarriga/nvim-notify", 19 | }, 20 | ft = { "http" }, 21 | opts = true, 22 | }, 23 | 24 | -- silent conversion of notebooks to flat text 25 | { 26 | "goerz/jupytext.vim", 27 | init = function () 28 | vim.g.jupytext_fmt = "md" 29 | end, 30 | }, 31 | 32 | -- LSP / code running / file rendering in markdown 33 | { 34 | -- "quarto-dev/quarto-nvim", 35 | "benlubas/quarto-nvim", 36 | dependencies = { 37 | -- LSP for code embedded in other file formats (e.g. python in markdown) 38 | -- (should this have its own config???) 39 | "jmbuhr/otter.nvim", 40 | 41 | -- make sure LSP niceties are loaded (is this a dep cycle?) 42 | "hrsh7th/nvim-cmp", 43 | "neovim/nvim-lspconfig", 44 | "nvim-treesitter/nvim-treesitter", 45 | -- hydra 46 | }, 47 | ft = { "quarto", "markdown" }, 48 | config = function () 49 | local quarto = require("quarto") 50 | quarto.setup({ 51 | lspFeatures = { 52 | languages = { "python", "rust" }, 53 | chunks = "all", 54 | diagnostics = { 55 | enabled = true, 56 | triggers = { "BufWritePost" }, 57 | }, 58 | completion = { 59 | enabled = true, 60 | }, 61 | }, 62 | keymap = { 63 | hover = "K", 64 | definition = "gd", 65 | rename = "r", 66 | references = "gr", 67 | format = "f", 68 | }, 69 | codeRunner = { 70 | enabled = true, 71 | ft_runners = { 72 | -- not installed yet 73 | bash = "slime", 74 | }, 75 | default_method = "molten", 76 | }, 77 | }) 78 | 79 | -- TODO 80 | -- vim.api.nvim_create_autocmd("FileType", { 81 | -- pattern = "markdown", 82 | -- callback = function () 83 | -- print("changed type") 84 | -- end, 85 | -- }) 86 | 87 | -- todo: copy over a bunch of keymaps 88 | vim.keymap.set("n", "qp", quarto.quartoPreview, { desc = "Preview the Quarto document", silent = true, noremap = true }) 89 | vim.keymap.set("n", "cc", "i```{}\r```", { desc = "Create new code cell", silent = true }) 90 | end, 91 | }, 92 | 93 | -- help with jupyter notebooks 94 | { 95 | "benlubas/molten-nvim", 96 | build = ":UpdateRemotePlugins", 97 | keys = { 98 | -- my own keybinds for initialization 99 | { "mi", }, 100 | { "ir", }, 101 | }, 102 | dependencies = { 103 | -- depends on jupytext converting .ipynb files on open. 104 | "goerz/jupytext.vim", 105 | 106 | -- depends on quarto to provide lsp/code running in markdown (output of jupytext) 107 | -- (make sure to use same quarto repo as above) 108 | "benlubas/quarto-nvim", 109 | 110 | -- lua imagemagick rock kind of broken on arm mac rn. disabling. 111 | -- { 112 | -- "3rd/image.nvim", 113 | -- -- additional opts that are required within molten 114 | -- opts = { 115 | -- max_width = 100, 116 | -- max_height = 12, 117 | -- max_height_window_percentage = math.huge, 118 | -- max_width_window_percentage = math.huge, 119 | -- window_overlap_clear_enabled = true, 120 | -- window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "" }, 121 | -- }, 122 | -- }, 123 | }, 124 | init = function () 125 | -- load the install imagemagick luarock (for image.nvim) 126 | -- doesn't seem to work anymore. 127 | -- package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?/init.lua;" 128 | -- package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?.lua;" 129 | 130 | vim.g.molten_auto_open_output = true 131 | -- vim.g.molten_image_provider = "image.nvim" 132 | vim.g.molten_output_crop_border = true 133 | 134 | vim.g.molten_output_win_max_height = 40 135 | -- vim.g.molten_virt_text_output = true 136 | vim.g.molten_use_border_highlights = true 137 | -- vim.g.molten_virt_lines_off_by_1 = true 138 | vim.g.molten_wrap_output = true 139 | 140 | vim.keymap.set("n", "mi", ":MoltenInit", { desc = "Initialize Molten", silent = true }) 141 | vim.keymap.set("n", "ir", function () 142 | local venv = os.getenv("VIRTUAL_ENV") 143 | if venv ~= nil then 144 | venv = string.match(venv, "/.+/(.+)") 145 | vim.cmd(("MoltenInit %s"):format(venv)) 146 | else 147 | vim.cmd("MoltenInit python3") 148 | end 149 | end, { desc = "Initialize Molten for python3", silent = true, noremap = true }) 150 | 151 | vim.api.nvim_create_autocmd("User", { 152 | pattern = "MoltenInitPost", 153 | callback = function () 154 | -- change some vim settings 155 | vim.opt.conceallevel = 0 156 | vim.cmd [[ TSContextDisable ]] 157 | 158 | -- ... always just activate quarto? 159 | require("quarto").activate() 160 | vim.notify("Quarto activated.") -- maybe put this in a pcall w/ .activate() to actually check if we're good 161 | 162 | local r = require("quarto.runner") 163 | vim.keymap.set("n", "rc", r.run_cell, { desc = "run cell", silent = true }) 164 | vim.keymap.set("n", "rA", r.run_all, { desc = "run all cells", silent = true }) 165 | 166 | vim.keymap.set("n", "", ":noautocmd MoltenHideOutput", { desc = "Close output window", silent = true }) 167 | 168 | vim.keymap.set("n", "]x", ":noautocmd MoltenNext", { desc = "Next Molten Cell", silent = true }) 169 | vim.keymap.set("n", "[x", ":noautocmd MoltenPrev", { desc = "Previous Molten Cell", silent = true }) 170 | end, 171 | }) 172 | end, 173 | }, 174 | } 175 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/text-manipulation.lua: -------------------------------------------------------------------------------- 1 | -- ---- Text Manipulation 2 | -- plugins roughly ordered in terms of how "important" they are to every-day use 3 | 4 | return { 5 | -- for surrounding phrases with characters 6 | -- "tpope/vim-surround", 7 | { 8 | "kylechui/nvim-surround", 9 | config = true, 10 | }, 11 | 12 | { 13 | "altermo/ultimate-autopair.nvim", 14 | event = { "InsertEnter", "CmdlineEnter" }, 15 | branch = "v0.6", 16 | enabled = true, 17 | opts = { 18 | { "<", ">", ft = { "rust" } }, 19 | { "|", "|", ft = { "rust" } }, 20 | }, 21 | }, 22 | 23 | { 24 | -- this plugin can't seem to do rust || very well. 25 | -- also, it doesn't auto-do mirrored spaces between pairs. 26 | "windwp/nvim-autopairs", 27 | event = "InsertEnter", 28 | enabled = false, 29 | config = function () 30 | local autopairs = require("nvim-autopairs") 31 | local Rule = require("nvim-autopairs.rule") 32 | local cond = require("nvim-autopairs.conds") 33 | 34 | autopairs.setup({}) 35 | 36 | autopairs.add_rules { 37 | -- autopair<> 38 | -- all languages? or just xml/langs w/ <> generics? 39 | Rule("<", ">") 40 | :with_pair(cond.before_regex("%a+")) 41 | :with_move(function (opts) 42 | return opts.char == ">" 43 | end), 44 | -- autopair|| <-- this one might be buggy? oh well 45 | Rule("|", "|", "rust") 46 | -- match letters or open parens 47 | :with_pair(cond.before_regex("[%a(]+")) 48 | :with_move(function (opts) 49 | return opts.char == "|" 50 | end), 51 | } 52 | end, 53 | }, 54 | 55 | -- undotree visualization/movement 56 | "mbbill/undotree", 57 | 58 | -- TS structural search and replace 59 | "cshuaimin/ssr.nvim", 60 | 61 | -- TS-aware commenting 62 | { 63 | "numToStr/Comment.nvim", 64 | config = true, 65 | }, 66 | 67 | -- TS-aware split/join 68 | { 69 | "Wansmer/treesj", 70 | config = function() require "configs.treesj" end, 71 | }, 72 | 73 | -- c-a/c-x for time/dates 74 | "tpope/vim-speeddating", 75 | 76 | -- c-a/c-x for common strings (true/false, yes/no, colors) 77 | { 78 | "nat-418/boole.nvim", 79 | opts = { 80 | mappings = { 81 | increment = "", 82 | decrement = "", 83 | }, 84 | allow_caps_additions = { 85 | -- full month names, full day names, day abbrevs handled by boole 86 | { "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec" }, 87 | 88 | -- English numbers 89 | { "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "zero" }, 90 | }, 91 | }, 92 | }, 93 | 94 | -- handy docstring generator 95 | { 96 | "danymat/neogen", 97 | -- dependencies = "nvim-treesitter/nvim-treesitter", 98 | config = function () 99 | require("neogen").setup({ 100 | -- can't quite get the snippets to expand properly right now... 101 | -- snippet_engine = "luasnip", 102 | }) 103 | end, 104 | }, 105 | 106 | -- auto-convert strings to/from f-strings/template strings 107 | { 108 | "chrisgrieser/nvim-puppeteer", 109 | dependencies = "nvim-treesitter/nvim-treesitter", 110 | lazy = false, 111 | ft = { "python", "javascript", "typescript" }, 112 | }, 113 | 114 | -- highlight things that change between undos 115 | { 116 | "tzachar/highlight-undo.nvim", 117 | opts = { 118 | duration = 800, 119 | undo = { 120 | hlgroup = "Normal", 121 | }, 122 | redo = { 123 | hlgroup = "Normal", 124 | }, 125 | }, 126 | }, 127 | } 128 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/treesitter.lua: -------------------------------------------------------------------------------- 1 | -- ---- Tree-Sitter 2 | 3 | return { 4 | -- use tree-sitter for language features 5 | { 6 | "nvim-treesitter/nvim-treesitter", 7 | build = ":TSUpdate", 8 | config = function() require "configs.treesitter" end, 9 | dependencies = { 10 | { 11 | "IndianBoy42/tree-sitter-just", 12 | config = true, 13 | }, 14 | }, 15 | }, 16 | 17 | "nvim-treesitter/nvim-treesitter-context", 18 | "nvim-treesitter/nvim-treesitter-textobjects", 19 | 20 | -- more textobjects 21 | { 22 | "echasnovski/mini.ai", 23 | main = "mini.ai", 24 | config = true, 25 | }, 26 | 27 | -- more textobjects 28 | { 29 | "chrisgrieser/nvim-various-textobjs", 30 | -- not a dependency for functionality: used for opening a gx link in browser but i use this only for the quick-opening of links for gx 31 | dependencies = { 32 | { 33 | "axieax/urlview.nvim", 34 | opts = { default_action = "system" }, 35 | }, 36 | }, 37 | opts = { 38 | useDefaultKeymaps = true, 39 | disabledKeymaps = { "r" }, 40 | }, 41 | }, 42 | 43 | -- pair highlighting 44 | { 45 | "https://gitlab.com/HiPhish/rainbow-delimiters.nvim", 46 | name = "rainbow-delimiters.nvim", 47 | url = "https://gitlab.com/HiPhish/rainbow-delimiters.nvim", 48 | -- TODO: doesn't update <> or || pairs (e.g. for rust) 49 | }, 50 | 51 | -- conceal (horizontally fold) keywords 52 | { 53 | "Jxstxs/conceal.nvim", 54 | build = ":lua require'conceal'.generate_conceals()", 55 | dependencies = { "nvim-treesitter/nvim-treesitter" }, 56 | -- default: lua and python are enabled (and a few c keywords) 57 | opts = {}, 58 | }, 59 | } 60 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/ui.lua: -------------------------------------------------------------------------------- 1 | -- ---- Theming and UI changes 2 | 3 | ---@param name string 4 | ---@param opts table (see nvim_set_hl) 5 | local update_highlight = function (name, opts) 6 | local hl = vim.api.nvim_get_hl(0, { name = name }) 7 | while hl and hl.link do 8 | hl = vim.api.nvim_get_hl(0, { name = hl.link }) 9 | end 10 | hl = vim.tbl_deep_extend("force", hl, opts) 11 | vim.api.nvim_set_hl(0, name, hl) 12 | end 13 | 14 | return { 15 | -- for some reason, setting termguicolors in tmux suks 16 | -- so for now i'm "stuck" on making updates to this 8-bit colorscheme 17 | { 18 | "dylanaraps/wal.vim", 19 | lazy = true, 20 | init = function () 21 | vim.opt.termguicolors = false 22 | vim.cmd.colorscheme("wal") 23 | 24 | -- overrides 25 | update_highlight("Comment", { italic = true }) 26 | update_highlight("DiagnosticVirtualTextOk", { italic = true }) 27 | update_highlight("DiagnosticVirtualTextHint", { italic = true }) 28 | update_highlight("DiagnosticVirtualTextInfo", { italic = true }) 29 | update_highlight("DiagnosticVirtualTextWarn", { italic = true }) 30 | update_highlight("DiagnosticVirtualTextError", { italic = true }) 31 | 32 | -- clear out the defaults from the new default colorscheme 33 | -- (I'm sure there's a better way to do this?) 34 | -- NVIM v0.10.0-dev-1746+g5651c1ff2 35 | -- this is not a great solution because some groups just get cleared back to Normal... 36 | update_highlight("@method.call.lua", {}) 37 | update_highlight("@lsp.type.method.lua", {}) 38 | update_highlight("@lsp.type.function.lua", {}) 39 | update_highlight("@method.call.python", {}) 40 | update_highlight("@method.python", {}) 41 | end 42 | }, 43 | 44 | -- don't use either of these anymore, but they're nice 45 | -- {"morhetz/gruvbox"} 46 | -- {"cpea2506/one_monokai.nvim"} 47 | -- {"rose-pine/neovim"} 48 | 49 | -- statusline 50 | { 51 | "nvim-lualine/lualine.nvim", 52 | config = function() require("configs.lualine") end, 53 | }, 54 | 55 | -- use oil instead for file exploration? 56 | { 57 | "stevearc/oil.nvim", 58 | opts = { 59 | keymaps = { 60 | ["yp"] = { 61 | desc = "Copy filepath to system clipboard", 62 | callback = function () 63 | require("oil.actions").copy_entry_path.callback() 64 | -- setreg not required i think(?) because i use autocmds for clipboard syncing. 65 | -- vim.fn.setreg("+", vim.fn.getreg(vim.v.register)) 66 | end, 67 | }, 68 | }, 69 | default_file_explorer = true, 70 | columns = { 71 | "icon", 72 | "size", 73 | } 74 | }, 75 | dependencies = { "nvim-tree/nvim-web-devicons" }, 76 | }, 77 | 78 | -- re-color window split borders 79 | { 80 | "nvim-zh/colorful-winsep.nvim", 81 | opts = { 82 | highlight = { ctermfg = 2 }, 83 | }, 84 | }, 85 | 86 | { 87 | "shellRaining/hlchunk.nvim", 88 | opts = { 89 | -- could modify these if I want to restrain hlchunk from certain languages? 90 | -- chunk = { support_filetypes = {}, exclude_filetypes = {} }, 91 | indent = { enable = false }, 92 | line_num = { enable = false }, 93 | blank = { enable = false }, 94 | }, 95 | }, 96 | 97 | -- nicer vim.ui.{input,select} (helpful when using noice, which changes UI a lot) 98 | { 99 | "stevearc/dressing.nvim", 100 | event = "VeryLazy", 101 | opts = { 102 | input = { enabled = false }, 103 | }, 104 | }, 105 | 106 | -- experiment with noice 107 | { 108 | "folke/noice.nvim", 109 | dependencies = { 110 | "MunifTanjim/nui.nvim", 111 | { 112 | "rcarriga/nvim-notify", 113 | opts = { 114 | -- override notify to use my settings for floating windows. 115 | on_open = function (win) 116 | local config = vim.api.nvim_win_get_config(win) 117 | config.border = "single" 118 | vim.api.nvim_win_set_config(win, config) 119 | end, 120 | }, 121 | }, 122 | }, 123 | opts = { 124 | views = { 125 | -- use square borders for noice dialogs 126 | cmdline_popup = { border = { style = "single" } }, 127 | hover = { border = { style = "single" } }, 128 | popupmenu = { border = { style = "single" } }, 129 | }, 130 | 131 | routes = { 132 | { 133 | -- hide buf written messages 134 | filter = { 135 | event = "msg_show", 136 | kind = "", 137 | find = "written", 138 | }, 139 | opts = { skip = true }, 140 | }, 141 | { 142 | -- shut up i'm not using termguicolors until i figure out wal.vim 143 | filter = { 144 | find = "Opacity changes require termguicolors to be set.", 145 | }, 146 | opts = { skip = true }, 147 | }, 148 | { 149 | -- ignore hlchunk complaining about missing parsers 150 | filter = { 151 | find = "no parser for", 152 | }, 153 | opts = { skip = true }, 154 | } 155 | }, 156 | 157 | lsp = { 158 | signature = { 159 | enabled = false, 160 | }, 161 | }, 162 | 163 | presets = { 164 | command_palette = true, 165 | long_message_to_split = true, 166 | lsp_doc_border = true, 167 | }, 168 | }, 169 | }, 170 | 171 | -- animation of common actions (cursor movement, scroll, window open/close/resize) 172 | { 173 | "echasnovski/mini.animate", 174 | opts = { 175 | scroll = { enable = false }, 176 | resize = { enable = false }, 177 | }, 178 | }, 179 | } 180 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/ux.lua: -------------------------------------------------------------------------------- 1 | -- ---- UX changes and add-ons 2 | 3 | return { 4 | -- repeat motions from plugins and elsewhere 5 | "tpope/vim-repeat", 6 | 7 | -- telescope - arbitrary fuzzy-searching over lists (e.g. buffers or files in workspace) 8 | { 9 | "nvim-telescope/telescope.nvim", 10 | -- version = "0.1.x", 11 | cmd = "Telescope", 12 | dependencies = { 13 | "nvim-lua/plenary.nvim", 14 | 15 | -- search luasnip snippets from inside telescope 16 | { 17 | "benfowler/telescope-luasnip.nvim", 18 | config = function () 19 | require("telescope").load_extension("luasnip") 20 | end, 21 | }, 22 | 23 | -- much better alternative to fuzzy-picker 24 | -- essentially a wrapper over ripgrep, that allows for simple fuzzy searching and file extension filtering. 25 | { 26 | "fdschmidt93/telescope-egrepify.nvim", 27 | dependencies = { "nvim-lua/plenary.nvim" }, 28 | }, 29 | 30 | -- slightly faster compiled fzf 31 | { 32 | "nvim-telescope/telescope-fzf-native.nvim", 33 | -- README says 'make' but it didn't seem to work 34 | -- build = "make", 35 | build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build", 36 | config = function () 37 | require("telescope").load_extension("fzf") 38 | end 39 | }, 40 | 41 | -- jump across edit locations 42 | "bloznelis/before.nvim", 43 | }, 44 | config = function() require "configs.telescope" end, 45 | }, 46 | 47 | -- git signs in gutter, management of hunks ;) and simple diff views 48 | { 49 | "lewis6991/gitsigns.nvim", 50 | config = function() require "configs.gitsigns" end, 51 | }, 52 | 53 | -- better viewer for git history, git diffs 54 | { 55 | "sindrets/diffview.nvim", 56 | dependencies = { "nvim-lua/plenary.nvim" }, 57 | opts = { use_icons = false }, 58 | }, 59 | 60 | -- use git from inside vim (e.g. `:Git commit`) 61 | { 62 | "tpope/vim-fugitive", 63 | 64 | -- telescope disables Netrw, which is required by GBrowse. 65 | -- here, we define our own Browse command. 66 | init = function () 67 | vim.api.nvim_create_user_command( 68 | "Browse", 69 | function (opts) 70 | -- NOTE: should be "xdg-open" on Linux. 71 | vim.fn.system { "open", opts.fargs[1] } 72 | end, 73 | { nargs = 1 } 74 | ) 75 | end, 76 | 77 | dependencies = { 78 | -- gbrowse: github provider (among other things?) 79 | "tpope/vim-rhubarb", 80 | 81 | -- gbrowse: gitlab provider 82 | { 83 | "shumphrey/fugitive-gitlab.vim", 84 | init = function () 85 | vim.g.fugitive_gitlab_domains = { 86 | ["ssh://gitlab.institution.edu"] = "https://gitlab.institution.edu", 87 | } 88 | end, 89 | }, 90 | }, 91 | }, 92 | 93 | -- advanced git search: fuzzily find/compare file/selection against git history 94 | { 95 | -- all these plugins are configured above 96 | "aaronhallaert/advanced-git-search.nvim", 97 | dependencies = { 98 | -- depends on this for its picker UI 99 | "nvim-telescope/telescope.nvim", 100 | -- depends on this for some internal git operations 101 | "tpope/vim-fugitive", 102 | -- optionally depends on this for diff view 103 | "sindrets/diffview.nvim", 104 | }, 105 | }, 106 | 107 | -- auto-saves yanked text, and offers viewing+selection of previous yanks. 108 | { 109 | "AckslD/nvim-neoclip.lua", 110 | opts = { 111 | enable_persistent_history = true, 112 | }, 113 | dependencies = { 114 | "kkharji/sqlite.lua", 115 | }, 116 | }, 117 | 118 | -- better dealing with folds 119 | -- TODO: maybe set foldmethod to something else if i'm going to use this? 120 | { 121 | "chrisgrieser/nvim-origami", 122 | event = "BufReadPost", -- later or on keypress would prevent saving folds 123 | opts = true, -- needed even when using default config 124 | }, 125 | } 126 | -------------------------------------------------------------------------------- /dot_config/nvim/plugin/colorize-border.vim: -------------------------------------------------------------------------------- 1 | " change colors of window border when entering/leaving insert mode 2 | " generally requires interaction with window manager + support for colored 3 | " window borders 4 | 5 | " white "0xffebdbb2" 6 | " red "0xccd75f5f" 7 | " green "0xcc98971a" 8 | 9 | let s:color_wht = "0xffebdbb2" 10 | let s:color_red = "0xccd75f5f" 11 | 12 | let s:os_type = system("uname -s") 13 | 14 | " yabai, on darwin 15 | let s:cmd = "yabai -m config active_window_border_color" 16 | 17 | " TODO: bspwm, on linux 18 | 19 | function ColorizeBorder() 20 | if s:os_type =~ "Darwin" 21 | silent! execute("!" . s:cmd . " " . s:color_red) 22 | else 23 | echom "not implemented for Linux" 24 | endif 25 | endfunction 26 | 27 | function UnColorizeBorder() 28 | if s:os_type =~ "Darwin" 29 | silent! execute("!" . s:cmd . " " . s:color_wht) 30 | else 31 | echom "not implemented for Linux" 32 | endif 33 | endfunction 34 | 35 | augroup change_borders 36 | autocmd! 37 | autocmd InsertEnter * :call ColorizeBorder() 38 | autocmd InsertLeave * :call UnColorizeBorder() 39 | augroup END 40 | -------------------------------------------------------------------------------- /dot_config/nvim/plugin/colorize-cursor.vim: -------------------------------------------------------------------------------- 1 | " Recolor the cursor's line number when you enter/leave insert mode. 2 | " 3 | " Based off of: 4 | " https://stackoverflow.com/questions/15561132/run-command-when-vim-enters-visual-mode 5 | 6 | " as of nvim (version?), requires cursorline and at least cursorlineopt=number 7 | 8 | " guifg lines are disabled, since my current colorscheme only uses termcolors 9 | 10 | function! ReturnHighlightTerm(group, term) 11 | " Store output of group to variable 12 | let l:output = execute('hi ' . a:group) 13 | 14 | " Find the term we're looking for 15 | return matchstr(output, a:term.'=\zs\S*') 16 | endfunction 17 | 18 | function! CursorLineNrColorInsert(mode) 19 | " Insert mode: blue 20 | if a:mode == "i" 21 | highlight CursorLineNr ctermfg=1 22 | " highlight CursorLineNr guifg=#268bd2 23 | 24 | " Replace mode: red 25 | elseif a:mode == "r" 26 | highlight CursorLineNr ctermfg=4 27 | " highlight CursorLineNr guifg=#dc322f 28 | 29 | else 30 | highlight CursorLineNr ctermfg=0 31 | " highlight CursorLineNr guifg=#073642 32 | 33 | endif 34 | endfunction 35 | 36 | let s:backup_term = ReturnHighlightTerm("CursorLineNr", "ctermfg") 37 | " let s:backup_gui = ReturnHighlightTerm("CursorLineNr", "guifg") 38 | 39 | augroup colorize_cursor 40 | autocmd! 41 | autocmd InsertEnter * call CursorLineNrColorInsert(v:insertmode) 42 | autocmd InsertLeave * :execute "highlight CursorLineNr ctermfg=" . s:backup_term 43 | " autocmd InsertLeave * :execute "highlight CursorLineNr guifg=" . s:backup_gui 44 | augroup END 45 | -------------------------------------------------------------------------------- /dot_config/nvim/templates/LICENSE/MIT: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) [year] [fullname] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /dot_config/nvim/templates/LICENSE/Unlicensed: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /dot_config/nvim/templates/python/main.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python3 2 | 3 | 4 | def main(): 5 | pass 6 | 7 | 8 | if __name__ == "__main__": 9 | main() 10 | -------------------------------------------------------------------------------- /dot_config/nvim/templates/sh/main.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | set -ex 4 | 5 | # get directory of script 6 | SCRIPT_DIR=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) 7 | 8 | # set FOO to value of FOO from env if exists, otherwise "defaultvalue" 9 | FOO="${FOO:-defaultvalue}" 10 | 11 | main () { 12 | return 0 13 | } 14 | 15 | main "$@" 16 | -------------------------------------------------------------------------------- /dot_config/packages/Brewfile: -------------------------------------------------------------------------------- 1 | tap "amar1729/formulae", "https://github.com/Amar1729/homebrew-formulae.git" 2 | tap "amar1729/gomuks", "https://github.com/Amar1729/homebrew-gomuks.git" 3 | tap "baskerville/formulae" 4 | tap "beeftornado/rmtree" 5 | tap "homebrew/bundle" 6 | tap "homebrew/cask" 7 | tap "homebrew/cask-drivers" 8 | tap "homebrew/cask-versions" 9 | tap "homebrew/core" 10 | tap "homebrew/services" 11 | tap "khanhas/tap" 12 | tap "koekeishiya/formulae" 13 | tap "martido/graph" 14 | brew "python@3.9" 15 | brew "antibody" 16 | brew "asciidoc" 17 | brew "asciinema" 18 | brew "asciiquarium" 19 | brew "bat" 20 | brew "binutils" 21 | brew "borgbackup" 22 | brew "chezmoi" 23 | brew "libmagic" 24 | brew "clang-format" 25 | brew "cmatrix" 26 | brew "ffmpeg" 27 | brew "colordiff" 28 | brew "diffutils" 29 | brew "exa" 30 | brew "exiftool" 31 | brew "fd" 32 | brew "ffmpeg" 33 | brew "findutils" 34 | brew "fzf" 35 | brew "gdb" 36 | brew "gh" 37 | brew "gist" 38 | brew "git" 39 | brew "git-filter-repo" 40 | brew "git-lfs" 41 | brew "gnupg" 42 | brew "gnu-sed" 43 | brew "gnu-tar" 44 | brew "gource" 45 | brew "graphviz" 46 | brew "grep" 47 | brew "grip" 48 | brew "hashcat" 49 | brew "htop" 50 | brew "imagemagick" 51 | brew "ipython" 52 | brew "jq" 53 | brew "libmagic" 54 | brew "lynx" 55 | brew "moreutils" 56 | brew "mosh" 57 | brew "mps-youtube" 58 | brew "youtube-dl" 59 | brew "mpv" 60 | brew "ncdu" 61 | brew "neofetch" 62 | brew "neovim" 63 | brew "open-completion" 64 | brew "openssh" 65 | brew "pass" 66 | brew "pdfgrep" 67 | brew "pinentry-mac" 68 | brew "pipes-sh" 69 | brew "pipx" 70 | brew "poetry" 71 | brew "pv" 72 | brew "pwgen" 73 | brew "reattach-to-user-namespace" 74 | brew "ripgrep" 75 | brew "shellcheck" 76 | brew "ssh-copy-id", link: true 77 | brew "terminal-notifier" 78 | brew "tig" 79 | brew "tmux" 80 | brew "ttyplot" 81 | brew "universal-ctags" 82 | brew "wget" 83 | brew "zsh" 84 | brew "zsh-completions" 85 | brew "amar1729/formulae/browserpass" 86 | brew "amar1729/formulae/pinentry-prefer-tty" 87 | brew "amar1729/formulae/snake", args: ["HEAD"] 88 | brew "amar1729/formulae/wp", args: ["HEAD"] 89 | brew "amar1729/gomuks/gomuks" 90 | brew "khanhas/tap/spicetify-cli" 91 | brew "koekeishiya/formulae/skhd" 92 | brew "koekeishiya/formulae/yabai" 93 | cask "adoptopenjdk" 94 | cask "alacritty" 95 | cask "atom" 96 | cask "firefox" 97 | cask "harmony" 98 | cask "karabiner-elements" 99 | cask "keepingyouawake" 100 | cask "keycastr" 101 | cask "mendeley" 102 | cask "telegram-desktop" 103 | cask "tidal" 104 | cask "transmission" 105 | cask "treesheets" 106 | cask "xquartz" 107 | -------------------------------------------------------------------------------- /dot_config/packages/Brewfile-personal: -------------------------------------------------------------------------------- 1 | tap "amar1729/deluge-meta", "https://github.com/Amar1729/homebrew-deluge-meta.git" 2 | tap "amar1729/pprng", "https://github.com/amar1729/homebrew-pprng.git" 3 | tap "gromgit/fuse" 4 | brew "flac" 5 | brew "cmus" 6 | brew "djvulibre" 7 | brew "e2fsprogs" 8 | brew "go" 9 | brew "lnav" 10 | brew "mdbook" 11 | brew "mktorrent" 12 | brew "mpc" 13 | brew "mpd" 14 | brew "ncmpcpp" 15 | brew "rtorrent" 16 | brew "rustup-init" 17 | brew "sshfs" 18 | brew "weechat" 19 | brew "amar1729/deluge-meta/deluge-meta" 20 | brew "amar1729/formulae/endoh1" 21 | brew "amar1729/formulae/pacwall", args: ["HEAD"] 22 | brew "gromgit/fuse/ext4fuse-mac" 23 | brew "gromgit/fuse/ntfs-3g-mac" 24 | cask "discord" 25 | cask "element" 26 | cask "iina" 27 | cask "keybase" 28 | cask "signal" 29 | cask "syncthing" 30 | cask "vlc" 31 | -------------------------------------------------------------------------------- /dot_config/packages/Brewfile-work: -------------------------------------------------------------------------------- 1 | tap "amar1729/libguestfs", "https://github.com/Amar1729/homebrew-libguestfs.git" 2 | tap "amar1729/ovftool", "https://github.com/Amar1729/homebrew-ovftool.git" 3 | tap "mongodb/brew" 4 | brew "ansible" 5 | brew "docker-completion" 6 | brew "infer" 7 | brew "amar1729/formulae/matterhorn" 8 | brew "amar1729/libguestfs/libguestfs" 9 | brew "mongodb/brew/mongodb-community" 10 | cask "adoptopenjdk8" 11 | cask "basictex" 12 | cask "beekeeper-studio" 13 | cask "camunda-modeler" 14 | brew "cloc" 15 | brew "cppcheck" 16 | brew "httpie" 17 | brew "neomutt" 18 | brew "pyenv" 19 | cask "db-browser-for-sqlite" 20 | cask "docker" 21 | cask "libreoffice" 22 | cask "ovftool" 23 | cask "vagrant" 24 | cask "zoom" 25 | -------------------------------------------------------------------------------- /dot_config/packages/pipx.txt: -------------------------------------------------------------------------------- 1 | black 2 | black-macchiato 3 | flake8 4 | mypy 5 | git+git://github.com/dylanaraps/pywal.git 6 | tox 7 | virtualenv 8 | vulture 9 | -------------------------------------------------------------------------------- /dot_config/packages/windows.bat: -------------------------------------------------------------------------------- 1 | REM install chocolatey: 2 | Set-ExecutionPolicy Bypass -Scope Process -Force; ` 3 | >> iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) 4 | 5 | REM (this is a comment) 6 | REM consider running this for make: 7 | REM choco install gnumake 8 | 9 | REM install openssh server and enable port 22 10 | New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH SSH Server' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 11 | 12 | Add-WindowsCapability -Online -Name OpenSSH.Server* 13 | 14 | REM start this shit on boot 15 | Set-Service -name sshd -StartupType Automatic 16 | 17 | REM install some other helpful stuff: 18 | choco install git 19 | 20 | REM disable hyper-v if you want to run docker stuff 21 | REM Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Hypervisor 22 | REM check on this: might not be the one you want to install 23 | REM choco install docker-toolbox 24 | -------------------------------------------------------------------------------- /dot_config/picom/picom.conf: -------------------------------------------------------------------------------- 1 | 2 | opacity-rule = [ 3 | "35:class_g = 'Bspwm' && class_i = 'presel_feedback'" 4 | ] 5 | -------------------------------------------------------------------------------- /dot_config/private_karabiner/scripts/README.md: -------------------------------------------------------------------------------- 1 | # Karabiner key rebindings 2 | 3 | I use [Karabiner-Elements](https://karabiner-elements.pqrs.org/) for arbitrary key rebindings on MacOS. It's been extremely helpful for workflow, especially in recent years when Apple removed the physical escape key in favor of a touch bar. 4 | 5 | I referenced https://github.com/pqrs-org/KE-complex_modifications for their dual_keys script and for inspiration for my own vi_extended mode. 6 | 7 | You can run the scripts in this directory (python or ruby) to generate a JSON blob. 8 | 9 | That JSON should be added to a file under `assets/complex_modifications`, after which you can add those rules through the Karabiner UI. 10 | 11 | ## all key rebindings 12 | 13 | | mode | original | on tap | on hold | 14 | | ---- | ---- | ---- | ---- | 15 | | | caps_lock | escape | | 16 | | | shift + caps_lock | caps_lock | | 17 | | | left_command | enter | left_command | 18 | | | right_command | tab | right_command | 19 | | | z | z | left_control | 20 | | | / | / | right_control | 21 | | ---- | ---- | ---- | ---- | 22 | | | f | f | vi_f_mode | 23 | | vi_f_mode | h | left_arrow | | 24 | | vi_f_mode | j | down_arrow | | 25 | | vi_f_mode | k | up_arrow | | 26 | | vi_f_mode | l | right_arrow | | 27 | | ---- | ---- | ---- | ---- | 28 | | | v | v | vi_v_mode (hold right_option) | 29 | | vi_v_mode | h | left_arrow | | 30 | | vi_v_mode | j | down_arrow | | 31 | | vi_v_mode | k | up_arrow | | 32 | | vi_v_mode | l | right_arrow | | 33 | | ---- | ---- | ---- | ---- | 34 | | | r | r | vi_r_mode (hold right_option + right_shift) | 35 | | vi_r_mode | h | left_arrow | | 36 | | vi_r_mode | j | down_arrow | | 37 | | vi_r_mode | k | up_arrow | | 38 | | vi_r_mode | l | right_arrow | | 39 | | ---- | ---- | ---- | ---- | 40 | -------------------------------------------------------------------------------- /dot_config/private_karabiner/scripts/executable_caps_shift.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import json 4 | 5 | 6 | def mod_rule(from_key, to_key, modifiers, optional=None): 7 | return [ 8 | { 9 | "from": { 10 | "key_code": from_key, 11 | "modifiers": { 12 | "mandatory": modifiers, 13 | "optional": optional if optional else from_key, 14 | }, 15 | }, 16 | "to": [{"key_code": from_key}], 17 | "type": "basic", 18 | }, 19 | { 20 | "from": { 21 | "key_code": from_key, 22 | "modifiers": {"optional": ["any"]}, 23 | }, 24 | "to": [ 25 | { 26 | "key_code": to_key, 27 | "modifiers": [], 28 | }, 29 | ], 30 | "type": "basic", 31 | }, 32 | ] 33 | 34 | 35 | def main(): 36 | return { 37 | 'title': 'Personal rules (@amar1729) caps->escape', 38 | 'maintainers': ['amar1729'], 39 | 'rules': [ 40 | { 41 | 'description': 'Caps_Lock -> Escape, shift+Caps_Lock->Caps_Lock', 42 | 'manipulators': mod_rule("caps_lock", "escape", ["shift"]), 43 | }, 44 | ], 45 | } 46 | 47 | 48 | print(json.dumps(main(), indent=4, sort_keys=True)) 49 | -------------------------------------------------------------------------------- /dot_config/private_karabiner/scripts/executable_create_vi_mode.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import json 4 | 5 | mode_name = 'vi_{}_mode' 6 | 7 | trigger_key_normal = 'f' 8 | trigger_key_movemt = 'r' 9 | trigger_key_visual = 'v' 10 | trigger_key_delete = 'd' 11 | 12 | arrow_dict = { 13 | 'h': 'left_arrow', 14 | 'j': 'down_arrow', 15 | 'k': 'up_arrow', 16 | 'l': 'right_arrow', 17 | } 18 | 19 | mod_dict = { 20 | trigger_key_normal: [], 21 | trigger_key_movemt: ['right_option'], 22 | trigger_key_visual: ['right_option', 'right_shift'], 23 | # note: delete_or_backspace is not a modifier 24 | # also 'delete' mode would only really have one keybind: delete-backward 25 | #trigger_key_delete: ['right_option', 'delete_or_backspace'], 26 | } 27 | 28 | def generate_to_directive(to_key, modifiers): 29 | j = { 30 | 'key_code': to_key, 31 | } 32 | 33 | if modifiers: 34 | j['modifiers'] = modifiers 35 | 36 | return j 37 | 38 | def generate_vi_mode(trigger_key, from_key, to_key, modifiers=None): 39 | return [ 40 | { 41 | 'type': 'basic', 42 | 'from': { 43 | 'key_code': from_key, 44 | 'modifiers': {'optional': ['any']}, 45 | }, 46 | 'to': [ 47 | generate_to_directive(to_key, modifiers), 48 | ], 49 | 'conditions': [ 50 | { 51 | 'type': 'variable_if', 52 | 'name': mode_name.format(trigger_key), 53 | 'value': 1, 54 | }, 55 | ], 56 | }, 57 | { 58 | 'type': 'basic', 59 | 'from': { 60 | 'simultaneous': [ 61 | { 'key_code': trigger_key, }, 62 | { 'key_code': from_key }, 63 | ], 64 | 'simultaneous_options': { 65 | 'key_down_order': 'strict', 66 | 'key_up_order': 'strict_inverse', 67 | 'to_after_key_up': [ 68 | { 69 | 'set_variable': { 70 | 'name': mode_name.format(trigger_key), 71 | 'value': 0, 72 | }, 73 | }, 74 | ], 75 | }, 76 | 'modifiers': {'optional': ['any']}, 77 | }, 78 | 'to': [ 79 | generate_to_directive(to_key, modifiers), 80 | { 81 | 'set_variable': { 82 | 'name': mode_name.format(trigger_key), 83 | 'value': 1, 84 | }, 85 | }, 86 | ], 87 | 'parameters': { 88 | 'basic.simultaneous_threshold_milliseconds': 500, 89 | }, 90 | }, 91 | ] 92 | 93 | def generate_manipulators(): 94 | for trigger, mods in mod_dict.items(): 95 | for from_key, to_key in arrow_dict.items(): 96 | for directive in generate_vi_mode(trigger, from_key, to_key, mods): 97 | yield directive 98 | 99 | if trigger == trigger_key_movemt: 100 | fk = tk = "delete_or_backspace" 101 | for directive in generate_vi_mode(trigger, fk, tk, mods): 102 | yield directive 103 | 104 | def main(): 105 | return { 106 | 'title': 'Personal rules (@amar1729) vi_expanded_mode', 107 | 'maintainers': ['amar1729'], 108 | 'rules': [ 109 | { 110 | 'description': 'Expanded Vi Mode (rev 1)', 111 | 'manipulators': [ 112 | m for m in generate_manipulators() 113 | ], 114 | }, 115 | ], 116 | } 117 | 118 | print(json.dumps(main(), indent=4, sort_keys=True)) 119 | -------------------------------------------------------------------------------- /dot_config/private_karabiner/scripts/executable_dual_keys.json.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # NOTE - slightly modified from parent repo: 4 | # https://github.com/pqrs-org/KE-complex_modifications/blob/a8f78f8f1cddc4cd2820d3d31066969971f78efa/src/json/dual_keys.json.rb 5 | 6 | PARAMETERS = { 7 | :to_if_alone_timeout_milliseconds => 300, 8 | :to_delayed_action_delay_milliseconds => 0, 9 | :to_if_held_down_threshold_milliseconds => 0, 10 | :simultaneous_threshold_milliseconds => 50, 11 | }.freeze 12 | 13 | require 'json' 14 | # require_relative '../lib/karabiner.rb' 15 | 16 | def main 17 | puts JSON.pretty_generate( 18 | "title" => "Dual keys (to relieve stress from your pinkies)", 19 | "maintainers" => ["marlonrichert"], 20 | "rules" => [ 21 | { 22 | "description" => "Dual keys", 23 | "manipulators" => [ 24 | generate_dual_key_rule("left_command", "return_or_enter", "left_command"), 25 | generate_dual_key_rule("right_command", "tab", "right_command"), 26 | generate_dual_key_rule("z", "z", "left_control"), 27 | generate_dual_key_rule("slash", "slash", "right_control"), 28 | generate_dual_key_rule("caps_lock", "escape", "caps_lock") 29 | ], 30 | }, 31 | ], 32 | ) 33 | end 34 | 35 | def generate_dual_key_rule(input, alone, held_down) 36 | { 37 | "type" => "basic", 38 | "from" => { 39 | "key_code" => input, 40 | "modifiers" => { "optional" => ["any"] }, 41 | }, 42 | "to_if_alone" => [ 43 | { 44 | "key_code" => alone, 45 | }, 46 | ], 47 | "to_if_held_down" => [ 48 | { 49 | "key_code" => held_down, 50 | }, 51 | ], 52 | 'parameters' => { 53 | 'basic.to_if_alone_timeout_milliseconds' => PARAMETERS[:to_if_alone_timeout_milliseconds], 54 | 'basic.to_if_held_down_threshold_milliseconds' => PARAMETERS[:to_if_held_down_threshold_milliseconds], 55 | }, 56 | } 57 | end 58 | 59 | def generate_single_key_rule(input, output) 60 | { 61 | "type" => "basic", 62 | "from" => { 63 | "key_code" => input, 64 | "modifiers" => { "optional" => ["any"] }, 65 | }, 66 | "to" => [ 67 | { 68 | "key_code" => output, 69 | }, 70 | ], 71 | } 72 | end 73 | 74 | main() 75 | -------------------------------------------------------------------------------- /dot_config/private_karabiner/scripts/executable_enter_shift.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # NOTE - slightly modified from parent repo: 4 | # https://github.com/pqrs-org/KE-complex_modifications/blob/a8f78f8f1cddc4cd2820d3d31066969971f78efa/src/json/dual_keys.json.rb 5 | 6 | PARAMETERS = { 7 | :to_if_alone_timeout_milliseconds => 300, 8 | :to_delayed_action_delay_milliseconds => 0, 9 | :to_if_held_down_threshold_milliseconds => 0, 10 | :simultaneous_threshold_milliseconds => 50, 11 | }.freeze 12 | 13 | require 'json' 14 | # require_relative '../lib/karabiner.rb' 15 | 16 | def main 17 | puts JSON.pretty_generate( 18 | "title" => "Dual keys (shift/enter)", 19 | "maintainers" => ["amar1729"], 20 | "rules" => [ 21 | { 22 | "description" => "Dual keys: enter->enter/shift on hold. Helpful for smaller keyboards.", 23 | "manipulators" => [ 24 | generate_dual_key_rule("return_or_enter", "return_or_enter", "right_shift"), 25 | generate_dual_key_rule("left_arrow", "left_arrow", "right_command"), 26 | generate_dual_key_rule("down_arrow", "down_arrow", "right_option"), 27 | ], 28 | }, 29 | ], 30 | ) 31 | end 32 | 33 | def generate_dual_key_rule(input, alone, held_down) 34 | { 35 | "type" => "basic", 36 | "from" => { 37 | "key_code" => input, 38 | "modifiers" => { "optional" => ["any"] }, 39 | }, 40 | "to_if_alone" => [ 41 | { 42 | "key_code" => alone, 43 | }, 44 | ], 45 | "to_if_held_down" => [ 46 | { 47 | "key_code" => held_down, 48 | }, 49 | ], 50 | 'parameters' => { 51 | 'basic.to_if_alone_timeout_milliseconds' => PARAMETERS[:to_if_alone_timeout_milliseconds], 52 | 'basic.to_if_held_down_threshold_milliseconds' => PARAMETERS[:to_if_held_down_threshold_milliseconds], 53 | }, 54 | } 55 | end 56 | 57 | main() 58 | -------------------------------------------------------------------------------- /dot_config/private_karabiner/scripts/executable_fn_keys.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import json 4 | 5 | 6 | def generate_fn_to(): 7 | return [ 8 | { 9 | 'type': 'basic', 10 | 'from': { 11 | 'key_code': 'fn', 12 | 'modifiers': { 13 | 'optional': ['any'], 14 | }, 15 | }, 16 | 'to': [ 17 | { 18 | 'key_code': 'left_option', 19 | 'modifiers': ['left_control'], 20 | }, 21 | ], 22 | 'conditions': [ 23 | { 24 | 'type': 'frontmost_application_if', 25 | 'bundle_identifiers': ["^org\\.mozilla\\.firefox$"], 26 | }, 27 | ], 28 | }, 29 | ] 30 | 31 | 32 | def main(): 33 | return { 34 | 'title': 'Personal rules (@amar1729) rebind fn -> alt+ctrl', 35 | 'maintainers': ['amar1729'], 36 | 'rules': [ 37 | { 38 | 'description': 'fn -> ctrl+alt (rev 1)', 39 | 'manipulators': generate_fn_to(), 40 | }, 41 | ], 42 | } 43 | 44 | 45 | print(json.dumps(main(), indent=4, sort_keys=True)) 46 | -------------------------------------------------------------------------------- /dot_config/private_spicetify/config.ini.tmpl: -------------------------------------------------------------------------------- 1 | [Setting] 2 | inject_css = 1 3 | replace_colors = 1 4 | overwrite_assets = 0 5 | spotify_path = /Applications/Spotify.app/Contents/Resources 6 | prefs_path = {{ .chezmoi.homeDir }}/Library/Application Support/Spotify/prefs 7 | current_theme = Gradianto 8 | color_scheme = 9 | 10 | [Preprocesses] 11 | remove_rtl_rule = 1 12 | expose_apis = 1 13 | disable_sentry = 1 14 | disable_ui_logging = 1 15 | 16 | [AdditionalOptions] 17 | lyric_force_no_sync = 0 18 | made_for_you_hub = 0 19 | new_feedback_ui = 0 20 | search_in_sidebar = 0 21 | visualization_high_framerate = 0 22 | extensions = 23 | experimental_features = 0 24 | fastUser_switching = 0 25 | home = 0 26 | lyric_always_show = 0 27 | radio = 0 28 | song_page = 0 29 | custom_apps = 30 | tastebuds = 0 31 | minimal_ui = 0 32 | 33 | ; DO NOT CHANGE! 34 | [Backup] 35 | version = 1.1.25.559.g85cf5e4c 36 | 37 | -------------------------------------------------------------------------------- /dot_config/ranger/rc.conf: -------------------------------------------------------------------------------- 1 | # This rc.conf only changes the following options from the defaults: 2 | 3 | set vcs_aware true 4 | 5 | set draw_borders true 6 | 7 | # Note: 8 | # change default scope.sh to use img2txt/imgcat/etc instead of exiftool if want img previews instead of exif info 9 | set preview_script ~/.config/ranger/scope.sh 10 | -------------------------------------------------------------------------------- /dot_config/rofi/config: -------------------------------------------------------------------------------- 1 | ! defaults: floating window, similar look to mac spotlight 2 | 3 | rofi.theme: ~/.cache/wal/colors-rofi-dark.rasi 4 | !rofi.font: Iosevka 16 5 | rofi.font: Fantasque Sans Mono 16 6 | -------------------------------------------------------------------------------- /dot_config/ruff/ruff.toml.tmpl: -------------------------------------------------------------------------------- 1 | {{- template "ruff.toml" . -}} 2 | -------------------------------------------------------------------------------- /dot_config/scripts/doap/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Hacker scripts 3 | 4 | This is a super simple, totally BS suite of bash scripts I put together that, when run, all look like something out of a bad sci-fi movie interface (includes colors!). 5 | 6 | Constantly a bit of a work in progress, inspired by geektyper.com and hackertyper.com. 7 | 8 | Might later make these into an ubersicht or conky widget? 9 | -------------------------------------------------------------------------------- /dot_config/scripts/doap/executable_encrypt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # pretend we're encrypting stuff with a block of 10 random hexdump lines 4 | 5 | source ./utils.sh 6 | 7 | clear 8 | printf "${b1} encrypting ... ${cno}\n" 9 | 10 | while True; do 11 | 12 | out="$(cat /dev/urandom|hexdump|head -n10|cut -f2- -d ' ')" 13 | echo "$out" 14 | 15 | sleep 1 16 | 17 | echo -e "\033[11A\r" 18 | 19 | done 20 | -------------------------------------------------------------------------------- /dot_config/scripts/doap/executable_network.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # repeatedly print out network stuff 4 | 5 | source ./utils.sh 6 | 7 | while True; do 8 | 9 | gtimeout 2 netstat -l 10 | 11 | printf "\n ${b1}exploring net ...${cno} \n\n" 12 | sleep 1 13 | 14 | IP="$(triplet).$(triplet).$(triplet).$(triplet)" 15 | ping -c5 localhost | sed -e "s|127\.0\.0\.1|$IP|" -e "s|$(hostname)||" 16 | 17 | printf "\n ${b4}checking host ...${cno} \n\n" 18 | sleep 1 19 | done 20 | -------------------------------------------------------------------------------- /dot_config/scripts/doap/executable_spinner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | i=1 4 | sp="/-\|" 5 | echo -n ' ' 6 | while true 7 | do 8 | printf "\b${sp:i++%${#sp}:1}" 9 | done 10 | -------------------------------------------------------------------------------- /dot_config/scripts/doap/executable_upload.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # pretend we're uploading 4 | 5 | source ./utils.sh 6 | 7 | bar="▉" 8 | 9 | clear 10 | printf "${b5}Uploading virus ... ${cno}\n" 11 | 12 | while True; do 13 | 14 | for i in 1 2 3 4 5 6 7 8 9; do 15 | printf "${b2}$bar${cno}" 16 | sleep 1 17 | done 18 | 19 | printf "\b\b\b\b\b\b\b\b\b\b" 20 | printf " " 21 | printf "\b\b\b\b\b\b\b\b\b\b" 22 | sleep 1 23 | 24 | done 25 | -------------------------------------------------------------------------------- /dot_config/scripts/doap/executable_utils.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | b0="\033[1;30m" 4 | b1="\033[1;31m" 5 | b2="\033[1;32m" 6 | b3="\033[1;33m" 7 | b4="\033[1;34m" 8 | b5="\033[1;35m" 9 | b5="\033[1;35m" 10 | b7="\033[1;37m" 11 | 12 | cno="\033[0m" 13 | 14 | 15 | 16 | 17 | triplet () { cat /dev/urandom| gtr -dc "1-9" | head -c2 ;} 18 | -------------------------------------------------------------------------------- /dot_config/scripts/executable_cols.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ -r ~/.cache/wal/colors.sh ] && source ~/.cache/wal/colors.sh 4 | 5 | xblk=$color0 6 | xgry=$color8 7 | xred=$color1 8 | xgrn=$color2 9 | xblu=$color4 10 | xwht=$color7 11 | 12 | # Background 13 | bwht="\e[40m" 14 | bgry="\e[100m" 15 | bred="\e[41m" 16 | bgrn="\e[42m" 17 | bblu="\e[44m" 18 | bblk="\e[47m" 19 | 20 | # Foreground 21 | fwht="\e[37m" 22 | fgry="\e[90m" 23 | fred="\e[31m" 24 | fgrn="\e[32m" 25 | fblu="\e[34m" 26 | fblk="\e[30m" 27 | 28 | printf "\n" 29 | printf " ${bgry} ${bred} ${bgrn} ${bblu} ${bblk} ${bwht}\n" 30 | printf " ${bgry} ${bred} ${bgrn} ${bblu} ${bblk} ${bwht}\n" 31 | printf " ${bgry} ${bred} ${bgrn} ${bblu} ${bblk} ${bwht}\n" 32 | printf " ${bgry} ${bred} ${bgrn} ${bblu} ${bblk} ${bwht}\n" 33 | printf " ${xblk} ${fgry}${xgry} ${fred}${xred} ${fgrn}${xgrn} ${fblu}${xblu} ${fwht}${xwht}\n" 34 | printf "\n" 35 | -------------------------------------------------------------------------------- /dot_config/simple-rc/dot_bashrc: -------------------------------------------------------------------------------- 1 | # Amar Paul's (simple) .bashrc 2 | 3 | # shell aliases 4 | [[ -r ~/.shell_aliases ]] && source ~/.shell_aliases 5 | 6 | #### 7 | ## moar history plz 8 | #### 9 | 10 | shopt -s histappend 11 | export HISTCONTROL=ignoreboth 12 | export HISTSIZE=9999 13 | export HISTFILESIZE=100000 14 | 15 | #### 16 | ## Change prompt: PS1 and pre/post command 17 | #### 18 | 19 | # Helpful: http://blog.taylormcgann.com/tag/prompt-color/ 20 | # white name, red directory 21 | export PS1="\[\033[1;37m\]\u\[\033[1m\] : \[\033[1;31m\]\W\[\033[0m\] $ " 22 | 23 | # hack for printing a newline after command but before output 24 | # From: https://seasonofcode.com/posts/debug-trap-and-prompt_command-in-bash.html 25 | # This will run before any command is executed. 26 | function PreCommand() { 27 | if [ -z "$AT_PROMPT" ]; then 28 | return 29 | fi 30 | unset AT_PROMPT 31 | echo "" 32 | } 33 | trap "PreCommand" DEBUG 34 | 35 | # This will run after the execution of the previous full command line. We don't 36 | # want it PostCommand to execute when first starting a bash session (i.e., at 37 | # the first prompt). 38 | FIRST_PROMPT=1 39 | function PostCommand() { 40 | AT_PROMPT=1 41 | if [ -n "$FIRST_PROMPT" ]; then 42 | unset FIRST_PROMPT 43 | return 44 | fi 45 | echo "" 46 | } 47 | PROMPT_COMMAND="PostCommand" 48 | 49 | #### 50 | ## End of prompt changes 51 | #### 52 | -------------------------------------------------------------------------------- /dot_config/simple-rc/dot_inputrc: -------------------------------------------------------------------------------- 1 | # only for bash 2 | # 3 | # $include /etc/inputrc 4 | # 5 | # set completion-ignore-case On 6 | # 7 | # # arrow up 8 | # "\e[A":history-search-backward 9 | # 10 | # ## arrow down 11 | # "\e[B":history-search-forward 12 | -------------------------------------------------------------------------------- /dot_config/simple-rc/dot_shell_aliases: -------------------------------------------------------------------------------- 1 | # General shell aliases (simple). Source from .bashrc or .zshrc 2 | 3 | #### 4 | ## Common aliases, command improvements: 5 | #### 6 | 7 | # ls, grep, mkdir, tmux improvements 8 | alias ll="ls -lhFG" 9 | alias la="ll -a" 10 | alias grep="grep --color=auto" 11 | alias fgrep="fgrep --color=auto" 12 | alias egrep="egrep --color=auto" 13 | alias ggrep="ggrep --color=auto" 14 | alias cclear="cd; clear" 15 | 16 | # Make new directory and immediately cd into it (from Nate Landau's, link below) 17 | # should the -p flag be included? 18 | mcd () { mkdir -p "$1" && cd "$1"; } 19 | 20 | # copy with a progress bar. 21 | alias cpv="rsync -poghb --backup-dir=/tmp/rsync -e /dev/null --progress --" 22 | 23 | # use `highlight` for colorized cat 24 | # Requires `nl` for line numbering 25 | hcat () { 26 | _hcat () { 27 | if [ -f "$1" ]; then 28 | case "$1" in 29 | # force configuration file syntax for rc and profile files 30 | *rc|*profile) 31 | highlight -O xterm256 --style=zenburn --syntax=conf -i "$1" 32 | ;; 33 | *) 34 | highlight -O xterm256 --style=zenburn -i "$1" 35 | ;; 36 | esac 37 | else 38 | echo "$1"" is not a valid file for highlighting." 39 | fi 40 | } 41 | 42 | NUMBER=0 43 | 44 | # loop through arguments 45 | while [[ $# -gt 0 ]]; do 46 | key="$1" 47 | 48 | case $key in 49 | -n) 50 | NUMBER=1 51 | ;; 52 | *) 53 | if [ $NUMBER -eq 0 ] 54 | then 55 | _hcat "$key" 56 | else 57 | _hcat "$key" | nl 58 | fi 59 | ;; 60 | esac 61 | shift 62 | done 63 | 64 | unset NUMBER 65 | unset -f _hcat 66 | } 67 | 68 | # make tmux easier to check 69 | alias tmux-ls="tmux list-sessions" 70 | # tmux-a [index] : attaches to the index of given session 71 | # tmux-a : tries to attach to last session; if none active, creates new one 72 | tmux-a () { 73 | sessions=`tmux list-sessions 2>/dev/null` 74 | # if there are tmux sessions, connect to the last one or the one specified by $1 75 | if [[ $? -eq 0 ]] 76 | then 77 | # if there's an argument given then connect to given session 78 | if [[ -n "$1" ]] 79 | then 80 | tmux attach -t "$1" 81 | #return $? 82 | else 83 | # no argument, and tmux is running: attach to the most recent session 84 | tmux attach 85 | #return $? 86 | fi 87 | else 88 | # tmux isn't running: start it up 89 | tmux 90 | #return 0 91 | fi 92 | } 93 | -------------------------------------------------------------------------------- /dot_config/simple-rc/dot_tmux.conf: -------------------------------------------------------------------------------- 1 | # Look and feel 2 | 3 | # Enable mouse mode and scrolling 4 | # version >= 2.0 5 | #set -g mouse on 6 | 7 | # version < 2.0 8 | setw -g mode-mouse off 9 | set -g mouse-select-pane off 10 | set -g mouse-resize-pane off 11 | set -g mouse-select-window off 12 | 13 | #bind-key -T copy-mode-vi WheelUpPane send -X scroll-up 14 | #bind-key -T copy-mode-vi WheelDownPane send -X scroll-down 15 | #bind-key -t vi-copy WheelUpPane scroll-up 16 | #bind-key -t vi-copy WheelDownPane scroll-down 17 | 18 | # set first window to index 1 (not 0) to map more to the keyboard layout... 19 | set-option -g base-index 1 20 | set-window-option -g pane-base-index 1 21 | 22 | set -g default-terminal "screen-256color" # 256 color tmux 23 | set -g history-limit 100000 # scrollback buffer 24 | set -sg escape-time 0 # No delay for escape key press 25 | 26 | setw -g aggressive-resize on 27 | 28 | # color status bar 29 | set-option -g status on 30 | set-option -g status-fg white 31 | set-option -g status-bg default 32 | set-option -g status-attr default 33 | 34 | # powerline-like status bar (keep prompt clean otherwise) 35 | #set -g status-left "#[fg=colour232,bg=colour2] #S #[fg=colour2,bg=colour233,nobold,nounderscore,noitalics]" 36 | #set -g status-left "#[fg=colour232,bg=colour2] #S #[fg=colour2,bg=colour233,nobold,nounderscore,noitalics]" 37 | set -g status-left "#S~ " 38 | 39 | # colors and titles of windows 40 | set-window-option -g window-status-current-fg red 41 | set-window-option -g window-status-current-bg default 42 | set-window-option -g window-status-current-attr default 43 | setw -g window-status-format ' #(echo "#{pane_current_command}") ' 44 | setw -g window-status-current-format ' #(echo "#{pane_current_command}") ' 45 | 46 | #set -g status-right " " 47 | set -g status-right "#[fg=colour2,bg=colour233,nobold,nounderscore,noitalics]@#[fg=colour232,bg=colour2] #(echo $USER) " 48 | 49 | ### 50 | # Key bindings 51 | ### 52 | 53 | # Copy/pasting 54 | # Use vim keybindings in copy mode 55 | # from https://robots.thoughtbot.com/tmux-copy-paste-on-os-x-a-better-future 56 | setw -g mode-keys vi 57 | 58 | # Setup 'v' to begin selection as in Vim, and 'y' to copy 59 | 60 | # version >= 2.0 61 | #bind-key -T copy-mode-vi v send -X begin-selection 62 | #bind-key -T copy-mode-vi y send -X copy-pipe "pbcopy" 63 | 64 | # change to ctrl+a prefix 65 | unbind C-b 66 | set-option -g prefix C-a 67 | bind-key C-a send-prefix 68 | 69 | # better splitting (use ',' and '.') 70 | unbind % 71 | unbind , 72 | bind , split-window -h -c "#{pane_current_path}" 73 | unbind '"' 74 | bind . split-window -v -c "#{pane_current_path}" 75 | 76 | # Create new windows 77 | bind -n S-Down new-window -c "#{pane_current_path}" 78 | bind c new-window -c "#{pane_current_path}" 79 | 80 | # Destroy pane (will destroy window if last pane) 81 | bind -n M-w kill-pane 82 | 83 | # switch panes using Alt-arrow (without prefix) 84 | bind -n M-h select-pane -L 85 | bind -n M-j select-pane -D 86 | bind -n M-k select-pane -U 87 | bind -n M-l select-pane -R 88 | 89 | # Pane resize in all four directions (without prefix) 90 | bind -nr M-H resize-pane -L 5 91 | bind -nr M-J resize-pane -D 5 92 | bind -nr M-K resize-pane -U 5 93 | bind -nr M-L resize-pane -R 5 94 | 95 | # Show/hide status bar 96 | bind -n S-Up set-option -g status 97 | 98 | # Toggle through windows 99 | bind -n S-Left previous-window 100 | bind -n S-Right next-window 101 | 102 | # Swap windows 103 | bind -n C-S-Left swap-window -t -1 104 | bind -n C-S-Right swap-window -t +1 105 | 106 | # Swap panes 107 | unbind { 108 | bind { swap-pane -D 109 | unbind } 110 | bind } swap-pane -U 111 | 112 | # Reload config file 113 | unbind r 114 | bind r source-file ~/.tmux.conf \; display "Reloaded!" 115 | -------------------------------------------------------------------------------- /dot_config/simple-rc/dot_vimrc: -------------------------------------------------------------------------------- 1 | " Amar's (simple) .vimrc 2 | 3 | " Spin up default plugins if you don't install neovim 4 | "call plug#begin('~/.vim/plugged') 5 | " 6 | "Plug 'tpope/vim-sensible' 7 | "Plug 'morhetz/gruvbox' 8 | "Plug 'davidhalter/jedi-vim' 9 | " 10 | "call plug#end() 11 | 12 | colorscheme zenburn 13 | "colorscheme gruvbox 14 | 15 | syntax on 16 | 17 | set number 18 | "set relativenumber 19 | 20 | set autoindent noexpandtab tabstop=4 shiftwidth=4 21 | set incsearch hlsearch 22 | 23 | set mouse=a 24 | 25 | augroup remember_folds 26 | autocmd! 27 | autocmd BufWinLeave *.* mkview 28 | autocmd BufWinEnter *.* silent! loadview 29 | augroup END 30 | 31 | let mapleader = "," 32 | 33 | map n :bnext 34 | map :noh 35 | -------------------------------------------------------------------------------- /dot_config/simple-rc/executable_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Installing .bashrc, .shell_aliases, .vimrc, and .tmux.conf ..." 4 | 5 | if [[ -e .bashrc ]] 6 | then 7 | mv .bashrc .bash-default-rc 8 | echo "Backed up .bashrc to .bash-default-rc" 9 | fi 10 | echo "" 11 | 12 | curl -O https://raw.githubusercontent.com/Amar1729/dotfiles/master/.config/simple-rc/.bashrc 13 | curl -O https://raw.githubusercontent.com/Amar1729/dotfiles/master/.config/simple-rc/.vimrc 14 | curl -O https://raw.githubusercontent.com/Amar1729/dotfiles/master/.config/simple-rc/.shell_aliases 15 | curl -O https://raw.githubusercontent.com/Amar1729/dotfiles/master/.config/simple-rc/.tmux.conf 16 | (mkdir -p .vim/colors && cd .vim/colors && \ 17 | curl -O https://raw.githubusercontent.com/Amar1729/dotfiles/master/.config/simple-rc/.vim/colors/zenburn.vim) 18 | 19 | echo "" 20 | echo "tmux: $(which tmux)" 21 | 22 | -------------------------------------------------------------------------------- /dot_config/sxhkd/sxhkdrc_darwin: -------------------------------------------------------------------------------- 1 | # 2 | # wm independent hotkeys 3 | # 4 | 5 | # terminal emulator 6 | ctrl + n 7 | xterm & 8 | 9 | # What is this? 10 | #mod1 + ctrl + Return 11 | # bspc rule -a urxvtc -o pseudo_tiled=on && urxvtc 12 | 13 | # make sxhkd reload its configuration files: 14 | mod1 + Escape 15 | pkill -USR1 -x sxhkd 16 | 17 | # 18 | # bspwm hotkeys 19 | # 20 | 21 | # close and kill 22 | mod1 + {_,shift + }w 23 | #bspc window -{c,k} 24 | bspc node -{c,k} 25 | 26 | # alternate between the tiled and monocle layout 27 | ctrl + m 28 | bspc desktop -l next 29 | 30 | # 31 | # state/flags 32 | # 33 | 34 | # set the window state 35 | mod1 + {t,shift + t,g,f} 36 | bspc node -t {tiled,pseudo_tiled,floating,fullscreen} 37 | 38 | # 39 | # focus/swap 40 | # 41 | 42 | # focus the next/previous node 43 | # Watch out! OS X - Cmd+c is copy 44 | mod1 + shift + c 45 | bspc node -f next 46 | 47 | # focus the older or newer node in the focus history 48 | mod1 + {o,i} 49 | bspc wm -h off; \ 50 | bspc node {older,newer} -f; \ 51 | bspc wm -h on 52 | 53 | # focus or send to the given desktop 54 | #mod1 + {_,shift + }{1-9} 55 | # bspc {desktop -f,node -d} '^{1-9,10}' 56 | 57 | # swap? 58 | mod3 + {u,i,o,p} 59 | bspc node -s {west,south,north,east} --follow 60 | 61 | # 62 | # move/resize 63 | # 64 | 65 | # expand a window by moving one of its side outward 66 | #mod1 + ctrl + {h,j,k,l} 67 | mod3 + ctrl + {h,j,k,l} 68 | #bspc window -z {left -20 0,bottom 0 20,top 0 -20,right 20 0} 69 | bspc node {@west -r -10,@south -r +10,@north -r -10,@east -r +10} 70 | 71 | # contract a window by moving one of its side inward 72 | #mod1 + ctrl + shift + {h,j,k,l} 73 | mod3 + ctrl + shift + {h,j,k,l} 74 | #bspc window -z {right -20 0,top 0 20,bottom 0 -20,left 20 0} 75 | bspc node {@east -r -10,@north -r +10,@south -r -10,@west -r +10} 76 | 77 | # move a floating window 78 | # Watch out! OS X - Cmd+Arrow is bound to Spaces nav 79 | #mod2 + {Left,Down,Up,Right} 80 | #mod1 + shift + {Left,Down,Up,Right} 81 | #mod1 + shift + {Left,Down,Up,Right} 82 | mod1 + shift + {Left,Down,Up,Right} 83 | # depending on release of bspc installed - 84 | # macOS HEAD (0.9.1) needs xdo 85 | #xdo move {-x -20,-y +20,-y -20,-x +20} 86 | bspc node -v {-20 0,0 20,0 -20,20 0} 87 | -------------------------------------------------------------------------------- /dot_config/sxhkd/sxhkdrc_linux: -------------------------------------------------------------------------------- 1 | # 2 | # wm independent hotkeys 3 | # 4 | 5 | # terminal emulator 6 | # windelicato - mod1 + shift + Return 7 | mod1 + Return 8 | urxvt 9 | 10 | # What is this? 11 | #mod1 + ctrl + Return 12 | # bspc rule -a urxvtc -o pseudo_tiled=on && urxvtc 13 | 14 | # program launcher 15 | # watch out! OS X - Cmd+Space is Sherlock 16 | mod2 + space 17 | dmenu_run 18 | 19 | # make sxhkd reload its configuration files: 20 | mod1 + Escape 21 | pkill -USR1 -x sxhkd 22 | 23 | # 24 | # bspwm hotkeys 25 | # 26 | 27 | # quit bspwm normally 28 | # Watch out! OS X - Cmd+Alt+Esc is force quit applications 29 | # (just stick with killing xquartz with Cmd+q) 30 | mod1 + mod2 + Escape 31 | bspc quit 32 | 33 | # close and kill 34 | mod1 + {_,shift + }w 35 | bspc node -{c,k} 36 | 37 | # alternate between the tiled and monocle layout 38 | mod1 + m 39 | bspc desktop -l next 40 | 41 | # if the current node is automatic, send it to the last manual, otherwise pull the last leaf 42 | mod1 + y 43 | bspc query -N -n focused.automatic && bspc node -n last.!automatic || bspc node last.leaf -n focused 44 | 45 | # swap the current node and the biggest node 46 | mod1 + g 47 | bspc node -s biggest 48 | 49 | # 50 | # state/flags 51 | # 52 | 53 | # set the window state 54 | mod1 + {t,shift + t,s,f} 55 | bspc node -t {tiled,pseudo_tiled,floating,fullscreen} 56 | 57 | # set the node flags 58 | mod1 + ctrl + {x,y,z} 59 | bspc node -g {locked,sticky,private} 60 | 61 | # 62 | # focus/swap 63 | # 64 | 65 | # focus the node in the given direction 66 | # Watch out! OS X - Cmd+h is hide 67 | mod2 + {_,shift + }{h,j,k,l} 68 | bspc node -{f,s} {west,south,north,east} 69 | 70 | # focus the node for the given path jump 71 | mod1 + {p,b,comma,period} 72 | bspc node -f @{parent,brother,first,second} 73 | 74 | # focus the next/previous node 75 | # Watch out! OS X - Cmd+c is copy 76 | mod2 + {_,shift + }c 77 | bspc node -f {next,prev} 78 | 79 | # focus the next/previous desktop 80 | mod1 + bracket{left,right} 81 | bspc desktop -f {prev,next} 82 | 83 | # focus the last node/desktop 84 | mod1 + {grave,Tab} 85 | bspc {node,desktop} -f last 86 | 87 | # focus the older or newer node in the focus history 88 | mod1 + {o,i} 89 | bspc wm -h off; \ 90 | bspc node {older,newer} -f; \ 91 | bspc wm -h on 92 | 93 | # focus or send to the given desktop 94 | mod1 + {_,shift + }{1-9,0} 95 | bspc {desktop -f,node -d} '^{1-9,10}' 96 | 97 | # 98 | # preselect 99 | # 100 | 101 | # preselect the direction 102 | mod1 + ctrl + {h,j,k,l} 103 | bspc node -p {west,south,north,east} 104 | 105 | # preselect the ratio 106 | mod1 + ctrl + {1-9} 107 | bspc node -o 0.{1-9} 108 | 109 | # cancel the preselection for the focused node 110 | mod1 + ctrl + space 111 | bspc node -p cancel 112 | 113 | # cancel the preselection for the focused desktop 114 | mod1 + ctrl + shift + space 115 | bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel 116 | 117 | # 118 | # move/resize 119 | # 120 | 121 | # expand a window by moving one of its side outward 122 | mod1 + mod2 + {h,j,k,l} 123 | bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0} 124 | 125 | # contract a window by moving one of its side inward 126 | mod1 + mod2 + shift + {h,j,k,l} 127 | bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0} 128 | 129 | # move a floating window 130 | # Watch out! OS X - Cmd+Arrow is bound to Spaces nav 131 | mod2 + {Left,Down,Up,Right} 132 | bspc node -v {-20 0,0 20,0 -20,20 0} 133 | -------------------------------------------------------------------------------- /dot_config/sxhkd/symlink_sxhkdrc.tmpl: -------------------------------------------------------------------------------- 1 | ./sxhkdrc_{{ .chezmoi.os }} 2 | -------------------------------------------------------------------------------- /dot_config/themes/Grafikartes-Flat-Retro-Modern-2-Chrome.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amar1729/dotfiles/37f152a8f737297e94d63b8a52b563eea7a5d3bc/dot_config/themes/Grafikartes-Flat-Retro-Modern-2-Chrome.icns -------------------------------------------------------------------------------- /dot_config/themes/Sublime Text.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amar1729/dotfiles/37f152a8f737297e94d63b8a52b563eea7a5d3bc/dot_config/themes/Sublime Text.icns -------------------------------------------------------------------------------- /dot_config/themes/firefox_dock_icon_replacement_by_sacrificials-d6ed9ra.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amar1729/dotfiles/37f152a8f737297e94d63b8a52b563eea7a5d3bc/dot_config/themes/firefox_dock_icon_replacement_by_sacrificials-d6ed9ra.png -------------------------------------------------------------------------------- /dot_config/themes/injector.txt: -------------------------------------------------------------------------------- 1 | # add this to a CSS injector for google.com searches 2 | # (to prevent the stupid half-second popup after coming back from a link): 3 | .s + div, .exp-outline { 4 | display: none; 5 | } 6 | -------------------------------------------------------------------------------- /dot_config/ubersicht/widgets/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Uebersicht Widgets 3 | 4 | I use the following widgets - they won't be added to my dotfiles repo, since the widgets themselves might be git projects. 5 | 6 | * [amar-bar](https://github.com/Amar1729/nerdbar.widget/) 7 | * [simple-bar](https://github.com/Jean-Tinland/simple-bar) 8 | -------------------------------------------------------------------------------- /dot_config/wal/templates/colors-alacritty.yml: -------------------------------------------------------------------------------- 1 | window.opacity: 0.8 2 | 3 | colors: 4 | primary: 5 | background: '{background}' 6 | foreground: '{foreground}' 7 | cursor: 8 | text: CellForeground 9 | cursor: '{cursor}' 10 | bright: 11 | # use light gray (for zsh-autocomplete text) 12 | black: '{color8}' 13 | red: '{color1}' 14 | green: '{color2}' 15 | yellow: '{color3}' 16 | blue: '{color4}' 17 | magenta: '{color5}' 18 | cyan: '{color6}' 19 | white: '{color7}' 20 | normal: 21 | # use black rather than default light gray (color8) (for black colors in eg vim airline) 22 | black: '{color0}' 23 | red: '{color9}' 24 | green: '{color10}' 25 | yellow: '{color11}' 26 | blue: '{color12}' 27 | magenta: '{color13}' 28 | cyan: '{color14}' 29 | white: '{color15}' 30 | -------------------------------------------------------------------------------- /dot_config/xresources/gruvbox-dark.xresources.tmpl: -------------------------------------------------------------------------------- 1 | {{ if (eq .chezmoi.os "linux") -}} 2 | ! ----------------------------------------------------------------------------- 3 | ! File: gruvbox-dark.xresources 4 | ! Description: Retro groove colorscheme generalized 5 | ! Author: morhetz 6 | ! Source: https://github.com/morhetz/gruvbox-generalized 7 | ! Last Modified: 6 Sep 2014 8 | ! ----------------------------------------------------------------------------- 9 | 10 | ! hard contrast: *background: #1d2021 11 | *background: #282828 12 | ! soft contrast: *background: #32302f 13 | *foreground: #ebdbb2 14 | ! Black + DarkGrey 15 | *color0: #282828 16 | *color8: #928374 17 | ! DarkRed + Red 18 | *color1: #cc241d 19 | *color9: #fb4934 20 | ! DarkGreen + Green 21 | *color2: #98971a 22 | *color10: #b8bb26 23 | ! DarkYellow + Yellow 24 | *color3: #d79921 25 | *color11: #fabd2f 26 | ! DarkBlue + Blue 27 | *color4: #458588 28 | *color12: #83a598 29 | ! DarkMagenta + Magenta 30 | *color5: #b16286 31 | *color13: #d3869b 32 | ! DarkCyan + Cyan 33 | *color6: #689d6a 34 | *color14: #8ec07c 35 | ! LightGrey + White 36 | *color7: #a89984 37 | *color15: #ebdbb2 38 | {{- end }} 39 | -------------------------------------------------------------------------------- /dot_gdbinit: -------------------------------------------------------------------------------- 1 | set startup-with-shell off 2 | -------------------------------------------------------------------------------- /dot_gitconfig.tmpl: -------------------------------------------------------------------------------- 1 | # lots of ideas taken from 2 | # https://gist.github.com/pksunkara/988716 3 | 4 | [user] 5 | name = {{ .git_user }} 6 | email = {{ .email }} 7 | 8 | [alias] 9 | c = clone 10 | d = diff 11 | ds = diff --staged 12 | dt = difftool 13 | co = checkout 14 | s = switch 15 | ci = commit 16 | st = status 17 | stn = status -uno 18 | br = branch 19 | m = merge 20 | ma = merge --abort 21 | # merge from upstream, if we git --fetch first 22 | # HEAD - get branch name 23 | # branch_name@{u} - get upstream tracking (e.g. origin/main 24 | merge-upstream = !UPSTREAM=$(git rev-parse --abbrev-ref $(git rev-parse --abbrev-ref HEAD)@{u}) && git merge --ff-only "$UPSTREAM" 25 | rc = rebase --continue 26 | ra = rebase --abort 27 | rs = rebase --skip 28 | p = pull 29 | pr = pull --rebase 30 | rv = remote -v 31 | # unstaged staged changes, but don't remove them (use --worktree,-W for that) 32 | rH = restore --staged 33 | cp = cherry-pick 34 | cpa = cherry-pick --abort 35 | cpc = cherry-pick --continue 36 | 37 | stp = stash push 38 | sta = stash apply 39 | std = stash drop 40 | stl = stash list 41 | 42 | sf = submodule foreach 43 | 44 | short = rev-parse --short HEAD 45 | 46 | # nicely formatted history (includes all branches) 47 | hist = log --graph --abbrev-commit --decorate --all --date=short \ 48 | --format=format:'%C(bold blue)%h%C(reset) %C(bold cyan)%ad%C(reset) | %C(white)%s%C(reset) %C(dim green)[%an]%C(reset) %C(bold yellow)%d%C(reset)' 49 | # history of specific branch 50 | histb = log --graph --abbrev-commit --decorate \ 51 | --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim green)[%an]%C(reset)' 52 | # longer format for really looking through history 53 | histl = log --graph --abbrev-commit --decorate --all \ 54 | --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim green)[%an]%C(reset)%n' 55 | 56 | # for diffing commits between two branches - don't want `--all` (like `hist` has) 57 | db = log --graph --abbrev-commit --decorate --date=short \ 58 | --format=format:'%C(bold blue)%h%C(reset) %C(bold cyan)%ad%C(reset) | %C(white)%s%C(reset) %C(dim green)[%an]%C(reset) %C(bold yellow)%d%C(reset)' 59 | 60 | # gitlab: get merge requests 61 | # (using `gh` for github) 62 | lab-mr = !sh -c 'git fetch $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' - 63 | # hub-mr = !sh -c 'git fetch $1 pull/$2/head:mr-$1-$2 && git checkout mr-$1-$2' - 64 | 65 | # empty commit - sometimes useful for testing CI 66 | fake = commit --allow-empty -m 'empty commit' 67 | 68 | # only use an ignore-revs-file when i want to 69 | bblame = blame --ignore-revs-file .git-blame-ignore-revs 70 | 71 | [core] 72 | editor = nvim 73 | excludesfile = ~/.gitignore_global 74 | pager = less --redraw-on-quit 75 | # problem here: 76 | # using `less -FX` turns to cat for onepage input (-F), and doesn't send termcap deinit (-X) 77 | # however, the lack of termcap init (-X) means you cant scroll w/ mouse on longer pages 78 | # changing to `less -F` sends termcap deinit which clears the page (useless) :/ 79 | # so either you can scroll on long input, or you keep results around for short bois 80 | 81 | [color "branch"] 82 | current = yellow bold 83 | local = green bold 84 | remote = cyan bold 85 | 86 | [color "diff"] 87 | meta = yellow bold 88 | frag = magenta bold 89 | old = red bold 90 | new = green bold 91 | whitespace = red reverse 92 | 93 | [color "diff-highlight"] 94 | oldNormal = red bold 95 | oldHighlight = red bold 52 96 | newNormal = green bold 97 | newHighlight = green bold 22 98 | 99 | [color "status"] 100 | added = green bold 101 | changed = yellow bold 102 | untracked = red bold 103 | 104 | [pager] 105 | stash = false 106 | #diff = diff-so-fancy | less --tabs=4 -R 107 | 108 | [filter "lfs"] 109 | clean = git-lfs clean -- %f 110 | smudge = git-lfs smudge -- %f 111 | process = git-lfs filter-process 112 | required = true 113 | 114 | [diff] 115 | # AST-based diff tool. 116 | # tool = diffsitter 117 | # AST-based diff tool, that seems a bit more robust. 118 | tool = difftastic 119 | submodule = log 120 | 121 | [difftool] 122 | prompt = false 123 | 124 | [difftool "difftastic"] 125 | cmd = difft "$LOCAL" "$REMOTE" 126 | 127 | [difftool "diffsitter"] 128 | cmd = diffsitter --color=on "$LOCAL" "$REMOTE" 129 | 130 | [difftool "nvim"] 131 | cmd = nvim -d "$LOCAL" "$REMOTE" 132 | 133 | [pull] 134 | ff = only 135 | 136 | [init] 137 | defaultBranch = main 138 | 139 | [rerere] 140 | enabled = true 141 | 142 | [rebase] 143 | autoStash = true 144 | 145 | [merge] 146 | conflictStyle = zdiff3 147 | 148 | [blame] 149 | # is there a way to fallback?? 150 | # ignoreRevsFile = .git-blame-ignore-revs 151 | # mark skipped commits with '?' 152 | markIgnoredLines = true 153 | # mark skipped unattributable lines with '*' 154 | markUnblamableLines = true 155 | coloring = highlightRecent 156 | -------------------------------------------------------------------------------- /dot_gitignore_global: -------------------------------------------------------------------------------- 1 | # Amar's global gitignore file 2 | 3 | # system stuff 4 | .vagrant/ 5 | 6 | # Mac/editing (tmp) stuff 7 | .DS_Store 8 | .AppleDouble 9 | ._* 10 | *~ 11 | *.sw[p|o] 12 | .cache/ 13 | .gitignore 14 | 15 | # Python 16 | *.pyc 17 | env/ 18 | venv* 19 | .venv/ 20 | __pycache__/ 21 | *.egg-info 22 | *.eggs 23 | .tox 24 | .mypy_cache 25 | .pyre 26 | .pdm-python 27 | dist/ 28 | .coverage 29 | htmlcov/ 30 | *.hdf5 31 | 32 | # java 33 | .factorypath 34 | *.class 35 | .sdkmanrc 36 | 37 | # Object files 38 | *.o 39 | *.dll 40 | *.so 41 | .ctags 42 | tags 43 | target/ 44 | # build/ 45 | 46 | # ide stuff :/ 47 | .idea 48 | .vscode 49 | -------------------------------------------------------------------------------- /dot_ipython/profile_default/ipython_config.py: -------------------------------------------------------------------------------- 1 | c.InteractiveShell.confirm_exit = False 2 | c.TerminalInteractiveShell.extra_open_editor_shortcuts = True 3 | c.InteractiveShell.editor = 'vim' 4 | # c.TerminalInteractiveShell.editing_mode = 'vi' 5 | 6 | # default history/load: 10e4 7 | c.InteractiveShell.history_length = 1000000 8 | c.InteractiveShell.history_load_length = 1000000 9 | 10 | # some custom ipython settings - i don't like the In/Out line prompts 11 | 12 | ## Use colors for displaying information about objects. Because this information 13 | # is passed through a pager (like 'less'), and some pagers get confused with 14 | # color codes, this capability can be turned off. 15 | c.InteractiveShell.color_info = True 16 | 17 | ## Set the color scheme (NoColor, Neutral, Linux, or LightBG). 18 | c.InteractiveShell.colors = 'Linux' 19 | 20 | from IPython.terminal.prompts import Prompts 21 | from pygments.token import Token 22 | 23 | class MyPrompt(Prompts): 24 | # keep regular >>> prompt 25 | def in_prompt_tokens(self, cli=None): 26 | return [(Token.Prompt, '>>> ')] 27 | 28 | # empty continuation lines to make copy/paste to script easier 29 | def continuation_prompt_tokens(self, cli=None): 30 | return [(Token.Prompt, ' ')] 31 | 32 | # simplify outline 33 | def out_prompt_tokens(self, cli=None): 34 | return [(Token.Prompt, '> ')] 35 | 36 | c.TerminalInteractiveShell.prompts_class = MyPrompt 37 | -------------------------------------------------------------------------------- /dot_nvidia-xinitrc: -------------------------------------------------------------------------------- 1 | # execute this xinitrc with `nvidia-xrun` 2 | # useful for computers that have multiple (e.g. integrated/dedicated) gpus 3 | # nvidia-xrun will start an xsession using the NVIDIA GPU on board, from which 4 | # you can start steam/lutris etc 5 | 6 | # note: 7 | # apparently, i may be able to use these lines to make X use nvidia gpu at init: 8 | # https://bbs.archlinux.org/viewtopic.php?id=240229 9 | # xrandr --setprovideroutputsource modesetting NVIDIA-0 10 | # xrandr --auto 11 | 12 | if [ $# -gt 0 ]; then 13 | $* 14 | else 15 | # ~/.nvidia-settings-rc can be generated initially with: 16 | # nvidia-settings --rewrite-config-file 17 | nvidia-settings --load-config-only & 18 | 19 | # only load this up while running under GPU 20 | conky -c ~/.config/conky-gpu/conkyrc 21 | 22 | . ~/.xinitrc 23 | fi 24 | -------------------------------------------------------------------------------- /dot_tigrc: -------------------------------------------------------------------------------- 1 | bind generic 9 !@sh -c "echo %(commit) | pbcopy" 2 | -------------------------------------------------------------------------------- /dot_tmux.conf.tmpl: -------------------------------------------------------------------------------- 1 | # Amar Paul's tmux configuration! 2 | # With help from a few sources - 3 | # https://gist.github.com/v-yarotsky/2157908 4 | # https://github.com/skwp/dotfiles/blob/master/tmux/tmux.conf 5 | 6 | 7 | #### 8 | ## Look and feel 9 | #### 10 | 11 | {{ if (eq .chezmoi.os "darwin") -}} 12 | # reattach to Quartz window server (commands like `open` or `subl`) 13 | set-option -g default-command "reattach-to-user-namespace -l $SHELL" 14 | {{- end }} 15 | 16 | # Enable mouse mode and scrolling 17 | # https://ryanfb.github.io/etc/2015/10/19/tmux_mouse_mode_on_el_capitan.html 18 | set -g mouse on 19 | 20 | ## 21 | # following block shouldn't be necessary with nhdaly/tmux-better-mouse-mode 22 | # 23 | #set-window-option -g alternate-screen off 24 | 25 | # Check if copy-mode or any mouse flags, then send mouse events 26 | # or check if we're in alternate screen end send navigation keys (up, down) 27 | 28 | # bind -n WheelUpPane if-shell -Ft='#{?pane_in_mode,1,#{mouse_any_flag}}' \ 29 | # 'send -Mt=' 'if-shell -Ft= "#{alternate_on}" \ 30 | # "send -t= Up" "copy-mode -et= ; send -Mt="' 31 | # bind -n WheelDownPane if-shell -Ft= '#{?pane_in_mode,1,#{mouse_any_flag}}' \ 32 | # 'send -Mt=' 'if-shell -Ft= "#{alternate_on}" \ 33 | # "send -t= Down" "send -Mt="' 34 | ## 35 | 36 | # set first window to index 1 (not 0) to map more to the keyboard layout... 37 | set-option -g base-index 1 38 | set-window-option -g pane-base-index 1 39 | 40 | set -g default-terminal "screen-256color" # 256 color tmux 41 | set -g history-limit 100000 # scrollback buffer 42 | set -sg escape-time 0 # No delay for escape key press 43 | set -g focus-events on # for nvim autoread 44 | set -sa terminal-features ',screen-256color:RGB' # for nvim termcolors 45 | 46 | setw -g aggressive-resize on 47 | 48 | # Colors, titles ideas (and Shift-switching) taken from: 49 | # https://gist.github.com/paulrouget/cc3cf124e0789c5dc1d387c2180f132b 50 | # https://www.reddit.com/r/unixporn/comments/5vke7s/osx_iterm2_tmux_vim/ 51 | 52 | # color status bar 53 | set-option -g status on 54 | set-option -g status-fg white 55 | set-option -g status-bg default 56 | set-option -g status-style default 57 | 58 | # default simple look 59 | set -g status-left '#[fg=colour232,bg=colour2] #S #[fg=colour2,bg=colour233,nobold,nounderscore,noitalics] ' 60 | setw -g window-status-format ' #(echo "#{pane_current_command}") ' 61 | setw -g window-status-current-format ' #(echo "#{pane_current_command}") ' 62 | setw -g window-status-current-style fg=red 63 | 64 | #  airline style 65 | if-shell -b '[[ $EDITOR_LOOK == "carot" ]]' \ 66 | "set -g status-left '#[fg=colour232,bg=colour2] #S #[fg=colour2,bg=colour233,nobold,nounderscore,noitalics] '; \ 67 | setw -g window-status-current-format ' #(echo \"#{pane_current_command}\") '; \ 68 | setw -g window-status-current-style fg=red,bg=black; \ 69 | setw -g window-status-style fg=white,bg=black" 70 | 71 | # ▏▎▍ block style 72 | if-shell -b '[[ $EDITOR_LOOK == "block" ]]' \ 73 | "set -g status-left '#[fg=colour232,bg=colour2] #S ▏▎▌▊#[fg=colour2,bg=colour233,nobold,nounderscore,noitalics] '; \ 74 | setw -g window-status-format ' #(echo \"#{pane_current_command}\") ▊'; \ 75 | setw -g window-status-current-format '▊▌#(echo \"#{pane_current_command}\") ▊▉'; \ 76 | setw -g window-status-current-style fg=colour232,bg=red; \ 77 | setw -g window-status-style fg=black,bg=green" 78 | 79 | set -g status-right '' 80 | # need to update for linux with block/carot 81 | #set -g status-right "#[fg=colour2,bg=colour233,nobold,nounderscore,noitalics]#[fg=colour232,bg=colour2] linux " 82 | 83 | 84 | #### 85 | ## Key bindings 86 | #### 87 | 88 | # Copy/pasting 89 | # Use vim keybindings in copy mode 90 | # from https://robots.thoughtbot.com/tmux-copy-paste-on-os-x-a-better-future 91 | setw -g mode-keys vi 92 | 93 | # Setup 'v' to begin selection as in Vim, and 'y' to copy 94 | bind-key -T copy-mode-vi v send -X begin-selection 95 | {{ if (eq .chezmoi.os "darwin") -}} 96 | bind-key -T copy-mode-vi y send -X copy-pipe "pbcopy" 97 | {{ else if (eq .chezmoi.os "linux") -}} 98 | bind-key -T copy-mode-vi y send -X copy-pipe "xclip -sel clipboard" 99 | {{- end }} 100 | 101 | # Update default binding of `Enter` to also use copy-pipe 102 | # (don't think I need this) 103 | #unbind -t vi-copy Enter 104 | #bind -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy" 105 | 106 | # change to ctrl+a prefix 107 | unbind C-b 108 | set-option -g prefix C-a 109 | bind-key C-a send-prefix 110 | 111 | # better splitting (use ',' and '.') 112 | unbind % 113 | unbind , 114 | bind , split-window -h -c "#{pane_current_path}" 115 | unbind '"' 116 | bind . split-window -v -c "#{pane_current_path}" 117 | 118 | # Create new windows 119 | bind -n S-Down new-window -c "#{pane_current_path}" 120 | bind c new-window -c "#{pane_current_path}" 121 | 122 | # Destroy pane (will destroy window if last pane) 123 | bind -n M-w kill-pane 124 | 125 | # Pane resize in all four directions (without prefix) 126 | bind -nr M-H resize-pane -L 5 127 | bind -nr M-J resize-pane -D 5 128 | bind -nr M-K resize-pane -U 5 129 | bind -nr M-L resize-pane -R 5 130 | 131 | # Show/hide status bar 132 | bind -n S-Up set-option -g status 133 | 134 | # Toggle through windows 135 | bind -n S-Left previous-window 136 | bind -n S-Right next-window 137 | 138 | # Swap windows 139 | bind -n C-S-Left swap-window -t -1 \; previous-window 140 | bind -n C-S-Right swap-window -t +1 \; next-window 141 | 142 | # Swap panes 143 | unbind '{' 144 | bind '{' swap-pane -D 145 | unbind '}' 146 | bind '}' swap-pane -U 147 | 148 | # Reload config file 149 | unbind r 150 | bind r source-file ~/.tmux.conf \; display "Reloaded!" 151 | 152 | # Plugins for tmux 153 | set -g @plugin 'tmux-plugins/tmux-sessionist' # better mgmt of sessions 154 | set -g @plugin 'tmux-plugins/tmux-resurrect' # save/restore tmux state 155 | set -g @plugin 'nhdaly/tmux-better-mouse-mode' # better scrolling 156 | set -g @plugin 'tmux-plugins/tmux-continuum' # automatic save/restore tmux state (depends on tmux-resurrect) 157 | set -g @plugin 'tmux-plugins/tmux-open' # open urls from tmux (needed on current alacritty) 158 | set -g @plugin 'christoomey/vim-tmux-navigator' # tmux/vim keybindings interop, pane movements 159 | 160 | set -g @resurrect-save 'S' 161 | set -g @resurrect-restore 'R' 162 | set -g @resurrect-strategy-nvim 'session' 163 | 164 | set -g @emulate-scroll-for-no-mouse-alternate-buffer 'on' 165 | 166 | set -g @continuum-restore 'on' 167 | 168 | set -g @open-S 'https://www.duckduckgo.com/?q=' 169 | 170 | # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) 171 | run '~/.tmux/plugins/tpm/tpm' 172 | -------------------------------------------------------------------------------- /dot_tokens.tmpl: -------------------------------------------------------------------------------- 1 | # sensitive tokens 2 | 3 | # chatter1 slack token (for slack cli) 4 | export SLACK_TOKEN="{{ pass "tokens/slack.chatter1" }}" 5 | 6 | # github access token for homebrew 7 | export HOMEBREW_GITHUB_API_TOKEN="{{ pass "tokens/github.homebrew-api" }}" 8 | 9 | # for gh cli 10 | export GITHUB_TOKEN="{{ pass "tokens/github" }}" 11 | -------------------------------------------------------------------------------- /dot_urxvt/ext/clipboard: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # Author: Bert Muennich 3 | # Website: http://www.github.com/muennich/urxvt-perls 4 | # License: GPLv2 5 | 6 | # Use keyboard shortcuts to copy the selection to the clipboard and to paste 7 | # the clipboard contents (optionally escaping all special characters). 8 | # Requires xsel to be installed! 9 | 10 | # Usage: put the following lines in your .Xdefaults/.Xresources: 11 | # URxvt.perl-ext-common: ...,clipboard 12 | # URxvt.keysym.M-c: perl:clipboard:copy 13 | # URxvt.keysym.M-v: perl:clipboard:paste 14 | # URxvt.keysym.M-C-v: perl:clipboard:paste_escaped 15 | 16 | # Options: 17 | # URxvt.clipboard.autocopy: If true, PRIMARY overwrites clipboard 18 | 19 | # You can also overwrite the system commands to use for copying/pasting. 20 | # The default ones are: 21 | # URxvt.clipboard.copycmd: xsel -ib 22 | # URxvt.clipboard.pastecmd: xsel -ob 23 | # If you prefer xclip, then put these lines in your .Xdefaults/.Xresources: 24 | # URxvt.clipboard.copycmd: xclip -i -selection clipboard 25 | # URxvt.clipboard.pastecmd: xclip -o -selection clipboard 26 | # On Mac OS X, put these lines in your .Xdefaults/.Xresources: 27 | # URxvt.clipboard.copycmd: pbcopy 28 | # URxvt.clipboard.pastecmd: pbpaste 29 | 30 | # The use of the functions should be self-explanatory! 31 | 32 | 33 | use strict; 34 | use warnings; 35 | 36 | sub on_start { 37 | my ($self) = @_; 38 | 39 | $self->{copy_cmd} = $self->x_resource('clipboard.copycmd') || 'xsel -ib'; 40 | $self->{paste_cmd} = $self->x_resource('clipboard.pastecmd') || 'xsel -ob'; 41 | 42 | if ($self->x_resource('clipboard.autocopy') eq 'true') { 43 | $self->enable(sel_grab => \&sel_grab); 44 | } 45 | 46 | () 47 | } 48 | 49 | sub copy { 50 | my ($self) = @_; 51 | 52 | if (open(CLIPBOARD, "| $self->{copy_cmd}")) { 53 | my $sel = $self->selection(); 54 | utf8::encode($sel); 55 | print CLIPBOARD $sel; 56 | close(CLIPBOARD); 57 | } else { 58 | print STDERR "error running '$self->{copy_cmd}': $!\n"; 59 | } 60 | 61 | () 62 | } 63 | 64 | sub paste { 65 | my ($self) = @_; 66 | 67 | my $str = `$self->{paste_cmd}`; 68 | if ($? == 0) { 69 | $self->tt_paste($str); 70 | } else { 71 | print STDERR "error running '$self->{paste_cmd}': $!\n"; 72 | } 73 | 74 | () 75 | } 76 | 77 | sub paste_escaped { 78 | my ($self) = @_; 79 | 80 | my $str = `$self->{paste_cmd}`; 81 | if ($? == 0) { 82 | $str =~ s/([!#\$%&\*\(\) ='"\\\|\[\]`~,<>\?])/\\$1/g; 83 | $self->tt_paste($str); 84 | } else { 85 | print STDERR "error running '$self->{paste_cmd}': $!\n"; 86 | } 87 | 88 | () 89 | } 90 | 91 | sub on_action { 92 | my ($self, $action) = @_; 93 | 94 | on_user_command($self, "clipboard:" . $action); 95 | } 96 | 97 | sub on_user_command { 98 | my ($self, $cmd) = @_; 99 | 100 | if ($cmd eq "clipboard:copy") { 101 | $self->copy; 102 | } elsif ($cmd eq "clipboard:paste") { 103 | $self->paste; 104 | } elsif ($cmd eq "clipboard:paste_escaped") { 105 | $self->paste_escaped; 106 | } 107 | 108 | () 109 | } 110 | 111 | sub sel_grab { 112 | my ($self) = @_; 113 | 114 | $self->copy; 115 | 116 | () 117 | } 118 | -------------------------------------------------------------------------------- /dot_zsh/completions/_rr: -------------------------------------------------------------------------------- 1 | #compdef rr 2 | 3 | # link the completion for 'ruff rule' to a custom alias 'rr'. 4 | 5 | compdef -e 'words[1]=(ruff rule); (( CURRENT+=1 )); _ruff' rr 6 | -------------------------------------------------------------------------------- /dot_zsh/completions/_tmux-a: -------------------------------------------------------------------------------- 1 | #compdef _tmux-a tmux-a 2 | 3 | # Complete attached-sessions and detached-sessions as separate tags. 4 | # function __tmux-sessions-separately { 5 | function _tmux-a { 6 | local ret=1 7 | local -a sessions detached_sessions attached_sessions 8 | sessions=( ${${(f)"$(command tmux 2> /dev/null list-sessions)"}/:[ $'\t']##/:} ) 9 | detached_sessions=( ${sessions:#*"(attached)"} ) 10 | attached_sessions=( ${(M)sessions:#*"(attached)"} ) 11 | 12 | # ### This seems to work without a _tags loop but not with it. I suspect 13 | # ### that has something to do with _describe doing its own _tags loop. 14 | _tags detached-sessions attached-sessions 15 | # Placing detached before attached means the default behaviour of this 16 | # function better suits its only current caller, _tmux-attach-session(). 17 | _requested detached-sessions && _describe -t detached-sessions 'detached sessions' detached_sessions "$@" && ret=0 18 | _requested attached-sessions && _describe -t attached-sessions 'attached sessions' attached_sessions "$@" && ret=0 19 | 20 | return ret 21 | } 22 | 23 | #__tmux-sessions-separately "$@" 24 | _tmux-a "$@" 25 | -------------------------------------------------------------------------------- /dot_zsh_plugins.txt: -------------------------------------------------------------------------------- 1 | 2 | # oh-my-zsh stuff 3 | # note: i don't load the entire omz library. 4 | # if you want to use an oh-my-zsh theme, you may have to: 5 | # load colors: 6 | # autoload -U colors && colors 7 | # expand prompt: 8 | # setopt prompt_subst 9 | # helper functions for vcs that many themes use: 10 | # robbyrussell/oh-my-zsh kind:zsh path:lib/git.zsh 11 | robbyrussell/oh-my-zsh kind:zsh path:lib/completion.zsh 12 | robbyrussell/oh-my-zsh kind:zsh path:lib/history.zsh 13 | robbyrussell/oh-my-zsh kind:zsh path:lib/key-bindings.zsh 14 | 15 | # completions (bunch of BLOAT try to pare this down) 16 | zsh-users/zsh-completions kind:fpath path:src 17 | 18 | # docker completions 19 | # https://github.com/docker/cli/blob/master/contrib/completion/zsh/_docker 20 | docker/cli kind:fpath path:contrib/completion/zsh 21 | docker/compose kind:fpath path:contrib/completion/zsh 22 | 23 | # open GitHub from cli 24 | peterhurford/git-it-on.zsh 25 | 26 | # good ch dir backward (helpful for very nested projects) 27 | Tarrasch/zsh-bd 28 | 29 | # ranking of directories 30 | #export _Z_DATA="$HOME/.cache/z" 31 | agkozak/zsh-z 32 | 33 | # include a notification for long-running commands or nonzero return codes 34 | # make sure to install terminal-notifier (Mac) or notify-send (Linux) 35 | #marzocchi/zsh-notify 36 | 37 | # bundles (and env vars) 38 | zsh-users/zsh-syntax-highlighting 39 | 40 | # nix zsh completions 41 | spwhitt/nix-zsh-completions kind:fpath 42 | 43 | # fish-like command suggestions 44 | zsh-users/zsh-autosuggestions 45 | 46 | # macOS window manager 47 | Amar1729/yabai-zsh-completions kind:fpath path:src 48 | 49 | # simple custom completions (tmux-a) 50 | https://gist.github.com/Amar1729/6b0008cf065872a49ceff674a85363bd kind:fpath 51 | 52 | # theme 53 | romkatv/powerlevel10k 54 | 55 | # lazy-load commands 56 | qoomon/zsh-lazyload 57 | 58 | # fuzzy wrappers for git 59 | wfxr/forgit 60 | 61 | # wrapper (fuzzy/tab completion) for python tooling 62 | andydecleyre/zpy 63 | -------------------------------------------------------------------------------- /encrypted_dot_pypirc.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP MESSAGE----- 2 | 3 | hQIMA3KsKHrErx1mARAAxxnSIx9PDZgNjw4+Xb8ACUlRdjbiVYkc5TlEEz1qjZg6 4 | F07ZvBLz0pukzkxpxrq/0z7VBdFmX47GP+th9dHskl5ZGWsYqee5Gd/As5szLe4H 5 | uZTS19R/ftGExHyRaPNAVgdYqqDn49jyHncwqtVf6DuMo/dRyCFV6CnLIiV9ptod 6 | c/xPOji6pHGqS+gXYS0jt36gslIXXftaM8IA4+E3+5HChlss4BiPzjJ2bh2MQH6v 7 | C6NJyqKE9hwxImimGNLx3MEM0dXwXro9x+cy4N3oSUTl1q7sDzaTemj11Wy+qgub 8 | hZ5JJNDe0b28pBn6Q0Z8251cLccYRXvxpqN+4BwUdBzlxde51ijoEnG8WRydQwGR 9 | dEunr+beM9KBFJ6R7pkoEyTwaF7D770c1sMDET+ldyI7+XJ2QDeEVoJnKYEUub1O 10 | K/g6wj/AVU13OaTJvwvZCJCH3k2yRLPiuYS3PURUUh0whwcgeYhk0yyugBvjF3Lu 11 | If/JAdQDce0FSNQixQIayCnNfQ/R8pLxb74lcGsv5V11eDFcPnJUR3thcxcQcJwt 12 | 4yT+uvvvWG+k2myOvcHTXcGCuZVwXmBwGLvtRwYmPEtsOr904n08BaTNTqoSbaIz 13 | X7VUHFygX9J5/UG+y4YDq78AVbr4ZiCswNpY7sbc0w0vYg3GhUjFVQcMnfFJ3XbS 14 | wNkBLtilvwbt47ADUAigCfAMCxsLoCD2MkhRKGDRT4sw5nm+82sBi+Aa4Jq8Pr85 15 | 1ktFTobne+OuEiNSCD7cF7j2RS+aMlJlVDLQsWyHSiM9WY5Sm27TrMDnZZOXtf4i 16 | qaebaCtSMuWPMz072mybB6hDCKALX2GNjAZR/9KTXHIOyqfAZw2W4dpBo22Z+1qF 17 | inbDx3B2p88GvtRKnjMNFL3s7lZnKt141QgXAqeps+YDI+/Nzy5qOs4XYPHEJ9d3 18 | oBAhWHsNWkkY49w++UXk/d56JCKGUpl8x7u7zl9j1DbbTOLj5m/+ugc06DcE0Alb 19 | VU7KdOczJoX2xBUfqIQ2HZJuk9NmFW64DSSpp/WiB1KcFFiWvzKPcXzMxvaRte+H 20 | 3F3ZNEvnFZAAUJOAp/YSkqNbxZF75OaespDHSkGwYtTqgMkUm4CuDiXY5IO7YXvv 21 | SjwjBz6huyeQSH4K7mNQdE49F5N8nj1OT/JrFIi+eL/UCHKVgoc5JuUQXIf1rGCp 22 | gCtaLygGMoWoxyblnq22W+q6T6MwHy4QXpYA 23 | =PPC4 24 | -----END PGP MESSAGE----- 25 | -------------------------------------------------------------------------------- /encrypted_private_dot_gist.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP MESSAGE----- 2 | 3 | hQIMA3KsKHrErx1mAQ/9FEzmzA7tAw+aKz9FWzjYTI2LFsoUHuIBK7BQnYTZhyuG 4 | J70iANR+2jGEUMLTbdxeFLoM1SkOa2HNss1Gcrs63NzRckxSiORgCPgtVQDwWQ7y 5 | U8LMqfq5ePCSveIZiZsTRI5hUuHszjDm5WAK7lcTvL9/UWHt8IeXtW35lsn+dMnr 6 | kRvExmMzecb93ZIlH9j9IkGxgGaV1ATMC9X9Djg1yr/127eAgoILUIZ1y8hkXcQs 7 | tMNjCGuaK4yDF7boCoZ4WN/MEMpndV2FBbVvkbVPk+LK9Y/XfL0PH7Hf/lB2mQwx 8 | IDz1YueZjRtdKsTuRN1u1FXNedwpmG1eKLwn8LhFfGpilH9qIaOTdc23znksDO2d 9 | 6NMTiBMh+ZygwXgeKMRYdpZNyYy306YloQ3qG3zAOhtXCubrbF4vuOM40q2XAgNJ 10 | JW1Bma2+DWkXNsMVRXNQ/j7YdJEc1WlMWsA51wvKCfSttIyp2YQKPp9p5P1hM3wn 11 | S5825UB3b8XI2oilIL/4hHaRYDXWu458/Q5iam6OxmWysB4+d0dI/2g4xPBO8O8N 12 | EzkPxwEB64zjPkmXvq8Ygm09ANf2Q6gQVcpKgJbz7eJysqFX1VMVbP2ZY5NWM0XB 13 | VV+drtgXy81HUMXtMGaX3crVH0yU8InT0a+4JN0kzZhFaT2Imz/AivP0VtrlfoTS 14 | bAGdTEuynPcRlvwRxH6B14wyysAvXb/rDJBNE9eltEPFHTxUCmkxxSxK/hkuN8Cf 15 | Z74cJRNI1zi0bWUuvsgXcL/xKLJmVor/uW7hTi1htfwq18zXuK4QKRxg863ypqAs 16 | wMAlpqVWBQ49AaDcfQ== 17 | =lhRv 18 | -----END PGP MESSAGE----- 19 | -------------------------------------------------------------------------------- /executable_dot_xinitrc: -------------------------------------------------------------------------------- 1 | # xinitrc 2 | # after sourcing .xprofile, set up daemons (e.g. picom, dunst) and start window manager 3 | 4 | [ -f ~/.xprofile ] && . ~/.xprofile 5 | 6 | # try setting resolution here? 7 | # nope! doesn't work ... 8 | # idk where to set this damn resolution 9 | #xrandr --output eDP-1 --mode 1920x1440 10 | 11 | # consider adding this: switches off the monitor backlight when screen is locked (how lock?) 12 | #xset dpms force off 13 | 14 | sh ~/.fehbg 15 | 16 | xflux -z 21230 & 17 | 18 | #autocutsel -fork 19 | autocutsel -selection PRIMARY -fork 20 | 21 | # touch gestures 22 | libinput-gestures-setup start 23 | 24 | dunst & 25 | 26 | # giview shows this as its own window 27 | # xwinwrap just gets confused (hangs) on trying to display the gif 28 | # NOTE - try this again since i forgot the ending ampersand 29 | #/opt/src/xwinwrap/xwinwrap -fs -debug -- gifview --geometry 2880x1440 -a ~/Downloads/rainy-cafe.gif & 30 | 31 | # ~dat sweet transparency~ 32 | picom -b --shadow --no-dnd-shadow --shadow-radius=30 --shadow-opacity=0.9 33 | 34 | exec >>~/.xsession-errors 2>&1 35 | 36 | # Here 37 | # we 38 | # gooooooooo 39 | exec bspwm -c $HOME/.config/bspwm/bspwmrc 40 | -------------------------------------------------------------------------------- /executable_dot_xprofile: -------------------------------------------------------------------------------- 1 | # source from .xinitrc 2 | # contains general "profile" things e.g. keybinds 3 | 4 | export LANG="en_US.UTF-8" 5 | 6 | xrdb ~/.Xresources 7 | 8 | # note - i have some rebindings e.g. caps lock -> escape here. 9 | # these obviously will only work inside x sessions; use loadkeys 10 | # for rebinding system-wide (e.g. a multi-user.terminal?) 11 | xmodmap ~/.Xmodmap 12 | 13 | #xset +fp ~/.fonts 14 | # https://github.com/sunaku/tamzen-font 15 | #xset +fp ~/.fonts/tamzen-font/bdf/ 16 | #xset +fp ~/.fonts/tamzen-font/dfont/ 17 | #xset fp rehash 18 | #xset -b 19 | 20 | xsetroot -cursor_name left_ptr 21 | -------------------------------------------------------------------------------- /executable_dot_yabairc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # global settings 4 | yabai -m config mouse_follows_focus on 5 | yabai -m config focus_follows_mouse autoraise 6 | 7 | yabai -m config window_topmost off 8 | yabai -m config window_opacity off 9 | yabai -m config window_shadow off 10 | yabai -m config insert_feedback_color 0xffd75f5f 11 | yabai -m config split_ratio 0.50 12 | yabai -m config auto_balance off 13 | yabai -m config mouse_modifier fn 14 | yabai -m config mouse_action1 resize 15 | yabai -m config window_zoom_persist off 16 | 17 | # borders (RIP) 18 | yabai -m config window_border on 19 | yabai -m config window_border_width 2 20 | yabai -m config window_border_blur off 21 | yabai -m config window_border_radius 0 22 | yabai -m config active_window_border_color 0xffebdbb2 23 | yabai -m config normal_window_border_color 0x00505050 24 | 25 | # general space settings 26 | yabai -m config layout bsp 27 | yabai -m config top_padding 30 28 | yabai -m config bottom_padding 5 29 | yabai -m config left_padding 5 30 | yabai -m config right_padding 5 31 | yabai -m config window_gap 5 32 | 33 | # "monocle" mode for space 1 34 | yabai -m config --space 1 layout stack 35 | 36 | # borders are timing out oddly (being redrawn behind app windows?) for me. 37 | # these signals to toggle borders off/on on window change seem to resolve issue. 38 | 39 | # borders are doing weird things in yabai right now. disable until fixed. 40 | # yabai -m signal --add event=application_front_switched \ 41 | # action="yabai -m config window_border off; yabai -m config window_border on" \ 42 | # label=window-border-reset-front_switched 43 | # 44 | # yabai -m signal --add event=window_focused \ 45 | # action="yabai -m config window_border off; yabai -m config window_border on" \ 46 | # label=window-border-reset-focused 47 | 48 | yabai -m signal --add event=space_changed \ 49 | action="wp --alacritty" \ 50 | label=alacritty-color-reload 51 | 52 | # float system apps 53 | yabai -m rule --add app="^System Preferences$" manage=off 54 | yabai -m rule --add app="^Finder$" manage=off 55 | yabai -m rule --add app="^Calculator$" manage=off 56 | yabai -m rule --add app="^Disk Utility$" manage=off 57 | yabai -m rule --add app="^Activity Monitor$" manage=off 58 | yabai -m rule --add app="^Installer$" manage=off 59 | yabai -m rule --add app="^System Information$" manage=off 60 | 61 | # float user apps 62 | yabai -m rule --add app="^python$" manage=off 63 | yabai -m rule --add app="^python$" manage=off 64 | yabai -m rule --add app="^python3$" manage=off 65 | yabai -m rule --add app="^Karabine$" manage=off 66 | yabai -m rule --add app="^Karabiner" manage=off 67 | # "app":"Karabiner-Elements", 68 | # "title":"Karabiner-Elements Preferences", 69 | yabai -m rule --add app="^Font Book$" manage=off 70 | yabai -m rule --add app="^Harmony$" manage=off 71 | yabai -m rule --add app="^Docker Desktop$" manage=off 72 | yabai -m rule --add app="^qemu-system-aarch64" manage=off 73 | yabai -m rule --add app="^VMware Fusion" manage=off 74 | yabai -m rule --add app="^VLC" manage=off 75 | yabai -m rule --add app="^Screen Sharing" manage=off 76 | 77 | # manage work apps 78 | yabai -m rule --add app="^Microsoft Outlook$" grid=90:160:1:1:158:88 79 | yabai -m rule --add app="^Cisco AnyConnect Secure Mobility Client$" manage=off 80 | yabai -m rule --add app="^Pulse Secure$" manage=off 81 | yabai -m rule --add app="^Oracle VM VirtualBox Manager$" manage=off 82 | yabai -m rule --add app="^VirtualBox$" manage=off 83 | yabai -m rule --add app="^VirtualBox VM$" manage=off 84 | yabai -m rule --add app="^zoom.us$" manage=off 85 | yabai -m rule --add app="Ghidra" title="Ghidra*" manage=off 86 | yabai -m rule --add app="Approve" title="Approve" manage=off 87 | yabai -m rule --add app="Microsoft Remote Desktop" manage=off 88 | 89 | # whenever a PiP window is opened, center it on its parent 90 | yabai -m signal --add \ 91 | label="Resize Firefox PiP windows to match parent" event=window_created \ 92 | app="Firefox" title="Picture-in-Picture" \ 93 | action="$HOME/.bin/yabai-resize-pip $"'YABAI_WINDOW_ID' 94 | 95 | echo "yabai configuration loaded.." 96 | -------------------------------------------------------------------------------- /private_Library/private_Application Support/private_Abricotine/app/themes/gruvbox/theme.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Abricotine Gruvbox", 3 | "label": "Abricotine Gruvbox", 4 | "author": "Amar Paul", 5 | "description": "Gruvbox theme (based off of morhetz/gruvbox) for Abricotine", 6 | "license": "MIT" 7 | } 8 | -------------------------------------------------------------------------------- /private_Library/private_Application Support/private_ruff/ruff.toml.tmpl: -------------------------------------------------------------------------------- 1 | {{- template "ruff.toml" . -}} 2 | -------------------------------------------------------------------------------- /private_Library/private_Application Support/pypoetry/private_config.toml: -------------------------------------------------------------------------------- 1 | [virtualenvs] 2 | in-project = true 3 | -------------------------------------------------------------------------------- /private_dot_gnupg/gpg-agent.conf.tmpl: -------------------------------------------------------------------------------- 1 | {{ if (eq .chezmoi.arch "arm64") -}} 2 | pinentry-program /opt/homebrew/bin/pinentry-prefer-tty 3 | {{ else -}} 4 | pinentry-program /usr/local/bin/pinentry-prefer-tty 5 | {{- end }} 6 | -------------------------------------------------------------------------------- /run_once_after_30-plugin-installation.sh.tmpl: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | set -eo pipefail 4 | 5 | # bundle zsh plugins 6 | antibody bundle < "$HOME/.zsh_plugins.txt" > "$HOME/.zsh_plugins.zsh" 7 | 8 | # change to zsh 9 | if [[ -f /etc/shells ]]; then 10 | if ! grep "$(which zsh)" /etc/shells; then 11 | which zsh | sudo tee -a /etc/shells 12 | fi 13 | fi 14 | 15 | if [[ -z "$SHELL" ]]; then 16 | if [[ "$SHELL" != *"zsh" ]]; then 17 | chsh -s $(which zsh) $(whoami) 18 | fi 19 | fi 20 | 21 | # install plugins for neovim - not sure best way to do with packer 22 | # nvim -c ":q" 23 | 24 | # tmux plugin manager 25 | if [[ ! -d "$HOME/.tmux/plugins/" ]]; then 26 | mkdir -p "$HOME/.tmux/plugins/" 27 | git clone https://github.com/tmux-plugins/tpm "$HOME/.tmux/plugins/tpm" 28 | fi 29 | 30 | pip3 config set list.format freeze 31 | poetry config virtualenvs.in-project true 32 | {{ if .work -}} 33 | poetry config certificates.proxied_pypi.cert "$HOME/.certs/full_cert.crt" 34 | {{- end }} 35 | 36 | # random scripts i've written 37 | if [[ ! -d "$HOME/.bin" ]]; then 38 | git clone https://github.com/Amar1729/bin.git "$HOME/.bin" 39 | fi 40 | 41 | {{ if (eq .chezmoi.os "darwin") -}} 42 | # ubersicht bar 43 | if [[ ! -d "$HOME/.config/ubersicht/widgets/simple-bar" ]]; then 44 | mkdir -p "$HOME/.config/ubersicht/widgets/" 45 | git clone https://github.com/Jean-Tinland/simple-bar.git "$HOME/.config/ubersicht/widgets/simple-bar" 46 | fi 47 | {{ end -}} 48 | 49 | # firefox minimal style 50 | {{ if (eq .chezmoi.os "darwin") -}} 51 | ( 52 | # most of the following commands are "|| true": assume if they fail then the 53 | # target state is up to date. 54 | # TODO: add --branch "ref" to the git clone commands 55 | mkdir -p ~/.config/mozilla/ 56 | git clone https://github.com/Amar1729/minimal-functional-fox \ 57 | ~/.config/mozilla/chrome || true 58 | 59 | if git clone https://github.com/MrOtherGuy/firefox-csshacks \ 60 | ~/.config/mozilla/firefox-csshacks; then 61 | 62 | # if successfully cloned this (i.e. if it wasn't already there) checkout to a known hash 63 | pushd ~/.config/mozilla/firefox-csshacks \ 64 | && git checkout 9276283311f46a146d1ea97a47041f3b3edce0a5 \ 65 | && popd 66 | fi 67 | 68 | # no -f: don't bother overwriting if the file's already there 69 | ln -sv ~/.config/mozilla/firefox-csshacks/chrome/autohide_sidebar.css \ 70 | ~/.config/mozilla/chrome/userChrome-sidebery.css || true 71 | 72 | sed -i'' -e "s|:HOME:|$HOME|" ~/.config/mozilla/chrome/userChrome.css 73 | 74 | # if Firefox profiles don't exist yet (right after app install), then launch ffox once 75 | if [[ ! -d "$HOME/Library/Application Support/Firefox/Profiles" ]]; then 76 | open -a Firefox 77 | fi 78 | for profile in "$HOME/Library/Application Support/Firefox/Profiles"/*.default-*; do 79 | ln -sfv "$HOME/.config/mozilla/chrome" "$profile" 80 | done 81 | ) 82 | # need to add (eq .chezmoi.os "linux") 83 | {{ end -}} 84 | -------------------------------------------------------------------------------- /run_once_after_50-karabiner.sh.tmpl: -------------------------------------------------------------------------------- 1 | {{- if (eq .chezmoi.os "darwin") -}} 2 | #!/usr/bin/env bash 3 | 4 | set -e 5 | 6 | mkdir -p "$HOME/.config/karabiner/assets/complex_modifications" 7 | 8 | for f in "$HOME"/.config/karabiner/scripts/*; do 9 | if [[ -x "$f" ]]; then 10 | nf="$(basename "$f")" 11 | jf="$HOME/.config/karabiner/assets/complex_modifications/${nf%%.*}.json" 12 | "$f" > "${jf}" 13 | 14 | echo "Created: $jf" 15 | fi 16 | done 17 | {{ end -}} 18 | -------------------------------------------------------------------------------- /run_once_after_60-python.sh.tmpl: -------------------------------------------------------------------------------- 1 | {{ if .work -}} 2 | #! /usr/bin/env bash 3 | 4 | set -e 5 | 6 | mkdir -p "$HOME/.certs" 7 | 8 | openssl s_client -connect pypi.org:443 -showcerts /dev/null | sed -e '/-----BEGIN/,/-----END/!d' > "$HOME/.certs/pypi.crt" 9 | 10 | printf "Internal URL from which to pull a proxy cert: " 11 | read INTERNAL 12 | openssl s_client -connect "$INTERNAL":443 -showcerts /dev/null | sed -e '/-----BEGIN/,/-----END/!d' > "$HOME/.certs/internal.crt" 13 | 14 | cat "$HOME"/.certs/{pypi.crt,internal.crt} > "$HOME/.certs/full_cert.crt" 15 | {{- end}} 16 | -------------------------------------------------------------------------------- /run_once_after_70-mac-defaults.sh.tmpl: -------------------------------------------------------------------------------- 1 | {{ if (eq .chezmoi.os "darwin") -}} 2 | #! /usr/bin/env bash 3 | 4 | # Tweak defaults on macOS 5 | 6 | # this article was extremely useful for figuring out defaults commands: 7 | # https://pawelgrzybek.com/change-macos-user-preferences-via-command-line/ 8 | # https://github.com/mathiasbynens/dotfiles/blob/master/.macos 9 | # essentially, you can use `defaults domains` and `defaults read` to figure out what you've changed 10 | 11 | # important defaults cmds 12 | # hide icons on the desktop: 13 | defaults write com.apple.finder CreateDesktop false 14 | defaults write org.macosforge.xquartz.X11 app_to_run /usr/local/bin/urxvt 15 | defaults write org.macosforge.xquartz.X11 app_to_run /usr/bin/true 16 | defaults write com.apple.dock no-bouncing -bool TRUE 17 | sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate.plist AutomaticDownload -bool NO 18 | 19 | # make arm macOS not choke out in certain xforwarding situations 20 | # https://github.com/XQuartz/XQuartz/issues/31 21 | defaults write org.xquartz.X11 enable_render_extension 0 22 | 23 | # disable things like screenshot/empty trash sound 24 | defaults write -g com.apple.sound.uiaudio.enabled -int 0 25 | 26 | # eff text autocorrection 27 | defaults write -g NSAutomaticCapitalizationEnabled -bool false 28 | defaults write -g NSAutomaticPeriodSubstitutionEnabled -bool false 29 | defaults write -g NSAutomaticSpellingCorrectionEnabled -bool false 30 | defaults write -g NSAutomaticDashSubstitutionEnabled -bool false 31 | defaults write -g NSAutomaticQuoteSubstitutionEnabled -bool false 32 | defaults write -g NSAutomaticTextCompletionEnabled -bool false 33 | 34 | # immediately ask for PW after locking screen 35 | defaults write com.apple.screensaver askForPassword -int 1 36 | defaults write com.apple.screensaver askForPasswordDelay -int 0 37 | 38 | # Top left screen corner -> Screen Saver 39 | defaults write com.apple.dock wvous-tl-corner -int 5 40 | defaults write com.apple.dock wvous-tl-modifier -int 0 41 | 42 | # ---- ---- 43 | 44 | # unload itunes media key agent 45 | # (this agent auto-opens iTunes/Music if you press back, play/pause, forward function keys 46 | launchctl unload -w /System/Library/LaunchAgents/com.apple.rcd.plist 47 | 48 | # ---- ---- 49 | 50 | # trackpad 51 | 52 | # Trackpad > Scroll & Zoom > Scroll direction: Natural 53 | defaults write -g com.apple.swipescrolldirection -bool false 54 | 55 | # Trackpad > Point & Click > Tap to click 56 | defaults -currentHost write -g com.apple.mouse.tapBehavior 1 57 | defaults write com.apple.AppleMultiTouchTrackpad Clicking '1' 58 | 59 | # Trackpad > More Gestures > Swipe between pages: swipe with three fingers 60 | # this doesnt totally work? 61 | # defaults write -g AppleEnableSwipeNavigateWithScrolls -bool false 62 | # defaults write com.apple.AppleMultiTouchTrackpad TrackpadThreeFingerHorizSwipeGesture -bool True 63 | # defaults write com.apple.AppleMultiTouchTrackpad TrackpadThreeFingerVertSwipeGesture -bool True 64 | 65 | # scale trackpad scaling past what system preferences allows 66 | defaults write -g com.apple.trackpad.scaling 420 67 | 68 | # ---- ---- 69 | 70 | # screenshot locations 71 | defaults write com.apple.screencapture location ~/Downloads 72 | 73 | # keyboard > shortcuts > app shortcuts 74 | 75 | # chrome 76 | defaults write com.google.Chrome NSUserKeyEquivalents -dict-add "Select Next Tab" '$\U2192' 77 | defaults write com.google.Chrome NSUserKeyEquivalents -dict-add "Select Previous Tab" '$\U2190' 78 | 79 | # firefox 80 | defaults write org.mozilla.firefox NSUserKeyEquivalents -dict-add "History" '@y' 81 | 82 | # vscode 83 | defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false 84 | 85 | {{ if .work -}} 86 | # outlook 87 | defaults write com.microsoft.Outlook NSUserKeyEquivalents -dict-add Calendar '$\U2192' 88 | defaults write com.microsoft.Outlook NSUserKeyEquivalents -dict-add Mail '$\U2190' 89 | {{- end }} 90 | 91 | # restart everything necessary 92 | pkill -u $(whoami) -f /System/Applications/System\ Preferences.app/Contents/MacOS/System\ Preferences 93 | killall SystemUIServer 94 | killall Finder 95 | 96 | # ---- ---- 97 | {{- end }} 98 | -------------------------------------------------------------------------------- /run_once_after_80-work-mac.py.tmpl: -------------------------------------------------------------------------------- 1 | {{ if (eq .chezmoi.os "darwin") -}} 2 | {{ if .work -}} 3 | #! /usr/bin/python2.7 4 | 5 | # set default mailto: link handler without having to sign into the damn mail.app 6 | # https://apple.stackexchange.com/questions/261881/set-default-mail-client-in-osx-without-adding-an-email-account 7 | # https://developer.apple.com/documentation/coreservices/1447760-lssetdefaulthandlerforurlscheme 8 | 9 | import LaunchServices 10 | result = LaunchServices.LSSetDefaultHandlerForURLScheme( 11 | "mailto", 12 | "com.microsoft.Outlook" 13 | ) 14 | print( 15 | "Result: %d (%s)" % ( 16 | result, 17 | "Success" if result == 0 else "Error" 18 | ) 19 | ) 20 | {{- end }} 21 | {{- end }} 22 | -------------------------------------------------------------------------------- /run_once_before_10-package-installation.sh.tmpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eufo pipefail 4 | 5 | function chezmoi () { 6 | if [[ -x "$HOME/bin/chezmoi" ]]; then 7 | "$HOME/bin/chezmoi" "$@" 8 | else 9 | command chezmoi "$@" 10 | fi 11 | } 12 | 13 | PKG_DIR="$(chezmoi source-path)"/dot_config/packages 14 | 15 | {{ if (eq .chezmoi.os "darwin") -}} 16 | 17 | xcode-select --install || true 18 | 19 | if ! command -v brew; then 20 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 21 | fi 22 | 23 | # generate with `brew bundle dump` 24 | brew bundle --no-lock --file="${PKG_DIR}/Brewfile" 25 | 26 | {{ if .work -}} 27 | brew bundle --no-lock --file="${PKG_DIR}/Brewfile-work" 28 | {{ else -}} 29 | brew bundle --no-lock --file="${PKG_DIR}/Brewfile-personal" 30 | {{- end }} 31 | 32 | /usr/local/bin/pip3 install --user pynvim jedi 33 | 34 | {{ else if (eq .chezmoi.os "linux") -}} 35 | {{ if (eq .chezmoi.osRelease.id "arch") -}} 36 | 37 | sudo pacman -Syu 38 | sudo pacman -S --needed - < "${PKG_DIR}/arch-pacman.txt" 39 | 40 | if ! command -v yay; then 41 | [[ -d /tmp/yay ]] && rm -rf /tmp/yay 42 | git clone https://aur.archlinux.org/yay-git.git /tmp/yay 43 | ( cd /tmp/yay && makepkg -si ) 44 | rm -rf /tmp/yay 45 | fi 46 | 47 | yay -S --needed - < "${PKG_DIR}/arch-aur.txt" 48 | 49 | {{ else if (eq .chezmoi.osRelease.id "ubuntu") -}} 50 | # probably a simple install: we're going to install some things manually. 51 | 52 | # reference for deleting the apt timer if it's there. 53 | # sudo -v || true 54 | # sudo systemctl stop unattended-upgrades 55 | # sudo systemctl disable apt-daily.timer 56 | # sudo systemctl disable apt-daily-upgrade.timer 57 | # sudo apt remove unattended-upgrades || true 58 | 59 | sudo apt update 60 | sudo apt upgrade -yq 61 | # xclip pass 62 | sudo apt install -y \ 63 | zsh curl git wget zip vim \ 64 | jq fzf fd-find ripgrep pipx 65 | 66 | # pip3 install --user pipx poetry 67 | 68 | # download bob (version manager for neovim) 69 | if [[ ! -x $HOME/.local/bin/bob ]]; then 70 | mkdir -p $HOME/.local/bin 71 | BOB_TAG="$(curl https://api.github.com/repos/MordechaiHadad/bob/releases/latest | jq -r '.tag_name')" 72 | wget https://github.com/MordechaiHadad/bob/releases/download/${BOB_TAG}/bob-linux-x86_64-openssl.zip -O /tmp/bob.zip && \ 73 | unzip -j /tmp/bob.zip -d $HOME/.local/bin && \ 74 | rm /tmp/bob.zip && \ 75 | chmod +x $HOME/.local/bin/bob 76 | fi 77 | 78 | # antibody 79 | # if ! which antibody; then 80 | # curl -sfL git.io/antibody | sudo sh -s - -b /usr/local/bin 81 | # fi 82 | 83 | if [[ ! -x $HOME/.local/bin/lazygit ]]; then 84 | LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | jq -r '.tag_name') 85 | curl -Lo /tmp/lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/download/${LAZYGIT_VERSION}/lazygit_${LAZYGIT_VERSION#v}_Linux_x86_64.tar.gz" 86 | tar xf /tmp/lazygit.tar.gz -C $HOME/.local/bin/ 87 | rm /tmp/lazygit.tar.gz 88 | fi 89 | 90 | {{- end }} 91 | 92 | {{- end }} 93 | 94 | {{ if .work }} 95 | # on work machines, we have artifactory set: 96 | pip config set global.index-url "{{ .pypi_artifactory }}" 97 | {{- end }} 98 | 99 | # install pipx pkgs 100 | # generate with `pipx list|grep package|awk '{print $2}'` 101 | if ! PIPX_CURRENT="$(pipx list | grep package | awk '{print $2}'|| true)"; then 102 | PIPX_CURRENT="" 103 | fi 104 | while read -r pkg || [[ -n "$pkg" ]]; do 105 | pkg="$(echo "$pkg" | sed -e 's|.*/||' -e 's|\.git.*||' -e '/pywal/d')" 106 | if ! grep "^${pkg}$" <<< "$PIPX_CURRENT" &>/dev/null; then 107 | pipx install --force "$pkg" 108 | fi 109 | done < "${PKG_DIR}/pipx.txt" 110 | 111 | # cargo install racer sccache 112 | --------------------------------------------------------------------------------