├── .gitignore ├── README.md ├── conda └── condarc ├── deploy.sh ├── firefox ├── stylus.json ├── surfing_keys.txt ├── treestyletab │ ├── config.json │ ├── custom-hover.css │ ├── custom.css │ └── stealth_tst.json └── user.js ├── git └── config ├── ipython_config.py ├── jupyter ├── jupyter_console_config.py └── jupyter_qtconsole_config.py ├── jupytext.toml ├── karabiner ├── assets │ └── complex_modifications │ │ └── 1615812172.json ├── backup.json └── karabiner.json ├── kitty ├── kitty.conf ├── macos-launch-services-cmdline └── themes │ ├── Atom.conf │ ├── Dracula.conf │ ├── nightfly.conf │ ├── onehalf-dark.conf │ ├── selenized-black.conf │ ├── selenized-dark.conf │ ├── selenized-light.conf │ ├── selenized-white.conf │ ├── snazzy.conf │ ├── sonokai-andromeda.conf │ ├── sonokai-atlantis.conf │ ├── sonokai-maia.conf │ └── sonokai-shusia.conf ├── lazygit └── config.yml ├── lf ├── cleaner.sh ├── icons ├── lfrc ├── previewer.sh └── utils.sh ├── neovide └── config.toml ├── nvim ├── after │ └── queries │ │ ├── markdown │ │ └── textobjects.scm │ │ └── python │ │ ├── highlights.scm │ │ ├── injections.scm │ │ └── textobjects.scm ├── data │ └── plenary │ │ └── filetypes │ │ └── fortran.lua ├── ftplugin │ ├── cuda.vim │ └── ipynb.vim ├── init.lua ├── lazy-lock.json ├── lua │ ├── config │ │ ├── autocmds.lua │ │ ├── keymaps.lua │ │ ├── lazy.lua │ │ ├── options.lua │ │ └── util.lua │ └── plugins │ │ ├── ai.lua │ │ ├── cmp.lua │ │ ├── coding.lua │ │ ├── colorschemes.lua │ │ ├── editor.lua │ │ ├── git.lua │ │ ├── hydra.lua │ │ ├── lsp.lua │ │ ├── python.lua │ │ ├── repl.lua │ │ ├── telescope.lua │ │ ├── treesitter.lua │ │ ├── ui.lua │ │ └── windows.lua └── snippets │ └── python.snippets ├── pixi └── config.toml ├── pudb ├── pudb.cfg └── stringifier.py ├── rclone └── rclone.conf ├── ruff └── pyproject.toml ├── starship.toml ├── stylua.toml ├── tmux └── tmux.conf ├── toshy └── toshy_config.py ├── wezterm └── wezterm.lua ├── yazi ├── init.lua └── yazi.toml └── zsh ├── znap-repos └── zshrc.zsh /.gitignore: -------------------------------------------------------------------------------- 1 | **.tags 2 | **.DS_Store 3 | 4 | karabiner/automatic_backups/ 5 | coc/ 6 | gh/config.yml 7 | 8 | lazygit/ 9 | pudb/saved-breakpoints* 10 | 11 | **packer_compiled** 12 | 13 | gcloud/ 14 | 15 | htop/htoprc 16 | **__pycache__/ 17 | 18 | nvim/site/ 19 | 20 | **.zwc 21 | mozilla/vpn.moz 22 | tmux/plugins 23 | btop 24 | github-copilot 25 | nvim/.neoconf.json 26 | pudb/internal-cmdline-history.txt 27 | .luarc.json 28 | nvim/lazyvim.json 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dotfiles 2 | Dotfiles, configuration for Zsh, Tmux, Neovim, Cvim ext, with install scripts on MacOS and Linux. 3 | 4 | - Use ZPlug for managing Zsh's plugins. 5 | - Use TMP for managing Tmux's plugins. 6 | - Use Vim-Plug for managing Neovim's plugins. 7 | -------------------------------------------------------------------------------- /conda/condarc: -------------------------------------------------------------------------------- 1 | channels: 2 | - conda-forge 3 | - defaults 4 | auto_activate_base: false 5 | changeps1: false 6 | -------------------------------------------------------------------------------- /deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | check_default_shell() { 4 | if [ -z "${SHELL##*zsh*}" ] ;then 5 | echo "Default shell is zsh." 6 | else 7 | echo -n "Default shell is not zsh. Do you want to chsh -s \$(which zsh)? (y/n)" 8 | old_stty_cfg=$(stty -g) 9 | stty raw -echo 10 | answer=$( while ! head -c 1 | grep -i '[ny]' ;do true ;done ) 11 | stty "$old_stty_cfg" && echo 12 | if echo "$answer" | grep -iq "^y" ;then 13 | chsh -s "$(which zsh)" 14 | else 15 | echo "Warning: Your configuration won't work properly. If you exec zsh, it'll exec tmux which will exec your default shell which isn't zsh." 16 | fi 17 | fi 18 | } 19 | 20 | echo "1. install HomeBrew package manager." 21 | echo "2. install various other software." 22 | echo "3. Make default shell to be zsh." 23 | echo "Let's get started? (y/n)" 24 | old_stty_cfg=$(stty -g) 25 | stty raw -echo 26 | answer=$( while ! head -c 1 | grep -i '[ny]' ;do true ;done ) 27 | stty "$old_stty_cfg" 28 | if echo "$answer" | grep -iq "^y" ;then 29 | echo 30 | else 31 | echo "Quitting, nothing was changed." 32 | exit 0 33 | fi 34 | 35 | ###### HOMEBREW ############ 36 | echo "Installed homebrew if not already." 37 | if ! [ -x "brew" ]; then 38 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 39 | fi 40 | ########################### 41 | 42 | 43 | brew install starship 44 | brew install bat 45 | brew install eza 46 | brew install git-delta 47 | brew tap tgotwig/linux-dust & brew install dust 48 | brew install duf 49 | brew install ripgrep 50 | brew install thefuck 51 | brew install fd 52 | brew tap cantino/mcfly & brew install mcfly 53 | brew install zoxide 54 | brew install neovim 55 | brew install lazygit 56 | brew install lf 57 | brew install btop 58 | brew install direnv 59 | brew install amethyst 60 | brew install stats 61 | 62 | check_default_shell 63 | 64 | 65 | echo 66 | echo -n "Would you like to backup your current dotfiles? (y/n) " 67 | old_stty_cfg=$(stty -g) 68 | stty raw -echo 69 | answer=$( while ! head -c 1 | grep -i '[ny]' ;do true ;done ) 70 | stty $old_stty_cfg 71 | if echo "$answer" | grep -iq "^y" ;then 72 | mv ~/.zshrc ~/.zshrc.old 73 | mv ~/.tmux.conf ~/.tmux.conf.old 74 | mv ~/.ipython/profile_default/ipython_config.py ~/.ipython/profile_default/ipython_config.py.old 75 | else 76 | echo -e "\nNot backing up old dotfiles." 77 | fi 78 | 79 | mkdir ~/.ipython/profile_default/ -p && ln -s ~/.config/ipython_config.py ~/.ipython/profile_default/ipython_config.py 80 | printf "source '$HOME/.config/zsh/zshrc.zsh'" >> "$HOME"/.zshrc 81 | 82 | echo 83 | echo "Please log out and log back in for default shell to be initialized." 84 | -------------------------------------------------------------------------------- /firefox/surfing_keys.txt: -------------------------------------------------------------------------------- 1 | map("F", "C"); // Capital F open link in new tab, normal f open link in current tab 2 | settings.tabsThreshold = 0; 3 | 4 | // Disable emoji popup. 5 | iunmap(":"); 6 | 7 | // 8 | settings.blacklistPattern = /.*\.ipynb$/i; 9 | 10 | // Roam stuff 11 | map("", 'd', /roamresearch\.com/i); 12 | map("", 'e', /roamresearch\.com/i); 13 | 14 | settings.clickableSelector = "*.roam-block, *.rm-block-ref, *.rm-title-display"; 15 | 16 | unmapAllExcept([ 17 | 'f', 'F', '/', 'C', '?', 't', 'T', 'S', 'D', '', 18 | 'E', 'R', 'cs', 'cS', ';fs', '', '', 'F', 19 | ], /roamresearch\.com/i); 20 | 21 | /// Shift-f to open link in sidebar 22 | const simulateMouseEvent = function(element, eventNames, { x, y } = {}, shiftKey = false) { 23 | if (typeof eventNames === 'string') eventNames = [eventNames]; 24 | eventNames.forEach(eventName => { 25 | element.dispatchEvent( 26 | // synchronous 27 | new MouseEvent(eventName, { 28 | view: window, 29 | bubbles: true, 30 | cancelable: true, 31 | clientX: x, 32 | clientY: y, 33 | button: 0, 34 | shiftKey 35 | }) 36 | ); 37 | }); 38 | }; 39 | mapkey('F', 'Roamclick', function () { 40 | Hints.create("", function (element, event) { 41 | simulateMouseEvent(element, ['mousedown', 'mouseup', 'click'], {x:0,y:0}, true); 42 | }); 43 | }, {domain: /roamresearch\.com/i}); 44 | -------------------------------------------------------------------------------- /firefox/treestyletab/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "chunkedUserStyleRules0": "I2FsbC10YWJzIHsKICAgIGJvcmRlcjogbm9uZSAhaW1wb3J0YW50Owp9Cgp0YWItaXRlbSB0YWItZmF2aWNvbiB7CiAgICBsZWZ0OiA3cHg7CiAgCW9yZGVyOiAtNAp9CgoKCnRhYi1pdGVtIC5sYWJlbCB7CiAgICBwYWRkaW5nLWJvdHRvbTogMnB4OwogICAgbWFyZ2luLWxlZnQ6IDExcHg7CiAgICBvcmRlcjogLTM7Cn0KCnRhYi1pdGVtIC50d2lzdHkgewogICAgZGlzcGxheSA6IG5vbmU7ICFpbXBvcnRhbnQ7Cn0KCgoKLnNvdW5kLWJ1dHRvbjphZnRlciB7CiAgICBtYXJnaW4tdG9wOiAycHg7Cn0KCi5jb3VudGVyIHsKICAgIGNvbG9yOiAjZmZmZmZmICFpbXBvcnRhbnQ7CiAgICBiYWNrZ3JvdW5kOiAjOTkyZjhkIWltcG9ydGFudDsKICAgIGJvcmRlci1yYWRpdXM6IDEwcHg7CiAgICBtYXJnaW46IDJweCAycHggMHB4IDBweDsKICAgIHBhZGRpbmc6IDAgOHB4OwogICAgcGFkZGluZy1ib3R0b206IDJweDsKICAgIG9yZGVyOiAtMiAhaW1wb3J0YW50Owp9CgouY291bnRlcjpiZWZvcmUsCi5jb3VudGVyOmFmdGVyIHsKICAgIGNvbnRlbnQ6ICIiOwp9Cgp0YWItaXRlbS5kaXNjYXJkZWQgLmxhYmVsLWNvbnRlbnQgewogIGNvbG9yOiAjN0U3RTdFOwp9Cgp0YWItaXRlbS5kaXNjYXJkZWQgdGFiLWZhdmljb24gewogIG9wYWNpdHk6IDAuNSAhaW1wb3J0YW50OwogIAp9CgoKI3RhYmJhciB0YWItaXRlbSB0YWItaXRlbS1zdWJzdGFuY2U6bm90KDpob3ZlcikgdGFiLWNsb3NlYm94IHsKICBkaXNwbGF5OiBub25lOwp9CgoKOnJvb3QubGVmdCB0YWItaXRlbSB0YWItZmF2aWNvbiB7CiAgICB0cmFuc2Zvcm06IHNjYWxlKDEyMCUpOwogICAgbWFyZ2luLXJpZ2h0OiA1cHg7Cn0KCnRhYi1pdGVtOm5vdChbZGF0YS1sZXZlbD0iMCJdKSB7CiAgICBib3JkZXItbGVmdDogc29saWQgM3B4ICM2YzY4YjcgIWltcG9ydGFudDsKfQp0YWItaXRlbTpub3QoW2RhdGEtbGV2ZWw9IjAiXSkgdGFiLWZhdmljb24gewogICAgbWFyZ2luLWxlZnQgOiAtMnB4ICFpbXBvcnRhbnQ7Cn0KdGFiLWl0ZW1bZGF0YS1sZXZlbD0iMSJdIHsKICAgIGJvcmRlci1sZWZ0OiBzb2xpZCAzcHggI2M5NGY2ZCAhaW1wb3J0YW50Owp9Cgp0YWItaXRlbVtkYXRhLWxldmVsPSIyIl0gewogICAgYm9yZGVyLWxlZnQ6IHNvbGlkIDNweCAjZGJjMDc0ICFpbXBvcnRhbnQ7Cn0KCnRhYi1pdGVtW2RhdGEtbGV2ZWw9IjMiXSB7CiAgICBib3JkZXItbGVmdDogc29saWQgM3B4ICM1Y2I4ODcgIWltcG9ydGFudDsKfQoKdGFiLWl0ZW0ucGlubmVkIHsKICAgIG1hcmdpbi1sZWZ0OiA1cHggIWltcG9ydGFudDsKICAgIHBhZGRpbmc6IDBweCAhaW1wb3J0YW50Owp9Cgp0YWItaXRlbS5waW5uZWQgdGFiLWZhdmljb24gewogICAgbWFyZ2luLWxlZnQ6IC03cHggIWltcG9ydGFudDsKICAgIHBhZGRpbmc6IDBweCAhaW1wb3J0YW50Owp9CgojdGFiYmFyLm92ZXJmbG93IHsgc2Nyb2xsYmFyLXdpZHRoOiBub25lOyB9IAoKOnJvb3Quc2lkZWJhciAjYmFja2dyb3VuZCB7CiAgYmFja2dyb3VuZDogIzJCMkEzMzsKfQo=", 3 | "colorScheme": "system-color", 4 | "configsVersion": 25, 5 | "delayForDuplicatedTabDetection": 20, 6 | "enableMacOSBehaviors": true, 7 | "optionsExpandedSections": [ 8 | "section-newTab", 9 | "section-drag", 10 | "section-appearance" 11 | ], 12 | "showExpertOptions": true, 13 | "style": "proton", 14 | "syncDevices": { 15 | "device-1623579496351-41772": { 16 | "id": "device-1623579496351-41772", 17 | "name": "Firefox on macOS", 18 | "icon": "device-desktop", 19 | "timestamp": 1623579498082 20 | } 21 | }, 22 | "userStyleRules": "", 23 | "userStyleRulesFieldHeight": "130px" 24 | } -------------------------------------------------------------------------------- /firefox/treestyletab/custom-hover.css: -------------------------------------------------------------------------------- 1 | :root{ 2 | --dark-0: #151D28; 3 | --dark-base: #192330; 4 | --dark-1: #233143; 5 | --dark-2: #2A3B51; 6 | --dark-3: #374E6C; 7 | --dark-4: #3E5879; 8 | --light-0: #D7DFEA; 9 | --light-base: #afc0d5; 10 | --light-1: #A1B5CE; 11 | --light-2: #D1DAE6; 12 | --light-3: #87A0C0; 13 | --light-4: #7996B9; 14 | --accent: #63cdcf; 15 | --yellow: #dbc074; 16 | --green: #5cb8a7; 17 | --red: #c94f6d; 18 | --extension-icon-mask: grayscale(45%) invert(75%) sepia(8%) saturate(862%) hue-rotate(173deg) brightness(88%); 19 | } 20 | 21 | :root.incognito{ 22 | --dark-0: #1C0E34; 23 | --dark-base: #20103c; 24 | --dark-1: #2F1D4E; 25 | --dark-2: #38225D; 26 | --dark-3: #4A2D7B; 27 | --dark-4: #53338A; 28 | --light-0: #CC6B9C; 29 | --light-base: #B9407C; 30 | --light-1: #AB3B73; 31 | --light-2: #9C3569; 32 | --light-3: #8D305E; 33 | --light-4: #7D2B54; 34 | --accent: #e9207e; 35 | --yellow: #C9B336; 36 | --green: #36C987; 37 | --red: #C9365D; 38 | --extension-icon-mask: grayscale(85%) invert(13%) sepia(80%) saturate(3107%) hue-rotate(256deg) brightness(84%) contrast(93%); 39 | } 40 | 41 | :root{ 42 | --tab-border-radius: 7px; /* border radius of tabs */ 43 | --animation-duration: 200ms; /* duration of different animations [0s: turn all animations off] */ 44 | --spacing: 14px; /* spacing between tabs. [<15px: compact tabs] */ 45 | --distance-from-edge: 7px; /* distance between tabs, and left-right edges of sidebar*/ 46 | --hover-text-spacing: 0.4; /* should be left alone. with hover sidebar, if text is visible in collapsed status, increase this */ 47 | 48 | 49 | --ease-in: cubic-bezier(0.32, 0, 0.67, 0); 50 | --ease-out: cubic-bezier(0.22, 1, 0.36, 1); 51 | --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1); 52 | 53 | --collapsed-width: 60px; 54 | 55 | --contextual-identity-color-blue: #63B3ED; 56 | --contextual-identity-color-orange: #F6AD55; 57 | --contextual-identity-color-green: #68D391; 58 | --contextual-identity-color-pink: #F687B3; 59 | } 60 | 61 | /************UNCUSTOMIZED CSS************/ 62 | #tabbar-container #tabbar{ 63 | margin-bottom: 15px !important; 64 | } 65 | 66 | :root, #background{ 67 | background: var(--dark-base) !important; 68 | } 69 | 70 | #all-tabs{ 71 | margin: 10px var(--distance-from-edge); 72 | } 73 | 74 | tab-item:not(.collapsed) { 75 | margin-top: var(--spacing); 76 | border-radius: var(--tab-border-radius); 77 | border: none !important; 78 | padding-top: 9px; 79 | padding-bottom: 10px; 80 | } 81 | 82 | tab-item.collapsed{ 83 | height: 0; 84 | margin: 0 !important; 85 | padding: 0 !important; 86 | } 87 | 88 | tab-item:not([data-level="0"]):not(.pinned){ 89 | border-left: dashed 2px var(--light-4) !important; 90 | border-top-left-radius: 0; 91 | border-bottom-left-radius: 0; 92 | margin-top: calc(var(--spacing)/2); 93 | } 94 | 95 | tab-item tab-favicon{ 96 | left: 0; 97 | filter: var(--extension-icon-mask); 98 | transition: transform calc(var(--animation-duration)*2) var(--ease-out); 99 | } 100 | 101 | .highlighter { 102 | display: none !important; 103 | } 104 | 105 | tab-item .label { 106 | color: var(--light-2) !important; 107 | padding-bottom: 2px; 108 | } 109 | 110 | tab-item .twisty:before{ 111 | background: var(--light-3) !important; 112 | } 113 | 114 | tab-item.active .label { 115 | color: var(--light-0) !important; 116 | } 117 | 118 | tab-item.active { 119 | background: var(--dark-3) !important; 120 | } 121 | 122 | 123 | tab-item:not(.active).highlighted{ 124 | background: var(--dark-1) !important; 125 | } 126 | 127 | tab-item:not(active):hover { 128 | background: var(--dark-1); 129 | } 130 | 131 | tab-item:hover tab-closebox { 132 | right: 10px; 133 | opacity: 1; 134 | } 135 | 136 | tab-item:not(pinned) tab-closebox { 137 | position: absolute; 138 | margin-top: 2px; 139 | height: 20px; 140 | width: 20px; 141 | right: -30px; 142 | border-radius: 50%; 143 | padding-top: 2px; 144 | padding-left: 2px; 145 | background: var(--light-4); 146 | transition : all var(--animation-duration) var(--ease-out); 147 | } 148 | 149 | .sound-button:after { 150 | background: var(--light-3) !important; 151 | margin-right: 5px; 152 | } 153 | 154 | .counter{ 155 | color: var(--light-4) !important; 156 | background: var(--dark-2) !important; 157 | border-radius: 7px; 158 | margin: 2px 4px 0px 0px; 159 | padding: 0 4px; 160 | padding-bottom: 2px; 161 | order: -1 !important; 162 | } 163 | 164 | .counter:before, .counter:after{ content: ""} 165 | 166 | /********LEFT CONTENT TAB(hover)*************/ 167 | 168 | :root.left tab-item{ 169 | padding-left: 0px; 170 | } 171 | 172 | :root.left tab-item tab-favicon { 173 | order: 10 !important; 174 | margin-right: calc(var(--collapsed-width)*0.25) !important; 175 | transform: scale(120%) translateX(0px) !important; 176 | } 177 | 178 | :root.left tab-item .sound-button:after { 179 | transform: translateX(0px); !important; 180 | transition: all calc(var(--animation-duration)*2.2) var(--ease-out) !important; 181 | } 182 | 183 | :root.left tab-item .label{ 184 | transform: translateX(0px); 185 | margin-right: calc(var(--collapsed-width)*var(--hover-text-spacing)) !important; 186 | transition: all var(--animation-duration) var(--ease-out); 187 | } 188 | 189 | :root.left tab-item:not(.pinned):hover tab-favicon { 190 | transform: scale(120%) translateX(-20px) !important; 191 | } 192 | 193 | :root.left tab-item:not([data-child-ids]):hover .label { 194 | transform: translateX(-15px); 195 | } 196 | 197 | :root.left tab-item:hover .sound-button:after{ 198 | transform: translateX(-25px); 199 | } 200 | 201 | :root.left tab-item[data-child-ids] .twisty{ 202 | margin-left: 5px; 203 | } 204 | 205 | /***********************************/ 206 | 207 | .tab 208 | .favicon 209 | .favicon-default::before { 210 | filter: var(--extension-icon-mask); /* change for light theme */ 211 | } 212 | 213 | .tab[data-current-favicon-uri="undefined"] 214 | .favicon 215 | .favicon-default::before{ 216 | background: url("chrome://branding/content/identity-icons-brand.svg") no-repeat center !important; 217 | mask: none !important; 218 | } 219 | 220 | /***********NEW TAB BUTTON**********/ 221 | 222 | .newtab-button-box { 223 | border: none !important; 224 | margin: 0 50px; 225 | } 226 | 227 | .newtab-button { 228 | border: none !important; 229 | border-radius: 8px; 230 | padding: 8px 0 !important; 231 | margin: 0 5px; 232 | } 233 | 234 | .newtab-button::before{ 235 | background: var(--light-3) !important; 236 | } 237 | 238 | .newtab-action-selector-anchor { 239 | border: none !important; 240 | margin-right: 10px; 241 | margin-top: 3px; 242 | } 243 | 244 | .newtab-button:hover { 245 | background: var(--dark-1); 246 | } 247 | 248 | /**********PINNED TAB***************/ 249 | 250 | tab-item.pinned { 251 | margin: 5px !important; 252 | padding: 5px !important; 253 | transition : all 0.1s var(--ease-out); 254 | } 255 | 256 | /**********CONTAINERS***************/ 257 | 258 | .contextual-identity-marker{ 259 | position: absolute !important; 260 | /* 261 | left: 0 !important 262 | */ 263 | right: 0 !important; 264 | top: 0 !important; 265 | bottom: 0 !important; 266 | } 267 | 268 | tab-item.active .contextual-identity-marker { 269 | display: none !important; 270 | } 271 | 272 | .contextual-identity-firefox-container-1:not(.active), 273 | .contextual-identity-firefox-container-2:not(.active), 274 | .contextual-identity-firefox-container-3:not(.active), 275 | .contextual-identity-firefox-container-4:not(.active){ 276 | border-top-left-radius: 0px !important; 277 | border-bottom-left-radius: 0px !important; 278 | } 279 | 280 | tab-item.active.contextual-identity-firefox-container-1 { 281 | background: linear-gradient(to right, #3182CE , #0BC5EA) !important; 282 | } 283 | 284 | tab-item.active.contextual-identity-firefox-container-2 { 285 | background: linear-gradient(to right, #38A169 , #38B2AC) !important; 286 | } 287 | 288 | tab-item.active.contextual-identity-firefox-container-3 { 289 | background: linear-gradient(to right, #DD6B20 , #F56565) !important; 290 | } 291 | 292 | tab-item.active.contextual-identity-firefox-container-4 { 293 | background: linear-gradient(to right, #D53F8C , #9F7AEA) !important; 294 | } 295 | 296 | /***********************************/ 297 | 298 | #all-tabs { 299 | border: none !important; 300 | } 301 | 302 | -------------------------------------------------------------------------------- /firefox/treestyletab/custom.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --dark-0: #151d28; 3 | --dark-base: #192330; 4 | --dark-1: #233143; 5 | --dark-2: #2a3b51; 6 | --dark-3: #374e6c; 7 | --dark-4: #3e5879; 8 | --light-0: #d7dfea; 9 | --light-base: #afc0d5; 10 | --light-1: #a1b5ce; 11 | --light-2: #94abc7; 12 | --light-3: #87a0c0; 13 | --light-4: #7996b9; 14 | --accent: #63cdcf; 15 | --yellow: #dbc074; 16 | --green: #5cb8a7; 17 | --red: #c94f6d; 18 | --extension-icon-mask: grayscale(85%) invert(75%) sepia(8%) saturate(862%) hue-rotate(173deg) brightness(88%); 19 | } 20 | 21 | :root.incognito { 22 | --dark-0: #1c0e34; 23 | --dark-base: #20103c; 24 | --dark-1: #2f1d4e; 25 | --dark-2: #38225d; 26 | --dark-3: #4a2d7b; 27 | --dark-4: #53338a; 28 | --light-0: #cc6b9c; 29 | --light-base: #b9407c; 30 | --light-1: #ab3b73; 31 | --light-2: #9c3569; 32 | --light-3: #8d305e; 33 | --light-4: #7d2b54; 34 | --accent: #e9207e; 35 | --yellow: #c9b336; 36 | --green: #36c987; 37 | --red: #c9365d; 38 | --extension-icon-mask: grayscale(85%) invert(13%) sepia(80%) saturate(3107%) hue-rotate(256deg) brightness(84%) 39 | contrast(93%); 40 | } 41 | 42 | :root { 43 | --tab-border-radius: 7px; /* border radius of tabs */ 44 | --animation-duration: 200ms; /* duration of different animations [0s: turn all animations off] */ 45 | --spacing: 14px; /* spacing between tabs. [<15px: compact tabs] */ 46 | --distance-from-edge: 10px; /* distance between tabs, and left-right edges of sidebar*/ 47 | --hover-text-spacing: 0.05; /* should be left alone. with hover sidebar, if text is visible in collapsed status, increase this */ 48 | 49 | --ease-in: cubic-bezier(0.32, 0, 0.67, 0); 50 | --ease-out: cubic-bezier(0.22, 1, 0.36, 1); 51 | --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1); 52 | 53 | --collapsed-width: 60px; 54 | } 55 | 56 | /************UNCUSTOMIZED CSS************/ 57 | #tabbar-container #tabbar { 58 | margin-bottom: 15px !important; 59 | } 60 | 61 | :root, 62 | #background { 63 | background: var(--dark-base) !important; 64 | } 65 | 66 | #all-tabs { 67 | margin: 10px var(--distance-from-edge); 68 | } 69 | 70 | tab-item:not(.collapsed) { 71 | margin-top: var(--spacing); 72 | border-radius: var(--tab-border-radius); 73 | border: none !important; 74 | padding-top: 9px; 75 | padding-bottom: 10px; 76 | } 77 | 78 | tab-item.collapsed { 79 | height: 0; 80 | margin: 0 !important; 81 | padding: 0 !important; 82 | } 83 | 84 | tab-item:not([data-level="0"]):not(.pinned) { 85 | border-left: dashed 2px var(--light-4) !important; 86 | border-top-left-radius: 0; 87 | border-bottom-left-radius: 0; 88 | margin-top: calc(var(--spacing) / 2); 89 | } 90 | 91 | tab-item tab-favicon { 92 | left: 0; 93 | filter: var(--extension-icon-mask); 94 | transition: left calc(var(--animation-duration) * 2) var(--ease-out); 95 | } 96 | 97 | .highlighter { 98 | display: none !important; 99 | } 100 | 101 | tab-item .label { 102 | color: var(--light-2) !important; 103 | padding-bottom: 2px; 104 | } 105 | 106 | tab-item .twisty:before { 107 | background: var(--light-3) !important; 108 | } 109 | 110 | tab-item.active .label { 111 | color: var(--light-0) !important; 112 | } 113 | 114 | tab-item.active { 115 | background: var(--dark-3) !important; 116 | } 117 | 118 | tab-item:not(.active).highlighted { 119 | background: var(--dark-1) !important; 120 | } 121 | 122 | tab-item:not(active):hover { 123 | background: var(--dark-1); 124 | } 125 | 126 | tab-item:hover tab-closebox { 127 | right: 10px; 128 | opacity: 1; 129 | } 130 | 131 | tab-item:not(pinned) tab-closebox { 132 | position: absolute; 133 | margin-top: 2px; 134 | height: 20px; 135 | width: 20px; 136 | right: -30px; 137 | border-radius: 50%; 138 | padding-top: 2px; 139 | padding-left: 2px; 140 | background: var(--light-4); 141 | transition: all var(--animation-duration) var(--ease-out); 142 | } 143 | 144 | .sound-button:after { 145 | background: var(--light-3) !important; 146 | margin-top: 2px; 147 | } 148 | 149 | .counter { 150 | color: var(--light-4) !important; 151 | background: var(--dark-2) !important; 152 | border-radius: 7px; 153 | margin: 2px 2px 0px 0px; 154 | padding: 0 4px; 155 | padding-bottom: 2px; 156 | order: -2 !important; 157 | } 158 | 159 | .counter:before, 160 | .counter:after { 161 | content: ""; 162 | } 163 | 164 | /********LEFT CONTENT TAB(static)*************/ 165 | 166 | :root.left tab-item { 167 | padding-left: 0; 168 | } 169 | 170 | :root.left tab-item tab-favicon { 171 | transform: scale(120%); 172 | margin-right: 5px; 173 | } 174 | 175 | :root.left tab-item .label { 176 | transform: translateX(10px); 177 | transition: all var(--animation-duration) var(--ease-out); 178 | } 179 | 180 | :root.left tab-item:not(.pinned):hover tab-favicon { 181 | left: -35px; 182 | } 183 | 184 | :root.left tab-item[data-child-ids]:not(.pinned):hover tab-favicon { 185 | left: -40px; 186 | } 187 | 188 | :root.left tab-item:hover .label, 189 | :root.left .label { 190 | transform: translateX(-25px); 191 | } 192 | 193 | :root.left tab-item[data-child-ids] .twisty { 194 | margin-right: 5px; 195 | } 196 | 197 | /********RIGHT CONTENT TAB(hover)*************/ 198 | 199 | :root.right tab-item:not(.active) tab-favicon { 200 | margin-right: calc(var(--collapsed-width) * -0.1) !important; 201 | } 202 | 203 | :root.right tab-item tab-favicon { 204 | transform: scale(120%) translateX(calc(var(--collapsed-width) * -0.1)); 205 | order: 1000; 206 | transition: all var(--animation-duration) var(--ease-in-out); 207 | margin-left: calc(var(--collapsed-width) * var(--hover-text-spacing)) !important; 208 | } 209 | 210 | :root.right tab-item.active:not(:hover) tab-favicon { 211 | filter: grayscale(10%) opacity(80%); 212 | transform: scale(120%); 213 | } 214 | 215 | :root.right tab-item:not(.pinned):hover tab-favicon { 216 | left: -30px; 217 | margin-left: 25px; 218 | } 219 | 220 | :root.right tab-item.active:not(.pinned):hover tab-favicon { 221 | left: -20px !important; 222 | margin-left: 15px; 223 | } 224 | 225 | :root.right tab-item.pinned tab-favicon { 226 | transform: scale(120%); 227 | } 228 | 229 | :root.right tab-item .label { 230 | margin-left: 10px; 231 | margin-right: calc(var(--collapsed-width) * 0.3) !important; 232 | } 233 | 234 | :root.right tab-item:not(pinned):hover tab-closebox { 235 | right: calc(var(--collapsed-width) * 0.3); 236 | } 237 | 238 | :root.right tab-item:not([data-level="0"]):not(.pinned) { 239 | border: none !important; 240 | border-right: dashed 2px var(--light-4) !important; 241 | border-radius: var(--tab-border-radius); 242 | border-top-right-radius: 0; 243 | border-bottom-right-radius: 0; 244 | } 245 | 246 | :root.right tab-item.active:not([data-level="0"]):not(.pinned) { 247 | margin-right: 5px !important; 248 | } 249 | 250 | :root.right .sound-button { 251 | order: -1 !important; 252 | } 253 | 254 | :root.right tab-item.active.pinned { 255 | position: relative; 256 | left: 190px !important; 257 | } 258 | 259 | :root.right tab-item.active.pinned tab-favicon { 260 | transform: scale(130%) !important; 261 | margin-left: 7px; 262 | } 263 | 264 | /***********************************/ 265 | 266 | .tab .favicon .favicon-default::before { 267 | filter: var(--extension-icon-mask); // change for light theme 268 | } 269 | 270 | .tab[data-current-favicon-uri="undefined"] .favicon .favicon-default::before { 271 | background: url("chrome://branding/content/identity-icons-brand.svg") no-repeat center !important; 272 | mask: none !important; 273 | } 274 | 275 | /***********NEW TAB BUTTON**********/ 276 | 277 | .newtab-button-box { 278 | border: none !important; 279 | margin: 0 50px; 280 | } 281 | 282 | .newtab-button { 283 | border: none !important; 284 | border-radius: 8px; 285 | padding: 8px 0 !important; 286 | margin: 0 5px; 287 | } 288 | 289 | .newtab-button::before { 290 | background: var(--light-3) !important; 291 | } 292 | 293 | .newtab-action-selector-anchor { 294 | border: none !important; 295 | margin-right: 10px; 296 | margin-top: 3px; 297 | } 298 | 299 | .newtab-button:hover { 300 | background: var(--dark-1); 301 | } 302 | 303 | /**********PINNED TAB***************/ 304 | 305 | tab-item.pinned { 306 | margin: 5px !important; 307 | padding: 5px !important; 308 | transition: all 0.1s var(--ease-out); 309 | } 310 | 311 | /**********CONTAINERS***************/ 312 | 313 | .contextual-identity-marker { 314 | position: absolute !important; 315 | left: 0 !important; 316 | top: 0 !important; 317 | bottom: 0 !important; 318 | } 319 | 320 | tab-item.active .contextual-identity-marker { 321 | display: none !important; 322 | } 323 | 324 | .contextual-identity-firefox-container-1:not(.active), 325 | .contextual-identity-firefox-container-2:not(.active), 326 | .contextual-identity-firefox-container-3:not(.active), 327 | .contextual-identity-firefox-container-4:not(.active) { 328 | border-top-left-radius: 0px !important; 329 | border-bottom-left-radius: 0px !important; 330 | } 331 | 332 | tab-item.active.contextual-identity-firefox-container-1 { 333 | background: linear-gradient(to right, #3182ce, #0bc5ea) !important; 334 | } 335 | 336 | tab-item.active.contextual-identity-firefox-container-2 { 337 | background: linear-gradient(to right, #dd6b20, #f56565) !important; 338 | } 339 | 340 | tab-item.active.contextual-identity-firefox-container-3 { 341 | background: linear-gradient(to right, #38a169, #38b2ac) !important; 342 | } 343 | 344 | tab-item.active.contextual-identity-firefox-container-4 { 345 | background: linear-gradient(to right, #d53f8c, #9f7aea) !important; 346 | } 347 | 348 | /***********************************/ 349 | 350 | #all-tabs { 351 | border: none !important; 352 | } 353 | -------------------------------------------------------------------------------- /firefox/treestyletab/stealth_tst.json: -------------------------------------------------------------------------------- 1 | { 2 | "autoCollapseExpandSubtreeOnAttach": false, 3 | "autoCollapseExpandSubtreeOnSelect": false, 4 | "chunkedUserStyleRules0": "I2FsbC10YWJzIHsKICAgIGJvcmRlcjogbm9uZSAhaW1wb3J0YW50Owp9Cgp0YWItaXRlbSB0YWItZmF2aWNvbiB7CiAgICBsZWZ0OiA3cHg7CiAgCW9yZGVyOiAtNAp9CgoKCnRhYi1pdGVtIC5sYWJlbCB7CiAgICBwYWRkaW5nLWJvdHRvbTogMnB4OwogICAgbWFyZ2luLWxlZnQ6IDExcHg7CiAgICBvcmRlcjogLTM7Cn0KCnRhYi1pdGVtIC50d2lzdHkgewogICAgZGlzcGxheSA6IG5vbmU7ICFpbXBvcnRhbnQ7Cn0KCgoKLnNvdW5kLWJ1dHRvbjphZnRlciB7CiAgICBtYXJnaW4tdG9wOiAycHg7Cn0KCi5jb3VudGVyIHsKICAgIGNvbG9yOiAjZmZmZmZmICFpbXBvcnRhbnQ7CiAgICBiYWNrZ3JvdW5kOiAjOTkyZjhkIWltcG9ydGFudDsKICAgIGJvcmRlci1yYWRpdXM6IDEwcHg7CiAgICBtYXJnaW46IDJweCAycHggMHB4IDBweDsKICAgIHBhZGRpbmc6IDAgOHB4OwogICAgcGFkZGluZy1ib3R0b206IDJweDsKICAgIG9yZGVyOiAtMiAhaW1wb3J0YW50Owp9CgouY291bnRlcjpiZWZvcmUsCi5jb3VudGVyOmFmdGVyIHsKICAgIGNvbnRlbnQ6ICIiOwp9Cgp0YWItaXRlbS5kaXNjYXJkZWQgLmxhYmVsLWNvbnRlbnQgewogIGNvbG9yOiAjN0U3RTdFOwp9Cgp0YWItaXRlbS5kaXNjYXJkZWQgdGFiLWZhdmljb24gewogIG9wYWNpdHk6IDAuNSAhaW1wb3J0YW50OwogIAp9CgoKI3RhYmJhciB0YWItaXRlbSB0YWItaXRlbS1zdWJzdGFuY2U6bm90KDpob3ZlcikgdGFiLWNsb3NlYm94IHsKICBkaXNwbGF5OiBub25lOwp9CgoKOnJvb3QubGVmdCB0YWItaXRlbSB0YWItZmF2aWNvbiB7CiAgICB0cmFuc2Zvcm06IHNjYWxlKDEyMCUpOwogICAgbWFyZ2luLXJpZ2h0OiA1cHg7Cn0KCnRhYi1pdGVtOm5vdChbZGF0YS1sZXZlbD0iMCJdKSB7CiAgICBib3JkZXItbGVmdDogc29saWQgM3B4ICM2YzY4YjcgIWltcG9ydGFudDsKfQp0YWItaXRlbTpub3QoW2RhdGEtbGV2ZWw9IjAiXSkgdGFiLWZhdmljb24gewogICAgbWFyZ2luLWxlZnQgOiAtMnB4ICFpbXBvcnRhbnQ7Cn0KdGFiLWl0ZW1bZGF0YS1sZXZlbD0iMSJdIHsKICAgIGJvcmRlci1sZWZ0OiBzb2xpZCAzcHggI2M5NGY2ZCAhaW1wb3J0YW50Owp9Cgp0YWItaXRlbVtkYXRhLWxldmVsPSIyIl0gewogICAgYm9yZGVyLWxlZnQ6IHNvbGlkIDNweCAjZGJjMDc0ICFpbXBvcnRhbnQ7Cn0KCnRhYi1pdGVtW2RhdGEtbGV2ZWw9IjMiXSB7CiAgICBib3JkZXItbGVmdDogc29saWQgM3B4ICM1Y2I4ODcgIWltcG9ydGFudDsKfQoKdGFiLWl0ZW0ucGlubmVkIHsKICAgIG1hcmdpbi1sZWZ0OiA1cHggIWltcG9ydGFudDsKICAgIHBhZGRpbmc6IDBweCAhaW1wb3J0YW50Owp9Cgp0YWItaXRlbS5waW5uZWQgdGFiLWZhdmljb24gewogICAgbWFyZ2luLWxlZnQ6IC03cHggIWltcG9ydGFudDsKICAgIHBhZGRpbmc6IDBweCAhaW1wb3J0YW50Owp9CgojdGFiYmFyLm92ZXJmbG93IHsgc2Nyb2xsYmFyLXdpZHRoOiBub25lOyB9IAoKOnJvb3Quc2lkZWJhciAjYmFja2dyb3VuZCB7CiAgYmFja2dyb3VuZDogIzJCMkEzMzsKfQo=", 5 | "configsVersion": 24, 6 | "iconColor": "dark", 7 | "lastConfirmedToCloseTabs": 1627182067614, 8 | "lastDraggedTabs": { 9 | "tabIds": [ 10 | 742, 11 | 743 12 | ], 13 | "urlsDigest": "80e0c0fecec4e4d13763b072e8e514da263c11db" 14 | }, 15 | "maxTreeLevel": 0, 16 | "notifiedFeaturesVersion": 9, 17 | "optionsExpandedSections": [ 18 | "section-advanced", 19 | "section-addons", 20 | "section-debug" 21 | ], 22 | "showExpertOptions": true, 23 | "syncAvailableNotified": true, 24 | "syncDeviceInfo": { 25 | "id": "device-1626294073961-41639", 26 | "name": "Firefox on Windows", 27 | "icon": "device-desktop", 28 | "timestamp": 1628099386171 29 | }, 30 | "syncDevices": { 31 | "device-1626294073961-41639": { 32 | "id": "device-1626294073961-41639", 33 | "name": "Firefox on Windows", 34 | "icon": "device-desktop", 35 | "timestamp": 1628099386171 36 | } 37 | }, 38 | "syncDevicesLocalCache": { 39 | "device-1626294073961-41639": { 40 | "id": "device-1626294073961-41639", 41 | "name": "Firefox on Windows", 42 | "icon": "device-desktop", 43 | "timestamp": 1628099386171 44 | } 45 | }, 46 | "syncOtherDevicesDetected": true, 47 | "treeDoubleClickBehavior": 1, 48 | "userStyleRules": "", 49 | "userStyleRulesFieldHeight": "120px", 50 | "warnOnCloseTabs": false, 51 | "warnOnCloseTabsByClosebox": false 52 | } 53 | -------------------------------------------------------------------------------- /firefox/user.js: -------------------------------------------------------------------------------- 1 | user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true); // default is false 2 | user_pref("svg.context-properties.content.enabled", true); 3 | -------------------------------------------------------------------------------- /git/config: -------------------------------------------------------------------------------- 1 | [user] 2 | name = Phúc Lê Khắc 3 | email = phuc.lkh@gmail.com 4 | [pull] 5 | ff = only 6 | [credential] 7 | helper = cache 8 | [init] 9 | defaultBranch = main 10 | [color] 11 | ui = true 12 | [diff] 13 | tool = nvimdiff 14 | [pager] 15 | diff = delta 16 | log = delta 17 | reflog = delta 18 | show = delta 19 | [interactive] 20 | diffFilter = delta --color-only 21 | [delta] 22 | features = line-numbers 23 | [filter "lfs"] 24 | clean = git-lfs clean -- %f 25 | smudge = git-lfs smudge -- %f 26 | process = git-lfs filter-process 27 | required = true 28 | -------------------------------------------------------------------------------- /jupyter/jupyter_console_config.py: -------------------------------------------------------------------------------- 1 | # Configuration file for jupyter-console. 2 | 3 | c = get_config() #noqa 4 | 5 | #------------------------------------------------------------------------------ 6 | # ConnectionFileMixin(LoggingConfigurable) configuration 7 | #------------------------------------------------------------------------------ 8 | ## Mixin for configurable classes that work with connection files 9 | 10 | ## JSON file in which to store connection info [default: kernel-.json] 11 | # 12 | # This file will contain the IP, ports, and authentication key needed to connect 13 | # clients to this kernel. By default, this file will be created in the security dir 14 | # of the current profile, but can be specified by absolute path. 15 | # Default: '' 16 | # c.ConnectionFileMixin.connection_file = '' 17 | 18 | ## set the control (ROUTER) port [default: random] 19 | # Default: 0 20 | # c.ConnectionFileMixin.control_port = 0 21 | 22 | ## set the heartbeat port [default: random] 23 | # Default: 0 24 | # c.ConnectionFileMixin.hb_port = 0 25 | 26 | ## set the iopub (PUB) port [default: random] 27 | # Default: 0 28 | # c.ConnectionFileMixin.iopub_port = 0 29 | 30 | ## Set the kernel's IP address [default localhost]. 31 | # If the IP address is something other than localhost, then 32 | # Consoles on other machines will be able to connect 33 | # to the Kernel, so be careful! 34 | # Default: '' 35 | # c.ConnectionFileMixin.ip = '' 36 | 37 | ## set the shell (ROUTER) port [default: random] 38 | # Default: 0 39 | # c.ConnectionFileMixin.shell_port = 0 40 | 41 | ## set the stdin (ROUTER) port [default: random] 42 | # Default: 0 43 | # c.ConnectionFileMixin.stdin_port = 0 44 | 45 | # Choices: any of ['tcp', 'ipc'] (case-insensitive) 46 | # Default: 'tcp' 47 | # c.ConnectionFileMixin.transport = 'tcp' 48 | 49 | #------------------------------------------------------------------------------ 50 | # JupyterConsoleApp(ConnectionFileMixin) configuration 51 | #------------------------------------------------------------------------------ 52 | ## The base Jupyter console application. 53 | 54 | ## Set to display confirmation dialog on exit. You can always use 'exit' or 55 | # 'quit', to force a direct exit without any confirmation. 56 | # Default: True 57 | # c.JupyterConsoleApp.confirm_exit = True 58 | 59 | ## JSON file in which to store connection info [default: kernel-.json] 60 | # See also: ConnectionFileMixin.connection_file 61 | # c.JupyterConsoleApp.connection_file = '' 62 | 63 | ## set the control (ROUTER) port [default: random] 64 | # See also: ConnectionFileMixin.control_port 65 | # c.JupyterConsoleApp.control_port = 0 66 | 67 | ## Connect to an already running kernel 68 | # Default: '' 69 | # c.JupyterConsoleApp.existing = '' 70 | 71 | ## set the heartbeat port [default: random] 72 | # See also: ConnectionFileMixin.hb_port 73 | # c.JupyterConsoleApp.hb_port = 0 74 | 75 | ## set the iopub (PUB) port [default: random] 76 | # See also: ConnectionFileMixin.iopub_port 77 | # c.JupyterConsoleApp.iopub_port = 0 78 | 79 | ## Set the kernel's IP address [default localhost]. 80 | # See also: ConnectionFileMixin.ip 81 | # c.JupyterConsoleApp.ip = '' 82 | 83 | ## The kernel manager class to use. 84 | # Default: 'jupyter_client.manager.KernelManager' 85 | # c.JupyterConsoleApp.kernel_manager_class = 'jupyter_client.manager.KernelManager' 86 | 87 | ## The name of the default kernel to start. 88 | # Default: 'python' 89 | # c.JupyterConsoleApp.kernel_name = 'python' 90 | 91 | ## set the shell (ROUTER) port [default: random] 92 | # See also: ConnectionFileMixin.shell_port 93 | # c.JupyterConsoleApp.shell_port = 0 94 | 95 | ## Path to the ssh key to use for logging in to the ssh server. 96 | # Default: '' 97 | # c.JupyterConsoleApp.sshkey = '' 98 | 99 | ## The SSH server to use to connect to the kernel. 100 | # Default: '' 101 | # c.JupyterConsoleApp.sshserver = '' 102 | 103 | ## set the stdin (ROUTER) port [default: random] 104 | # See also: ConnectionFileMixin.stdin_port 105 | # c.JupyterConsoleApp.stdin_port = 0 106 | 107 | # See also: ConnectionFileMixin.transport 108 | # c.JupyterConsoleApp.transport = 'tcp' 109 | 110 | #------------------------------------------------------------------------------ 111 | # Application(SingletonConfigurable) configuration 112 | #------------------------------------------------------------------------------ 113 | ## This is an application. 114 | 115 | ## The date format used by logging formatters for %(asctime)s 116 | # Default: '%Y-%m-%d %H:%M:%S' 117 | # c.Application.log_datefmt = '%Y-%m-%d %H:%M:%S' 118 | 119 | ## The Logging format template 120 | # Default: '[%(name)s]%(highlevel)s %(message)s' 121 | # c.Application.log_format = '[%(name)s]%(highlevel)s %(message)s' 122 | 123 | ## Set the log level by value or name. 124 | # Choices: any of [0, 10, 20, 30, 40, 50, 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL'] 125 | # Default: 30 126 | # c.Application.log_level = 30 127 | 128 | ## Configure additional log handlers. 129 | # 130 | # The default stderr logs handler is configured by the log_level, log_datefmt 131 | # and log_format settings. 132 | # 133 | # This configuration can be used to configure additional handlers (e.g. to 134 | # output the log to a file) or for finer control over the default handlers. 135 | # 136 | # If provided this should be a logging configuration dictionary, for more 137 | # information see: 138 | # https://docs.python.org/3/library/logging.config.html#logging-config- 139 | # dictschema 140 | # 141 | # This dictionary is merged with the base logging configuration which defines 142 | # the following: 143 | # 144 | # * A logging formatter intended for interactive use called 145 | # ``console``. 146 | # * A logging handler that writes to stderr called 147 | # ``console`` which uses the formatter ``console``. 148 | # * A logger with the name of this application set to ``DEBUG`` 149 | # level. 150 | # 151 | # This example adds a new handler that writes to a file: 152 | # 153 | # .. code-block:: python 154 | # 155 | # c.Application.logging_config = { 156 | # 'handlers': { 157 | # 'file': { 158 | # 'class': 'logging.FileHandler', 159 | # 'level': 'DEBUG', 160 | # 'filename': '', 161 | # } 162 | # }, 163 | # 'loggers': { 164 | # '': { 165 | # 'level': 'DEBUG', 166 | # # NOTE: if you don't list the default "console" 167 | # # handler here then it will be disabled 168 | # 'handlers': ['console', 'file'], 169 | # }, 170 | # } 171 | # } 172 | # Default: {} 173 | # c.Application.logging_config = {} 174 | 175 | ## Instead of starting the Application, dump configuration to stdout 176 | # Default: False 177 | # c.Application.show_config = False 178 | 179 | ## Instead of starting the Application, dump configuration to stdout (as JSON) 180 | # Default: False 181 | # c.Application.show_config_json = False 182 | 183 | #------------------------------------------------------------------------------ 184 | # JupyterApp(Application) configuration 185 | #------------------------------------------------------------------------------ 186 | ## Base class for Jupyter applications 187 | 188 | ## Answer yes to any prompts. 189 | # Default: False 190 | # c.JupyterApp.answer_yes = False 191 | 192 | ## Full path of a config file. 193 | # Default: '' 194 | # c.JupyterApp.config_file = '' 195 | 196 | ## Specify a config file to load. 197 | # Default: '' 198 | # c.JupyterApp.config_file_name = '' 199 | 200 | ## Generate default config file. 201 | # Default: False 202 | # c.JupyterApp.generate_config = False 203 | 204 | ## The date format used by logging formatters for %(asctime)s 205 | # See also: Application.log_datefmt 206 | # c.JupyterApp.log_datefmt = '%Y-%m-%d %H:%M:%S' 207 | 208 | ## The Logging format template 209 | # See also: Application.log_format 210 | # c.JupyterApp.log_format = '[%(name)s]%(highlevel)s %(message)s' 211 | 212 | ## Set the log level by value or name. 213 | # See also: Application.log_level 214 | # c.JupyterApp.log_level = 30 215 | 216 | ## 217 | # See also: Application.logging_config 218 | # c.JupyterApp.logging_config = {} 219 | 220 | ## Instead of starting the Application, dump configuration to stdout 221 | # See also: Application.show_config 222 | # c.JupyterApp.show_config = False 223 | 224 | ## Instead of starting the Application, dump configuration to stdout (as JSON) 225 | # See also: Application.show_config_json 226 | # c.JupyterApp.show_config_json = False 227 | 228 | #------------------------------------------------------------------------------ 229 | # ZMQTerminalIPythonApp(JupyterApp, JupyterConsoleApp) configuration 230 | #------------------------------------------------------------------------------ 231 | ## Answer yes to any prompts. 232 | # See also: JupyterApp.answer_yes 233 | # c.ZMQTerminalIPythonApp.answer_yes = False 234 | 235 | ## Full path of a config file. 236 | # See also: JupyterApp.config_file 237 | # c.ZMQTerminalIPythonApp.config_file = '' 238 | 239 | ## Specify a config file to load. 240 | # See also: JupyterApp.config_file_name 241 | # c.ZMQTerminalIPythonApp.config_file_name = '' 242 | 243 | ## 244 | # See also: JupyterConsoleApp.confirm_exit 245 | # c.ZMQTerminalIPythonApp.confirm_exit = True 246 | 247 | ## JSON file in which to store connection info [default: kernel-.json] 248 | # See also: ConnectionFileMixin.connection_file 249 | # c.ZMQTerminalIPythonApp.connection_file = '' 250 | 251 | ## set the control (ROUTER) port [default: random] 252 | # See also: ConnectionFileMixin.control_port 253 | # c.ZMQTerminalIPythonApp.control_port = 0 254 | 255 | ## Connect to an already running kernel 256 | # See also: JupyterConsoleApp.existing 257 | # c.ZMQTerminalIPythonApp.existing = '' 258 | 259 | ## Generate default config file. 260 | # See also: JupyterApp.generate_config 261 | # c.ZMQTerminalIPythonApp.generate_config = False 262 | 263 | ## set the heartbeat port [default: random] 264 | # See also: ConnectionFileMixin.hb_port 265 | # c.ZMQTerminalIPythonApp.hb_port = 0 266 | 267 | ## set the iopub (PUB) port [default: random] 268 | # See also: ConnectionFileMixin.iopub_port 269 | # c.ZMQTerminalIPythonApp.iopub_port = 0 270 | 271 | ## Set the kernel's IP address [default localhost]. 272 | # See also: ConnectionFileMixin.ip 273 | # c.ZMQTerminalIPythonApp.ip = '' 274 | 275 | ## The kernel manager class to use. 276 | # See also: JupyterConsoleApp.kernel_manager_class 277 | # c.ZMQTerminalIPythonApp.kernel_manager_class = 'jupyter_client.manager.KernelManager' 278 | 279 | ## The name of the default kernel to start. 280 | # See also: JupyterConsoleApp.kernel_name 281 | # c.ZMQTerminalIPythonApp.kernel_name = 'python' 282 | 283 | ## The date format used by logging formatters for %(asctime)s 284 | # See also: Application.log_datefmt 285 | # c.ZMQTerminalIPythonApp.log_datefmt = '%Y-%m-%d %H:%M:%S' 286 | 287 | ## The Logging format template 288 | # See also: Application.log_format 289 | # c.ZMQTerminalIPythonApp.log_format = '[%(name)s]%(highlevel)s %(message)s' 290 | 291 | ## Set the log level by value or name. 292 | # See also: Application.log_level 293 | # c.ZMQTerminalIPythonApp.log_level = 30 294 | 295 | ## 296 | # See also: Application.logging_config 297 | # c.ZMQTerminalIPythonApp.logging_config = {} 298 | 299 | ## set the shell (ROUTER) port [default: random] 300 | # See also: ConnectionFileMixin.shell_port 301 | # c.ZMQTerminalIPythonApp.shell_port = 0 302 | 303 | ## Instead of starting the Application, dump configuration to stdout 304 | # See also: Application.show_config 305 | # c.ZMQTerminalIPythonApp.show_config = False 306 | 307 | ## Instead of starting the Application, dump configuration to stdout (as JSON) 308 | # See also: Application.show_config_json 309 | # c.ZMQTerminalIPythonApp.show_config_json = False 310 | 311 | ## Path to the ssh key to use for logging in to the ssh server. 312 | # See also: JupyterConsoleApp.sshkey 313 | # c.ZMQTerminalIPythonApp.sshkey = '' 314 | 315 | ## The SSH server to use to connect to the kernel. 316 | # See also: JupyterConsoleApp.sshserver 317 | # c.ZMQTerminalIPythonApp.sshserver = '' 318 | 319 | ## set the stdin (ROUTER) port [default: random] 320 | # See also: ConnectionFileMixin.stdin_port 321 | # c.ZMQTerminalIPythonApp.stdin_port = 0 322 | 323 | # See also: ConnectionFileMixin.transport 324 | # c.ZMQTerminalIPythonApp.transport = 'tcp' 325 | 326 | #------------------------------------------------------------------------------ 327 | # ZMQTerminalInteractiveShell(SingletonConfigurable) configuration 328 | #------------------------------------------------------------------------------ 329 | ## Text to display before the first prompt. Will be formatted with variables 330 | # {version} and {kernel_banner}. 331 | # Default: 'Jupyter console {version}\n\n{kernel_banner}' 332 | # c.ZMQTerminalInteractiveShell.banner = 'Jupyter console {version}\n\n{kernel_banner}' 333 | 334 | ## Callable object called via 'callable' image handler with one argument, `data`, 335 | # which is `msg["content"]["data"]` where `msg` is the message from iopub 336 | # channel. For example, you can find base64 encoded PNG data as 337 | # `data['image/png']`. If your function can't handle the data supplied, it 338 | # should return `False` to indicate this. 339 | # Default: None 340 | # c.ZMQTerminalInteractiveShell.callable_image_handler = None 341 | 342 | ## Options for displaying tab completions, 'column', 'multicolumn', and 343 | # 'readlinelike'. These options are for `prompt_toolkit`, see `prompt_toolkit` 344 | # documentation for more information. 345 | # Choices: any of ['column', 'multicolumn', 'readlinelike'] 346 | # Default: 'multicolumn' 347 | # c.ZMQTerminalInteractiveShell.display_completions = 'multicolumn' 348 | 349 | ## Shortcut style to use at the prompt. 'vi' or 'emacs'. 350 | # Default: 'emacs' 351 | # c.ZMQTerminalInteractiveShell.editing_mode = 'emacs' 352 | 353 | ## Highlight matching brackets. 354 | # Default: True 355 | # c.ZMQTerminalInteractiveShell.highlight_matching_brackets = True 356 | 357 | ## The name of a Pygments style to use for syntax highlighting 358 | # Default: '' 359 | # c.ZMQTerminalInteractiveShell.highlighting_style = '' 360 | 361 | ## Override highlighting format for specific tokens 362 | # Default: {} 363 | # c.ZMQTerminalInteractiveShell.highlighting_style_overrides = {} 364 | 365 | ## How many history items to load into memory 366 | # Default: 1000 367 | # c.ZMQTerminalInteractiveShell.history_load_length = 1000 368 | 369 | ## Handler for image type output. This is useful, for example, when connecting 370 | # to the kernel in which pylab inline backend is activated. There are four 371 | # handlers defined. 'PIL': Use Python Imaging Library to popup image; 'stream': 372 | # Use an external program to show the image. Image will be fed into the STDIN 373 | # of the program. You will need to configure `stream_image_handler`; 374 | # 'tempfile': Use an external program to show the image. Image will be saved in 375 | # a temporally file and the program is called with the temporally file. You 376 | # will need to configure `tempfile_image_handler`; 'callable': You can set any 377 | # Python callable which is called with the image data. You will need to 378 | # configure `callable_image_handler`. 379 | # Choices: any of ['PIL', 'stream', 'tempfile', 'callable'] or None 380 | # Default: 'PIL' 381 | # c.ZMQTerminalInteractiveShell.image_handler = 'PIL' 382 | 383 | ## Whether to include output from clients 384 | # other than this one sharing the same kernel. 385 | # Default: False 386 | c.ZMQTerminalInteractiveShell.include_other_output = True 387 | 388 | ## Timeout (in seconds) for giving up on a kernel's is_complete 389 | # response. 390 | # 391 | # If the kernel does not respond at any point within this time, 392 | # the kernel will no longer be asked if code is complete, and the 393 | # console will default to the built-in is_complete test. 394 | # Default: 1 395 | # c.ZMQTerminalInteractiveShell.kernel_is_complete_timeout = 1 396 | 397 | ## Timeout for giving up on a kernel (in seconds). 398 | # 399 | # On first connect and restart, the console tests whether the 400 | # kernel is running and responsive by sending kernel_info_requests. 401 | # This sets the timeout in seconds for how long the kernel can take 402 | # before being presumed dead. 403 | # Default: 60 404 | # c.ZMQTerminalInteractiveShell.kernel_timeout = 60 405 | 406 | ## Preferred object representation MIME type in order. First matched MIME type 407 | # will be used. 408 | # Default: ['image/png', 'image/jpeg', 'image/svg+xml'] 409 | # c.ZMQTerminalInteractiveShell.mime_preference = ['image/png', 'image/jpeg', 'image/svg+xml'] 410 | 411 | ## Prefix to add to outputs coming from clients other than this one. 412 | # 413 | # Only relevant if include_other_output is True. 414 | # Default: 'Remote ' 415 | c.ZMQTerminalInteractiveShell.other_output_prefix = '' 416 | 417 | ## Display the current vi mode (when using vi editing mode). 418 | # Default: True 419 | # c.ZMQTerminalInteractiveShell.prompt_includes_vi_mode = True 420 | 421 | ## Use simple fallback prompt. Features may be limited. 422 | # Default: False 423 | # c.ZMQTerminalInteractiveShell.simple_prompt = False 424 | 425 | ## Command to invoke an image viewer program when you are using 'stream' image 426 | # handler. This option is a list of string where the first element is the 427 | # command itself and reminders are the options for the command. Raw image data 428 | # is given as STDIN to the program. 429 | # Default: [] 430 | # c.ZMQTerminalInteractiveShell.stream_image_handler = [] 431 | 432 | ## Command to invoke an image viewer program when you are using 'tempfile' image 433 | # handler. This option is a list of string where the first element is the 434 | # command itself and reminders are the options for the command. You can use 435 | # {file} and {format} in the string to represent the location of the generated 436 | # image file and image format. 437 | # Default: [] 438 | # c.ZMQTerminalInteractiveShell.tempfile_image_handler = [] 439 | 440 | ## Use 24bit colors instead of 256 colors in prompt highlighting. If your 441 | # terminal supports true color, the following command should print 'TRUECOLOR' 442 | # in orange: printf "\x1b[38;2;255;100;0mTRUECOLOR\x1b[0m\n" 443 | # Default: False 444 | c.ZMQTerminalInteractiveShell.true_color = True 445 | 446 | ## Whether to use the kernel's is_complete message 447 | # handling. If False, then the frontend will use its 448 | # own is_complete handler. 449 | # Default: True 450 | # c.ZMQTerminalInteractiveShell.use_kernel_is_complete = True 451 | 452 | #------------------------------------------------------------------------------ 453 | # KernelManager(ConnectionFileMixin) configuration 454 | #------------------------------------------------------------------------------ 455 | ## Manages a single kernel in a subprocess on this host. 456 | # 457 | # This version starts kernels with Popen. 458 | 459 | ## Should we autorestart the kernel if it dies. 460 | # Default: True 461 | # c.KernelManager.autorestart = True 462 | 463 | ## JSON file in which to store connection info [default: kernel-.json] 464 | # See also: ConnectionFileMixin.connection_file 465 | # c.KernelManager.connection_file = '' 466 | 467 | ## set the control (ROUTER) port [default: random] 468 | # See also: ConnectionFileMixin.control_port 469 | # c.KernelManager.control_port = 0 470 | 471 | ## set the heartbeat port [default: random] 472 | # See also: ConnectionFileMixin.hb_port 473 | # c.KernelManager.hb_port = 0 474 | 475 | ## set the iopub (PUB) port [default: random] 476 | # See also: ConnectionFileMixin.iopub_port 477 | # c.KernelManager.iopub_port = 0 478 | 479 | ## Set the kernel's IP address [default localhost]. 480 | # See also: ConnectionFileMixin.ip 481 | # c.KernelManager.ip = '' 482 | 483 | ## set the shell (ROUTER) port [default: random] 484 | # See also: ConnectionFileMixin.shell_port 485 | # c.KernelManager.shell_port = 0 486 | 487 | ## Time to wait for a kernel to terminate before killing it, in seconds. When a 488 | # shutdown request is initiated, the kernel will be immediately sent an 489 | # interrupt (SIGINT), followedby a shutdown_request message, after 1/2 of 490 | # `shutdown_wait_time`it will be sent a terminate (SIGTERM) request, and finally 491 | # at the end of `shutdown_wait_time` will be killed (SIGKILL). terminate and 492 | # kill may be equivalent on windows. Note that this value can beoverridden by 493 | # the in-use kernel provisioner since shutdown times mayvary by provisioned 494 | # environment. 495 | # Default: 5.0 496 | # c.KernelManager.shutdown_wait_time = 5.0 497 | 498 | ## set the stdin (ROUTER) port [default: random] 499 | # See also: ConnectionFileMixin.stdin_port 500 | # c.KernelManager.stdin_port = 0 501 | 502 | # See also: ConnectionFileMixin.transport 503 | # c.KernelManager.transport = 'tcp' 504 | 505 | #------------------------------------------------------------------------------ 506 | # KernelRestarter(LoggingConfigurable) configuration 507 | #------------------------------------------------------------------------------ 508 | ## Monitor and autorestart a kernel. 509 | 510 | ## Whether to include every poll event in debugging output. 511 | # 512 | # Has to be set explicitly, because there will be *a lot* of output. 513 | # Default: False 514 | # c.KernelRestarter.debug = False 515 | 516 | ## Whether to choose new random ports when restarting before the kernel is alive. 517 | # Default: True 518 | # c.KernelRestarter.random_ports_until_alive = True 519 | 520 | ## The number of consecutive autorestarts before the kernel is presumed dead. 521 | # Default: 5 522 | # c.KernelRestarter.restart_limit = 5 523 | 524 | ## The time in seconds to consider the kernel to have completed a stable start 525 | # up. 526 | # Default: 10.0 527 | # c.KernelRestarter.stable_start_time = 10.0 528 | 529 | ## Kernel heartbeat interval in seconds. 530 | # Default: 3.0 531 | # c.KernelRestarter.time_to_dead = 3.0 532 | 533 | #------------------------------------------------------------------------------ 534 | # Session(Configurable) configuration 535 | #------------------------------------------------------------------------------ 536 | ## Object for handling serialization and sending of messages. 537 | # 538 | # The Session object handles building messages and sending them 539 | # with ZMQ sockets or ZMQStream objects. Objects can communicate with each 540 | # other over the network via Session objects, and only need to work with the 541 | # dict-based IPython message spec. The Session will handle 542 | # serialization/deserialization, security, and metadata. 543 | # 544 | # Sessions support configurable serialization via packer/unpacker traits, 545 | # and signing with HMAC digests via the key/keyfile traits. 546 | # 547 | # Parameters 548 | # ---------- 549 | # 550 | # debug : bool 551 | # whether to trigger extra debugging statements 552 | # packer/unpacker : str : 'json', 'pickle' or import_string 553 | # importstrings for methods to serialize message parts. If just 554 | # 'json' or 'pickle', predefined JSON and pickle packers will be used. 555 | # Otherwise, the entire importstring must be used. 556 | # 557 | # The functions must accept at least valid JSON input, and output 558 | # *bytes*. 559 | # 560 | # For example, to use msgpack: 561 | # packer = 'msgpack.packb', unpacker='msgpack.unpackb' 562 | # pack/unpack : callables 563 | # You can also set the pack/unpack callables for serialization directly. 564 | # session : bytes 565 | # the ID of this Session object. The default is to generate a new UUID. 566 | # username : unicode 567 | # username added to message headers. The default is to ask the OS. 568 | # key : bytes 569 | # The key used to initialize an HMAC signature. If unset, messages 570 | # will not be signed or checked. 571 | # keyfile : filepath 572 | # The file containing a key. If this is set, `key` will be initialized 573 | # to the contents of the file. 574 | 575 | ## Threshold (in bytes) beyond which an object's buffer should be extracted to 576 | # avoid pickling. 577 | # Default: 1024 578 | # c.Session.buffer_threshold = 1024 579 | 580 | ## Whether to check PID to protect against calls after fork. 581 | # 582 | # This check can be disabled if fork-safety is handled elsewhere. 583 | # Default: True 584 | # c.Session.check_pid = True 585 | 586 | ## Threshold (in bytes) beyond which a buffer should be sent without copying. 587 | # Default: 65536 588 | # c.Session.copy_threshold = 65536 589 | 590 | ## Debug output in the Session 591 | # Default: False 592 | # c.Session.debug = False 593 | 594 | ## The maximum number of digests to remember. 595 | # 596 | # The digest history will be culled when it exceeds this value. 597 | # Default: 65536 598 | # c.Session.digest_history_size = 65536 599 | 600 | ## The maximum number of items for a container to be introspected for custom serialization. 601 | # Containers larger than this are pickled outright. 602 | # Default: 64 603 | # c.Session.item_threshold = 64 604 | 605 | ## execution key, for signing messages. 606 | # Default: b'' 607 | # c.Session.key = b'' 608 | 609 | ## path to file containing execution key. 610 | # Default: '' 611 | # c.Session.keyfile = '' 612 | 613 | ## Metadata dictionary, which serves as the default top-level metadata dict for 614 | # each message. 615 | # Default: {} 616 | # c.Session.metadata = {} 617 | 618 | ## The name of the packer for serializing messages. 619 | # Should be one of 'json', 'pickle', or an import name 620 | # for a custom callable serializer. 621 | # Default: 'json' 622 | # c.Session.packer = 'json' 623 | 624 | ## The UUID identifying this session. 625 | # Default: '' 626 | # c.Session.session = '' 627 | 628 | ## The digest scheme used to construct the message signatures. 629 | # Must have the form 'hmac-HASH'. 630 | # Default: 'hmac-sha256' 631 | # c.Session.signature_scheme = 'hmac-sha256' 632 | 633 | ## The name of the unpacker for unserializing messages. 634 | # Only used with custom functions for `packer`. 635 | # Default: 'json' 636 | # c.Session.unpacker = 'json' 637 | 638 | ## Username for the Session. Default is your system username. 639 | # Default: 'phuc' 640 | # c.Session.username = 'phuc' 641 | -------------------------------------------------------------------------------- /jupytext.toml: -------------------------------------------------------------------------------- 1 | # Pair ipynb notebooks to py:percent text notebooks 2 | formats = "ipynb,py:percent" 3 | cell_markers = '"""' 4 | -------------------------------------------------------------------------------- /kitty/macos-launch-services-cmdline: -------------------------------------------------------------------------------- 1 | --listen-on unix:/tmp/mykitty 2 | -------------------------------------------------------------------------------- /kitty/themes/Atom.conf: -------------------------------------------------------------------------------- 1 | background #161718 2 | foreground #c4c8c5 3 | cursor #d0d0d0 4 | selection_background #444444 5 | color0 #000000 6 | color8 #000000 7 | color1 #fc5ef0 8 | color9 #fc5ef0 9 | color2 #86c38a 10 | color10 #94f936 11 | color3 #ffd6b1 12 | color11 #f5ffa7 13 | color4 #85befd 14 | color12 #95cbfe 15 | color5 #b9b5fc 16 | color13 #b9b5fc 17 | color6 #85befd 18 | color14 #85befd 19 | color7 #dfdfdf 20 | color15 #dfdfdf 21 | selection_foreground #161718 22 | -------------------------------------------------------------------------------- /kitty/themes/Dracula.conf: -------------------------------------------------------------------------------- 1 | background #1e1f28 2 | foreground #f8f8f2 3 | cursor #bbbbbb 4 | selection_background #44475a 5 | color0 #000000 6 | color8 #545454 7 | color1 #ff5555 8 | color9 #ff5454 9 | color2 #50fa7b 10 | color10 #50fa7b 11 | color3 #f0fa8b 12 | color11 #f0fa8b 13 | color4 #bd92f8 14 | color12 #bd92f8 15 | color5 #ff78c5 16 | color13 #ff78c5 17 | color6 #8ae9fc 18 | color14 #8ae9fc 19 | color7 #bbbbbb 20 | color15 #ffffff 21 | selection_foreground #1e1f28 22 | -------------------------------------------------------------------------------- /kitty/themes/nightfly.conf: -------------------------------------------------------------------------------- 1 | background #011627 2 | foreground #acb4c2 3 | cursor #9ca1aa 4 | color0 #1d3b53 5 | color1 #fc514e 6 | color2 #a1cd5e 7 | color3 #e3d18a 8 | color4 #82aaff 9 | color5 #c792ea 10 | color6 #7fdbca 11 | color7 #a1aab8 12 | color8 #7c8f8f 13 | color9 #ff5874 14 | color10 #21c7a8 15 | color11 #ecc48d 16 | color12 #82aaff 17 | color13 #ae81ff 18 | color14 #7fdbca 19 | color15 #d6deeb 20 | selection_background #b2ceee 21 | selection_foreground #080808 22 | -------------------------------------------------------------------------------- /kitty/themes/onehalf-dark.conf: -------------------------------------------------------------------------------- 1 | # Onehalf Colorscheme for Kitty 2 | # Based on https://github.com/sonph/onehalf 3 | # By https://github.com/dbinary 4 | 5 | foreground #dcdfe4 6 | background #282c34 7 | selection_foreground #000000 8 | selection_background #FFFACD 9 | url_color #0087BD 10 | 11 | # black 12 | color0 #282c34 13 | color8 #5d677a 14 | 15 | # red 16 | color1 #e06c75 17 | color9 #e06c75 18 | 19 | # green 20 | color2 #98c379 21 | color10 #98c379 22 | 23 | # yellow 24 | color3 #e5c07b 25 | color11 #e5c07b 26 | 27 | # blue 28 | color4 #61afef 29 | color12 #61afef 30 | 31 | # magenta 32 | color5 #c678dd 33 | color13 #c678dd 34 | 35 | # cyan 36 | color6 #56b6c2 37 | color14 #56b6c2 38 | 39 | # white 40 | color7 #dcdfe4 41 | color15 #dcdfe4 42 | 43 | -------------------------------------------------------------------------------- /kitty/themes/selenized-black.conf: -------------------------------------------------------------------------------- 1 | # vim:fileencoding=utf-8:ft=conf:foldmethod=marker 2 | 3 | # Selenized black color scheme for Kitty 4 | 5 | #: Color scheme {{{ 6 | 7 | #: The foreground and background colors 8 | foreground #b9b9b9 9 | background #181818 10 | 11 | #: The opacity of the background. A number between 0 and 1, where 1 is 12 | #: opaque and 0 is fully transparent. This will only work if 13 | #: supported by the OS (for instance, when using a compositor under 14 | #: X11). Note that it only sets the default background color's 15 | #: opacity. This is so that things like the status bar in vim, 16 | #: powerline prompts, etc. still look good. But it means that if you 17 | #: use a color theme with a background color in your editor, it will 18 | #: not be rendered as transparent. Instead you should change the 19 | #: default background color in your kitty config and not use a 20 | #: background color in the editor color scheme. Or use the escape 21 | #: codes to set the terminals default colors in a shell script to 22 | #: launch your editor. Be aware that using a value less than 1.0 is a 23 | #: (possibly significant) performance hit. If you want to dynamically 24 | #: change transparency of windows set dynamic_background_opacity to 25 | #: yes (this is off by default as it has a performance cost) 26 | background_opacity 1.0 27 | 28 | #: Allow changing of the background_opacity dynamically, using either 29 | #: keyboard shortcuts (increase_background_opacity and 30 | #: decrease_background_opacity) or the remote control facility. 31 | dynamic_background_opacity no 32 | 33 | #: How much to dim text that has the DIM/FAINT attribute set. One 34 | #: means no dimming and zero means fully dimmed (i.e. invisible). 35 | dim_opacity 0.625 36 | 37 | #: The foreground for text selected with the mouse. A value of none 38 | #: means to leave the color unchanged. 39 | selection_foreground none 40 | 41 | #: The background for text selected with the mouse. 42 | selection_background #3b3b3b 43 | 44 | #: Tab bar colors 45 | active_tab_foreground #dedede 46 | active_tab_background #3b3b3b 47 | inactive_tab_foreground #777777 48 | inactive_tab_background #181818 49 | tab_bar_background #181818 50 | 51 | #: The 16 terminal colors. There are 8 basic colors, each color has a 52 | #: dull and bright version. You can also set the remaining colors from 53 | #: the 256 color table as color16 to color255. 54 | 55 | #: black 56 | color0 #252525 57 | color8 #3b3b3b 58 | 59 | #: red 60 | color1 #ed4a46 61 | color9 #ff5e56 62 | 63 | #: green 64 | color2 #70b433 65 | color10 #83c746 66 | 67 | #: yellow 68 | color3 #dbb32d 69 | color11 #efc541 70 | 71 | #: blue 72 | color4 #368aeb 73 | color12 #4f9cfe 74 | 75 | #: magenta 76 | color5 #eb6eb7 77 | color13 #ff81ca 78 | 79 | #: cyan 80 | color6 #3fc5b7 81 | color14 #56d8c9 82 | 83 | #: white 84 | color7 #777777 85 | color15 #dedede 86 | 87 | #: }}} 88 | -------------------------------------------------------------------------------- /kitty/themes/selenized-dark.conf: -------------------------------------------------------------------------------- 1 | # vim:fileencoding=utf-8:ft=conf:foldmethod=marker 2 | 3 | # Selenized dark color scheme for Kitty 4 | 5 | #: Color scheme {{{ 6 | 7 | #: The foreground and background colors 8 | foreground #adbcbc 9 | background #103c48 10 | 11 | #: The opacity of the background. A number between 0 and 1, where 1 is 12 | #: opaque and 0 is fully transparent. This will only work if 13 | #: supported by the OS (for instance, when using a compositor under 14 | #: X11). Note that it only sets the default background color's 15 | #: opacity. This is so that things like the status bar in vim, 16 | #: powerline prompts, etc. still look good. But it means that if you 17 | #: use a color theme with a background color in your editor, it will 18 | #: not be rendered as transparent. Instead you should change the 19 | #: default background color in your kitty config and not use a 20 | #: background color in the editor color scheme. Or use the escape 21 | #: codes to set the terminals default colors in a shell script to 22 | #: launch your editor. Be aware that using a value less than 1.0 is a 23 | #: (possibly significant) performance hit. If you want to dynamically 24 | #: change transparency of windows set dynamic_background_opacity to 25 | #: yes (this is off by default as it has a performance cost) 26 | background_opacity 1.0 27 | 28 | #: Allow changing of the background_opacity dynamically, using either 29 | #: keyboard shortcuts (increase_background_opacity and 30 | #: decrease_background_opacity) or the remote control facility. 31 | dynamic_background_opacity no 32 | 33 | #: How much to dim text that has the DIM/FAINT attribute set. One 34 | #: means no dimming and zero means fully dimmed (i.e. invisible). 35 | dim_opacity 0.625 36 | 37 | #: The foreground for text selected with the mouse. A value of none 38 | #: means to leave the color unchanged. 39 | selection_foreground none 40 | 41 | #: The background for text selected with the mouse. 42 | selection_background #325b66 43 | 44 | #: Tab bar colors 45 | active_tab_foreground #cad8d9 46 | active_tab_background #325b66 47 | inactive_tab_foreground #72898f 48 | inactive_tab_background #103c48 49 | tab_bar_background #103c48 50 | 51 | #: The 16 terminal colors. There are 8 basic colors, each color has a 52 | #: dull and bright version. You can also set the remaining colors from 53 | #: the 256 color table as color16 to color255. 54 | 55 | #: black 56 | color0 #174956 57 | color8 #325b66 58 | 59 | #: red 60 | color1 #fa5750 61 | color9 #ff665c 62 | 63 | #: green 64 | color2 #75b938 65 | color10 #84c747 66 | 67 | #: yellow 68 | color3 #dbb32d 69 | color11 #ebc13d 70 | 71 | #: blue 72 | color4 #4695f7 73 | color12 #58a3ff 74 | 75 | #: magenta 76 | color5 #f275be 77 | color13 #ff84cd 78 | 79 | #: cyan 80 | color6 #41c7b9 81 | color14 #53d6c7 82 | 83 | #: white 84 | color7 #72898f 85 | color15 #cad8d9 86 | 87 | #: }}} 88 | -------------------------------------------------------------------------------- /kitty/themes/selenized-light.conf: -------------------------------------------------------------------------------- 1 | # vim:fileencoding=utf-8:ft=conf:foldmethod=marker 2 | 3 | # Selenized light color scheme for Kitty 4 | 5 | #: Color scheme {{{ 6 | 7 | #: The foreground and background colors 8 | foreground #53676d 9 | background #fbf3db 10 | 11 | #: The opacity of the background. A number between 0 and 1, where 1 is 12 | #: opaque and 0 is fully transparent. This will only work if 13 | #: supported by the OS (for instance, when using a compositor under 14 | #: X11). Note that it only sets the default background color's 15 | #: opacity. This is so that things like the status bar in vim, 16 | #: powerline prompts, etc. still look good. But it means that if you 17 | #: use a color theme with a background color in your editor, it will 18 | #: not be rendered as transparent. Instead you should change the 19 | #: default background color in your kitty config and not use a 20 | #: background color in the editor color scheme. Or use the escape 21 | #: codes to set the terminals default colors in a shell script to 22 | #: launch your editor. Be aware that using a value less than 1.0 is a 23 | #: (possibly significant) performance hit. If you want to dynamically 24 | #: change transparency of windows set dynamic_background_opacity to 25 | #: yes (this is off by default as it has a performance cost) 26 | background_opacity 1.0 27 | 28 | #: Allow changing of the background_opacity dynamically, using either 29 | #: keyboard shortcuts (increase_background_opacity and 30 | #: decrease_background_opacity) or the remote control facility. 31 | dynamic_background_opacity no 32 | 33 | #: How much to dim text that has the DIM/FAINT attribute set. One 34 | #: means no dimming and zero means fully dimmed (i.e. invisible). 35 | dim_opacity 0.625 36 | 37 | #: The foreground for text selected with the mouse. A value of none 38 | #: means to leave the color unchanged. 39 | selection_foreground none 40 | 41 | #: The background for text selected with the mouse. 42 | selection_background #cfcebe 43 | 44 | #: Tab bar colors 45 | active_tab_foreground #3a4d53 46 | active_tab_background #cfcebe 47 | inactive_tab_foreground #909995 48 | inactive_tab_background #fbf3db 49 | tab_bar_background #fbf3db 50 | 51 | #: The 16 terminal colors. There are 8 basic colors, each color has a 52 | #: dull and bright version. You can also set the remaining colors from 53 | #: the 256 color table as color16 to color255. 54 | 55 | #: black 56 | color0 #e9e4d0 57 | color8 #cfcebe 58 | 59 | #: red 60 | color1 #d2212d 61 | color9 #cc1729 62 | 63 | #: green 64 | color2 #489100 65 | color10 #428b00 66 | 67 | #: yellow 68 | color3 #ad8900 69 | color11 #a78300 70 | 71 | #: blue 72 | color4 #0072d4 73 | color12 #006dce 74 | 75 | #: magenta 76 | color5 #ca4898 77 | color13 #c44392 78 | 79 | #: cyan 80 | color6 #009c8f 81 | color14 #00978a 82 | 83 | #: white 84 | color7 #909995 85 | color15 #3a4d53 86 | 87 | #: }}} 88 | -------------------------------------------------------------------------------- /kitty/themes/selenized-white.conf: -------------------------------------------------------------------------------- 1 | # vim:fileencoding=utf-8:ft=conf:foldmethod=marker 2 | 3 | # Selenized white color scheme for Kitty 4 | 5 | #: Color scheme {{{ 6 | 7 | #: The foreground and background colors 8 | foreground #474747 9 | background #ffffff 10 | 11 | #: The opacity of the background. A number between 0 and 1, where 1 is 12 | #: opaque and 0 is fully transparent. This will only work if 13 | #: supported by the OS (for instance, when using a compositor under 14 | #: X11). Note that it only sets the default background color's 15 | #: opacity. This is so that things like the status bar in vim, 16 | #: powerline prompts, etc. still look good. But it means that if you 17 | #: use a color theme with a background color in your editor, it will 18 | #: not be rendered as transparent. Instead you should change the 19 | #: default background color in your kitty config and not use a 20 | #: background color in the editor color scheme. Or use the escape 21 | #: codes to set the terminals default colors in a shell script to 22 | #: launch your editor. Be aware that using a value less than 1.0 is a 23 | #: (possibly significant) performance hit. If you want to dynamically 24 | #: change transparency of windows set dynamic_background_opacity to 25 | #: yes (this is off by default as it has a performance cost) 26 | background_opacity 1.0 27 | 28 | #: Allow changing of the background_opacity dynamically, using either 29 | #: keyboard shortcuts (increase_background_opacity and 30 | #: decrease_background_opacity) or the remote control facility. 31 | dynamic_background_opacity no 32 | 33 | #: How much to dim text that has the DIM/FAINT attribute set. One 34 | #: means no dimming and zero means fully dimmed (i.e. invisible). 35 | dim_opacity 0.625 36 | 37 | #: The foreground for text selected with the mouse. A value of none 38 | #: means to leave the color unchanged. 39 | selection_foreground none 40 | 41 | #: The background for text selected with the mouse. 42 | selection_background #cdcdcd 43 | 44 | #: Tab bar colors 45 | active_tab_foreground #282828 46 | active_tab_background #cdcdcd 47 | inactive_tab_foreground #878787 48 | inactive_tab_background #ffffff 49 | tab_bar_background #ffffff 50 | 51 | #: The 16 terminal colors. There are 8 basic colors, each color has a 52 | #: dull and bright version. You can also set the remaining colors from 53 | #: the 256 color table as color16 to color255. 54 | 55 | #: black 56 | color0 #ebebeb 57 | color8 #cdcdcd 58 | 59 | #: red 60 | color1 #d6000c 61 | color9 #bf0000 62 | 63 | #: green 64 | color2 #1d9700 65 | color10 #008400 66 | 67 | #: yellow 68 | color3 #c49700 69 | color11 #af8500 70 | 71 | #: blue 72 | color4 #0064e4 73 | color12 #0054cf 74 | 75 | #: magenta 76 | color5 #dd0f9d 77 | color13 #c7008b 78 | 79 | #: cyan 80 | color6 #00ad9c 81 | color14 #009a8a 82 | 83 | #: white 84 | color7 #878787 85 | color15 #282828 86 | 87 | #: }}} 88 | -------------------------------------------------------------------------------- /kitty/themes/snazzy.conf: -------------------------------------------------------------------------------- 1 | # Snazzy Colorscheme for Kitty 2 | # Based on https://github.com/sindresorhus/hyper-snazzy 3 | 4 | foreground #eff0eb 5 | background #1e2127 6 | selection_foreground #000000 7 | selection_background #FFFACD 8 | url_color #0087BD 9 | cursor #97979B 10 | cursor_text_color #282A36 11 | 12 | # black 13 | color0 #282a36 14 | color8 #686868 15 | 16 | # red 17 | color1 #FF5C57 18 | color9 #FF5C57 19 | 20 | # green 21 | color2 #5AF78E 22 | color10 #5AF78E 23 | 24 | # yellow 25 | color3 #F3F99D 26 | color11 #F3F99D 27 | 28 | # blue 29 | color4 #57C7FF 30 | color12 #57C7FF 31 | 32 | # magenta 33 | color5 #FF6AC1 34 | color13 #FF6AC1 35 | 36 | # cyan 37 | color6 #9AEDFE 38 | color14 #9AEDFE 39 | 40 | # white 41 | color7 #F1F1F0 42 | color15 #EFF0EB 43 | -------------------------------------------------------------------------------- /kitty/themes/sonokai-andromeda.conf: -------------------------------------------------------------------------------- 1 | background #2b2d3a 2 | foreground #e1e3e4 3 | 4 | selection_background #3a3e4e 5 | selection_foreground #e1e3e4 6 | 7 | cursor #e1e3e4 8 | cursor_text_color background 9 | 10 | # Black 11 | color0 #181a1c 12 | color8 #7e8294 13 | 14 | # Red 15 | color1 #fb617e 16 | color9 #fb617e 17 | 18 | # Green 19 | color2 #9ed06c 20 | color10 #9ed06c 21 | 22 | # Yellow 23 | color3 #f0c362 24 | color11 #f0c362 25 | 26 | # Blue 27 | color4 #6dcae8 28 | color12 #6dcae8 29 | 30 | # Magenta 31 | color5 #bb97ee 32 | color13 #bb97ee 33 | 34 | # Cyan 35 | color6 #f89860 36 | color7 #f89860 37 | 38 | # White 39 | color7 #e1e3e4 40 | color15 #e1e3e4 41 | -------------------------------------------------------------------------------- /kitty/themes/sonokai-atlantis.conf: -------------------------------------------------------------------------------- 1 | background #2a2f38 2 | foreground #e1e3e4 3 | 4 | selection_background #3d4455 5 | selection_foreground #e1e3e4 6 | 7 | cursor #e1e3e4 8 | cursor_text_color background 9 | 10 | # Black 11 | color0 #181a1c 12 | color8 #828a9a 13 | 14 | # Red 15 | color1 #ff6578 16 | color9 #ff6578 17 | 18 | # Green 19 | color2 #9dd274 20 | color10 #9dd274 21 | 22 | # Yellow 23 | color3 #eacb64 24 | color11 #eacb64 25 | 26 | # Blue 27 | color4 #72cce8 28 | color12 #72cce8 29 | 30 | # Magenta 31 | color5 #ba9cf3 32 | color13 #ba9cf3 33 | 34 | # Cyan 35 | color6 #f69c5e 36 | color7 #f69c5e 37 | 38 | # White 39 | color7 #e1e3e4 40 | color15 #e1e3e4 41 | -------------------------------------------------------------------------------- /kitty/themes/sonokai-maia.conf: -------------------------------------------------------------------------------- 1 | background #273136 2 | foreground #e1e2e3 3 | 4 | selection_background #3a444b 5 | selection_foreground #e1e2e3 6 | 7 | cursor #e1e2e3 8 | cursor_text_color background 9 | 10 | # Black 11 | color0 #1c1e1f 12 | color8 #82878b 13 | 14 | # Red 15 | color1 #f76c7c 16 | color9 #f76c7c 17 | 18 | # Green 19 | color2 #9cd57b 20 | color10 #9cd57b 21 | 22 | # Yellow 23 | color3 #e3d367 24 | color11 #e3d367 25 | 26 | # Blue 27 | color4 #78cee9 28 | color12 #78cee9 29 | 30 | # Magenta 31 | color5 #baa0f8 32 | color13 #baa0f8 33 | 34 | # Cyan 35 | color6 #f3a96a 36 | color7 #f3a96a 37 | 38 | # White 39 | color7 #e1e2e3 40 | color15 #e1e2e3 41 | -------------------------------------------------------------------------------- /kitty/themes/sonokai-shusia.conf: -------------------------------------------------------------------------------- 1 | background #2d2a2e 2 | foreground #e3e1e4 3 | 4 | selection_background #423f46 5 | selection_foreground #e3e1e4 6 | 7 | cursor #e3e1e4 8 | cursor_text_color background 9 | 10 | # Black 11 | color0 #1a181a 12 | color8 #848089 13 | 14 | # Red 15 | color1 #f85e84 16 | color9 #f85e84 17 | 18 | # Green 19 | color2 #9ecd6f 20 | color10 #9ecd6f 21 | 22 | # Yellow 23 | color3 #e5c463 24 | color11 #e5c463 25 | 26 | # Blue 27 | color4 #7accd7 28 | color12 #7accd7 29 | 30 | # Magenta 31 | color5 #ab9df2 32 | color13 #ab9df2 33 | 34 | # Cyan 35 | color6 #ef9062 36 | color7 #ef9062 37 | 38 | # White 39 | color7 #e3e1e4 40 | color15 #e3e1e4 41 | -------------------------------------------------------------------------------- /lazygit/config.yml: -------------------------------------------------------------------------------- 1 | git: 2 | paging: 3 | colorArg: always 4 | pager: delta --paging=never 5 | gui: 6 | nerdFontsVersion: "3" 7 | -------------------------------------------------------------------------------- /lf/cleaner.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | kitty +kitten icat --clear --stdin no --silent --transfer-mode file < /dev/null > /dev/tty 4 | -------------------------------------------------------------------------------- /lf/icons: -------------------------------------------------------------------------------- 1 | # vim:ft=conf 2 | 3 | # These examples require Nerd Fonts or a compatible font to be used. 4 | # See https://www.nerdfonts.com for more information. 5 | 6 | # default values from lf (with matching order) 7 | # ln l # LINK 8 | # or l # ORPHAN 9 | # tw t # STICKY_OTHER_WRITABLE 10 | # ow d # OTHER_WRITABLE 11 | # st t # STICKY 12 | # di d # DIR 13 | # pi p # FIFO 14 | # so s # SOCK 15 | # bd b # BLK 16 | # cd c # CHR 17 | # su u # SETUID 18 | # sg g # SETGID 19 | # ex x # EXEC 20 | # fi - # FILE 21 | 22 | # file types (with matching order) 23 | ln  # LINK 24 | or  # ORPHAN 25 | tw t # STICKY_OTHER_WRITABLE 26 | ow  # OTHER_WRITABLE 27 | st t # STICKY 28 | di  # DIR 29 | pi p # FIFO 30 | so s # SOCK 31 | bd b # BLK 32 | cd c # CHR 33 | su u # SETUID 34 | sg g # SETGID 35 | ex  # EXEC 36 | fi  # FILE 37 | 38 | # file extensions (vim-devicons) 39 | *.styl  40 | *.sass  41 | *.scss  42 | *.htm  43 | *.html  44 | *.slim  45 | *.haml  46 | *.ejs  47 | *.css  48 | *.less  49 | *.md  50 | *.mdx  51 | *.markdown  52 | *.rmd  53 | *.json  54 | *.webmanifest  55 | *.js  56 | *.mjs  57 | *.jsx  58 | *.rb  59 | *.gemspec  60 | *.rake  61 | *.php  62 | *.py  63 | *.pyc  64 | *.pyo  65 | *.pyd  66 | *.coffee  67 | *.mustache  68 | *.hbs  69 | *.conf  70 | *.ini  71 | *.yml  72 | *.yaml  73 | *.toml  74 | *.bat  75 | *.mk  76 | *.jpg  77 | *.jpeg  78 | *.bmp  79 | *.png  80 | *.webp  81 | *.gif  82 | *.ico  83 | *.twig  84 | *.cpp  85 | *.c++  86 | *.cxx  87 | *.cc  88 | *.cp  89 | *.c  90 | *.cs 󰌛 91 | *.h  92 | *.hh  93 | *.hpp  94 | *.hxx  95 | *.hs  96 | *.lhs  97 | *.nix  98 | *.lua  99 | *.java  100 | *.sh  101 | *.fish  102 | *.bash  103 | *.zsh  104 | *.ksh  105 | *.csh  106 | *.awk  107 | *.ps1  108 | *.ml λ 109 | *.mli λ 110 | *.diff  111 | *.db  112 | *.sql  113 | *.dump  114 | *.clj  115 | *.cljc  116 | *.cljs  117 | *.edn  118 | *.scala  119 | *.go  120 | *.dart  121 | *.xul  122 | *.sln  123 | *.suo  124 | *.pl  125 | *.pm  126 | *.t  127 | *.rss  128 | '*.f#'  129 | *.fsscript  130 | *.fsx  131 | *.fs  132 | *.fsi  133 | *.rs  134 | *.rlib  135 | *.d  136 | *.erl  137 | *.hrl  138 | *.ex  139 | *.exs  140 | *.eex  141 | *.leex  142 | *.heex  143 | *.vim  144 | *.ai  145 | *.psd  146 | *.psb  147 | *.ts  148 | *.tsx  149 | *.jl  150 | *.pp  151 | *.vue  152 | *.elm  153 | *.swift  154 | *.xcplayground  155 | *.tex 󰙩 156 | *.r 󰟔 157 | *.rproj 󰗆 158 | *.sol 󰡪 159 | *.pem  160 | 161 | # file names (vim-devicons) (case-insensitive not supported in lf) 162 | *gruntfile.coffee  163 | *gruntfile.js  164 | *gruntfile.ls  165 | *gulpfile.coffee  166 | *gulpfile.js  167 | *gulpfile.ls  168 | *mix.lock  169 | *dropbox  170 | *.ds_store  171 | *.gitconfig  172 | *.gitignore  173 | *.gitattributes  174 | *.gitlab-ci.yml  175 | *.bashrc  176 | *.zshrc  177 | *.zshenv  178 | *.zprofile  179 | *.vimrc  180 | *.gvimrc  181 | *_vimrc  182 | *_gvimrc  183 | *.bashprofile  184 | *favicon.ico  185 | *license  186 | *node_modules  187 | *react.jsx  188 | *procfile  189 | *dockerfile  190 | *docker-compose.yml  191 | *rakefile  192 | *config.ru  193 | *gemfile  194 | *makefile  195 | *cmakelists.txt  196 | *robots.txt 󰚩 197 | 198 | # file names (case-sensitive adaptations) 199 | *Gruntfile.coffee  200 | *Gruntfile.js  201 | *Gruntfile.ls  202 | *Gulpfile.coffee  203 | *Gulpfile.js  204 | *Gulpfile.ls  205 | *Dropbox  206 | *.DS_Store  207 | *LICENSE  208 | *React.jsx  209 | *Procfile  210 | *Dockerfile  211 | *Docker-compose.yml  212 | *Rakefile  213 | *Gemfile  214 | *Makefile  215 | *CMakeLists.txt  216 | 217 | # file patterns (vim-devicons) (patterns not supported in lf) 218 | # .*jquery.*\.js$  219 | # .*angular.*\.js$  220 | # .*backbone.*\.js$  221 | # .*require.*\.js$  222 | # .*materialize.*\.js$  223 | # .*materialize.*\.css$  224 | # .*mootools.*\.js$  225 | # .*vimrc.*  226 | # Vagrantfile$  227 | 228 | # file patterns (file name adaptations) 229 | *jquery.min.js  230 | *angular.min.js  231 | *backbone.min.js  232 | *require.min.js  233 | *materialize.min.js  234 | *materialize.min.css  235 | *mootools.min.js  236 | *vimrc  237 | Vagrantfile  238 | 239 | # archives or compressed (extensions from dircolors defaults) 240 | *.tar  241 | *.tgz  242 | *.arc  243 | *.arj  244 | *.taz  245 | *.lha  246 | *.lz4  247 | *.lzh  248 | *.lzma  249 | *.tlz  250 | *.txz  251 | *.tzo  252 | *.t7z  253 | *.zip  254 | *.z  255 | *.dz  256 | *.gz  257 | *.lrz  258 | *.lz  259 | *.lzo  260 | *.xz  261 | *.zst  262 | *.tzst  263 | *.bz2  264 | *.bz  265 | *.tbz  266 | *.tbz2  267 | *.tz  268 | *.deb  269 | *.rpm  270 | *.jar  271 | *.war  272 | *.ear  273 | *.sar  274 | *.rar  275 | *.alz  276 | *.ace  277 | *.zoo  278 | *.cpio  279 | *.7z  280 | *.rz  281 | *.cab  282 | *.wim  283 | *.swm  284 | *.dwm  285 | *.esd  286 | 287 | # image formats (extensions from dircolors defaults) 288 | *.jpg  289 | *.jpeg  290 | *.mjpg  291 | *.mjpeg  292 | *.gif  293 | *.bmp  294 | *.pbm  295 | *.pgm  296 | *.ppm  297 | *.tga  298 | *.xbm  299 | *.xpm  300 | *.tif  301 | *.tiff  302 | *.png  303 | *.svg  304 | *.svgz  305 | *.mng  306 | *.pcx  307 | *.mov  308 | *.mpg  309 | *.mpeg  310 | *.m2v  311 | *.mkv  312 | *.webm  313 | *.ogm  314 | *.mp4  315 | *.m4v  316 | *.mp4v  317 | *.vob  318 | *.qt  319 | *.nuv  320 | *.wmv  321 | *.asf  322 | *.rm  323 | *.rmvb  324 | *.flc  325 | *.avi  326 | *.fli  327 | *.flv  328 | *.gl  329 | *.dl  330 | *.xcf  331 | *.xwd  332 | *.yuv  333 | *.cgm  334 | *.emf  335 | *.ogv  336 | *.ogx  337 | 338 | # audio formats (extensions from dircolors defaults) 339 | *.aac  340 | *.au  341 | *.flac  342 | *.m4a  343 | *.mid  344 | *.midi  345 | *.mka  346 | *.mp3  347 | *.mpc  348 | *.ogg  349 | *.ra  350 | *.wav  351 | *.oga  352 | *.opus  353 | *.spx  354 | *.xspf  355 | 356 | # other formats 357 | *.pdf  358 | *.log  359 | -------------------------------------------------------------------------------- /lf/lfrc: -------------------------------------------------------------------------------- 1 | # vim:ft=bash 2 | 3 | set previewer ~/.config/lf/previewer.sh 4 | set cleaner ~/.config/lf/cleaner.sh 5 | map i $(bat --paging=always $f) 6 | map I $(nvim -u NONE $f) 7 | 8 | map f $nvim $(fzf) 9 | map T trash 10 | map D delete 11 | map S calcdirsize 12 | 13 | set icons 14 | set sortby time 15 | set reverse 16 | set info size:time 17 | 18 | # interpreter for shell commands (needs to be POSIX compatible) 19 | # set shell zsh 20 | 21 | # set '-eu' options for shell commands 22 | # These options are used to have safer shell commands. Option '-e' is used to 23 | # exit on error and option '-u' is used to give error for unset variables. 24 | # Option '-f' disables pathname expansion which can be useful when $f, $fs, and 25 | # $fx variables contain names with '*' or '?' characters. However, this option 26 | # is used selectively within individual commands as it can be limiting at 27 | # times. 28 | set shellopts '-eu' 29 | 30 | # set internal field separator (IFS) to "\n" for shell commands 31 | # This is useful to automatically split file names in $fs and $fx properly 32 | # since default file separator used in these variables (i.e. 'filesep' option) 33 | # is newline. You need to consider the values of these options and create your 34 | # commands accordingly. 35 | set ifs "\n" 36 | 37 | # leave some space at the top and the bottom of the screen 38 | set scrolloff 10 39 | 40 | # use enter for shell commands 41 | map shell 42 | 43 | # execute current file (must be executable) 44 | map x $$f 45 | map X !$f 46 | 47 | # dedicated keys for file opener actions 48 | map o &open $f 49 | map O $open --ask $f 50 | 51 | # define a custom 'open' command 52 | # This command is called when current file is not a directory. You may want to 53 | # use either file extensions and/or mime types here. Below uses an editor for 54 | # text files and a file opener for the rest. 55 | cmd open ${{ 56 | case $(file --mime-type $f -b) in 57 | text/*) $EDITOR $fx;; 58 | *) for f in $fx; do setsid $OPENER $f > /dev/null 2> /dev/null & done;; 59 | esac 60 | }} 61 | 62 | # define a custom 'rename' command without prompt for overwrite 63 | # cmd rename %[ -e $1 ] && printf "file exists" || mv $f $1 64 | # map r push :rename 65 | 66 | # make sure trash folder exists 67 | # %mkdir -p ~/.trash 68 | 69 | # move current file or selected files to trash folder 70 | # (also see 'man mv' for backup/overwrite options) 71 | cmd trash %set -f; mv $fx ~/.trash 72 | 73 | # define a custom 'delete' command 74 | # cmd delete ${{ 75 | # set -f 76 | # printf "$fx\n" 77 | # printf "delete?[y/n]" 78 | # read ans 79 | # [ $ans = "y" ] && rm -rf $fx 80 | # }} 81 | 82 | # use '' key for either 'trash' or 'delete' command 83 | # map trash 84 | # map delete 85 | 86 | # extract the current file with the right command 87 | # (xkcd link: https://xkcd.com/1168/) 88 | cmd extract ${{ 89 | set -f 90 | case $f in 91 | *.tar.bz|*.tar.bz2|*.tbz|*.tbz2) tar xjvf $f;; 92 | *.tar.gz|*.tgz) tar xzvf $f;; 93 | *.tar.xz|*.txz) tar xJvf $f;; 94 | *.zip) unzip $f;; 95 | *.rar) unrar x $f;; 96 | *.7z) 7z x $f;; 97 | esac 98 | }} 99 | 100 | # compress current file or selected files with tar and gunzip 101 | cmd tar ${{ 102 | set -f 103 | mkdir $1 104 | cp -r $fx $1 105 | tar czf $1.tar.gz $1 106 | rm -rf $1 107 | }} 108 | 109 | # compress current file or selected files with zip 110 | cmd zip ${{ 111 | set -f 112 | mkdir $1 113 | cp -r $fx $1 114 | zip -r $1.zip $1 115 | rm -rf $1 116 | }} 117 | 118 | cmd z %{{ 119 | result="$(zoxide query --exclude $PWD $@ | sed 's/\\/\\\\/g;s/"/\\"/g')" 120 | lf -remote "send $id cd \"$result\"" 121 | }} 122 | 123 | cmd fzf_search ${{ 124 | RG_PREFIX="rg --column --line-number --no-heading --color=always --smart-case " 125 | res="$( 126 | FZF_DEFAULT_COMMAND="$RG_PREFIX ''" \ 127 | fzf --bind "change:reload:$RG_PREFIX {q} || true" \ 128 | --ansi --layout=reverse --header 'Search in files' \ 129 | | cut -d':' -f1 | sed 's/\\/\\\\/g;s/"/\\"/g' 130 | )" 131 | [ -n "$res" ] && lf -remote "send $id select \"$res\"" 132 | }} 133 | map gs :fzf_search 134 | 135 | cmd on-select &{{ 136 | lf -remote "send $id set statfmt \"$(eza -ld --color=always "$f")\"" 137 | }} 138 | 139 | cmd yank-dirname $dirname -- "$f" | head -n-1 | pbcopy 140 | cmd yank-path $printf '%s' "$fx" | pbcopy 141 | cmd yank-basename $basename -a -- $fx | head -n-1 | pbcopy 142 | map yd :yank-dirname 143 | map yp :yank-path 144 | map yy :yank-basename 145 | -------------------------------------------------------------------------------- /lf/previewer.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | file=$1 3 | w=$(($2 - 2)) 4 | h=$(($3 - 2)) 5 | x=$4 6 | y=$5 7 | 8 | if [[ "$( file -Lb --mime-type "$file")" =~ ^image ]]; then 9 | kitty +kitten icat --silent --stdin no --transfer-mode file --place "${w}x${h}@${x}x${y}" "$file" < /dev/null > /dev/tty 10 | exit 1 11 | fi 12 | 13 | num_lines=$(tr '\r' '\n' < "$file" | wc -l) 14 | end_start=$(($num_lines - 1)) 15 | 16 | case "${file}" in 17 | # *) echo $h ;; 18 | *.log) tr '\r' '\n' < "${file}" | bat -f -n -l log --terminal-width "${w}" --wrap=never -r :$h -r $end_start:;; 19 | *) bat -f -n --terminal-width "${w}" "${file}";; 20 | esac 21 | -------------------------------------------------------------------------------- /lf/utils.sh: -------------------------------------------------------------------------------- 1 | lfcd () { 2 | tmp="$(mktemp)" 3 | # `command` is needed in case `lfcd` is aliased to `lf` 4 | command lf -last-dir-path="$tmp" "$@" 5 | if [ -f "$tmp" ]; then 6 | dir="$(cat "$tmp")" 7 | rm -f "$tmp" 8 | if [ -d "$dir" ]; then 9 | if [ "$dir" != "$(pwd)" ]; then 10 | cd "$dir" 11 | fi 12 | fi 13 | fi 14 | } 15 | bindkey -s '^o' 'lfcd\n' # zsh 16 | -------------------------------------------------------------------------------- /neovide/config.toml: -------------------------------------------------------------------------------- 1 | frame = "transparent" 2 | 3 | [font] 4 | normal = [{ family = "Monaspace Argon"}, "Symbols Nerd Font Mono"] 5 | italic = [{ family = "Monaspace Radon" }, "Symbols Nerd Font Mono"] 6 | bold = [{ family = "Monaspace Krypton" }, "Symbols Nerd Font Mono"] 7 | size = 15 8 | 9 | [box-drawing] 10 | # "font-glyph", "native" or "selected-native" 11 | mode = "native" 12 | # selected = "🮐🮑🮒" 13 | # 14 | [font.features] 15 | "Monaspace Argon" = ["+calt", "+liga", "+dlig", "+ss01", "+ss02", "+ss03", "+ss04", "+ss05", "+ss06", "+ss07", "+ss08" ] 16 | "Monaspace Radon" = ["+calt", "+liga", "+dlig", "+ss01", "+ss02", "+ss03", "+ss04", "+ss05", "+ss06", "+ss07", "+ss08" ] 17 | "Monaspace Krypton" = ["+calt", "+liga", "+dlig", "+ss01", "+ss02", "+ss03", "+ss04", "+ss05", "+ss06", "+ss07", "+ss08" ] 18 | "Cascadia Code" = [ "+calt", "+ss01", "+ss02" ] 19 | -------------------------------------------------------------------------------- /nvim/after/queries/markdown/textobjects.scm: -------------------------------------------------------------------------------- 1 | ;extends 2 | 3 | (fenced_code_block (code_fence_content) @code_cell.inner) @code_cell.outer 4 | -------------------------------------------------------------------------------- /nvim/after/queries/python/highlights.scm: -------------------------------------------------------------------------------- 1 | ;; extends 2 | 3 | ; Set highlight to @text otherwise will be highlighted as @string 4 | ; # %% [markdown] cell 5 | (( 6 | (comment) @_mdcomment 7 | . (expression_statement 8 | (string (string_content) @variable))) 9 | (#lua-match? @_mdcomment "^# %%%% %[markdown%]")) 10 | 11 | -------------------------------------------------------------------------------- /nvim/after/queries/python/injections.scm: -------------------------------------------------------------------------------- 1 | ;extends 2 | 3 | ; # %% [markdown] 4 | ; """ 5 | ; Highlighting this region for this kind of cell 6 | ; """ 7 | (module 8 | (expression_statement 9 | (string 10 | (string_start) @_comment_mark 11 | (string_content) @injection.content) 12 | ) 13 | (#eq? @_comment_mark "\"\"\"") 14 | (#set! injection.language "markdown") 15 | ) 16 | 17 | ; proper capture but not supported offset yet 18 | ; ((comment) @_cell_marker 19 | ; . (comment)+ @injection.content 20 | ; . (comment) @_cell_end 21 | ; (#lua-match? @_cell_end "^# *%%%%") 22 | ; (#lua-match? @_cell_marker "^# *%%%% *%[markdown%]") 23 | ; (#not-lua-match? @injection.content "^# *%%%%") 24 | ; (#set! injection.language "markdown") 25 | ; ; (#offset! @injection.content 0 1 0 0) 26 | ; ) 27 | -------------------------------------------------------------------------------- /nvim/after/queries/python/textobjects.scm: -------------------------------------------------------------------------------- 1 | ; extends 2 | 3 | ; Code cells in percent format # %% 4 | ((comment) @cell_marker 5 | (#lua-match? @cell_marker "^# *%%%%")) 6 | 7 | 8 | ; ; doesn't work robustly for a cell with one node yet 9 | ; ; also for implicit beginning and and cells 10 | ((comment) @_marker 11 | . (_) @_start 12 | (_)* 13 | (_) @_end . 14 | (comment) @_marker 15 | (#lua-match? @_marker "^# *%%%%") 16 | (#make-range! "cell.inner" @_start @_end) 17 | ) 18 | ; ((comment) @_marker1 19 | ; . _? @_start 20 | ; _* 21 | ; _ @_end . 22 | ; (comment) @_marker2 23 | ; (#lua-match? @_marker1 "^# %%%%.*") 24 | ; (#lua-match? @_marker2 "^# %%%%.*") 25 | ; (#make-range! "cell.outer" @_marker1 @_end) 26 | ; ) 27 | -------------------------------------------------------------------------------- /nvim/data/plenary/filetypes/fortran.lua: -------------------------------------------------------------------------------- 1 | return { 2 | extension = { 3 | ["f90"] = "fortran", 4 | ["f95"] = "fortran", 5 | ["f03"] = "fortran", 6 | }, 7 | } 8 | -------------------------------------------------------------------------------- /nvim/ftplugin/cuda.vim: -------------------------------------------------------------------------------- 1 | setlocal commentstring=//%s 2 | -------------------------------------------------------------------------------- /nvim/ftplugin/ipynb.vim: -------------------------------------------------------------------------------- 1 | setlocal commentstring=#%s 2 | -------------------------------------------------------------------------------- /nvim/init.lua: -------------------------------------------------------------------------------- 1 | -- bootstrap lazy.nvim, LazyVim and your plugins 2 | require("config.lazy") 3 | -------------------------------------------------------------------------------- /nvim/lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "LazyVim": { "branch": "main", "commit": "25abbf546d564dc484cf903804661ba12de45507" }, 3 | "SchemaStore.nvim": { "branch": "main", "commit": "df87d16fc4ea7c2c67cfc00b513861738693fe07" }, 4 | "bamboo.nvim": { "branch": "master", "commit": "97124a0b81f886abc0d666ebec512b92425d67b6" }, 5 | "blink.cmp": { "branch": "main", "commit": "4f38ce99a472932d5776337f08f7a8180f1f571a" }, 6 | "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, 7 | "catppuccin": { "branch": "main", "commit": "1bf070129c0b6f77cc23f6a2212dcdc868308c52" }, 8 | "codecompanion.nvim": { "branch": "main", "commit": "d19670a44c35e9ba0674cc7a25ff3b8f22bbf062" }, 9 | "conform.nvim": { "branch": "master", "commit": "374aaf384e2e841607b8e2fe63fa3ad01d111c91" }, 10 | "dial.nvim": { "branch": "master", "commit": "2c7e2750372918f072a20f3cf754d845e143d7c9" }, 11 | "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, 12 | "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, 13 | "eagle.nvim": { "branch": "main", "commit": "dd1a28c4d8626fbe85580b0a9ed8f88d77a26da1" }, 14 | "edgy.nvim": { "branch": "main", "commit": "7e8dedc39abebe40c289b8012cc89b11c69aa7a0" }, 15 | "flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" }, 16 | "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, 17 | "gitlinker.nvim": { "branch": "master", "commit": "23982c86f50a9c3f4bc531d41b7a4a68ddd12355" }, 18 | "gitsigns.nvim": { "branch": "main", "commit": "43b0c856ae5f32a195d83f4a27fe21d63e6c966c" }, 19 | "grug-far.nvim": { "branch": "main", "commit": "5ddfc2e9d1967084162c2c77e7036a43029abf78" }, 20 | "hydra.nvim": { "branch": "main", "commit": "983852960cd4e4e9a1b272df0bd1447495aae755" }, 21 | "image.nvim": { "branch": "master", "commit": "f95cb9cca3a05033d5e94cfd760a48ec9a7d4719" }, 22 | "inc-rename.nvim": { "branch": "main", "commit": "2eaff20526ff6101337b84f4b0d238c11f47d7f4" }, 23 | "incline.nvim": { "branch": "main", "commit": "27040695b3bbfcd3257669037bd008d1a892831d" }, 24 | "inlay-hint.nvim": { "branch": "main", "commit": "9dce1b25bc60fd9cf06e548c2143ab87517c5cd6" }, 25 | "jupyter-kernel.nvim": { "branch": "main", "commit": "5772fa8932f2c73736a777082656f1bfe0287076" }, 26 | "jupytext.nvim": { "branch": "main", "commit": "c8baf3ad344c59b3abd461ecc17fc16ec44d0f7b" }, 27 | "kanagawa.nvim": { "branch": "master", "commit": "4de88d695634a8776c687af8e7436cfa074aa0c0" }, 28 | "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, 29 | "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, 30 | "log-highlight.nvim": { "branch": "main", "commit": "ad14bf52ef93d83a625ab22a1ed94405bcacbcf7" }, 31 | "lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" }, 32 | "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, 33 | "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, 34 | "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, 35 | "material.nvim": { "branch": "main", "commit": "96285a62923ea8e38aea7b603099752da2a97e97" }, 36 | "mini.ai": { "branch": "main", "commit": "e139eb1101beb0250fea322f8c07a42f0f175688" }, 37 | "mini.align": { "branch": "main", "commit": "2b42ac0be7d570c2208f9e334ecef13453cd222d" }, 38 | "mini.animate": { "branch": "main", "commit": "9b518c39c0e25b7b5e4e61db3f1407f7b4889f4e" }, 39 | "mini.hipatterns": { "branch": "main", "commit": "e5083df391171dc9d8172645606f8496d9443374" }, 40 | "mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" }, 41 | "mini.indentscope": { "branch": "main", "commit": "8af2569a7d7fd37300dfa760e44e71efbbf322fd" }, 42 | "mini.map": { "branch": "main", "commit": "f3c156693a9f68a10ae285d537edd36f4cf0e64f" }, 43 | "mini.operators": { "branch": "main", "commit": "2df4df029be367adfc781a8a1b5e8067d2d979df" }, 44 | "mini.pairs": { "branch": "main", "commit": "69864a2efb36c030877421634487fd90db1e4298" }, 45 | "mini.surround": { "branch": "main", "commit": "5aab42fcdcf31fa010f012771eda5631c077840a" }, 46 | "mini.visits": { "branch": "main", "commit": "c0a3b02f5d82080a2aa6cd9185ff16944ce2451a" }, 47 | "molten-nvim": { "branch": "main", "commit": "81aa71b6468aeb93297c47d7bac6938a47b7cbd9" }, 48 | "monokai-pro.nvim": { "branch": "master", "commit": "31bad737610ec211de086d373c73025f39de93cb" }, 49 | "neotest": { "branch": "master", "commit": "862afb2a2219d9ca565f67416fb7003cc0f22c4f" }, 50 | "neotest-python": { "branch": "master", "commit": "a2861ab3c9a0bf75a56b11835c2bfc8270f5be7e" }, 51 | "nightfox.nvim": { "branch": "main", "commit": "ba47d4b4c5ec308718641ba7402c143836f35aa9" }, 52 | "noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" }, 53 | "nordic.nvim": { "branch": "main", "commit": "6afe957722fb1b0ec7ca5fbea5a651bcca55f3e1" }, 54 | "nui.nvim": { "branch": "main", "commit": "f535005e6ad1016383f24e39559833759453564e" }, 55 | "nvim-cmp": { "branch": "main", "commit": "8c82d0bd31299dbff7f8e780f5e06d2283de9678" }, 56 | "nvim-lightbulb": { "branch": "master", "commit": "aa3a8b0f4305b25cfe368f6c9be9923a7c9d0805" }, 57 | "nvim-lint": { "branch": "master", "commit": "9dfb77ef6c5092a19502883c02dc5a02ec648729" }, 58 | "nvim-lspconfig": { "branch": "master", "commit": "61e5109c8cf24807e4ae29813a3a82b31821dd45" }, 59 | "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, 60 | "nvim-notify": { "branch": "master", "commit": "22f29093eae7785773ee9d543f8750348b1a195c" }, 61 | "nvim-send-to-term": { "branch": "master", "commit": "e0aa448d417a553d19cba8c78d91993387f1ff2d" }, 62 | "nvim-transparent": { "branch": "main", "commit": "8a2749a2fa74f97fe6557f61b89ac7fd873f3c21" }, 63 | "nvim-treesitter": { "branch": "master", "commit": "066fd6505377e3fd4aa219e61ce94c2b8bdb0b79" }, 64 | "nvim-treesitter-context": { "branch": "master", "commit": "5c48b8ba1b0b7b25feb6e34e7eb293ea893aedc4" }, 65 | "nvim-treesitter-textobjects": { "branch": "master", "commit": "e10df91b312c86af6d7ea9b0d525a3f5762b5dec" }, 66 | "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, 67 | "oil.nvim": { "branch": "master", "commit": "685cdb4ffa74473d75a1b97451f8654ceeab0f4a" }, 68 | "onedark.nvim": { "branch": "master", "commit": "11de4da47f3e69cb70c3ae9816bd8af166cbe121" }, 69 | "persistence.nvim": { "branch": "main", "commit": "166a79a55bfa7a4db3e26fc031b4d92af71d0b51" }, 70 | "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, 71 | "rainbow-delimiters.nvim": { "branch": "master", "commit": "55ad4fb76ab68460f700599b7449385f0c4e858e" }, 72 | "refactoring.nvim": { "branch": "master", "commit": "2be7ea3f10b7e59658f5abf6dffc50b5d61964d6" }, 73 | "render-markdown": { "branch": "main", "commit": "a1b0988f5ab26698afb56b9c2f0525a4de1195c1" }, 74 | "render-markdown.nvim": { "branch": "main", "commit": "a1b0988f5ab26698afb56b9c2f0525a4de1195c1" }, 75 | "scope.nvim": { "branch": "main", "commit": "6b4208f017da9b122d69ddc5841e040dffe7313c" }, 76 | "smart-splits.nvim": { "branch": "master", "commit": "bfa7a5f3c9b9bb20c0ac1c251d9285c124b9601a" }, 77 | "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, 78 | "suda.vim": { "branch": "master", "commit": "9adda7d195222d4e2854efb2a88005a120296c47" }, 79 | "tabout.nvim": { "branch": "master", "commit": "9a3499480a8e53dcaa665e2836f287e3b7764009" }, 80 | "telescope-lazy-plugins.nvim": { "branch": "main", "commit": "67ab8b6b4ff942184726993b8c3f5d840534ce15" }, 81 | "telescope.nvim": { "branch": "master", "commit": "415af52339215926d705cccc08145f3782c4d132" }, 82 | "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, 83 | "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, 84 | "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, 85 | "ts-comments.nvim": { "branch": "main", "commit": "1bd9d0ba1d8b336c3db50692ffd0955fe1bb9f0c" }, 86 | "ts-node-action": { "branch": "master", "commit": "bfaa787cc85d753af3c19245b4142ed727a534b5" }, 87 | "vim-matchup": { "branch": "master", "commit": "ea2ff43e09e68b63fc6d9268fc5d82d82d433cb3" }, 88 | "vim-mundo": { "branch": "master", "commit": "2ceda8c65f7b3f9066820729fc02003a09df91f9" }, 89 | "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, 90 | "vim-slime": { "branch": "main", "commit": "f6bbbeb8f18393f2177cdcef764f3e0e1d7e9328" }, 91 | "vim-unstack": { "branch": "master", "commit": "9b191419b4d3f26225a5ae3df5e409c62b426941" }, 92 | "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }, 93 | "window-picker": { "branch": "main", "commit": "6382540b2ae5de6c793d4aa2e3fe6dbb518505ec" }, 94 | "winshift.nvim": { "branch": "main", "commit": "37468ed6f385dfb50402368669766504c0e15583" }, 95 | "yazi.nvim": { "branch": "main", "commit": "82873628a2b78dce48b5bcf8d1d8ed14f0ee985f" } 96 | } 97 | -------------------------------------------------------------------------------- /nvim/lua/config/autocmds.lua: -------------------------------------------------------------------------------- 1 | -- Autocmds are automatically loaded on the VeryLazy event 2 | -- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua 3 | -- Add any additional autocmds here 4 | 5 | -- Plain terminal 6 | vim.api.nvim_create_autocmd("TermOpen", { 7 | pattern = "term://*", 8 | command = [[setlocal listchars= nonumber norelativenumber | startinsert]], 9 | }) 10 | 11 | -- vim.api.nvim_create_autocmd("TermClose", { 12 | -- callback = function() 13 | -- if vim.v.event.status == 0 then vim.api.nvim_buf_delete(0, {}) end 14 | -- end, 15 | -- }) 16 | 17 | -- show cursor line only in active window, i.e reticle.nvim 18 | vim.api.nvim_create_autocmd({ "InsertLeave", "WinEnter" }, { 19 | callback = function() 20 | local ok, cl = pcall(vim.api.nvim_win_get_var, 0, "auto-cursorline") 21 | if ok and cl then 22 | vim.wo.cursorline = true 23 | vim.api.nvim_win_del_var(0, "auto-cursorline") 24 | end 25 | end, 26 | }) 27 | vim.api.nvim_create_autocmd({ "InsertEnter", "WinLeave" }, { 28 | callback = function() 29 | local cl = vim.wo.cursorline 30 | if cl then 31 | vim.api.nvim_win_set_var(0, "auto-cursorline", cl) 32 | vim.wo.cursorline = false 33 | end 34 | end, 35 | }) 36 | 37 | -- auto wrap on text-based file 38 | vim.api.nvim_create_autocmd("FileType", { 39 | pattern = { "text", "tex", "markdown", "rst" }, 40 | callback = function() vim.wo.wrap = true end, 41 | }) 42 | 43 | -- indent line (non-blankline only) 44 | vim.api.nvim_create_autocmd("OptionSet", { 45 | pattern = { "list" }, 46 | callback = function() 47 | local bufnr = vim.api.nvim_get_current_buf() 48 | local lead = "│" 49 | for i = 1, vim.bo[bufnr].tabstop - 1 do 50 | lead = lead .. " " 51 | end 52 | vim.opt_local.listchars:append({ leadmultispace = lead }) 53 | end, 54 | }) 55 | 56 | ----------------- python ----------------- 57 | -- From nvim-puppetteer 58 | local function replaceNodeText(node, text) 59 | local start_row, start_col, end_row, end_col = node:range() 60 | local lines = vim.split(text, "\n") 61 | vim.cmd.undojoin() -- make undos ignore the next change, see issue #8 62 | vim.api.nvim_buf_set_text(0, start_row, start_col, end_row, end_col, lines) 63 | end 64 | vim.api.nvim_create_autocmd({ "InsertLeave", "TextChanged" }, { 65 | pattern = { "*.py" }, 66 | callback = function() -- Auto f-string on typing { 67 | local node = vim.treesitter.get_node() 68 | if not node then return end 69 | 70 | local str_node 71 | if node:type() == "string" then 72 | str_node = node 73 | elseif node:type():find("^string_") then 74 | str_node = node:parent() 75 | elseif node:type() == "escape_sequence" then 76 | str_node = node:parent():parent() 77 | else 78 | return 79 | end 80 | 81 | local text = vim.treesitter.get_node_text(str_node, 0) 82 | if text == "" then return end -- don't convert empty strings, user might want to enter sth 83 | 84 | local isFString = text:find("^f") 85 | local hasBraces = text:find("{.-}") 86 | 87 | if not isFString and hasBraces then 88 | replaceNodeText(str_node, "f" .. text) 89 | elseif isFString and not hasBraces then 90 | text = text:sub(2) 91 | replaceNodeText(str_node, text) 92 | end 93 | end, 94 | }) 95 | 96 | ------------ COLOR ------------ 97 | -- NOTE: Due to the way different colorschemes configure different highlights group, 98 | -- there is no universal way to add gui options to all the desired components. 99 | -- Findout the final highlight group being linked to and update gui option. 100 | local function mod_hl(opts, hl_names) 101 | for _, hl in ipairs(hl_names) do 102 | local hl_def = vim.api.nvim_get_hl(0, { name = hl }) 103 | for k, v in pairs(opts) do 104 | hl_def[k] = v 105 | end 106 | local ok, _ = pcall(vim.api.nvim_set_hl, 0, hl, hl_def) 107 | if not ok then vim.pretty_print("Failed to set highlight " .. hl) end 108 | end 109 | end 110 | 111 | local update_highlight = function() 112 | mod_hl({ bold = true, italic = true }, { 113 | "@type.builtin", 114 | "@module.builtin", 115 | "@constant.builtin", 116 | "@function.builtin", 117 | "@variable.builtin", 118 | "@variable.parameter.builtin", 119 | "@boolean", 120 | }) 121 | mod_hl({ bold = true }, { 122 | "@type", 123 | "@constructor", 124 | }) 125 | mod_hl({ italic = true }, { 126 | "@comment", 127 | "@variable.parameter", 128 | }) 129 | 130 | if 131 | not require("snacks").util.color("IlluminatedWordText") and require("snacks").util.color("LSPReferenceText") 132 | then 133 | vim.api.nvim_set_hl(0, "IlluminatedWordText", { link = "LSPReferenceText" }) 134 | vim.api.nvim_set_hl(0, "IlluminatedWordRead", { link = "LSPReferenceText" }) 135 | vim.api.nvim_set_hl(0, "IlluminatedWordWrite", { link = "LSPReferenceText" }) 136 | end 137 | vim.cmd([[ 138 | " highlight! Folded guibg=NONE 139 | highlight! MiniCursorwordCurrent guifg=NONE guibg=NONE gui=NONE cterm=NONE 140 | ]]) 141 | end 142 | vim.api.nvim_create_autocmd( 143 | { "ColorScheme", "SessionLoadPost" }, 144 | { group = vim.api.nvim_create_augroup("Color", {}), callback = update_highlight } 145 | ) 146 | vim.api.nvim_create_autocmd({ "BufReadPost" }, { 147 | group = vim.api.nvim_create_augroup("Color", { clear = false }), 148 | callback = update_highlight, 149 | once = true, 150 | }) 151 | -------------------------------------------------------------------------------- /nvim/lua/config/keymaps.lua: -------------------------------------------------------------------------------- 1 | -- Keymaps are automatically loaded on the VeryLazy event 2 | -- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua 3 | -- Add any additional keymaps here 4 | local map = vim.keymap.set 5 | 6 | -- map("n", "", "", { desc = "Alternate buffer" }) 7 | map({"n", "t"}, "", function() Snacks.terminal.toggle(nil, { win = { position = "float", border = "rounded"} }) end, {}) 8 | map("n", "fl", function() Snacks.terminal.open("lf") end, { desc = "LF file manager" }) 9 | map("t", "", [[]], { desc = "Escape terminal by scrolling up" }) 10 | 11 | -- map("t", "", "") 12 | -- map("t", "", "") 13 | -- map("t", "", "") 14 | 15 | map("n", "z", "za", { desc = "Toggle fold" }) 16 | 17 | map({ "n", "v" }, "gf", "gF", { desc = "Go to file at line" }) 18 | 19 | map("n", "H", "_", { desc = "First character of line" }) 20 | map("n", "L", "$", { desc = "Last character of line" }) 21 | map("n", "J", function() 22 | vim.cmd("normal! mzJ") 23 | local col = vim.fn.col(".") 24 | ---@diagnostic disable-next-line: param-type-mismatch 25 | local context = string.sub(vim.fn.getline("."), col - 1, col + 1) 26 | if 27 | context == ") ." 28 | or context == ") :" 29 | or context:match("%( .") 30 | or context:match(". ,") 31 | or context:match("%w %.") 32 | then 33 | vim.cmd("undojoin | normal! x") 34 | elseif context == ",)" then 35 | vim.cmd("undojoin | normal! hx") 36 | end 37 | vim.cmd("normal! `z") 38 | vim.cmd("delmarks z") 39 | end, { desc = "Join line with smart whitespace removal" }) 40 | 41 | map("n", "i", function() 42 | if #vim.fn.getline(".") == 0 then 43 | return [["_cc]] 44 | else 45 | return "i" 46 | end 47 | end, { expr = true, desc = "properly indent on empty line when insert" }) 48 | 49 | -- Don't remap as that is the same as ", { silent = true, desc = "Alternate file" }) 51 | map("n", "", "g", { silent = true, desc = "Alternate tab" }) 52 | map("n", "]", ":tabnext", { silent = true, desc = "Next tab" }) 53 | map("n", "[", ":tabprev", { silent = true, desc = "Prev tab" }) 54 | 55 | map("n", "dd", function() 56 | local is_empty_line = vim.api.nvim_get_current_line():match("^%s*$") 57 | if is_empty_line then 58 | return '"_dd' 59 | else 60 | return "dd" 61 | end 62 | end, { noremap = true, expr = true, desc = "Don't yank empty line to clipboard" }) 63 | 64 | map("n", "dm", function() 65 | local cur_line = vim.fn.line(".") 66 | -- Delete buffer local mark 67 | for _, mark in ipairs(vim.fn.getmarklist("%")) do 68 | if mark.pos[2] == cur_line and mark.mark:match("[a-zA-Z]") then 69 | vim.api.nvim_buf_del_mark(0, string.sub(mark.mark, 2, #mark.mark)) 70 | return 71 | end 72 | end 73 | -- Delete global marks 74 | local cur_buf = vim.api.nvim_win_get_buf(vim.api.nvim_get_current_win()) 75 | for _, mark in ipairs(vim.fn.getmarklist()) do 76 | if mark.pos[1] == cur_buf and mark.pos[2] == cur_line and mark.mark:match("[a-zA-Z]") then 77 | vim.api.nvim_buf_del_mark(0, string.sub(mark.mark, 2, #mark.mark)) 78 | return 79 | end 80 | end 81 | end, { noremap = true, desc = "Delete mark on the current line" }) 82 | 83 | -- mini.basic mappings 84 | 85 | map( 86 | "n", 87 | "gO", 88 | "call append(line('.') - 1, repeat([''], v:count1))", 89 | { desc = "Put empty line above" } 90 | ) 91 | map( 92 | "n", 93 | "go", 94 | "call append(line('.'), repeat([''], v:count1))", 95 | { desc = "Put empty line below" } 96 | ) 97 | 98 | 99 | map({ "n", "x" }, "gy", '"+y', { desc = "Copy to system clipboard" }) 100 | map({ "n" }, "gY", '"+y$', { desc = "Copy to system clipboard" }) 101 | map({ "n", "x" }, "gp", '"+p', { desc = "Paste from system clipboard" }) 102 | -- Paste in Visual with `P` to not copy selected text (`:h v_P`) 103 | map({ "n", "x" }, "gP", '"+P', { desc = "Paste from system (without yanking text)" }) 104 | 105 | -- gv: Reselect visual selection by default 106 | -- Reselect latest changed, put, or yanked text 107 | map( 108 | "n", 109 | "gV", 110 | '"`[" . strpart(getregtype(), 0, 1) . "`]"', 111 | { expr = true, desc = "Select changed" } 112 | ) 113 | 114 | -- Search inside visually highlighted text. Use `silent = false` for it to 115 | -- make effect immediately. 116 | map("x", "g/", "/\\%V", { silent = false, desc = "Search inside visual selection" }) 117 | 118 | -- Search visually selected text (slightly better than builtins in Neovim>=0.8) 119 | map("x", "*", [[y/\V=escape(@", '/\')]]) 120 | map("x", "#", [[y?\V=escape(@", '?\')]]) 121 | 122 | -- NOTE: Adding `redraw` helps with `cmdheight=0` if buffer is not modified 123 | map( 124 | { "n", "i", "x" }, 125 | "", 126 | "silent! update | redraw", 127 | { desc = "Save and go to Normal mode" } 128 | ) 129 | 130 | -- mini.basics toggles 131 | local toggle_prefix = [[\]] 132 | local map_toggle = function(lhs, rhs, desc) map("n", toggle_prefix .. lhs, rhs, { desc = desc }) end 133 | map_toggle( 134 | "b", 135 | 'lua vim.o.bg = vim.o.bg == "dark" and "light" or "dark"; print(vim.o.bg)', 136 | "Toggle 'background'" 137 | ) 138 | map_toggle("c", "setlocal cursorline! cursorline?", "Toggle 'cursorline'") 139 | map_toggle("C", "setlocal cursorcolumn! cursorcolumn?", "Toggle 'cursorcolumn'") 140 | map_toggle("d", function() 141 | if vim.o.diff then 142 | vim.cmd.diffoff() 143 | else 144 | vim.cmd.diffthis() 145 | end 146 | end, "Toggle diff mode") 147 | map_toggle( 148 | "h", 149 | 'let v:hlsearch = 1 - v:hlsearch | echo (v:hlsearch ? " " : "no") . "hlsearch"', 150 | "Toggle search highlight" 151 | ) 152 | map_toggle("i", "setlocal ignorecase! ignorecase?", "Toggle 'ignorecase'") 153 | map_toggle("l", "setlocal list! list?", "Toggle 'list'") 154 | map_toggle("n", "setlocal number! number?", "Toggle 'number'") 155 | map_toggle("r", "setlocal relativenumber! relativenumber?", "Toggle 'relativenumber'") 156 | map_toggle("s", "setlocal spell! spell?", "Toggle 'spell'") 157 | map_toggle("w", "setlocal wrap! wrap?", "Toggle 'wrap'") 158 | 159 | vim.api.nvim_create_user_command("DiffOrig", function() 160 | -- Get start buffer 161 | local start = vim.api.nvim_get_current_buf() 162 | local ft = vim.api.nvim_get_option_value("filetype", { buf = start }) 163 | 164 | -- `vnew` - Create empty vertical split window 165 | -- `set buftype=nofile` - Buffer is not related to a file, will not be written 166 | -- `0d_` - Remove an extra empty start row 167 | -- `diffthis` - Set diff mode to a new vertical split 168 | vim.cmd("vnew | set buftype=nofile | read ++edit # | 0d_ | diffthis") 169 | 170 | -- Get scratch buffer 171 | local scratch = vim.api.nvim_get_current_buf() 172 | vim.api.nvim_set_option_value("filetype", ft, { buf = scratch }) 173 | -- `wincmd p` - Go to the start window 174 | -- `diffthis` - Set diff mode to a start window 175 | vim.cmd("wincmd p | diffthis") 176 | 177 | -- Map `q` for both buffers to exit diff view and delete scratch buffer 178 | for _, buf in ipairs({ scratch, start }) do 179 | vim.keymap.set("n", "q", function() 180 | vim.api.nvim_buf_delete(scratch, { force = true }) 181 | vim.keymap.del("n", "q", { buffer = start }) 182 | end, { buffer = buf }) 183 | end 184 | end, { desc = "Diff with last saved." }) 185 | 186 | vim.keymap.set({ "c", "i", "t" }, "", "", { desc = "Alt-BS delete word in insert mode" }) 187 | vim.keymap.set({ "c", "i", "t" }, "", "", { desc = "Alt-S-BS delete word in insert mode" }) 188 | 189 | ---------- TAB 190 | vim.keymap.set("n", "n", "tabnew", { desc = "New tab" }) 191 | vim.keymap.set("n", "", function() 192 | vim.ui.select(vim.api.nvim_list_tabpages(), { 193 | prompt = "Select Tab:", 194 | format_item = function(tabid) 195 | local wins = vim.api.nvim_tabpage_list_wins(tabid) 196 | local not_floating_win = function(winid) 197 | return vim.api.nvim_win_get_config(winid).relative == "" 198 | end 199 | wins = vim.tbl_filter(not_floating_win, wins) 200 | local bufs = {} 201 | for _, win in ipairs(wins) do 202 | local buf = vim.api.nvim_win_get_buf(win) 203 | local buftype = vim.api.nvim_get_option_value("buftype", { buf = buf }) 204 | if buftype ~= "nofile" then 205 | local fname = vim.api.nvim_buf_get_name(buf) 206 | table.insert(bufs, vim.fn.fnamemodify(fname, ":t")) 207 | end 208 | end 209 | local tabnr = vim.api.nvim_tabpage_get_number(tabid) 210 | local cwd = string.format(" %8s: ", vim.fn.fnamemodify(vim.fn.getcwd(-1, tabnr), ":t")) 211 | local is_current = vim.api.nvim_tabpage_get_number(0) == tabnr and "✸" or " " 212 | return tabnr .. is_current .. cwd .. table.concat(bufs, ", ") 213 | end, 214 | }, function(tabid) 215 | if tabid ~= nil then vim.cmd(tabid .. "tabnext") end 216 | end) 217 | end, { desc = "Select tab" }) 218 | -------------------------------------------------------------------------------- /nvim/lua/config/lazy.lua: -------------------------------------------------------------------------------- 1 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 2 | if not vim.uv.fs_stat(lazypath) then 3 | -- bootstrap lazy.nvim 4 | -- stylua: ignore 5 | vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) 6 | end 7 | vim.opt.rtp:prepend(vim.env.LAZY or lazypath) 8 | 9 | -- Example for configuring Neovim to load user-installed installed Lua rocks: 10 | package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?/init.lua;" 11 | package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?.lua;" 12 | 13 | require("lazy").setup({ 14 | spec = { 15 | { 16 | "LazyVim/LazyVim", 17 | import = "lazyvim.plugins", 18 | opts = { colorscheme = "kanagawa" }, 19 | }, 20 | { import = "plugins" }, 21 | }, 22 | defaults = { 23 | lazy = true, -- every plugin is lazy-loaded by default 24 | version = false, -- always use the latest git commit 25 | }, 26 | checker = { enabled = false }, -- automatically check for plugin updates 27 | performance = { 28 | rtp = { 29 | disabled_plugins = { 30 | "gzip", 31 | "matchit", 32 | "matchparen", 33 | "netrwPlugin", 34 | "tarPlugin", 35 | "tohtml", 36 | "tutor", 37 | "zipPlugin", 38 | }, 39 | }, 40 | }, 41 | }) 42 | -------------------------------------------------------------------------------- /nvim/lua/config/options.lua: -------------------------------------------------------------------------------- 1 | -- Options are automatically loaded before lazy.nvim startup 2 | -- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua 3 | -- Add any additional options here 4 | 5 | local g, o, opt = vim.g, vim.o, vim.opt 6 | 7 | g.mapleader = " " 8 | 9 | o.title = true 10 | o.titlestring = " " .. vim.fn.fnamemodify(vim.fn.getcwd(), ":t") 11 | o.clipboard = "" -- use gy and gp to interact with osc52-system clipbard 12 | -- Copy/paste with system clipboard 13 | local function paste() 14 | return { 15 | vim.fn.split(vim.fn.getreg(""), "\n"), 16 | vim.fn.getregtype(""), 17 | } 18 | end 19 | g.clipboard = { 20 | name = "OSC 52", 21 | copy = { 22 | ["+"] = require("vim.ui.clipboard.osc52").copy("+"), 23 | ["*"] = require("vim.ui.clipboard.osc52").copy("*"), 24 | }, 25 | paste = { 26 | ["+"] = paste, 27 | ["*"] = paste, 28 | }, 29 | } 30 | o.splitright = true 31 | 32 | o.breakindent = true -- Indent wrapped lines to match line start 33 | o.showbreak = "↳" -- character show in front of wrapped lines 34 | -- o.breakindentopt = "shift:-2" -- dedent showbreak 35 | o.linebreak = true -- Wrap long lines at 'breakat' (if 'wrap' is set) 36 | 37 | o.number = true 38 | o.relativenumber = true 39 | o.numberwidth = 3 40 | o.cursorline = true 41 | o.showtabline = 0 --never 42 | o.winblend = 10 43 | 44 | o.ignorecase = true -- Ignore case when searching (use `\C` to force not doing that) 45 | o.incsearch = true -- Show search results while typing 46 | o.infercase = true -- Infer letter cases for a richer built-in keyword completion 47 | o.smartcase = true -- Don't ignore case when searching if pattern has upper case 48 | o.smartindent = true -- Make indenting smart 49 | 50 | o.virtualedit = "block,onemore" -- Allow going past the end of line in visual block mode 51 | o.scrolloff = 10 -- context lines 52 | 53 | o.list = false 54 | -- Define which helper symbols to show 55 | opt.listchars = { 56 | leadmultispace = "│ ", 57 | tab = "│ ", 58 | extends = "…", 59 | precedes = "…", 60 | trail = "␣", 61 | -- eol = "↲", 62 | } 63 | opt.fillchars = { 64 | foldopen = "", 65 | foldclose = "", 66 | fold = " ", 67 | diff = "╱", 68 | eob = " ", 69 | } 70 | 71 | opt.diffopt:append({ "indent-heuristic", "algorithm:patience" }) 72 | opt.foldlevel = 1 73 | g.autoformat = false 74 | 75 | opt.path:append("**") 76 | opt.shortmess:append("s") 77 | opt.mousemoveevent = true 78 | 79 | g.lazyvim_python_lsp = "basedpyright" 80 | g.lazyvim_python_ruff = "ruff" 81 | g.python3_host_prog = vim.fn.fnamemodify(os.getenv("CONDA_EXE") or "", ":p:h:h").. "/envs/neovim/bin/python" 82 | 83 | if vim.g.neovide then 84 | vim.g.minianimate_disable = true 85 | vim.g.neovide_window_blurred = true 86 | vim.g.neovide_opacity = 0.8 87 | vim.g.neovide_floating_corner_radius = 0.5 88 | vim.g.neovide_input_macos_option_key_is_meta = 'only_left' 89 | vim.g.neovide_cursor_animate_command_line = true -- noice incompat 90 | vim.g.neovide_cursor_smooth_blink = true 91 | -- vim.g.neovide_cursor_vfx_mode = "ripple" 92 | vim.keymap.set("v", "", '"+y') -- Copy 93 | vim.keymap.set({ "n", "v" }, "", '"+P') -- Paste 94 | vim.keymap.set({ "i", "c" }, "", "+") -- Paste 95 | vim.keymap.set("t", "", [["+P]]) -- Paste 96 | vim.keymap.set( 97 | "n", 98 | "", 99 | function() vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * 1.1 end 100 | ) 101 | vim.keymap.set( 102 | "n", 103 | "", 104 | function() vim.g.neovide_scale_factor = vim.g.neovide_scale_factor / 1.1 end 105 | ) 106 | vim.keymap.set( 107 | "n", 108 | "", 109 | function() vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * 1.1 end 110 | ) 111 | vim.keymap.set( 112 | "n", 113 | "", 114 | function() vim.g.neovide_scale_factor = vim.g.neovide_scale_factor / 1.1 end 115 | ) 116 | vim.g.neovide_scale_factor = 1.0 117 | vim.keymap.set({ "n", "v", "t", "i" }, "", [[tabnext]]) 118 | vim.keymap.set({ "n", "v", "t", "i" }, "", [[tabprev]]) 119 | vim.keymap.set({ "n", "v", "t", "i" }, "", [[tabnext #]]) 120 | vim.keymap.set({ "n", "v", "t", "i" }, "", [[tabnew]]) 121 | vim.keymap.set({ "n", "v", "t", "i" }, "", [[tabclose]]) 122 | -- https://github.com/neovide/neovide/issues/1771 123 | -- Prevent scrolling animation when changing buffer 124 | vim.api.nvim_create_autocmd("BufLeave", { 125 | callback = function() 126 | vim.g.neovide_scroll_animation_length = 0 127 | end, 128 | }) 129 | vim.api.nvim_create_autocmd("BufEnter", { 130 | callback = function() 131 | vim.fn.timer_start(70, function() 132 | vim.g.neovide_scroll_animation_length = 0.3 133 | end) 134 | end, 135 | }) 136 | end 137 | -------------------------------------------------------------------------------- /nvim/lua/config/util.lua: -------------------------------------------------------------------------------- 1 | M = {} 2 | 3 | function M.statuscolumn() 4 | local win = vim.g.statusline_winid 5 | local buf = vim.api.nvim_win_get_buf(win) 6 | local is_file = vim.bo[buf].buftype == "" 7 | local show_signs = vim.wo[win].signcolumn ~= "no" 8 | 9 | local components = { "", "", "" } -- left, middle, right 10 | 11 | local show_open_folds = vim.g.lazyvim_statuscolumn and vim.g.lazyvim_statuscolumn.folds_open 12 | local use_githl = vim.g.lazyvim_statuscolumn and vim.g.lazyvim_statuscolumn.folds_githl 13 | 14 | if show_signs then 15 | local signs = LazyVim.ui.get_signs(buf, vim.v.lnum) 16 | 17 | ---@type Sign?,Sign?,Sign? 18 | local sign, gitsign, fold, githl 19 | for _, s in ipairs(signs) do 20 | if s.name and (s.name:find("GitSign") or s.name:find("MiniDiffSign")) then 21 | gitsign = s 22 | if use_githl then 23 | githl = s["texthl"] 24 | end 25 | else 26 | sign = s 27 | end 28 | end 29 | 30 | vim.api.nvim_win_call(win, function() 31 | if vim.fn.foldclosed(vim.v.lnum) >= 0 then 32 | fold = { text = vim.opt.fillchars:get().foldclose or "", texthl = githl or "Folded" } 33 | elseif 34 | show_open_folds 35 | and not LazyVim.ui.skip_foldexpr[buf] 36 | and tostring(vim.treesitter.foldexpr(vim.v.lnum)):sub(1, 1) == ">" 37 | then -- fold start 38 | fold = { text = vim.opt.fillchars:get().foldopen or "", texthl = githl } 39 | end 40 | end) 41 | 42 | local mark = LazyVim.ui.get_mark(buf, vim.v.lnum) 43 | if vim.v.virtnum ~= 0 then 44 | -- Don't duplicate sign on virtual line 45 | sign = nil 46 | else 47 | sign = mark or fold or sign 48 | end 49 | -- except for gitsign's indicator line 50 | components[2] = LazyVim.ui.icon(sign or gitsign) 51 | end 52 | 53 | -- Numbers in Neovim are weird 54 | -- They show when either number or relativenumber is true 55 | local is_num = vim.wo[win].number 56 | local is_relnum = vim.wo[win].relativenumber 57 | if (is_num or is_relnum) and vim.v.virtnum == 0 then 58 | if vim.fn.has("nvim-0.11") == 1 then 59 | components[1] = "%l" -- 0.11 handles both the current and other lines with %l 60 | else 61 | if vim.v.relnum == 0 then 62 | components[1] = "%l" -- the current line 63 | else 64 | components[1] = is_relnum and "%r" or "%l" -- other lines 65 | end 66 | end 67 | end 68 | 69 | components[1] = "%=" .. components[1] .. " " -- right align 70 | -- if vim.v.virtnum ~= 0 then components[1] = "%= " end 71 | 72 | return table.concat(components, "") 73 | end 74 | 75 | return M 76 | -------------------------------------------------------------------------------- /nvim/lua/plugins/ai.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "olimorris/codecompanion.nvim", 4 | dependencies = { 5 | "nvim-lua/plenary.nvim", 6 | "nvim-treesitter/nvim-treesitter", 7 | "nvim-telescope/telescope.nvim", -- Optional 8 | { 9 | "stevearc/dressing.nvim", -- Optional: Improves the default Neovim UI 10 | opts = {}, 11 | }, 12 | }, 13 | opts = { 14 | adapters = { 15 | openai = function() 16 | return require("codecompanion.adapters").extend("openai", { 17 | url = "localhost:8080/v1/chat/completions", 18 | }) 19 | end, 20 | }, 21 | }, 22 | cmd = { "CodeCompanion" }, 23 | keys = { 24 | { "aa", "CodeCompanionActions", mode = { "n", "v" }, desc = "AI Actions" }, 25 | { "", "CodeCompanionToggle", mode = { "n", "v" }, desc = "AI chat Toggle" }, 26 | { "ac", "CodeCompanionAdd", mode = { "v" }, desc = "AI add to Chat" }, 27 | { "ap", "'<,'>CodeCompanion", mode = { "n", "v" }, desc = "AI Prompt" }, 28 | }, 29 | }, 30 | } 31 | -------------------------------------------------------------------------------- /nvim/lua/plugins/cmp.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "hrsh7th/nvim-cmp", 4 | event = { "InsertEnter", "CmdlineEnter" }, 5 | dependencies = { 6 | "hrsh7th/cmp-cmdline", 7 | "dmitmel/cmp-cmdline-history", 8 | "rafamadriz/friendly-snippets", 9 | { "garymjr/nvim-snippets", opts = { friendly_snippets = true } }, 10 | }, 11 | opts = function(_, opts) 12 | opts.completion.keyword_length = 2 13 | opts.window = { 14 | completion = { 15 | col_offset = -2, -- to align text when 2 icons are prepended 16 | }, 17 | } 18 | 19 | table.insert(opts.sources, { name = "snippets" }) 20 | 21 | opts.formatting = { 22 | fields = { "kind", "abbr", "menu" }, 23 | format = function(entry, item) 24 | local kind_icons = require("lazyvim.config").icons.kinds 25 | local source_icons = { 26 | nvim_lsp = "", 27 | luasnip = "", 28 | snippets = "", 29 | treesitter = "", 30 | tags = "", 31 | buffer = "", 32 | fuzzy_buffer = "󱔘", 33 | path = "", 34 | fuzzy_path = "󰉓", 35 | omni = "", 36 | cmp_ai = "", 37 | copilot = "", 38 | cmp_tabnine = "󰌒", 39 | rg = "", 40 | cmdline = "", 41 | cmdline_history = "", 42 | jupyter = "", 43 | } 44 | item.menu = source_icons[entry.source.name] or entry.source.name 45 | item.menu = item.menu .. " " .. item.kind 46 | item.kind = kind_icons[item.kind]:sub(1, -2) or " " 47 | return item 48 | end, 49 | } 50 | end, 51 | 52 | config = function(_, opts) 53 | local cmp = require("cmp") 54 | for _, source in ipairs(opts.sources) do 55 | if source.name == "copilot" then 56 | source.group_index = 2 -- disable copilot on default 57 | else 58 | source.group_index = source.group_index or 1 59 | end 60 | end 61 | opts.mapping = vim.tbl_extend("force", opts.mapping, { 62 | [""] = cmp.mapping.complete({ 63 | config = { 64 | sources = vim.tbl_filter( 65 | function(source) return source.group_index == 2 end, 66 | opts.sources 67 | ), 68 | }, 69 | }), 70 | }) 71 | cmp.setup(opts) -- insert mode completion 72 | cmp.setup.cmdline({ "/", "?" }, { 73 | completion = { completeopt = "menu,menuone,noselect,noinsert" }, 74 | mapping = cmp.mapping.preset.cmdline(), 75 | sources = { 76 | { name = "buffer" }, 77 | }, 78 | }) 79 | cmp.setup.cmdline(":", { 80 | completion = { completeopt = "menu,menuone,noselect,noinsert" }, 81 | mapping = cmp.mapping.preset.cmdline(), 82 | sources = cmp.config.sources({ 83 | { name = "cmdline" }, 84 | { name = "cmdline_history" }, 85 | }), 86 | }) 87 | end, 88 | }, 89 | } 90 | -------------------------------------------------------------------------------- /nvim/lua/plugins/coding.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-lint", 4 | opts = { 5 | linters_by_ft = { 6 | sh = { "shellcheck" }, 7 | markdown = {}, 8 | }, 9 | }, 10 | }, 11 | { 12 | "folke/flash.nvim", 13 | keys = { 14 | { 15 | "*", 16 | function() require("flash").jump({ pattern = vim.fn.expand("") }) end, 17 | desc = "Jump with current word.", 18 | }, 19 | { 20 | "k", 21 | function() 22 | require("flash").jump({ 23 | action = function(match, state) 24 | vim.api.nvim_win_call(match.win, function() 25 | vim.api.nvim_win_set_cursor(match.win, match.pos) 26 | vim.lsp.buf.hover() 27 | end) 28 | state:restore() 29 | end, 30 | }) 31 | end, 32 | }, 33 | }, 34 | }, 35 | { 36 | "echasnovski/mini.align", 37 | opts = { mappings = { start = "", start_with_preview = "gA" } }, 38 | keys = { { "gA", desc = "Align with preview", mode = { "n", "x" } } }, 39 | }, 40 | { 41 | "echasnovski/mini.indentscope", 42 | opts = { 43 | mappings = { goto_top = "[ai", goto_bottom = "]ai" }, 44 | draw = { priority = 12 }, 45 | }, 46 | }, 47 | { 48 | "abecodes/tabout.nvim", 49 | config = function() 50 | require("tabout").setup({ 51 | tabkey = "", -- key to trigger tabout, set to an empty string to disable 52 | backwards_tabkey = "", -- key to trigger backwards tabout, set to an empty string to disable 53 | act_as_tab = true, -- shift content if tab out is not possible 54 | act_as_shift_tab = false, -- reverse shift content if tab out is not possible (if your keyboard/terminal supports ) 55 | default_tab = "", -- shift default action (only at the beginning of a line, otherwise is used) 56 | default_shift_tab = "", -- reverse shift default action, 57 | enable_backwards = true, -- well ... 58 | completion = false, -- if the tabkey is used in a completion pum 59 | tabouts = { 60 | { open = "'", close = "'" }, 61 | { open = '"', close = '"' }, 62 | { open = "`", close = "`" }, 63 | { open = "(", close = ")" }, 64 | { open = "[", close = "]" }, 65 | { open = "{", close = "}" }, 66 | }, 67 | ignore_beginning = true, --[[ if the cursor is at the beginning of a filled element it will rather tab out than shift the content ]] 68 | exclude = {}, -- tabout will ignore these filetypes 69 | }) 70 | end, 71 | opt = true, -- Set this to true if the plugin is optional 72 | event = "InsertCharPre", -- Set the event to 'InsertCharPre' for better compatibility 73 | priority = 1000, 74 | }, 75 | { "indent-blankline.nvim", enabled = false }, 76 | { "tpope/vim-sleuth", event = "VeryLazy" }, --One plugin everything tab indent 77 | { 78 | "CKolkey/ts-node-action", 79 | dependencies = { "nvim-treesitter" }, 80 | config = true, 81 | keys = { 82 | { 83 | "ga", 84 | function() require("ts-node-action").node_action() end, 85 | desc = "Node Action", 86 | }, 87 | }, 88 | }, 89 | { 90 | "ThePrimeagen/refactoring.nvim", 91 | opts = {}, 92 | cmd = "Refactor", 93 | keys = { 94 | { 95 | "dv", 96 | function() require("refactoring").debug.print_var() end, 97 | mode = { "x", "n" }, 98 | desc = "Print variable", 99 | }, 100 | { 101 | "dd", 102 | function() require("refactoring").debug.printf() end, 103 | mode = "n", 104 | desc = "Print function call", 105 | }, 106 | { 107 | "dD", 108 | function() require("refactoring").debug.cleanup() end, 109 | mode = "n", 110 | desc = "Print cleanup", 111 | }, 112 | }, 113 | }, 114 | { 115 | "echasnovski/mini.surround", 116 | opts = { 117 | mappings = { -- Emulate Tpope's original mapping 118 | add = "ys", 119 | delete = "ds", 120 | find = "]s", 121 | find_left = "[s", 122 | highlight = "vs", 123 | replace = "cs", 124 | update_n_lines = "gsn", 125 | }, 126 | }, 127 | }, 128 | { "echasnovski/mini.operators", opts = {}, keys = { "g=", "gx", "gm", "gr", "gs" } }, 129 | { "mini.comment", enabled = not vim.fn.has("nvim-0.10") }, 130 | { "lambdalisue/suda.vim", cmd = { "SudaRead", "SudaWrite" } }, 131 | } 132 | -------------------------------------------------------------------------------- /nvim/lua/plugins/colorschemes.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { "rebelot/kanagawa.nvim", 3 | opts = { 4 | dimInactive = true, 5 | colors = { theme = { all = { ui = { bg_gutter = "none" } } } }, 6 | }, 7 | }, 8 | { "navarasu/onedark.nvim", opts = { style = "warmer" } }, 9 | { "folke/tokyonight.nvim", opts = { dim_inactive = true } }, 10 | { "EdenEast/nightfox.nvim", opts = { options = { dim_inactive = true } } }, -- dayfox, dawnfox, duskfox, nordfox, terafox, carbonfox 11 | { 'AlexvZyl/nordic.nvim'}, 12 | { "catppuccin/nvim", name = "catppuccin", opts = { dim_inactive = { enabled = true } } }, 13 | { "loctvl842/monokai-pro.nvim" }, 14 | { "marko-cerovac/material.nvim" }, 15 | { 16 | "ribru17/bamboo.nvim", 17 | opts = { 18 | highlights = { ["@comment"] = { fg = "$grey" } }, 19 | dim_inactive = true, 20 | }, 21 | }, 22 | { "xiyaowong/nvim-transparent", 23 | opts = { extra_groups = { "NormalFloat" } }, 24 | keys = { { "\\t", "TransparentToggle", desc = "Toggle Transparent" } }, 25 | }, 26 | { "folke/styler.nvim", 27 | event = "VeryLazy", 28 | enabled = false, 29 | opts = { 30 | themes = { 31 | python = { colorscheme = "bamboo" }, 32 | markdown = { colorscheme = "catppuccin" }, 33 | json = { colorscheme = "monokai-pro" }, 34 | toml = { colorscheme = "monokai-pro-spectrum" }, 35 | yaml = { colorscheme = "monokai-pro-machine" }, 36 | help = { colorscheme = "material-deep-ocean" }, 37 | }, 38 | }, 39 | }, 40 | } 41 | -------------------------------------------------------------------------------- /nvim/lua/plugins/editor.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { -- Undo tree 3 | "simnalamburt/vim-mundo", 4 | cmd = "MundoToggle", 5 | keys = { { "uu", "MundoToggle", desc = "Undo" } }, 6 | }, 7 | { 8 | "echasnovski/mini.visits", 9 | event = "BufEnter", 10 | opts = {}, 11 | keys = { 12 | { "va", function() require("mini.visits").add_label() end, desc = "Add label" }, 13 | { "vr", function() require("mini.visits").remove_label() end, desc = "Remove label" }, 14 | { 15 | "vl", 16 | function() require("mini.visits").select_label("", nil) end, 17 | desc = "Select label (cwd)", 18 | }, 19 | { 20 | "vL", 21 | function() require("mini.visits").select_label("", "") end, 22 | desc = "Select label (all)", 23 | }, 24 | { 25 | "vv", 26 | function() require("mini.visits").select_path() end, 27 | desc = "Visited path (cwd)", 28 | }, 29 | { 30 | "vV", 31 | function() require("mini.visits").select_path("") end, 32 | desc = "Visited path (all)", 33 | }, 34 | { 35 | "]v", 36 | function() require("mini.visits").iterate_paths("forward") end, 37 | desc = "Next visited path", 38 | }, 39 | { 40 | "[v", 41 | function() require("mini.visits").iterate_paths("backward") end, 42 | desc = "Previous visited path", 43 | }, 44 | { 45 | "]V", 46 | function() require("mini.visits").iterate_paths("last") end, 47 | desc = "Last visited path", 48 | }, 49 | { 50 | "[V", 51 | function() require("mini.visits").iterate_paths("first") end, 52 | desc = "First visited path", 53 | }, 54 | }, 55 | }, 56 | { 57 | "echasnovski/mini.map", 58 | opts = function() 59 | local map = require("mini.map") 60 | return { 61 | symbols = { encode = require("mini.map").gen_encode_symbols.dot("3x2") }, 62 | integrations = { 63 | map.gen_integration.builtin_search(), 64 | map.gen_integration.diff(), 65 | map.gen_integration.gitsigns(), 66 | map.gen_integration.diagnostic(), 67 | }, 68 | window = { 69 | show_integration_count = false, 70 | }, 71 | } 72 | end, 73 | keys = { 74 | { "mm", "lua MiniMap.toggle()", desc = "MiniMap" }, 75 | { "mf", "lua MiniMap.toggle_focus()", desc = "MiniMap" }, 76 | { "ms", "lua MiniMap.toggle_side()", desc = "MiniMap" }, 77 | }, 78 | }, 79 | { 80 | "mattboehm/vim-unstack", 81 | cmd = { "UnstackFromSelection", "UnstackFromClipboard", "UnstackFromText" }, 82 | keys = { { "dS", "UnstackFromClipboard", desc = "Un-stack trace" } }, 83 | }, 84 | { "HiPhish/rainbow-delimiters.nvim", event = "BufEnter" }, 85 | { "tiagovla/scope.nvim", opts = {}, event = "VeryLazy" }, 86 | { "soulis-1256/eagle.nvim", lazy = false }, 87 | { 88 | "3rd/image.nvim", 89 | enabled = false, 90 | ft = { "markdown", "vimwiki", "quarto", "python" }, 91 | opts = { 92 | integrations = { 93 | markdown = { filetypes = { "markdown", "vimwiki", "quarto", "python" } }, 94 | }, 95 | max_width = 100, 96 | max_height = 12, 97 | max_height_window_percentage = math.huge, -- this is necessary for a good experience 98 | max_width_window_percentage = math.huge, 99 | window_overlap_clear_enabled = false, -- toggles images when windows are overlapped 100 | window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "" }, 101 | }, 102 | }, 103 | { 104 | "MeanderingProgrammer/markdown.nvim", 105 | dependencies = { { "headlines.nvim", enabled = false } }, 106 | name = "render-markdown", -- Only needed if you have another plugin named markdown.nvim 107 | ft = { "markdown", "python", "quarto", "rmd", "vimwiki", "norg", "org", "octo" }, 108 | opts = { 109 | file_types = { "markdown", "python", "quarto", "rmd", "vimwiki", "norg", "org", "octo" }, 110 | }, 111 | }, 112 | { "stevearc/oil.nvim", opts = {}, keys = { { "-", "Oil", desc = "Open parent directory" } } }, 113 | { ---@type LazySpec 114 | "mikavilpas/yazi.nvim", 115 | event = "VeryLazy", 116 | keys = { 117 | { "-", "Yazi", desc = "Open yazi at the current file", }, 118 | { "_", "Yazi cwd", desc = "Open the file manager in nvim's working directory", }, 119 | { "fy", "Yazi toggle", desc = "Resume the last yazi session", }, 120 | }, 121 | opts = { 122 | open_for_directories = false, 123 | keymaps = { show_help = "", }, 124 | }, 125 | }, 126 | } 127 | -------------------------------------------------------------------------------- /nvim/lua/plugins/git.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- { "tpope/vim-fugitive", cmd = "G" }, -- Git commands in nvim 3 | { 4 | "sindrets/diffview.nvim", 5 | keys = { 6 | { "gh", "DiffviewFileHistory %", desc = "File history" }, 7 | { "gH", "DiffviewFileHistory ", desc = "Commit history" }, 8 | { "gv", "DiffviewOpen", desc = "Diff View" }, 9 | }, 10 | }, 11 | { 12 | "lewis6991/gitsigns.nvim", 13 | opts = { 14 | signs = { untracked = { text = "┊"}}, 15 | current_line_blame_opts = { virt_text_pos = 'right_align'}, 16 | attach_to_untracked = true, 17 | on_attach = function(buffer) 18 | local gs = require("gitsigns") 19 | 20 | local function map(mode, l, r, desc) 21 | vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc }) 22 | end 23 | 24 | map("n", "]h", function() gs.nav_hunk("next") end, "Next Hunk") 25 | map("n", "[h", function() gs.nav_hunk("prev") end, "Prev Hunk") 26 | map("n", "]H", function() gs.nav_hunk("last") end, "Last Hunk") 27 | map("n", "[H", function() gs.nav_hunk("first") end, "First Hunk") 28 | map({ "n", "v" }, "gs", ":Gitsigns stage_hunk", "Stage Hunk") 29 | map({ "n", "v" }, "gr", ":Gitsigns reset_hunk", "Reset Hunk") 30 | map("n", "gS", gs.stage_buffer, "Stage Buffer") 31 | map("n", "gu", gs.undo_stage_hunk, "Undo Stage Hunk") 32 | map("n", "gU", gs.reset_buffer_index, "Undo all Stage Hunk") 33 | map("n", "gR", gs.reset_buffer, "Reset Buffer") 34 | map("n", "gp", gs.preview_hunk_inline, "Preview Hunk Inline") 35 | map("n", "gb", function() gs.blame_line({ full = true }) end, "Blame Line") 36 | map("n", "gd", gs.diffthis, "Diff This") 37 | map("n", "gD", function() gs.diffthis("~") end, "Diff This ~") 38 | map({ "o", "x" }, "gh", ":Gitsigns select_hunk", "GitSigns Select Hunk") 39 | 40 | map("n", "gtb", gs.toggle_current_line_blame, "blame virtual text") 41 | map("n", "gtd", gs.toggle_deleted, "deleted virtual text") 42 | map("n", "gtl", gs.toggle_linehl, "line highlight") 43 | map("n", "gtn", gs.toggle_numhl, "line number highlight") 44 | map("n", "gts", gs.toggle_signs, "signs column") 45 | map("n", "gtw", gs.toggle_word_diff, "word diff") 46 | end, 47 | }, 48 | }, 49 | { "linrongbin16/gitlinker.nvim", cmd = "GitLink", opts = {} }, 50 | } 51 | -------------------------------------------------------------------------------- /nvim/lua/plugins/hydra.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvimtools/hydra.nvim", 3 | event = "VeryLazy", 4 | opts = { 5 | z_keys = { 6 | name = "Folding screen", 7 | mode = "n", 8 | color = "pink", 9 | body = "z", 10 | hint = [[ 11 | _M_: 󰡍 _m_:  _k_:  _[_: 󰜝 _i_: 󰌁 __: Quit 12 | _H_:  _h_:  _z_: 󰘢 _l_:  _L_:  Screen 13 | _R_: 󰡏 _r_:  _j_:  _]_: 󰜙 _a_/__:  Fold 14 | ]], 15 | config = { 16 | invoke_on_body = true, 17 | on_enter = function() 18 | -- vim.opt.statuscolumn = [[%!v:lua.require'config.util'.statuscolumn()]] 19 | vim.b.minianimate_disable = true 20 | end, 21 | on_exit = function() 22 | -- vim.opt.statuscolumn = [[%!v:lua.require'lazyvim.util.ui'.statuscolumn()]] 23 | vim.b.minianimate_disable = false 24 | end, 25 | }, 26 | heads = { 27 | { "h", "5zh", { nowait = true } }, 28 | { "l", "5zl", { nowait = true } }, 29 | { "H", "zH", { nowait = true } }, 30 | { "L", "zL", { nowait = true } }, 31 | { "[", "[z", { nowait = true } }, 32 | { "]", "]z", { nowait = true } }, 33 | { "j", "zj", { nowait = true } }, 34 | { "k", "zk", { nowait = true } }, 35 | { "i", "zi", { nowait = true } }, 36 | { "a", "za", { nowait = true } }, 37 | { "", "za", { nowait = true } }, 38 | { "m", "zm", { nowait = true } }, 39 | { "M", "zM", { nowait = true } }, 40 | { "r", "zr", { nowait = true } }, 41 | { "R", "zR", { nowait = true } }, 42 | { "z", "zz", { nowait = true } }, 43 | }, 44 | }, 45 | 46 | -- TODO: mini.visit 47 | buffers = { 48 | name = "Buffers", 49 | body = "B", 50 | hint = [[ 51 | _h_:  _l_:  _j_:  _s_:  _d_: 󰆴 _D_: 󰒺 __:  52 | _H_: 󰁍 _L_: 󰁔 _p_: 󰐃 _c_: 󰦀 _q_:  _E_: 󰒻 _m_: Move __: Quit 53 | ]], 54 | config = { 55 | color = "pink", 56 | -- hint = { position = "top", offset = 1 }, 57 | invoke_on_body = true, 58 | }, 59 | heads = { 60 | { "h", "BufferLineCyclePrev" }, 61 | { "l", "BufferLineCycleNext" }, 62 | { "H", "BufferLineMovePrev" }, 63 | { "L", "BufferLineMoveNext" }, 64 | { "j", "BufferLinePick", { exit = true } }, 65 | { "p", "BufferLineTogglePin", { nowait = true } }, 66 | { "s", "Telescope buffers", { nowait = true, exit = true } }, 67 | { "m", "ScopeMoveBuf", { nowait = true, exit = true } }, 68 | { "d", function() require("mini.bufremove").delete(0, false) end }, 69 | { "q", function() require("mini.bufremove").unshow(0) end }, 70 | { "c", "BufferLinePickClose" }, 71 | { "D", "BufferLineSortByDirectory" }, 72 | { "E", "BufferLineSortByExtension" }, 73 | { "", "BufferLineSortByTabs" }, 74 | { "", nil, { exit = true } }, 75 | }, 76 | }, 77 | 78 | options = { 79 | name = "UI Options", 80 | hint = [[ 81 | ^ ^ UI Options 82 | ^ 83 | _v_ %{ve} virtual edit 84 | _i_ %{list} invisible characters 85 | _s_ %{spell} spell 86 | _w_ %{wrap} wrap 87 | _c_ %{cul} cursor line 88 | _n_ %{nu} number 89 | _r_ %{rnu} relative number 90 | ^ 91 | ^^^^ __ 92 | ]], 93 | config = { 94 | color = "amaranth", 95 | invoke_on_body = true, 96 | hint = { 97 | position = "middle", 98 | }, 99 | }, 100 | mode = { "n", "x" }, 101 | body = "U", 102 | heads = { 103 | { "n", function() vim.o.number = not vim.o.number end, { desc = "number" } }, 104 | { 105 | "r", 106 | function() vim.o.relativenumber = not vim.o.relativenumber end, 107 | { desc = "relativenumber" }, 108 | }, 109 | { 110 | "v", 111 | function() 112 | if vim.o.virtualedit == "all" then 113 | vim.o.virtualedit = "block" 114 | else 115 | vim.o.virtualedit = "all" 116 | end 117 | end, 118 | { desc = "virtualedit" }, 119 | }, 120 | { "i", function() vim.o.list = not vim.o.list end, { desc = "show invisible" } }, 121 | { "s", function() vim.o.spell = not vim.o.spell end, { exit = true, desc = "spell" } }, 122 | { "w", function() vim.o.wrap = not vim.o.wrap end, { desc = "wrap" } }, 123 | { 124 | "c", 125 | function() vim.o.cursorline = not vim.o.cursorline end, 126 | { desc = "cursor line" }, 127 | }, 128 | { "q", nil, { exit = true } }, 129 | { "", nil, { exit = true } }, 130 | }, 131 | }, 132 | 133 | git = { 134 | name = "Git", 135 | hint = [[ 136 | _K_: prev hunk ↑ _s_: stage hunk _b_: blame line _d_: Diff this _h_: file history 137 | _J_: next hunk ↓ _S_: stage buffer _B_: blame show full _D_: Diff orig _H_: files history 138 | _l_: deleted lines _u_: undo stage _p_: preview hunk _/_: base file _v_: Diff View 139 | ^ ^ _g_: LazyGit _q_: quit __: exit 140 | ]], 141 | config = { 142 | color = "pink", 143 | invoke_on_body = true, 144 | on_enter = function() 145 | local gs = package.loaded.gitsigns 146 | if not gs then return end 147 | vim.cmd("silent! %foldopen!") 148 | vim.bo.modifiable = false 149 | gs.toggle_linehl(true) 150 | gs.toggle_numhl(true) 151 | gs.toggle_word_diff(true) 152 | gs.toggle_current_line_blame(true) 153 | end, 154 | on_exit = function() 155 | local gs = package.loaded.gitsigns 156 | if not gs then return end 157 | gs.toggle_linehl(false) 158 | gs.toggle_numhl(false) 159 | gs.toggle_word_diff(false) 160 | gs.toggle_current_line_blame(false) 161 | gs.toggle_deleted(false) 162 | end, 163 | }, 164 | mode = "n", 165 | body = "G", 166 | heads = { 167 | { "J", "Gitsigns next_hunk", { desc = "next hunk" } }, 168 | { "K", "Gitsigns prev_hunk", { desc = "prev hunk" } }, 169 | { "s", "Gitsigns stage_hunk", { desc = "stage hunk" } }, 170 | { "u", "Gitsigns undo_stage_hunk", { desc = "undo last stage" } }, 171 | { "S", "Gitsigns stage_buffer", { desc = "stage buffer" } }, 172 | { "p", "Gitsigns preview_hunk", { desc = "preview hunk" } }, 173 | { "l", "Gitsigns toggle_deleted", { nowait = true } }, 174 | { "d", "Gitsigns diffthis", { desc = "Diff This", exit = true } }, 175 | { "D", "Gitsigns diffthis ~", { desc = "Diff with ~", exit = true } }, 176 | { "h", "DiffviewFileHistory %", { exit = true } }, 177 | { "H", "DiffviewFileHistory ", { exit = true } }, 178 | { "b", "Gitsigns blame_line", { desc = "blame" } }, 179 | { "B", "Gitsigns blame_line full=true" }, 180 | { "/", "Gitsigns show" }, -- show the base of the file 181 | { "g", function() LazyVim.terminal.open("lazygit") end, { exit = true } }, 182 | { "v", "DiffviewOpen", { exit = true } }, 183 | { "q", nil, { exit = true, nowait = true } }, 184 | { "", nil, { exit = true, nowait = true } }, 185 | }, 186 | }, 187 | }, 188 | 189 | config = function(_, opts) 190 | for name, mode in pairs(opts) do 191 | require("hydra")(mode) 192 | end 193 | end, 194 | } 195 | -------------------------------------------------------------------------------- /nvim/lua/plugins/lsp.lua: -------------------------------------------------------------------------------- 1 | local function toggle_diag_virtext() 2 | local virtual_text = { -- Default virtual_text opts from Lazy.Nvim 3 | spacing = 4, 4 | source = "if_many", 5 | prefix = "●", 6 | } 7 | local config = vim.diagnostic.config() 8 | if type(config.virtual_text) == "table" then 9 | config.virtual_text = false 10 | vim.diagnostic.config(config) 11 | vim.notify("Disable diagnostics virtualtext", 5, { title = "Diagnostics" }) 12 | else 13 | config.virtual_text = virtual_text 14 | vim.diagnostic.config(config) 15 | vim.notify("Enabled diagnostics virtualtext", 5, { title = "Diagnostics" }) 16 | end 17 | end 18 | 19 | return { 20 | { 21 | "neovim/nvim-lspconfig", 22 | init = function() 23 | local keys = require("lazyvim.plugins.lsp.keymaps").get() 24 | keys[#keys + 1] = 25 | { "chi", "Telescope lsp_incoming_calls", desc = "Hierarchy/Incoming" } 26 | keys[#keys + 1] = 27 | { "cho", "Telescope lsp_outgoing_calls", desc = "Hierarchy/Outgoing" } 28 | 29 | keys[#keys + 1] = { "uv", toggle_diag_virtext, desc = "Toggle diagnostic virtualtext"} 30 | end, 31 | ---@class PluginLspOpts 32 | opts = { 33 | ---@type lspconfig.options 34 | servers = {}, 35 | -- return true if you don't want this server to be setup with lspconfig 36 | ---@type table 37 | setup = { 38 | -- fallback for all 39 | -- ["*"] = function(server, opts) end, 40 | }, 41 | }, 42 | }, 43 | { 44 | "kosayoda/nvim-lightbulb", 45 | event = "LspAttach", 46 | opts = { 47 | autocmd = { enabled = true }, 48 | sign = { enabled = true, text = "" }, 49 | action_kinds = { "quickfix", "refactor" }, 50 | ignore = { 51 | actions_without_kind = true, 52 | }, 53 | }, 54 | }, 55 | { 56 | 'felpafel/inlay-hint.nvim', 57 | event = 'LspAttach', 58 | opts = { }, 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /nvim/lua/plugins/python.lua: -------------------------------------------------------------------------------- 1 | ---@diagnostic disable: missing-fields 2 | return { 3 | { 4 | "nvim-lspconfig", 5 | opts = { 6 | ---@type lspconfig.options 7 | servers = { 8 | ---@type lspconfig.options.basedpyright 9 | basedpyright = { 10 | settings = { 11 | basedpyright = { 12 | analysis = { 13 | typeCheckingMode = "standard", 14 | diagnosticSeverityOverrides = { 15 | reportAttributeAccessIssue = "warning", 16 | reportOptionalMemberAccess = "none", 17 | reportUnusedVariable = "none", 18 | reportUnusedCallResult = "none", 19 | reportUnusedExpression = "none", 20 | reportUnknownMemberType = "none", 21 | reportUnknownLambdaType = "none", 22 | reportUnknownParameterType = "none", 23 | reportUnknownVariableTypeType = "none", 24 | reportMissingParameterType = "none", 25 | reportMissingTypeStub = "information", 26 | reportUnknownVariableType = "none", 27 | reportUnknownArgumentType = "none", 28 | reportImplicitOverride = "none", 29 | reportAny = "none", 30 | }, 31 | }, 32 | }, 33 | } 34 | }, 35 | ---@type lspconfig.options.pyright 36 | pyright = { 37 | settings = { 38 | python = { 39 | analysis = { 40 | diagnosticSeverityOverrides = { 41 | reportGeneralTypeIssues = "information", 42 | reportPrivateImportUsage = "information", 43 | reportOptionalOperand = "information", 44 | reportOptionalSubscript = "information", 45 | reportOptionalMemberAccess = "information", 46 | }, 47 | }, 48 | }, 49 | }, 50 | }, 51 | }, 52 | }, 53 | }, 54 | { 55 | "venv-selector.nvim", 56 | enabled = false, 57 | opts = { 58 | anaconda_base_path = vim.fn.fnamemodify(os.getenv("CONDA_EXE") or "", ":p:h:h"), 59 | anaconda_envs_path = vim.fn.fnamemodify(os.getenv("CONDA_EXE") or "", ":p:h:h") .. "/envs", 60 | } 61 | }, 62 | { 63 | -- "numiras/semshi", 64 | "wookayin/semshi", -- use a maintained fork 65 | enabled = false, 66 | ft = "python", 67 | build = ":UpdateRemotePlugins", 68 | init = function() 69 | -- Disabled these features better provided by LSP or other more general plugins 70 | vim.g["semshi#error_sign"] = false 71 | vim.g["semshi#simplify_markup"] = false 72 | vim.g["semshi#mark_selected_nodes"] = false 73 | vim.g["semshi#update_delay_factor"] = 0.001 74 | 75 | -- This autocmd must be defined in init to take effect 76 | vim.api.nvim_create_autocmd({ "VimEnter", "ColorScheme" }, { 77 | group = vim.api.nvim_create_augroup("SemanticHighlight", {}), 78 | callback = function() 79 | -- Only add style, inherit or link to the LSP's colors 80 | vim.cmd([[ 81 | highlight! semshiGlobal gui=bold 82 | highlight! semshiImported gui=italic 83 | highlight! semshiBuiltin gui=bold,italic 84 | highlight! link semshiParameter @lsp.type.parameter 85 | highlight! link semshiParameterUnused DiagnosticUnnecessary 86 | highlight! link semshiAttribute @variable.member 87 | highlight! link semshiSelf @lsp.type.selfParameter 88 | highlight! semshiUnresolved gui=undercurl 89 | highlight! link semshiFree @lsp.typemod.variable.static 90 | ]]) 91 | end, 92 | }) 93 | end, 94 | }, 95 | } 96 | -------------------------------------------------------------------------------- /nvim/lua/plugins/repl.lua: -------------------------------------------------------------------------------- 1 | -- In a native script, we mimick a notebook cell by defining a marker 2 | -- It's commonly defined in many editors and program to use 3 | -- a space and two percent (%) sign after the comment symbol 4 | -- For python, julia etc that would be a line starting with `# %%` 5 | local cell_marker = [[# %%]] 6 | 7 | return { 8 | { 9 | "mtikekar/nvim-send-to-term", 10 | cmd = { "SendTo", "SendHere" }, 11 | init = function() 12 | vim.g.send_disable_mapping = true -- dont use default 13 | local function send_to_wez(opts) 14 | local pane_id = opts.args 15 | local function send_to_pane(lines) 16 | lines = table.concat(lines, "\n"):gsub('"', '\\"') -- Escape double quote since it's used to wrap lines 17 | os.execute('wezterm cli send-text --pane-id=' .. pane_id .. ' "' .. lines .. '"') 18 | os.execute('wezterm cli send-text --pane-id=' .. pane_id .. ' --no-paste "\r\r"') 19 | end 20 | vim.g.send_target = { send = send_to_pane, } 21 | end 22 | vim.api.nvim_create_user_command("SendToWez", send_to_wez, { nargs = 1 }) 23 | local function send_to_jupyter(opts) 24 | if vim.b.jupyter_attached == nil then 25 | vim.notify("No jupyter kernel attached") 26 | return 27 | end 28 | vim.g.send_target = { send = function (lines) 29 | lines = table.concat(lines, "\n") 30 | vim.fn.JupyterExecute(lines) 31 | end} 32 | end 33 | vim.api.nvim_create_user_command("SendToJupyter", send_to_jupyter, {}) 34 | end, 35 | keys = { 36 | { "", "Send", desc = "Send", mode = "n" }, 37 | { "", "Send'>", desc = "Send", mode = "v" }, 38 | { "", "vipSend}j", desc = "Send", mode = "n" }, 39 | { "ti", "SendHere ipy", desc="Send to current ipython terminal.", mode="n"}, 40 | }, 41 | }, 42 | { -- General vim repl code send 43 | "jpalardy/vim-slime", 44 | enabled = false, 45 | init = function() 46 | vim.g.slime_no_mappings = 1 47 | vim.g.slime_cell_delimiter = cell_marker 48 | vim.g.slime_bracketed_paste = 1 49 | vim.g.slime_python_ipython = 1 50 | vim.g.slime_target = "neovim" 51 | -- vim.g.slime_target = "wezterm" 52 | -- vim.g.slime_default_config = { pane_direction = "next" } 53 | vim.g.slime_menu_config = true 54 | vim.api.nvim_create_user_command("SlimeTarget", function(opts) 55 | if opts.args ~= nil then 56 | vim.b.slime_target = opts.args 57 | vim.b.slime_config = nil 58 | else 59 | vim.b.slime_config = vim.g.slime_config 60 | vim.b.slime_target = vim.g.slime_target 61 | end 62 | vim.notify("Slime send target is: " .. vim.b.slime_target) 63 | end, { desc = "Change Slime target", nargs = 1 }) 64 | end, 65 | cmd = { "SlimeConfig", "SlimeTarget" }, 66 | keys = { 67 | { "", "SlimeRegionSend", mode = "x", desc = "Send Selection" }, 68 | { "", "SlimeMotionSend", mode = "n", desc = "Send Motion / Text Object" }, 69 | { 70 | "", 71 | "vir]rj", 72 | mode = "n", 73 | remap = true, 74 | desc = "Send Cell and Jump Next", 75 | }, 76 | { "rr", "SlimeMotionSend", mode = "n", desc = "Send Motion (Aslo )" }, 77 | { "rC", "SlimeConfig", desc = "Slime Run Config" }, 78 | { "rT", "SlimeTarget", desc = "Slime Run Target" }, 79 | }, 80 | }, 81 | 82 | { -- Overlay cell marker & metadata so it's less distracting 83 | "echasnovski/mini.hipatterns", 84 | ft = { "python" }, 85 | opts = function(_, opts) 86 | local censor_extmark_opts = function(buf_id, match, data) 87 | local mask = string.rep("⎯", vim.api.nvim_win_get_width(0)) 88 | return { 89 | virt_text = { { mask, "SignColumn" } }, 90 | virt_text_pos = "overlay", 91 | virt_text_hide = true, 92 | -- virt_text_win_col = 5, 93 | priority = 200, 94 | right_gravity = false, 95 | } 96 | end 97 | opts.highlighters["cell_marker"] = { 98 | pattern = function(bufid) 99 | -- local cms = vim.api.nvim_get_option_value("commentstring", { buf = bufid }) 100 | -- return "^" .. string.gsub(cms, [[%s]], "") .. [[%%.*]] 101 | return "^# *%%" 102 | end, 103 | group = "", 104 | extmark_opts = censor_extmark_opts, 105 | } 106 | end, 107 | }, 108 | { -- Define code cell object `ir`, `ar` 109 | "echasnovski/mini.ai", 110 | opts = function(_, opts) 111 | opts.custom_textobjects["r"] = function(ai_mode, _, _) -- Repl Code Cell object 112 | local buf_nlines = vim.api.nvim_buf_line_count(0) 113 | local cell_markers = {} 114 | for line_no = 1, buf_nlines do 115 | if vim.fn.getline(line_no):sub(1, 4) == cell_marker then 116 | table.insert(cell_markers, line_no) 117 | end 118 | end 119 | table.insert(cell_markers, 1, 0) -- Beginning 120 | table.insert(cell_markers, #cell_markers + 1, buf_nlines + 1) 121 | 122 | local regions = {} 123 | for i = 1, #cell_markers - 1 do 124 | local from_line = ai_mode == "i" and cell_markers[i] + 1 or math.max(cell_markers[i], 1) 125 | -- for `around cell` on empty line select previous cell 126 | local to_line = cell_markers[i + 1] - 1 127 | local to_line_len = vim.fn.getline(to_line):len() + 1 128 | table.insert(regions, { 129 | from = { line = from_line, col = 1 }, 130 | to = { line = to_line, col = to_line_len }, 131 | }) 132 | end 133 | return regions 134 | end 135 | end, 136 | }, 137 | { -- Mapping for moving between cell `]r`, `[r` 138 | "nvim-treesitter", 139 | opts = { 140 | textobjects = { 141 | select = { 142 | enable = true, 143 | keymaps = { 144 | ["ix"] = "@cell.inner", 145 | ["ax"] = "@cell.outer", 146 | }, 147 | }, 148 | move = { 149 | goto_next_start = { ["]r"] = "@cell_marker" }, 150 | goto_previous_start = { ["[r"] = "@cell_marker" }, 151 | }, 152 | }, 153 | }, 154 | }, 155 | { -- Automatically convert ipynb to py script with cell markers 156 | "GCBallesteros/jupytext.nvim", 157 | lazy = false, -- for auto convert ipynb on open, minimal startup time 158 | opts = {}, 159 | }, 160 | { -- Inspect and completion in neovim from running kernel 161 | "lkhphuc/jupyter-kernel.nvim", 162 | opts = { timeout = 0.5 }, 163 | build = ":UpdateRemotePlugins", 164 | cmd = "JupyterAttach", 165 | keys = { 166 | { "k", "JupyterInspect", desc = "Inspect object in kernel" }, 167 | }, 168 | dependencies = { 169 | { 170 | "nvim-cmp", 171 | opts = function(_, opts) 172 | table.insert(opts.sources, 1, { name = "jupyter", group_index = 1, priority = 100 }) 173 | end, 174 | }, 175 | }, 176 | }, 177 | { -- Notebook-style run and display results 178 | "benlubas/molten-nvim", 179 | build = ":UpdateRemotePlugins", 180 | keys = { 181 | { "rm", "MoltenInit", desc = "MoltenInit" }, 182 | }, 183 | init = function() 184 | vim.g.molten_auto_open_output = false 185 | vim.g.molten_virt_text_output = true 186 | vim.g.molten_virt_lines_off_by_1 = false 187 | vim.g.molten_wrap_output = true 188 | vim.api.nvim_create_autocmd("User", { 189 | pattern = "MoltenInitPost", 190 | callback = function() 191 | vim.keymap.set( 192 | "n", 193 | "rM", 194 | "MoltenDeinit", 195 | { buffer = true, desc = "Molten Stop" } 196 | ) 197 | vim.keymap.set( 198 | "n", 199 | "", 200 | "MoltenEvaluateOperator", 201 | { buffer = true, silent = true, desc = "Run" } 202 | ) 203 | vim.keymap.set( 204 | "x", 205 | "", 206 | ":MoltenEvaluateVisual'>", 207 | { buffer = true, silent = true, desc = "Run selection" } 208 | ) 209 | vim.keymap.set( 210 | "n", 211 | "", 212 | "vir]rj", 213 | { remap = true, buffer = true, desc = "Run cell and move" } 214 | ) 215 | vim.keymap.set( 216 | "n", 217 | "rh", 218 | "MoltenHideOutput", 219 | { buffer = true, silent = true, desc = "Hide Output" } 220 | ) 221 | vim.keymap.set( 222 | "n", 223 | "ro", 224 | "noautocmd MoltenEnterOutput", 225 | { buffer = true, silent = true, desc = "Show/Enter Output" } 226 | ) 227 | vim.keymap.set( 228 | "n", 229 | "ri", 230 | "MoltenImportOutput", 231 | { buffer = true, desc = "Import Notebook Output" } 232 | ) 233 | if vim.fn.bufname():match("ipynb") then vim.cmd("MoltenImportOutput") end 234 | vim.cmd([[JupyterAttach]]) 235 | end, 236 | }) 237 | vim.api.nvim_create_autocmd("BufWritePost", { 238 | pattern = { "*.ipynb" }, 239 | callback = function() 240 | if require("molten.status").initialized() == "Molten" then 241 | vim.cmd("MoltenExportOutput!") 242 | end 243 | end, 244 | }) 245 | end, 246 | dependencies = { 247 | { "lualine.nvim", 248 | opts = function(_, opts) 249 | table.insert(opts.sections.lualine_x, { 250 | function() 251 | local kernels = require('molten.status').kernels() 252 | return kernels == "" and "" or " " .. kernels 253 | end, 254 | color = "PreProc", 255 | }) 256 | end, 257 | }, 258 | }, 259 | }, 260 | { 261 | "hydra.nvim", 262 | optional = true, 263 | opts = { 264 | code_cells = { 265 | name = "Code cells", 266 | mode = "n", 267 | color = "pink", 268 | body = "r", 269 | hint = [[_j_/_k_: move down/up _r_: run cell_l_: run line _R_: run above^^ __/_q_: exit]], 270 | config = { invoke_on_body = true, }, 271 | heads = { 272 | { "J", "]r", remap = true }, 273 | { "K", "[r", remap = true }, 274 | { "", "ir]r", remap = true }, 275 | { "", "V", remap = true }, 276 | { "m", "MoltenInit" }, 277 | { "R", ":QuartoSendAbove" }, 278 | { "C", "SlimeConfig" }, 279 | { "T", "SlimeTarget" }, 280 | { "", nil, { exit = true } }, 281 | { "q", nil, { exit = true } }, 282 | } 283 | } 284 | } 285 | } 286 | } 287 | -------------------------------------------------------------------------------- /nvim/lua/plugins/telescope.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-telescope/telescope.nvim", 4 | enabled=false, 5 | opts = { 6 | defaults = { 7 | mappings = { 8 | i = { 9 | [""] = require("telescope.actions").to_fuzzy_refine, 10 | [""] = require("telescope.actions").select_tab_drop, 11 | [""] = require("telescope.actions").results_scrolling_left, 12 | [""] = require("telescope.actions").results_scrolling_right, 13 | }, 14 | }, 15 | layout_strategy = "flex", 16 | layout_config = { 17 | prompt_position = "top", 18 | horizontal = { preview_width = { 0.55, max = 100, min = 30 } }, 19 | vertical = { preview_cutoff = 20, preview_height = 0.5 }, 20 | cursor = { height = 0.5, width = 0.8 }, 21 | }, 22 | sorting_strategy = "ascending", 23 | path_display = { filename_first = { reverse_directories = false } }, 24 | dynamic_preview_title = true, 25 | }, 26 | pickers = { 27 | buffers = { 28 | theme = "dropdown", 29 | mappings = { i = { [""] = require("telescope.actions").delete_buffer } }, 30 | }, 31 | current_buffer_fuzzy_find = { layout_strategy = "vertical" }, 32 | grep_string = { layout_strategy = "vertical" }, 33 | lsp_references = { layout_strategy = "vertical" }, 34 | lsp_definitions = { layout_strategy = "vertical" }, 35 | lsp_type_definitions = { layout_strategy = "cursor" }, 36 | lsp_implementations = { layout_strategy = "cursor" }, 37 | }, 38 | }, 39 | keys = { 40 | { "/", "Telescope current_buffer_fuzzy_find", desc = "Fuzzy workspace" }, 41 | { "#", "Telescope grep_string", desc = "Search word under cursor" }, 42 | { "", "Telescope resume", desc = "Resume last search" }, 43 | { "s/", "Telescope search_history", desc = "Search history" }, 44 | { "sj", "Telescope jumplist", desc = "Jumplist" }, 45 | { "sP", "Telescope builtin", desc = "Pickers" }, 46 | { "gfc", "Telescope git_commits", desc = "commits" }, 47 | { "gfs", "Telescope git_status", desc = "status" }, 48 | { "gfb", "Telescope git_branches", desc = "branch" }, 49 | { "gfh", "Telescope git_stash", desc = "stashs" }, 50 | }, 51 | }, 52 | { 53 | "polirritmico/telescope-lazy-plugins.nvim", 54 | enabled = false, 55 | dependencies = { 56 | { 57 | "telescope.nvim", 58 | opts = { 59 | extensions = { 60 | lazy_plugins = { 61 | custom_entries = { 62 | { 63 | name = "LazyVim", 64 | filepath = vim.fn.stdpath("data") .. "/lazy/LazyVim/lua/lazyvim/config/init.lua", 65 | repo_url = "https://github.com/LazyVim/LazyVim", 66 | repo_dir = vim.fn.stdpath("data") .. "/lazy/LazyVim", 67 | }, 68 | }, 69 | }, 70 | }, 71 | }, 72 | }, 73 | }, 74 | keys = { { "sp", "Telescope lazy_plugins", desc = "Plugins" } }, 75 | }, 76 | } 77 | -------------------------------------------------------------------------------- /nvim/lua/plugins/treesitter.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-treesitter/nvim-treesitter", 4 | dependencies = { 5 | { "andymass/vim-matchup", branch = "master" }, 6 | { "nvim-treesitter/nvim-treesitter-context", opts = { multiline_threshold = 2, }, }, 7 | }, 8 | opts = { 9 | incremental_selection = { 10 | keymaps = { node_incremental = "v", }, 11 | }, 12 | matchup = { enable = true, include_match_words = true }, 13 | }, 14 | }, 15 | } 16 | -------------------------------------------------------------------------------- /nvim/lua/plugins/ui.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { "nvim-notify", opts = { background_colour = "NormalFloat" } }, 3 | { 4 | "noice.nvim", 5 | opts = { 6 | presets = { 7 | bottom_search = false, -- a classic bottom cmdline for search 8 | }, 9 | views = { 10 | hover = { 11 | win_options = { winblend = 20 }, 12 | }, 13 | }, 14 | routes = { 15 | { 16 | filter = { 17 | any = { 18 | { find = "No information available" }, 19 | { find = "E486" }, 20 | { find = "E490" }, 21 | { find = "osc52" }, 22 | { find = "more line" }, 23 | { find = "line less" }, 24 | { find = "fewer line" }, 25 | { find = "lines? yanked" }, 26 | { find = " changes?;" }, 27 | { find = "Already at newest change" }, 28 | { event = "msg_show", find = "No more valid diagnostics to move to" }, 29 | { event = "msg_show", find = "^E486: Pattern not found" }, 30 | { event = "msg_show", find = "^Hunk " }, 31 | }, 32 | }, 33 | view = "mini", 34 | }, 35 | { 36 | filter = { 37 | any = { 38 | { event = "msg_show", find = "^[/?]." }, 39 | }, 40 | }, 41 | skip = true, 42 | }, 43 | }, 44 | }, 45 | }, 46 | { 47 | "folke/edgy.nvim", 48 | enabled = true, 49 | opts = { 50 | animate = { enabled = not vim.g.neovide }, 51 | keys = { 52 | [""] = function(win) win:resize("width", 2) end, 53 | [""] = function(win) win:resize("width", -2) end, 54 | [""] = function(win) win:resize("height", 2) end, 55 | [""] = function(win) win:resize("height", -2) end, 56 | }, 57 | }, 58 | keys = { 59 | { 60 | "e", 61 | function() 62 | vim.b.edgy_disable = not vim.b.edgy_disable 63 | LazyVim.notify((vim.b.edgy_disable and "Disable" or "Enable") .. " Edgy for buffer") 64 | end, 65 | desc = "Edgy (un)attach", 66 | }, 67 | }, 68 | }, 69 | { 70 | "which-key.nvim", 71 | opts = { preset = "helix" }, 72 | }, 73 | { 74 | "nvim-lualine/lualine.nvim", 75 | opts = function(_, opts) 76 | opts.options = { 77 | component_separators = "", -- ┊ |         78 | section_separators = "", -- { left = "", right = "" }, 79 | } 80 | opts.sections.lualine_a = { 81 | { 82 | "mode", 83 | icon = "", --   84 | fmt = function(str) return str:sub(1, 3) end, 85 | color = { gui = "bold" }, 86 | }, 87 | } 88 | table.insert(opts.sections.lualine_b, { 89 | function() return " " .. vim.fn.fnamemodify(vim.fn.getcwd(), ":t") end, 90 | color = { gui = "italic", fg = require("snacks").util.color("Operator") }, 91 | }) 92 | opts.sections.lualine_c[1] = require("lazyvim.util").lualine.root_dir({ cwd = true }) 93 | opts.sections.lualine_c[2] = "" -- no diagnostic in statusline 94 | opts.sections.lualine_c[4] = LazyVim.lualine.pretty_path({ length = 7 }) 95 | 96 | -- Remove some LazyVim's default 97 | for _, component in ipairs(opts.sections.lualine_x) do 98 | if component[1] == "diff" then component[1] = "" end 99 | end 100 | vim.list_extend(opts.sections.lualine_x, { 101 | { 102 | function() return require("noice").api.status.search.get() end, 103 | cond = function() 104 | return package.loaded["noice"] and require("noice").api.status.search.has() 105 | end, 106 | color = { fg = require("snacks").util.color("DiagnosticOk") }, 107 | }, 108 | { --python venv 109 | function() 110 | local venv = os.getenv("CONDA_DEFAULT_ENV") or os.getenv("VIRTUAL_ENV") or "No Env" 111 | return " " .. venv 112 | end, 113 | cond = function() return vim.bo.filetype == "python" end, 114 | color = { fg = require("snacks").util.color("Operator"), gui = "italic" }, 115 | }, 116 | }) 117 | 118 | opts.sections.lualine_y[2] = { "location", padding = { left = 0, right = 1 }, icon = "" } 119 | table.insert(opts.sections.lualine_y, 1, { 120 | function() -- lsp 121 | local num_clients = #vim.lsp.get_clients({ bufnr = 0 }) 122 | if num_clients > 0 then return " " .. num_clients end 123 | return "" 124 | end, 125 | color = { fg = require("snacks").util.color("Type") }, 126 | }) 127 | table.insert(opts.sections.lualine_y, 1, { --terminal 128 | function() return " " .. vim.o.channel end, 129 | cond = function() return vim.o.buftype == "terminal" end, 130 | color = {fg = require("snacks").util.color("Type")}, 131 | }) 132 | 133 | opts.sections.lualine_z = { 134 | { -- tabs 135 | function() return " " .. vim.fn.tabpagenr() .. "/" .. vim.fn.tabpagenr("$") end, 136 | cond = function() return vim.fn.tabpagenr("$") > 1 end, 137 | color = { gui = "bold" }, 138 | separator = "|", 139 | }, 140 | { "hostname", icon = "󰢹" }, 141 | } 142 | 143 | end, 144 | }, 145 | { 146 | "akinsho/bufferline.nvim", 147 | event = "BufEnter", 148 | opts = { 149 | options = { 150 | always_show_bufferline = true, 151 | diagnostics = false, 152 | -- separator_style = "slope", 153 | }, 154 | }, 155 | }, 156 | { 157 | "b0o/incline.nvim", 158 | branch = "main", 159 | event = "BufReadPost", 160 | opts = { 161 | window = { zindex = 40, margin = { horizontal = 0, vertical = 0 } }, 162 | hide = { cursorline = true }, 163 | render = function(props) 164 | local helpers = require("incline.helpers") 165 | local filename = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(props.buf), ":t") 166 | local ft_icon, ft_color = require("nvim-web-devicons").get_icon_color(filename) 167 | local modified = vim.bo[props.buf].modified and "bold,italic" or "bold" 168 | 169 | local function get_git_diff() 170 | local icons = require("lazyvim.config").icons.git 171 | icons["changed"] = icons.modified 172 | local summary = vim.b.minidiff_summary 173 | summary = summary 174 | and { 175 | added = summary.add, 176 | modified = summary.change, 177 | removed = summary.delete, 178 | } 179 | or vim.b[props.buf].gitsigns_status_dict 180 | local labels = {} 181 | if summary == nil then return labels end 182 | for name, icon in pairs(icons) do 183 | if tonumber(summary[name]) and summary[name] > 0 then 184 | table.insert(labels, { icon .. summary[name] .. " ", group = "Diff" .. name }) 185 | end 186 | end 187 | -- if #labels > 0 then table.insert(labels, { "┊ " }) end 188 | return labels 189 | end 190 | local function get_diagnostic_label() 191 | local icons = require("lazyvim.config").icons.diagnostics 192 | local label = {} 193 | 194 | for severity, icon in pairs(icons) do 195 | local n = #vim.diagnostic.get( 196 | props.buf, 197 | { severity = vim.diagnostic.severity[string.upper(severity)] } 198 | ) 199 | if n > 0 then 200 | table.insert(label, { icon .. n .. " ", group = "DiagnosticSign" .. severity }) 201 | end 202 | end 203 | if #label > 0 then table.insert(label, { "┊ " }) end 204 | return label 205 | end 206 | 207 | local buffer = { 208 | { get_diagnostic_label() }, 209 | { get_git_diff() }, 210 | ft_icon and { 211 | " " .. ft_icon .. " ", 212 | guibg = ft_color, 213 | guifg = helpers.contrast_color(ft_color), 214 | } or "", 215 | { " " .. filename, gui = modified }, 216 | { " 󰕮 " .. vim.api.nvim_win_get_number(props.win), group = "lualine_b_visual" }, 217 | } 218 | return buffer 219 | end, 220 | }, 221 | }, 222 | { 223 | "echasnovski/mini.animate", 224 | vscode = false, 225 | opts = { 226 | open = { enable = false }, 227 | close = { enable = false }, 228 | resize = { enable = false }, 229 | }, 230 | }, 231 | { 232 | "folke/snacks.nvim", 233 | ---@type snacks.Config 234 | opts = { 235 | statuscolumn = { 236 | folds = { 237 | open = true, 238 | git_hl = true, 239 | } 240 | } 241 | } 242 | } 243 | } 244 | -------------------------------------------------------------------------------- /nvim/lua/plugins/windows.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "sindrets/winshift.nvim", 4 | opts = {}, 5 | keys = { { "ws", "WinShift", desc = "Win Shift/Swap" } }, 6 | }, 7 | { 8 | "mrjones2014/smart-splits.nvim", 9 | lazy = false, 10 | keys = { 11 | -- these keymaps will also accept a range, 12 | { "", "SmartResizeLeft", mode = { "n", "t" } }, 13 | { "", "SmartResizeDown", mode = { "n", "t" } }, 14 | { "", "SmartResizeUp", mode = { "n", "t" } }, 15 | { "", "SmartResizeRight", mode = { "n", "t" } }, 16 | { "", "SmartCursorMoveLeft", mode = { "n", "t" } }, 17 | { "", "SmartCursorMoveDown", mode = { "n", "t" } }, 18 | { "", "SmartCursorMoveUp", mode = { "n", "t" } }, 19 | { "", "SmartCursorMoveRight", mode = { "n", "t" } }, 20 | -- { "", "SmartCursorMoveLeft", mode = { "n", "t" } }, 21 | -- { "", "SmartCursorMoveDown", mode = { "n", "t" } }, 22 | -- { "", "SmartCursorMoveUp", mode = { "n", "t" } }, 23 | -- { "", "SmartCursorMoveRight", mode = { "n", "t" } }, 24 | 25 | { "", "SmartCursorMoveLeft", mode = { "n", "t" } }, 26 | { "", "SmartCursorMoveDown", mode = { "n", "t" } }, 27 | { "", "SmartCursorMoveUp", mode = { "n", "t" } }, 28 | { "", "SmartCursorMoveRight", mode = { "n", "t" } }, 29 | { "", "SmartResizeLeft", mode = { "n", "t" } }, 30 | { "", "SmartResizeDown", mode = { "n", "t" } }, 31 | { "", "SmartResizeUp", mode = { "n", "t" } }, 32 | { "", "SmartResizeRight", mode = { "n", "t" } }, 33 | 34 | { "wr", "SmartResizeMode", mode = "n", desc = "Resize mode" }, 35 | }, 36 | }, 37 | { 38 | "s1n7ax/nvim-window-picker", 39 | name = "window-picker", 40 | keys = { 41 | { 42 | "wp", 43 | function() 44 | local winnr = require("window-picker").pick_window() 45 | if winnr ~= nil then vim.api.nvim_set_current_win(winnr) end 46 | end, 47 | desc = "Pick window", 48 | }, 49 | }, 50 | opts = { 51 | show_prompt = false, 52 | hint = "floating-big-letter", 53 | selection_chars = 'TNSERIAODHPLCFUWYX', 54 | filter_rules = { 55 | bo = { filetype = { "incline", "noice" }, buftype = {"nofile"} }, 56 | }, 57 | }, 58 | }, 59 | { 60 | "hydra.nvim", 61 | opts = { 62 | windows = { 63 | name = "Windows", 64 | hint = [[ 65 | ^^^^^^^^^^^^ Move ^^ Split 66 | ^^^^^^^^^^^^------------- ^^------------------------------------ 67 | ^ ^ _k_ ^ ^ ^ ^ _K_ ^ ^ _p_: pick _s_,_-_: horizontally 68 | _h_ ^ ^ _l_ _H_ ^ ^ _L_ _r_: resize _v_,_|_: vertically 69 | ^ ^ _j_ ^ ^ ^ ^ _J_ ^ ^ _=_: equalize _c_,_d_: close 70 | focus^^^^^^ window^^^^^^ _z_: maximize _o_: remain only 71 | ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^^ ^ ^ 72 | ]], 73 | config = { 74 | invoke_on_body = true, 75 | hint = { 76 | offset = -1, 77 | }, 78 | }, 79 | mode = "n", 80 | body = "w", 81 | heads = { 82 | { "h", "h" }, 83 | { "j", "j" }, 84 | { "k", "k" }, 85 | { "l", "l" }, 86 | 87 | { "H", "WinShift left" }, 88 | { "J", "WinShift down" }, 89 | { "K", "WinShift up" }, 90 | { "L", "WinShift right" }, 91 | 92 | { "s", "split" }, 93 | { "-", "split", { desc = false } }, 94 | { "v", "vsplit" }, 95 | { "|", "vsplit", { desc = false } }, 96 | { "o", "o", { exit = true, desc = "remain only" } }, 97 | { "z", "ZenMode", { exit = true, desc = "maximize" } }, 98 | 99 | { "w", "w", { exit = true, desc = false } }, 100 | 101 | { "p", "wp", { remap = true, exit = true, desc = "pick" } }, 102 | { "r", "SmartResizeMode", { exit = true, desc = "resize" } }, 103 | { "=", "=", { nowait = true, exit = false, desc = "equalize" } }, 104 | { "c", "close", { desc = "close window" } }, 105 | { "d", "close", { desc = "close window" } }, 106 | { "", "close", { desc = false } }, 107 | 108 | { "", nil, { exit = true, desc = false } }, 109 | }, 110 | }, 111 | }, 112 | }, 113 | } 114 | -------------------------------------------------------------------------------- /nvim/snippets/python.snippets: -------------------------------------------------------------------------------- 1 | # Import common packages 2 | snippet impe Import Einops 3 | import einops as E 4 | snippet impn Import Numpy 5 | import numpy as np 6 | snippet impj Import Jax 7 | import jax 8 | snippet impjn Import Jax Numpy 9 | import jax.numpy as jnp 10 | snippet impt Import torch 11 | import torch 12 | -------------------------------------------------------------------------------- /pixi/config.toml: -------------------------------------------------------------------------------- 1 | change_ps1 = false 2 | -------------------------------------------------------------------------------- /pudb/pudb.cfg: -------------------------------------------------------------------------------- 1 | [pudb] 2 | breakpoints_weight = 0.8 3 | current_stack_frame = top 4 | custom_shell = 5 | custom_stringifier = /home/phuc/.config/pudb/stringifier.py 6 | custom_theme = 7 | default_variables_access_level = public 8 | display = auto 9 | hide_cmdline_win = False 10 | hotkeys_breakpoints = B 11 | hotkeys_code = C 12 | hotkeys_stack = S 13 | hotkeys_toggle_cmdline_focus = ctrl x 14 | hotkeys_variables = V 15 | line_numbers = True 16 | prompt_on_quit = True 17 | seen_welcome = e045 18 | shell = ipython 19 | sidebar_width = 0.625 20 | stack_weight = 1 21 | stringifier = ~/.config/pudb/stringifier.py 22 | theme = monokai-256 23 | variables_weight = 1.0 24 | wrap_variables = True 25 | 26 | -------------------------------------------------------------------------------- /pudb/stringifier.py: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | 3 | try: 4 | import torch 5 | 6 | HAVE_TORCH = 1 7 | except ImportError: 8 | HAVE_TORCH = 0 9 | 10 | 11 | try: 12 | import jax 13 | HAVE_JAX = 1 14 | except ImportError: 15 | HAVE_JAX = 0 16 | 17 | 18 | from pudb.var_view import default_stringifier, type_stringifier 19 | 20 | 21 | def shortened_sfier(value: Any, max_chars: int = -1) -> str: 22 | out: str = default_stringifier(value) 23 | 24 | if max_chars > 0 and len(out) > max_chars: 25 | out = type_stringifier(value) 26 | 27 | return out 28 | 29 | 30 | def pudb_stringifier(value: Any) -> str: 31 | if HAVE_TORCH: 32 | if isinstance(value, torch.nn.Module): 33 | device: str = str(next(value.parameters()).device) 34 | params: int = sum([p.numel() for p in value.parameters() if p.requires_grad]) 35 | rep: str = value.__repr__() if len(value.__repr__()) < 55 else type(value).__name__ 36 | 37 | return f"{rep}[{device}] Params: {params}" 38 | elif isinstance(value, torch.Tensor): 39 | return "{}[{}][{}] {}".format( 40 | type(value).__name__, 41 | str(value.dtype).replace("torch.", ""), 42 | str(value.device), 43 | str(list(value.shape)), 44 | ) 45 | if HAVE_JAX and hasattr(value, "shape"): 46 | out = f"{type(value).__name__}{value.shape}" 47 | if hasattr(value, "dtype"): 48 | out += f"[{value.dtype}]" 49 | if hasattr(value, "client"): 50 | out += f"[{value.client.platform}]" 51 | return out 52 | 53 | return shortened_sfier(value) 54 | -------------------------------------------------------------------------------- /rclone/rclone.conf: -------------------------------------------------------------------------------- 1 | [gpu] 2 | type = sftp 3 | host = 136.206.46.4 4 | user = phuc 5 | shell_type = unix 6 | ssh = ssh gpu 7 | md5sum_command = md5sum 8 | sha1sum_command = sha1sum 9 | 10 | -------------------------------------------------------------------------------- /ruff/pyproject.toml: -------------------------------------------------------------------------------- 1 | # For MacOS, symlink `ln -s ~/.config/ruff ~/Library/Application\ Support/ruff` 2 | [tool.ruff] 3 | extend-include = ["*.ipynb"] 4 | 5 | [tool.ruff.lint] 6 | select = ["ALL"] 7 | ignore = [ 8 | "ANN", # missing-type 9 | "ARGS001", 10 | # "B007", # unused-loop-control-variable 11 | # "C901", # complex-structure 12 | # "COM812", # missing-trailing-comma 13 | "C408", # rewrite litteral dict 14 | "C901", # too complex 15 | "COM812", # missing-trailing-comma 16 | "D10", # Undocumented public 17 | "D20", # Undocumented public 18 | "D21", # Undocumented public 19 | "D40", 20 | "D41", 21 | "E402", # module-import-not-at-top-of-file 22 | "E501", # Line too long 23 | "E731", # assign lambda 24 | "E999", # Syntax error, let other take cares 25 | "EM", # formatting traceback 26 | "ERA", # Eradicate 27 | "FA102", # Missing future import 28 | "FBT00", # Boolean arguments 29 | "FIX", 30 | "F401", # Unused import 31 | "G004", # Logging use f-string 32 | "I", # Import sort 33 | "N8", # uppercase names 34 | # "N802", # Function name upper case 35 | # "N803", # variable upper case 36 | # "N806", # upper case import 37 | # "N812", 38 | "PIE808", # unnecessary-range-start 39 | "PLR09", # too-many 40 | "PLR0913", # too-many-arguments 41 | "PLR0915", # too-many-statements 42 | "PLR2004", # magic-value-comparison 43 | "PLR5501", # collapsible-else-if 44 | "RET504", # unnecessary-assign 45 | # "RET505", # superfluous-else-return 46 | "S101", # assert 47 | "S301", # suspicious-pickle-usage 48 | "S311", # suspicious-non-cryptographic-random-usage 49 | # "SIM300", # yoda-conditions 50 | "T201", # print 51 | "TD00", # todo 52 | "TRY002", # write own exception 53 | "TRY003", # raise-vanilla-args 54 | "UP039", # unnecessary-class-parentheses 55 | "Q000", # single quote 56 | "Q001", # single quote 57 | "Q002", # single quote 58 | "W29", # trailing-whitespace, missing blankline 59 | ] 60 | -------------------------------------------------------------------------------- /starship.toml: -------------------------------------------------------------------------------- 1 | # Get editor completions based on the config schema 2 | "$schema" = 'https://starship.rs/config-schema.json' 3 | 4 | # Inserts a blank line between shell prompts 5 | # add_newline = true 6 | 7 | # Replace the '❯' symbol in the prompt with '➜' 8 | # [character] # The name of the module we are configuring is 'character' 9 | # success_symbol = '[➜](bold green)' # The 'success_symbol' segment is being set to '➜' with the color 'bold green' 10 | 11 | [env_var] 12 | variable = 'WEZTERM_PANE' 13 | default = "" 14 | 15 | [gcloud] 16 | disabled = false 17 | 18 | [os] 19 | disabled = false 20 | 21 | [time] 22 | disabled = false 23 | 24 | # nerd-font-symbols preset 25 | [aws] 26 | symbol = " " 27 | 28 | [buf] 29 | symbol = " " 30 | 31 | [c] 32 | symbol = " " 33 | 34 | [conda] 35 | symbol = " " 36 | 37 | [dart] 38 | symbol = " " 39 | 40 | [directory] 41 | read_only = " " 42 | 43 | [docker_context] 44 | symbol = " " 45 | 46 | [elixir] 47 | symbol = " " 48 | 49 | [elm] 50 | symbol = " " 51 | 52 | [git_branch] 53 | symbol = " " 54 | 55 | [golang] 56 | symbol = " " 57 | 58 | [guix_shell] 59 | symbol = " " 60 | 61 | [haskell] 62 | symbol = " " 63 | 64 | [haxe] 65 | symbol = "⌘ " 66 | 67 | [hg_branch] 68 | symbol = " " 69 | 70 | [java] 71 | symbol = " " 72 | 73 | [julia] 74 | symbol = " " 75 | 76 | [lua] 77 | symbol = " " 78 | 79 | [memory_usage] 80 | symbol = " " 81 | 82 | [meson] 83 | symbol = "喝 " 84 | 85 | [nim] 86 | symbol = " " 87 | 88 | [nix_shell] 89 | symbol = " " 90 | 91 | [nodejs] 92 | symbol = " " 93 | 94 | [os.symbols] 95 | Alpine = " " 96 | Amazon = " " 97 | Android = " " 98 | Arch = " " 99 | CentOS = " " 100 | Debian = " " 101 | DragonFly = " " 102 | Emscripten = " " 103 | EndeavourOS = " " 104 | Fedora = " " 105 | FreeBSD = " " 106 | Garuda = "﯑ " 107 | Gentoo = " " 108 | HardenedBSD = "ﲊ " 109 | Illumos = " " 110 | Linux = " " 111 | Macos = " " 112 | Manjaro = " " 113 | Mariner = " " 114 | MidnightBSD = " " 115 | Mint = " " 116 | NetBSD = " " 117 | NixOS = " " 118 | OpenBSD = " " 119 | openSUSE = " " 120 | OracleLinux = " " 121 | Pop = " " 122 | Raspbian = " " 123 | Redhat = " " 124 | RedHatEnterprise = " " 125 | Redox = " " 126 | Solus = "ﴱ " 127 | SUSE = " " 128 | Ubuntu = " " 129 | Unknown = " " 130 | Windows = " " 131 | 132 | [package] 133 | symbol = " " 134 | 135 | [python] 136 | symbol = " " 137 | 138 | [rlang] 139 | symbol = "ﳒ " 140 | 141 | [ruby] 142 | symbol = " " 143 | 144 | [rust] 145 | symbol = " " 146 | 147 | [scala] 148 | symbol = " " 149 | 150 | [spack] 151 | symbol = "🅢 " 152 | -------------------------------------------------------------------------------- /stylua.toml: -------------------------------------------------------------------------------- 1 | indent_type = "Spaces" 2 | indent_width = 2 3 | column_width = 100 4 | collapse_simple_statement = "Always" 5 | -------------------------------------------------------------------------------- /tmux/tmux.conf: -------------------------------------------------------------------------------- 1 | unbind-key C-b 2 | set -g prefix C-a 3 | bind C-a send-prefix # Nested remote session etc 4 | 5 | set -g base-index 1 6 | set -g pane-base-index 1 7 | 8 | set -g default-terminal "${TERM}" 9 | set -ga terminal-overrides ",xterm-256color:Tc" 10 | set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support 11 | set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0 12 | 13 | # For tpipeline 14 | set -g focus-events on 15 | set -g status-style bg=default 16 | set -g status-left-length 90 17 | set -g status-right-length 90 18 | set -g status-justify absolute-centre 19 | 20 | # List of plugins 21 | set -g @plugin 'tmux-plugins/tpm' 22 | set -g @plugin 'tmux-plugins/tmux-sensible' 23 | set -g @plugin 'christoomey/vim-tmux-navigator' 24 | set -g @plugin 'tmux-plugins/tmux-pain-control' 25 | # set -g @plugin 'noscript/tmux-mighty-scroll' 26 | set -g @plugin 'jaclu/tmux-menus' 27 | set -g @menus_trigger '/' 28 | set -g @plugin 'schasse/tmux-jump' 29 | 30 | # Bootstrap and Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) 31 | if "test ! -d ~/.tmux/plugins/tpm" \ 32 | "run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'" 33 | run '~/.tmux/plugins/tpm/tpm' 34 | -------------------------------------------------------------------------------- /wezterm/wezterm.lua: -------------------------------------------------------------------------------- 1 | local wezterm = require("wezterm") 2 | local act = wezterm.action 3 | 4 | local config = wezterm.config_builder() 5 | 6 | -- ZenMode.nvim 7 | wezterm.on("user-var-changed", function(window, pane, name, value) 8 | local overrides = window:get_config_overrides() or {} 9 | if name == "ZEN_MODE" then 10 | local incremental = value:find("+") 11 | local number_value = tonumber(value) 12 | if incremental ~= nil then 13 | while number_value > 0 do 14 | window:perform_action(wezterm.action.IncreaseFontSize, pane) 15 | number_value = number_value - 1 16 | end 17 | overrides.enable_tab_bar = false 18 | elseif number_value < 0 then 19 | window:perform_action(wezterm.action.ResetFontSize, pane) 20 | overrides.font_size = nil 21 | overrides.enable_tab_bar = true 22 | else 23 | overrides.font_size = number_value 24 | overrides.enable_tab_bar = false 25 | end 26 | end 27 | window:set_config_overrides(overrides) 28 | end) 29 | 30 | config.warn_about_missing_glyphs = false 31 | config.enable_wayland = false 32 | config.window_background_opacity = 0.80 33 | config.macos_window_background_blur = 10 34 | -- config.debug_key_events = true, 35 | -- config.default_gui_startup_args = { "connect", "unix" } 36 | config.unix_domains = { 37 | { 38 | name = "gpu", 39 | proxy_command = { "ssh", "-T", "gpu", "wezterm", "cli", "proxy", }, 40 | }, 41 | } 42 | config.ssh_domains = wezterm.default_ssh_domains() 43 | 44 | config.font = wezterm.font_with_fallback({ 45 | -- { family = "0xProto Nerd Font" }, 46 | { family = "Cascadia Code" }, 47 | { family = "Rec Mono Duotone" }, 48 | { family = "Victor Mono", weight = "Medium" }, 49 | { family = "JetBrains Mono" }, 50 | }) 51 | config.harfbuzz_features = { 52 | "calt", "clig", "dlig", "liga", "ss01", "ss02", 53 | "ss03", "ss04", "ss05", "ss06", "ss07", "ss08", 54 | } 55 | config.font_size = 15 56 | config.underline_position = "-2pt" 57 | config.color_scheme = "kanagawabones" 58 | 59 | config.window_decorations = "INTEGRATED_BUTTONS|RESIZE" 60 | config.window_padding = { left = 0, right = 0, top = 0, bottom = 0 } 61 | config.tab_max_width = 32 62 | config.window_frame = { 63 | font_size = 14.0, 64 | } 65 | config.inactive_pane_hsb = { 66 | saturation = 0.9, 67 | brightness = 0.75, 68 | } 69 | 70 | 71 | config.mouse_bindings = { 72 | { 73 | event = { Down = { streak = 2, button = 'Right' } }, 74 | action = wezterm.action.SelectTextAtMouseCursor 'Block', 75 | mods = 'NONE', 76 | }, 77 | { 78 | event = { Down = { streak = 4, button = 'Left' } }, 79 | action = wezterm.action.SelectTextAtMouseCursor 'SemanticZone', 80 | mods = 'NONE', 81 | }, 82 | } 83 | config.keys = { 84 | { key = "_", mods = "CMD", action = act({ SplitVertical = { domain = "CurrentPaneDomain" } }) }, 85 | { key = "|", mods = "CMD", action = act({ SplitHorizontal = { domain = "CurrentPaneDomain" } }) }, 86 | { key = "_", mods = "CTRL|SHIFT", action = act({ SplitVertical = { domain = "CurrentPaneDomain" } }) }, 87 | { key = "|", mods = "CTRL|SHIFT", action = act({ SplitHorizontal = { domain = "CurrentPaneDomain" } }) }, 88 | 89 | { key = "p", mods = "CMD", action = act.ActivateCommandPalette }, 90 | { key = "z", mods = "CMD", action = act.TogglePaneZoomState }, 91 | { key = "V", mods = "CMD", action = act.ActivateCopyMode }, 92 | { key = "s", mods = "CTRL|SHIFT", action = act.QuickSelect }, 93 | { key = "s", mods = "CMD", action = act.QuickSelect }, 94 | { key = "+", mods = "CMD", action = act.IncreaseFontSize }, 95 | 96 | { key = "PageUp", mods = "", action = act.ScrollByPage(-1) }, 97 | { key = "PageDown", mods = "", action = act.ScrollByPage(1) }, 98 | { key = "PageUp", mods = "CMD", action = act.ScrollToPrompt(-1) }, 99 | { key = "PageDown", mods = "CMD", action = act.ScrollToPrompt(1) }, 100 | 101 | { key = ">", mods = "CMD|SHIFT", action = act.MoveTabRelative(1) }, 102 | { key = "<", mods = "CMD|SHIFT", action = act.MoveTabRelative(-1) }, 103 | -- { key = "d", mods = "CMD", action = act.CloseCurrentPane({ confirm = true }) }, 104 | { key = "d", mods = "CTRL|SHIFT", action = act.DisableDefaultAssignment }, 105 | { key = "d", mods = "CTRL", action = act.DisableDefaultAssignment }, 106 | { key = "g", mods = "CMD", action = act.SpawnTab("DefaultDomain") }, 107 | { key = "g", mods = "CTRL|SHIFT", action = act.SpawnTab("DefaultDomain") }, 108 | { key = "l", mods = "CMD", action = act.ActivateLastTab }, 109 | { key = "l", mods = "CTRL|SHIFT", action = act.ActivateLastTab }, 110 | 111 | { key = "Enter", mods = "SHIFT", action = act.DisableDefaultAssignment }, 112 | -- { key = "Enter", mods = "ALT", action = act.DisableDefaultAssignment }, 113 | { key = "Tab", mods = "CTRL", action = act.DisableDefaultAssignment }, 114 | }, 115 | 116 | { key = "]", mods = "CMD", action = act.RotatePanes("Clockwise") }, 117 | { key = "[", mods = "CMD", action = act.RotatePanes("CounterClockwise") }, 118 | } 119 | config.enable_kitty_graphics = true 120 | 121 | wezterm.on("update-status", function(window, pane) 122 | local right_status = "" 123 | local workspace = window.active_workspace() 124 | if workspace ~= "default" then 125 | right_status = right_status .. workspace 126 | end 127 | local meta = pane:get_metadata() or {} 128 | if meta.is_tardy then 129 | local secs = meta.since_last_response_ms / 1000.0 130 | right_status = string.format("tardy: %5.1fs⏳", secs) + right_status 131 | end 132 | window:set_right_status(right_status) 133 | end) 134 | 135 | local function tab_title(tab_info) 136 | local title = tab_info.tab_title 137 | -- if the tab title is explicitly set, take that 138 | if title and #title > 0 then return title end 139 | -- Otherwise, use the title from the active pane in that tab 140 | return tab_info.active_pane.title 141 | end 142 | 143 | wezterm.on("format-tab-title", function(tab, tabs, panes, config, hover, max_width) 144 | local title = tab.tab_index + 1 .. ": " .. tab_title(tab) 145 | local pane = tab.active_pane 146 | if pane.domain_name and pane.domain_name ~= "local" then 147 | title = title .. " (" .. pane.domain_name .. ") " 148 | end 149 | 150 | local has_unseen_output = false 151 | for _, pane in ipairs(tab.panes) do 152 | if pane.has_unseen_output then 153 | has_unseen_output = true 154 | break 155 | end 156 | end 157 | if has_unseen_output then title = title .. " ●" end 158 | 159 | return title 160 | end) 161 | 162 | wezterm.on('format-window-title', function(tab, pane, tabs, panes, config) 163 | local zoomed = '' 164 | if tab.active_pane.is_zoomed then 165 | zoomed = '[Z] ' 166 | end 167 | 168 | local index = '' 169 | if #tabs > 1 then 170 | index = string.format('[%d/%d] ', tab.tab_index + 1, #tabs) 171 | end 172 | local host = '' 173 | if pane.domain_name and pane.domain_name ~= "local" then 174 | host = " (" .. pane.domain_name .. ") " 175 | end 176 | 177 | return zoomed .. index .. tab.active_pane.title .. host 178 | end) 179 | 180 | local smart_splits = wezterm.plugin.require("https://github.com/mrjones2014/smart-splits.nvim") 181 | smart_splits.apply_to_config(config, { 182 | direction_keys = { "h", "j", "k", "l" }, 183 | modifiers = { 184 | move = "CTRL", -- modifier to use for pane movement, e.g. CTRL+h to move left 185 | resize = "META", -- modifier to use for pane resize, e.g. META+h to resize to the left 186 | }, 187 | }) 188 | smart_splits.apply_to_config(config, { 189 | direction_keys = { "LeftArrow", "DownArrow", "UpArrow", "RightArrow" }, 190 | modifiers = { 191 | move = "CTRL", -- modifier to use for pane movement, e.g. CTRL+h to move left 192 | resize = "META", -- modifier to use for pane resize, e.g. META+h to resize to the left 193 | }, 194 | }) 195 | 196 | return config 197 | -------------------------------------------------------------------------------- /yazi/init.lua: -------------------------------------------------------------------------------- 1 | Header:children_add(function() 2 | if ya.target_family() ~= "unix" then 3 | return ui.Line {} 4 | end 5 | return ui.Span(ya.user_name() .. "@" .. ya.host_name() .. ":"):fg("blue") 6 | end, 500, Header.LEFT) 7 | -------------------------------------------------------------------------------- /yazi/yazi.toml: -------------------------------------------------------------------------------- 1 | [manager] 2 | linemode = "size" 3 | -------------------------------------------------------------------------------- /zsh/znap-repos: -------------------------------------------------------------------------------- 1 | /Users/phuc/dotfiles/diricons 2 | agkozak/zsh-z 3 | bigH/git-fuzzy 4 | hlissner/zsh-autopair 5 | jeffreytse/zsh-vi-mode 6 | junegunn/fzf 7 | junegunn/fzf/shell/completions.zsh 8 | marlonrichert/zsh-autocomplete 9 | MichaelAquilina/zsh-you-should-use 10 | romkatv/powerlevel10k 11 | softmoth/zsh-vim-mode 12 | Tarrasch/zsh-autoenv 13 | trapd00r/LS_COLORS 14 | wfxr/forgit 15 | zdharma/fast-syntax-highlighting 16 | zpm-zsh/colors 17 | zpm-zsh/ls 18 | zsh-users/zsh-autosuggestions 19 | zsh-users/zsh-completions 20 | zsh-users/zsh-history-substring-search 21 | -------------------------------------------------------------------------------- /zsh/zshrc.zsh: -------------------------------------------------------------------------------- 1 | if [ ! -d "$HOME/.zsh" ]; then 2 | git clone --depth 1 https://github.com/marlonrichert/zsh-snap.git $HOME/.zsh/zsh-snap 3 | fi 4 | source $HOME/.zsh/zsh-snap/znap.zsh 5 | 6 | znap eval starship "starship init zsh --print-full-init" 7 | znap prompt 8 | # znap source romkatv/powerlevel10k 9 | znap source jeffreytse/zsh-vi-mode 10 | function zvm_after_init() { 11 | bindkey '^[^?' backward-kill-word 12 | znap source junegunn/fzf shell/{completion,key-bindings}.zsh 13 | export FZF_DEFAULT_OPTS="--layout=reverse" 14 | # export FZF_DEFAULT_COMMAND='rg --files --hidden --follow --glob "!.git/*"' 15 | znap source Aloxaf/fzf-tab 16 | znap source Freed-Wu/fzf-tab-source 17 | # disable sort when completing `git checkout` 18 | zstyle ':completion:*:git-checkout:*' sort false 19 | # set list-colors to enable filename colorizing 20 | zstyle ':completion:*' list-colors '${(s.:.)LS_COLORS}' 21 | # preview directory's content with eza when completing cd 22 | zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza -1 --color=always $realpath' 23 | # switch group using `,` and `.` 24 | zstyle ':fzf-tab:*' switch-group ',' '.' 25 | } 26 | 27 | # package managers 28 | [[ -x "$(command -v brew)" ]] && FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}" 29 | 30 | # terminal's shell-integration 31 | [[ "$TERM" == "xterm-kitty" ]] && alias ssh="kitty +kitten ssh" 32 | [[ "$TERM_PROGRAM" == "WezTerm" ]] && export TERM=wezterm 33 | znap eval wezterm 'curl -fsSL https://raw.githubusercontent.com/wez/wezterm/main/assets/shell-integration/wezterm.sh' 34 | znap fpath _wezterm "wezterm shell-completion --shell zsh" 35 | znap eval wezterm_info "curl -o ~/wezterm.terminfo https://raw.githubusercontent.com/wez/wezterm/main/termwiz/data/wezterm.terminfo && tic -x -o ~/.terminfo ~/wezterm.terminfo && rm ~/wezterm.terminfo" 36 | 37 | # python 38 | znap install conda-incubator/conda-zsh-completion 39 | [[ -x "$(command -v conda)" ]] && znap eval conda "conda shell.zsh hook" 40 | [[ -x "$(command -v pipx)" ]] && znap eval pipx "register-python-argcomplete pipx" 41 | [[ -x "$(command -v pip)" ]] && znap eval pip 'eval "$(pip completion --zsh)"' 42 | [[ -x "$(command -v poetry)" ]] && znap fpath _poetry 'poetry completions zsh' 43 | 44 | export ZSH_AUTOSUGGEST_STRATEGY=(match_prev_cmd history completion) 45 | znap source zsh-users/zsh-autosuggestions # On same line 46 | znap source zpm-zsh/ls # Use eza for ls 47 | # znap source zpm-zsh/autoenv 48 | znap source hlissner/zsh-autopair 49 | znap source MichaelAquilina/zsh-you-should-use 50 | znap source zdharma-continuum/fast-syntax-highlighting 51 | znap source zsh-users/zsh-completions 52 | 53 | znap eval direnv "direnv hook zsh" 54 | znap eval zoxide "zoxide init zsh" 55 | znap fpath _fuck "$(thefuck --alias)" 56 | # znap source not-poma/lazyshell # GPT 57 | source $HOME/.config/lf/utils.sh 58 | 59 | export EDITOR="nvim" 60 | [[ -v NVIM ]] && export EDITOR="nvr -l" && export VISUAL="nvr -l" 61 | alias v="$EDITOR" vimdiff="$EDITOR -d" n="nvim" 62 | alias g="git" lg="lazygit" yz="yazi" 63 | 64 | export BAT_THEME=OneHalfDark 65 | export PAGER="bat" 66 | export MANPAGER="sh -c 'col -bx | bat -l man -p'" 67 | export LESSOPEN="|$HOMEBREW_PREFIX/bin/lesspipe.sh %s" 68 | 69 | export PATH="$HOME/.local/bin:$HOME/.pixi/bin/:$HOME/.local/share/nvim/mason/bin:$PATH" 70 | export SAVEHIST=2000 71 | export HISTFILE=$HOME/.zsh_history 72 | export HISTSIZE=2000 73 | 74 | which sccache > /dev/null && export RUST_WRAPPER=sccache 75 | GO="$HOME/go/bin" && [ -d $GO ] && export PATH="$GO:$PATH" 76 | HASKELL="$HOME/.ghcup/bin" && [ -d $HASKELL ] && export PATH="$HASKELL:$PATH" 77 | export JUPYTER_CONFIG_PATH="~/.config/jupyter/:$JUPYTER_CONFIG_PATH" 78 | 79 | autoload -z edit-command-line 80 | zle -N edit-command-line 81 | bindkey "^X^E" edit-command-line 82 | 83 | autoload -U select-word-style 84 | select-word-style bash 85 | 86 | # Don't let > silently overwrite files. To overwrite, use >! instead. 87 | setopt NO_CLOBBER 88 | 89 | # Treat comments pasted into the command line as comments, not code. 90 | setopt INTERACTIVE_COMMENTS 91 | 92 | # Don't treat non-executable files in your $path as commands. This makes sure 93 | # they don't show up as command completions. Settinig this option can impact 94 | # performance on older systems, but should not be a problem on modern ones. 95 | setopt HASH_EXECUTABLES_ONLY 96 | 97 | # Enable ** and *** as shortcuts for **/* and ***/*, respectively. 98 | # https://zsh.sourceforge.io/Doc/Release/Expansion.html#Recursive-Globbing 99 | setopt GLOB_STAR_SHORT 100 | 101 | # Sort numbers numerically, not lexicographically. 102 | setopt NUMERIC_GLOB_SORT 103 | 104 | precmd() { 105 | echo -ne "\033]0; $(pwd | sed 's/.*\///')\007" 106 | } 107 | 108 | # vim:ft=bash 109 | --------------------------------------------------------------------------------