├── .gitignore ├── .luarc.json ├── README.md ├── assets ├── md.css ├── mdhl.css ├── ss1.png ├── ss2.png ├── ss3.png └── ss4.png ├── colors └── custom.vim ├── init.lua ├── lua ├── cool_stuff │ ├── chelpers │ │ └── init.lua │ ├── init.lua │ ├── ntsh │ │ └── init.lua │ └── todo_float.lua ├── mappings │ ├── init.lua │ ├── markdown.lua │ ├── rust.lua │ └── sql.lua ├── plugins │ ├── alpha.lua │ ├── colorizer.lua │ ├── comments.lua │ ├── completions.lua │ ├── conform.lua │ ├── cursor.lua │ ├── fidget.lua │ ├── flash.lua │ ├── floatingtodo.lua │ ├── fmt_utils.lua │ ├── image.lua │ ├── lspconfig.lua │ ├── markview.lua │ ├── mdmath.lua │ ├── mdprev.lua │ ├── minimisc.lua │ ├── not_sure.lua │ ├── rust.lua │ ├── screenkey.lua │ ├── statusline.lua │ ├── tabout.lua │ ├── telescope.lua │ ├── textobjects.lua │ ├── theme.lua │ ├── tmux.lua │ ├── transparency.lua │ ├── treesitter.lua │ ├── typstprev.lua │ ├── vimtex.lua │ ├── webdevicons.lua │ ├── whichkey.lua │ ├── yazi.lua │ └── zen.lua ├── snippets │ ├── latex.lua │ ├── notes.lua │ └── zig.lua ├── utils │ ├── color_overrides.lua │ ├── dashboard.lua │ └── init.lua └── vimopts.lua └── spell ├── en.utf-8.add └── en.utf-8.add.spl /.gitignore: -------------------------------------------------------------------------------- 1 | lazy-lock.json 2 | -------------------------------------------------------------------------------- /.luarc.json: -------------------------------------------------------------------------------- 1 | { 2 | "diagnostics.globals": [ 3 | "vim", 4 | "get_python_path", 5 | "listDiagnostics", 6 | "leave_snippet" 7 | ], 8 | "diagnostics.disable": [ 9 | "undefined-field", 10 | "missing-fields", 11 | "redundant-parameter" 12 | ] 13 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # My Nvim Config 2 | 3 | A bloated config with minimal flashiness. 4 | 5 | ![preview 1](assets/ss1.png) 6 | ![preview 2](assets/ss2.png) 7 | ![preview 3](assets/ss3.png) 8 | ![preview 4](assets/ss4.png) 9 | -------------------------------------------------------------------------------- /assets/md.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: "MyCustomFont"; 3 | src: url("/Users/michaelwilliams/Library/Fonts/IosevkaNerdFont-Regular.ttf"); 4 | } 5 | 6 | body { 7 | font-family: "MyCustomFont", monospace !important; 8 | } 9 | /* 10 | * github like style 11 | * https://github.com/iamcco/markdown.css/blob/master/dest/github/markdown.css 12 | */ 13 | 14 | main { 15 | /*background-color: #080808;*/ 16 | background: transparent; 17 | } 18 | 19 | body { 20 | /*background-color: #080808;*/ 21 | background-color: white; 22 | } 23 | 24 | :root { 25 | --color-text-primary: black; 26 | --color-text-tertiary: #777; 27 | --color-text-link: #bea3c7; 28 | /*--color-bg-primary: #080808;*/ 29 | --color-bg-primary: white; 30 | --color-bg-secondary: #fafbfc; 31 | --color-bg-tertiary: #080808; 32 | --color-border-primary: #ddd; 33 | --color-border-secondary: #eaecef; 34 | --color-border-tertiary: #d1d5da; 35 | --color-kbd-foreground: #444d56; 36 | --color-markdown-blockquote-border: #dfe2e5; 37 | --color-markdown-table-border: #dfe2e5; 38 | --color-markdown-table-tr-border: #c6cbd1; 39 | --color-markdown-code-bg: #080808; 40 | } 41 | /* [data-theme="dark"] { */ 42 | /* --color-text-primary: #c9d1d9; */ 43 | /* --color-text-tertiary: #8b949e; */ 44 | /* --color-text-link: #58a6ff; */ 45 | /* --color-bg-primary: #0d1117; */ 46 | /* --color-bg-secondary: #0d1117; */ 47 | /* --color-bg-tertiary: #161b22; */ 48 | /* --color-border-primary: #30363d; */ 49 | /* --color-border-secondary: #21262d; */ 50 | /* --color-border-tertiary: #6e7681; */ 51 | /* --color-kbd-foreground: #b1bac4; */ 52 | /* --color-markdown-blockquote-border: #3b434b; */ 53 | /* --color-markdown-table-border: none; */ 54 | /* --color-markdown-table-tr-border: #272c32; */ 55 | /* --color-markdown-code-bg: #080808; */ 56 | /* } */ 57 | 58 | .markdown-body ol ol, 59 | .markdown-body ul ol, 60 | .markdown-body ol ul, 61 | .markdown-body ul ul, 62 | .markdown-body ol ul ol, 63 | .markdown-body ul ul ol, 64 | .markdown-body ol ul ul, 65 | .markdown-body ul ul ul { 66 | margin-top: 0; 67 | margin-bottom: 0; 68 | } 69 | .markdown-body { 70 | min-height: 100vh; 71 | /* font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif, "Apple Color Emoji", "Segoe UI 72 | Emoji", "Segoe UI Symbol"; */ 73 | /*font-family: "JetBrains Mono";*/ 74 | /*font-size: 16px;*/ 75 | color: var(--color-text-primary); 76 | line-height: 1.6; 77 | word-wrap: break-word; 78 | padding: 45px; 79 | /*background: var(--color-bg-primary);*/ 80 | /* border: 1px solid var(--color-border-primary); */ 81 | -webkit-border-radius: 0 0 3px 3px; 82 | border-radius: 0 0 3px 3px; 83 | } 84 | .markdown-body > *:first-child { 85 | margin-top: 0 !important; 86 | } 87 | .markdown-body > *:last-child { 88 | margin-bottom: 0 !important; 89 | } 90 | .markdown-body .table-of-contents ol { 91 | list-style: none; 92 | } 93 | .markdown-body .table-of-contents > ol { 94 | padding-left: 0; 95 | } 96 | .markdown-body * { 97 | -webkit-box-sizing: border-box; 98 | -moz-box-sizing: border-box; 99 | box-sizing: border-box; 100 | } 101 | .markdown-body h1, 102 | .markdown-body h2, 103 | .markdown-body h3, 104 | .markdown-body h4, 105 | .markdown-body h5, 106 | .markdown-body h6 { 107 | margin-top: 1em; 108 | margin-bottom: 16px; 109 | font-weight: bold; 110 | line-height: 1.4; 111 | } 112 | .markdown-body h1 .anchor, 113 | .markdown-body h2 .anchor, 114 | .markdown-body h3 .anchor, 115 | .markdown-body h4 .anchor, 116 | .markdown-body h5 .anchor, 117 | .markdown-body h6 .anchor { 118 | margin-left: -24px; 119 | visibility: hidden; 120 | } 121 | .markdown-body h1:hover .anchor, 122 | .markdown-body h2:hover .anchor, 123 | .markdown-body h3:hover .anchor, 124 | .markdown-body h4:hover .anchor, 125 | .markdown-body h5:hover .anchor, 126 | .markdown-body h6:hover .anchor { 127 | visibility: visible; 128 | } 129 | .markdown-body p, 130 | .markdown-body blockquote, 131 | .markdown-body ul, 132 | .markdown-body ol, 133 | .markdown-body dl, 134 | .markdown-body table, 135 | .markdown-body pre { 136 | margin-top: 0; 137 | margin-bottom: 16px; 138 | } 139 | .markdown-body h1 { 140 | margin: 0.67em 0; 141 | padding-bottom: 0.3em; 142 | font-size: 2.25em; 143 | line-height: 1.2; 144 | border-bottom: 1px solid var(--color-border-secondary); 145 | } 146 | .markdown-body h2 { 147 | padding-bottom: 0.3em; 148 | font-size: 1.75em; 149 | line-height: 1.225; 150 | border-bottom: 1px solid var(--color-border-secondary); 151 | } 152 | .markdown-body h3 { 153 | font-size: 1.5em; 154 | line-height: 1.43; 155 | } 156 | .markdown-body h4 { 157 | font-size: 1.25em; 158 | } 159 | .markdown-body h5 { 160 | font-size: 1em; 161 | } 162 | .markdown-body h6 { 163 | font-size: 1em; 164 | color: var(--color-text-tertiary); 165 | } 166 | .markdown-body hr { 167 | margin-top: 20px; 168 | margin-bottom: 20px; 169 | height: 0; 170 | border: 0; 171 | border-top: 1px solid var(--color-border-primary); 172 | } 173 | .markdown-body ol, 174 | .markdown-body ul { 175 | padding-left: 2em; 176 | } 177 | .markdown-body ol ol, 178 | .markdown-body ul ol { 179 | list-style-type: lower-roman; 180 | } 181 | .markdown-body ol ul, 182 | .markdown-body ul ul { 183 | list-style-type: circle; 184 | } 185 | .markdown-body ol ul ul, 186 | .markdown-body ul ul ul { 187 | list-style-type: square; 188 | } 189 | .markdown-body ol { 190 | list-style-type: decimal; 191 | } 192 | .markdown-body ul { 193 | list-style-type: disc; 194 | } 195 | .markdown-body dl { 196 | margin-bottom: 1.3em; 197 | } 198 | .markdown-body dl dt { 199 | font-weight: 700; 200 | } 201 | .markdown-body dl dd { 202 | margin-left: 0; 203 | } 204 | .markdown-body dl dd p { 205 | margin-bottom: 0.8em; 206 | } 207 | .markdown-body blockquote { 208 | margin-left: 0; 209 | margin-right: 0; 210 | padding: 0 15px; 211 | color: var(--color-text-tertiary); 212 | border-left: 4px solid var(--color-markdown-blockquote-border); 213 | } 214 | .markdown-body table { 215 | display: block; 216 | width: 100%; 217 | overflow: auto; 218 | word-break: normal; 219 | word-break: keep-all; 220 | border-collapse: collapse; 221 | border-spacing: 0; 222 | } 223 | .markdown-body table tr { 224 | background-color: var(--color-bg-primary); 225 | border-top: 1px solid var(--color-markdown-table-tr-border); 226 | } 227 | .markdown-body table tr:nth-child(2n) { 228 | background-color: var(--color-bg-tertiary); 229 | } 230 | .markdown-body table th, 231 | .markdown-body table td { 232 | padding: 6px 13px; 233 | border: 1px solid var(--color-markdown-table-border); 234 | vertical-align: top; 235 | } 236 | .markdown-body kbd { 237 | display: inline-block; 238 | padding: 5px 6px; 239 | /*font:*/ 240 | /* 14px SFMono-Regular,*/ 241 | /* Consolas,*/ 242 | /* Liberation Mono,*/ 243 | /* Menlo,*/ 244 | /* monospace;*/ 245 | line-height: 10px; 246 | /* color: var(--color-kbd-foreground); */ 247 | vertical-align: middle; 248 | background-color: var(--color-bg-secondary); 249 | border: 1px solid var(--color-border-tertiary); 250 | border-radius: 3px; 251 | box-shadow: inset 0 -1px 0 var(--color-border-tertiary); 252 | } 253 | .markdown-body pre { 254 | word-wrap: normal; 255 | padding: 16px; 256 | overflow: auto; 257 | font-size: 85%; 258 | line-height: 1.45; 259 | /*background-color: var(--color-bg-tertiary);*/ 260 | -webkit-border-radius: 3px; 261 | border-radius: 3px; 262 | } 263 | .markdown-body pre code { 264 | display: inline; 265 | max-width: initial; 266 | padding: 0; 267 | margin: 0; 268 | overflow: initial; 269 | font-size: 100%; 270 | line-height: inherit; 271 | word-wrap: normal; 272 | white-space: pre; 273 | border: 0; 274 | -webkit-border-radius: 3px; 275 | border-radius: 3px; 276 | background-color: transparent; 277 | } 278 | .markdown-body pre code:before, 279 | .markdown-body pre code:after { 280 | content: normal; 281 | } 282 | .markdown-body code { 283 | /* font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; */ 284 | padding: 0; 285 | padding-top: 0.2em; 286 | padding-bottom: 0.2em; 287 | margin: 0; 288 | font-size: 85%; 289 | background-color: var(--color-markdown-code-bg); 290 | -webkit-border-radius: 3px; 291 | border-radius: 3px; 292 | } 293 | .markdown-body code:before, 294 | .markdown-body code:after { 295 | letter-spacing: -0.2em; 296 | content: "\00a0"; 297 | } 298 | .markdown-body a { 299 | color: var(--color-text-link); 300 | text-decoration: none; 301 | background: transparent; 302 | } 303 | .markdown-body img { 304 | max-width: 100%; 305 | max-height: 100%; 306 | } 307 | .markdown-body strong { 308 | font-weight: bold; 309 | } 310 | .markdown-body em { 311 | font-style: italic; 312 | } 313 | .markdown-body del { 314 | text-decoration: line-through; 315 | } 316 | .task-list-item { 317 | list-style-type: none; 318 | } 319 | .task-list-item input { 320 | font: 321 | 13px/1.4 Helvetica, 322 | arial, 323 | nimbussansl, 324 | liberationsans, 325 | freesans, 326 | clean, 327 | sans-serif, 328 | "Apple Color Emoji", 329 | "Segoe 330 | UI Emoji", 331 | "Segoe UI Symbol"; 332 | margin: 0 0.35em 0.25em -1.6em; 333 | vertical-align: middle; 334 | } 335 | .task-list-item input[disabled] { 336 | cursor: default; 337 | } 338 | .task-list-item input[type="checkbox"] { 339 | -webkit-box-sizing: border-box; 340 | -moz-box-sizing: border-box; 341 | box-sizing: border-box; 342 | padding: 0; 343 | } 344 | .task-list-item input[type="radio"] { 345 | -webkit-box-sizing: border-box; 346 | -moz-box-sizing: border-box; 347 | box-sizing: border-box; 348 | padding: 0; 349 | } 350 | 351 | #page-header { 352 | display: none; 353 | } 354 | 355 | /* code coloring */ 356 | -------------------------------------------------------------------------------- /assets/mdhl.css: -------------------------------------------------------------------------------- 1 | .hljs { 2 | display: block; 3 | overflow-x: auto; 4 | padding: 0.5em; 5 | color: var(--color-text-primary); 6 | /*background: #080808;*/ 7 | background: white; 8 | } 9 | 10 | .hljs-comment, 11 | .hljs-quote { 12 | color: gray; 13 | font-style: italic; 14 | } 15 | 16 | .hljs-keyword, 17 | .hljs-selector-tag, 18 | .hljs-subst { 19 | color: #72749b; 20 | font-weight: bold; 21 | } 22 | 23 | .hljs-number, 24 | .hljs-literal, 25 | .hljs-variable, 26 | .hljs-template-variable, 27 | .hljs-tag .hljs-attr { 28 | color: #080808; 29 | } 30 | 31 | .hljs-string, 32 | .hljs-doctag { 33 | color: #d4bd98; 34 | } 35 | 36 | .hljs-title, 37 | .hljs-section, 38 | .hljs-selector-id { 39 | color: #c7c7d4; 40 | font-weight: bold; 41 | } 42 | 43 | .hljs-subst { 44 | font-weight: normal; 45 | } 46 | 47 | .hljs-type, 48 | .hljs-class .hljs-title { 49 | color: #458; 50 | font-weight: bold; 51 | } 52 | 53 | .hljs-tag, 54 | .hljs-name, 55 | .hljs-attribute { 56 | color: #000080; 57 | font-weight: normal; 58 | } 59 | 60 | .hljs-regexp, 61 | .hljs-link { 62 | color: #009926; 63 | } 64 | 65 | .hljs-symbol, 66 | .hljs-bullet { 67 | color: #990073; 68 | } 69 | 70 | .hljs-built_in, 71 | .hljs-builtin-name { 72 | color: #aabdbb; 73 | } 74 | 75 | .hljs-meta { 76 | color: #999; 77 | font-weight: bold; 78 | } 79 | 80 | .hljs-deletion { 81 | background: #fdd; 82 | } 83 | 84 | .hljs-addition { 85 | background: #dfd; 86 | } 87 | 88 | .hljs-emphasis { 89 | font-style: italic; 90 | } 91 | 92 | .hljs-strong { 93 | font-weight: bold; 94 | } 95 | -------------------------------------------------------------------------------- /assets/ss1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimichael/my-nvim-config/3739f67f6a26a590ea0ae68fc080a9b680c8928d/assets/ss1.png -------------------------------------------------------------------------------- /assets/ss2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimichael/my-nvim-config/3739f67f6a26a590ea0ae68fc080a9b680c8928d/assets/ss2.png -------------------------------------------------------------------------------- /assets/ss3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimichael/my-nvim-config/3739f67f6a26a590ea0ae68fc080a9b680c8928d/assets/ss3.png -------------------------------------------------------------------------------- /assets/ss4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimichael/my-nvim-config/3739f67f6a26a590ea0ae68fc080a9b680c8928d/assets/ss4.png -------------------------------------------------------------------------------- /colors/custom.vim: -------------------------------------------------------------------------------- 1 | " took many of these colors from github.com/CosecSecCot/cosec-twilight.nvim. 2 | 3 | set bg=dark 4 | hi clear 5 | if exists('syntax_on') 6 | syntax reset 7 | endif 8 | 9 | let g:colors_name = 'custom' 10 | 11 | " Define highlight groups 12 | highlight Normal guifg=#FEFEFE guibg=#202020 13 | highlight NormalFloat guifg=#FEFEFE guibg=#202020 14 | highlight Comment guifg=#6f7b68 15 | highlight TSComment guifg=#6f7b68 16 | highlight Conceal guibg=#262626 17 | highlight Constant guifg=#cccccc 18 | "highlight CursorColumn 19 | "highlight CursorLine 20 | highlight DiffAdd guifg=#FFFEDB guibg=#2B3328 21 | highlight DiffChange guifg=#FFFEDB guibg=#262636 22 | highlight DiffDelete guifg=#C34143 guibg=#42242B 23 | highlight DiffText guifg=#FFFEDB guibg=#49443C 24 | highlight Directory guifg=#C1C88D 25 | highlight Error guifg=#FFFEDB gui=undercurl 26 | highlight ErrorMsg guifg=#FFFEDB 27 | "highlight FoldColumn 28 | "highlight Folded 29 | highlight Function guifg=#AA9AAC 30 | highlight Identifier guifg=#8B9698 31 | "highlight LineNr guifg=#474A4D 32 | highlight LineNrAbove guifg=#888888 guibg=#222222 33 | highlight LineNrBelow guifg=#888888 guibg=#222222 34 | highlight LineNr guifg=#d6d2c8 35 | highlight MatchParen guifg=#FFFEDB 36 | highlight NonText guifg=#303030 37 | highlight Operator guifg=#DEBF7C 38 | highlight Pmenu guifg=#918988 guibg=#303030 39 | highlight PmenuSbar guifg=#918988 guibg=#262626 40 | highlight PmenuSel guifg=#BFBBBA guibg=#303030 41 | highlight PmenuThumb guifg=#918988 guibg=#262626 gui=reverse 42 | highlight PreProc guifg=#8B9698 43 | highlight Question guifg=#9b8d7f 44 | highlight QuickFixLine guibg=#303030 45 | highlight Search guibg=#5F5958 46 | "highlight SignColumn 47 | highlight Special guifg=#cccccc 48 | highlight SpecialChar guifg=#C1C88D 49 | highlight SpecialKey guifg=#676767 50 | highlight Statement guifg=#cccccc 51 | highlight StatusLine guifg=#FFFEDB guibg=#34383C 52 | highlight String guifg=#A2A970 53 | highlight Structure guifg=#AA9AAC 54 | highlight Substitute guifg=#1A1A1A guibg=#C1C88D 55 | highlight TabLine guifg=#A09998 guibg=#212121 56 | highlight TabLineFill guifg=#A09998 guibg=#212121 57 | highlight TabLineSel guifg=#A09998 guibg=#40474F 58 | highlight Title guifg=#FFFEDB term=none cterm=none 59 | highlight Todo guifg=#8B9698 60 | highlight Type guifg=#E3D896 61 | highlight Underlined gui=undercurl 62 | highlight VertSplit guifg=#303030 63 | highlight Visual guibg=#454545 64 | highlight WarningMsg guifg=#FFFEDB 65 | highlight Float guifg=#6f7b68 66 | highlight Number guifg=#6f7b68 67 | highlight Boolean guifg=#6f7b68 68 | highlight WinSeparator guibg=#111111 guifg=#888888 69 | 70 | highlight @markup.link.label.markdown_inline cterm=NONE 71 | -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | local utils = require("utils") 2 | 3 | local colorscheme = "custom" 4 | 5 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 6 | if not (vim.uv or vim.loop).fs_stat(lazypath) then 7 | local lazyrepo = "https://github.com/folke/lazy.nvim.git" 8 | local out = vim.fn.system({ 9 | "git", 10 | "clone", 11 | "--filter=blob:none", 12 | "--branch=stable", 13 | lazyrepo, 14 | lazypath, 15 | }) 16 | if vim.v.shell_error ~= 0 then 17 | vim.api.nvim_echo({ 18 | { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, 19 | { out, "WarningMsg" }, 20 | { "\nPress any key to exit..." }, 21 | }, true, {}) 22 | vim.fn.getchar() 23 | os.exit(1) 24 | end 25 | end 26 | vim.opt.rtp:prepend(lazypath) 27 | 28 | -- vim opts 29 | require("vimopts") 30 | 31 | -- lazy.nvim setup 32 | require("lazy").setup("plugins", { 33 | defaults = { 34 | lazy = false, 35 | }, 36 | }) 37 | 38 | vim.filetype.add({ extension = { templ = "templ" } }) 39 | vim.filetype.add({ extension = { purs = "purescript" } }) 40 | vim.filetype.add({ 41 | extension = { nim = "nim" }, 42 | filename = { ["Nim"] = "nim" }, 43 | }) 44 | 45 | -- stop zig qf list from opening >:( 46 | vim.g.zig_fmt_parse_errors = 0 47 | 48 | -- treesitter config 49 | local config = require("nvim-treesitter.configs") 50 | config.setup({ 51 | ignore_install = {}, 52 | ensure_installed = { 53 | "typst", 54 | "purescript", 55 | "nix", 56 | "nim", 57 | "vimdoc", 58 | "go", 59 | "rust", 60 | "c", 61 | "lua", 62 | "python", 63 | "html", 64 | "css", 65 | "javascript", 66 | "typescript", 67 | "prisma", 68 | "haskell", 69 | "zig", 70 | "gleam", 71 | "wgsl", 72 | "php", 73 | "nim", 74 | "sql", 75 | "markdown", 76 | "latex", 77 | "gdscript", 78 | "gdshader", 79 | }, 80 | highlight = { 81 | enable = true, 82 | }, 83 | indent = { enable = true }, 84 | modules = {}, 85 | sync_install = true, 86 | auto_install = true, 87 | }) 88 | 89 | -- language specific mappings go here 90 | require("cool_stuff") 91 | require("mappings") 92 | 93 | utils.color_overrides.setup_colorscheme_overrides() 94 | 95 | -- theme 96 | vim.cmd("colorscheme " .. colorscheme) 97 | 98 | utils.fix_telescope_parens_win() 99 | utils.dashboard.setup_dashboard_image_colors() 100 | 101 | vim.api.nvim_create_autocmd("FileType", { 102 | pattern = "markdown", 103 | callback = function() 104 | vim.opt_local.conceallevel = 2 105 | end, 106 | }) 107 | -------------------------------------------------------------------------------- /lua/cool_stuff/chelpers/init.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.insert_protos = function() 4 | local filepath = vim.fn.expand("%:p") 5 | if filepath == nil then 6 | return 7 | end 8 | local cmd = "ctags -o - --kinds-C=f --kinds-C++=f -x --_xformat='%{typeref} %{name} %{signature};' " .. 9 | filepath .. " | tr ':' ' ' | sed -e 's/^typename //'" 10 | vim.notify("cmd = " .. cmd) 11 | local output = vim.fn.system(cmd) 12 | local cursor_pos = vim.api.nvim_win_get_cursor(0) 13 | local line = cursor_pos[1] 14 | 15 | vim.api.nvim_buf_set_lines(0, line - 1, line - 1, false, vim.split(output, '\n')) 16 | end 17 | 18 | M.setup = function() 19 | vim.api.nvim_create_user_command("CProtos", M.insert_protos, {}) 20 | end 21 | 22 | return M 23 | -------------------------------------------------------------------------------- /lua/cool_stuff/init.lua: -------------------------------------------------------------------------------- 1 | require("cool_stuff.chelpers").setup() 2 | require("cool_stuff.ntsh").setup() 3 | 4 | -- keymaps for nts 5 | vim.keymap.set("n", "[n", ":Nts") 6 | vim.keymap.set("n", "[j", ":NtsJournal") 7 | 8 | vim.api.nvim_create_user_command("Path", function() 9 | print(vim.fn.expand("%:p")) 10 | end, {}) 11 | -------------------------------------------------------------------------------- /lua/cool_stuff/ntsh/init.lua: -------------------------------------------------------------------------------- 1 | local utils = require("utils") 2 | 3 | local M = {} 4 | 5 | M.opts = {} 6 | 7 | local default_opts = { 8 | root_dir = "~/notes", 9 | journal_dir = "~/notes/dailies", 10 | } 11 | 12 | local function create_note(args) 13 | vim.ui.input({ prompt = "title: " }, function(input) 14 | if input == nil or input == "" then 15 | return 16 | end 17 | 18 | if not args["fargs"] or not args["fargs"][1] then 19 | vim.ui.input({ prompt = "loc (default .):" }, function(loc_input) 20 | local loc = "." 21 | if loc_input == nil then 22 | return 23 | end 24 | if loc_input ~= "" then 25 | loc = loc_input 26 | end 27 | 28 | -- vim.notify("creating note at: " .. loc) 29 | 30 | local cmds = { "note", M.opts.root_dir .. "/" .. loc } 31 | for word in input:gmatch("%S+") do 32 | table.insert(cmds, word) 33 | end 34 | 35 | local output = vim.system(cmds):wait() 36 | 37 | vim.cmd("edit " .. output.stdout) 38 | end) 39 | end 40 | 41 | local loc = args["fargs"][1] or "." 42 | 43 | local cmd = "silent!nts note " .. M.opts.root_dir .. "/" .. loc .. " " .. input 44 | vim.cmd(cmd) 45 | end) 46 | end 47 | 48 | local function open_journal(opts) 49 | local date = os.date("%Y-%m-%d") 50 | local note_file = "journal-" .. date .. ".md" 51 | local full_path = opts.journal_dir .. "/" .. note_file 52 | 53 | -- if cannot open file, try generating it 54 | if vim.fn.filereadable(vim.fn.expand(full_path)) == 0 then 55 | vim.cmd("silent!nts journal") 56 | end 57 | 58 | vim.cmd("edit " .. full_path) 59 | end 60 | 61 | function M.setup(opts) 62 | opts = opts or {} 63 | M.opts = vim.tbl_deep_extend("force", default_opts, opts) 64 | M.opts.root_dir = utils.expand_path(M.opts.root_dir) 65 | 66 | vim.api.nvim_create_user_command("Nts", create_note, { nargs = "*" }) 67 | vim.api.nvim_create_user_command("NtsJournal", function() 68 | open_journal(M.opts) 69 | end, { nargs = "*" }) 70 | end 71 | 72 | return M 73 | -------------------------------------------------------------------------------- /lua/cool_stuff/todo_float.lua: -------------------------------------------------------------------------------- 1 | local utils = require("utils") 2 | 3 | local M = {} 4 | 5 | local function float_win_config() 6 | local width = math.min(math.floor(vim.o.columns * 0.8), 64) 7 | local height = math.floor(vim.o.lines * 0.8) 8 | 9 | return { 10 | relative = "editor", 11 | width = width, 12 | height = height, 13 | col = utils.center_in(vim.o.columns, width), 14 | row = utils.center_in(vim.o.lines, height), 15 | border = "single", 16 | } 17 | end 18 | 19 | local function open_floating_file(filepath) 20 | local path = utils.expand_path(filepath) 21 | 22 | -- Check if the file exists 23 | if vim.fn.filereadable(path) == 0 then 24 | vim.notify("File does not exist: " .. path, vim.log.levels.ERROR) 25 | return 26 | end 27 | 28 | -- Look for an existing buffer with this file 29 | local buf = vim.fn.bufnr(path, true) 30 | 31 | -- If the buffer doesn't exist, create one and edit the file 32 | if buf == -1 then 33 | buf = vim.api.nvim_create_buf(false, false) 34 | vim.api.nvim_buf_set_name(buf, path) 35 | vim.api.nvim_buf_call(buf, function() 36 | vim.cmd("edit " .. vim.fn.fnameescape(path)) 37 | end) 38 | end 39 | 40 | vim.bo[buf].swapfile = false 41 | 42 | local win = vim.api.nvim_open_win(buf, true, float_win_config()) 43 | vim.cmd("setlocal nospell") 44 | 45 | vim.api.nvim_buf_set_keymap(buf, "n", "q", "", { 46 | noremap = true, 47 | silent = true, 48 | callback = function() 49 | -- Check if the buffer has unsaved changes 50 | if vim.api.nvim_get_option_value("modified", { buf = buf }) then 51 | vim.notify("save your changes bro", vim.log.levels.WARN) 52 | else 53 | vim.api.nvim_win_close(0, true) 54 | end 55 | end, 56 | }) 57 | 58 | vim.api.nvim_create_autocmd("VimResized", { 59 | callback = function() 60 | vim.api.nvim_win_set_config(win, float_win_config()) 61 | end, 62 | once = false, 63 | }) 64 | end 65 | 66 | local function setup_user_commands(opts) 67 | local target_file = opts.target_file or "todo.md" 68 | local resolved_target_file = vim.fn.resolve(target_file) 69 | 70 | if vim.fn.filereadable(resolved_target_file) == true then 71 | opts.target_file = resolved_target_file 72 | else 73 | opts.target_file = opts.global_file 74 | end 75 | vim.api.nvim_create_user_command("Td", function() 76 | open_floating_file(opts.target_file) 77 | end, {}) 78 | end 79 | 80 | local function setup_keymaps() 81 | vim.keymap.set("n", "td", ":Td", { silent = true }) 82 | end 83 | 84 | M.setup = function(opts) 85 | setup_user_commands(opts) 86 | setup_keymaps() 87 | end 88 | 89 | return M 90 | -------------------------------------------------------------------------------- /lua/mappings/init.lua: -------------------------------------------------------------------------------- 1 | require("mappings.rust") 2 | require("mappings.sql") 3 | require("mappings.markdown") 4 | -------------------------------------------------------------------------------- /lua/mappings/markdown.lua: -------------------------------------------------------------------------------- 1 | local function startswith(str, pref) 2 | return str:sub(1, #pref) == pref 3 | end 4 | 5 | local function triml(s) 6 | return s:match("^%s*(.*)") 7 | end 8 | 9 | local function toggle_todo() 10 | local line = vim.api.nvim_get_current_line() 11 | local trimmed_line = triml(line) 12 | local row, col = unpack(vim.api.nvim_win_get_cursor(0)) 13 | 14 | vim.cmd("noa") 15 | 16 | if startswith(trimmed_line, "- [x") then 17 | local replacement = string.gsub(line, "%[x%]", "[ ]") 18 | print(replacement) 19 | vim.api.nvim_buf_set_lines(0, row - 1, row, true, { replacement }) 20 | elseif startswith(trimmed_line, "- [ ]") then 21 | local replacement = string.gsub(line, "%[ %]", "[x]") 22 | print(replacement) 23 | vim.api.nvim_buf_set_lines(0, row - 1, row, true, { replacement }) 24 | end 25 | 26 | vim.api.nvim_win_set_cursor(0, { row, col }) 27 | 28 | vim.cmd("redraw") 29 | end 30 | 31 | vim.api.nvim_create_augroup("MarkdownKeymaps", { clear = true }) 32 | 33 | vim.api.nvim_create_autocmd("FileType", { 34 | group = "MarkdownKeymaps", 35 | pattern = "Markdown", 36 | callback = function() 37 | vim.keymap.set("n", "a", toggle_todo, { silent = true }) 38 | end, 39 | }) 40 | -------------------------------------------------------------------------------- /lua/mappings/rust.lua: -------------------------------------------------------------------------------- 1 | vim.api.nvim_create_augroup("rust_mappings", { clear = true }) 2 | 3 | -- insert || because that can be annoying to type 4 | vim.api.nvim_create_autocmd("FileType", { 5 | pattern = "rust", 6 | group = "rust_mappings", 7 | callback = function() 8 | vim.api.nvim_buf_set_keymap(0, "n", "b", "a||i", { noremap = true, silent = true }) 9 | end, 10 | }) 11 | -------------------------------------------------------------------------------- /lua/mappings/sql.lua: -------------------------------------------------------------------------------- 1 | vim.api.nvim_create_autocmd("FileType", { 2 | pattern = "sql", 3 | callback = function() 4 | vim.opt_local.indentexpr = "" 5 | end, 6 | }) 7 | -------------------------------------------------------------------------------- /lua/plugins/alpha.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "goolord/alpha-nvim", 3 | dependencies = { 4 | "echasnovski/mini.icons", 5 | }, 6 | 7 | config = function() 8 | local alpha = require("alpha") 9 | local dashboard = require("alpha.themes.dashboard") 10 | 11 | dashboard.section.header.opts.hl = { 12 | { 13 | { "I2A0", 0, 3 }, 14 | { "I2A0", 3, 6 }, 15 | { "I2A0", 6, 9 }, 16 | { "I2A0", 9, 12 }, 17 | { "I2A0", 12, 15 }, 18 | { "I2A0", 15, 18 }, 19 | { "I2A0", 18, 21 }, 20 | { "I2A0", 21, 24 }, 21 | { "I2A0", 24, 27 }, 22 | { "I2A0", 27, 30 }, 23 | { "I2A0", 30, 33 }, 24 | { "I2A0", 33, 36 }, 25 | { "I2A0", 36, 39 }, 26 | { "I2A0", 39, 42 }, 27 | { "I2A0", 42, 45 }, 28 | { "I2A0", 45, 48 }, 29 | { "I2A0", 48, 51 }, 30 | { "I2A0", 51, 54 }, 31 | { "I2A0", 54, 57 }, 32 | { "I2A0", 57, 60 }, 33 | { "I2A0", 60, 63 }, 34 | { "I2A0", 63, 66 }, 35 | { "I2A0", 66, 69 }, 36 | { "I2A0", 69, 72 }, 37 | { "I2A0", 72, 75 }, 38 | { "I2A0", 75, 78 }, 39 | { "I2A0", 78, 81 }, 40 | { "I2A0", 81, 84 }, 41 | { "I2A0", 84, 87 }, 42 | { "I2A0", 87, 90 }, 43 | { "I2A0", 90, 93 }, 44 | { "I2A0", 93, 96 }, 45 | { "I2A0", 96, 99 }, 46 | { "I2A0", 99, 102 }, 47 | { "I2A0", 102, 105 }, 48 | { "I2A0", 105, 108 }, 49 | { "I2A0", 108, 111 }, 50 | }, 51 | { 52 | { "I2A1", 0, 3 }, 53 | { "I2A2", 3, 6 }, 54 | { "I2A2", 6, 9 }, 55 | { "I2A2", 9, 12 }, 56 | { "I2A2", 12, 15 }, 57 | { "I2A2", 15, 18 }, 58 | { "I2A2", 18, 21 }, 59 | { "I2A2", 21, 24 }, 60 | { "I2A2", 24, 27 }, 61 | { "I2A2", 27, 30 }, 62 | { "I2A2", 30, 33 }, 63 | { "I2A2", 33, 36 }, 64 | { "I2A2", 36, 39 }, 65 | { "I2A3", 39, 42 }, 66 | { "I2A4", 42, 45 }, 67 | { "I2A5", 45, 48 }, 68 | { "I2A6", 48, 51 }, 69 | { "I2A7", 51, 54 }, 70 | { "I2A8", 54, 57 }, 71 | { "I2A4", 57, 60 }, 72 | { "I2A9", 60, 63 }, 73 | { "I2A2", 63, 66 }, 74 | { "I2A2", 66, 69 }, 75 | { "I2A10", 69, 72 }, 76 | { "I2A2", 72, 75 }, 77 | { "I2A2", 75, 78 }, 78 | { "I2A2", 78, 81 }, 79 | { "I2A2", 81, 84 }, 80 | { "I2A2", 84, 87 }, 81 | { "I2A2", 87, 90 }, 82 | { "I2A2", 90, 93 }, 83 | { "I2A2", 93, 96 }, 84 | { "I2A11", 96, 99 }, 85 | { "I2A12", 99, 102 }, 86 | { "I2A12", 102, 105 }, 87 | { "I2A13", 105, 108 }, 88 | { "I2A12", 108, 111 }, 89 | }, 90 | { 91 | { "I2A2", 0, 3 }, 92 | { "I2A2", 3, 6 }, 93 | { "I2A2", 6, 9 }, 94 | { "I2A2", 9, 12 }, 95 | { "I2A2", 12, 15 }, 96 | { "I2A2", 15, 18 }, 97 | { "I2A2", 18, 21 }, 98 | { "I2A2", 21, 24 }, 99 | { "I2A2", 24, 27 }, 100 | { "I2A2", 27, 30 }, 101 | { "I2A2", 30, 33 }, 102 | { "I2A2", 33, 36 }, 103 | { "I2A14", 36, 39 }, 104 | { "I2A15", 39, 42 }, 105 | { "I2A16", 42, 45 }, 106 | { "I2A17", 45, 48 }, 107 | { "I2A2", 48, 51 }, 108 | { "I2A2", 51, 54 }, 109 | { "I2A18", 54, 57 }, 110 | { "I2A19", 57, 60 }, 111 | { "I2A20", 60, 63 }, 112 | { "I2A21", 63, 66 }, 113 | { "I2A2", 66, 69 }, 114 | { "I2A2", 69, 72 }, 115 | { "I2A22", 72, 75 }, 116 | { "I2A22", 75, 78 }, 117 | { "I2A2", 78, 81 }, 118 | { "I2A2", 81, 84 }, 119 | { "I2A2", 84, 87 }, 120 | { "I2A23", 87, 90 }, 121 | { "I2A2", 90, 93 }, 122 | { "I2A2", 93, 96 }, 123 | { "I2A2", 96, 99 }, 124 | { "I2A2", 99, 102 }, 125 | { "I2A2", 102, 105 }, 126 | { "I2A2", 105, 108 }, 127 | { "I2A2", 108, 111 }, 128 | }, 129 | { 130 | { "I2A24", 0, 3 }, 131 | { "I2A25", 3, 6 }, 132 | { "I2A2", 6, 9 }, 133 | { "I2A2", 9, 12 }, 134 | { "I2A2", 12, 15 }, 135 | { "I2A2", 15, 18 }, 136 | { "I2A2", 18, 21 }, 137 | { "I2A2", 21, 24 }, 138 | { "I2A2", 24, 27 }, 139 | { "I2A2", 27, 30 }, 140 | { "I2A2", 30, 33 }, 141 | { "I2A26", 33, 36 }, 142 | { "I2A27", 36, 39 }, 143 | { "I2A27", 39, 42 }, 144 | { "I2A28", 42, 45 }, 145 | { "I2A29", 45, 48 }, 146 | { "I2A30", 48, 51 }, 147 | { "I2A31", 51, 54 }, 148 | { "I2A32", 54, 57 }, 149 | { "I2A33", 57, 60 }, 150 | { "I2A34", 60, 63 }, 151 | { "I2A35", 63, 66 }, 152 | { "I2A27", 66, 69 }, 153 | { "I2A36", 69, 72 }, 154 | { "I2A2", 72, 75 }, 155 | { "I2A2", 75, 78 }, 156 | { "I2A37", 78, 81 }, 157 | { "I2A38", 81, 84 }, 158 | { "I2A2", 84, 87 }, 159 | { "I2A2", 87, 90 }, 160 | { "I2A2", 90, 93 }, 161 | { "I2A2", 93, 96 }, 162 | { "I2A2", 96, 99 }, 163 | { "I2A2", 99, 102 }, 164 | { "I2A38", 102, 105 }, 165 | { "I2A22", 105, 108 }, 166 | { "I2A39", 108, 111 }, 167 | }, 168 | { 169 | { "I2A40", 0, 3 }, 170 | { "I2A41", 3, 6 }, 171 | { "I2A42", 6, 9 }, 172 | { "I2A43", 9, 12 }, 173 | { "I2A40", 12, 15 }, 174 | { "I2A42", 15, 18 }, 175 | { "I2A44", 18, 21 }, 176 | { "I2A45", 21, 24 }, 177 | { "I2A46", 24, 27 }, 178 | { "I2A46", 27, 30 }, 179 | { "I2A46", 30, 33 }, 180 | { "I2A27", 33, 36 }, 181 | { "I2A27", 36, 39 }, 182 | { "I2A47", 39, 42 }, 183 | { "I2A48", 42, 45 }, 184 | { "I2A2", 45, 48 }, 185 | { "I2A2", 48, 51 }, 186 | { "I2A1", 51, 54 }, 187 | { "I2A2", 54, 57 }, 188 | { "I2A2", 57, 60 }, 189 | { "I2A49", 60, 63 }, 190 | { "I2A50", 63, 66 }, 191 | { "I2A47", 66, 69 }, 192 | { "I2A7", 69, 72 }, 193 | { "I2A51", 72, 75 }, 194 | { "I2A52", 75, 78 }, 195 | { "I2A52", 78, 81 }, 196 | { "I2A53", 81, 84 }, 197 | { "I2A54", 84, 87 }, 198 | { "I2A55", 87, 90 }, 199 | { "I2A56", 90, 93 }, 200 | { "I2A57", 93, 96 }, 201 | { "I2A2", 96, 99 }, 202 | { "I2A58", 99, 102 }, 203 | { "I2A59", 102, 105 }, 204 | { "I2A60", 105, 108 }, 205 | { "I2A61", 108, 111 }, 206 | }, 207 | { 208 | { "I2A62", 0, 3 }, 209 | { "I2A62", 3, 6 }, 210 | { "I2A63", 6, 9 }, 211 | { "I2A63", 9, 12 }, 212 | { "I2A63", 12, 15 }, 213 | { "I2A62", 15, 18 }, 214 | { "I2A64", 18, 21 }, 215 | { "I2A63", 21, 24 }, 216 | { "I2A64", 24, 27 }, 217 | { "I2A62", 27, 30 }, 218 | { "I2A65", 30, 33 }, 219 | { "I2A66", 33, 36 }, 220 | { "I2A67", 36, 39 }, 221 | { "I2A68", 39, 42 }, 222 | { "I2A69", 42, 45 }, 223 | { "I2A70", 45, 48 }, 224 | { "I2A2", 48, 51 }, 225 | { "I2A2", 51, 54 }, 226 | { "I2A71", 54, 57 }, 227 | { "I2A50", 57, 60 }, 228 | { "I2A50", 60, 63 }, 229 | { "I2A72", 63, 66 }, 230 | { "I2A73", 66, 69 }, 231 | { "I2A74", 69, 72 }, 232 | { "I2A75", 72, 75 }, 233 | { "I2A75", 75, 78 }, 234 | { "I2A76", 78, 81 }, 235 | { "I2A77", 81, 84 }, 236 | { "I2A50", 84, 87 }, 237 | { "I2A50", 87, 90 }, 238 | { "I2A78", 90, 93 }, 239 | { "I2A79", 93, 96 }, 240 | { "I2A80", 96, 99 }, 241 | { "I2A81", 99, 102 }, 242 | { "I2A82", 102, 105 }, 243 | { "I2A83", 105, 108 }, 244 | { "I2A84", 108, 111 }, 245 | }, 246 | { 247 | { "I2A83", 0, 3 }, 248 | { "I2A83", 3, 6 }, 249 | { "I2A85", 6, 9 }, 250 | { "I2A86", 9, 12 }, 251 | { "I2A87", 12, 15 }, 252 | { "I2A88", 15, 18 }, 253 | { "I2A87", 18, 21 }, 254 | { "I2A89", 21, 24 }, 255 | { "I2A90", 24, 27 }, 256 | { "I2A91", 27, 30 }, 257 | { "I2A92", 30, 33 }, 258 | { "I2A93", 33, 36 }, 259 | { "I2A94", 36, 39 }, 260 | { "I2A95", 39, 42 }, 261 | { "I2A96", 42, 45 }, 262 | { "I2A97", 45, 48 }, 263 | { "I2A98", 48, 51 }, 264 | { "I2A99", 51, 54 }, 265 | { "I2A100", 54, 57 }, 266 | { "I2A69", 57, 60 }, 267 | { "I2A101", 60, 63 }, 268 | { "I2A75", 63, 66 }, 269 | { "I2A102", 66, 69 }, 270 | { "I2A103", 69, 72 }, 271 | { "I2A104", 72, 75 }, 272 | { "I2A105", 75, 78 }, 273 | { "I2A50", 78, 81 }, 274 | { "I2A106", 81, 84 }, 275 | { "I2A50", 84, 87 }, 276 | { "I2A50", 87, 90 }, 277 | { "I2A50", 90, 93 }, 278 | { "I2A107", 93, 96 }, 279 | { "I2A50", 96, 99 }, 280 | { "I2A108", 99, 102 }, 281 | { "I2A83", 102, 105 }, 282 | { "I2A109", 105, 108 }, 283 | { "I2A109", 108, 111 }, 284 | }, 285 | { 286 | { "I2A98", 0, 3 }, 287 | { "I2A110", 3, 6 }, 288 | { "I2A98", 6, 9 }, 289 | { "I2A98", 9, 12 }, 290 | { "I2A111", 12, 15 }, 291 | { "I2A112", 15, 18 }, 292 | { "I2A113", 18, 21 }, 293 | { "I2A27", 21, 24 }, 294 | { "I2A27", 24, 27 }, 295 | { "I2A27", 27, 30 }, 296 | { "I2A27", 30, 33 }, 297 | { "I2A114", 33, 36 }, 298 | { "I2A75", 36, 39 }, 299 | { "I2A75", 39, 42 }, 300 | { "I2A115", 42, 45 }, 301 | { "I2A116", 45, 48 }, 302 | { "I2A117", 48, 51 }, 303 | { "I2A115", 51, 54 }, 304 | { "I2A118", 54, 57 }, 305 | { "I2A75", 57, 60 }, 306 | { "I2A119", 60, 63 }, 307 | { "I2A120", 63, 66 }, 308 | { "I2A50", 66, 69 }, 309 | { "I2A50", 69, 72 }, 310 | { "I2A50", 72, 75 }, 311 | { "I2A50", 75, 78 }, 312 | { "I2A50", 78, 81 }, 313 | { "I2A50", 81, 84 }, 314 | { "I2A50", 84, 87 }, 315 | { "I2A50", 87, 90 }, 316 | { "I2A50", 90, 93 }, 317 | { "I2A50", 93, 96 }, 318 | { "I2A50", 96, 99 }, 319 | { "I2A121", 99, 102 }, 320 | { "I2A122", 102, 105 }, 321 | { "I2A123", 105, 108 }, 322 | { "I2A110", 108, 111 }, 323 | }, 324 | { 325 | { "I2A98", 0, 3 }, 326 | { "I2A98", 3, 6 }, 327 | { "I2A98", 6, 9 }, 328 | { "I2A124", 9, 12 }, 329 | { "I2A125", 12, 15 }, 330 | { "I2A126", 15, 18 }, 331 | { "I2A27", 18, 21 }, 332 | { "I2A127", 21, 24 }, 333 | { "I2A128", 24, 27 }, 334 | { "I2A129", 27, 30 }, 335 | { "I2A130", 30, 33 }, 336 | { "I2A75", 33, 36 }, 337 | { "I2A75", 36, 39 }, 338 | { "I2A75", 39, 42 }, 339 | { "I2A131", 42, 45 }, 340 | { "I2A132", 45, 48 }, 341 | { "I2A75", 48, 51 }, 342 | { "I2A75", 51, 54 }, 343 | { "I2A75", 54, 57 }, 344 | { "I2A133", 57, 60 }, 345 | { "I2A134", 60, 63 }, 346 | { "I2A134", 63, 66 }, 347 | { "I2A134", 66, 69 }, 348 | { "I2A134", 69, 72 }, 349 | { "I2A135", 72, 75 }, 350 | { "I2A136", 75, 78 }, 351 | { "I2A50", 78, 81 }, 352 | { "I2A50", 81, 84 }, 353 | { "I2A137", 84, 87 }, 354 | { "I2A138", 87, 90 }, 355 | { "I2A139", 90, 93 }, 356 | { "I2A50", 93, 96 }, 357 | { "I2A140", 96, 99 }, 358 | { "I2A50", 99, 102 }, 359 | { "I2A141", 102, 105 }, 360 | { "I2A142", 105, 108 }, 361 | { "I2A143", 108, 111 }, 362 | }, 363 | { 364 | { "I2A98", 0, 3 }, 365 | { "I2A98", 3, 6 }, 366 | { "I2A144", 6, 9 }, 367 | { "I2A145", 9, 12 }, 368 | { "I2A146", 12, 15 }, 369 | { "I2A147", 15, 18 }, 370 | { "I2A50", 18, 21 }, 371 | { "I2A50", 21, 24 }, 372 | { "I2A50", 24, 27 }, 373 | { "I2A50", 27, 30 }, 374 | { "I2A148", 30, 33 }, 375 | { "I2A149", 33, 36 }, 376 | { "I2A150", 36, 39 }, 377 | { "I2A130", 39, 42 }, 378 | { "I2A75", 42, 45 }, 379 | { "I2A75", 45, 48 }, 380 | { "I2A75", 48, 51 }, 381 | { "I2A151", 51, 54 }, 382 | { "I2A152", 54, 57 }, 383 | { "I2A153", 57, 60 }, 384 | { "I2A154", 60, 63 }, 385 | { "I2A2", 63, 66 }, 386 | { "I2A155", 66, 69 }, 387 | { "I2A156", 69, 72 }, 388 | { "I2A157", 72, 75 }, 389 | { "I2A158", 75, 78 }, 390 | { "I2A50", 78, 81 }, 391 | { "I2A50", 81, 84 }, 392 | { "I2A50", 84, 87 }, 393 | { "I2A50", 87, 90 }, 394 | { "I2A50", 90, 93 }, 395 | { "I2A50", 93, 96 }, 396 | { "I2A50", 96, 99 }, 397 | { "I2A159", 99, 102 }, 398 | { "I2A50", 102, 105 }, 399 | { "I2A160", 105, 108 }, 400 | { "I2A161", 108, 111 }, 401 | }, 402 | { 403 | { "I2A98", 0, 3 }, 404 | { "I2A162", 3, 6 }, 405 | { "I2A163", 6, 9 }, 406 | { "I2A164", 9, 12 }, 407 | { "I2A50", 12, 15 }, 408 | { "I2A165", 15, 18 }, 409 | { "I2A50", 18, 21 }, 410 | { "I2A50", 21, 24 }, 411 | { "I2A50", 24, 27 }, 412 | { "I2A50", 27, 30 }, 413 | { "I2A50", 30, 33 }, 414 | { "I2A166", 33, 36 }, 415 | { "I2A134", 36, 39 }, 416 | { "I2A75", 39, 42 }, 417 | { "I2A75", 42, 45 }, 418 | { "I2A167", 45, 48 }, 419 | { "I2A168", 48, 51 }, 420 | { "I2A169", 51, 54 }, 421 | { "I2A170", 54, 57 }, 422 | { "I2A171", 57, 60 }, 423 | { "I2A1", 60, 63 }, 424 | { "I2A172", 63, 66 }, 425 | { "I2A173", 66, 69 }, 426 | { "I2A174", 69, 72 }, 427 | { "I2A75", 72, 75 }, 428 | { "I2A75", 75, 78 }, 429 | { "I2A175", 78, 81 }, 430 | { "I2A50", 81, 84 }, 431 | { "I2A50", 84, 87 }, 432 | { "I2A50", 87, 90 }, 433 | { "I2A50", 90, 93 }, 434 | { "I2A50", 93, 96 }, 435 | { "I2A176", 96, 99 }, 436 | { "I2A177", 99, 102 }, 437 | { "I2A178", 102, 105 }, 438 | { "I2A179", 105, 108 }, 439 | { "I2A180", 108, 111 }, 440 | }, 441 | { 442 | { "I2A98", 0, 3 }, 443 | { "I2A98", 3, 6 }, 444 | { "I2A181", 6, 9 }, 445 | { "I2A182", 9, 12 }, 446 | { "I2A183", 12, 15 }, 447 | { "I2A184", 15, 18 }, 448 | { "I2A50", 18, 21 }, 449 | { "I2A50", 21, 24 }, 450 | { "I2A185", 24, 27 }, 451 | { "I2A50", 27, 30 }, 452 | { "I2A50", 30, 33 }, 453 | { "I2A50", 33, 36 }, 454 | { "I2A186", 36, 39 }, 455 | { "I2A187", 39, 42 }, 456 | { "I2A188", 42, 45 }, 457 | { "I2A189", 45, 48 }, 458 | { "I2A190", 48, 51 }, 459 | { "I2A191", 51, 54 }, 460 | { "I2A192", 54, 57 }, 461 | { "I2A193", 57, 60 }, 462 | { "I2A194", 60, 63 }, 463 | { "I2A195", 63, 66 }, 464 | { "I2A196", 66, 69 }, 465 | { "I2A197", 69, 72 }, 466 | { "I2A198", 72, 75 }, 467 | { "I2A95", 75, 78 }, 468 | { "I2A50", 78, 81 }, 469 | { "I2A50", 81, 84 }, 470 | { "I2A199", 84, 87 }, 471 | { "I2A50", 87, 90 }, 472 | { "I2A50", 90, 93 }, 473 | { "I2A200", 93, 96 }, 474 | { "I2A201", 96, 99 }, 475 | { "I2A202", 99, 102 }, 476 | { "I2A203", 102, 105 }, 477 | { "I2A204", 105, 108 }, 478 | { "I2A204", 108, 111 }, 479 | }, 480 | } 481 | 482 | dashboard.section.header.val = { 483 | [[ ⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣀⣀⣀⣀⠀⡀⢀⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ]], 484 | [[ ⣶⣶⣶⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⣽⠃⠀⠀⠀⢼⠻⣿⣿⣟⣿⣿⣿⣿⣶⣶⣶⣶⣤⣤⣤⣤⣤ ]], 485 | [[ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏⠀⠀⠛⡶⢶⢺⠁⠀⠈⢿⣿⣿⣿⣿⣿⣿⣏⣿⣿⣿⣿⣿⣿⣿ ]], 486 | [[ ⣯⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⣤⠀⣀⣠⡛⣣⡀⠀⠈⢿⣿⣿⣻⣏⣿⣿⣿⣿⣿⣿⣟⣿⠿ ]], 487 | [[ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃⠀⠀⣳⣶⣿⣿⣷⣾⠱⠀⠀⠊⢿⠿⠿⢛⣽⣿⡿⢿⣿⣟⠿⠿⠿ ]], 488 | [[ ⠉⠉⠉⠛⠛⠛⠋⠛⠛⠛⣧⠀⡀⠀⠀⢿⣿⣿⡿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠁⠀⠀⠀⠀⠅⢀⢀⡀ ]], 489 | [[ ⠔⠄⢀⡀⠀⠀⠀⠄⠐⠸⠿⡀⠀⠀⠀⢘⣿⢷⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠀⠀⠰⣠⣇ ]], 490 | [[ ⣷⣆⣴⣮⢻⡲⡲⠀⠁⠀⠀⠀⠀⠀⠀⠹⡿⠘⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣀⡘⢷⣏ ]], 491 | [[ ⣿⣿⣿⣗⠿⢈⠁⡀⠀⠁⠀⠀⠀⠀⠀⠀⠉⠀⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠠⢀⠄⠀⠄⠈⢿⣮⢿ ]], 492 | [[ ⣿⣟⡿⣾⠀⠀⠀⠀⠀⠀⠀⢀⡤⠄⠀⠀⠀⠀⠸⠁⢠⣦⣤⢀⠀⠀⠀⠀⠀⠀⠀⠀⠐⠀⠈⣿⠀ ]], 493 | [[ ⣿⣿⠏⠁⢀⡇⠀⠀⠀⠀⠀⠀⡄⠀⠀⠀⠘⡏⣷⣵⡻⠃⠄⢴⣆⠀⠀⠀⠀⠀⠀⠀⠰⠀⣆⣷⣿ ]], 494 | [[ ⣿⡿⣻⠗⠀⢠⠀⠀⠀⠀⠀⠃⠀⠀⠀⠀⢠⣤⣄⢰⣶⢯⣤⡈⠋⠀⠀⠀⠀⠀⠀⠀⠀⠆⠀⣿⣼ ]], 495 | } 496 | 497 | dashboard.section.buttons.val = { 498 | -- dashboard.button("e", " > New file", ":ene startinsert "), 499 | dashboard.button("b", "λ > Browse files", ":Yazi"), 500 | dashboard.button("z", "λ > Browse Directories", ":Telescope zoxide list"), 501 | dashboard.button("f", "λ > Find file", ":Telescope find_files"), 502 | dashboard.button("r", "λ > Recent", ":Telescope oldfiles"), 503 | } 504 | 505 | alpha.setup(dashboard.opts) 506 | end, 507 | } 508 | -------------------------------------------------------------------------------- /lua/plugins/colorizer.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "norcalli/nvim-colorizer.lua", 3 | config = function() 4 | require("colorizer").setup({ 5 | "*", 6 | css = { rgb_fn = true }, 7 | }) 8 | end, 9 | } 10 | -------------------------------------------------------------------------------- /lua/plugins/comments.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "numToStr/Comment.nvim", 3 | } 4 | -------------------------------------------------------------------------------- /lua/plugins/completions.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- { 3 | -- "hrsh7th/cmp-nvim-lsp", 4 | -- }, 5 | { 6 | "kdheepak/cmp-latex-symbols", 7 | }, 8 | { 9 | "saghen/blink.cmp", 10 | dependencies = { 11 | { 12 | "L3MON4D3/LuaSnip", 13 | version = "v2.*", 14 | -- dependencies = { 15 | -- "saadparwaiz1/cmp_luasnip", 16 | -- { 17 | -- "rafamadriz/friendly-snippets", 18 | -- config = function() 19 | -- require('luasnip.loaders.from_vscode').lazy_load() 20 | -- end 21 | -- }, 22 | -- "onsails/lspkind.nvim", 23 | -- }, 24 | }, 25 | }, 26 | version = "1.*", 27 | 28 | ---@module 'blink.cmp' 29 | opts = { 30 | keymap = { 31 | [""] = { "select_next", "snippet_forward", "fallback" }, 32 | [""] = { "select_prev", "snippet_backward", "fallback" }, 33 | [""] = { "accept", "fallback" }, 34 | [""] = { "hide", "fallback" }, 35 | }, 36 | 37 | appearance = { 38 | nerd_font_variant = "mono", 39 | }, 40 | signature = { 41 | enabled = true, 42 | window = { 43 | show_documentation = false, 44 | }, 45 | }, 46 | completion = { 47 | trigger = { 48 | show_on_insert_on_trigger_character = false, 49 | show_on_accept_on_trigger_character = false, 50 | show_on_blocked_trigger_characters = { "{", "(", "}", ")" }, 51 | }, 52 | documentation = { 53 | auto_show = true, 54 | auto_show_delay_ms = 0, 55 | }, 56 | menu = { 57 | scrollbar = false, 58 | draw = { 59 | columns = { 60 | { "kind_icon" }, 61 | { "label", "label_description", gap = 1 }, 62 | { "kind", gap = 1 }, 63 | { "label_description", gap = 1 }, 64 | { "source_name", gap = 1 }, 65 | }, 66 | components = { 67 | kind_icon = { 68 | ellipsis = false, 69 | width = { fill = true }, 70 | text = function(ctx) 71 | local kind_icons = { 72 | Function = "λ", -- Lambda symbol for functions 73 | Method = "∂", -- Lambda symbol for methods 74 | Field = "󰀫", -- Lambda symbol for methods 75 | Variable = "󰀫", -- Lambda symbol for methods 76 | Property = "󰀫", -- Lambda symbol for methods 77 | Keyword = "k", -- Lambda symbol for methods 78 | Struct = "Π", -- Lambda symbol for methods 79 | Enum = "τ", -- Lambda symbol for methods 80 | EnumMember = "τ", -- Lambda symbol for methods 81 | Snippet = "⊂", 82 | Text = "τ", 83 | Module = "⌠", 84 | Constructor = "∑", 85 | } 86 | 87 | local icon = kind_icons[ctx.kind] 88 | if icon == nil then 89 | icon = ctx.kind_icon 90 | end 91 | return icon 92 | end, 93 | }, 94 | }, 95 | }, 96 | }, 97 | }, 98 | snippets = { 99 | preset = "luasnip", 100 | -- Function to use when expanding LSP provided snippets 101 | expand = function(snippet) 102 | vim.snippet.expand(snippet) 103 | end, 104 | -- Function to use when checking if a snippet is active 105 | active = function(filter) 106 | return vim.snippet.active(filter) 107 | end, 108 | -- Function to use when jumping between tab stops in a snippet, where direction can be negative or positive 109 | jump = function(direction) 110 | vim.snippet.jump(direction) 111 | end, 112 | }, 113 | sources = { 114 | default = { "lsp", "path", "snippets", "buffer" }, 115 | }, 116 | fuzzy = { implementation = "prefer_rust_with_warning" }, 117 | }, 118 | opts_extend = { "sources.default" }, 119 | }, 120 | -- { 121 | -- "hrsh7th/nvim-cmp", 122 | -- config = function() 123 | -- local lspkind = require("lspkind") 124 | -- local luasnip = require("luasnip") 125 | -- 126 | -- luasnip.add_snippets("markdown", require("snippets.notes")) 127 | -- luasnip.add_snippets("text", require("snippets.notes")) 128 | -- luasnip.add_snippets("tex", require("snippets.latex")) 129 | -- luasnip.add_snippets("zig", require("snippets.zig")) 130 | -- -- Set up nvim-cmp. 131 | -- local cmp_autopairs = require("nvim-autopairs.completion.cmp") 132 | -- local cmp = require("cmp") 133 | -- require("luasnip.loaders.from_vscode").lazy_load() 134 | -- 135 | -- cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) 136 | -- 137 | -- cmp.setup({ 138 | -- preselect = cmp.PreselectMode.None, 139 | -- snippet = { 140 | -- -- REQUIRED - you must specify a snippet engine 141 | -- expand = function(args) 142 | -- require("luasnip").lsp_expand(args.body) 143 | -- end, 144 | -- }, 145 | -- window = { 146 | -- completion = { border = "solid" }, 147 | -- documentation = { border = "solid" }, 148 | -- }, 149 | -- mapping = cmp.mapping.preset.insert({ 150 | -- [""] = cmp.mapping.scroll_docs(-4), 151 | -- [""] = cmp.mapping.scroll_docs(4), 152 | -- [""] = cmp.mapping.complete(), 153 | -- [""] = cmp.mapping.abort(), 154 | -- -- [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. 155 | -- [""] = cmp.mapping.confirm({ select = false }), 156 | -- 157 | -- [""] = cmp.mapping(function(fallback) 158 | -- if cmp.visible() then 159 | -- cmp.select_next_item() 160 | -- elseif luasnip.expand_or_jumpable() then 161 | -- luasnip.expand_or_jump() 162 | -- else 163 | -- fallback() 164 | -- end 165 | -- end, { "i", "s" }), 166 | -- 167 | -- [""] = cmp.mapping(function(fallback) 168 | -- if cmp.visible() then 169 | -- cmp.select_prev_item() 170 | -- elseif luasnip.jumpable(-1) then 171 | -- luasnip.jump(-1) 172 | -- else 173 | -- fallback() 174 | -- end 175 | -- end, { "i", "s" }), 176 | -- }), 177 | -- sources = cmp.config.sources({ 178 | -- { 179 | -- name = "nvim_lsp", 180 | -- entry_filter = function(entry, ctx) 181 | -- return require("cmp").lsp.CompletionItemKind.Snippet ~= entry:get_kind() 182 | -- end, 183 | -- }, 184 | -- { 185 | -- name = "luasnip", 186 | -- }, -- For luasnip users. 187 | -- { name = "nvim_lsp_signature_help" }, -- function arg popups while typing 188 | -- }, { 189 | -- { name = "buffer" }, 190 | -- -- { name = "latex_symbols" }, 191 | -- }), 192 | -- formatting = { 193 | -- fields = { "kind", "abbr", "menu" }, 194 | -- format = function(entry, vim_item) 195 | -- local kind_icons = { 196 | -- Function = "λ", -- Lambda symbol for functions 197 | -- Method = "∂", -- Lambda symbol for methods 198 | -- Field = "󰀫", -- Lambda symbol for methods 199 | -- Property = "󰀫", -- Lambda symbol for methods 200 | -- Keyword = "k", -- Lambda symbol for methods 201 | -- Struct = "π", -- Lambda symbol for methods 202 | -- Struct = "Π", -- Lambda symbol for methods 203 | -- Enum = "τ", -- Lambda symbol for methods 204 | -- EnumMember = "τ", -- Lambda symbol for methods 205 | -- Snippet = "⊂", 206 | -- Text = "τ", 207 | -- Module = "⌠", 208 | -- } 209 | -- 210 | -- local kind = lspkind.cmp_format({ 211 | -- mode = "symbol_text", 212 | -- 213 | -- symbol_map = kind_icons, -- Override default symbols 214 | -- })(entry, vim_item) 215 | -- local strings = vim.split(kind.kind, "%s", { trimempty = true }) 216 | -- kind.kind = " " .. (strings[1] or "") .. " " 217 | -- kind.menu = " " .. (strings[2] or "") .. "" 218 | -- 219 | -- return kind 220 | -- end, 221 | -- }, 222 | -- }) 223 | -- end, 224 | -- }, 225 | } 226 | -------------------------------------------------------------------------------- /lua/plugins/conform.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "stevearc/conform.nvim", 3 | config = function() 4 | vim.g.disable_autoformat = false 5 | require("conform").setup({ 6 | formatters_by_ft = { 7 | purescript = { "purstidy", stop_after_first = true }, 8 | lua = { "stylua", stop_after_first = true }, 9 | ocaml = { "ocamlformat", stop_after_first = true }, 10 | python = { "black" }, 11 | rust = { "rustfmt" }, 12 | javascript = { "prettier", stop_after_first = true }, 13 | javascriptreact = { "prettier", stop_after_first = true }, 14 | typescript = { "prettier", stop_after_first = true }, 15 | typescriptreact = { "prettier", stop_after_first = true }, 16 | astro = { "astro", stop_after_first = true }, 17 | go = { "gofumpt", "golines", "goimports-reviser" }, 18 | c = { "clang_format" }, 19 | cpp = { "clang_format" }, 20 | haskell = { "ormolu" }, 21 | yaml = { "yamlfmt" }, 22 | html = { "prettier" }, 23 | json = { "prettier" }, 24 | markdown = { "prettier" }, 25 | gleam = { "gleam" }, 26 | asm = { "asmfmt" }, 27 | css = { "prettier", stop_after_first = true }, 28 | }, 29 | format_on_save = function(bufnr) 30 | if vim.g.disable_autoformat then 31 | return 32 | end 33 | return { 34 | timeout_ms = 500, 35 | lsp_format = "fallback", 36 | } 37 | end, 38 | }) 39 | 40 | vim.api.nvim_create_autocmd("BufWritePre", { 41 | pattern = "*", 42 | callback = function(args) 43 | if vim.g.disable_autoformat then 44 | return 45 | end 46 | require("conform").format({ bufnr = args.buf }) 47 | end, 48 | }) 49 | end, 50 | } 51 | -------------------------------------------------------------------------------- /lua/plugins/cursor.lua: -------------------------------------------------------------------------------- 1 | return {} 2 | -- return { 3 | -- "sphamba/smear-cursor.nvim", 4 | -- opts = { 5 | -- enabled = true, 6 | -- smear_between_buffers = false, 7 | -- stiffness = 0.9, 8 | -- trailing_stiffness = 0.8, 9 | -- distance_stop_animating = 0.3, 10 | -- }, 11 | -- } 12 | -------------------------------------------------------------------------------- /lua/plugins/fidget.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "j-hui/fidget.nvim", 3 | opts = { 4 | -- options 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /lua/plugins/flash.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "folke/flash.nvim", 3 | event = "VeryLazy", 4 | opts = {}, 5 | -- stylua: ignore 6 | keys = { 7 | { "zk", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, 8 | { "Zk", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, 9 | { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, 10 | { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, 11 | { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, 12 | }, 13 | } 14 | -------------------------------------------------------------------------------- /lua/plugins/floatingtodo.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "vimichael/floatingtodo.nvim", 3 | config = function() 4 | require("floatingtodo").setup({ 5 | target_file = "~/notes/todo.md", 6 | width = 0.9, 7 | position = "center", 8 | }) 9 | vim.keymap.set("n", "td", ":Td", { silent = true }) 10 | end 11 | } 12 | -------------------------------------------------------------------------------- /lua/plugins/fmt_utils.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "Wansmer/treesj", 4 | keys = { "m", "j", "s" }, 5 | dependencies = { "nvim-treesitter/nvim-treesitter" }, 6 | config = function() 7 | require("treesj").setup({}) 8 | end, 9 | }, 10 | { 11 | "windwp/nvim-autopairs", 12 | event = "InsertEnter", 13 | config = function() 14 | local npairs = require("nvim-autopairs") 15 | npairs.setup({ 16 | enable_check_bracket_line = false, 17 | }) 18 | end, 19 | opts = {}, 20 | }, 21 | { 22 | "echasnovski/mini.surround", 23 | opts = { 24 | custom_surroundings = nil, 25 | highlight_duration = 500, 26 | mappings = { 27 | add = "sa", -- Add surrounding in Normal and Visual modes 28 | delete = "sd", -- Delete surrounding 29 | find = "sf", -- Find surrounding (to the right) 30 | find_left = "sF", -- Find surrounding (to the left) 31 | highlight = "sh", -- Highlight surrounding 32 | replace = "sr", -- Replace surrounding 33 | update_n_lines = "sn", -- Update `n_lines` 34 | 35 | suffix_last = "l", -- Suffix to search with "prev" method 36 | suffix_next = "n", -- Suffix to search with "next" method 37 | }, 38 | n_lines = 20, 39 | respect_selection_type = false, 40 | search_method = "cover", 41 | silent = false, 42 | }, 43 | }, 44 | } 45 | -------------------------------------------------------------------------------- /lua/plugins/image.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "vhyrro/luarocks.nvim", 4 | priority = 1001, -- this plugin needs to run before anything else 5 | opts = { 6 | rocks = { "magick" }, 7 | }, 8 | }, 9 | { 10 | "3rd/image.nvim", 11 | dependencies = { "luarocks.nvim" }, 12 | config = function() 13 | require("image").setup({ 14 | integrations = { 15 | 16 | markdown = { 17 | enabled = true, 18 | -- only_render_image_at_cursor = true, 19 | filetypes = { "markdown" }, 20 | clear_in_insert_mode = true, 21 | only_render_image_at_cursor = true, 22 | -- only_render_image_at_cursor_mode = "popup", 23 | }, 24 | }, 25 | max_width_window_percentage = nil, 26 | max_height_window_percentage = 50, 27 | window_overlap_clear_enabled = false, -- toggles images when windows are overlapped 28 | window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "" }, 29 | editor_only_render_when_focused = false, -- auto show/hide images when the editor gains/looses focus 30 | tmux_show_only_in_active_window = true, -- auto show/hide images in the correct Tmux window (needs visual-activity off) 31 | }) 32 | end, 33 | }, 34 | } 35 | -------------------------------------------------------------------------------- /lua/plugins/lspconfig.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "williamboman/mason.nvim", 4 | config = function() 5 | require("mason").setup({ 6 | PATH = "prepend", 7 | }) 8 | end, 9 | }, 10 | { 11 | "williamboman/mason-lspconfig.nvim", 12 | config = function() 13 | require("mason-lspconfig").setup({ 14 | ensure_installed = { 15 | "fortls", 16 | -- "nil_ls", 17 | "bashls", 18 | "omnisharp", 19 | "cmake", 20 | "lua_ls", 21 | "rust_analyzer", 22 | "gopls", 23 | "templ", 24 | "html", 25 | "cssls", 26 | "emmet_language_server", 27 | "htmx", 28 | "tailwindcss", 29 | "ts_ls", 30 | "astro", 31 | "ols", 32 | -- "gdscript", 33 | -- "tsserver", 34 | "pylsp", 35 | "clangd", 36 | "prismals", 37 | "yamlls", 38 | "jsonls", 39 | "eslint", 40 | -- "hls", 41 | -- "zls", 42 | "marksman", 43 | "sqlls", 44 | "wgsl_analyzer", 45 | "texlab", 46 | "intelephense", 47 | "nim_langserver", 48 | }, 49 | }) 50 | end, 51 | }, 52 | { 53 | "neovim/nvim-lspconfig", 54 | dependencies = { "saghen/blink.cmp" }, 55 | config = function() 56 | -- local capabilities = require("cmp_nvim_lsp").default_capabilities() 57 | local capabilities = require('blink.cmp').get_lsp_capabilities() 58 | local lspconfig = require("lspconfig") 59 | local configs = require("lspconfig.configs") 60 | 61 | lspconfig.cmake.setup({ 62 | capabilities = capabilities, 63 | }) 64 | lspconfig.fortls.setup({ 65 | capabilities = capabilities, 66 | root_dir = require("lspconfig").util.root_pattern("*.f90"), 67 | }) 68 | lspconfig.purescriptls.setup({ 69 | capabilities = capabilities, 70 | filetypes = { "purescript" }, 71 | settings = { 72 | purescript = { 73 | addSpagoSources = true, -- e.g. any purescript language-server config here 74 | }, 75 | }, 76 | flags = { 77 | debounce_text_changes = 150, 78 | }, 79 | }) 80 | lspconfig.ols.setup({ 81 | capabilities = capabilities, 82 | root_dir = require("lspconfig").util.root_pattern("*.odin"), 83 | }) 84 | lspconfig.ocamllsp.setup({ 85 | capabilities = capabilities, 86 | cmd = { "ocamllsp", "--stdio" }, 87 | filetypes = { "ocaml", "reason" }, 88 | root_dir = require("lspconfig").util.root_pattern("*.opam", "esy.json", "package.json"), 89 | }) 90 | if not configs.roc_ls then 91 | configs.roc_ls = { 92 | default_config = { 93 | cmd = { "roc_language_server", "--stdio" }, 94 | capabilties = capabilities, 95 | filetypes = { 96 | "roc", 97 | }, 98 | single_file_support = true, 99 | }, 100 | } 101 | end 102 | lspconfig.roc_ls.setup({ 103 | capabilities = capabilities, 104 | }) 105 | lspconfig.gdscript.setup({ 106 | capabilities = capabilities, 107 | filetypes = { "gd", "gdscript", "gdscript3" }, 108 | }) 109 | lspconfig.astro.setup({ 110 | capabilities = capabilities, 111 | }) 112 | lspconfig.nil_ls.setup({ 113 | capabilities = capabilities, 114 | }) 115 | lspconfig.sqlls.setup({ 116 | capabilities = capabilities, 117 | }) 118 | lspconfig.intelephense.setup({ 119 | capabilities = capabilities, 120 | }) 121 | lspconfig.texlab.setup({ 122 | capabilities = capabilities, 123 | }) 124 | lspconfig.zls.setup({ 125 | capabilities = capabilities, 126 | cmd = { "zls" }, 127 | }) 128 | lspconfig.hls.setup({ 129 | capabilities = capabilities, 130 | single_file_support = true, 131 | }) 132 | lspconfig.bashls.setup({ 133 | capabilities = capabilities, 134 | }) 135 | lspconfig.lua_ls.setup({ 136 | capabilities = capabilities, 137 | -- cmd = { "lua_ls" }, 138 | settings = { 139 | Lua = { 140 | diagnostics = { 141 | globals = { "vim" }, -- Recognize 'vim' as a global variable 142 | }, 143 | workspace = { 144 | library = { 145 | vim.api.nvim_get_runtime_file("", true), 146 | "${3rd}/love2d/library" 147 | }, -- Include Neovim runtime files 148 | }, 149 | telemetry = { 150 | enable = false, 151 | }, 152 | }, 153 | }, 154 | }) 155 | lspconfig.wgsl_analyzer.setup({ 156 | capabilities = capabilities, 157 | }) 158 | lspconfig.jsonls.setup({ 159 | capabilities = capabilities, 160 | }) 161 | lspconfig.gopls.setup({ 162 | capabilities = capabilities, 163 | }) 164 | lspconfig.cssls.setup({ 165 | capabilities = capabilities, 166 | }) 167 | lspconfig.prismals.setup({ 168 | capabilities = capabilities, 169 | }) 170 | lspconfig.yamlls.setup({ 171 | capabilities = capabilities, 172 | }) 173 | lspconfig.html.setup({ 174 | capabilities = capabilities, 175 | filetypes = { 176 | "templ", 177 | "html", 178 | "php", 179 | "css", 180 | "javascriptreact", 181 | "typescriptreact", 182 | "javascript", 183 | "typescript", 184 | "jsx", 185 | "tsx", 186 | }, 187 | }) 188 | lspconfig.htmx.setup({ 189 | capabilities = capabilities, 190 | filetypes = { "html", "templ" }, 191 | }) 192 | lspconfig.emmet_language_server.setup({ 193 | capabilities = capabilities, 194 | filetypes = { 195 | "templ", 196 | "html", 197 | "css", 198 | "php", 199 | "javascriptreact", 200 | "typescriptreact", 201 | "javascript", 202 | "typescript", 203 | "jsx", 204 | "tsx", 205 | }, 206 | }) 207 | -- lspconfig.tailwindcss.setup({ 208 | -- capabilities = capabilities, 209 | -- filetypes = { 210 | -- "templ", 211 | -- "html", 212 | -- "css", 213 | -- "javascriptreact", 214 | -- "typescriptreact", 215 | -- "javascript", 216 | -- "typescript", 217 | -- "jsx", 218 | -- "tsx", 219 | -- }, 220 | -- root_dir = require("lspconfig").util.root_pattern( 221 | -- "tailwind.config.js", 222 | -- "tailwind.config.cjs", 223 | -- "tailwind.config.mjs", 224 | -- "tailwind.config.ts", 225 | -- "postcss.config.js", 226 | -- "postcss.config.cjs", 227 | -- "postcss.config.mjs", 228 | -- "postcss.config.ts", 229 | -- "package.json", 230 | -- "node_modules", 231 | -- ".git" 232 | -- ), 233 | -- }) 234 | lspconfig.templ.setup({ 235 | capabilities = capabilities, 236 | filetypes = { "templ" }, 237 | }) 238 | 239 | if not configs.ts_ls then 240 | configs.ts_ls = { 241 | default_config = { 242 | cmd = { "typescript-language-server", "--stdio" }, 243 | capabilties = capabilities, 244 | filetypes = { 245 | "javascript", 246 | "javascriptreact", 247 | "typescript", 248 | "typescriptreact", 249 | "html", 250 | }, 251 | root_dir = require("lspconfig").util.root_pattern("package.json", "tsconfig.json", ".git"), 252 | single_file_support = true, 253 | }, 254 | } 255 | end 256 | lspconfig.ts_ls.setup({ 257 | capabilties = capabilities, 258 | cmd = { "typescript-language-server", "--stdio" }, 259 | capabilties = capabilities, 260 | filetypes = { 261 | "javascript", 262 | "javascriptreact", 263 | "typescript", 264 | "typescriptreact", 265 | "html", 266 | }, 267 | root_dir = require("lspconfig").util.root_pattern("package.json", "tsconfig.json", ".git"), 268 | single_file_support = true, 269 | }) 270 | lspconfig.eslint.setup({ 271 | capabilties = capabilities, 272 | }) 273 | 274 | require("lspconfig").clangd.setup({ 275 | cmd = { 276 | "clangd", 277 | "--background-index", 278 | "--pch-storage=memory", 279 | "--all-scopes-completion", 280 | "--pretty", 281 | "--header-insertion=never", 282 | "-j=4", 283 | "--inlay-hints", 284 | "--header-insertion-decorators", 285 | "--function-arg-placeholders", 286 | "--completion-style=detailed", 287 | }, 288 | filetypes = { "c", "cpp", "objc", "objcpp" }, 289 | root_dir = require("lspconfig").util.root_pattern("src"), 290 | init_option = { fallbackFlags = { "-std=c++2a" } }, 291 | capabilities = capabilities, 292 | single_file_support = true, 293 | }) 294 | 295 | function get_python_path() 296 | -- Check if there's an active virtual environment 297 | local venv_path = os.getenv("VIRTUAL_ENV") 298 | if venv_path then 299 | return venv_path .. "/bin/python3" 300 | else 301 | -- get os name 302 | local os_name = require("utils").get_os() 303 | -- get os interpreter path 304 | if os_name == "windows" then 305 | return "C:/python312" 306 | elseif os_name == "linux" then 307 | return "/usr/bin/python3" 308 | else 309 | return "/Library/Frameworks/Python.framework/Versions/3.11/bin/python3" 310 | end 311 | -- Fallback to global Python interpreter 312 | end 313 | end 314 | 315 | lspconfig.pylsp.setup({ 316 | capabilties = capabilities, 317 | settings = { 318 | python = { 319 | pythonPath = get_python_path(), 320 | }, 321 | }, 322 | }) 323 | 324 | lspconfig.marksman.setup({ 325 | capabilties = capabilities, 326 | }) 327 | lspconfig.gleam.setup({ 328 | capabilties = capabilities, 329 | }) 330 | lspconfig.nim_langserver.setup({ 331 | capabilties = capabilities, 332 | }) 333 | lspconfig.omnisharp.setup({ 334 | capabilties = capabilities, 335 | cmd = { "OmniSharp" }, 336 | }) 337 | end, 338 | }, 339 | } 340 | -------------------------------------------------------------------------------- /lua/plugins/markview.lua: -------------------------------------------------------------------------------- 1 | return { 2 | } 3 | 4 | -- cant figure out how to disable list rendering :( 5 | 6 | -- return { 7 | -- "OXY2DEV/markview.nvim", 8 | -- opts = { 9 | -- markdown = { 10 | -- list_items = { 11 | -- enable = false, 12 | -- shift_width = function(buffer, item) 13 | -- --- Reduces the `indent` by 1 level. 14 | -- local parent_indnet = math.max(1, item.indent - vim.bo[buffer].shiftwidth) 15 | -- 16 | -- return item.indent * (1 / (parent_indnet * 2)) 17 | -- end, 18 | -- marker_minus = { 19 | -- add_padding = function(_, item) 20 | -- return item.indent > 1 21 | -- end, 22 | -- }, 23 | -- }, 24 | -- }, 25 | -- }, 26 | -- } 27 | -------------------------------------------------------------------------------- /lua/plugins/mdmath.lua: -------------------------------------------------------------------------------- 1 | return {} 2 | -- return { 3 | -- -- dir = "~/dotfiles/.config/nvim/lua/plugins/mdmath.nvim", 4 | -- "Thiago4532/mdmath.nvim", 5 | -- dependencies = { 6 | -- "nvim-treesitter/nvim-treesitter", 7 | -- }, 8 | -- opts = { 9 | -- -- Filetypes that the plugin will be enabled by default. 10 | -- filetypes = { "markdown" }, 11 | -- -- Color of the equation, can be a highlight group or a hex color. 12 | -- -- Examples: 'Normal', '#ff0000' 13 | -- foreground = "Normal", 14 | -- -- Hide the text when the equation is under the cursor. 15 | -- anticonceal = true, 16 | -- -- Hide the text when in the Insert Mode. 17 | -- hide_on_insert = true, 18 | -- -- Enable dynamic size for non-inline equations. 19 | -- dynamic = true, 20 | -- -- Configure the scale of dynamic-rendered equations. 21 | -- dynamic_scale = 1.0, 22 | -- -- Interval between updates (milliseconds). 23 | -- update_interval = 400, 24 | -- 25 | -- -- Internal scale of the equation images, increase to prevent blurry images when increasing terminal 26 | -- -- font, high values may produce aliased images. 27 | -- -- WARNING: This do not affect how the images are displayed, only how many pixels are used to render them. 28 | -- -- See `dynamic_scale` to modify the displayed size. 29 | -- internal_scale = 1.0, 30 | -- }, 31 | -- } 32 | -------------------------------------------------------------------------------- /lua/plugins/mdprev.lua: -------------------------------------------------------------------------------- 1 | return {} 2 | -- return { 3 | -- "iamcco/markdown-preview.nvim", 4 | -- cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, 5 | -- build = "cd app; yarn install", 6 | -- init = function() 7 | -- vim.g.mkdp_filetypes = { "markdown" } 8 | -- vim.g.mkdp_browser = "/Applications/Brave Browser.app" 9 | -- end, 10 | -- ft = { "markdown" }, 11 | -- config = function() 12 | -- vim.keymap.set("n", "mdn", ":MarkdownPreview") 13 | -- vim.keymap.set("n", "mds", ":MarkdownPreviewStop") 14 | -- 15 | -- vim.g.mkdp_markdown_css = "/Users/michaelwilliams/dotfiles/.config/nvim/assets/md.css" 16 | -- vim.g.mkdp_highlight_css = "/Users/michaelwilliams/dotfiles/.config/nvim/assets/mdhl.css" 17 | -- end, 18 | -- } 19 | -------------------------------------------------------------------------------- /lua/plugins/minimisc.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "echasnovski/mini.misc", 3 | config = function() 4 | local misc = require("mini.misc") 5 | misc.setup({}) 6 | 7 | misc.setup_termbg_sync() 8 | end 9 | } 10 | -------------------------------------------------------------------------------- /lua/plugins/not_sure.lua: -------------------------------------------------------------------------------- 1 | return {} 2 | 3 | 4 | -- return { 5 | -- { 6 | -- "nvim-neo-tree/neo-tree.nvim", 7 | -- branch = "v3.x", 8 | -- dependencies = { 9 | -- "nvim-lua/plenary.nvim", 10 | -- "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended 11 | -- "MunifTanjim/nui.nvim", 12 | -- -- {"3rd/image.nvim", opts = {}}, -- Optional image support in preview window: See `# Preview Mode` for more information 13 | -- }, 14 | -- lazy = false, -- neo-tree will lazily load itself 15 | -- ---@module "neo-tree" 16 | -- ---@type neotree.Config? 17 | -- opts = { 18 | -- -- fill any relevant options here 19 | -- }, 20 | -- }, 21 | -- { 22 | -- "stevearc/oil.nvim", 23 | -- opts = {} 24 | -- } 25 | -- } 26 | -------------------------------------------------------------------------------- /lua/plugins/rust.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "mrcjkb/rustaceanvim", 3 | version = "^6", 4 | lazy = false, 5 | } 6 | -------------------------------------------------------------------------------- /lua/plugins/screenkey.lua: -------------------------------------------------------------------------------- 1 | local yt = false 2 | 3 | if yt then 4 | return { 5 | "NStefan002/screenkey.nvim", 6 | lazy = false, 7 | version = "*", -- or branch = "dev", to use the latest commit 8 | config = function() 9 | vim.cmd("Screenkey") 10 | end 11 | } 12 | else 13 | return {} 14 | end 15 | -------------------------------------------------------------------------------- /lua/plugins/statusline.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-lualine/lualine.nvim", 3 | dependencies = { "echasnovski/mini.icons" }, 4 | config = function() 5 | require("lualine").setup({ 6 | options = { 7 | icons_enabled = false, 8 | theme = "auto", 9 | component_separators = "", 10 | section_separators = "", 11 | }, 12 | 13 | sections = { 14 | lualine_a = { "mode" }, 15 | lualine_b = { "branch" }, 16 | lualine_c = { "filename" }, 17 | lualine_x = { 18 | function() 19 | local encoding = vim.o.fileencoding 20 | if encoding == "" then 21 | return vim.bo.fileformat .. " :: " .. vim.bo.filetype 22 | else 23 | return encoding .. " :: " .. vim.bo.fileformat .. " :: " .. vim.bo.filetype 24 | end 25 | end, 26 | }, 27 | lualine_y = { "progress" }, 28 | lualine_z = { "location" }, 29 | }, 30 | }) 31 | end, 32 | } 33 | -------------------------------------------------------------------------------- /lua/plugins/tabout.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "abecodes/tabout.nvim", 4 | lazy = false, 5 | config = function() 6 | require("tabout").setup({ 7 | tabkey = "", -- key to trigger tabout, set to an empty string to disable 8 | backwards_tabkey = "", -- key to trigger backwards tabout, set to an empty string to disable 9 | act_as_tab = true, -- shift content if tab out is not possible 10 | act_as_shift_tab = false, -- reverse shift content if tab out is not possible (if your keyboard/terminal supports ) 11 | default_tab = "", -- shift default action (only at the beginning of a line, otherwise is used) 12 | default_shift_tab = "", -- reverse shift default action, 13 | enable_backwards = true, -- well ... 14 | completion = false, -- if the tabkey is used in a completion pum 15 | tabouts = { 16 | { open = "'", close = "'" }, 17 | { open = '"', close = '"' }, 18 | { open = "`", close = "`" }, 19 | { open = "(", close = ")" }, 20 | { open = "[", close = "]" }, 21 | -- { open = "{", close = "}" }, 22 | }, 23 | ignore_beginning = true, --[[ if the cursor is at the beginning of a filled element it will rather tab out than shift the content ]] 24 | exclude = {}, -- tabout will ignore these filetypes 25 | }) 26 | end, 27 | dependencies = { -- These are optional 28 | "nvim-treesitter/nvim-treesitter", 29 | "L3MON4D3/LuaSnip", 30 | "hrsh7th/nvim-cmp", 31 | }, 32 | opt = true, -- Set this to true if the plugin is optional 33 | event = "InsertCharPre", -- Set the event to 'InsertCharPre' for better compatibility 34 | priority = 1000, 35 | }, 36 | { 37 | "L3MON4D3/LuaSnip", 38 | keys = function() 39 | -- Disable default tab keybinding in LuaSnip 40 | return {} 41 | end, 42 | }, 43 | } 44 | -------------------------------------------------------------------------------- /lua/plugins/telescope.lua: -------------------------------------------------------------------------------- 1 | -- telescope.nvim 2 | return { 3 | { 4 | "nvim-telescope/telescope.nvim", 5 | tag = "0.1.8", 6 | -- branch = "0.1.x", 7 | dependencies = { 8 | "nvim-lua/plenary.nvim", 9 | { 10 | "nvim-telescope/telescope-fzf-native.nvim", 11 | build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release", 12 | }, 13 | }, 14 | config = function() 15 | require("telescope").setup({ 16 | extensions = { 17 | fzf = { 18 | fuzzy = true, -- false will only do exact matching 19 | override_generic_sorter = true, -- override the generic sorter 20 | override_file_sorter = true, -- override the file sorter 21 | case_mode = "smart_case", 22 | }, 23 | }, 24 | pickers = { 25 | colorscheme = { 26 | enable_preview = true, 27 | }, 28 | find_files = { 29 | hidden = true, 30 | find_command = { 31 | "rg", 32 | "--files", 33 | "--glob", 34 | "!{.git/*,.next/*,.svelte-kit/*,target/*,node_modules/*}", 35 | "--path-separator", 36 | "/", 37 | }, 38 | }, 39 | }, 40 | }) 41 | 42 | require("telescope").load_extension("fzf") 43 | require("telescope").load_extension("zoxide") 44 | -- telescope setup 45 | local builtin = require("telescope.builtin") 46 | 47 | vim.keymap.set( 48 | "n", 49 | "jk", 50 | "lua require'telescope.builtin'.find_files({ find_command = {'rg', '--files', '--hidden', '-g', '!.git' }})", 51 | {} 52 | ) 53 | vim.keymap.set("n", "fb", ":Telescope file_browser", {}) 54 | vim.keymap.set("n", "fg", builtin.live_grep, {}) 55 | vim.keymap.set("n", "fd", builtin.diagnostics, {}) 56 | vim.keymap.set("n", "ds", builtin.lsp_document_symbols, {}) 57 | vim.keymap.set("n", "ws", builtin.lsp_workspace_symbols, {}) 58 | vim.keymap.set("n", "fz", ":Telescope zoxide list", {}) 59 | vim.keymap.set("n", "fv", builtin.help_tags, {}) 60 | end, 61 | }, 62 | { 63 | "jvgrootveld/telescope-zoxide", 64 | config = function() end, 65 | }, 66 | { 67 | "nvim-telescope/telescope-ui-select.nvim", 68 | config = function() 69 | require("telescope").setup({ 70 | extensions = { 71 | ["ui-select"] = { 72 | require("telescope.themes").get_dropdown({ 73 | -- even more opts 74 | }), 75 | }, 76 | }, 77 | }) 78 | -- To get ui-select loaded and working with telescope, you need to call 79 | -- load_extension, somewhere after setup function: 80 | require("telescope").load_extension("ui-select") 81 | end, 82 | }, 83 | } 84 | -------------------------------------------------------------------------------- /lua/plugins/textobjects.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-treesitter/nvim-treesitter-textobjects", 3 | dependencies = { "nvim-treesitter" }, 4 | config = function() 5 | require("nvim-treesitter.configs").setup({ 6 | textobjects = { 7 | move = { 8 | enable = true, 9 | set_jumps = true, 10 | goto_next_start = { 11 | ["[f"] = "@function.outer", 12 | ["]["] = "@class.outer", 13 | }, 14 | goto_previous_start = { 15 | ["]f"] = "@function.outer", 16 | ["[["] = "@class.outer", 17 | }, 18 | goto_previous_end = { 19 | ["[F"] = "@function.outer", 20 | ["[]"] = "@class.outer", 21 | }, 22 | }, 23 | select = { 24 | enable = true, 25 | 26 | -- Automatically jump forward to textobj, similar to targets.vim 27 | lookahead = true, 28 | 29 | keymaps = { 30 | -- You can use the capture groups defined in textobjects.scm 31 | ["af"] = "@function.outer", 32 | ["if"] = "@function.inner", 33 | -- You can optionally set descriptions to the mappings (used in the desc parameter of 34 | -- nvim_buf_set_keymap) which plugins like which-key display 35 | ["ic"] = { query = "@class.inner", desc = "Select inner part of a class region" }, 36 | ["ac"] = { query = "@class.outer", desc = "Select outer part of a class region" }, 37 | -- You can also use captures from other query groups like `locals.scm` 38 | ["as"] = { query = "@local.scope", query_group = "locals", desc = "Select language scope" }, 39 | }, 40 | -- You can choose the select mode (default is charwise 'v') 41 | -- 42 | -- Can also be a function which gets passed a table with the keys 43 | -- * query_string: eg '@function.inner' 44 | -- * method: eg 'v' or 'o' 45 | -- and should return the mode ('v', 'V', or '') or a table 46 | -- mapping query_strings to modes. 47 | selection_modes = { 48 | ["@parameter.outer"] = "v", -- charwise 49 | ["@function.outer"] = "V", -- linewise 50 | ["@class.outer"] = "", -- blockwise 51 | }, 52 | -- If you set this to `true` (default is `false`) then any textobject is 53 | -- extended to include preceding or succeeding whitespace. Succeeding 54 | -- whitespace has priority in order to act similarly to eg the built-in 55 | -- `ap`. 56 | -- 57 | -- Can also be a function which gets passed a table with the keys 58 | -- * query_string: eg '@function.inner' 59 | -- * selection_mode: eg 'v' 60 | -- and should return true or false 61 | include_surrounding_whitespace = true, 62 | }, 63 | }, 64 | }) 65 | end, 66 | } 67 | -------------------------------------------------------------------------------- /lua/plugins/theme.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "vim-scripts/newsprint.vim" 4 | }, 5 | { 6 | "gbprod/nord.nvim" 7 | }, 8 | { 9 | "slugbyte/lackluster.nvim", 10 | }, 11 | { 12 | "vim-scripts/zenesque.vim", 13 | }, 14 | { 15 | "jaredgorski/fogbell.vim", 16 | }, 17 | -- Using lazy.nvim 18 | -- { 19 | -- "metalelf0/black-metal-theme-neovim", 20 | -- lazy = false, 21 | -- priority = 1000, 22 | -- config = function() 23 | -- require("black-metal").setup({ 24 | -- theme = "taake", 25 | -- code_style = { 26 | -- comments = "none", 27 | -- conditionals = "none", 28 | -- functions = "none", 29 | -- keywords = "none", 30 | -- headings = "bold", -- Markdown headings 31 | -- operators = "none", 32 | -- keyword_return = "none", 33 | -- strings = "none", 34 | -- variables = "none", 35 | -- }, 36 | -- }) 37 | -- require("black-metal").load() 38 | -- end, 39 | -- }, 40 | { 41 | "oahlen/iceberg.nvim", 42 | }, 43 | { 44 | "sainnhe/gruvbox-material", 45 | config = function() 46 | vim.g.gruvbox_material_background = "hard" 47 | end, 48 | }, 49 | { 50 | "Skardyy/makurai-nvim", 51 | }, 52 | { 53 | "blazkowolf/gruber-darker.nvim", 54 | opts = { 55 | bold = false, 56 | }, 57 | }, 58 | { 59 | "zenbones-theme/zenbones.nvim", 60 | dependencies = "rktjmp/lush.nvim", 61 | lazy = false, 62 | priority = 1000, 63 | italic = false, 64 | }, 65 | { "ellisonleao/gruvbox.nvim" }, 66 | { 67 | "vague2k/vague.nvim", 68 | config = function() 69 | require("vague").setup({ 70 | -- optional configuration here 71 | -- transparent = true, 72 | style = { 73 | -- "none" is the same thing as default. But "italic" and "bold" are also valid options 74 | boolean = "none", 75 | number = "none", 76 | float = "none", 77 | error = "none", 78 | comments = "none", 79 | conditionals = "none", 80 | functions = "none", 81 | headings = "bold", 82 | operators = "none", 83 | strings = "none", 84 | variables = "none", 85 | 86 | -- keywords 87 | keywords = "none", 88 | keyword_return = "none", 89 | keywords_loop = "none", 90 | keywords_label = "none", 91 | keywords_exception = "none", 92 | 93 | -- builtin 94 | builtin_constants = "none", 95 | builtin_functions = "none", 96 | builtin_types = "none", 97 | builtin_variables = "none", 98 | }, 99 | colors = { 100 | -- func = "#bc96b0", 101 | -- keyword = "#787bab", 102 | -- -- string = "#d4bd98", 103 | -- string = "#8a739a", 104 | -- -- string = "#f2e6ff", 105 | -- -- number = "#f2e6ff", 106 | -- -- string = "#d8d5b1", 107 | -- number = "#8f729e", 108 | -- -- type = "#dcaed7", 109 | }, 110 | }) 111 | end, 112 | }, 113 | { 114 | "jnurmine/Zenburn", 115 | }, 116 | { 117 | "RRethy/base16-nvim", 118 | }, 119 | } 120 | -------------------------------------------------------------------------------- /lua/plugins/tmux.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "christoomey/vim-tmux-navigator", 3 | cmd = { 4 | "TmuxNavigateLeft", 5 | "TmuxNavigateDown", 6 | "TmuxNavigateUp", 7 | "TmuxNavigateRight", 8 | "TmuxNavigatePrevious", 9 | }, 10 | keys = { 11 | { "", "TmuxNavigateLeft" }, 12 | { "", "TmuxNavigateDown" }, 13 | { "", "TmuxNavigateUp" }, 14 | { "", "TmuxNavigateRight" }, 15 | { "", "TmuxNavigatePrevious" }, 16 | }, 17 | } 18 | -------------------------------------------------------------------------------- /lua/plugins/transparency.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "xiyaowong/transparent.nvim", 3 | } 4 | -------------------------------------------------------------------------------- /lua/plugins/treesitter.lua: -------------------------------------------------------------------------------- 1 | -- treesitter 2 | return { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" } 3 | -------------------------------------------------------------------------------- /lua/plugins/typstprev.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "chomosuke/typst-preview.nvim", 3 | lazy = false, -- or ft = 'typst' 4 | version = "1.*", 5 | opts = { 6 | invert_colors = "always", 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /lua/plugins/vimtex.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "lervag/vimtex", 3 | lazy = false, -- we don't want to lazy load VimTeX 4 | -- tag = "v2.15", -- uncomment to pin to a specific release 5 | init = function() 6 | -- VimTeX configuration goes here, e.g. 7 | vim.g.vimtex_view_method = "skim" 8 | vim.g.vimtex_view_skim_sync = 1 9 | vim.g.vimtex_view_skim_activate = 1 10 | vim.g.vimtex_quickfix_mode = 0 11 | -- vim.g.tex_conceal = "abdmg" 12 | end, 13 | } 14 | -------------------------------------------------------------------------------- /lua/plugins/webdevicons.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-tree/nvim-web-devicons", 3 | config = function() 4 | require("nvim-web-devicons").setup({}) 5 | end, 6 | priority = 1000, 7 | } 8 | -------------------------------------------------------------------------------- /lua/plugins/whichkey.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "folke/which-key.nvim", 3 | event = "VeryLazy", 4 | opts = { 5 | preset = "helix", 6 | plugins = { 7 | marks = false, 8 | operators = false, 9 | windows = false, 10 | nav = false, 11 | }, 12 | win = { 13 | padding = { 0, 1 }, 14 | title = false, 15 | border = "none", 16 | }, 17 | icons = { 18 | breadcrumb = ">>=", 19 | separator = ":: ", 20 | group = " ++ ", 21 | keys = {}, 22 | }, 23 | }, 24 | config = function(_, opts) 25 | require("which-key").setup(opts) 26 | end, 27 | keys = { 28 | { 29 | "?", 30 | function() 31 | require("which-key").show({ global = false }) 32 | end, 33 | desc = "Buffer Local Keymaps (which-key)", 34 | }, 35 | }, 36 | } 37 | -------------------------------------------------------------------------------- /lua/plugins/yazi.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "mikavilpas/yazi.nvim", 3 | event = "VeryLazy", 4 | keys = { 5 | -- 👇 in this section, choose your own keymappings! 6 | { 7 | "n", 8 | "Yazi", 9 | desc = "Open yazi at the current file", 10 | }, 11 | { 12 | -- Open in the current working directory 13 | "cw", 14 | "Yazi cwd", 15 | desc = "Open the file manager in nvim's working directory", 16 | }, 17 | { 18 | -- NOTE: this requires a version of yazi that includes 19 | -- https://github.com/sxyazi/yazi/pull/1305 from 2024-07-18 20 | "", 21 | "Yazi toggle", 22 | desc = "Resume the last yazi session", 23 | }, 24 | }, 25 | opts = { 26 | -- if you want to open yazi instead of netrw, see below for more info 27 | open_for_directories = false, 28 | keymaps = { 29 | show_help = "", 30 | }, 31 | yazi_floating_window_border = "none" 32 | }, 33 | } 34 | -------------------------------------------------------------------------------- /lua/plugins/zen.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "folke/zen-mode.nvim", 3 | opts = {}, 4 | config = function() 5 | require("zen-mode").setup({ 6 | window = { 7 | width = 83, 8 | -- width = 1.00, 9 | }, 10 | }) 11 | vim.keymap.set("n", "zz", ":ZenMode") 12 | end, 13 | } 14 | -------------------------------------------------------------------------------- /lua/snippets/latex.lua: -------------------------------------------------------------------------------- 1 | local ls = require("luasnip") 2 | local s = ls.snippet 3 | local t = ls.text_node 4 | local i = ls.insert_node 5 | -- local f = ls.function_node 6 | 7 | return { 8 | 9 | -- simple symbols 10 | s("int", t("mathbb{Z}")), 11 | s("intp", t("mathbb{Z^{+}}")), 12 | s("tf", t("\\therefore")), 13 | 14 | -- flushleft 15 | s("fll", { 16 | t("\\begin{flushleft}"), 17 | i(1, "content"), 18 | t("\\end{flushleft}"), 19 | }), 20 | 21 | -- align* 22 | s("ali", { 23 | t("\\begin{align*}"), 24 | i(1, "content"), 25 | t("\\end{align*}"), 26 | }), 27 | 28 | -- basic header stuff 29 | s("head", { 30 | t({ "\\documentclass{article}", "" }), 31 | t({ "\\usepackage{amsmath}", "" }), 32 | t({ "\\usepackage{amssymb}", "" }), 33 | t({ "\\usepackage{amssymb}", "", "" }), 34 | t({ "\\title{" }), 35 | i(1, "title"), 36 | t({ "}", "" }), 37 | t({ "\\author{Michael Williams}", "" }), 38 | t({ "\\date{\\today}", "", "" }), 39 | t({ "\\begin{document}", "" }), 40 | t({ "\\maketitle", "" }), 41 | i(2, "content"), 42 | t({ "", "\\end{document}" }), 43 | }), 44 | 45 | -- basic header stuff 46 | s("frac", { 47 | t("\\frac{"), 48 | i(1, "num"), 49 | t("}{"), 50 | i(2, "denom"), 51 | t("}"), 52 | }), 53 | 54 | -- summation 55 | s("sum", { 56 | t("\\sum_{"), 57 | i(1, "low"), 58 | t("}^{"), 59 | i(2, "high"), 60 | t("}"), 61 | i(3, ""), 62 | }), 63 | 64 | -- function 65 | s("fn", { 66 | i(1, "fn_name"), 67 | t("("), 68 | i(2, "arg(s)"), 69 | t(") = "), 70 | i(3, "fn def."), 71 | }), 72 | } 73 | -------------------------------------------------------------------------------- /lua/snippets/notes.lua: -------------------------------------------------------------------------------- 1 | local ls = require("luasnip") 2 | local s = ls.snippet 3 | local t = ls.text_node 4 | local i = ls.insert_node 5 | local f = ls.function_node 6 | 7 | -- ∀∃□¬∨∧∑λ∈∅ 8 | 9 | local function get_date() 10 | return os.date("%m-%d-%Y") 11 | end 12 | 13 | return { 14 | 15 | -- latex 16 | s("$", { 17 | t({ "$$", "" }), 18 | i(1, ""), 19 | t({ "", "$$" }), 20 | }), 21 | 22 | -- math plain text snippets 23 | s("lam", t("λ")), 24 | s("lsm", t("∃")), 25 | s("lal", t("∀")), 26 | s("land", t("∧")), 27 | s("lor", t("∨")), 28 | s("lnot", t("¬")), 29 | s("lin", t("∈")), 30 | s("nil", t("∅")), 31 | s("summ", t("∑")), 32 | 33 | -- people 34 | s("Jean", t("Jean-Paul Sartre")), 35 | s("Sim", t("Simone de Beauvoir")), 36 | s("Gabriel", t("Gabriel Marcel")), 37 | 38 | -- gen words 39 | s("exist", t("existentialist")), 40 | s("phil", t("philosophy")), 41 | s("phil", t("philosophical")), 42 | s("bec", t("because")), 43 | s("there", t("therefore")), 44 | s("math", t("mathematical")), 45 | s("org", t("organization")), 46 | s("cs", t("computer Science")), 47 | s("pe", t("people")), 48 | s("pe", t("person")), 49 | s("dif", t("different")), 50 | 51 | -- misc 52 | 53 | s("head", { 54 | t({ "-- Michael Williams", "" }), 55 | t("-- Date: "), 56 | f(get_date, {}), 57 | t({ "", "-- Title: " }), 58 | i(1, "add title here"), 59 | }), 60 | -- markdown stuff 61 | s("td", t("- [ ]")), 62 | s("td", t("- [x]")), 63 | } 64 | -------------------------------------------------------------------------------- /lua/snippets/zig.lua: -------------------------------------------------------------------------------- 1 | local ls = require("luasnip") 2 | local s = ls.snippet 3 | local t = ls.text_node 4 | local i = ls.insert_node 5 | local f = ls.function_node 6 | 7 | return { 8 | s("stru", { 9 | t({ "const " }), 10 | i(1, ""), 11 | t({ " = struct {", "\t" }), 12 | i(2, ""), 13 | t({ "", "};" }), 14 | }), 15 | } 16 | -------------------------------------------------------------------------------- /lua/utils/color_overrides.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | -- sets the line colors for vague 4 | function M.vague_line_colors() 5 | vim.api.nvim_set_hl(0, "LineNrAbove", { fg = "#646477" }) 6 | vim.api.nvim_set_hl(0, "LineNrBelow", { fg = "#646477" }) 7 | vim.api.nvim_set_hl(0, "LineNr", { fg = "#d6d2c8" }) 8 | end 9 | 10 | function M.my_line_colors() 11 | vim.api.nvim_set_hl(0, "LineNrAbove", { fg = "#888888", bg = "#1e1e1e" }) 12 | vim.api.nvim_set_hl(0, "LineNrBelow", { fg = "#888888", bg = "#1e1e1e" }) 13 | vim.api.nvim_set_hl(0, "LineNr", { fg = "#d6d2c8" }) 14 | end 15 | 16 | function M.zenbones_theme_overrides() 17 | vim.api.nvim_set_hl(0, "LineNrAbove", { fg = "#888888", bg = "#1e1e1e" }) 18 | vim.api.nvim_set_hl(0, "LineNrBelow", { fg = "#888888", bg = "#1e1e1e" }) 19 | vim.api.nvim_set_hl(0, "LineNr", { fg = "#d6d2c8" }) 20 | end 21 | 22 | function M.cosec_twilight_overrides() 23 | local hl = vim.api.nvim_set_hl 24 | 25 | local literal_color = "#cccccc" 26 | local comment = "#6f7b68" 27 | local bg = "#222222" 28 | 29 | hl(0, "Float", { fg = literal_color }) 30 | hl(0, "Number", { fg = literal_color }) 31 | hl(0, "Boolean", { fg = literal_color }) 32 | 33 | hl(0, "TSComment", { fg = comment, gui = nil }) 34 | hl(0, "Comment", { fg = comment, gui = nil }) 35 | hl(0, "Search", { bg = "#9b8d7f", fg = "#1e1e1e" }) 36 | hl(0, "PmenuSel", { bg = "#9b8d7f", fg = "#1e1e1e" }) 37 | hl(0, "WinSeparator", { bg = "#111111", fg = "#888888" }) 38 | hl(0, "Normal", { bg = "#202020" }) 39 | 40 | hl(0, "LineNrAbove", { fg = "#888888", bg = "#222222" }) 41 | hl(0, "LineNrBelow", { fg = "#888888", bg = "#222222" }) 42 | hl(0, "LineNr", { fg = "#d6d2c8" }) 43 | 44 | hl(0, "Question", { bg = "#9b8d7f" }) 45 | hl(0, "DiagnosticVirtualTextError", { fg = "#912222" }) 46 | end 47 | 48 | function M.black_metal_theme_overrides() 49 | vim.api.nvim_set_hl(0, "DiagnosticVirtualTextError", { fg = "#912222" }) 50 | vim.api.nvim_set_hl(0, "TSComment", { fg = "#6f7b68", gui = nil }) 51 | vim.api.nvim_set_hl(0, "Comment", { fg = "#6f7b68", gui = nil }) 52 | vim.api.nvim_set_hl(0, "Visual", { bg = "#9b8d7f", fg = "#1e1e1e" }) 53 | vim.api.nvim_set_hl(0, "Search", { bg = "#9b8d7f", fg = "#1e1e1e" }) 54 | vim.api.nvim_set_hl(0, "PmenuSel", { bg = "#9b8d7f", fg = "#1e1e1e" }) 55 | 56 | -- lighter bg 57 | -- bg_color = "#040404" 58 | -- vim.api.nvim_set_hl(0, "Normal", { bg = "#222222" }) 59 | -- vim.api.nvim_set_hl(0, "NormalNC", { bg = bg_color }) 60 | 61 | vim.api.nvim_set_hl(0, "LineNrAbove", { fg = "#888888", bg = "#222222" }) 62 | vim.api.nvim_set_hl(0, "LineNrBelow", { fg = "#888888", bg = "#222222" }) 63 | vim.api.nvim_set_hl(0, "LineNr", { fg = "#d6d2c8" }) 64 | 65 | -- accent = "#9c9b98" 66 | -- vim.api.nvim_set_hl(0, "Statement", { fg = accent }) 67 | -- vim.api.nvim_set_hl(0, "WarningMsg", { fg = accent }) 68 | -- vim.api.nvim_set_hl(0, "TSVariable", { fg = accent }) 69 | -- vim.api.nvim_set_hl(0, "Exception", { fg = accent }) 70 | -- vim.api.nvim_set_hl(0, "Macro", { fg = accent }) 71 | -- vim.api.nvim_set_hl(0, "VisualNOS", { fg = accent }) 72 | -- vim.api.nvim_set_hl(0, "Character", { fg = accent }) 73 | -- vim.api.nvim_set_hl(0, "TSCharacter", { fg = accent }) 74 | -- vim.api.nvim_set_hl(0, "TSCharacterBuiltin", { fg = accent }) 75 | -- vim.api.nvim_set_hl(0, "@namespace", { fg = accent }) 76 | 77 | -- local function replace_color(old_color, new_color) 78 | -- local highlights = vim.api.nvim_get_hl(0, {}) 79 | -- 80 | -- for group, opts in pairs(highlights) do 81 | -- if opts.fg and string.format("#%06x", opts.fg) == old_color then 82 | -- opts.fg = new_color 83 | -- end 84 | -- if opts.bg and string.format("#%06x", opts.bg) == old_color then 85 | -- opts.bg = new_color 86 | -- end 87 | -- 88 | -- vim.api.nvim_set_hl(0, group, opts) 89 | -- end 90 | -- end 91 | -- 92 | -- -- Example: Replace `#ff0000` (red) with `#00ff00` (green) 93 | -- replace_color("#9b8d7f", "#CDb7d2") 94 | end 95 | 96 | function M.vague_status_colors() 97 | local custom_iceberk_dark = require("lualine.themes.iceberg_dark") 98 | -- custom_iceberk_dark.normal.c.bg = "#080808" -- archiving bc this is my term bg 99 | custom_iceberk_dark.normal.c.bg = nil 100 | custom_iceberk_dark.inactive.b.bg = nil 101 | custom_iceberk_dark.inactive.a.bg = nil 102 | custom_iceberk_dark.inactive.c.bg = nil 103 | custom_iceberk_dark.insert.a.bg = "#bc96b0" 104 | custom_iceberk_dark.visual.a.bg = "#787bab" 105 | custom_iceberk_dark.replace.a.bg = "#a1b3b9" 106 | 107 | require("lualine").setup({ 108 | options = { 109 | theme = custom_iceberk_dark, 110 | }, 111 | }) 112 | end 113 | 114 | -- sets up custom colors dependent on themes 115 | function M.setup_colorscheme_overrides() 116 | vim.api.nvim_create_autocmd("ColorScheme", { 117 | -- so it's fired when used in other autocmds 118 | nested = true, 119 | pattern = "*", 120 | callback = function() 121 | local colorscheme = vim.g.colors_name 122 | if colorscheme == nil then 123 | return 124 | end 125 | if string.find(colorscheme, "base16") then 126 | if string.find(colorscheme, "metal") then 127 | M.black_metal_theme_overrides() 128 | end 129 | M.my_line_colors() 130 | elseif colorscheme == "zenburn" then 131 | M.my_line_colors() 132 | elseif colorscheme == "zenbones" then 133 | M.zenbones_theme_overrides() 134 | elseif colorscheme == "cosec-twilight" then 135 | -- M.cosec_twilight_overrides() 136 | end 137 | end, 138 | }) 139 | 140 | -- remove italics from zenburn and the such 141 | local grpid = vim.api.nvim_create_augroup('custom_highlights', {}) 142 | vim.api.nvim_create_autocmd('ColorScheme', { 143 | group = grpid, 144 | pattern = 'zen*', 145 | command = 'hi Comment gui=NONE |' .. 146 | 'hi Constant gui=NONE' 147 | }) 148 | end 149 | 150 | -- setup some commands for manually setting values 151 | vim.api.nvim_create_user_command("MyLine", M.my_line_colors, {}) 152 | vim.api.nvim_create_user_command("VagueStatus", M.vague_status_colors, {}) 153 | vim.api.nvim_create_user_command("VagueLine", M.vague_line_colors, {}) 154 | vim.api.nvim_create_user_command("DefStatus", function() 155 | require("lualine").setup({ options = { theme = "auto" } }) 156 | end, {}) 157 | 158 | return M 159 | -------------------------------------------------------------------------------- /lua/utils/dashboard.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.setup_dashboard_image_colors = function() 4 | -- for dashboard 5 | -- vim.api.nvim_set_hl(0, "I2A0", { fg = "#1f3670" }) 6 | -- vim.api.nvim_set_hl(0, "I2A1", { fg = "#e6eff3" }) 7 | -- vim.api.nvim_set_hl(0, "I2A2", { fg = "#f2f7fa" }) 8 | -- vim.api.nvim_set_hl(0, "I2A3", { fg = "#989cb2" }) 9 | -- vim.api.nvim_set_hl(0, "I2A4", { fg = "#e0e8eb" }) 10 | -- vim.api.nvim_set_hl(0, "I2A5", { fg = "#69739d" }) 11 | -- vim.api.nvim_set_hl(0, "I2A6", { fg = "#2c3685" }) 12 | -- vim.api.nvim_set_hl(0, "I2A7", { fg = "#252b8c" }) 13 | -- vim.api.nvim_set_hl(0, "I2A8", { fg = "#3c438a" }) 14 | -- vim.api.nvim_set_hl(0, "I2A9", { fg = "#8692ba" }) 15 | -- vim.api.nvim_set_hl(0, "I2A10", { fg = "#bbbbbe" }) 16 | -- vim.api.nvim_set_hl(0, "I2A11", { fg = "#c6ced8" }) 17 | -- vim.api.nvim_set_hl(0, "I2A12", { fg = "#bdc7d8" }) 18 | -- vim.api.nvim_set_hl(0, "I2A13", { fg = "#c1cad8" }) 19 | -- vim.api.nvim_set_hl(0, "I2A14", { fg = "#7f86bb" }) 20 | -- vim.api.nvim_set_hl(0, "I2A15", { fg = "#0d1263" }) 21 | -- vim.api.nvim_set_hl(0, "I2A16", { fg = "#383872" }) 22 | -- vim.api.nvim_set_hl(0, "I2A17", { fg = "#464f8f" }) 23 | -- vim.api.nvim_set_hl(0, "I2A18", { fg = "#899ba3" }) 24 | -- vim.api.nvim_set_hl(0, "I2A19", { fg = "#4d4a98" }) 25 | -- vim.api.nvim_set_hl(0, "I2A20", { fg = "#101b83" }) 26 | -- vim.api.nvim_set_hl(0, "I2A21", { fg = "#0f1981" }) 27 | -- vim.api.nvim_set_hl(0, "I2A22", { fg = "#9ab9c6" }) 28 | -- vim.api.nvim_set_hl(0, "I2A23", { fg = "#a4b6bb" }) 29 | -- vim.api.nvim_set_hl(0, "I2A24", { fg = "#b0c4d2" }) 30 | -- vim.api.nvim_set_hl(0, "I2A25", { fg = "#e9f0f4" }) 31 | -- vim.api.nvim_set_hl(0, "I2A26", { fg = "#7a7e9c" }) 32 | -- vim.api.nvim_set_hl(0, "I2A27", { fg = "#0d1883" }) 33 | -- vim.api.nvim_set_hl(0, "I2A28", { fg = "#7fa3b7" }) 34 | -- vim.api.nvim_set_hl(0, "I2A29", { fg = "#0c1561" }) 35 | -- vim.api.nvim_set_hl(0, "I2A30", { fg = "#213481" }) 36 | -- vim.api.nvim_set_hl(0, "I2A31", { fg = "#7f839e" }) 37 | -- vim.api.nvim_set_hl(0, "I2A32", { fg = "#080c40" }) 38 | -- vim.api.nvim_set_hl(0, "I2A33", { fg = "#748690" }) 39 | -- vim.api.nvim_set_hl(0, "I2A34", { fg = "#132085" }) 40 | -- vim.api.nvim_set_hl(0, "I2A35", { fg = "#0e1982" }) 41 | -- vim.api.nvim_set_hl(0, "I2A36", { fg = "#e9eff4" }) 42 | -- vim.api.nvim_set_hl(0, "I2A37", { fg = "#8487a1" }) 43 | -- vim.api.nvim_set_hl(0, "I2A38", { fg = "#aec0c3" }) 44 | -- vim.api.nvim_set_hl(0, "I2A39", { fg = "#7094ad" }) 45 | -- vim.api.nvim_set_hl(0, "I2A40", { fg = "#7a9bb1" }) 46 | -- vim.api.nvim_set_hl(0, "I2A41", { fg = "#81a2b6" }) 47 | -- vim.api.nvim_set_hl(0, "I2A42", { fg = "#8fb0bf" }) 48 | -- vim.api.nvim_set_hl(0, "I2A43", { fg = "#88a9ba" }) 49 | -- vim.api.nvim_set_hl(0, "I2A44", { fg = "#92b4c1" }) 50 | -- vim.api.nvim_set_hl(0, "I2A45", { fg = "#b6cdd6" }) 51 | -- vim.api.nvim_set_hl(0, "I2A46", { fg = "#d7e3ea" }) 52 | -- vim.api.nvim_set_hl(0, "I2A47", { fg = "#0c157a" }) 53 | -- vim.api.nvim_set_hl(0, "I2A48", { fg = "#8ba2ac" }) 54 | -- vim.api.nvim_set_hl(0, "I2A49", { fg = "#394875" }) 55 | -- vim.api.nvim_set_hl(0, "I2A50", { fg = "#020339" }) 56 | -- vim.api.nvim_set_hl(0, "I2A51", { fg = "#dee1ee" }) 57 | -- vim.api.nvim_set_hl(0, "I2A52", { fg = "#c2c4ce" }) 58 | -- vim.api.nvim_set_hl(0, "I2A53", { fg = "#5c5e63" }) 59 | -- vim.api.nvim_set_hl(0, "I2A54", { fg = "#acc2d0" }) 60 | -- vim.api.nvim_set_hl(0, "I2A55", { fg = "#84a5b8" }) 61 | -- vim.api.nvim_set_hl(0, "I2A56", { fg = "#7f9cb5" }) 62 | -- vim.api.nvim_set_hl(0, "I2A57", { fg = "#96afc3" }) 63 | -- vim.api.nvim_set_hl(0, "I2A58", { fg = "#a0afb5" }) 64 | -- vim.api.nvim_set_hl(0, "I2A59", { fg = "#c1c6df" }) 65 | -- vim.api.nvim_set_hl(0, "I2A60", { fg = "#bac0d1" }) 66 | -- vim.api.nvim_set_hl(0, "I2A61", { fg = "#b7bdd3" }) 67 | -- vim.api.nvim_set_hl(0, "I2A62", { fg = "#3879a0" }) 68 | -- vim.api.nvim_set_hl(0, "I2A63", { fg = "#36769d" }) 69 | -- vim.api.nvim_set_hl(0, "I2A64", { fg = "#34749b" }) 70 | -- vim.api.nvim_set_hl(0, "I2A65", { fg = "#b2c7d3" }) 71 | -- vim.api.nvim_set_hl(0, "I2A66", { fg = "#2d318e" }) 72 | -- vim.api.nvim_set_hl(0, "I2A67", { fg = "#3d469c" }) 73 | -- vim.api.nvim_set_hl(0, "I2A68", { fg = "#070d5e" }) 74 | -- vim.api.nvim_set_hl(0, "I2A69", { fg = "#08123c" }) 75 | -- vim.api.nvim_set_hl(0, "I2A70", { fg = "#90a3b5" }) 76 | -- vim.api.nvim_set_hl(0, "I2A71", { fg = "#ccdee8" }) 77 | -- vim.api.nvim_set_hl(0, "I2A72", { fg = "#1d1b42" }) 78 | -- vim.api.nvim_set_hl(0, "I2A73", { fg = "#1a1f42" }) 79 | -- vim.api.nvim_set_hl(0, "I2A74", { fg = "#5e6e71" }) 80 | -- vim.api.nvim_set_hl(0, "I2A75", { fg = "#5e5659" }) 81 | -- vim.api.nvim_set_hl(0, "I2A76", { fg = "#282646" }) 82 | -- vim.api.nvim_set_hl(0, "I2A77", { fg = "#151440" }) 83 | -- vim.api.nvim_set_hl(0, "I2A78", { fg = "#15206f" }) 84 | -- vim.api.nvim_set_hl(0, "I2A79", { fg = "#1d3e8d" }) 85 | -- vim.api.nvim_set_hl(0, "I2A80", { fg = "#314b82" }) 86 | -- vim.api.nvim_set_hl(0, "I2A81", { fg = "#4980a3" }) 87 | -- vim.api.nvim_set_hl(0, "I2A82", { fg = "#3d7ea4" }) 88 | -- vim.api.nvim_set_hl(0, "I2A83", { fg = "#4081a7" }) 89 | -- vim.api.nvim_set_hl(0, "I2A84", { fg = "#3e7fa5" }) 90 | -- vim.api.nvim_set_hl(0, "I2A85", { fg = "#3f80a6" }) 91 | -- vim.api.nvim_set_hl(0, "I2A86", { fg = "#4d85a8" }) 92 | -- vim.api.nvim_set_hl(0, "I2A87", { fg = "#3d7ea5" }) 93 | -- vim.api.nvim_set_hl(0, "I2A88", { fg = "#3a7ba2" }) 94 | -- vim.api.nvim_set_hl(0, "I2A89", { fg = "#4781a5" }) 95 | -- vim.api.nvim_set_hl(0, "I2A90", { fg = "#3e7195" }) 96 | -- vim.api.nvim_set_hl(0, "I2A91", { fg = "#656a9c" }) 97 | -- vim.api.nvim_set_hl(0, "I2A92", { fg = "#9292c2" }) 98 | -- vim.api.nvim_set_hl(0, "I2A93", { fg = "#5d63aa" }) 99 | -- vim.api.nvim_set_hl(0, "I2A94", { fg = "#102170" }) 100 | -- vim.api.nvim_set_hl(0, "I2A95", { fg = "#1c324a" }) 101 | -- vim.api.nvim_set_hl(0, "I2A96", { fg = "#141a49" }) 102 | -- vim.api.nvim_set_hl(0, "I2A97", { fg = "#234572" }) 103 | -- vim.api.nvim_set_hl(0, "I2A98", { fg = "#4b8daf" }) 104 | -- vim.api.nvim_set_hl(0, "I2A99", { fg = "#3c748f" }) 105 | -- vim.api.nvim_set_hl(0, "I2A100", { fg = "#487396" }) 106 | -- vim.api.nvim_set_hl(0, "I2A101", { fg = "#4f4f54" }) 107 | -- vim.api.nvim_set_hl(0, "I2A102", { fg = "#494d53" }) 108 | -- vim.api.nvim_set_hl(0, "I2A103", { fg = "#35444c" }) 109 | -- vim.api.nvim_set_hl(0, "I2A104", { fg = "#2f3549" }) 110 | -- vim.api.nvim_set_hl(0, "I2A105", { fg = "#0f1444" }) 111 | -- vim.api.nvim_set_hl(0, "I2A106", { fg = "#060e3b" }) 112 | -- vim.api.nvim_set_hl(0, "I2A107", { fg = "#242e5b" }) 113 | -- vim.api.nvim_set_hl(0, "I2A108", { fg = "#275580" }) 114 | -- vim.api.nvim_set_hl(0, "I2A109", { fg = "#488aad" }) 115 | -- vim.api.nvim_set_hl(0, "I2A110", { fg = "#498bae" }) 116 | -- vim.api.nvim_set_hl(0, "I2A111", { fg = "#4485aa" }) 117 | -- vim.api.nvim_set_hl(0, "I2A112", { fg = "#5489aa" }) 118 | -- vim.api.nvim_set_hl(0, "I2A113", { fg = "#42639d" }) 119 | -- vim.api.nvim_set_hl(0, "I2A114", { fg = "#544e5e" }) 120 | -- vim.api.nvim_set_hl(0, "I2A115", { fg = "#32434b" }) 121 | -- vim.api.nvim_set_hl(0, "I2A116", { fg = "#1c304d" }) 122 | -- vim.api.nvim_set_hl(0, "I2A117", { fg = "#477797" }) 123 | -- vim.api.nvim_set_hl(0, "I2A118", { fg = "#5e5b5e" }) 124 | -- vim.api.nvim_set_hl(0, "I2A119", { fg = "#444a51" }) 125 | -- vim.api.nvim_set_hl(0, "I2A120", { fg = "#132a41" }) 126 | -- vim.api.nvim_set_hl(0, "I2A121", { fg = "#588dad" }) 127 | -- vim.api.nvim_set_hl(0, "I2A122", { fg = "#1d3765" }) 128 | -- vim.api.nvim_set_hl(0, "I2A123", { fg = "#305983" }) 129 | -- vim.api.nvim_set_hl(0, "I2A124", { fg = "#4a8cae" }) 130 | -- vim.api.nvim_set_hl(0, "I2A125", { fg = "#305e8d" }) 131 | -- vim.api.nvim_set_hl(0, "I2A126", { fg = "#767eb9" }) 132 | -- vim.api.nvim_set_hl(0, "I2A127", { fg = "#495e9c" }) 133 | -- vim.api.nvim_set_hl(0, "I2A128", { fg = "#080e61" }) 134 | -- vim.api.nvim_set_hl(0, "I2A129", { fg = "#173542" }) 135 | -- vim.api.nvim_set_hl(0, "I2A130", { fg = "#3e484f" }) 136 | -- vim.api.nvim_set_hl(0, "I2A131", { fg = "#3a444d" }) 137 | -- vim.api.nvim_set_hl(0, "I2A132", { fg = "#38454d" }) 138 | -- vim.api.nvim_set_hl(0, "I2A133", { fg = "#34647b" }) 139 | -- vim.api.nvim_set_hl(0, "I2A134", { fg = "#183743" }) 140 | -- vim.api.nvim_set_hl(0, "I2A135", { fg = "#193644" }) 141 | -- vim.api.nvim_set_hl(0, "I2A136", { fg = "#1e2852" }) 142 | -- vim.api.nvim_set_hl(0, "I2A137", { fg = "#0c0d41" }) 143 | -- vim.api.nvim_set_hl(0, "I2A138", { fg = "#9aacb3" }) 144 | -- vim.api.nvim_set_hl(0, "I2A139", { fg = "#080a3e" }) 145 | -- vim.api.nvim_set_hl(0, "I2A140", { fg = "#07093e" }) 146 | -- vim.api.nvim_set_hl(0, "I2A141", { fg = "#34667d" }) 147 | -- vim.api.nvim_set_hl(0, "I2A142", { fg = "#4d8daf" }) 148 | -- vim.api.nvim_set_hl(0, "I2A143", { fg = "#487392" }) 149 | -- vim.api.nvim_set_hl(0, "I2A144", { fg = "#4082a6" }) 150 | -- vim.api.nvim_set_hl(0, "I2A145", { fg = "#ebf0f4" }) 151 | -- vim.api.nvim_set_hl(0, "I2A146", { fg = "#2f338e" }) 152 | -- vim.api.nvim_set_hl(0, "I2A147", { fg = "#070d5b" }) 153 | -- vim.api.nvim_set_hl(0, "I2A148", { fg = "#294157" }) 154 | -- vim.api.nvim_set_hl(0, "I2A149", { fg = "#33657d" }) 155 | -- vim.api.nvim_set_hl(0, "I2A150", { fg = "#9f9ea2" }) 156 | -- vim.api.nvim_set_hl(0, "I2A151", { fg = "#2a4759" }) 157 | -- vim.api.nvim_set_hl(0, "I2A152", { fg = "#183943" }) 158 | -- vim.api.nvim_set_hl(0, "I2A153", { fg = "#295d5e" }) 159 | -- vim.api.nvim_set_hl(0, "I2A154", { fg = "#477e7f" }) 160 | -- vim.api.nvim_set_hl(0, "I2A155", { fg = "#adc1ce" }) 161 | -- vim.api.nvim_set_hl(0, "I2A156", { fg = "#7899a2" }) 162 | -- vim.api.nvim_set_hl(0, "I2A157", { fg = "#46656d" }) 163 | -- vim.api.nvim_set_hl(0, "I2A158", { fg = "#5e696c" }) 164 | -- vim.api.nvim_set_hl(0, "I2A159", { fg = "#05063b" }) 165 | -- vim.api.nvim_set_hl(0, "I2A160", { fg = "#7296af" }) 166 | -- vim.api.nvim_set_hl(0, "I2A161", { fg = "#162b67" }) 167 | -- vim.api.nvim_set_hl(0, "I2A162", { fg = "#4687ab" }) 168 | -- vim.api.nvim_set_hl(0, "I2A163", { fg = "#508eaf" }) 169 | -- vim.api.nvim_set_hl(0, "I2A164", { fg = "#2d306c" }) 170 | -- vim.api.nvim_set_hl(0, "I2A165", { fg = "#2e5782" }) 171 | -- vim.api.nvim_set_hl(0, "I2A166", { fg = "#0d1d3e" }) 172 | -- vim.api.nvim_set_hl(0, "I2A167", { fg = "#305f53" }) 173 | -- vim.api.nvim_set_hl(0, "I2A168", { fg = "#578e92" }) 174 | -- vim.api.nvim_set_hl(0, "I2A169", { fg = "#c2d5dd" }) 175 | -- vim.api.nvim_set_hl(0, "I2A170", { fg = "#b0c6cf" }) 176 | -- vim.api.nvim_set_hl(0, "I2A171", { fg = "#5d908f" }) 177 | -- vim.api.nvim_set_hl(0, "I2A172", { fg = "#566b86" }) 178 | -- vim.api.nvim_set_hl(0, "I2A173", { fg = "#85a7b2" }) 179 | -- vim.api.nvim_set_hl(0, "I2A174", { fg = "#677984" }) 180 | -- vim.api.nvim_set_hl(0, "I2A175", { fg = "#0e0d3d" }) 181 | -- vim.api.nvim_set_hl(0, "I2A176", { fg = "#060940" }) 182 | -- vim.api.nvim_set_hl(0, "I2A177", { fg = "#0a173d" }) 183 | -- vim.api.nvim_set_hl(0, "I2A178", { fg = "#050a3a" }) 184 | -- vim.api.nvim_set_hl(0, "I2A179", { fg = "#6283a0" }) 185 | -- vim.api.nvim_set_hl(0, "I2A180", { fg = "#7ba1b6" }) 186 | -- vim.api.nvim_set_hl(0, "I2A181", { fg = "#1d274e" }) 187 | -- vim.api.nvim_set_hl(0, "I2A182", { fg = "#112840" }) 188 | -- vim.api.nvim_set_hl(0, "I2A183", { fg = "#304872" }) 189 | -- vim.api.nvim_set_hl(0, "I2A184", { fg = "#264874" }) 190 | -- vim.api.nvim_set_hl(0, "I2A185", { fg = "#343661" }) 191 | -- vim.api.nvim_set_hl(0, "I2A186", { fg = "#689191" }) 192 | -- vim.api.nvim_set_hl(0, "I2A187", { fg = "#165b4c" }) 193 | -- vim.api.nvim_set_hl(0, "I2A188", { fg = "#0e6e53" }) 194 | -- vim.api.nvim_set_hl(0, "I2A189", { fg = "#0a7456" }) 195 | -- vim.api.nvim_set_hl(0, "I2A190", { fg = "#057b59" }) 196 | -- vim.api.nvim_set_hl(0, "I2A191", { fg = "#7a97a9" }) 197 | -- vim.api.nvim_set_hl(0, "I2A192", { fg = "#a8c1ce" }) 198 | -- vim.api.nvim_set_hl(0, "I2A193", { fg = "#5f98b4" }) 199 | -- vim.api.nvim_set_hl(0, "I2A194", { fg = "#89b0b0" }) 200 | -- vim.api.nvim_set_hl(0, "I2A195", { fg = "#35786c" }) 201 | -- vim.api.nvim_set_hl(0, "I2A196", { fg = "#496a70" }) 202 | -- vim.api.nvim_set_hl(0, "I2A197", { fg = "#6d8e95" }) 203 | -- vim.api.nvim_set_hl(0, "I2A198", { fg = "#afb9c2" }) 204 | -- vim.api.nvim_set_hl(0, "I2A199", { fg = "#203154" }) 205 | -- vim.api.nvim_set_hl(0, "I2A200", { fg = "#080e44" }) 206 | -- vim.api.nvim_set_hl(0, "I2A201", { fg = "#345b81" }) 207 | -- vim.api.nvim_set_hl(0, "I2A202", { fg = "#1e305d" }) 208 | -- vim.api.nvim_set_hl(0, "I2A203", { fg = "#548faf" }) 209 | -- vim.api.nvim_set_hl(0, "I2A204", { fg = "#5790af" }) 210 | end 211 | 212 | return M 213 | -------------------------------------------------------------------------------- /lua/utils/init.lua: -------------------------------------------------------------------------------- 1 | local utils = {} 2 | 3 | utils.color_overrides = require("utils.color_overrides") 4 | utils.dashboard = require("utils.dashboard") 5 | 6 | --- get the operating system name 7 | --- "windows", "mac", "linux" 8 | function utils.get_os() 9 | local uname = vim.loop.os_uname() 10 | local os_name = uname.sysname 11 | if os_name == "Windows_NT" then 12 | return "windows" 13 | elseif os_name == "Darwin" then 14 | return "mac" 15 | else 16 | return "linux" 17 | end 18 | end 19 | 20 | -- fixes parenthesis issue with directories and telescope 21 | function utils.fix_telescope_parens_win() 22 | if vim.fn.has("win32") then 23 | local ori_fnameescape = vim.fn.fnameescape 24 | ---@diagnostic disable-next-line: duplicate-set-field 25 | vim.fn.fnameescape = function(...) 26 | local result = ori_fnameescape(...) 27 | return result:gsub("\\", "/") 28 | end 29 | end 30 | end 31 | 32 | function utils.expand_path(path) 33 | if path:sub(1, 1) == "~" then 34 | return os.getenv("HOME") .. path:sub(2) 35 | end 36 | return path 37 | end 38 | 39 | function utils.center_in(outer, inner) 40 | return (outer - inner) / 2 41 | end 42 | 43 | return utils 44 | -------------------------------------------------------------------------------- /lua/vimopts.lua: -------------------------------------------------------------------------------- 1 | -- general settings 2 | vim.cmd("set number") 3 | vim.cmd("set relativenumber") 4 | vim.cmd("set ts=2") 5 | vim.cmd("set cmdheight=0") 6 | vim.cmd("set termguicolors") 7 | vim.cmd("set scrolloff=5") 8 | vim.cmd("autocmd FileType sql setlocal noautoindent") 9 | vim.cmd("autocmd FileType sql setlocal nosmartindent") 10 | vim.cmd("autocmd FileType sql setlocal nocindent") 11 | vim.cmd("set signcolumn=no") 12 | vim.g.python3_host_prog = "/Library/Frameworks/Python.framework/Versions/3.11/bin/python3" 13 | 14 | vim.o.scrolloff = 5 15 | vim.opt.ignorecase = true 16 | 17 | -- hmmmmmmmmmmmmmmmmm not sure about this 18 | -- vim.opt.colorcolumn = "80" 19 | 20 | -- minor visual changes to panes 21 | vim.opt.fillchars = 22 | { vert = " ", horiz = " ", horizup = " ", horizdown = " ", vertleft = " ", vertright = " ", verthoriz = " " } 23 | vim.keymap.set("n", "", "h") 24 | vim.keymap.set("n", "", "j") 25 | vim.keymap.set("n", "", "k") 26 | vim.keymap.set("n", "", "l") 27 | 28 | -- because [e goes to the next error 29 | -- for consistency 30 | vim.keymap.set("n", "[s", "]s") 31 | vim.keymap.set("n", "]s", "[s") 32 | 33 | -- window manips 34 | vim.keymap.set("n", "=", [[vertical resize +5]]) -- make the window biger vertically 35 | vim.keymap.set("n", "-", [[vertical resize -5]]) -- make the window smaller vertically 36 | 37 | -- vim.cmd("set guicursor=n-v-c:block-blinkon1,i-ci:ver25") 38 | vim.opt.guicursor = "n-v-c:block-blinkon1-CursorInsert,i:block-CursorInsert" 39 | 40 | vim.api.nvim_create_user_command("Setwd", function() 41 | vim.cmd("cd " .. vim.fn.expand("%:p:h")) 42 | end, {}) 43 | 44 | local utils = require("utils") 45 | local os_name = utils.get_os() 46 | 47 | if os_name == "windows" then 48 | vim.cmd("set shell=powershell") 49 | else 50 | vim.cmd("set shell=/bin/zsh") 51 | end 52 | vim.cmd("set shellcmdflag=-c") 53 | vim.cmd("set shellquote=") 54 | vim.cmd("set shellxquote=") 55 | 56 | -- stop right-shift when errors/warning appear 57 | vim.o.signcolumn = "no" 58 | vim.o.completeopt = "menuone,noselect,preview" 59 | 60 | vim.opt.tabstop = 2 61 | vim.opt.shiftwidth = 2 62 | vim.opt.expandtab = true 63 | vim.bo.softtabstop = 2 64 | 65 | -- move selections 66 | vim.keymap.set("v", "J", ":m '>+1gv=gv") -- Shift visual selected line down 67 | vim.keymap.set("v", "K", ":m '<-2gv=gv") -- Shift visual selected line up 68 | vim.keymap.set("n", "t", "bv~") 69 | 70 | -- colorscheme picker 71 | vim.keymap.set("n", "", ":Telescope colorscheme") 72 | 73 | -- remaps 74 | vim.g.mapleader = " " 75 | 76 | vim.keymap.set("n", "", "zz") 77 | vim.keymap.set("n", "", "zz") 78 | vim.keymap.set("n", "", "zz") 79 | vim.keymap.set("n", "", "zz") 80 | vim.keymap.set("n", "Y", "yy") 81 | 82 | -- autocomplete in normal text 83 | vim.keymap.set("i", "", "", { noremap = true, silent = true }) 84 | vim.keymap.set("i", "", "", { noremap = true, silent = true }) 85 | vim.keymap.set("i", "", "", { noremap = true, silent = true }) 86 | 87 | -- spell check 88 | vim.keymap.set("n", "ll", ":setlocal spell spelllang=en_us") 89 | 90 | -- lsp setup 91 | vim.keymap.set("n", "K", vim.lsp.buf.hover) 92 | vim.keymap.set("n", "gd", vim.lsp.buf.definition) 93 | vim.keymap.set("n", "gD", vim.lsp.buf.declaration) 94 | vim.keymap.set("n", "gr", function() 95 | -- Trigger the LSP references function and populate the quickfix list 96 | vim.lsp.buf.references() 97 | 98 | vim.defer_fn(function() 99 | -- Set up an autocmd to remap keys in the quickfix window 100 | vim.api.nvim_create_autocmd("FileType", { 101 | pattern = "qf", -- Only apply this mapping in quickfix windows 102 | callback = function() 103 | -- Remap to jump to the location and close the quickfix window 104 | vim.api.nvim_buf_set_keymap(0, "n", "", ":cclose", { noremap = true, silent = true }) 105 | vim.api.nvim_buf_set_keymap(0, "n", "q", ":cclose", { noremap = true, silent = true }) 106 | 107 | -- Set up to cycle through quickfix list entries 108 | vim.keymap.set("n", "", function() 109 | local current_idx = vim.fn.getqflist({ idx = 0 }).idx 110 | local qflist = vim.fn.getqflist() -- Get the current quickfix list 111 | if current_idx >= #qflist then 112 | vim.cmd("cfirst") 113 | vim.cmd("wincmd p") 114 | else 115 | vim.cmd("cnext") 116 | vim.cmd("wincmd p") 117 | end 118 | end, { noremap = true, silent = true, buffer = 0 }) 119 | 120 | vim.keymap.set("n", "", function() 121 | local current_idx = vim.fn.getqflist({ idx = 0 }).idx 122 | if current_idx < 2 then 123 | vim.cmd("clast") 124 | vim.cmd("wincmd p") 125 | else 126 | vim.cmd("cprev") 127 | vim.cmd("wincmd p") 128 | end 129 | end, { noremap = true, silent = true, buffer = 0 }) 130 | end, 131 | }) 132 | end, 0) 133 | end) 134 | 135 | vim.keymap.set({ "n", "v" }, "ca", vim.lsp.buf.code_action, {}) 136 | 137 | vim.keymap.set({ "n", "v" }, "ca", vim.lsp.buf.code_action, {}) 138 | 139 | -- see error 140 | vim.keymap.set("n", "e", vim.diagnostic.open_float) 141 | 142 | -- go to errors 143 | vim.keymap.set("n", "[e", vim.diagnostic.goto_next) 144 | vim.keymap.set("n", "]e", vim.diagnostic.goto_next) 145 | 146 | function leave_snippet() 147 | if 148 | ((vim.v.event.old_mode == "s" and vim.v.event.new_mode == "n") or vim.v.event.old_mode == "i") 149 | and require("luasnip").session.current_nodes[vim.api.nvim_get_current_buf()] 150 | and not require("luasnip").session.jump_active 151 | then 152 | require("luasnip").unlink_current() 153 | end 154 | end 155 | 156 | -- stop snippets when you leave to normal mode 157 | vim.api.nvim_command([[ 158 | autocmd ModeChanged * lua leave_snippet() 159 | ]]) 160 | 161 | -- make help and man open up on the side instead above 162 | vim.api.nvim_create_autocmd("FileType", { 163 | pattern = { "help", "man" }, 164 | command = "wincmd L", 165 | }) 166 | 167 | vim.lsp.set_log_level("warn") 168 | 169 | vim.cmd([[ 170 | autocmd! DiagnosticChanged * lua vim.diagnostic.setloclist({open = false}) ]]) 171 | 172 | vim.api.nvim_create_augroup("CreateDirs", { clear = true }) 173 | vim.api.nvim_create_autocmd("BufWritePre", { 174 | group = "CreateDirs", 175 | pattern = "*", 176 | callback = function() 177 | local file_path = vim.fn.expand(":p:h") 178 | if vim.fn.isdirectory(file_path) == 0 then 179 | vim.fn.mkdir(file_path, "p") 180 | end 181 | end, 182 | }) 183 | 184 | vim.api.nvim_create_autocmd("BufEnter", { 185 | pattern = { "*.md" }, 186 | callback = function() 187 | vim.cmd("set linebreak") 188 | -- vim.cmd("colorscheme zenburn") 189 | end, 190 | nested = true, 191 | }) 192 | 193 | vim.api.nvim_create_autocmd({ "FileType", "VimEnter", "BufReadPre" }, { 194 | pattern = { "*.md" }, 195 | callback = function() 196 | vim.schedule(function() 197 | vim.keymap.set("n", "md", ":lua OpenInObsidian()", { noremap = true, silent = true }) 198 | vim.o.shiftwidth = 2 199 | end) 200 | end, 201 | }) 202 | 203 | function OpenInObsidian() 204 | local file = vim.fn.expand("") -- Get the file path under the cursor 205 | if file:match("%.md$") then 206 | local vault = "notes" -- Replace with your Obsidian vault name 207 | local vault_path = vim.fn.expand("~/path/to/vault/") -- Adjust to your vault path 208 | local relative_path = file:gsub(vault_path, "") -- Get relative path from vault root 209 | local obsidian_url = "obsidian://open?vault=" .. vault .. "&file=" .. vim.fn.fnameescape(relative_path) 210 | vim.fn.system({ "open", obsidian_url }) -- macOS 'open' command to launch Obsidian 211 | else 212 | vim.cmd("silent open " .. file) -- Default behavior (for non-.md files) 213 | end 214 | end 215 | 216 | vim.api.nvim_create_user_command("FormatDisable", function(args) 217 | vim.g.disable_autoformat = true 218 | end, { 219 | desc = "Disable autoformat-on-save", 220 | }) 221 | 222 | vim.api.nvim_create_user_command("FormatEnable", function() 223 | vim.b.disable_autoformat = false 224 | vim.g.disable_autoformat = false 225 | end, { 226 | desc = "Re-enable autoformat-on-save", 227 | }) 228 | 229 | vim.api.nvim_command('autocmd VimResized * wincmd =') 230 | 231 | vim.diagnostic.config({ 232 | virtual_text = true, 233 | }) 234 | -------------------------------------------------------------------------------- /spell/en.utf-8.add: -------------------------------------------------------------------------------- 1 | Shutendoji 2 | oni 3 | oni's 4 | realm/! 5 | Tocco 6 | asian 7 | nenbutsu 8 | art402 9 | wakashu 10 | wakashu 11 | wakashu 12 | wakashu 13 | wakashu 14 | nenja 15 | shudo 16 | Hiroya 17 | impl 18 | Nakakubo's 19 | EEOA 20 | Goldin's 21 | Nakubo's 22 | Goldin 23 | EEOA's 24 | ungendered 25 | Nakakubo 26 | asoc3yyy 27 | src 28 | Ishii 29 | Kuntz 30 | Masako 31 | masculinities 32 | Salaryman 33 | Doxa 34 | Routledge 35 | -------------------------------------------------------------------------------- /spell/en.utf-8.add.spl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimichael/my-nvim-config/3739f67f6a26a590ea0ae68fc080a9b680c8928d/spell/en.utf-8.add.spl --------------------------------------------------------------------------------