├── README.md ├── init.lua └── lazy-lock.json /README.md: -------------------------------------------------------------------------------- 1 | # Neovim config 2 | My neovim config. Might require nightly. 3 | 4 | ## Screenshots 5 | > [!NOTE] 6 | > 7 | > No screenshots or showcase for treesitter, lsp diagnostics, nvim-cmp, etc as they're common in all configs. 8 | > Here are some unique (useless) things which cant be seen in other normal configs. 9 | 10 | | Dashboard | Init file | 11 | |---|---| 12 | | | | 13 | 14 | | Lil ducklings everywhere | Animated float open | 15 | |---|---| 16 | | | | 17 | 18 | | Plugin Market | Read XKCD when bored | 19 | |---|---| 20 | | | | 21 | 22 | | Mpv Music player | Raining inside | 23 | |---|---| 24 | | | | 25 | 26 | 27 | Some notes regarding the config: 28 | - This might be the most useless config you might come across. Peace ☮️ 29 | - Approximately around 500 LOC. 30 | - The gifs above might feel choppy, but theyre super smooth in real. 31 | - Some of the other functionalities that are not mentioned: 32 | - Calculator (A real one with a UI) 33 | - Stalk (provide a gh username and check their activities) 34 | - TmpClone (temporarily clone a project from gh for quick inspection) 35 | - Quicknote (Project agnostic notes that does not pollute the root directory) 36 | - Scratch buffer (filetype default set to lua and \r evaluates it) 37 | - Bookmark in the signcolumn with mini alphabets (toggleable) 38 | - Chatgpt (custom) 39 | - Cheat.sh (custom detects language automagically) 40 | - Close command (:bd and :q detect automagically) 41 | - Neorg (with code execution and presenter modules) 42 | - Screensavers (DVD logo running around) 43 | - Snake game (not fully working) 44 | - Thunder client alternative with tab like clickable winbar. 45 | - No mason/null-ls though. I already have lsp and diags working. 46 | - Custom vim.ui.input, vim.ui.select and vim.notify. 47 | - NullPointer (share files via :PP using 0x0.st) 48 | 49 | >
50 | > Old Screenshots 51 | > 52 | > ![image](https://user-images.githubusercontent.com/77913442/146633265-bdbcdae3-29b2-4058-b217-d5f2b162af40.png) 53 | > ![image](https://user-images.githubusercontent.com/77913442/146633549-c098e7ca-6f6d-4740-8ab6-531d8a030555.png) 54 | > ![image](https://user-images.githubusercontent.com/77913442/146633580-3fa0430e-228e-4010-97ca-46ea58cffc14.png) 55 | >
56 | -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | 2 | 3 | -- {{{ -- Settings 4 | 5 | vim.loader.enable() 6 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 7 | if not vim.uv.fs_stat(lazypath) then 8 | print("Installing lazy.nvim...") 9 | vim.system({"git", "clone", "--branch=stable", "--filter=blob:none", "https://github.com/folke/lazy.nvim", lazypath}):wait() 10 | end 11 | vim.opt.runtimepath:prepend(lazypath) 12 | 13 | local opts = { 14 | General = { 15 | exrc = true, spell = false, wrap = false, linebreak = true, ruler = false, 16 | conceallevel = 2, timeoutlen = 300, updatetime = 500, 17 | wildignore = { '*.pyc,__pycache__,node_modules,*.lock,package%-lock%.json,target' }, 18 | }, 19 | Backup = { backup = false, writebackup = false, swapfile = false }, 20 | Layout = { 21 | scrolloff = 5, splitright = true, splitbelow = true, pumheight = 10, 22 | incsearch = true, showmode = false, showtabline = 2, laststatus = 3, 23 | }, 24 | Edit = { 25 | completeopt = "menu,menuone,noselect,popup", 26 | virtualedit = "block", ignorecase = true, 27 | clipboard = "unnamedplus", iskeyword = vim.o.iskeyword..",-" 28 | }, 29 | Fold = { 30 | foldmethod = "expr", 31 | foldlevelstart = 99, 32 | foldexpr = 'v:lua.vim.treesitter.foldexpr()', 33 | foldtext = 'v:lua.require("essentials").simple_fold()' 34 | }, 35 | Ui = { 36 | pumblend = 30, inccommand = "split", termguicolors = true, number = true, signcolumn = "yes:2", 37 | rnu = true, guifont = "JetBrainsMono Nerd Font:h10:b", 38 | shortmess = "tF".."TIcC".."as".."WoO", 39 | fillchars = { eob=' ', fold=' ', foldopen="", foldsep=" ", foldclose="" } 40 | }, 41 | Tabspace = { 42 | shiftwidth = 4, tabstop = 4, softtabstop = 0, -- expandtab = true, 43 | smartindent = true, breakindent = true, smarttab = true 44 | } 45 | } 46 | 47 | vim.g.python3_host_prog = '/usr/bin/python' 48 | vim.g.gruvbox_material_better_performance = 1 49 | for _, section in pairs(opts) do for k,v in pairs(section) do vim.opt[k] = v end end 50 | -- vim.opt.statuscolumn = "%s %{foldlevel(v:lnum) <= foldlevel(v:lnum-1) ? ' ' : (foldclosed(v:lnum) == -1 ? '' : '')} %{v:relnum ? v:relnum : v:lnum} " 51 | 52 | vim.schedule(function() 53 | local ess_status, essentials = pcall(require, "essentials") 54 | if ess_status then 55 | vim.ui.input = essentials.ui_input 56 | vim.ui.select = essentials.ui_select 57 | vim.notify = essentials.ui_notify 58 | end 59 | end) 60 | 61 | -- }}} 62 | 63 | -- {{{ -- Utils 64 | local Util = {} 65 | 66 | --> Different kinds of Borders 67 | Util.border = ({ 68 | { "╒", "═", "╕", "│", "╛", "═", "╘", "│" }, 69 | { "▁", "▁", "▁", "▕", "▔", "▔", "▔", "▏", }, 70 | { "🭽", "▔", "🭾", "▕", "🭿", "▁", "🭼", "▏" }, 71 | { "", "", "", " ", "", "", "", " " }, 72 | })[vim.g.neovide and 1 or 3] 73 | 74 | Util.center = function(dict) 75 | local new_dict = {} 76 | for _, v in pairs(dict) do 77 | local padding = vim.fn.max(vim.fn.map(dict, 'strwidth(v:val)')) 78 | local spacing = (" "):rep(math.floor((vim.o.columns - padding) / 2)) .. v 79 | table.insert(new_dict, spacing) 80 | end 81 | return new_dict 82 | end 83 | 84 | --> Simple dashboard 85 | Util.splash_screen = vim.schedule_wrap(function() 86 | local xdg = vim.fn.fnamemodify(vim.fn.stdpath("config") --[[@as string]], ":h").."/" 87 | local header = { 88 | "","", "", "", "", "", 89 | [[ ███▄ █ ▒█████ ██▓ ▄████▄ ▓█████ ]], 90 | [[ ██ ▀█ █ ▒██▒ ██▒ ▓██▒ ▒██▀ ▀█ ▓█ ▀ ]], 91 | [[▓██ ▀█ ██▒ ▒██░ ██▒ ▒██▒ ▒▓█ ▄ ▒███ ]], 92 | [[▓██▒ ▐▌██▒ ▒██ ██░ ░██░ ▒▓▓▄ ▄██▒ ▒▓█ ▄ ]], 93 | [[▒██░ ▓██░ ░ ████▓▒░ ░██░ ▒ ▓███▀ ░ ░▒████▒ ]], 94 | [[░ ▒░ ▒ ▒ ░ ▒░▒░▒░ ░▓ ░ ░▒ ▒ ░ ░░ ▒░ ░ ]], 95 | [[░ ░░ ░ ▒░ ░ ▒ ▒░ ▒ ░ ░ ▒ ░ ░ ░ ]], 96 | [[ ░ ░ ░ ░ ░ ░ ▒ ▒ ░ ░ ░ ]], 97 | [[ ░ ░ ░ ░ ░ ░ ░ ░ ]], 98 | [[ ░ ]] 99 | } 100 | local arg = vim.fn.argv(0) 101 | if (vim.bo.ft ~= "lazy") and (vim.bo.ft ~= "netrw") and (arg == "") then 102 | vim.fn.matchadd("Error", '[░▒]') 103 | vim.fn.matchadd("Function", '[▓█▄▀▐▌]') 104 | local map = function(lhs, rhs) vim.keymap.set('n', lhs, rhs, {silent=true, buffer=0}) end 105 | local keys = {K='kitty/kitty.conf', W='wezterm/wezterm.lua', I='nvim/init.lua', A='alacritty/alacritty.toml', G='ghostty/config', H='hypr/hyprland.conf'} 106 | vim.api.nvim_put(Util.center(header), "l", true, true) 107 | vim.cmd [[silent! setl nonu nornu nobl acd ft=dashboard bh=wipe bt=nofile]] 108 | for k,f in pairs(keys) do map(k,'e '..xdg..f..' | setl noacd') end 109 | map('P', 'Telescope oldfiles'); map('q', 'q'); map('o', 'e #<1') -- edit the last edited file 110 | end 111 | end) 112 | 113 | --> Closing Windows and buffers 114 | Util.close_command = function() 115 | if vim.bo.modified then print("buf not saved!") return end 116 | local total = #vim.tbl_filter(function(buf) 117 | return vim.api.nvim_buf_is_loaded(buf) and vim.api.nvim_buf_get_name(buf) ~= "" 118 | end, vim.api.nvim_list_bufs()) 119 | 120 | local quit_cmd = #vim.api.nvim_list_wins() > 1 and 'Q' or 'q' 121 | vim.cmd(total == 1 and quit_cmd or 'bd') 122 | end 123 | 124 | -- }}} 125 | 126 | -- {{{ -- Autocmds 127 | 128 | --> Wrapper function 129 | local au = function(events, ptn, cb) vim.api.nvim_create_autocmd(events, {pattern=ptn, [type(cb)=='function' and 'callback' or 'command']=cb}) end 130 | 131 | --> LSP Related 132 | au("BufWritePre", "*.rs,*.svelte", function() vim.lsp.buf.format() end) 133 | -- au("CursorHold", "*", function() vim.diagnostic.open_float() end) 134 | au("FileType", "json,jsonc,http,markdown", "set cole=0") 135 | au("FileType", "norg", "set scl=yes:4 nonu nornu") 136 | 137 | --> OLD 138 | au("BufReadPost", "*.lua", [[call matchadd("Keyword", "--> \\zs.*\\ze$")]]) 139 | au("BufEnter", "*", 'setl fo-=cro') 140 | au("BufReadPost", "*", function() require("essentials").last_place() end) 141 | au("TextYankPost", "*", function() vim.highlight.on_yank({higroup="Visual", timeout=200}) end) 142 | au("TermOpen", "term://*", "setl nonu nornu scl=no | star") 143 | au("UIEnter", "*", Util.splash_screen) 144 | 145 | --> Commands 146 | vim.api.nvim_create_user_command("Format", vim.lsp.buf.format, {}) 147 | vim.api.nvim_create_user_command("X", ":silent !xset r rate 169 69", {}) 148 | vim.api.nvim_create_user_command("PP", function() require("essentials").null_pointer() end, {range='%'}) 149 | vim.api.nvim_create_user_command("Mess", function() require("essentials").messages() end, {}) 150 | -- }}} 151 | 152 | -- {{{ -- Mappings 153 | 154 | vim.g.mapleader = " " 155 | vim.g.maplocalleader = "," 156 | local function map(mode, key, func) vim.keymap.set(mode, key, func, {silent=true}) end 157 | local function cmd(s) return ""..s.."" end 158 | 159 | --> Testing mappings 160 | map('n', 'd', vim.diagnostic.setqflist) 161 | map('n', 'u', function() require("thunder").run() end) 162 | map('n', 'k', function() require("essentials").konsole() end) 163 | map('n', 'gQ', function() require("essentials").open_quick_note() end) 164 | map('n', 'ii', function() require("nvim-market").install_picker() end) 165 | map('n', 'iu', function() require("nvim-market").remove_picker() end) 166 | map('n', 'v', function() require("lsp_lines").toggle() end) 167 | map('n', 'gl', function() vim.diagnostic.open_float() end) 168 | 169 | map('n', '', 'echo') 170 | map('c', 'jk', 'echo | setl nonu nornu scl=no | resize -20') 171 | map('n', 'gn', cmd "Gitsigns next_hunk") 172 | map('n', 'gp', cmd "Gitsigns prev_hunk") 173 | map('n', 'gb', cmd "Gitsigns blame_line") 174 | map('n', 'gd', cmd "Gitsigns preview_hunk_inline") 175 | map('n', 'gr', cmd "Gitsigns reset_hunk") 176 | 177 | map('n', '', cmd "cnext") 178 | map('n', '', cmd "cprev") 179 | 180 | --> Temp and Test maps 181 | map('n', 'l', function() require("essentials").toggle_term("lazygit", 't', true) end) 182 | map({'n', 't'}, 't', function() require("essentials").toggle_term("fish", 'v', true) end) 183 | map('n', 'p', cmd 'Lazy') 184 | map('t', '', [[]]) 185 | map('n', 'gh', function() vim.cmd.help(vim.fn.expand('')) end) 186 | 187 | --> General Mappings 188 | map('n', 'e' , function() require("nvim-tree.api").tree.toggle({find_file=true}) end) 189 | map('n', 'q' , function() require("essentials").toggle_quickfix() end) 190 | map('n', 'z' , cmd 'FocusMaximise') 191 | 192 | --> stuff.nvim keymaps (https://github.com/tamton-aquib/stuff.nvim) 193 | map('n', 'gC', function() require("calc").toggle() end) 194 | map('n', 'gS', function() require("stalk").stalk() end) 195 | map('n', 'gs', function() require("scratch").toggle() end) 196 | map('n', 'gB', function() require("bt").toggle() end) 197 | map('n', 'gT', function() require("tmpclone").clone() end) 198 | map('n', 'gp', function() require("mpv").toggle_player() end) 199 | map('n', 'gP', function() require("dep").check() end) 200 | 201 | --> Lsp mappings 202 | map('n', 'gD', vim.lsp.buf.definition) 203 | map('n', 'gd', 'vs | lua vim.lsp.buf.definition()') 204 | map('n', 'gr', vim.lsp.buf.references) 205 | map('n', 'ca', vim.lsp.buf.code_action) 206 | 207 | --> essentials.nvim mappings ( https://github.com/tamton-aquib/essentials.nvim ) 208 | map('n', '' , function() require("essentials").rename() end) 209 | map('n', 'r' , function() require("essentials").run_file() end) 210 | map('n', 's' , function() require("essentials").swap_bool() end) 211 | map('n', 'w', Util.close_command) 212 | map('n', 'gx', function() require("essentials").go_to_url() end) 213 | map('n', 'cs', function() require("essentials").cheat_sh() end) 214 | 215 | --> Telescope mappings 216 | map('n', 'ff', cmd "Telescope find_files") 217 | map('n', 'fg', cmd "Telescope live_grep") 218 | map('n', 'fs', cmd "Telescope grep_string") 219 | map('n', 'fo', cmd "Telescope oldfiles") 220 | map('n', 'fh', cmd "Telescope help_tags") 221 | 222 | --> WINDOW Control 223 | map({ 'n', 't' }, '', cmd 'wincmd h') 224 | map({ 'n', 't' }, '', cmd 'wincmd j') 225 | map({ 'n', 't' }, '', cmd 'wincmd k') 226 | map({ 'n', 't' }, '', cmd 'wincmd l') 227 | map('n', '', '-') 228 | map('n', '' , '+') 229 | 230 | --> Move selected line / block of text in visual mode 231 | map("x", "", ":move '<-2gv-gv") 232 | map("x", "", ":move '>+1gv-gv") 233 | map("n", "", ":move .+1==") 234 | map("n", "", ":move .-2==") 235 | 236 | --> OLD 237 | map('n', '' , '') 238 | map('n', 'a', 'ggVG') 239 | map('i', 'jk' , '') 240 | 241 | map('n', 'n' , cmd 'exe "norm! nzz" | lua vim.defer_fn(vim.cmd.nohl, 3000)') 242 | map('n', 'N' , cmd 'exe "norm! Nzz" | lua vim.defer_fn(vim.cmd.nohl, 3000)') 243 | 244 | map('n', '' , cmd 'bnext') 245 | map('n', '' , cmd 'bprevious') 246 | map('v', '<' , '' , '>gv') 248 | map('n', '>' , '>>') 249 | map('n', '<' , '<<') 250 | 251 | -- }}} 252 | 253 | -- {{{ -- Plug configs 254 | local cfg_cmp = function() 255 | local cmp = require('cmp') 256 | 257 | local kind_icons = { 258 | Text = ' ', Method = ' ', Function = ' ', Constructor = ' ', Field = ' ', Variable = ' ', Class = ' ', Interface = ' ', 259 | Module = ' ', Property = ' ', Unit = ' ', Value = ' ', Enum = ' ', Keyword = ' ', Snippet = ' ', Color = ' ', File = ' ', 260 | Reference = ' ', Folder = ' ', EnumMember = ' ', Constant = ' ', Struct = ' ', Event = ' ', Operator = ' ', TypeParameter = ' ', 261 | } 262 | 263 | -- Great for other themes, not for gruvbox tho 264 | -- for _, k in ipairs(vim.tbl_keys(kind_icons)) do vim.cmd("hi CmpItemKind"..k.." gui=reverse") end 265 | cmp.setup { 266 | formatting = { 267 | fields = { 'kind', 'abbr', 'menu' }, 268 | format = function(_, item) 269 | item.kind = ' ' .. (kind_icons[item.kind] or "󰺕 ") 270 | return item 271 | end 272 | }, 273 | window = { documentation = { border = "shadow" }, completion={side_padding=0} }, 274 | snippet = { expand=function(o) vim.snippet.expand(o.body) end }, 275 | mapping = cmp.mapping.preset.insert { 276 | [''] = cmp.mapping.scroll_docs(-1), 277 | [''] = cmp.mapping.scroll_docs(1), 278 | [''] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }), 279 | [''] = cmp.mapping.confirm({ select = true }), 280 | [''] = cmp.mapping(function(fb) (vim.snippet.active() and vim.snippet.jump or fb)(1) end, { "i", "s" }) 281 | }, 282 | sources = cmp.config.sources { 283 | { name = 'path' }, 284 | { name = 'nvim_lsp' }, 285 | { name = 'nvim_lsp_signature_help' }, 286 | { name = 'nvim_lua' }, 287 | { name = 'neorg'}, 288 | { name = 'buffer' }, 289 | { name = 'vim-dadbod-completion'} 290 | }, 291 | experimental = { ghost_text = true } -- Disable this later? 292 | } 293 | 294 | cmp.setup.cmdline(':', { mapping=cmp.mapping.preset.cmdline(), sources={{name="cmdline", keyword_length=3}} }) 295 | end 296 | 297 | local cfg_telescope = { 298 | defaults = { 299 | prompt_prefix = "  ", selection_caret = " ", winblend = 20, 300 | borderchars = { 301 | -- prompt = { "─", "│", "─", "│", "╭", "┬", "┤", "├" }, 302 | -- results = { " ", "│", "─", "│", "│", "│", "┴", "╰" }, 303 | -- preview = { "─", "│", "─", " ", "─", "╮", "╯", "─" }, --false 304 | 305 | prompt = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, 306 | results = { "", "", "", "", "", "", "", "" }, 307 | }, 308 | preview = false, results_title = false, sorting_strategy = "ascending", 309 | layout_config = { prompt_position="top", height=0.75, width=0.75 }, 310 | file_ignore_patterns = vim.opt.wildignore:get() 311 | } 312 | } 313 | 314 | local cfg_neorg = { 315 | load = { 316 | ["core.defaults"] = {}, ["core.concealer"] = {}, 317 | ["core.completion"] = { config={ engine="nvim-cmp" } }, 318 | ["core.presenter"] = { config={ zen_mode = "zen-mode" } }, 319 | ["core.itero"] = {}, ["core.ui.calendar"] = {}, ["core.export"] = {}, 320 | ["core.latex.renderer"] = {} 321 | } 322 | } 323 | 324 | local cfg_staline = function() 325 | Bruh = function() require("mpv").toggle_player() end 326 | vim.g.lsp_status = "" 327 | 328 | vim.api.nvim_create_autocmd("LspProgress", { 329 | callback = function(o) 330 | local status = o.data.params.value.percentage or "" 331 | vim.g.lsp_status = type(status) == "number" and status.."%" or "" 332 | vim.cmd.redrawstatus() 333 | end 334 | }) 335 | 336 | local virtual_env = function() 337 | local nice = vim.fn.fnamemodify(vim.env.VIRTUAL_ENV or '', ':t') 338 | return nice ~= '' and '('.. nice ..')' or '' 339 | end 340 | 341 | vim.g.mpv_visualizer = "" 342 | require("staline").setup({ 343 | defaults = { true_colors=true }, 344 | special_table = { mpv = { 'MPV', ' ' } }, 345 | sections = { 346 | left = { ' ', 'mode', ' ', 'git_branch', ' ', 'lsp', ' %{g:lsp_status}' }, 347 | right = { ' %10@v:lua.Bruh@󰎆 %X %{g:mpv_visualizer}', virtual_env, 'line_column', ' ' } 348 | } 349 | }) 350 | require("stabline").setup({ font_active="none", stab_start=" %#Identifier# ", stab_bg='none', stab_left='', inactive_fg='none', fg="#95c561" }) 351 | end 352 | 353 | -- }}} 354 | 355 | -- {{{ -- Lazy 356 | local plugins = { 357 | 358 | --> Temporary and testing 359 | { 360 | "pmizio/typescript-tools.nvim", 361 | dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" }, 362 | opts = { 363 | settings = { 364 | tsserver_file_preferences = { 365 | includeInlayParameterNameHints = "all", 366 | includeCompletionsForModuleExports = true, 367 | quotePreference = "auto", 368 | }, 369 | tsserver_format_options = { 370 | allowIncompleteCompletions = false, 371 | allowRenameOfImportPath = false, 372 | } 373 | }, 374 | }, 375 | }, 376 | 377 | { 378 | 'kristijanhusak/vim-dadbod-ui', 379 | dependencies = { 380 | { 'tpope/vim-dadbod', lazy = true }, 381 | { 'kristijanhusak/vim-dadbod-completion', ft = { 'sql', 'mysql', 'plsql' }, lazy = true }, 382 | }, 383 | cmd = { 'DBUI', 'DBUIToggle', 'DBUIAddConnection', 'DBUIFindBuffer' }, 384 | init = function() vim.g.db_ui_use_nerd_fonts = 1 end, 385 | }, 386 | 387 | -- { 'sindrets/diffview.nvim', config=true }, 388 | -- { 'willothy/flatten.nvim', opts={window = { open="smart" } } }, 389 | -- { 'linux-cultist/venv-selector.nvim', config=true, ft="python" }, 390 | 391 | { 'windwp/nvim-ts-autotag', opts={} }, 392 | { url='https://git.sr.ht/~whynothugo/lsp_lines.nvim', config=true }, 393 | 394 | --> My Useless lil plugins 395 | { 'tamton-aquib/nvim-market', import="nvim-market.plugins", config=true, lazy=true, dev=true }, 396 | { 'tamton-aquib/staline.nvim', config=cfg_staline, event="ColorScheme", dev=true }, 397 | { 'tamton-aquib/flirt.nvim', config=true, cond=not vim.g.neovide, dev=true }, 398 | { 'tamton-aquib/stuff.nvim', lazy=true, dev=true }, 399 | { 'tamton-aquib/essentials.nvim', lazy=true, dev=true }, 400 | -- { 'tamton-aquib/mpv.nvim', opts={setup_widgets=true}, lazy=true, dev=true }, 401 | -- { 'tamton-aquib/keys.nvim', opts={} }, 402 | -- { 'tamton-aquib/zone.nvim', opts={after=5, style='dvd'}, dev=true }, 403 | 404 | --> THEMES AND UI 405 | { '3rd/image.nvim', opts={ backend="kitty" }, ft={"norg", "markdown"}, cond=not vim.g.neovide }, 406 | { 'sainnhe/gruvbox-material', config=function() vim.cmd.colorscheme("gruvbox-material") end }, 407 | { 'nvim-tree/nvim-web-devicons', opts={override={norg={icon=" ", color="#4878be", name="neorg"}, http={icon="󰯊 ", name="http", color="#986fec"}} }, event="VeryLazy" }, 408 | { 'norcalli/nvim-colorizer.lua', cmd="ColorizerToggle" }, 409 | { 'lewis6991/gitsigns.nvim', config=true }, 410 | { 'nvim-tree/nvim-tree.lua', opts={ renderer={ indent_markers={ enable=true } } }, lazy=true }, 411 | { 'declancm/cinnamon.nvim', config=true, keys={"", ""}, cond=not vim.g.neovide }, 412 | 413 | --> LSP and COMPLETION 414 | { 'neovim/nvim-lspconfig', lazy=true }, 415 | { 'hrsh7th/nvim-cmp', config=cfg_cmp, event={"InsertEnter", "CmdlineEnter"}, lazy=true, 416 | dependencies = { 417 | 'hrsh7th/cmp-nvim-lsp', 418 | 'hrsh7th/cmp-path', 419 | 'hrsh7th/cmp-nvim-lsp-signature-help', 420 | 'hrsh7th/cmp-cmdline', 421 | 'hrsh7th/cmp-buffer' 422 | } 423 | }, 424 | 425 | --> Telescope, TREESITTER, NEORG, REST 426 | { 'nvim-telescope/telescope.nvim', opts=cfg_telescope, cmd="Telescope", dependencies={"nvim-lua/plenary.nvim"} }, 427 | { 'nvim-treesitter/nvim-treesitter', opts={highlight={enable=true}, indent={enable=true} }, main="nvim-treesitter.configs" }, 428 | { "vhyrro/luarocks.nvim", opts={rocks={"magick"}} }, 429 | { "nvim-neorg/neorg", ft="norg", dependencies={ "luarocks.nvim" }, opts=cfg_neorg }, 430 | 431 | --> GENERAL PURPOSE 432 | { 'notjedi/nvim-rooter.lua', config=true }, 433 | { 'nvim-focus/focus.nvim', lazy=true, opts={ui = {cursorline=false, signcolumn=false}}, event="WinEnter" }, 434 | { 'windwp/nvim-autopairs', config=true, event="InsertEnter" }, 435 | { 'shellRaining/hlchunk.nvim', opts={ indent={enable=true, use_treesitter=true}, chunk={enable=true, notify=true, chars={right_arrow="─"}} }}, 436 | } 437 | 438 | require("lazy").setup({ plugins }, { 439 | ui = { pills=false }, install={ colorscheme = { "gruvbox-material", "retrobox"} }, 440 | dev = { path="~/STUFF/NEOVIM/", patterns = {"tamton-aquib" }, fallback = true }, 441 | performance = { rtp = { disabled_plugins = { 442 | "node_provider", "2html_plugin", "getscript", "getscriptPlugin", "gzip", "matchit", 443 | "tar", "tarPlugin", "rrhelper", "spellfile_plugin", "vimball", 444 | "vimballPlugin", "zip", "zipPlugin", "tutor", "spellfile", "tarPlugin", 445 | "man", "logiPat", "netrwSettings", "netrwFileHandlers", "netrw", "netrwPlugin", 446 | "tohtml", "editorconfig", "python3_provider", "remote_plugins", "rplugin", 447 | }} } 448 | }) 449 | -- }}} 450 | 451 | -- {{{ -- LSP 452 | 453 | local runtime_path = vim.split(package.path, ';') 454 | local s = { 455 | 456 | -- sqls = { 457 | -- settings = { 458 | -- sqls = { 459 | -- connections = { 460 | -- { 461 | -- driver = 'mariadb', 462 | -- dataSourceName = 'taj:thengakola@localhost:3306/TodoApp', 463 | -- }, 464 | -- } 465 | -- }, 466 | -- }, 467 | -- }, 468 | 469 | tailwindcss = {}, 470 | pyright={}, 471 | cssls={}, -- biome = {}, tsserver={}, svelte = {},-- yamlls = {}, eslint = {}, 472 | -- ruff_lsp={}, ruff={}, rust_analyzer={}, 473 | -- jdtls = {}, clangd = {}, 474 | lua_ls = { 475 | settings = { 476 | Lua = { 477 | runtime={version="LuaJIT"}, 478 | path = vim.g.devmode and runtime_path or {}, 479 | workspace = { checkThirdParty = "Disable", library = { vim.env.VIMRUNTIME } } 480 | } 481 | } 482 | } 483 | } 484 | vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {border = Util.border}) 485 | vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {border = Util.border}) 486 | 487 | vim.diagnostic.config({ 488 | virtual_text = false, 489 | signs = { text = { '', '', '', '' } }, -- {"", "", ""} 490 | float = { 491 | border = Util.border, 492 | suffix = '', 493 | focusable=false, 494 | header = { "  Diagnostics", "String" }, 495 | prefix = function(_, _, _) return "  " , "String" end, -- icons:        496 | } 497 | }) 498 | 499 | table.insert(runtime_path, 'lua/?.lua') 500 | table.insert(runtime_path, 'lua/?/init.lua') 501 | local lspconfig = require("lspconfig") 502 | 503 | for server, opt in pairs(s) do 504 | opt.capabilities = require("cmp_nvim_lsp").default_capabilities() 505 | opt.on_init = function(client) 506 | client.server_capabilities.semanticTokensProvider = nil 507 | end 508 | lspconfig[server].setup(opt) 509 | end 510 | -- }}} 511 | 512 | -- {{{ -- MISC 513 | vim.cmd [[hi link @punctuation.bracket Red | hi link @constructor.lua Red]] 514 | vim.cmd [[hi WarningText gui=underline | hi ErrorText gui=underline | hi TSDanger gui=reverse]] 515 | 516 | function UF() 517 | local title = vim.fn.getline(vim.v.foldstart):gsub([[%-%- %{%{%{ %-%- ]], "") 518 | return (" "):rep(math.floor(vim.o.columns - title:len()) / 2) .. title 519 | end 520 | 521 | vim.api.nvim_create_autocmd("BufReadPost", { 522 | pattern = vim.fn.stdpath("config") .. "/init.lua", 523 | callback = function() 524 | vim.cmd [[setl foldtext=v:lua.UF()]] 525 | vim.keymap.set('n', '', 'za', {buffer=0}) 526 | vim.api.nvim_buf_set_extmark(0, vim.api.nvim_create_namespace("taj0023"), 0, 0, { 527 | virt_text = {{ Util.center({"-- [[ INIT.LUA ]] --"})[1] , "Function"}} 528 | }) 529 | end 530 | }) 531 | 532 | if vim.g.neovide then 533 | vim.g.neovide_underline_automatic_scaling = true 534 | vim.g.neovide_scale_factor = 1.0 535 | vim.g.neovide_floating_blur_amount_x = 2.0 536 | vim.g.neovide_floating_blur_amount_y = 2.0 537 | vim.g.neovide_floating_shadow = true 538 | vim.g.neovide_floating_z_height = 10 539 | vim.g.neovide_transparency = 0.9 540 | vim.g.neovide_padding_top = 10 541 | vim.g.neovide_padding_left = 10 542 | vim.g.neovide_remember_window_size = true 543 | end 544 | 545 | -- }}} 546 | 547 | -- {{{ -- TEMP 548 | -- vim.g.dbs = { dev = 'mariadb://localhost:3306/TodoApp', prod = 'mariadb://localhost:3306/ExampleDB' } 549 | map("n", "db", cmd 'DBUIToggle') 550 | 551 | vim.api.nvim_create_autocmd({'WinEnter', 'FileType'}, { 552 | group = vim.api.nvim_create_augroup('FocusDisable', { clear = true }), 553 | callback = function() vim.w.focus_disable = vim.tbl_contains({ 'NvimTree', 'dbui', 'dbee' }, vim.bo.ft) end, 554 | }) 555 | vim.filetype.add({ extension = { http = "http" } }) 556 | -- vim.opt.showtabline = 1 557 | 558 | -- vim.api.nvim_create_autocmd("LspProgress", { 559 | -- callback = function(o) 560 | -- local p = o.data.params.value.percentage 561 | -- vim.wo.winbar = p and ("%#Green#"..("▔"):rep(math.floor((p*vim.o.columns) / 100))) or "" 562 | -- end 563 | -- }) 564 | 565 | vim.keymap.set('ia', 'pp', vim.schedule_wrap(function() 566 | local pps = { python = [[print("${0}")]], typescriptreact = [[console.log("${0}")]] } 567 | local key = vim.api.nvim_replace_termcodes("", true, false, true) 568 | vim.api.nvim_feedkeys(key, 'i', false) 569 | vim.defer_fn(function() vim.snippet.expand(pps[vim.bo.ft] or "Error") end, 1) 570 | end), {}) 571 | 572 | -- vim.opt.background = "dark" 573 | -- vim.cmd.colorscheme("retrobox") 574 | -- vim.opt.statusline = "%#Normal#"..("─"):rep(vim.o.columns) 575 | 576 | -- local boffer = vim.api.nvim_create_buf(false, true) 577 | -- vim.api.nvim_open_win(boffer, true, { 578 | -- relative="editor", style="minimal", border="none", 579 | -- height=1, width=vim.o.columns, row=vim.o.lines-3, col=0 580 | -- }) 581 | -- vim.cmd.hi("NormalFloat guibg=#fbf1c7") 582 | -- vim.api.nvim_buf_set_lines(boffer, 0, -1, false, {("▂"):rep(vim.o.columns)}) 583 | -- 584 | -- vim.opt.statusline = "%#Normal#%f%=%p %c:%l %y" 585 | -- vim.opt.winbar = "%#Normal#"..("▂"):rep(vim.o.columns) 586 | -- local half = ("%#Normal# "):rep(math.floor(vim.o.columns/2) - 10) 587 | -- vim.opt.tabline = half .. "%t" .. half 588 | 589 | vim.keymap.set('n', 'f', '/', {}) 590 | vim.keymap.set('n', 't', '?', {}) 591 | 592 | -- local session_path = vim.fn.stdpath('config') .. '/session.vim' 593 | -- map("n", "ss", 'sil wa! | mks! ' .. session_path .. ' | qa!') 594 | -- map("n", "sl", '%bd! | so ' .. session_path .. ' | ec "Session loaded from: ' .. session_path .. '"') 595 | -- -- vim: fdm=marker fdls=-1 fdl=0 nonu nornu scl=no 596 | -- -- }}} 597 | -------------------------------------------------------------------------------- /lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "cinnamon.nvim": { "branch": "master", "commit": "a011e84b624cd7b609ea928237505d31b987748a" }, 3 | "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, 4 | "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, 5 | "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, 6 | "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" }, 7 | "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, 8 | "focus.nvim": { "branch": "master", "commit": "2c2c91d0bdb8ec9f67655c0e125953e27f5798c9" }, 9 | "gitsigns.nvim": { "branch": "main", "commit": "75dc649106827183547d3bedd4602442340d2f7f" }, 10 | "gruvbox-material": { "branch": "master", "commit": "35f15c44874b60351590150105dce3863d9bb09a" }, 11 | "hlchunk.nvim": { "branch": "main", "commit": "350e4e8f1b6f4c6dbd9a98946547ed557bab5335" }, 12 | "image.nvim": { "branch": "master", "commit": "645f997d171ea3d2505986a0519755600a26f02f" }, 13 | "lazy.nvim": { "branch": "main", "commit": "ad30030b6abca7dac5a493c58b4d183b3fe93202" }, 14 | "lsp_lines.nvim": { "branch": "main", "commit": "7d9e2748b61bff6ebba6e30adbc7173ccf21c055" }, 15 | "luarocks.nvim": { "branch": "main", "commit": "1db9093915eb16ba2473cfb8d343ace5ee04130a" }, 16 | "neorg": { "branch": "main", "commit": "b17a33ede3ff91de614c735c1617bf9dc61372d5" }, 17 | "nvim-autopairs": { "branch": "master", "commit": "c15de7e7981f1111642e7e53799e1211d4606cb9" }, 18 | "nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" }, 19 | "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, 20 | "nvim-lspconfig": { "branch": "master", "commit": "710a8fa7379db32199545f30ea01dd8446b9302f" }, 21 | "nvim-rooter.lua": { "branch": "main", "commit": "36c597962c5f136d6230f53837ff14fcaf81eff7" }, 22 | "nvim-tree.lua": { "branch": "master", "commit": "26632f496e7e3c0450d8ecff88f49068cecc8bda" }, 23 | "nvim-treesitter": { "branch": "master", "commit": "979beffc1a86e7ba19bd6535c0370d8e1aaaad3c" }, 24 | "nvim-ts-autotag": { "branch": "main", "commit": "6eb4120a1aadef07ac312f1c4bc6456712220007" }, 25 | "nvim-web-devicons": { "branch": "master", "commit": "b77921fdc44833c994fdb389d658ccbce5490c16" }, 26 | "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, 27 | "tailwind-fold.nvim": { "branch": "main", "commit": "4335dd915073fe3da43a85b06742d12626603973" }, 28 | "telescope.nvim": { "branch": "master", "commit": "dfa230be84a044e7f546a6c2b0a403c739732b86" }, 29 | "typescript-tools.nvim": { "branch": "master", "commit": "c43d9580c3ff5999a1eabca849f807ab33787ea7" }, 30 | "vim-dadbod": { "branch": "master", "commit": "7888cb7164d69783d3dce4e0283decd26b82538b" }, 31 | "vim-dadbod-completion": { "branch": "master", "commit": "5d5ad196fcde223509d7dabbade0148f7884c5e3" }, 32 | "vim-dadbod-ui": { "branch": "master", "commit": "0dc68d9225a70d42f8645049482e090c1a8dce25" } 33 | } --------------------------------------------------------------------------------