├── .github ├── README.md └── screenshots │ └── header.png ├── .gitignore ├── filetype.lua ├── init.lua ├── lazy-lock.json └── lua ├── core ├── au.lua ├── cfg.lua ├── cmds.lua ├── colors.lua ├── init.lua ├── keys.lua └── opts.lua ├── hls ├── buf.lua ├── dash.lua ├── nerdtree.lua └── stl.lua ├── plugs ├── README.md ├── cmds.lua ├── init.lua ├── lsp │ ├── cmp.lua │ ├── lspconfig.lua │ ├── luasnip.lua │ └── mason.lua ├── strap.lua ├── ts │ ├── autopair.lua │ └── treesitter.lua ├── ui │ ├── colorizer.lua │ ├── devicons.lua │ ├── gitsigns.lua │ ├── prism.lua │ └── starter.lua └── util │ ├── nvim-tree.lua │ ├── telescope.lua │ └── toggleterm.lua └── ui ├── buf ├── fn.lua └── init.lua ├── init.lua └── stl ├── init.lua ├── modes.lua └── modules ├── branch.lua ├── diagnostics.lua ├── diff.lua ├── filename.lua ├── folder.lua ├── lsp.lua ├── mode.lua └── position.lua /.github/README.md: -------------------------------------------------------------------------------- 1 | screenshot 2 | 3 | 4 | Startuptime: 17.58ms
5 | List of plugins can be found in a readme in lua/plugs folder.

