From 761f890b105c57fc4e24f8b4a2455d53f7a93ec6 Mon Sep 17 00:00:00 2001 From: voidarc Date: Thu, 9 Apr 2026 20:35:13 +0100 Subject: [PATCH 1/6] blank slate --- lua/config/autocmd.lua | 44 ----------- lua/config/binds.lua | 29 ------- lua/config/lazy.lua | 42 ---------- lua/plugins/completion/blink.lua | 50 ------------ lua/plugins/completion/conform.lua | 17 ----- lua/plugins/completion/lazydev.lua | 11 --- lua/plugins/completion/linter.lua | 44 ----------- lua/plugins/completion/lspconfig.lua | 39 ---------- lua/plugins/completion/treesitter.lua | 30 -------- lua/plugins/editing/flash.lua | 40 ---------- lua/plugins/editing/neorg.lua | 106 -------------------------- lua/plugins/editing/scrollEof.lua | 6 -- lua/plugins/init.lua | 1 - lua/plugins/ui/catppuccin.lua | 13 ---- lua/plugins/ui/lualine.lua | 72 ----------------- lua/plugins/ui/noice.lua | 47 ------------ lua/plugins/ui/vimade.lua | 8 -- lua/plugins/utils/files.lua | 55 ------------- lua/plugins/utils/mini.lua | 73 ------------------ lua/plugins/utils/telescope.lua | 83 -------------------- 20 files changed, 810 deletions(-) delete mode 100644 lua/config/autocmd.lua delete mode 100644 lua/config/binds.lua delete mode 100644 lua/config/lazy.lua delete mode 100644 lua/plugins/completion/blink.lua delete mode 100644 lua/plugins/completion/conform.lua delete mode 100644 lua/plugins/completion/lazydev.lua delete mode 100644 lua/plugins/completion/linter.lua delete mode 100644 lua/plugins/completion/lspconfig.lua delete mode 100644 lua/plugins/completion/treesitter.lua delete mode 100644 lua/plugins/editing/flash.lua delete mode 100644 lua/plugins/editing/neorg.lua delete mode 100644 lua/plugins/editing/scrollEof.lua delete mode 100644 lua/plugins/init.lua delete mode 100644 lua/plugins/ui/catppuccin.lua delete mode 100644 lua/plugins/ui/lualine.lua delete mode 100644 lua/plugins/ui/noice.lua delete mode 100644 lua/plugins/ui/vimade.lua delete mode 100644 lua/plugins/utils/files.lua delete mode 100644 lua/plugins/utils/mini.lua delete mode 100644 lua/plugins/utils/telescope.lua diff --git a/lua/config/autocmd.lua b/lua/config/autocmd.lua deleted file mode 100644 index b9fa53f..0000000 --- a/lua/config/autocmd.lua +++ /dev/null @@ -1,44 +0,0 @@ --- Autocommand to check git status -vim.api.nvim_create_autocmd("VimEnter", { - callback = function() - -- Verify if the current directory is a git repo - local is_git = os.execute("git rev-parse --is-inside-work-tree > /dev/null 2>&1") - if is_git ~= 0 then - return - end - - -- Perform an async fetch to avoid startup lag - vim.fn.jobstart("git fetch", { - on_exit = function() - -- Get the number of commits the remote is ahead of local HEAD - local count = vim.fn.system("git rev-list --count HEAD..@{u} 2>/dev/null"):gsub("%s+", "") - - if count ~= "" and tonumber(count) > 0 then - vim.schedule(function() - vim.notify( - "󰊢 " .. count .. " new commit(s) available on remote.", - vim.log.levels.INFO, - { title = "Git Status", icon = "󰊢" } - ) - end) - end - end, - }) - end, -}) - -local cursorline_group = vim.api.nvim_create_augroup("CursorLineControl", { clear = true }) - -vim.api.nvim_create_autocmd({ "WinEnter", "BufEnter" }, { - group = cursorline_group, - callback = function() - vim.opt_local.cursorline = true - end, -}) - -vim.api.nvim_create_autocmd({ "WinLeave" }, { - group = cursorline_group, - callback = function() - vim.opt_local.cursorline = false - end, -}) diff --git a/lua/config/binds.lua b/lua/config/binds.lua deleted file mode 100644 index 9619003..0000000 --- a/lua/config/binds.lua +++ /dev/null @@ -1,29 +0,0 @@ --- Keymap function -function Keymap(mode, key, binding) - vim.keymap.set(mode, key, binding, { noremap = true, silent = true }) -end - -Keymap("n", "q:", ":") -- remove nonsense command -Keymap("n", "bd", function() -- delete buffer - vim.cmd("bd") - vim.cmd("echo 'Buffer deleted'") -end) - -for bind = "i", "a", "A" do -- proper indenting function - Keymap("n", bind, function() - if vim.fn.getline("."):match("^%s*$") then - return [["_cc]] - else - return bind - end - end) -end - -Keymap("i", "", "") -- C-Backscpace for whole words - --- Open Lazygit -Keymap("n", "l", function() - Snacks.lazygit.open() -end) - -Keymap("n", "d", "lua vim.diagnostic.open_float()") -- Diagnostics for Linter diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua deleted file mode 100644 index ae4cf46..0000000 --- a/lua/config/lazy.lua +++ /dev/null @@ -1,42 +0,0 @@ --- Bootstrap lazy.nvim -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not (vim.uv or vim.loop).fs_stat(lazypath) then - local lazyrepo = "https://github.com/folke/lazy.nvim.git" - local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) - if vim.v.shell_error ~= 0 then - vim.api.nvim_echo({ - { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, - { out, "WarningMsg" }, - { "\nPress any key to exit..." }, - }, true, {}) - vim.fn.getchar() - os.exit(1) - end -end -vim.opt.rtp:prepend(lazypath) - --- Make sure to setup `mapleader` and `maplocalleader` before --- loading lazy.nvim so that mappings are correct. --- This is also a good place to setup other settings (vim.opt) -vim.g.mapleader = " " -vim.g.maplocalleader = "," - --- Setup lazy.nvim -require("lazy").setup({ - spec = { - -- import your plugins - { import = "plugins.utils" }, - { import = "plugins" }, - { import = "plugins.ui" }, - { import = "plugins.editing" }, - { import = "plugins.completion" }, - }, - -- Configure any other settings here. See the documentation for more details. - -- colorscheme that will be used when installing plugins. - install = { colorscheme = { "catppuccin" } }, - ui = { - border = "rounded", - }, - -- automatically check for plugin updates - checker = { enabled = false }, -}) diff --git a/lua/plugins/completion/blink.lua b/lua/plugins/completion/blink.lua deleted file mode 100644 index 4398eca..0000000 --- a/lua/plugins/completion/blink.lua +++ /dev/null @@ -1,50 +0,0 @@ -return { - "saghen/blink.cmp", - dependencies = { - "L3MON4D3/LuaSnip", - }, - opts = { - -- Snippet configuration - snippets = { - preset = "luasnip", -- Tells blink.cmp to use LuaSnip - }, - - fuzzy = { implementation = "lua" }, - - signature = { - enabled = true, - }, - - completion = { - list = { - selection = { - preselect = false, - auto_insert = true, - }, - }, - }, - - -- Keymaps - keymap = { - [""] = { "select_next", "snippet_forward", "fallback" }, - }, - sources = { - default = { - "lazydev", - "lsp", -- (Equivalent to cmp-nvim-lsp) - "snippets", -- (Handled by the snippets config, replaces cmp_luasnip source) - "buffer", -- (Equivalent to cmp-buffer) - "path", -- (Equivalent to cmp-path) - -- "cmdline", -- Generally configured separately, but often included by default - }, - providers = { - lazydev = { - name = "LazyDev", - module = "lazydev.integrations.blink", - -- make lazydev completions top priority (see `:h blink.cmp`) - score_offset = 100, - }, - }, - }, - }, -} diff --git a/lua/plugins/completion/conform.lua b/lua/plugins/completion/conform.lua deleted file mode 100644 index b7cc40f..0000000 --- a/lua/plugins/completion/conform.lua +++ /dev/null @@ -1,17 +0,0 @@ -return { - "stevearc/conform.nvim", - config = function() - require("conform").setup({ - formatters_by_ft = { - lua = { "stylua" }, - javascript = { "prettier" }, - python = { "black" }, - nix = { "nixfmt" }, - css = { "prettier" }, - rust = { "rustfmt" }, - }, - format_on_save = true, - undojoin = true, - }) - end, -} diff --git a/lua/plugins/completion/lazydev.lua b/lua/plugins/completion/lazydev.lua deleted file mode 100644 index 72ebd73..0000000 --- a/lua/plugins/completion/lazydev.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - "folke/lazydev.nvim", - ft = "lua", -- only load on lua files - opts = { - library = { - -- See the configuration section for more details - -- Load luvit types when the `vim.uv` word is found - { path = "${3rd}/luv/library", words = { "vim%.uv" } }, - }, - }, -} diff --git a/lua/plugins/completion/linter.lua b/lua/plugins/completion/linter.lua deleted file mode 100644 index b7e7679..0000000 --- a/lua/plugins/completion/linter.lua +++ /dev/null @@ -1,44 +0,0 @@ -return { - "mfussenegger/nvim-lint", - config = function() - local lint = require("lint") - - -- Explicitly define linters for each file type (without ast_grep) - lint.linters_by_ft = { - python = { "flake8" }, - javascript = { "eslint" }, - typescript = { "eslint" }, - } - - -- Only show diagnostics close to the cursor - vim.diagnostic.config({ - virtual_text = { - spacing = 4, - -- You can make prefix dynamic based on severity using a function - prefix = function(diagnostic) - local icons = { - [vim.diagnostic.severity.ERROR] = " ", - [vim.diagnostic.severity.WARN] = " ", - [vim.diagnostic.severity.INFO] = " ", - [vim.diagnostic.severity.HINT] = " ", - } - return icons[diagnostic.severity] or "●" - end, - }, - signs = false, - underline = true, - update_in_insert = false, - }) - - -- Auto-run the linter only for the configured filetypes - vim.api.nvim_create_autocmd("BufWritePost", { - pattern = "!*.lua", - callback = function() - local ft = vim.bo.filetype - if lint.linters_by_ft[ft] then - lint.try_lint() - end - end, - }) - end, -} diff --git a/lua/plugins/completion/lspconfig.lua b/lua/plugins/completion/lspconfig.lua deleted file mode 100644 index b98e818..0000000 --- a/lua/plugins/completion/lspconfig.lua +++ /dev/null @@ -1,39 +0,0 @@ -return { - "neovim/nvim-lspconfig", - config = function() - vim.lsp.config("lua_ls", { - settings = { - Lua = { - -- Tell the server to let Neovim handle snippet expansion - completion = { - callSnippet = "Replace", - }, - -- Use LuaJIT (which Neovim uses) - runtime = { - version = "LuaJIT", - }, - }, - }, - }) - vim.lsp.config("emmet_ls", { - -- capabilities = require("cmp_nvim_lsp").default_capabilities(), - filetypes = { "html", "css", "javascriptreact", "typescriptreact" }, - init_options = { - html = { - options = { - ["bem.enabled"] = true, - }, - }, - }, - }) - vim.lsp.enable({ - "lua_ls", - "ts_ls", - "pylsp", - "cssls", - "nixd", - "rust_analyzer", - "emmet_ls", - }) - end, -} diff --git a/lua/plugins/completion/treesitter.lua b/lua/plugins/completion/treesitter.lua deleted file mode 100644 index 51e875b..0000000 --- a/lua/plugins/completion/treesitter.lua +++ /dev/null @@ -1,30 +0,0 @@ -return { - "nvim-treesitter/nvim-treesitter", - lazy = false, - branch = "master", - build = ":TSUpdate", - config = function() - require("nvim-treesitter.configs").setup({ - highlight = { enable = true }, - indent = { enable = true }, - ensure_installed = { - "bash", - "html", - "latex", - "javascript", - "json", - "lua", - "norg", - "markdown", - "markdown_inline", - "query", - "regex", - "tsx", - "typescript", - "python", - "vim", - "yaml", - }, - }) - end, -} diff --git a/lua/plugins/editing/flash.lua b/lua/plugins/editing/flash.lua deleted file mode 100644 index 016e2ba..0000000 --- a/lua/plugins/editing/flash.lua +++ /dev/null @@ -1,40 +0,0 @@ -return { - "folke/flash.nvim", - event = "VeryLazy", - ---@type Flash.Config - opts = {}, - keys = { - { - "ss", - mode = { "n", "x", "o" }, - function() - require("flash").jump() - end, - desc = "Flash", - }, - { - "S", - mode = { "n", "x", "o" }, - function() - require("flash").treesitter() - end, - desc = "Flash Treesitter", - }, - { - "r", - mode = "o", - function() - require("flash").remote() - end, - desc = "Remote Flash", - }, - { - "R", - mode = { "o", "x" }, - function() - require("flash").treesitter_search() - end, - desc = "Treesitter Search", - }, - }, -} diff --git a/lua/plugins/editing/neorg.lua b/lua/plugins/editing/neorg.lua deleted file mode 100644 index 0748c4e..0000000 --- a/lua/plugins/editing/neorg.lua +++ /dev/null @@ -1,106 +0,0 @@ -return { - { - "nvim-neorg/neorg", - lazy = true, - ft = "norg", - version = "*", - dependencies = { - { "nvim-lua/plenary.nvim" }, - { "nvim-neorg/neorg-telescope" }, - { "benlubas/neorg-interim-ls" }, - }, - config = function() - require("neorg").setup({ - load = { - ["core.defaults"] = {}, - ["core.concealer"] = {}, - ["core.qol.toc"] = { - config = { - close_after_use = true, - }, - }, - ["core.integrations.treesitter"] = {}, - ["core.looking-glass"] = {}, - ["core.itero"] = { - config = { - iterables = { - "unordered_list%d", - "ordered_list%d", - "quote%d", - }, - }, - }, - ["core.completion"] = { - config = { engine = { module_name = "external.lsp-completion" } }, - }, - ["core.dirman"] = { - config = { - workspaces = { - notes = "~/Notes", - site = "~/Documents/voidarc/content/", - }, - default_workspace = "notes", - }, - }, - ["core.integrations.telescope"] = { - config = { - insert_file_link = { - -- Whether to show the title preview in telescope. Affects performance with a large - -- number of files. - show_title_preview = true, - }, - }, - }, - ["external.interim-ls"] = { - config = { - -- default config shown - completion_provider = { - -- Enable or disable the completion provider - enable = true, - - -- Show file contents as documentation when you complete a file name - documentation = true, - - -- Try to complete categories provided by Neorg Query. Requires `benlubas/neorg-query` - categories = false, - - -- suggest heading completions from the given file for `{@x|}` where `|` is your cursor - -- and `x` is an alphanumeric character. `{@name}` expands to `[name]{:$/people:# name}` - }, - }, - }, - }, - }) - vim.wo.foldlevel = 99 - vim.wo.conceallevel = 2 - - vim.api.nvim_create_autocmd("Filetype", { - pattern = "norg", - callback = function() - vim.keymap.set("n", "", "(neorg.esupports.hop.hop-link.vsplit)", { buffer = true }) - vim.keymap.set("i", "", "(neorg.itero.next-iteration)", { buffer = true }) - vim.keymap.set("n", "m", "Neorg inject-metadata", { buffer = true }) - vim.keymap.set("n", "f", "Telescope neorg insert_link", { buffer = true }) - vim.opt.colorcolumn = "140" - vim.api.nvim_set_hl(0, "@neorg.tags.ranged_verbatim.code_block", { bg = "NONE" }) - end, - }) - end, - }, - { - "folke/snacks.nvim", - config = function() - require("snacks").setup({ - bigfile = {}, - lazygit = {}, - image = { - enabled = true, - math = { - enabled = true, - latex = {}, - }, - }, - }) - end, - }, -} diff --git a/lua/plugins/editing/scrollEof.lua b/lua/plugins/editing/scrollEof.lua deleted file mode 100644 index e121c05..0000000 --- a/lua/plugins/editing/scrollEof.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - "Aasim-A/scrollEOF.nvim", - event = { "CursorMoved", "WinScrolled" }, - opts = {}, -} - diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua deleted file mode 100644 index a564707..0000000 --- a/lua/plugins/init.lua +++ /dev/null @@ -1 +0,0 @@ -return {} diff --git a/lua/plugins/ui/catppuccin.lua b/lua/plugins/ui/catppuccin.lua deleted file mode 100644 index 5ce5c62..0000000 --- a/lua/plugins/ui/catppuccin.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - "catppuccin/nvim", - name = "catppuccin", - opts = { - transparent_background = true, -- disables setting the background color. - float = { - transparent = true, -- enable transparent floating windows - solid = false, -- use solid styling for floating windows, see |winborder| - }, - show_end_of_buffer = true, -- shows the '~' characters after the end of buffers - } -} - diff --git a/lua/plugins/ui/lualine.lua b/lua/plugins/ui/lualine.lua deleted file mode 100644 index 9cb3756..0000000 --- a/lua/plugins/ui/lualine.lua +++ /dev/null @@ -1,72 +0,0 @@ -return { - "nvim-lualine/lualine.nvim", - dependencies = { "nvim-tree/nvim-web-devicons", "archibate/lualine-time" }, - config = function() - require("lualine").setup({ - options = { - icons_enabled = true, - theme = "auto", - component_separators = { left = "", right = "" }, - section_separators = { left = "", right = "" }, - disabled_filetypes = { - statusline = {}, - winbar = {}, - }, - ignore_focus = {}, - always_divide_middle = true, - always_show_tabline = true, - globalstatus = false, - refresh = { - statusline = 1000, - tabline = 1000, - winbar = 1000, - refresh_time = 16, -- ~60fps - events = { - "WinEnter", - "BufEnter", - "BufWritePost", - "SessionLoadPost", - "FileChangedShellPost", - "VimResized", - "Filetype", - "CursorMoved", - "CursorMovedI", - "ModeChanged", - }, - }, - }, - sections = { - lualine_a = { - "mode", - { - function() - local reg = vim.fn.reg_recording() - if reg == "" then - return "" - end -- not recording - return "MACRO " .. string.upper(tostring(reg)) - end, - }, - }, - lualine_b = { "branch", "diff", "diagnostics" }, - lualine_c = { "filename" }, - lualine_x = { "filetype" }, - lualine_y = { "lsp_status" }, - lualine_z = { "ctime" }, - }, - inactive_sections = { - lualine_a = {}, - lualine_b = { "branch", "diff", "diagnostics" }, - lualine_c = { "filename" }, - lualine_x = { "location" }, - lualine_y = {}, - lualine_z = {}, - }, - tabline = {}, - winbar = {}, - inactive_winbar = {}, - extensions = {}, - }) - end, -} - diff --git a/lua/plugins/ui/noice.lua b/lua/plugins/ui/noice.lua deleted file mode 100644 index c3f88a7..0000000 --- a/lua/plugins/ui/noice.lua +++ /dev/null @@ -1,47 +0,0 @@ -return { - "folke/noice.nvim", - event = "VeryLazy", - config = function() - vim.notify = require("notify").setup({ - background_colour = "#000000", - render = "compact", - stages = "slide", - }) - require("noice").setup({ - messages = { - enabled = true, - view = "mini", - view_error = "notify", -- view for errors - view_warn = "notify", -- view for warnings - view_history = "messages", -- view for :messages - view_search = "virtualtext", -- view for search count messages. Set to `false` to disable - }, - notify = { - enabled = true, - view = "notify", - }, - hover = { - enabled = false, - }, - lsp = { - hover = { - enabled = false, - }, - signature = { - enabled = false, - }, - }, - presets = { - long_message_to_split = true, -- long messages will be sent to a split - inc_rename = false, -- enables an input dialog for inc-rename.nvim - lsp_doc_border = false, -- add a border to hover docs and signature help - }, - }) - end, - dependencies = { - -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries - "MunifTanjim/nui.nvim", - "rcarriga/nvim-notify", - }, -} - diff --git a/lua/plugins/ui/vimade.lua b/lua/plugins/ui/vimade.lua deleted file mode 100644 index 7034827..0000000 --- a/lua/plugins/ui/vimade.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - "tadaa/vimade", - opts = { - recipe = { "minimalist", { animate = true } }, - fadelevel = 0.6, - }, -} - diff --git a/lua/plugins/utils/files.lua b/lua/plugins/utils/files.lua deleted file mode 100644 index e0d37b5..0000000 --- a/lua/plugins/utils/files.lua +++ /dev/null @@ -1,55 +0,0 @@ -return { - { - "okuuva/auto-save.nvim", - version = "^1.0.0", -- see https://devhints.io/semver, alternatively use '*' to use the latest tagged release - cmd = "ASToggle", -- optional for lazy loading on command - event = { "InsertLeave", "TextChanged" }, - opts = {}, - config = function(opts) - require("auto-save").setup({ - enabled = true, - trigger_events = { -- See :h events - immediate_save = { "BufLeave", "FocusLost", "QuitPre", "VimSuspend" }, -- vim events that trigger an immediate save - defer_save = { "InsertLeave" }, -- vim events that trigger a deferred save (saves after `debounce_delay`) - cancel_deferred_save = { "InsertEnter" }, -- vim events that cancel a pending deferred save - }, - debounce_delay = 1000, - noautocmd = true, - }) - local group = vim.api.nvim_create_augroup("autosave", {}) - - vim.api.nvim_create_autocmd("User", { - pattern = "AutoSaveWritePre", - group = group, - callback = function(opts) - if opts.data.saved_buffer ~= nil then - local filename = vim.fn.expand("%:t") - print("Saved '" .. filename .. "' at " .. vim.fn.strftime("%H:%M:%S")) - end - end, - }) - - vim.api.nvim_create_autocmd("User", { - pattern = "AutoSaveEnable", - group = group, - callback = function(opts) - print("AutoSave enabled") - end, - }) - - vim.api.nvim_create_autocmd("User", { - pattern = "AutoSaveDisable", - group = group, - callback = function(opts) - print("AutoSave disabled") - end, - }) - end, - }, - { - "vladdoster/remember.nvim", - config = function() - require("remember").setup({}) - end, - }, -} diff --git a/lua/plugins/utils/mini.lua b/lua/plugins/utils/mini.lua deleted file mode 100644 index af8c3fa..0000000 --- a/lua/plugins/utils/mini.lua +++ /dev/null @@ -1,73 +0,0 @@ -return { - "echasnovski/mini.nvim", - version = "", - - config = function() - require("mini.pairs").setup() -- Bracket pairs and stuff - - require("mini.ai").setup() -- Around and In extension for visual mode - - require("mini.cursorword").setup() -- Underline current word below cursor (makes it easier to c and d) - - require("mini.indentscope").setup({ -- shows indents - symbol = "│", - draw = { - delay = 10, - animation = require("mini.indentscope").gen_animation.linear({ - duration = 15, - unit = "step", - easing = "out", - }), - }, - }) - - require("mini.trailspace").setup() -- Shows useless spaces - - require("mini.sessions").setup({ -- dir based session management - autoread = true, - autowrite = true, - file = ".session", - force = { read = false, write = true, delete = true }, - }) - - require("mini.surround").setup() -- Suround selections with characters - - require("mini.move").setup({ -- move selection in visual mode - mappings = { - down = "J", - up = "K", - }, - }) - - require("mini.icons").setup() -- Icon provider - - -- local animate = require("mini.animate") -- animations ovs - -- require("mini.animate").setup({ - -- cursor = { - -- enable = false, - -- }, - -- scroll = { - -- -- Animate for 200 milliseconds with linear easing - -- timing = animate.gen_timing.linear({ duration = 100, unit = "total" }), - -- -- Animate equally but with at most 120 steps instead of default 60 - -- subscroll = animate.gen_subscroll.equal({ max_output_steps = 60 }), - -- }, - -- open = { - -- -- Animate for 400 milliseconds with linear easing - -- timing = animate.gen_timing.linear({ duration = 100, unit = "total" }), - -- -- Animate with wiping from nearest edge instead of default static one - -- winconfig = animate.gen_winconfig.wipe({ direction = "from_edge" }), - -- -- Make bigger windows more transparent - -- winblend = animate.gen_winblend.linear({ from = 0, to = 0 }), - -- }, - -- close = { - -- -- Animate for 400 milliseconds with linear easing - -- timing = animate.gen_timing.linear({ duration = 100, unit = "total" }), - -- -- Animate with wiping to nearest edge instead of default static one - -- winconfig = animate.gen_winconfig.wipe({ direction = "to_edge" }), - -- -- Make bigger windows more transparent - -- winblend = animate.gen_winblend.linear({ from = 0, to = 0 }), - -- }, - -- }) - end, -} diff --git a/lua/plugins/utils/telescope.lua b/lua/plugins/utils/telescope.lua deleted file mode 100644 index ba990a8..0000000 --- a/lua/plugins/utils/telescope.lua +++ /dev/null @@ -1,83 +0,0 @@ -return { - { - "nvim-telescope/telescope.nvim", - tag = "", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-telescope/telescope-symbols.nvim", - "nvim-telescope/telescope-ui-select.nvim", - { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, - }, - config = function() - require("telescope").setup({ - defaults = { - file_ignore_patterns = { ".git", ".venv", ".node_modules" }, - }, - pickers = { - live_grep = { - additional_args = function(opts) - return { "--hidden" } - end, - }, - }, - extensions = { - file_browser = { - theme = "ivy", - hijack_netrw = true, - }, - ["ui-select"] = { - require("telescope.themes").get_dropdown({ - -- even more opts - }), - }, - }, - }) - local builtin = require("telescope.builtin") - - vim.keymap.set("n", "ff", function() - builtin.find_files({ hidden = true }) - end, { desc = "Telescope find files (current file dir)" }) - - vim.keymap.set("n", "fn", function() - local full_path = vim.api.nvim_buf_get_name(0) - local dir = vim.fn.fnamemodify(full_path, ":h") - require("telescope").extensions.file_browser.file_browser({ - path = dir, - }) - end) - - vim.keymap.set("n", "fs", function() -- select sessions - MiniSessions.select() - end) - - vim.keymap.set("n", "fd", function() -- select sessions - MiniSessions.select("delete") - end) - - vim.keymap.set("n", "fg", function() - builtin.live_grep({ hidden = true }) - end, { desc = "Telescope live grep (current file dir)" }) - - vim.keymap.set("n", "fb", function() - builtin.buffers({ cwd = vim.fn.expand("%:p:h") }) -- buffers don’t need cwd, but harmless - end, { desc = "Telescope buffers" }) - - require("telescope").load_extension("file_browser") - require("telescope").load_extension("ui-select") - require("telescope").load_extension("nerdy") - end, - }, - { - "nvim-telescope/telescope-file-browser.nvim", - dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" }, - }, - { - "2kabhishek/nerdy.nvim", - cmd = "Nerdy", - opts = { - max_recents = 30, -- Configure recent icons limit - copy_to_clipboard = false, -- Copy glyph to clipboard instead of inserting - copy_register = "+", -- Register to use for copying (if `copy_to_clipboard` is true) - }, - }, -} From 624fefdd18037a6a02cf865d8d4a79efa31d812b Mon Sep 17 00:00:00 2001 From: voidarc Date: Fri, 10 Apr 2026 12:15:22 +0100 Subject: [PATCH 2/6] an attempt was made --- flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 12 +++--------- init.lua | 2 +- plugins/init.lua | 1 + plugins/ui/catppuccin.lua | 10 ++++++++++ 5 files changed, 42 insertions(+), 10 deletions(-) create mode 100644 flake.lock create mode 100644 plugins/init.lua create mode 100644 plugins/ui/catppuccin.lua diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..cdcfcf2 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1775423009, + "narHash": "sha256-vPKLpjhIVWdDrfiUM8atW6YkIggCEKdSAlJPzzhkQlw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "68d8aa3d661f0e6bd5862291b5bb263b2a6595c9", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index cc7223e..e0fa78e 100644 --- a/flake.nix +++ b/flake.nix @@ -82,15 +82,9 @@ ]; shellHook = '' - export TREE_SITTER_LIB_PATH="${pkgs.tree-sitter}/lib" - echo "Neovim LSP environment loaded" - export DEVSHELL_NAME="󱄅 flake/#89dceb" - - # Trigger zsh - if [[ -z "$ZSH_VERSION" ]]; then - exec zsh - fi - + export TREE_SITTER_LIB_PATH="${pkgs.tree-sitter}/lib" + echo "Neovim LSP environment loaded" + export DEVSHELL_NAME="󱄅 flake/#89dceb" ''; }; }; diff --git a/init.lua b/init.lua index cc846ae..c228226 100644 --- a/init.lua +++ b/init.lua @@ -1,4 +1,4 @@ -require("config.lazy") +require("plugins.init") -- Colorcheme vim.cmd.colorscheme("catppuccin-mocha") diff --git a/plugins/init.lua b/plugins/init.lua new file mode 100644 index 0000000..97d6405 --- /dev/null +++ b/plugins/init.lua @@ -0,0 +1 @@ +require("plugins.ui.catppuccin") diff --git a/plugins/ui/catppuccin.lua b/plugins/ui/catppuccin.lua new file mode 100644 index 0000000..2a20a0c --- /dev/null +++ b/plugins/ui/catppuccin.lua @@ -0,0 +1,10 @@ +vim.pack.add({ { src = "https://github.com/catppuccin/nvim", name = "catppuccin" } }) + +require("catppuccin").setup({ + transparent_background = true, -- disables setting the background color. + float = { + transparent = true, -- enable transparent floating windows + solid = false, -- use solid styling for floating windows, see |winborder| + }, + show_end_of_buffer = true, -- shows the '~' characters after the end of buffers +}) From 6f7793bde419f71facbaf003aacf0144a1f04609 Mon Sep 17 00:00:00 2001 From: voidarc Date: Fri, 10 Apr 2026 15:27:58 +0100 Subject: [PATCH 3/6] almost everything --- init.lua | 5 ++ lua/config/autocmd.lua | 44 +++++++++++ lua/config/binds.lua | 34 +++++++++ lua/plugins/completion/conform.lua | 14 ++++ lua/plugins/completion/lspconfig.lua | 85 ++++++++++++++++++++++ lua/plugins/completion/treesitter.lua | 24 ++++++ lua/plugins/init.lua | 35 +++++++++ {plugins => lua/plugins}/ui/catppuccin.lua | 0 lua/plugins/ui/lualine.lua | 71 ++++++++++++++++++ lua/plugins/ui/noice.lua | 41 +++++++++++ lua/plugins/utils/mini.lua | 52 +++++++++++++ nvim-pack-lock.json | 64 ++++++++++++++++ plugins/init.lua | 1 - 13 files changed, 469 insertions(+), 1 deletion(-) create mode 100644 lua/config/autocmd.lua create mode 100644 lua/config/binds.lua create mode 100644 lua/plugins/completion/conform.lua create mode 100644 lua/plugins/completion/lspconfig.lua create mode 100644 lua/plugins/completion/treesitter.lua create mode 100644 lua/plugins/init.lua rename {plugins => lua/plugins}/ui/catppuccin.lua (100%) create mode 100644 lua/plugins/ui/lualine.lua create mode 100644 lua/plugins/ui/noice.lua create mode 100644 lua/plugins/utils/mini.lua create mode 100644 nvim-pack-lock.json delete mode 100644 plugins/init.lua diff --git a/init.lua b/init.lua index c228226..bcd55d8 100644 --- a/init.lua +++ b/init.lua @@ -1,4 +1,9 @@ +vim.g.mapleader = " " +vim.g.maplocalleader = "," + require("plugins.init") +require("config.autocmd") +require("config.binds") -- Colorcheme vim.cmd.colorscheme("catppuccin-mocha") diff --git a/lua/config/autocmd.lua b/lua/config/autocmd.lua new file mode 100644 index 0000000..b9fa53f --- /dev/null +++ b/lua/config/autocmd.lua @@ -0,0 +1,44 @@ +-- Autocommand to check git status +vim.api.nvim_create_autocmd("VimEnter", { + callback = function() + -- Verify if the current directory is a git repo + local is_git = os.execute("git rev-parse --is-inside-work-tree > /dev/null 2>&1") + if is_git ~= 0 then + return + end + + -- Perform an async fetch to avoid startup lag + vim.fn.jobstart("git fetch", { + on_exit = function() + -- Get the number of commits the remote is ahead of local HEAD + local count = vim.fn.system("git rev-list --count HEAD..@{u} 2>/dev/null"):gsub("%s+", "") + + if count ~= "" and tonumber(count) > 0 then + vim.schedule(function() + vim.notify( + "󰊢 " .. count .. " new commit(s) available on remote.", + vim.log.levels.INFO, + { title = "Git Status", icon = "󰊢" } + ) + end) + end + end, + }) + end, +}) + +local cursorline_group = vim.api.nvim_create_augroup("CursorLineControl", { clear = true }) + +vim.api.nvim_create_autocmd({ "WinEnter", "BufEnter" }, { + group = cursorline_group, + callback = function() + vim.opt_local.cursorline = true + end, +}) + +vim.api.nvim_create_autocmd({ "WinLeave" }, { + group = cursorline_group, + callback = function() + vim.opt_local.cursorline = false + end, +}) diff --git a/lua/config/binds.lua b/lua/config/binds.lua new file mode 100644 index 0000000..0920543 --- /dev/null +++ b/lua/config/binds.lua @@ -0,0 +1,34 @@ +-- Keymap function +function Keymap(mode, key, binding, opts) + local options = { noremap = true, silent = true } + if opts then + options = vim.tbl_extend("force", options, opts) + end + vim.keymap.set(mode, key, binding, options) +end + +Keymap("n", "q:", ":") -- remove nonsense command +Keymap("n", "bd", function() -- delete buffer + vim.cmd("bd") + vim.cmd("echo 'Buffer deleted'") +end) + +for _, bind in ipairs({ "i", "a", "A" }) do + -- Pass { expr = true } as the fourth argument + Keymap("n", bind, function() + if vim.fn.getline("."):match("^%s*$") then + return [["_cc]] + else + return bind + end + end, { expr = true }) +end + +Keymap("i", "", "") -- C-Backscpace for whole words + +-- Open Lazygit +Keymap("n", "l", function() + Snacks.lazygit.open() +end) + +Keymap("n", "d", "lua vim.diagnostic.open_float()") -- Diagnostics for Linter diff --git a/lua/plugins/completion/conform.lua b/lua/plugins/completion/conform.lua new file mode 100644 index 0000000..50404d7 --- /dev/null +++ b/lua/plugins/completion/conform.lua @@ -0,0 +1,14 @@ +vim.pack.add({ { src = "https://github.com/stevearc/conform.nvim", name = "conform" } }) + +require("conform").setup({ + formatters_by_ft = { + lua = { "stylua" }, + javascript = { "prettier" }, + python = { "black" }, + nix = { "nixfmt" }, + css = { "prettier" }, + rust = { "rustfmt" }, + }, + format_on_save = true, + undojoin = true, +}) diff --git a/lua/plugins/completion/lspconfig.lua b/lua/plugins/completion/lspconfig.lua new file mode 100644 index 0000000..405c7ea --- /dev/null +++ b/lua/plugins/completion/lspconfig.lua @@ -0,0 +1,85 @@ +vim.pack.add({ + { src = "https://github.com/neovim/nvim-lspconfig", name = "lspconfig" }, + { src = "https://github.com/saghen/blink.cmp", name = "blink" }, +}) + +vim.lsp.config("lua_ls", { + settings = { + Lua = { + -- Tell the server to let Neovim handle snippet expansion + completion = { + callSnippet = "Replace", + }, + -- Use LuaJIT (which Neovim uses) + runtime = { + version = "LuaJIT", + }, + }, + }, +}) +vim.lsp.config("emmet_ls", { + -- capabilities = require("cmp_nvim_lsp").default_capabilities(), + filetypes = { "html", "css", "javascriptreact", "typescriptreact" }, + init_options = { + html = { + options = { + ["bem.enabled"] = true, + }, + }, + }, +}) +vim.lsp.enable({ + "lua_ls", + "ts_ls", + "pylsp", + "cssls", + "nixd", + "rust_analyzer", + "emmet_ls", +}) + +vim.o.pumborder = "rounded" + +require("blink.cmp").setup({ + -- Snippet configuration + -- snippets = { + -- preset = "luasnip", -- Tells blink.cmp to use LuaSnip + -- }, + + fuzzy = { implementation = "lua" }, + + signature = { + enabled = true, + }, + + completion = { + list = { + selection = { + preselect = false, + auto_insert = true, + }, + }, + }, + + -- Keymaps + keymap = { + [""] = { "select_next", "snippet_forward", "fallback" }, + }, + sources = { + default = { + "lsp", -- (Equivalent to cmp-nvim-lsp) + "snippets", -- (Handled by the snippets config, replaces cmp_luasnip source) + "buffer", -- (Equivalent to cmp-buffer) + "path", -- (Equivalent to cmp-path) + -- "cmdline", -- Generally configured separately, but often included by default + }, + providers = { + -- lazydev = { + -- name = "LazyDev", + -- module = "lazydev.integrations.blink", + -- -- make lazydev completions top priority (see `:h blink.cmp`) + -- score_offset = 100, + -- }, + }, + }, +}) diff --git a/lua/plugins/completion/treesitter.lua b/lua/plugins/completion/treesitter.lua new file mode 100644 index 0000000..256da87 --- /dev/null +++ b/lua/plugins/completion/treesitter.lua @@ -0,0 +1,24 @@ +vim.pack.add({ { src = "https://github.com/nvim-treesitter/nvim-treesitter", name = "treesitter" } }) + +require("nvim-treesitter").setup({ + highlight = { enable = true }, + indent = { enable = true }, +}) + +require("nvim-treesitter").install({ + "bash", + "html", + "latex", + "javascript", + "json", + "lua", + "markdown", + "markdown_inline", + "query", + "regex", + "tsx", + "typescript", + "python", + "vim", + "yaml", +}) diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua new file mode 100644 index 0000000..155def3 --- /dev/null +++ b/lua/plugins/init.lua @@ -0,0 +1,35 @@ +local plugins = {} + +-- 1. Setup paths +local lua_path = vim.fn.stdpath("config") .. "/lua" +local plugin_dir = lua_path .. "/plugins" + +-- 2. Use ** to search recursively for all .lua files +local files = vim.fn.split(vim.fn.globpath(plugin_dir, "**/*.lua"), "\n") + +for _, file in ipairs(files) do + -- Get path relative to the 'lua' directory + -- Example: /home/user/.config/nvim/lua/plugins/ui/statusline.lua + -- Becomes: plugins/ui/statusline.lua + local relative_path = file:sub(#lua_path + 2) + + -- Remove the .lua extension + local module_path = relative_path:gsub("%.lua$", "") + + -- Convert path slashes to Lua dots (plugins/ui/statusline -> plugins.ui.statusline) + module_path = module_path:gsub("/", ".") + + -- 3. The Guard: Don't require the current file (plugins.init) + if not module_path:match("%.init$") and module_path ~= "plugins" then + local status_ok, module_content = pcall(require, module_path) + + if status_ok then + table.insert(plugins, module_content) + else + -- Optional: notify if a file failed to load + vim.notify("Error loading " .. module_path .. ": " .. module_content, vim.log.levels.ERROR) + end + end +end + +return plugins diff --git a/plugins/ui/catppuccin.lua b/lua/plugins/ui/catppuccin.lua similarity index 100% rename from plugins/ui/catppuccin.lua rename to lua/plugins/ui/catppuccin.lua diff --git a/lua/plugins/ui/lualine.lua b/lua/plugins/ui/lualine.lua new file mode 100644 index 0000000..5d4efe8 --- /dev/null +++ b/lua/plugins/ui/lualine.lua @@ -0,0 +1,71 @@ +vim.pack.add({ + { src = "https://github.com/nvim-lualine/lualine.nvim", name = "lualine" }, + { src = "https://github.com/nvim-tree/nvim-web-devicons", name = "devicons" }, + { src = "https://github.com/archibate/lualine-time", name = "lualine-time" }, +}) + +require("lualine").setup({ + options = { + icons_enabled = true, + theme = "auto", + component_separators = { left = "", right = "" }, + section_separators = { left = "", right = "" }, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + always_show_tabline = true, + globalstatus = false, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + refresh_time = 16, -- ~60fps + events = { + "WinEnter", + "BufEnter", + "BufWritePost", + "SessionLoadPost", + "FileChangedShellPost", + "VimResized", + "Filetype", + "CursorMoved", + "CursorMovedI", + "ModeChanged", + }, + }, + }, + sections = { + lualine_a = { + "mode", + { + function() + local reg = vim.fn.reg_recording() + if reg == "" then + return "" + end -- not recording + return "MACRO " .. string.upper(tostring(reg)) + end, + }, + }, + lualine_b = { "branch", "diff", "diagnostics" }, + lualine_c = { "filename" }, + lualine_x = { "filetype" }, + lualine_y = { "lsp_status" }, + lualine_z = { "ctime" }, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = { "branch", "diff", "diagnostics" }, + lualine_c = { "filename" }, + lualine_x = { "location" }, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {}, +}) diff --git a/lua/plugins/ui/noice.lua b/lua/plugins/ui/noice.lua new file mode 100644 index 0000000..f0be596 --- /dev/null +++ b/lua/plugins/ui/noice.lua @@ -0,0 +1,41 @@ +vim.pack.add({ + { src = "https://github.com/folke/noice.nvim", name = "noice" }, + { src = "https://github.com/MunifTanjim/nui.nvim", name = "nui" }, + { src = "https://github.com/rcarriga/nvim-notify", name = "notify" }, +}) + +vim.notify = require("notify").setup({ + background_colour = "#000000", + render = "compact", + stages = "slide", +}) +require("noice").setup({ + messages = { + enabled = true, + view = "mini", + view_error = "notify", -- view for errors + view_warn = "notify", -- view for warnings + view_history = "messages", -- view for :messages + view_search = "virtualtext", -- view for search count messages. Set to `false` to disable + }, + notify = { + enabled = true, + view = "notify", + }, + hover = { + enabled = false, + }, + lsp = { + hover = { + enabled = false, + }, + signature = { + enabled = false, + }, + }, + presets = { + long_message_to_split = true, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = false, -- add a border to hover docs and signature help + }, +}) diff --git a/lua/plugins/utils/mini.lua b/lua/plugins/utils/mini.lua new file mode 100644 index 0000000..fab7e4e --- /dev/null +++ b/lua/plugins/utils/mini.lua @@ -0,0 +1,52 @@ +vim.pack.add({ { src = "https://github.com/echasnovski/mini.nvim", name = "mini" } }) + +require("mini.pairs").setup() -- Bracket pairs and stuff + +require("mini.ai").setup() -- Around and In extension for visual mode + +require("mini.cursorword").setup() -- Underline current word below cursor (makes it easier to c and d) + +require("mini.indentscope").setup({ -- shows indents + symbol = "│", + draw = { + delay = 10, + animation = require("mini.indentscope").gen_animation.linear({ + duration = 15, + unit = "step", + easing = "out", + }), + }, +}) + +require("mini.trailspace").setup() -- Shows useless spaces + +require("mini.sessions").setup({ -- dir based session management + autoread = true, + autowrite = true, + file = ".session", + force = { read = false, write = true, delete = true }, +}) + +require("mini.surround").setup() -- Suround selections with characters + +require("mini.move").setup({ -- move selection in visual mode + mappings = { + down = "J", + up = "K", + }, +}) + +require("mini.icons").setup() -- Icon provider + +local animate = require("mini.animate") -- animations ovs +require("mini.animate").setup({ + cursor = { + enable = false, + }, + scroll = { + -- Animate for 200 milliseconds with linear easing + timing = animate.gen_timing.linear({ duration = 100, unit = "total" }), + -- Animate equally but with at most 120 steps instead of default 60 + subscroll = animate.gen_subscroll.equal({ max_output_steps = 60 }), + }, +}) diff --git a/nvim-pack-lock.json b/nvim-pack-lock.json new file mode 100644 index 0000000..011ae33 --- /dev/null +++ b/nvim-pack-lock.json @@ -0,0 +1,64 @@ +{ + "plugins": { + "blink": { + "rev": "456d38d1cd3743926f329204c2340f3e7840aad6", + "src": "https://github.com/saghen/blink.cmp" + }, + "catppuccin": { + "rev": "426dbebe06b5c69fd846ceb17b42e12f890aedf1", + "src": "https://github.com/catppuccin/nvim" + }, + "conform": { + "rev": "086a40dc7ed8242c03be9f47fbcee68699cc2395", + "src": "https://github.com/stevearc/conform.nvim" + }, + "devicons": { + "rev": "c72328a5494b4502947a022fe69c0c47e53b6aa6", + "src": "https://github.com/nvim-tree/nvim-web-devicons" + }, + "lspconfig": { + "rev": "c588db330592fa477a70d2fee6ba20a57194bdc3", + "src": "https://github.com/neovim/nvim-lspconfig" + }, + "lspkind": { + "rev": "c7274c48137396526b59d86232eabcdc7fed8a32", + "src": "https://github.com/onsails/lspkind.nvim" + }, + "lualine": { + "rev": "f5d2a8570f8b736ddb9bb4be504355bcd6e15ec8", + "src": "https://github.com/nvim-lualine/lualine.nvim" + }, + "lualine-time": { + "rev": "8838875e2e787293bb905d23dbb91ef4bde188ea", + "src": "https://github.com/archibate/lualine-time" + }, + "mini": { + "rev": "69b7433355664cf76898eb86a12a019f39bd86d1", + "src": "https://github.com/echasnovski/mini.nvim" + }, + "neorg": { + "rev": "1f14d72aad7165eac307a2a2f6be0fb97a04b3c2", + "src": "https://github.com/nvim-neorg/neorg" + }, + "noice": { + "rev": "7bfd942445fb63089b59f97ca487d605e715f155", + "src": "https://github.com/folke/noice.nvim" + }, + "notify": { + "rev": "8701bece920b38ea289b457f902e2ad184131a5d", + "src": "https://github.com/rcarriga/nvim-notify" + }, + "nui": { + "rev": "de740991c12411b663994b2860f1a4fd0937c130", + "src": "https://github.com/MunifTanjim/nui.nvim" + }, + "plenary": { + "rev": "74b06c6c75e4eeb3108ec01852001636d85a932b", + "src": "https://github.com/nvim-lua/plenary.nvim" + }, + "treesitter": { + "rev": "4916d6592ede8c07973490d9322f187e07dfefac", + "src": "https://github.com/nvim-treesitter/nvim-treesitter" + } + } +} diff --git a/plugins/init.lua b/plugins/init.lua deleted file mode 100644 index 97d6405..0000000 --- a/plugins/init.lua +++ /dev/null @@ -1 +0,0 @@ -require("plugins.ui.catppuccin") From b76db809f2f8634f4ed55c7154b62954061daa77 Mon Sep 17 00:00:00 2001 From: voidarc Date: Fri, 10 Apr 2026 20:55:51 +0100 Subject: [PATCH 4/6] added a load of nonsense and fixed the flake --- flake.nix | 25 ++----------- lua/config/binds.lua | 19 +++++++--- lua/plugins/completion/conform.lua | 36 ++++++++++++++++++- lua/plugins/completion/lspconfig.lua | 14 +++++--- lua/plugins/ui/catppuccin.lua | 10 +++++- lua/plugins/utils/convenience.lua | 54 ++++++++++++++++++++++++++++ nvim-pack-lock.json | 28 +++++++++++++++ test.ts | 1 + 8 files changed, 152 insertions(+), 35 deletions(-) create mode 100644 lua/plugins/utils/convenience.lua create mode 100644 test.ts diff --git a/flake.nix b/flake.nix index e0fa78e..b61e05e 100644 --- a/flake.nix +++ b/flake.nix @@ -17,6 +17,7 @@ vscode-langservers-extracted emmet-ls rust-analyzer + ast-grep prettier black nixfmt @@ -33,32 +34,10 @@ tree-sitter ripgrep gcc + fzf gnumake imagemagick - luajitPackages.magick - ghostscript luarocks - - (texlive.combine { - inherit (texlive) - scheme-basic - varwidth - preview - mathtools - amsfonts - amscdx - xcolor - dvisvgm - dvipng - wrapfig - standalone - graphicxbox - amsmath - ulem - hyperref - capt-of - ; - }) ]; nvim-wrapped = pkgs.symlinkJoin { diff --git a/lua/config/binds.lua b/lua/config/binds.lua index 0920543..00c06cc 100644 --- a/lua/config/binds.lua +++ b/lua/config/binds.lua @@ -26,9 +26,18 @@ end Keymap("i", "", "") -- C-Backscpace for whole words --- Open Lazygit -Keymap("n", "l", function() - Snacks.lazygit.open() -end) - Keymap("n", "d", "lua vim.diagnostic.open_float()") -- Diagnostics for Linter + +-- Flash keymaps +Keymap("n", "ss", function() + require("flash").jump() +end) +Keymap("n", "S", function() + require("flash").treesitter() +end) +Keymap("n", "r", function() + require("flash").remote() +end) +Keymap("n", "R", function() + require("flash").treesitter_search() +end) diff --git a/lua/plugins/completion/conform.lua b/lua/plugins/completion/conform.lua index 50404d7..850c086 100644 --- a/lua/plugins/completion/conform.lua +++ b/lua/plugins/completion/conform.lua @@ -1,4 +1,7 @@ -vim.pack.add({ { src = "https://github.com/stevearc/conform.nvim", name = "conform" } }) +vim.pack.add({ + { src = "https://github.com/stevearc/conform.nvim", name = "conform" }, + { src = "https://github.com/mfussenegger/nvim-lint", name = "lint" }, +}) require("conform").setup({ formatters_by_ft = { @@ -12,3 +15,34 @@ require("conform").setup({ format_on_save = true, undojoin = true, }) + +local lint = require("lint") + +-- Only show diagnostics close to the cursor +vim.diagnostic.config({ + virtual_text = { + spacing = 4, + prefix = function(diagnostic) + local icons = { + [vim.diagnostic.severity.ERROR] = " ", + [vim.diagnostic.severity.WARN] = "󰉀 ", + [vim.diagnostic.severity.INFO] = " ", + [vim.diagnostic.severity.HINT] = "󰌵 ", + } + return icons[diagnostic.severity] or "" + end, + }, + signs = false, + underline = true, + update_in_insert = false, +}) + +-- Auto-run the linter only for the configured filetypes +vim.api.nvim_create_autocmd("BufWritePost", { + callback = function() + local ft = vim.bo.filetype + if lint.linters_by_ft[ft] then + lint.try_lint() + end + end, +}) diff --git a/lua/plugins/completion/lspconfig.lua b/lua/plugins/completion/lspconfig.lua index 405c7ea..6985c7d 100644 --- a/lua/plugins/completion/lspconfig.lua +++ b/lua/plugins/completion/lspconfig.lua @@ -1,6 +1,7 @@ vim.pack.add({ { src = "https://github.com/neovim/nvim-lspconfig", name = "lspconfig" }, { src = "https://github.com/saghen/blink.cmp", name = "blink" }, + { src = "https://github.com/folke/lazydev.nvim", name = "lazydev" }, }) vim.lsp.config("lua_ls", { @@ -41,10 +42,6 @@ vim.lsp.enable({ vim.o.pumborder = "rounded" require("blink.cmp").setup({ - -- Snippet configuration - -- snippets = { - -- preset = "luasnip", -- Tells blink.cmp to use LuaSnip - -- }, fuzzy = { implementation = "lua" }, @@ -67,11 +64,11 @@ require("blink.cmp").setup({ }, sources = { default = { + -- "lazydev", "lsp", -- (Equivalent to cmp-nvim-lsp) "snippets", -- (Handled by the snippets config, replaces cmp_luasnip source) "buffer", -- (Equivalent to cmp-buffer) "path", -- (Equivalent to cmp-path) - -- "cmdline", -- Generally configured separately, but often included by default }, providers = { -- lazydev = { @@ -83,3 +80,10 @@ require("blink.cmp").setup({ }, }, }) + +vim.api.nvim_create_autocmd("FileType", { + pattern = "lua", + callback = function() + require("lazydev").setup() + end, +}) diff --git a/lua/plugins/ui/catppuccin.lua b/lua/plugins/ui/catppuccin.lua index 2a20a0c..9226ac7 100644 --- a/lua/plugins/ui/catppuccin.lua +++ b/lua/plugins/ui/catppuccin.lua @@ -1,4 +1,7 @@ -vim.pack.add({ { src = "https://github.com/catppuccin/nvim", name = "catppuccin" } }) +vim.pack.add({ + { src = "https://github.com/catppuccin/nvim", name = "catppuccin" }, + { src = "https://github.com/tadaa/vimade", name = "vimade" }, +}) require("catppuccin").setup({ transparent_background = true, -- disables setting the background color. @@ -8,3 +11,8 @@ require("catppuccin").setup({ }, show_end_of_buffer = true, -- shows the '~' characters after the end of buffers }) + +require("vimade").setup({ + recipe = { "minimalist", { animate = true } }, + fadelevel = 0.6, +}) diff --git a/lua/plugins/utils/convenience.lua b/lua/plugins/utils/convenience.lua new file mode 100644 index 0000000..0b89e39 --- /dev/null +++ b/lua/plugins/utils/convenience.lua @@ -0,0 +1,54 @@ +vim.pack.add({ + { src = "https://github.com/okuuva/auto-save.nvim", name = "autosave" }, + { src = "https://github.com/vladdoster/remember.nvim", name = "remember" }, + { src = "https://github.com/Aasim-A/scrollEOF.nvim", name = "scrolleof" }, + { src = "https://github.com/folke/flash.nvim", name = "flash" }, +}) + +require("auto-save").setup({ + enabled = true, + trigger_events = { + immediate_save = { "BufLeave", "FocusLost", "QuitPre", "VimSuspend" }, + defer_save = { "InsertLeave" }, -- save after debounce + cancel_deferred_save = { "InsertEnter" }, -- cancel pending save + }, + debounce_delay = 1000, + noautocmd = true, +}) + +local group = vim.api.nvim_create_augroup("autosave", {}) + +-- Notification to say when a file is saved +vim.api.nvim_create_autocmd("User", { + pattern = "AutoSaveWritePre", + group = group, + callback = function(opts) + if opts.data.saved_buffer ~= nil then + local filename = vim.fn.expand("%:t") + print("Saved '" .. filename .. "' at " .. vim.fn.strftime("%H:%M:%S")) + end + end, +}) + +-- Notification when enabling/disabling autosave for a buffer +vim.api.nvim_create_autocmd("User", { + pattern = "AutoSaveEnable", + group = group, + callback = function(opts) + print("AutoSave enabled") + end, +}) + +vim.api.nvim_create_autocmd("User", { + pattern = "AutoSaveDisable", + group = group, + callback = function(opts) + print("AutoSave disabled") + end, +}) + +-- enable remember +require("remember").setup({}) + +-- enable scrolleof +require("scrollEOF").setup() diff --git a/nvim-pack-lock.json b/nvim-pack-lock.json index 011ae33..d79e3f3 100644 --- a/nvim-pack-lock.json +++ b/nvim-pack-lock.json @@ -1,5 +1,9 @@ { "plugins": { + "autosave": { + "rev": "9aabcb8396224dcbf8d51c0c1d620d88a46e89d7", + "src": "https://github.com/okuuva/auto-save.nvim" + }, "blink": { "rev": "456d38d1cd3743926f329204c2340f3e7840aad6", "src": "https://github.com/saghen/blink.cmp" @@ -16,6 +20,18 @@ "rev": "c72328a5494b4502947a022fe69c0c47e53b6aa6", "src": "https://github.com/nvim-tree/nvim-web-devicons" }, + "flash": { + "rev": "fcea7ff883235d9024dc41e638f164a450c14ca2", + "src": "https://github.com/folke/flash.nvim" + }, + "lazydev": { + "rev": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d", + "src": "https://github.com/folke/lazydev.nvim" + }, + "lint": { + "rev": "eab58b48eb11d7745c11c505e0f3057165902461", + "src": "https://github.com/mfussenegger/nvim-lint" + }, "lspconfig": { "rev": "c588db330592fa477a70d2fee6ba20a57194bdc3", "src": "https://github.com/neovim/nvim-lspconfig" @@ -56,9 +72,21 @@ "rev": "74b06c6c75e4eeb3108ec01852001636d85a932b", "src": "https://github.com/nvim-lua/plenary.nvim" }, + "remember": { + "rev": "85aff6dc0a5adab088ef6b9210585ded31c32c7b", + "src": "https://github.com/vladdoster/remember.nvim" + }, + "scrolleof": { + "rev": "e462b9a07b8166c3e8011f1dcbc6bf68b67cd8d7", + "src": "https://github.com/Aasim-A/scrollEOF.nvim" + }, "treesitter": { "rev": "4916d6592ede8c07973490d9322f187e07dfefac", "src": "https://github.com/nvim-treesitter/nvim-treesitter" + }, + "vimade": { + "rev": "9b2eacd9c97c0bb547f6f3a27e8b5b7a70ad4d03", + "src": "https://github.com/tadaa/vimade" } } } diff --git a/test.ts b/test.ts new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/test.ts @@ -0,0 +1 @@ + From ac461d7a6ca9b8a836dd9a5db1b140a1b6cd53d9 Mon Sep 17 00:00:00 2001 From: voidarc Date: Thu, 16 Apr 2026 09:59:52 +0100 Subject: [PATCH 5/6] made lazydev load only when in a lua file --- flake.nix | 1 - lua/plugins/completion/lspconfig.lua | 20 ++++++++++++++++++-- nvim-pack-lock.json | 24 ++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index b61e05e..61755c5 100644 --- a/flake.nix +++ b/flake.nix @@ -11,7 +11,6 @@ system = "x86_64-linux"; # change if needed pkgs = import nixpkgs { inherit system; }; pkgList = with pkgs; [ - # LSPs lua-language-server vscode-langservers-extracted diff --git a/lua/plugins/completion/lspconfig.lua b/lua/plugins/completion/lspconfig.lua index 6985c7d..51c2112 100644 --- a/lua/plugins/completion/lspconfig.lua +++ b/lua/plugins/completion/lspconfig.lua @@ -1,7 +1,6 @@ vim.pack.add({ { src = "https://github.com/neovim/nvim-lspconfig", name = "lspconfig" }, { src = "https://github.com/saghen/blink.cmp", name = "blink" }, - { src = "https://github.com/folke/lazydev.nvim", name = "lazydev" }, }) vim.lsp.config("lua_ls", { @@ -81,9 +80,26 @@ require("blink.cmp").setup({ }, }) -vim.api.nvim_create_autocmd("FileType", { +vim.api.nvim_create_autocmd("FileType", { -- Lazy load lazydev when in lua file (no pun intended) pattern = "lua", callback = function() + vim.pack.add({ + { src = "https://github.com/folke/lazydev.nvim", name = "lazydev" }, + }) require("lazydev").setup() + require("blink.cmp").setup({ -- Reload blink with lazydev as a source + sources = { + -- add lazydev to your completion providers + default = { "lazydev", "lsp", "path", "snippets", "buffer" }, + providers = { + lazydev = { + name = "LazyDev", + module = "lazydev.integrations.blink", + -- make lazydev completions top priority (see `:h blink.cmp`) + score_offset = 100, + }, + }, + }, + }) end, }) diff --git a/nvim-pack-lock.json b/nvim-pack-lock.json index d79e3f3..5d82fd3 100644 --- a/nvim-pack-lock.json +++ b/nvim-pack-lock.json @@ -80,6 +80,30 @@ "rev": "e462b9a07b8166c3e8011f1dcbc6bf68b67cd8d7", "src": "https://github.com/Aasim-A/scrollEOF.nvim" }, + "telescope": { + "rev": "471eebb1037899fd942cc0f52c012f8773505da1", + "src": "https://github.com/nvim-telescope/telescope.nvim" + }, + "telescope-file-browser": { + "rev": "3610dc7dc91f06aa98b11dca5cc30dfa98626b7e", + "src": "https://github.com/nvim-telescope/telescope-file-browser.nvim" + }, + "telescope-fzf": { + "rev": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c", + "src": "https://github.com/nvim-telescope/telescope-fzf-native.nvim" + }, + "telescope-nerdy": { + "rev": "97b0914dece80204a777f04c94b9980da0f7ac88", + "src": "https://github.com/2kabhishek/nerdy.nvim" + }, + "telescope-symbols": { + "rev": "a6d0127a53d39b9fc2af75bd169d288166118aec", + "src": "https://github.com/nvim-telescope/telescope-symbols.nvim" + }, + "telescope-ui-select": { + "rev": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2", + "src": "https://github.com/nvim-telescope/telescope-ui-select.nvim" + }, "treesitter": { "rev": "4916d6592ede8c07973490d9322f187e07dfefac", "src": "https://github.com/nvim-treesitter/nvim-treesitter" From e2555ad8d0180d29eab63033f5840b0a79d2ae00 Mon Sep 17 00:00:00 2001 From: voidarc Date: Thu, 16 Apr 2026 10:00:14 +0100 Subject: [PATCH 6/6] fixed mini sessions and added telescope --- lua/config/autocmd.lua | 31 ++++++++++++++++++++++ lua/config/binds.lua | 43 +++++++++++++++++++++++++++++++ lua/plugins/utils/convenience.lua | 31 ---------------------- lua/plugins/utils/telescope.lua | 37 ++++++++++++++++++++++++++ 4 files changed, 111 insertions(+), 31 deletions(-) create mode 100644 lua/plugins/utils/telescope.lua diff --git a/lua/config/autocmd.lua b/lua/config/autocmd.lua index b9fa53f..38cdc82 100644 --- a/lua/config/autocmd.lua +++ b/lua/config/autocmd.lua @@ -42,3 +42,34 @@ vim.api.nvim_create_autocmd({ "WinLeave" }, { vim.opt_local.cursorline = false end, }) + +local group = vim.api.nvim_create_augroup("autosave", {}) + +-- Notification to say when a file is saved by autosave +vim.api.nvim_create_autocmd("User", { + pattern = "AutoSaveWritePre", + group = group, + callback = function(opts) + if opts.data.saved_buffer ~= nil then + local filename = vim.fn.expand("%:t") + print("Saved '" .. filename .. "' at " .. vim.fn.strftime("%H:%M:%S")) + end + end, +}) + +-- Notification when enabling/disabling autosave for a buffer +vim.api.nvim_create_autocmd("User", { + pattern = "AutoSaveEnable", + group = group, + callback = function() + print("AutoSave enabled") + end, +}) + +vim.api.nvim_create_autocmd("User", { + pattern = "AutoSaveDisable", + group = group, + callback = function() + print("AutoSave disabled") + end, +}) diff --git a/lua/config/binds.lua b/lua/config/binds.lua index 00c06cc..142a947 100644 --- a/lua/config/binds.lua +++ b/lua/config/binds.lua @@ -41,3 +41,46 @@ end) Keymap("n", "R", function() require("flash").treesitter_search() end) + +-- Mini Session Keybinds +Keymap("n", "qj", function() -- quit and save session local + require("mini.sessions").write(".session") + vim.cmd("wqa") +end) + +Keymap("n", "qd", function() -- quit and delete session + require("mini.sessions").delete(".session") + vim.cmd("wqa") +end) + +-- Telescope + +local builtin = require("telescope.builtin") + +Keymap("n", "ff", function() + builtin.find_files({ hidden = true }) +end) + +Keymap("n", "fn", function() + local full_path = vim.api.nvim_buf_get_name(0) + local dir = vim.fn.fnamemodify(full_path, ":h") + require("telescope").extensions.file_browser.file_browser({ + path = dir, + }) +end) + +Keymap("n", "fs", function() -- select sessions + MiniSessions.select() +end) + +Keymap("n", "fd", function() -- select sessions + MiniSessions.select("delete") +end) + +Keymap("n", "fg", function() + builtin.live_grep({ hidden = true }) +end) + +Keymap("n", "fb", function() + builtin.buffers({ cwd = vim.fn.expand("%:p:h") }) -- buffers don’t need cwd, but harmless +end) diff --git a/lua/plugins/utils/convenience.lua b/lua/plugins/utils/convenience.lua index 0b89e39..8ebffec 100644 --- a/lua/plugins/utils/convenience.lua +++ b/lua/plugins/utils/convenience.lua @@ -16,37 +16,6 @@ require("auto-save").setup({ noautocmd = true, }) -local group = vim.api.nvim_create_augroup("autosave", {}) - --- Notification to say when a file is saved -vim.api.nvim_create_autocmd("User", { - pattern = "AutoSaveWritePre", - group = group, - callback = function(opts) - if opts.data.saved_buffer ~= nil then - local filename = vim.fn.expand("%:t") - print("Saved '" .. filename .. "' at " .. vim.fn.strftime("%H:%M:%S")) - end - end, -}) - --- Notification when enabling/disabling autosave for a buffer -vim.api.nvim_create_autocmd("User", { - pattern = "AutoSaveEnable", - group = group, - callback = function(opts) - print("AutoSave enabled") - end, -}) - -vim.api.nvim_create_autocmd("User", { - pattern = "AutoSaveDisable", - group = group, - callback = function(opts) - print("AutoSave disabled") - end, -}) - -- enable remember require("remember").setup({}) diff --git a/lua/plugins/utils/telescope.lua b/lua/plugins/utils/telescope.lua new file mode 100644 index 0000000..502ffd4 --- /dev/null +++ b/lua/plugins/utils/telescope.lua @@ -0,0 +1,37 @@ +vim.pack.add({ + { src = "https://github.com/nvim-telescope/telescope.nvim", name = "telescope" }, + { src = "https://github.com/nvim-lua/plenary.nvim", name = "plenary" }, + { src = "https://github.com/nvim-telescope/telescope-symbols.nvim", name = "telescope-symbols" }, + { src = "https://github.com/nvim-telescope/telescope-ui-select.nvim", name = "telescope-ui-select" }, + { src = "https://github.com/nvim-telescope/telescope-fzf-native.nvim", name = "telescope-fzf" }, + { src = "https://github.com/nvim-telescope/telescope-file-browser.nvim", name = "telescope-file-browser" }, + { src = "https://github.com/2kabhishek/nerdy.nvim", name = "telescope-nerdy" }, +}) + +require("telescope").setup({ + defaults = { + file_ignore_patterns = { ".git", ".venv", ".node_modules" }, + }, + pickers = { + live_grep = { + additional_args = function() + return { "--hidden" } + end, + }, + }, + extensions = { + file_browser = { + theme = "ivy", + hijack_netrw = true, + }, + ["ui-select"] = { + require("telescope.themes").get_dropdown({ + -- even more opts + }), + }, + }, +}) + +require("telescope").load_extension("file_browser") +require("telescope").load_extension("ui-select") +require("telescope").load_extension("nerdy")