6 | 7 | Based on the actual CPU time of the Neovim process till UIEnter.
8 | This is more accurate than `nvim --startuptime`.
9 | LazyStart 7.11ms
10 | LazyDone 12.27ms (+5.16ms)
11 | UIEnter 17.58ms (+5.31ms)
12 | 13 | Special Thanks
14 | This config wouldn't have been possible without these chads! 15 | + [dharmx](https://github.com/dharmx/nvim/) 16 | + [siduck](https://github.com/NvChad/NvChad) 17 | 18 |
19 | 20 | -------------------------------------------------------------------------------- /.github/screenshots/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/namishh/kodo/50c4911bbc042f2c148529769d202cb3fcf65596/.github/screenshots/header.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.json 2 | -------------------------------------------------------------------------------- /filetype.lua: -------------------------------------------------------------------------------- 1 | vim.filetype.add({ extension = { mdx = 'mdx' } }) 2 | -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | vim.loader.enable() 2 | require("plugs") 3 | require("core") 4 | require("ui") 5 | -------------------------------------------------------------------------------- /lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" }, 3 | "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, 4 | "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, 5 | "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, 6 | "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, 7 | "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, 8 | "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, 9 | "gitsigns.nvim": { "branch": "main", "commit": "ee7634ab4f0a6606438fe13e16cbf2065589a5ed" }, 10 | "indent-blankline.nvim": { "branch": "master", "commit": "e7a4442e055ec953311e77791546238d1eaae507" }, 11 | "lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" }, 12 | "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, 13 | "mdx.nvim": { "branch": "main", "commit": "ae83959b61a9fec8da228ebb5d6b045fd532d2cc" }, 14 | "mini.starter": { "branch": "main", "commit": "3e0af795938ee800846708bed92fbe4e8583141a" }, 15 | "nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" }, 16 | "nvim-cmp": { "branch": "main", "commit": "82bd4b59432d44cf5e2a5ce3a40a037a575a6623" }, 17 | "nvim-colorizer.lua": { "branch": "master", "commit": "0671e0eabc6842676d3310370e8fae4e1c51d7f9" }, 18 | "nvim-comment": { "branch": "main", "commit": "e9ac16ab056695cad6461173693069ec070d2b23" }, 19 | "nvim-lspconfig": { "branch": "master", "commit": "84f867753f659bfd9319f75bd5eb273a315f2da5" }, 20 | "nvim-tree.lua": { "branch": "master", "commit": "2a268f631da85e83b7a95291be589bcddfc785d8" }, 21 | "nvim-treesitter": { "branch": "master", "commit": "18cf02f5efe677d992fe7f96f395ef40a2f329d2" }, 22 | "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, 23 | "nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" }, 24 | "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, 25 | "prism": { "branch": "main", "commit": "b3a27aa45ce7af0d0f1ddf88b78bf06eca4f13cd" }, 26 | "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, 27 | "telescope.nvim": { "branch": "master", "commit": "df534c3042572fb958586facd02841e10186707c" }, 28 | "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, 29 | "toggleterm.nvim": { "branch": "main", "commit": "137d06fb103952a0fb567882bb8527e2f92d327d" }, 30 | "typescript-tools.nvim": { "branch": "master", "commit": "f8c2e0b36b651c85f52ad5c5373ff8b07adc15a7" }, 31 | "vim-astro": { "branch": "main", "commit": "9b4674ecfe1dd84b5fb9b4de1653975de6e8e2e1" }, 32 | "vim-nix": { "branch": "master", "commit": "e25cd0f2e5922f1f4d3cd969f92e35a9a327ffb0" }, 33 | "vim-prisma": { "branch": "main", "commit": "95c5b25066efb34c75bce78698baa371fe0ee7c2" }, 34 | "yuck.vim": { "branch": "master", "commit": "9b5e0370f70cc30383e1dabd6c215475915fe5c3" } 35 | } 36 | -------------------------------------------------------------------------------- /lua/core/au.lua: -------------------------------------------------------------------------------- 1 | -- Formatting Code on Save 2 | vim.api.nvim_create_autocmd({ "BufWritePre" }, { 3 | callback = function() 4 | for _, client in ipairs(vim.lsp.get_active_clients()) do 5 | if client.attached_buffers[vim.api.nvim_get_current_buf()] then 6 | vim.lsp.buf.format() 7 | return 8 | else 9 | return 10 | end 11 | end 12 | end 13 | }) 14 | 15 | vim.api.nvim_create_autocmd({ "VimEnter" }, { 16 | callback = function(data) 17 | local directory = vim.fn.isdirectory(data.file) == 1 18 | 19 | if not directory then 20 | return 21 | end 22 | 23 | -- change to the directory 24 | vim.cmd.cd(data.file) 25 | 26 | -- open the tree 27 | require("nvim-tree.api").tree.open() 28 | end 29 | }) 30 | -------------------------------------------------------------------------------- /lua/core/cfg.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | M.statusstyle = 'minimal' 3 | M.customSchemes = require("core.colors") 4 | 5 | return M 6 | -------------------------------------------------------------------------------- /lua/core/cmds.lua: -------------------------------------------------------------------------------- 1 | local has_value = function(tab, val) 2 | for _, value in ipairs(tab) do 3 | if value == val then 4 | return true 5 | end 6 | end 7 | return false 8 | end 9 | 10 | local available_themes = { 'blocks', 'fancy', 'minimal' } 11 | vim.api.nvim_create_user_command( 12 | 'StatuslineGlowup', 13 | function(opts) 14 | if has_value(available_themes, opts.args) then 15 | vim.g.statusStyle = opts.args 16 | require("ui.stl").setup(opts.args) 17 | else 18 | print 'Invalid Theme' 19 | end 20 | end, 21 | { 22 | nargs = 1, 23 | complete = function() 24 | return available_themes 25 | end, 26 | } 27 | ) 28 | -------------------------------------------------------------------------------- /lua/core/colors.lua: -------------------------------------------------------------------------------- 1 | local schemes = { 2 | { 3 | name = "natural", 4 | comment = "#545454", 5 | background = "#0b0f10", 6 | darker = "#060809", 7 | black = "#0b0f10", 8 | foreground = "#eeeeee", 9 | cursorline = "#161f21", 10 | cursor = "#eeeeee", 11 | color0 = "#1e2b2e", 12 | color1 = "#cd644b", 13 | color2 = "#417858", 14 | color3 = "#e5993c", 15 | color4 = "#53859f", 16 | color5 = "#be796d", 17 | color6 = "#4a8d7f", 18 | color7 = "#d4d4d4", 19 | color8 = "#1e2b2e", 20 | color9 = "#cd644b", 21 | color10 = "#417858", 22 | color11 = "#e5993c", 23 | color12 = "#53859f", 24 | color13 = "#be796d", 25 | color14 = "#4a8d7f", 26 | color15 = "#d4d4d4", 27 | }, 28 | { 29 | name = "gw", 30 | comment = "#545454", 31 | background = "#1b1b1b", 32 | darker = "#151515", 33 | black = "#1b1b1b", 34 | foreground = "#eeeeee", 35 | cursorline = "#222222", 36 | cursor = "#eeeeee", 37 | color0 = "#3c3c3c", 38 | color1 = "#e45c79", 39 | color2 = "#92bc55", 40 | color3 = "#e0b05c", 41 | color4 = "#589ede", 42 | color5 = "#ea93a9", 43 | color6 = "#5ab1de", 44 | color7 = "#e8e8e8", 45 | color8 = "#383838", 46 | color9 = "#e45c79", 47 | color10 = "#92bc55", 48 | color11 = "#e0b05c", 49 | color12 = "#589ede", 50 | color13 = "#ea93a9", 51 | color14 = "#5ab1de", 52 | color15 = "#e8e8e8", 53 | }, 54 | { 55 | name = "default", 56 | comment = "#585858", 57 | background = "#181818", 58 | darker = "#131313", 59 | black = "#181818", 60 | foreground = "#f8f8f8", 61 | cursorline = "#222222", 62 | cursor = "#f8f8f8", 63 | color0 = "#383838", 64 | color1 = "#ab4642", 65 | color2 = "#a1b56c", 66 | color3 = "#f7ca88", 67 | color4 = "#7cafc2", 68 | color5 = "#ba8baf", 69 | color6 = "#86c1b9", 70 | color7 = "#e8e8e8", 71 | color8 = "#383838", 72 | color9 = "#ab4642", 73 | color10 = "#a1b56c", 74 | color11 = "#f7ca88", 75 | color12 = "#7cafc2", 76 | color13 = "#ba8baf", 77 | color14 = "#86c1b9", 78 | color15 = "#e8e8e8", 79 | }, 80 | { 81 | name = "carburetor", 82 | comment = "#8d8d8d", 83 | background = "#161616", 84 | darker = "#0b0b0b", 85 | black = "#161616", 86 | foreground = "#f5e0dc", 87 | cursorline = "#222222", 88 | cursor = "#f5e0dc", 89 | color0 = "#262626", 90 | color1 = "#ff8389", 91 | color2 = "#42be65", 92 | color3 = "#ff832b", 93 | color4 = "#78a9ff", 94 | color5 = "#be95ff", 95 | color6 = "#82cfff", 96 | color7 = "#e0e0e0", 97 | color8 = "#262626", 98 | color9 = "#ff8389", 99 | color10 = "#42be65", 100 | color11 = "#ff832b", 101 | color12 = "#78a9ff", 102 | color13 = "#be95ff", 103 | color14 = "#82cfff", 104 | color15 = "#e0e0e0", 105 | }, 106 | { 107 | name = "horizon", 108 | comment = "#6C6F93", 109 | background = "#16171e", 110 | darker = "#131419", 111 | black = "#16171e", 112 | foreground = "#d5d8da", 113 | cursorline = "#1b1C23", 114 | cursor = "#d5d8da", 115 | color0 = "#1c1d26", 116 | color1 = "#E95678", 117 | color2 = "#29D398", 118 | color3 = "#FAB795", 119 | color4 = "#26BBD9", 120 | color5 = "#EE64AE", 121 | color6 = "#59E3E3", 122 | color7 = "#f2e6e3", 123 | color8 = "#232530", 124 | color9 = "#EC6A88", 125 | color10 = "#3FDAA4", 126 | color11 = "#FBC3A7", 127 | color12 = "#3FC6DE", 128 | color13 = "#F075B7", 129 | color14 = "#6BE6E6", 130 | color15 = "#f7ebe8", 131 | }, 132 | { 133 | name = "verdant", 134 | comment = "#5a5858", 135 | background = "#0c0c0c", 136 | black = "#0c0c0c", 137 | darker = "#070707", 138 | foreground = "#dbdfdf", 139 | cursorline = "#191919", 140 | cursor = "#dbdfdf", 141 | color0 = "#1b1b1b", 142 | color1 = "#c14d53", 143 | color2 = "#56966e", 144 | color3 = "#dc8c61", 145 | color4 = "#6e95bd", 146 | color5 = "#a56db1", 147 | color6 = "#6a9f98", 148 | color7 = "#b7b7b7", 149 | color8 = "#272727", 150 | color9 = "#da4b52", 151 | color10 = "#57a274", 152 | color11 = "#e1956c", 153 | color12 = "#6fadea", 154 | color13 = "#d466e9", 155 | color14 = "#63c4b5", 156 | color15 = "#d4d5d5", 157 | }, 158 | { 159 | name = "swamp", 160 | background = "#1d1a11", 161 | foreground = "#ebe0bb", 162 | cursorline = "#242015", 163 | comment = "#8b815e", 164 | darker = "#15130c", 165 | cursor = "#ebe0bb", 166 | black = "#1d1a11", -- useful when background is transparent 167 | color0 = "#242115", 168 | color1 = "#ad335b", 169 | color2 = "#7c9151", 170 | color3 = "#b26a89", 171 | color4 = "#db930d", 172 | color5 = "#db930d", 173 | color6 = "#cb7277", 174 | color7 = "#ebe0bb", 175 | color8 = "#292518", 176 | color9 = "#c73667", 177 | color10 = "#8da656", 178 | color12 = "#b06c89", 179 | color11 = "#dfb03a", 180 | color13 = "#dfb03a", 181 | color14 = "#dd8e92", 182 | color15 = "#e1d6b3", 183 | }, 184 | { 185 | name = "stardewnight", 186 | comment = "#676778", 187 | background = "#16161a", 188 | black = "#16161a", 189 | darker = "#15181b", 190 | foreground = "#e9ecf2", 191 | cursorline = "#212126", 192 | cursor = "#e9ecf2", 193 | color0 = "#2a2a30", 194 | color1 = "#f25c5c", 195 | color2 = "#55b682", 196 | color3 = "#ff9c6a", 197 | color4 = "#7aaaff", 198 | color5 = "#f17ac6", 199 | color6 = "#7acaff", 200 | color7 = "#DCDFE4", 201 | color8 = "#2a2a30", 202 | color9 = "#f25c5c", 203 | color10 = "#55b682", 204 | color11 = "#ff9c6a", 205 | color12 = "#7aaaff", 206 | color13 = "#f17ac6", 207 | color14 = "#7acaff", 208 | color15 = "#DCDFE4", 209 | }, 210 | { 211 | name = "radium", 212 | comment = "#515c68", 213 | background = "#101419", 214 | black = "#101419", 215 | darker = "#0c0f12", 216 | foreground = "#d4d4d5", 217 | cursorline = "#111419", 218 | cursor = "#d4d4d5", 219 | color0 = "#181c24", 220 | color1 = "#f87070", 221 | color2 = "#79dcaa", 222 | color3 = "#ffe59e", 223 | color4 = "#7ab0df", 224 | color5 = "#c397d8", 225 | color6 = "#70c0ba", 226 | color7 = "#d4d4d5", 227 | color8 = "#1c2228", 228 | color9 = "#fb7373", 229 | color10 = "#36c692", 230 | color11 = "#fccf67", 231 | color12 = "#5fb0fc", 232 | color13 = "#b77ee0", 233 | color14 = "#54c3d6", 234 | color15 = "#ffffff", 235 | }, 236 | { 237 | name = "nirvana", 238 | comment = "#5a5858", 239 | background = "#121111", 240 | darker = "#0e0d0d", 241 | black = "#121111", 242 | foreground = "#dfdddd", 243 | cursorline = "#191919", 244 | cursor = "#dfdddd", 245 | color0 = "#1b1b1b", 246 | color1 = "#af575b", 247 | color2 = "#7d8a6b", 248 | color3 = "#caac79", 249 | color4 = "#7d95ae", 250 | color5 = "#a07ea7", 251 | color6 = "#6d8f8a", 252 | color7 = "#b7b7b7", 253 | color8 = "#272727", 254 | color9 = "#c15a5e", 255 | color10 = "#8fa176", 256 | color11 = "#d8b170", 257 | color12 = "#8097fb", 258 | color13 = "#b183ba", 259 | color14 = "#8cb5af", 260 | color15 = "#d4d5d5", 261 | }, 262 | { 263 | name = "fullerene", 264 | comment = "#525252", 265 | background = "#0c0c0c", 266 | black = "#0c0c0c", 267 | darker = "#080808", 268 | foreground = "#f4f4f4", 269 | cursorline = "#161616", 270 | cursor = "#f4f4f4", 271 | color0 = "#1f1f1f", 272 | color1 = "#902c3b", 273 | color2 = "#2a8664", 274 | color3 = "#d78438", 275 | color4 = "#546ad8", 276 | color5 = "#875fd4", 277 | color6 = "#1f7a89", 278 | color7 = "#e0e0e0", 279 | color8 = "#262626", 280 | color9 = "#c1374b", 281 | color10 = "#32ae80", 282 | color11 = "#e1a36b", 283 | color12 = "#738be7", 284 | color13 = "#9e7ad5", 285 | color14 = "#2b9eb0", 286 | color15 = "#c6c6c6", 287 | }, 288 | { 289 | name = "kizu", 290 | color0 = '#131718', 291 | color1 = '#ee6a70', 292 | color2 = '#7cd39f', 293 | color3 = '#de876d', 294 | color4 = '#7ba5dd', 295 | color5 = '#c085e9', 296 | color6 = '#7fc8db', 297 | color7 = '#c4c4c4', 298 | color8 = '#151a1c', 299 | color9 = '#e56f74', 300 | color10 = '#7fc59c', 301 | color11 = '#d9845e', 302 | color12 = '#769dd1', 303 | color13 = '#bc85e1', 304 | color14 = '#77bacc', 305 | color15 = '#b7b8b8', 306 | comment = '#6e7071', 307 | background = "#080c0d", 308 | black = '#080c0d', 309 | darker = "#05090a", 310 | foreground = '#C5C8C9', 311 | cursorline = '#0f1415', 312 | }, 313 | { 314 | name = "sweetpastel", 315 | comment = "#515c68", 316 | background = "#171b1e", 317 | black = "#171b1e", 318 | darker = "#15181b", 319 | foreground = "#F8F9FA", 320 | cursorline = "#1B1F23", 321 | cursor = "#F8F9FA", 322 | color0 = "#222629", 323 | color1 = "#E5A3A1", 324 | color2 = "#B4E3AD", 325 | color3 = "#F1C192", 326 | color4 = "#A3CBE7", 327 | color5 = "#CEACE8", 328 | color6 = "#C9D4FF", 329 | color7 = "#EEEFF0", 330 | color8 = "#262b30", 331 | color9 = "#F9B7B5", 332 | color10 = "#C8F7C1", 333 | color11 = "#efc091", 334 | color12 = "#B7DFFB", 335 | color13 = "#E2C0FC", 336 | color14 = "#DDE8FF", 337 | color15 = "#F8F9FA", 338 | }, 339 | { 340 | name = "fovere", 341 | background = "#111012", 342 | foreground = "#e6e6e6", 343 | cursorline = '#1d1a1f', 344 | comment = '#907d8a', 345 | darker = '#0a090b', 346 | cursor = "#e6e6e6", 347 | black = "#111012", 348 | color0 = "#221d23", 349 | color1 = "#cf5555", 350 | color2 = "#58f17f", 351 | color3 = "#f7ba7e", 352 | color4 = "#a7b3fb", 353 | color5 = "#d788f9", 354 | color6 = "#89daec", 355 | color7 = "#dadada", 356 | color8 = "#252027", 357 | color9 = "#df7772", 358 | color10 = "#60c481", 359 | color11 = "#fcc48c", 360 | color12 = "#93a0f0", 361 | color13 = "#c97fe9", 362 | color14 = "#97e2f3", 363 | color15 = "#c9c9c9", 364 | } 365 | } 366 | 367 | return schemes 368 | -------------------------------------------------------------------------------- /lua/core/init.lua: -------------------------------------------------------------------------------- 1 | require("core.au") 2 | require("core.opts") 3 | require("core.keys") 4 | require("core.cmds") 5 | -------------------------------------------------------------------------------- /lua/core/keys.lua: -------------------------------------------------------------------------------- 1 | vim.g.mapleader = ' ' 2 | local map = vim.api.nvim_set_keymap 3 | 4 | -- Moving Between Buffers 5 | map('n', '', 'h', { noremap = true, silent = false }) 6 | map('n', '', 'l', { noremap = true, silent = false }) 7 | map('n', '', 'j', { noremap = true, silent = false }) 8 | map('n', '', 'k', { noremap = true, silent = false }) 9 | 10 | map('n', '', ':NvimTreeToggle', { noremap = true, silent = true }) 11 | 12 | map('n', '', ':ToggleTerm', { noremap = true, silent = true }) 13 | map('n', 't', ':ToggleTerm', { noremap = true, silent = true }) 14 | map('t', '', 'ToggleTerm', { noremap = true, silent = true }) 15 | map('t', 't', 'ToggleTerm', { noremap = true, silent = true }) 16 | 17 | map('n', '', ':CommentToggle', { noremap = true, silent = true }) 18 | map('v', '', ':CommentToggle', { noremap = true, silent = true }) 19 | map('n', 'cc', ':CommentToggle', { noremap = true, silent = true }) 20 | map('v', 'cc', ':CommentToggle', { noremap = true, silent = true }) 21 | 22 | map('n', 'zR', ':lua require("ufo").openAllFolds', { noremap = true, silent = true }) 23 | map('n', 'zM', ':lua require("ufo").closeAllFolds', { noremap = true, silent = true }) 24 | 25 | map('n', 'ff', 'Telescope find_files', { noremap = true, silent = true }) 26 | map('n', 'fr', 'Telescope oldfiles', { noremap = true, silent = true }) 27 | map('n', 'fg', 'Telescope live_grep', { noremap = true, silent = true }) 28 | map('n', 'ct', 'PrismTelescope', { noremap = true, silent = true }) 29 | 30 | map('n', 'f', 'lua vim.lsp.buf.format()', { noremap = true, silent = true }) 31 | 32 | map('n', 'om', 'Mason', { noremap = true, silent = true }) 33 | map('n', 'ol', 'Lazy', { noremap = true, silent = true }) 34 | 35 | 36 | map('n', 'lr', 'LSPRestart', { noremap = true, silent = true }) 37 | map('n', 'lS', 'LSPStop', { noremap = true, silent = true }) 38 | map('n', 'ls', 'LSPStart', { noremap = true, silent = true }) 39 | -------------------------------------------------------------------------------- /lua/core/opts.lua: -------------------------------------------------------------------------------- 1 | local cmd = vim.cmd 2 | local opt = vim.opt 3 | local diagnostic = vim.diagnostic 4 | local g = vim.g 5 | local config = require("core.cfg") 6 | 7 | cmd('autocmd BufEnter * set formatoptions-=cro') 8 | cmd('autocmd BufEnter * setlocal formatoptions-=cro') 9 | 10 | vim.treesitter.language.register('markdown', 'mdx') 11 | opt.hidden = true 12 | g.code_action_menu_window_border = 'single' 13 | opt.ch = 0 14 | g.currentTheme = config.colorscheme 15 | g.theme_cache = vim.fn.stdpath "data" .. "/colors_data/" 16 | g.statusStyle = config.statusstyle 17 | opt.pumheight = 10 18 | opt.fileencoding = 'utf-8' 19 | opt.splitbelow = true 20 | opt.list = true 21 | opt.splitright = true 22 | opt.termguicolors = true 23 | opt.conceallevel = 0 24 | opt.showtabline = 3 25 | opt.tabline = ' ' 26 | opt.showmode = false 27 | opt.backup = false 28 | opt.number = true 29 | opt.relativenumber = true 30 | opt.numberwidth = 3 31 | opt.ruler = false 32 | opt.writebackup = false 33 | opt.updatetime = 300 34 | opt.timeoutlen = 500 35 | opt.clipboard = "unnamedplus" 36 | opt.hlsearch = true 37 | opt.ignorecase = true 38 | opt.scrolloff = 0 39 | opt.sidescrolloff = 5 40 | opt.foldcolumn = '0' -- '0' is not bad 41 | opt.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value 42 | opt.foldlevelstart = 99 43 | opt.foldenable = true 44 | opt.mouse = "a" -- Mouse support for noobs 45 | opt.cursorline = true 46 | opt.tabstop = 2 47 | opt.softtabstop = 2 48 | opt.shiftwidth = 0 49 | opt.autoindent = true 50 | opt.expandtab = true 51 | opt.fillchars:append('eob: ') 52 | opt.listchars:append "space: " 53 | cmd('set lazyredraw') 54 | cmd('set nolist') 55 | opt.laststatus = 0 -- Global Status 56 | diagnostic.config { signs = false } -- Removing diagnostic column 57 | opt.updatetime = 250 58 | opt.shadafile = "NONE" 59 | opt.shadafile = "" 60 | opt.swapfile = false 61 | opt.shortmess:append "sI" 62 | g.loaded_python3_provider = 0 63 | -------------------------------------------------------------------------------- /lua/hls/buf.lua: -------------------------------------------------------------------------------- 1 | local utils = require("prism.utils") 2 | local colors = require("prism.themer"):getColors() 3 | return { 4 | BufflineBufOnActive = { fg = colors.foreground, bg = colors.black }, 5 | BufflineBufOnInactive = { fg = utils.darken(colors.foreground, colors.cursorline, 0.45), bg = utils.lighten(colors.cursorline, colors.foreground, 0.93) }, 6 | BufflineBufOnModified = { fg = colors.color4, bg = colors.black }, 7 | BuffLineBufOffModified = { fg = colors.color4, bg = utils.lighten(colors.cursorline, colors.foreground, 0.93) }, 8 | BufflineBufOnClose = { fg = colors.color9, bg = colors.black }, 9 | BuffLineBufOffClose = { fg = colors.color9, bg = utils.lighten(colors.cursorline, colors.foreground, 0.93) }, 10 | BuffLineTree = { bg = colors.darker, fg = colors.white }, 11 | BuffLineEmpty = { bg = colors.background, fg = colors.white }, 12 | BuffLineEmptyColor = { bg = colors.cursorline, fg = colors.white }, 13 | BuffLineButton = { bg = utils.darken(colors.color4, colors.cursorline, 0.12), fg = colors.color7 }, 14 | BuffLineCloseButton = { bg = colors.color9, fg = colors.black }, 15 | 16 | -- OLD BUFFLINE HIGHLIGHTS 17 | -- BufflineBufOnActive = { bg = colors.color4, fg = colors.black }, 18 | -- BufflineBufOnInactive = { fg = colors.color7, bg = utils.darken(colors.color4, colors.cursorline, 0.04) }, 19 | -- BuffLineBufOnModified = { bg = colors.color4, fg = colors.black }, 20 | -- BuffLineBufOffModified = { fg = colors.color4, bg = utils.darken(colors.color4, colors.cursorline, 0.04) }, 21 | -- BuffLineBufOnClose = { bg = colors.color4, fg = colors.black }, 22 | -- BuffLineBufOffClose = { fg = colors.color9, bg = utils.darken(colors.color9, colors.cursorline, 0.1) }, 23 | 24 | } 25 | -------------------------------------------------------------------------------- /lua/hls/dash.lua: -------------------------------------------------------------------------------- 1 | local utils = require("prism.utils") 2 | local colors = require("prism.themer"):getColors() 3 | 4 | -- IN THIS DIRECTORY YOU CAN ADD ANY NUMBER OF FILES 5 | -- ALL OF THEM RETURN A TABLE WHICH CONTAINS HIGHLIGHTS TO BE ADDED 6 | -- YOUR HIGHLIGHTS WILL BE PREFFERED OVER THE DEFAULTS 7 | 8 | return { 9 | MiniStarterHeader = { fg = colors.color2 }, 10 | MiniStarterFooter = { fg = utils.darken(colors.comment, colors.black, 0.6) }, 11 | MiniStarterItemBullet = { fg = colors.color4 }, 12 | MiniStarterSection = { fg = colors.color4 }, 13 | MiniStarterItem = { fg = colors.comment }, 14 | MiniStarterCurrent = { fg = colors.foreground }, 15 | MiniStarterItemPrefix = { fg = colors.foreground }, 16 | } 17 | -------------------------------------------------------------------------------- /lua/hls/nerdtree.lua: -------------------------------------------------------------------------------- 1 | local utils = require("prism.utils") 2 | local colors = require("prism.themer"):getColors() 3 | return { 4 | NvimTreeFolderIcon = { fg = utils.darken(colors.color3, colors.cursorline, 0.85), bg = colors.darker }, 5 | } 6 | -------------------------------------------------------------------------------- /lua/hls/stl.lua: -------------------------------------------------------------------------------- 1 | local utils = require("prism.utils") 2 | local colors = require("prism.themer"):getColors() 3 | 4 | return { 5 | StalineFolderIcon = { bg = colors.color1, fg = colors.black }, 6 | StalineFolderSep = { bg = colors.black, fg = colors.color1 }, 7 | --StalineFolderText = { bg = colors.cursorline, fg = colors.color1 }, 8 | StalineFolderText = { bg = utils.darken(colors.color1, colors.black, 0.05), fg = colors.color1 }, 9 | StalineFolderTextMinimal = { bg = colors.background, fg = colors.color7 }, 10 | 11 | StalineFilename = { bg = colors.background, fg = colors.color7 }, 12 | StalineFilenameMinimal = { bg = colors.background, fg = colors.color7 }, 13 | StalineFilenameFancy = { bg = colors.cursorline, fg = colors.color7 }, 14 | StalineFilenameSep = { fg = colors.cursorline, bg = colors.black }, 15 | StalineLogo = { bg = colors.black, fg = colors.color12 }, 16 | --StalineProgress = { bg = colors.cursorline, fg = colors.color2 }, 17 | StalineProgress = { bg = utils.darken(colors.color2, colors.black, 0.05), fg = colors.color2 }, 18 | StalineProgressMinimal = { bg = utils.lighten(colors.cursorline, colors.foreground, 0.93), fg = colors.color7 }, 19 | StalineModeMinimal = { bg = utils.lighten(colors.cursorline, colors.foreground, 0.93), fg = colors.color7 }, 20 | StalineProgressSep = { bg = colors.color8, fg = colors.color10 }, 21 | StalineProgressIcon = { bg = colors.color10, fg = colors.color8 }, 22 | StalineBranch = { bg = colors.background, fg = colors.comment }, 23 | StalineModeSepTwo = { bg = colors.cursorline, fg = colors.color8 }, 24 | StalineNormalMode = { bg = colors.color4, fg = colors.black }, 25 | StalineVisualMode = { bg = colors.color11, fg = colors.black }, 26 | StalineCommandMode = { bg = colors.color9, fg = colors.black }, 27 | StalineInsertMode = { bg = colors.color10, fg = colors.black }, 28 | StalineTerminalMode = { bg = colors.color13, fg = colors.black }, 29 | StalineNTerminalMode = { bg = colors.color13, fg = colors.black }, 30 | StalineConfirmMode = { bg = colors.color6, fg = colors.black }, 31 | StalineNormalModeSep = { fg = colors.color4, bg = colors.color8 }, 32 | StalineVisualModeSep = { fg = colors.color11, bg = colors.color8 }, 33 | StalineCommandModeSep = { fg = colors.color9, bg = colors.color8 }, 34 | StalineInsertModeSep = { fg = colors.color10, bg = colors.color8 }, 35 | StalineTerminalModeSep = { fg = colors.color13, bg = colors.color8 }, 36 | StalineNTerminalModeSep = { fg = colors.color13, bg = colors.color8 }, 37 | StalineConfirmModeSep = { fg = colors.color6, bg = colors.color8 }, 38 | StalineEmptySpace = { bg = colors.background, fg = colors.color15 }, 39 | StalineSep = { bg = colors.background, fg = colors.comment }, 40 | StalineNix = { bg = colors.background, fg = colors.color12 }, 41 | StalineLspError = { bg = colors.black, fg = colors.color9 }, 42 | StalineLspInfo = { bg = colors.black, fg = colors.color12 }, 43 | StalineLspHints = { bg = colors.black, fg = colors.color6 }, 44 | StalineLspWarning = { bg = colors.black, fg = colors.color11 }, 45 | StalineLspErrorIcon = { bg = colors.black, fg = colors.color9 }, 46 | StalineLspInfoIcon = { bg = colors.black, fg = colors.color12 }, 47 | StalineLspHintsIcon = { bg = colors.black, fg = colors.color6 }, 48 | StalineLspWarningIcon = { bg = colors.black, fg = colors.color11 }, 49 | --StalineLspNameNormal = { bg = colors.cursorline, fg = colors.color5 }, 50 | StalineLspNameNormal = { bg = utils.darken(colors.color5, colors.black, 0.07), fg = colors.color5 }, 51 | StalineLspName = { bg = utils.darken(colors.color5, colors.black, 0.07), fg = colors.color5 }, 52 | StalineLspNameMinimal = { bg = colors.background, fg = colors.color7 }, 53 | StalineLspIcon = { bg = colors.color13, fg = colors.black }, 54 | StalineDiffAdd = { bg = colors.background, fg = colors.color10 }, 55 | StalineDiffAddFancy = { bg = utils.darken(colors.color2, colors.black, 0.07), fg = colors.color10 }, 56 | StalineDiffAddMinimal = { bg = colors.black, fg = colors.comment }, 57 | StalineDiffChange = { bg = colors.background, fg = colors.color11 }, 58 | StalineDiffChangeFancy = { bg = utils.darken(colors.color11, colors.black, 0.07), fg = colors.foreground }, 59 | StalineDiffChangeMinimal = { bg = colors.black, fg = colors.comment }, 60 | StalineDiffRemoveFancy = { bg = colors.black, fg = colors.color9 }, 61 | StalineDiffRemoveMinimal = { bg = colors.black, fg = colors.comment }, 62 | StalineDiffRemove = { bg = colors.background, fg = colors.color9 }, 63 | StalineDefaultFile = { bg = colors.background, fg = colors.foreground }, 64 | } 65 | -------------------------------------------------------------------------------- /lua/plugs/README.md: -------------------------------------------------------------------------------- 1 | ### Plugins 2 | 3 | Specific language based plugins are not included 4 | 5 | | Plugin | Description | Lazy | 6 | | ------------- |-------------| :-----:| 7 | | [folke/lazy](https://github.com/folke/lazy.nvim) | the package manager, better than packer.nvim for newbies | `false` | 8 | | [chadcat7/prism](https://github.com/chadcat7/prism) | my own plugin written for making fast colorschemes | `true` | 9 | | [nvim-treesitter/nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) | syntax highlighting, most popular one for neovim | `true` | 10 | | [NvChad/nvim-colorizer.lua](https://github.com/NvChad/nvim-colorizer.lua) | highlights colors and is really frickin fast | `true` | 11 | | [kyazdani42/nvim-tree.lua](https://github.com/kyazdani42/nvim-tree.lua) | a very neat, simple and clean file tree | `true` | 12 | | [nvim-tree/nvim-web-devicons](https://github.com/nvim-tree/nvim-web-devicons) | lua fork of vim devicons | `true` 13 | | [nvim-telescope/telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) | probably the most popular menu. can be used for a lot of stuff | `true` | 14 | | [akinsho/toggleterm.nvim](https://github.com/akinsho/toggleterm.nvim) | terminal integration in neovim | `true` | 15 | | [lewis6991/gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim) | Super fast git decorations implemented purely in Lua. | `true` | 16 | | [lukas-reineke/indent-blankline.nvim](https://github.com/lukas-reineke/indent-blankline.nvim) | super cool for keeping track of code | `true` | 17 | | [williamboman/mason.nvim](https://github.com/williamboman/mason.nvim) | installing LSPs made super easy | `true` | 18 | | [L3MON4D3/LuaSnip](https://github.com/L3MON4D3/LuaSnip) | very simple and easy to use snippet engine | `true` | 19 | | [echasnovski/mini.starter](https://github.com/echasnovski/mini.starter) | a very minimal and good looking dashboard | `true` | 20 | | [terrortylor/nvim-comment](https://github.com/terrortylor/nvim-comment) | quik and easy commenting | `true` | 21 | | [folke/todo-comments.nvim](https://github.com/folke/todo-comments.nvim) | beautiful highlights for TODO comments | `true` | 22 | 23 | -------------------------------------------------------------------------------- /lua/plugs/cmds.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.toggleterm = { 4 | "ToggleTerm", 5 | "ToggleTermAll", 6 | "ToggleTermSendCurrentLine", 7 | "ToggleTermSendVisualSelection", 8 | "ToggleTermSendVisualLine", 9 | "ToggleTermSetName", 10 | } 11 | 12 | M.treesitter = { 13 | "TSInstall", 14 | "TSBufEnable", 15 | "TSBufDisable", 16 | "TSEnable", 17 | "TSDisable", 18 | "TSModuleInfo", 19 | } 20 | 21 | return M 22 | -------------------------------------------------------------------------------- /lua/plugs/init.lua: -------------------------------------------------------------------------------- 1 | require("plugs.strap") 2 | local lazy = require("lazy") 3 | lazy.setup({ 4 | { 5 | 'nvim-treesitter/nvim-treesitter', 6 | run = ":TSUpdate", 7 | lazy = true, 8 | cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSModuleInfo" }, 9 | config = function() require('plugs.ts.treesitter') end 10 | }, 11 | { 12 | 'windwp/nvim-ts-autotag', 13 | event = "InsertEnter", 14 | lazy = true 15 | }, 16 | { 17 | 'NvChad/nvim-colorizer.lua', 18 | event = 'BufRead', 19 | config = function() require('plugs.ui.colorizer') end, 20 | lazy = true 21 | }, 22 | { 23 | "nvim-tree/nvim-web-devicons", 24 | event = 'BufRead', 25 | config = function() require('plugs.ui.devicons') end, 26 | lazy = true, 27 | }, 28 | { 29 | "lukas-reineke/indent-blankline.nvim", 30 | main = "ibl", 31 | opts = {}, 32 | event = "BufReadPost", 33 | config = function() 34 | require("ibl").setup() 35 | end 36 | }, 37 | { 38 | 'kyazdani42/nvim-tree.lua', 39 | lazy = true, 40 | cmd = "NvimTreeToggle", 41 | config = function() require('plugs.util.nvim-tree') end 42 | }, 43 | { 44 | 'nvim-lua/plenary.nvim', 45 | lazy = true, 46 | }, 47 | { 48 | 'nvim-telescope/telescope.nvim', 49 | cmd = "Telescope", 50 | lazy = true, 51 | dependencies = { 'plenary.nvim' }, 52 | config = function() require('plugs.util.telescope') end 53 | }, 54 | { 55 | "terrortylor/nvim-comment", 56 | event = "BufRead", 57 | config = function() 58 | require('nvim_comment').setup({ create_mappings = true }) 59 | end 60 | }, 61 | { 62 | "akinsho/toggleterm.nvim", 63 | lazy = true, 64 | config = function() require('plugs.util.toggleterm') end, 65 | cmd = "ToggleTerm", 66 | }, 67 | { 68 | "lewis6991/gitsigns.nvim", 69 | lazy = true, 70 | event = { "BufRead" }, 71 | config = function() 72 | require("plugs.ui.gitsigns") 73 | end 74 | }, 75 | { 76 | "williamboman/mason.nvim", 77 | cmd = { 78 | "MasonInstall", 79 | "MasonUninstall", 80 | "Mason", 81 | "MasonUninstallAll", 82 | "MasonLog", 83 | }, 84 | lazy = true, 85 | config = function() require('plugs.lsp.mason') end, 86 | }, 87 | { 88 | "neovim/nvim-lspconfig", 89 | event = { "BufReadPost", "BufNewFile" }, 90 | lazy = true, 91 | cmd = { "LspInfo", "LspInstall", "LspUninstall", "LspStart" }, 92 | config = function() 93 | require "plugs.lsp.lspconfig" 94 | end, 95 | }, 96 | 97 | -- load luasnips + cmp related in insert mode only 98 | { 99 | "hrsh7th/nvim-cmp", 100 | event = "InsertEnter", 101 | lazy = true, 102 | dependencies = { 103 | { 104 | -- snippet plugin 105 | "L3MON4D3/LuaSnip", 106 | lazy = true, 107 | dependencies = "rafamadriz/friendly-snippets", 108 | config = function() 109 | require("plugs.lsp.luasnip") 110 | end, 111 | }, 112 | 113 | -- autopairing of (){}[] etc 114 | { 115 | "windwp/nvim-autopairs", 116 | opts = { 117 | fast_wrap = {}, 118 | disable_filetype = { "TelescopePrompt", "vim" }, 119 | }, 120 | event = "InsertEnter", 121 | lazy = true, 122 | config = function(_, opts) 123 | require("nvim-autopairs").setup(opts) 124 | 125 | -- setup cmp for autopairs 126 | local cmp_autopairs = require "nvim-autopairs.completion.cmp" 127 | require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done()) 128 | end, 129 | }, 130 | 131 | -- cmp sources plugins 132 | { 133 | "saadparwaiz1/cmp_luasnip", 134 | "hrsh7th/cmp-nvim-lua", 135 | "hrsh7th/cmp-nvim-lsp", 136 | "hrsh7th/cmp-buffer", 137 | "hrsh7th/cmp-path", 138 | }, 139 | }, 140 | config = function() 141 | require("plugs.lsp.cmp") 142 | end, 143 | }, 144 | { 145 | "nvim-telescope/telescope-ui-select.nvim", 146 | lazy = true 147 | }, 148 | { 149 | "folke/todo-comments.nvim", 150 | dependencies = { "nvim-lua/plenary.nvim" }, 151 | event = { "BufReadPost", "InsertEnter" }, 152 | opts = { 153 | signs = false, 154 | } 155 | }, 156 | { 157 | 'echasnovski/mini.starter', 158 | version = false, 159 | lazy = false, 160 | config = function() 161 | require("plugs.ui.starter") 162 | end 163 | }, 164 | { 165 | "chadcat7/prism", 166 | lazy = true, 167 | event = "UIEnter", 168 | config = function() 169 | require("plugs.ui.prism") 170 | end 171 | }, 172 | { 173 | "wuelnerdotexe/vim-astro", 174 | ft = "astro" 175 | }, 176 | { 177 | "davidmh/mdx.nvim", 178 | config = true, 179 | event = "BufEnter *.mdx", 180 | dependencies = { "nvim-treesitter/nvim-treesitter" } 181 | }, 182 | { 183 | "pmizio/typescript-tools.nvim", 184 | dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" }, 185 | opts = {}, 186 | event = "BufRead", 187 | ft = { "ts", "astro", "tsx", "jsx", "js", "vue" } 188 | }, 189 | { 190 | 'prisma/vim-prisma', 191 | ft = "prisma" 192 | }, 193 | { 194 | "elkowar/yuck.vim", 195 | ft = "yuck" 196 | }, 197 | { 198 | "LnL7/vim-nix", 199 | lazy = true, 200 | ft = 'nix', 201 | }, 202 | }, { 203 | ui = { 204 | size = { width = 0.8, height = 0.8 }, 205 | border = "solid", 206 | icons = { 207 | cmd = " ", 208 | config = "", 209 | event = "", 210 | ft = " ", 211 | init = " ", 212 | import = " ", 213 | keys = " ", 214 | lazy = "鈴 ", 215 | loaded = "●", 216 | not_loaded = "○", 217 | plugin = " ", 218 | runtime = " ", 219 | source = " ", 220 | start = "", 221 | task = "✔ ", 222 | list = { "●", "➜", "★", "‒" }, 223 | }, 224 | throttle = 20, 225 | }, 226 | defaults = { lazy = true }, 227 | performance = { 228 | cache = { 229 | enabled = true, 230 | path = vim.fn.stdpath("cache") .. "/lazy/cache", 231 | ttl = 3600 * 24 * 5, 232 | disable_events = { "VimEnter", "BufReadPre", "UIEnter" }, 233 | }, 234 | reset_packpath = true, 235 | rtp = { 236 | disabled_plugins = { 237 | "2html_plugin", 238 | "getscript", 239 | "getscriptPlugin", 240 | "gzip", 241 | "netrw", 242 | "netrwPlugin", 243 | "netrwSettings", 244 | "netrwFileHandlers", 245 | "logipat", 246 | "matchit", 247 | "matchparen", 248 | "tar", 249 | "tarPlugin", 250 | "rrhelper", 251 | "spellfile_plugin", 252 | "vimball", 253 | "vimballPlugin", 254 | "zip", 255 | "zipPlugin", 256 | "logipat", 257 | "matchit", 258 | "tutor", 259 | "rplugin", 260 | "syntax", 261 | "synmenu", 262 | "optwin", 263 | "compiler", 264 | "bugreport", 265 | "ftplugin", 266 | "archlinux", 267 | "fzf", 268 | "tutor_mode_plugin", 269 | "sleuth", 270 | "vimgrep" 271 | }, 272 | }, 273 | }, 274 | } 275 | ) 276 | -------------------------------------------------------------------------------- /lua/plugs/lsp/cmp.lua: -------------------------------------------------------------------------------- 1 | local cmp = require("cmp") 2 | 3 | local symbol_map = { 4 | Text = "󰉿 ", 5 | Method = "󰆧 ", 6 | Function = "󰡱 ", 7 | Constructor = " ", 8 | Field = "󰜢 ", 9 | Variable = "󰘥 ", 10 | Class = "󰠱", 11 | Interface = " ", 12 | Module = " ", 13 | Property = "󰜢 ", 14 | Unit = "󰑭", 15 | Value = "󰎠 ", 16 | Enum = " ", 17 | Keyword = "󰌋 ", 18 | Snippet = " ", 19 | Color = "󰏘", 20 | File = "󰈙", 21 | Reference = "󰈇 ", 22 | Folder = "󰉋 ", 23 | EnumMember = " ", 24 | Constant = "󰭍 ", 25 | Struct = "󰙅 ", 26 | Event = " ", 27 | Operator = "󰆕 ", 28 | } 29 | local options = { 30 | completion = { 31 | completeopt = "menu,menuone", 32 | }, 33 | preselect = cmp.PreselectMode.Item, 34 | snippet = { 35 | expand = function(args) 36 | require("luasnip").lsp_expand(args.body) 37 | end, 38 | }, 39 | window = { 40 | documentation = { 41 | winhighlight = "Normal:CmpDoc", 42 | }, 43 | completion = { 44 | winhighlight = "Normal:Pmenu", 45 | scrollbar = false, 46 | }, 47 | }, 48 | formatting = { 49 | fields = { "kind", "abbr", "menu" }, 50 | format = function(_, item) 51 | local a = string.rep(" ", 10) 52 | item.abbr = item.abbr .. a 53 | item.menu = " " .. item.kind .. " " 54 | item.kind = " " .. symbol_map[item.kind] .. " " 55 | return item 56 | end, 57 | }, 58 | mapping = { 59 | [""] = cmp.mapping.select_prev_item(), 60 | [""] = cmp.mapping.select_next_item(), 61 | [""] = cmp.mapping.scroll_docs(-4), 62 | [""] = cmp.mapping.scroll_docs(4), 63 | [""] = cmp.mapping.complete(), 64 | [""] = cmp.mapping.close(), 65 | [""] = cmp.mapping.confirm { 66 | behavior = cmp.ConfirmBehavior.Replace, 67 | select = false, 68 | }, 69 | [""] = cmp.mapping(function(fallback) 70 | if cmp.visible() then 71 | cmp.select_next_item() 72 | elseif require("luasnip").expand_or_jumpable() then 73 | vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-expand-or-jump", true, true, true), "") 74 | else 75 | fallback() 76 | end 77 | end, 78 | { 79 | "i", 80 | "s", 81 | }), 82 | [""] = cmp.mapping(function(fallback) 83 | if cmp.visible() then 84 | cmp.select_prev_item() 85 | elseif require("luasnip").jumpable(-1) then 86 | vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-jump-prev", true, true, true), "") 87 | else 88 | fallback() 89 | end 90 | end, { 91 | "i", 92 | "s", 93 | }), 94 | }, 95 | sources = { 96 | { name = "luasnip" }, 97 | { name = "nvim_lsp" }, 98 | { name = "buffer" }, 99 | { name = "nvim_lua" }, 100 | { name = "path" }, 101 | }, 102 | } 103 | 104 | cmp.setup(options) 105 | -------------------------------------------------------------------------------- /lua/plugs/lsp/lspconfig.lua: -------------------------------------------------------------------------------- 1 | local lspconfig = require("lspconfig") 2 | 3 | local M = {} 4 | 5 | M.on_attach = function(client, _) 6 | client.server_capabilities.documentFormattingProvider = true 7 | client.server_capabilities.documentRangeFormattingProvider = true 8 | end 9 | 10 | M.capabilities = vim.lsp.protocol.make_client_capabilities() 11 | 12 | M.capabilities.textDocument.foldingRange = { 13 | dynamicRegistration = false, 14 | lineFoldingOnly = true 15 | } 16 | 17 | M.capabilities.textDocument.completion.completionItem = { 18 | documentationFormat = { "markdown", "plaintext" }, 19 | snippetSupport = true, 20 | preselectSupport = true, 21 | insertReplaceSupport = true, 22 | labelDetailsSupport = true, 23 | deprecatedSupport = true, 24 | commitCharactersSupport = true, 25 | tagSupport = { valueSet = { 1 } }, 26 | resolveSupport = { 27 | properties = { 28 | "documentation", 29 | "detail", 30 | "additionalTextEdits", 31 | }, 32 | }, 33 | } 34 | 35 | 36 | local servers = { "html", "pyright", "emmet_ls", "clangd", "cssls", "rnix", "hls", "gopls", 37 | "astro", "vuels" } 38 | 39 | for _, k in ipairs(servers) do 40 | lspconfig[k].setup { 41 | } 42 | end 43 | 44 | -- lspconfig.ts_ls.setup { 45 | -- on_attach = M.on_attach, 46 | -- capabilities = M.capabilities, 47 | -- init_options = { 48 | -- preferences = { includeCompletionsForModuleExports = false } 49 | -- } 50 | -- } 51 | 52 | 53 | lspconfig.rust_analyzer.setup { 54 | filetypes = { "rust" }, 55 | cmd = { "rustup", "run", "stable", "rust-analyzer" }, 56 | } 57 | 58 | lspconfig.lua_ls.setup { 59 | on_attach = M.on_attach, 60 | capabilities = M.capabilities, 61 | 62 | settings = { 63 | Lua = { 64 | completion = { 65 | callSnippet = "Replace" 66 | }, 67 | diagnostics = { 68 | globals = { "vim", "awesome", "client", "screen", "mouse", "tag" }, 69 | }, 70 | }, 71 | } 72 | } 73 | 74 | return M 75 | -------------------------------------------------------------------------------- /lua/plugs/lsp/luasnip.lua: -------------------------------------------------------------------------------- 1 | local luasnip = require("luasnip") 2 | local options = { 3 | history = true, 4 | updateevents = "TextChanged,TextChangedI", 5 | } 6 | 7 | luasnip.config.set_config(options) 8 | require("luasnip.loaders.from_vscode").lazy_load() 9 | require("luasnip.loaders.from_vscode").lazy_load { paths = vim.g.luasnippets_path or "" } 10 | 11 | vim.api.nvim_create_autocmd("InsertLeave", { 12 | callback = function() 13 | if 14 | require("luasnip").session.current_nodes[vim.api.nvim_get_current_buf()] 15 | and not require("luasnip").session.jump_active 16 | then 17 | require("luasnip").unlink_current() 18 | end 19 | end, 20 | }) 21 | -------------------------------------------------------------------------------- /lua/plugs/lsp/mason.lua: -------------------------------------------------------------------------------- 1 | local mason = require("mason") 2 | 3 | local options = { 4 | ensure_installed = { "lua-language-server" }, -- not an option from mason.nvim 5 | 6 | ui = { 7 | icons = { 8 | package_pending = " ", 9 | package_installed = " ", 10 | package_uninstalled = "󰚌", 11 | }, 12 | 13 | keymaps = { 14 | toggle_server_expand = "", 15 | install_server = "i", 16 | update_server = "u", 17 | check_server_version = "c", 18 | update_all_servers = "U", 19 | check_outdated_servers = "C", 20 | uninstall_server = "X", 21 | cancel_installation = "", 22 | }, 23 | }, 24 | 25 | max_concurrent_installers = 10, 26 | } 27 | 28 | 29 | 30 | mason.setup(options) 31 | -------------------------------------------------------------------------------- /lua/plugs/strap.lua: -------------------------------------------------------------------------------- 1 | local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" 2 | if not vim.loop.fs_stat(lazypath) then 3 | vim.fn.system({ 4 | "git", 5 | "clone", 6 | "https://github.com/folke/lazy.nvim.git", 7 | lazypath, 8 | }) 9 | end 10 | vim.opt.rtp:prepend(lazypath) 11 | -------------------------------------------------------------------------------- /lua/plugs/ts/autopair.lua: -------------------------------------------------------------------------------- 1 | require("nvim-autopairs").setup {} 2 | -------------------------------------------------------------------------------- /lua/plugs/ts/treesitter.lua: -------------------------------------------------------------------------------- 1 | require 'nvim-treesitter.configs'.setup { 2 | -- A list of parser names, or "all" 3 | ensure_installed = { "python", "javascript", "lua", "markdown", "markdown_inline" }, 4 | 5 | -- Install parsers synchronously (only applied to `ensure_installed`) 6 | sync_install = false, 7 | 8 | -- Automatically install missing parsers when entering buffer 9 | auto_install = true, 10 | 11 | 12 | highlight = { 13 | -- `false` will disable the whole extension 14 | 15 | -- Setting this to true will run `:h syntax` and tree-sitter at the same time. 16 | -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). 17 | -- Using this option may slow down your editor, and you may see some duplicate highlights. 18 | -- Instead of true it can also be a list of languages 19 | additional_vim_regex_highlighting = false, 20 | }, 21 | autotag = { -- Auto tag html 22 | enable = true, 23 | filetypes = { "html", "xml", "javascriptreact", "typescriptreact" }, 24 | }, 25 | rainbow = { 26 | enable = true, 27 | -- disable = { "jsx", "cpp" }, list of languages you want to disable the plugin for 28 | extended_mode = false, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean 29 | max_file_lines = nil, -- colors = {}, -- table of hex stringsnes = nil, -- Do not enable for files with more than n lines, int 30 | -- termcolors = {} -- table of colour name strings 31 | }, 32 | } 33 | -------------------------------------------------------------------------------- /lua/plugs/ui/colorizer.lua: -------------------------------------------------------------------------------- 1 | require 'colorizer'.setup({ 2 | filetypes = { "*" }, 3 | user_default_options = { 4 | RGB = true, -- #RGB hex codes 5 | RRGGBB = true, -- #RRGGBB hex codes 6 | names = false, -- "Name" codes like Blue or blue 7 | RRGGBBAA = true, -- #RRGGBBAA hex codes 8 | AARRGGBB = false, -- 0xAARRGGBB hex codes 9 | rgb_fn = true, -- CSS rgb() and rgba() functions 10 | hsl_fn = true, -- CSS hsl() and hsla() functions 11 | css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB 12 | css_fn = false, -- Enable all CSS *functions*: rgb_fn, hsl_fn 13 | -- Available modes for `mode`: foreground, background, virtualtext 14 | mode = "background", -- Set the display mode. 15 | -- Available methods are false / true / "normal" / "lsp" / "both" 16 | -- True is same as normal 17 | tailwind = true, -- Enable tailwind colors 18 | -- parsers can contain values used in |user_default_options| 19 | sass = { enable = false, parsers = { "css" }, }, -- Enable sass colors 20 | virtualtext = "■", 21 | }, 22 | }) 23 | 24 | vim.defer_fn(function() 25 | require("colorizer").attach_to_buffer(0) 26 | end, 0) 27 | -------------------------------------------------------------------------------- /lua/plugs/ui/devicons.lua: -------------------------------------------------------------------------------- 1 | local devicons = require("nvim-web-devicons") 2 | 3 | local config = { 4 | override = { 5 | c = { icon = "", name = "C" }, 6 | css = { icon = "", name = "CSS" }, 7 | deb = { icon = "", name = "Deb" }, 8 | Dockerfile = { 9 | icon = "", 10 | name = "Dockerfile", 11 | }, 12 | md = { icon = "" }, 13 | astro = { icon = "󰑣", name = "SVELTE" }, 14 | html = { icon = "", name = "HTML" }, 15 | jpeg = { icon = " ", name = "JPEG" }, 16 | jpg = { icon = " ", name = "JPG" }, 17 | js = { icon = " ", name = "JS" }, 18 | kt = { icon = "", name = "Kt" }, 19 | lock = { icon = "󰌾", name = "Lock" }, 20 | mp3 = { icon = "󰎈", name = "MP3" }, 21 | mp4 = { icon = "", name = "MP4" }, 22 | out = { icon = "", name = "Out" }, 23 | png = { icon = "", name = "PNG" }, 24 | py = { icon = "", name = "Py" }, 25 | rust = { icon = "󱘗", name = "Rust" }, 26 | ["robots.txt"] = { 27 | icon = "󱚣", 28 | name = "robots", 29 | }, 30 | toml = { icon = "", name = "TOML" }, 31 | ts = { icon = "󰛦", name = "TS" }, 32 | ttf = { 33 | icon = "", 34 | name = "TrueTypeFont", 35 | }, 36 | rb = { icon = "󰴭" }, 37 | yuck = { icon = "󰇷", name = "Yuck" }, 38 | vim = { icon = "", name = "Vim" }, 39 | rpm = { icon = "", name = "RPM" }, 40 | vue = { icon = "󰡄", name = "Vue" }, 41 | woff = { 42 | icon = "", 43 | name = "WebOpenFontFormat", 44 | }, 45 | woff2 = { 46 | icon = "", 47 | name = "WebOpenFontFormat2", 48 | }, 49 | xz = { icon = "", name = "XZ" }, 50 | zip = { icon = "", name = "Zip" }, 51 | }, 52 | default = true, 53 | } 54 | 55 | devicons.set_default_icon("󰈚") 56 | devicons.setup(config) 57 | -------------------------------------------------------------------------------- /lua/plugs/ui/gitsigns.lua: -------------------------------------------------------------------------------- 1 | require('gitsigns').setup { 2 | signs = { 3 | add = { text = '┃' }, 4 | change = { text = '┃' }, 5 | delete = { text = '_' }, 6 | topdelete = { text = '‾' }, 7 | changedelete = { text = '~' }, 8 | untracked = { text = '┆' }, 9 | }, 10 | signs_staged = { 11 | add = { text = '┃' }, 12 | change = { text = '┃' }, 13 | delete = { text = '_' }, 14 | topdelete = { text = '‾' }, 15 | changedelete = { text = '~' }, 16 | untracked = { text = '┆' }, 17 | }, 18 | signs_staged_enable = true, 19 | signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` 20 | numhl = false, -- Toggle with `:Gitsigns toggle_numhl` 21 | linehl = false, -- Toggle with `:Gitsigns toggle_linehl` 22 | word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` 23 | watch_gitdir = { 24 | follow_files = true 25 | }, 26 | auto_attach = true, 27 | attach_to_untracked = false, 28 | current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` 29 | current_line_blame_opts = { 30 | virt_text = true, 31 | virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' 32 | delay = 1000, 33 | ignore_whitespace = false, 34 | virt_text_priority = 100, 35 | use_focus = true, 36 | }, 37 | current_line_blame_formatter = ', - ', 38 | sign_priority = 6, 39 | update_debounce = 100, 40 | status_formatter = nil, -- Use default 41 | max_file_length = 40000, -- Disable if file is longer than this (in lines) 42 | preview_config = { 43 | -- Options passed to nvim_open_win 44 | border = 'single', 45 | style = 'minimal', 46 | relative = 'cursor', 47 | row = 0, 48 | col = 1 49 | }, 50 | } 51 | -------------------------------------------------------------------------------- /lua/plugs/ui/prism.lua: -------------------------------------------------------------------------------- 1 | local cfg = require("core.cfg") 2 | 3 | require("prism"):setup({ 4 | customSchemes = cfg.customSchemes, 5 | currentTheme = "fovere", 6 | reset = false, 7 | customFiles = vim.fn.stdpath "config" .. "/lua/hls", 8 | transparent = false, 9 | reload = {}, 10 | }) 11 | -------------------------------------------------------------------------------- /lua/plugs/ui/starter.lua: -------------------------------------------------------------------------------- 1 | local stats = require("lazy").stats() 2 | local starter = require('mini.starter') 3 | starter.setup({ 4 | evaluate_single = true, 5 | items = { 6 | { name = 'search project', action = 'Telescope find_files', section = 'Actions' }, 7 | { name = 'live grep', action = 'Telescope live_grep', section = 'Actions' }, 8 | { name = 'change colorscheme', action = 'PrismTelescope', section = 'Actions' }, 9 | starter.sections.recent_files(4, false), 10 | }, 11 | footer = "loaded " .. stats.count .. " plugins", 12 | header = "ฅ^•ﻌ•^ฅ", 13 | content_hooks = { 14 | starter.gen_hook.adding_bullet("> "), 15 | starter.gen_hook.aligning('center', 'top'), 16 | starter.gen_hook.padding(3, 5), 17 | }, 18 | }) 19 | -------------------------------------------------------------------------------- /lua/plugs/util/nvim-tree.lua: -------------------------------------------------------------------------------- 1 | require 'nvim-tree'.setup { 2 | renderer = { 3 | root_folder_label = false, 4 | indent_markers = { 5 | enable = true, 6 | }, 7 | icons = { 8 | glyphs = { 9 | default = ' ', 10 | symlink = ' ', 11 | git = { 12 | untracked = " ", 13 | } 14 | }, 15 | show = { 16 | git = true, 17 | folder = true, 18 | file = true, 19 | folder_arrow = false, 20 | } 21 | } 22 | }, 23 | actions = { 24 | open_file = { 25 | window_picker = { 26 | exclude = { 27 | filetype = { 28 | "packer", 29 | "qf" 30 | }, 31 | buftype = { 32 | "terminal", 33 | "help" 34 | } 35 | }, 36 | }, 37 | }, 38 | }, 39 | filters = { 40 | exclude = { '.git', 'node_modules', '.cache' }, 41 | }, 42 | update_focused_file = { 43 | enable = true, 44 | update_root = true, 45 | }, 46 | git = { 47 | enable = true, 48 | ignore = false, 49 | timeout = 500, 50 | }, 51 | hijack_directories = { enable = true }, 52 | view = { 53 | width = "20%", 54 | side = "left", 55 | }, 56 | } 57 | vim.cmd [[ 58 | autocmd BufEnter * ++nested if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif 59 | nnoremap cd :cd %:p:h:pwd 60 | ]] 61 | -------------------------------------------------------------------------------- /lua/plugs/util/telescope.lua: -------------------------------------------------------------------------------- 1 | local actions = require('telescope.actions') 2 | require('telescope').setup { 3 | defaults = { 4 | layout_config = { 5 | horizontal = { 6 | prompt_position = "bottom", 7 | preview_width = 0.55, 8 | results_width = 0.8, 9 | }, 10 | vertical = { 11 | mirror = false, 12 | }, 13 | width = 0.69, 14 | height = 0.75, 15 | preview_cutoff = 120, 16 | }, 17 | find_command = { 18 | 'rg', '--no-heading', '--with-filename', '--line-number', '--column', '--smart-case' 19 | }, 20 | prompt_prefix = "  ", 21 | selection_caret = " ", 22 | entry_prefix = " ", 23 | initial_mode = "insert", 24 | selection_strategy = "reset", 25 | sorting_strategy = "ascending", 26 | layout_strategy = "horizontal", 27 | file_sorter = require 'telescope.sorters'.get_fuzzy_file, 28 | file_ignore_patterns = {}, 29 | generic_sorter = require 'telescope.sorters'.get_generic_fuzzy_sorter, 30 | path_display = {}, 31 | winblend = 0, 32 | border = {}, 33 | borderchars = { '─', '│', '─', '│', '╭', '╮', '╯', '╰' }, 34 | color_devicons = true, 35 | use_less = true, 36 | set_env = { ['COLORTERM'] = 'truecolor' }, -- default = nil, 37 | file_previewer = require 'telescope.previewers'.vim_buffer_cat.new, 38 | grep_previewer = require 'telescope.previewers'.vim_buffer_vimgrep.new, 39 | qflist_previewer = require 'telescope.previewers'.vim_buffer_qflist.new, 40 | buffer_previewer_maker = require 'telescope.previewers'.buffer_previewer_maker, 41 | mappings = { 42 | i = { 43 | [""] = actions.move_selection_next, 44 | [""] = actions.move_selection_previous, 45 | [""] = actions.smart_send_to_qflist + actions.open_qflist, 46 | [""] = actions.close, 47 | [""] = actions.select_default + actions.center 48 | }, 49 | n = { 50 | [""] = actions.move_selection_next, 51 | [""] = actions.move_selection_previous, 52 | [""] = actions.smart_send_to_qflist + actions.open_qflist 53 | } 54 | } 55 | }, 56 | extensions = { 57 | ["ui-select"] = { 58 | require("telescope.themes").get_dropdown { 59 | -- even more opts 60 | } 61 | } 62 | } 63 | } 64 | require("telescope").load_extension("ui-select") 65 | -------------------------------------------------------------------------------- /lua/plugs/util/toggleterm.lua: -------------------------------------------------------------------------------- 1 | require "toggleterm".setup { 2 | size = 13, 3 | shading_factor = '-27', 4 | open_mapping = [[]], 5 | shade_filetypes = { "toggleterm" }, 6 | shade_terminals = true, 7 | start_in_insert = true, 8 | persist_size = true, 9 | direction = 'horizontal', 10 | float_opts = { 11 | winblend = 3, 12 | }, 13 | winbar = { 14 | enabled = false, 15 | }, 16 | close_on_exit = true, 17 | } 18 | -------------------------------------------------------------------------------- /lua/ui/buf/fn.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | M.bufilter = function() 3 | local bufs = vim.api.nvim_list_bufs() or nil 4 | 5 | if not bufs then 6 | return {} 7 | end 8 | 9 | for i = #bufs, 1, -1 do 10 | local filename = (#vim.api.nvim_buf_get_name(bufs[i]) ~= 0) and 11 | vim.fn.fnamemodify(vim.api.nvim_buf_get_name(bufs[i]), ":t") or 12 | "" 13 | if not vim.api.nvim_buf_is_valid(bufs[i]) or not vim.bo[bufs[i]].buflisted or not vim.api.nvim_buf_is_loaded(bufs[i]) or filename == '' then 14 | table.remove(bufs, i) 15 | end 16 | end 17 | 18 | return bufs 19 | end 20 | 21 | M.tabuflinePrev = function() 22 | local bufs = M.bufilter() 23 | for i, v in ipairs(bufs) do 24 | if vim.api.nvim_get_current_buf() == v then 25 | vim.cmd(i == 1 and "b" .. bufs[#bufs] or "b" .. bufs[i - 1]) 26 | break 27 | end 28 | end 29 | end 30 | M.tabuflineNext = function() 31 | local bufs = M.bufilter() 32 | 33 | for i, v in ipairs(bufs) do 34 | if vim.api.nvim_get_current_buf() == v then 35 | vim.cmd(i == #bufs and "b" .. bufs[1] or "b" .. bufs[i + 1]) 36 | break 37 | end 38 | end 39 | end 40 | 41 | 42 | M.close_buffer = function(bufnr) 43 | if vim.bo.buftype == "terminal" then 44 | vim.cmd(vim.bo.buflisted and "set nobl | enew" or "hide") 45 | else 46 | bufnr = bufnr or vim.api.nvim_get_current_buf() 47 | if bufnr == vim.api.nvim_get_current_buf() then 48 | require("ui.buf.fn").tabuflinePrev() 49 | end 50 | vim.cmd("confirm bd" .. bufnr) 51 | end 52 | end 53 | 54 | return M 55 | -------------------------------------------------------------------------------- /lua/ui/buf/init.lua: -------------------------------------------------------------------------------- 1 | -- so after a very unsucessful attempt at ripping off nvchad, i am making my own shit 2 | local M = {} 3 | -- creating commands 4 | vim.cmd "function! BufflineGoToBuf(bufnr,b,c,d) \n execute 'b'..a:bufnr \n endfunction" 5 | vim.cmd [[ 6 | function! BufflineKillBuf(bufnr,b,c,d) 7 | call luaeval('require("ui.buf.fn").close_buffer(_A)', a:bufnr) 8 | endfunction]] 9 | 10 | vim.cmd "function! ToggleTheme(a,b,c,d) \n lua require('prism.themer'):random() \n endfunction" 11 | vim.cmd "function! CloseAll(a,b,c,d) \n q \n endfunction" 12 | vim.api.nvim_create_user_command("BufflinePrev", function() 13 | require("ui.buf.fn").tabuflinePrev() 14 | end, {}) 15 | vim.api.nvim_create_user_command("BufflineNext", function() 16 | require("ui.buf.fn").tabuflineNext() 17 | end, {}) 18 | local createTab = function(buf) 19 | local close_btn = "%" .. buf .. "@BufflineKillBuf@ %X" 20 | local filename = (#vim.api.nvim_buf_get_name(buf) ~= 0) and vim.fn.fnamemodify(vim.api.nvim_buf_get_name(buf), ":t") or 21 | "" 22 | 23 | for _, buffer in pairs(vim.api.nvim_list_bufs()) do 24 | if vim.api.nvim_buf_is_valid(buffer) and vim.api.nvim_buf_is_loaded(buffer) and vim.bo[buffer].buflisted and filename ~= "" then 25 | if filename == vim.fn.fnamemodify(vim.api.nvim_buf_get_name(buffer), ":t") and buffer ~= buf then 26 | local other = {} 27 | for match in (vim.api.nvim_buf_get_name(buffer) .. "/"):gmatch("(.-)" .. "/") do 28 | table.insert(other, match) 29 | end 30 | 31 | local current = {} 32 | for match in (vim.api.nvim_buf_get_name(buf) .. "/"):gmatch("(.-)" .. "/") do 33 | table.insert(current, match) 34 | end 35 | 36 | filename = current[#current] 37 | 38 | for i = #current - 1, 1, -1 do 39 | local value_current = current[i] 40 | local other_current = other[i] 41 | 42 | if value_current ~= other_current then 43 | filename = value_current .. '/' .. filename 44 | break 45 | end 46 | end 47 | break 48 | end 49 | end 50 | end 51 | if buf == vim.api.nvim_get_current_buf() then 52 | filename = "%#BufflineBufOnActive# " .. " " .. filename 53 | close_btn = (vim.bo[0].modified and "%" .. buf .. "@BufflineKillBuf@%#BuffLineBufOnModified#  ") 54 | or ("%#BuffLineBufOnClose#" .. close_btn) .. " " 55 | else 56 | filename = "%#BufflineBufOnInactive# " .. " " .. filename 57 | close_btn = (vim.bo[buf].modified and "%" .. buf .. "@BufflineKillBuf@%#BuffLineBufOffModified#  ") 58 | or ("%#BuffLineBufOffClose#" .. close_btn) .. " " 59 | end 60 | return "%" .. buf .. "@BufflineGoToBuf@" .. filename .. " " .. close_btn .. '%X' .. "%#BufflineEmptyColor#" 61 | end 62 | 63 | local excludedFileTypes = { 'NvimTree', 'help', 'dasher', 'lir', 'alpha', "toggleterm" } 64 | 65 | local treeWidth = function() 66 | for _, win in pairs(vim.api.nvim_tabpage_list_wins(0)) do 67 | if vim.bo[vim.api.nvim_win_get_buf(win)].ft == "NvimTree" then 68 | return vim.api.nvim_win_get_width(win) 69 | end 70 | end 71 | return 0 72 | end 73 | 74 | M.getTabline = function() 75 | local buffline = "" 76 | local buffstart = "%#BuffLineEmpty#" 77 | local button = "%#BufflineButton# %@ToggleTheme@" .. " " 78 | local closebutton = "%#BufflineCloseButton# %@CloseAll@" .. " " 79 | local counter = 0 80 | for _, buf in pairs(vim.api.nvim_list_bufs()) do 81 | local filename = vim.api.nvim_buf_get_name(buf):match("^.+/(.+)$") or "" 82 | if vim.api.nvim_buf_is_valid(buf) and vim.api.nvim_buf_is_loaded(buf) and vim.bo[buf].buflisted and filename ~= "" then 83 | local conditions = vim.tbl_contains(excludedFileTypes, vim.bo[buf].ft) 84 | if conditions then goto do_nothing else filename = "%#BufflineEmptyColor#" .. createTab(buf) end 85 | buffline = buffline .. filename 86 | counter = counter + 1 87 | end 88 | ::do_nothing:: 89 | end 90 | if counter > 0 then 91 | buffstart = "%#BufflineEmptyColor#" 92 | end 93 | local treespace 94 | if treeWidth() > 2 then 95 | treespace = "%#BufflineTree#" .. 96 | string.rep(" ", treeWidth() / 2 - 3) .. "Browse" .. string.rep(" ", treeWidth() / 2 - 2) 97 | else 98 | treespace = "%#BufflineTree#" .. string.rep(" ", treeWidth()) 99 | end 100 | return treespace .. buffstart .. buffline .. "%=" .. button .. closebutton 101 | end 102 | 103 | M.setup = function() 104 | if #vim.fn.getbufinfo { buflisted = 1 } >= 1 then 105 | vim.o.showtabline = 2 106 | vim.o.tabline = '%!v:lua.require("ui.buf").getTabline()' 107 | end 108 | end 109 | vim.cmd [[ 110 | nnoremap :BufflineNext 111 | nnoremap :BufflinePrev 112 | ]] 113 | return M 114 | -------------------------------------------------------------------------------- /lua/ui/init.lua: -------------------------------------------------------------------------------- 1 | vim.api.nvim_create_autocmd({ "ModeChanged", "CursorHold" }, { 2 | callback = function() 3 | vim.opt.laststatus = 3 -- Global Status 4 | require("ui.stl").setup(vim.g.statusStyle) 5 | require("ui.buf").setup() 6 | end 7 | }) 8 | -------------------------------------------------------------------------------- /lua/ui/stl/init.lua: -------------------------------------------------------------------------------- 1 | local run = function(STYLE) 2 | local mode = require("ui.stl.modules.mode") 3 | local filename = require("ui.stl.modules.filename") 4 | local branch = require("ui.stl.modules.branch") 5 | local diff = require("ui.stl.modules.diff") 6 | local folder = require("ui.stl.modules.folder") 7 | local position = require("ui.stl.modules.position") 8 | local diagnostics = require("ui.stl.modules.diagnostics") 9 | local lsp = require("ui.stl.modules.lsp") 10 | return table.concat { 11 | mode(STYLE), 12 | filename(STYLE), 13 | branch(), 14 | diff(STYLE), 15 | "%=", 16 | diagnostics(STYLE), 17 | folder(STYLE), 18 | lsp(STYLE) or "", 19 | position(STYLE), 20 | }; 21 | end 22 | 23 | local setup = function(STYLE) 24 | vim.opt.statusline = run(STYLE) 25 | vim.api.nvim_create_autocmd({ "ModeChanged", "CursorHold", "CursorMoved", "CursorMovedI" }, { 26 | callback = function() 27 | vim.opt.statusline = run(STYLE) 28 | end 29 | }) 30 | end 31 | 32 | return { run = run, setup = setup } 33 | -------------------------------------------------------------------------------- /lua/ui/stl/modes.lua: -------------------------------------------------------------------------------- 1 | return { 2 | ["n"] = { "NORMAL", "StalineNormalMode" }, 3 | ["niI"] = { "NORMAL i", "StalineNormalMode" }, 4 | ["niR"] = { "NORMAL r", "StalineNormalMode" }, 5 | ["niV"] = { "NORMAL v", "StalineNormalMode" }, 6 | ["no"] = { "N-PENDING", "StalineNormalMode" }, 7 | ["i"] = { "INSERT", "StalineInsertMode" }, 8 | ["ic"] = { "INSERT (completion)", "StalineInsertMode" }, 9 | ["ix"] = { "INSERT completion", "StalineInsertMode" }, 10 | ["t"] = { "TERMINAL", "StalineTerminalMode" }, 11 | ["nt"] = { "NTERMINAL", "StalineNTerminalMode" }, 12 | ["v"] = { "VISUAL", "StalineVisualMode" }, 13 | ["V"] = { "V-LINE", "StalineVisualMode" }, 14 | ["Vs"] = { "V-LINE (Ctrl O)", "StalineVisualMode" }, 15 | [""] = { "V-BLOCK", "StalineVisualMode" }, 16 | ["R"] = { "REPLACE", "StalineReplaceMode" }, 17 | ["Rv"] = { "V-REPLACE", "StalineReplaceMode" }, 18 | ["s"] = { "SELECT", "StalineSelectMode" }, 19 | ["S"] = { "S-LINE", "StalineSelectMode" }, 20 | [""] = { "S-BLOCK", "StalineSelectMode" }, 21 | ["c"] = { "COMMAND", "StalineCommandMode" }, 22 | ["cv"] = { "COMMAND", "StalineCommandMode" }, 23 | ["ce"] = { "COMMAND", "StalineCommandMode" }, 24 | ["r"] = { "PROMPT", "StalineConfirmMode" }, 25 | ["rm"] = { "MORE", "StalineConfirmMode" }, 26 | ["r?"] = { "CONFIRM", "StalineConfirmMode" }, 27 | ["!"] = { "SHELL", "StalineTerminalMode" }, 28 | } 29 | -------------------------------------------------------------------------------- /lua/ui/stl/modules/branch.lua: -------------------------------------------------------------------------------- 1 | local M = function() 2 | if not vim.b.gitsigns_head or vim.b.gitsigns_git_status then 3 | return "" 4 | end 5 | 6 | local git_status = vim.b.gitsigns_status_dict 7 | 8 | local branch_name = "  " .. git_status.head .. " " 9 | 10 | return "%#StalineBranch#" .. branch_name 11 | end 12 | 13 | return M 14 | -------------------------------------------------------------------------------- /lua/ui/stl/modules/diagnostics.lua: -------------------------------------------------------------------------------- 1 | local diagnostic = vim.diagnostic 2 | local M = function(m) 3 | local errors = #diagnostic.get(0, { severity = diagnostic.severity.ERROR }) 4 | local warnings = #diagnostic.get(0, { severity = diagnostic.severity.WARN }) 5 | local hints = #diagnostic.get(0, { severity = diagnostic.severity.HINT }) 6 | local info = #diagnostic.get(0, { severity = diagnostic.severity.INFO }) 7 | if (m == 'blocks' or m == "minimal") then 8 | ERROR = (errors and errors > 0) and 9 | ("%#StalineLspErrorIcon#" .. "X" .. "%#StalineLspError#" .. errors) or "" 10 | WARNING = (warnings and warnings > 0) and 11 | ("%#StalineLspWarningIcon#" .. "!" .. "%#StalineLspWarning#" .. warnings) or "" 12 | HINT = (hints and hints > 0) and 13 | ("%#StalineLspHintsIcon#" .. "@" .. "%#StalineLspHints#" .. hints) or "" 14 | INFO = (info and info > 0) and ("%#StalineLspInfoIcon#" .. "i" .. "%#StalineLspInfo#" .. info) 15 | or "" 16 | elseif (m == 'fancy') then 17 | ERROR = (errors and errors > 0) and 18 | ("%#StalineLspErrorIcon#" .. "X" .. "%#StalineLspError#" .. errors) or "" 19 | WARNING = (warnings and warnings > 0) and 20 | ("%#StalineLspWarningIcon#" .. "!" .. "%#StalineLspWarning#" .. warnings) or "" 21 | HINT = (hints and hints > 0) and 22 | ("%#StalineLspHintsIcon#" .. "@" .. "%#StalineLspHints#" .. hints) or "" 23 | INFO = (info and info > 0) and ("%#StalineLspInfoIcon#" .. "i" .. "%#StalineLspInfo#" .. info) 24 | or "" 25 | elseif (m == 'minimal') then 26 | ERROR = (errors and errors > 0) and 27 | ("%#StalineLspErrorMinimalIcon#" .. " X" .. "%#StalineLspMinimalError#" .. errors .. " ") or "" 28 | WARNING = (warnings and warnings > 0) and 29 | ("%#StalineLspWarningMinimalIcon#" .. " !" .. "%#StalineLspMinimalWarning#" .. warnings .. " ") or "" 30 | HINT = (hints and hints > 0) and 31 | ("%#StalineLspHintsMinimalIcon#" .. " @" .. "%#StalineLspMinimalHints#" .. hints .. " ") or "" 32 | INFO = (info and info > 0) and ("%#StalineLspInfoMinimalIcon#" .. " i" .. "%#StalineLspMinimalInfo#" .. info .. " ") 33 | or "" 34 | else 35 | return "F" 36 | end 37 | return ERROR .. " " .. WARNING .. " " .. HINT .. " " .. INFO .. " " .. "%#StalineEmptySpace#" 38 | end 39 | return M 40 | -------------------------------------------------------------------------------- /lua/ui/stl/modules/diff.lua: -------------------------------------------------------------------------------- 1 | local M = function(m) 2 | if not vim.b.gitsigns_head or vim.b.gitsigns_git_status then 3 | return "" 4 | end 5 | 6 | local git_status = vim.b.gitsigns_status_dict 7 | 8 | if git_status then 9 | local added = (git_status.added) and ("+" .. git_status.added) or "" 10 | local changed = (git_status.changed) and (" / ~" .. git_status.changed) or "" 11 | local removed = (git_status.removed) and (" / -" .. git_status.removed) or "" 12 | if (m == 'blocks') then 13 | return " " .. 14 | "%#StalineDiffAdd#" .. added .. "%#StalineDiffChange#" .. changed .. "%#StalineDiffRemove#" .. removed 15 | elseif (m == 'fancy') then 16 | added = (git_status.added) and ("+" .. git_status.added) or "" 17 | changed = (git_status.changed) and ("~" .. git_status.changed) or "" 18 | removed = (git_status.removed) and ("-" .. git_status.removed) or "" 19 | return " " .. 20 | "%#StalineDiffAddFancy#" .. 21 | added .. 22 | " " .. 23 | "%#StalineDiffChangeFancy#" .. changed .. " %#StalineDiffRemoveFancy#" .. removed .. " %#StalineEmptySpace#" 24 | elseif (m == 'minimal') then 25 | return " " .. 26 | "%#StalineDiffAddMinimal#" .. 27 | added .. 28 | "%#StalineDiffChangeMinimal#" .. 29 | changed .. "%#StalineDiffRemoveMinimal#" .. removed .. " %#StalineEmptySpace#" 30 | else 31 | return "F" 32 | end 33 | else 34 | return " " 35 | end 36 | end 37 | 38 | return M 39 | -------------------------------------------------------------------------------- /lua/ui/stl/modules/filename.lua: -------------------------------------------------------------------------------- 1 | local fn = vim.fn 2 | local M = function(m) 3 | local icon = "  " 4 | local filename = (fn.expand "%" == "" and "Empty ") or fn.expand "%:t" 5 | if filename ~= "Empty " then 6 | local devicons = require("nvim-web-devicons") 7 | local ft_icon, icon_hl = devicons.get_icon(filename) 8 | icon = (ft_icon ~= nil and " " .. ft_icon) or "" 9 | if not icon_hl then 10 | icon_hl = "StalineDefaultFile" 11 | end 12 | if filename == "NvimTree_1" then 13 | filename = "File Explorer" 14 | end 15 | if filename == "[startuptime]" then 16 | filename = "Startup Time" 17 | end 18 | if string.find(filename, "toggleterm") then 19 | filename = "Terminal" 20 | end 21 | if (m == 'blocks') then 22 | return "%#StalineFilenameIcon#" .. "%#" .. icon_hl .. "# " .. icon .. " %#StalineFilename#" .. filename .. " " 23 | elseif (m == 'minimal') then 24 | return "%#StalineFilenameIconMinimal#" .. 25 | "%#" .. icon_hl .. "# " .. icon .. " %#StalineFilenameMinimal#" .. filename .. " " 26 | elseif m == "fancy" then 27 | return "%#StalineFilenameFancy#" .. 28 | icon .. " " .. filename .. " " .. "%#StalineFilenameSep#" .. " %#StalineEmptySpace#" 29 | end 30 | else 31 | if (m == 'minimal' or m == 'blocks') then 32 | return "%#StalineFilename# Kodo " 33 | elseif m == "fancy" then 34 | return "%#StalineFilenameFancy#" .. " Kodo " .. "%#StalineFilenameSep#" .. " %#StalineEmptySpace#" 35 | end 36 | end 37 | end 38 | return M 39 | -------------------------------------------------------------------------------- /lua/ui/stl/modules/folder.lua: -------------------------------------------------------------------------------- 1 | local fn = vim.fn 2 | local M = function(m) 3 | if (m == 'blocks') then 4 | local directory = "%#StalineFolderText#" .. " " .. fn.fnamemodify(fn.getcwd(), ":t") .. " " 5 | local icon = "%#StalineFolderIcon#" .. " DIR " 6 | return icon .. directory .. "%#StalineEmptySpace#" .. " " 7 | elseif (m == 'fancy') then 8 | local directory = "%#StalineFolderText#" .. " " .. fn.fnamemodify(fn.getcwd(), ":t") .. " " 9 | local icon = "%#StalineFolderIcon#" .. " " 10 | return "%#StalineFolderSep#" .. "" .. icon .. directory .. "%#StalineEmptySpace#" .. " " 11 | elseif (m == 'minimal') then 12 | local directory = "%#StalineFolderTextMinimal#" .. " " .. fn.fnamemodify(fn.getcwd(), ":t") .. " " 13 | return directory .. "%#StalineEmptySpace#" 14 | else 15 | return 'f' 16 | end 17 | end 18 | 19 | return M 20 | -------------------------------------------------------------------------------- /lua/ui/stl/modules/lsp.lua: -------------------------------------------------------------------------------- 1 | -- thanks nvchad 2 | local M = function(m) 3 | for _, client in ipairs(vim.lsp.get_active_clients()) do 4 | if client.attached_buffers[vim.api.nvim_get_current_buf()] then 5 | if (m == 'blocks') then 6 | return "%#StalineLspIcon#" .. 7 | " LSP " .. "%#StalineLspNameNormal#" .. " " .. client.name .. " %#StalineEmptySpace#" .. " " 8 | elseif (m == 'minimal') then 9 | return "%#StalineSep#| %#StalineEmptySpace#" .. 10 | "%#StalineLspNameMinimal#" .. client.name .. " %#StalineEmptySpace#" 11 | elseif (m == 'fancy') then 12 | return "%#StalineLspIcon#" .. 13 | "  " .. "%#StalineLspName#" .. " " .. client.name .. " " .. "%#StalineEmptySpace#" .. " " 14 | else 15 | return 'f' 16 | end 17 | end 18 | end 19 | end 20 | 21 | return M 22 | -------------------------------------------------------------------------------- /lua/ui/stl/modules/mode.lua: -------------------------------------------------------------------------------- 1 | local api = vim.api 2 | local modes = require("ui.stl.modes") 3 | 4 | 5 | local M = function(m) 6 | local mode = api.nvim_get_mode().mode 7 | local sep = "%#" .. modes[mode][2] .. "Sep" .. "#" .. " " 8 | local septwo = "%#StalineModeSepTwo" .. "#" .. " " 9 | if (m == 'blocks') then 10 | return "%#" .. modes[mode][2] .. "#" .. " " .. modes[mode][1] .. " "; 11 | elseif (m == 'minimal') then 12 | return "%#" .. "StalineModeMinimal" .. "#" .. " " .. modes[mode][1] .. " "; 13 | elseif (m == 'fancy') then 14 | return "%#" .. modes[mode][2] .. "#" .. "  " .. modes[mode][1] .. " " .. sep .. septwo .. ""; 15 | else 16 | return "F" 17 | end 18 | end 19 | 20 | return M 21 | -------------------------------------------------------------------------------- /lua/ui/stl/modules/position.lua: -------------------------------------------------------------------------------- 1 | local fn = vim.fn 2 | 3 | local modes = require("ui.stl.modes") 4 | local api = vim.api 5 | 6 | local M = function(m) 7 | local mode = api.nvim_get_mode().mode 8 | local current = fn.line "." 9 | local total = fn.line "$" 10 | if (m == 'blocks') then 11 | return "%#StalineProgress#" .. 12 | " " .. current .. "/" .. total .. " " .. "%#StalineProgressIcon#" .. " " .. "%#StalineEmptySpace#" 13 | elseif (m == 'minimal') then 14 | return " %#StalineNix#  " .. "%#StalineProgressMinimal#" .. 15 | " " .. current .. "/" .. total .. " " .. "%#" .. modes[mode][2] .. "#" .. " " .. "%#StalineEmptySpace#" 16 | elseif (m == 'fancy') then 17 | return "%#StalineProgressIcon#" .. 18 | "  " .. "%#StalineProgress#" .. " " .. current .. "/" .. total .. " " .. "%#StalineEmptySpace#" 19 | else 20 | return "F" 21 | end 22 | end 23 | 24 | return M 25 | --------------------------------------------------------------------------------