diff --git a/lazyvim.json b/lazyvim.json index 5a3f8ef..26d7d9f 100644 --- a/lazyvim.json +++ b/lazyvim.json @@ -34,7 +34,8 @@ "lazyvim.plugins.extras.util.mini-hipatterns", "lazyvim.plugins.extras.util.octo", "lazyvim.plugins.extras.util.project", - "lazyvim.plugins.extras.util.rest" + "lazyvim.plugins.extras.util.rest", + "lazyvim.plugins.extras.vscode" ], "install_version": 7, "news": { diff --git a/lua/plugins/blame.lua b/lua/plugins/blame.lua new file mode 100644 index 0000000..faf96df --- /dev/null +++ b/lua/plugins/blame.lua @@ -0,0 +1,9 @@ +-- Git blame integration +-- Shows git blame information in the current buffer +return { + "FabijanZulj/blame.nvim", + config = function() + require("blame").setup() + end, + cmd = "BlameToggle", +} \ No newline at end of file diff --git a/lua/plugins/blink.lua b/lua/plugins/blink.lua new file mode 100644 index 0000000..6c9e4ad --- /dev/null +++ b/lua/plugins/blink.lua @@ -0,0 +1,53 @@ +-- Blink.cmp configuration +-- Autocompletion plugin with multiple sources +return { + "saghen/blink.cmp", + dependencies = { + "hrsh7th/cmp-calc", + "saghen/blink.compat", + "Kaiser-Yang/blink-cmp-avante", + { + "Kaiser-Yang/blink-cmp-git", + dependencies = { "nvim-lua/plenary.nvim" }, + }, + { + "Kaiser-Yang/blink-cmp-dictionary", + dependencies = { "nvim-lua/plenary.nvim" }, + }, + }, + opts = { + keymap = { + [""] = { LazyVim.cmp.map({ "snippet_forward" }), "select_next", "fallback" }, + [""] = { LazyVim.cmp.map({ "snippet_backward" }), "select_prev", "fallback" }, + [""] = { "accept", "fallback" }, + [""] = { "hide", "fallback" }, + [""] = { "select_and_accept" }, + }, + completion = { list = { selection = { preselect = false, auto_insert = false } } }, + sources = { + default = { "avante", "git", "dictionary", "calc" }, + compat = { "calc" }, + providers = { + calc = { + kind = "calc", + }, + git = { + module = "blink-cmp-git", + name = "Git", + opts = {}, + }, + avante = { + module = "blink-cmp-avante", + name = "Avante", + opts = {}, + }, + dictionary = { + module = "blink-cmp-dictionary", + name = "Dict", + min_keyword_length = 3, + opts = {}, + }, + }, + }, + }, +} \ No newline at end of file diff --git a/lua/plugins/bufferline.lua b/lua/plugins/bufferline.lua new file mode 100644 index 0000000..0e0a0df --- /dev/null +++ b/lua/plugins/bufferline.lua @@ -0,0 +1,22 @@ +-- Buffer line configuration +-- Shows open buffers at the top of the screen +return { + "akinsho/bufferline.nvim", + opts = { + options = { + always_show_bufferline = false, + show_buffer_close_icons = false, + show_close_icon = false, + }, + }, + keys = { + { "", "BufferLineCyclePrev", desc = "Move to previous buffer" }, + { "", "BufferLineCycleNext", desc = "Move to next buffer" }, + { "", "BufferLineMovePrev", desc = "Re-order to previous buffer" }, + { "", "BufferLineMoveNext", desc = "Re-order to next buffer" }, + { "", "BufferLineTogglePin", desc = "Toggle Pin" }, + { "bP", false }, + { "bw", "BufferLineCloseOthers", desc = "Delete All Buffers" }, + { "bW", "BufferLineGroupClose ungrouped", desc = "Delete Non-Pinned Buffers" }, + }, +} \ No newline at end of file diff --git a/lua/plugins/conform.lua b/lua/plugins/conform.lua new file mode 100644 index 0000000..8220dce --- /dev/null +++ b/lua/plugins/conform.lua @@ -0,0 +1,25 @@ +-- Code formatting configuration +-- Sets up formatters for SQL and Mojo languages +return { + "stevearc/conform.nvim", + opts = { + formatters_by_ft = { + mojo = { "mojo" }, + sql = { "sqlfluff" }, + mysql = { "sqlfluff" }, + plsql = { "sqlfluff" }, + }, + formatters = { + sqlfluff = { + require_cwd = false, + args = { "format", "--dialect=postgres", "-" }, + }, + mojo = { + inherit = false, + command = "mojo", + args = { "format", "--quiet", "$FILENAME" }, + stdin = false, + }, + }, + }, +} \ No newline at end of file diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua deleted file mode 100644 index d789495..0000000 --- a/lua/plugins/init.lua +++ /dev/null @@ -1,289 +0,0 @@ -return { - { - "folke/tokyonight.nvim", - opts = { style = "night" }, - }, - - { - "akinsho/bufferline.nvim", - opts = { - options = { - always_show_bufferline = false, - show_buffer_close_icons = false, - show_close_icon = false, - }, - }, - keys = { - { "", "BufferLineCyclePrev", desc = "Move to previous buffer" }, - { "", "BufferLineCycleNext", desc = "Move to next buffer" }, - { "", "BufferLineMovePrev", desc = "Re-order to previous buffer" }, - { "", "BufferLineMoveNext", desc = "Re-order to next buffer" }, - { "", "BufferLineTogglePin", desc = "Toggle Pin" }, - { "bP", false }, - { "bw", "BufferLineCloseOthers", desc = "Delete All Buffers" }, - { "bW", "BufferLineGroupClose ungrouped", desc = "Delete Non-Pinned Buffers" }, - }, - }, - - { - "folke/snacks.nvim", - opts = { - dashboard = { - preset = { - header = [[Hey Joe 👋!]], - }, - }, - indent = { - scope = { enabled = false }, - animate = { enabled = false }, - }, - scroll = { - enabled = false, - }, - picker = { - formatters = { - file = { - filename_first = true, -- display filename before the file path - truncate = 100, -- truncate the file path to (roughly) this length - }, - }, - hidden = true, -- show hidden files by default - }, - }, - keys = { - { - "", - function() - Snacks.picker.files({ hidden = true }) - end, - desc = "Find Files (Root Dir)", - }, - }, - }, - - { - "johmsalas/text-case.nvim", - config = function() - require("textcase").setup({}) - end, - }, - - { - -- Measure the time spent on projects - "wakatime/vim-wakatime", - event = "VeryLazy", - }, - - { - "neovim/nvim-lspconfig", - opts = { - servers = { - golangci_lint_ls = {}, - }, - }, - }, - - { - "saghen/blink.cmp", - dependencies = { - "hrsh7th/cmp-calc", - "saghen/blink.compat", - "Kaiser-Yang/blink-cmp-avante", - { - "Kaiser-Yang/blink-cmp-git", - dependencies = { "nvim-lua/plenary.nvim" }, - }, - { - "Kaiser-Yang/blink-cmp-dictionary", - dependencies = { "nvim-lua/plenary.nvim" }, - }, - }, - opts = { - keymap = { - [""] = { LazyVim.cmp.map({ "snippet_forward" }), "select_next", "fallback" }, - [""] = { LazyVim.cmp.map({ "snippet_backward" }), "select_prev", "fallback" }, - [""] = { "accept", "fallback" }, - [""] = { "hide", "fallback" }, - [""] = { "select_and_accept" }, - }, - completion = { list = { selection = { preselect = false, auto_insert = false } } }, - sources = { - default = { "avante", "git", "dictionary", "calc" }, - compat = { "calc" }, - providers = { - calc = { - kind = "calc", - }, - git = { - module = "blink-cmp-git", - name = "Git", - opts = {}, - }, - avante = { - module = "blink-cmp-avante", - name = "Avante", - opts = {}, - }, - dictionary = { - module = "blink-cmp-dictionary", - name = "Dict", - min_keyword_length = 3, - opts = {}, - }, - }, - }, - }, - }, - - { - "folke/which-key.nvim", - opts = { - preset = "helix", - icons = { - mappings = false, - rules = false, - }, - spec = { - { - mode = { "n" }, - { "W", 'lua require("config.utils").sudo_write()', desc = "Write (sudo)" }, - }, - }, - }, - }, - - { - "ZWindL/orphans.nvim", - config = function() - require("orphans").setup({}) - end, - cmd = { "Orphans" }, - }, - - { - "nvim-treesitter/nvim-treesitter", - optional = true, - opts = { ensure_installed = { "sql", "gotmpl", "comment" } }, - }, - - { - "mfussenegger/nvim-lint", - opts = { - linters = { - ["markdownlint-cli2"] = { - args = { "--config", os.getenv("HOME") .. "/.config/nvim/.markdownlint-cli2.yaml", "--" }, - }, - }, - }, - }, - - { - "FabijanZulj/blame.nvim", - config = function() - require("blame").setup() - end, - cmd = "BlameToggle", - }, - - { - "nvim-lualine/lualine.nvim", - event = "VeryLazy", - opts = function(_, opts) - local function is_textfile() - local filetype = vim.bo.filetype - return filetype == "markdown" - or filetype == "asciidoc" - or filetype == "pandoc" - or filetype == "tex" - or filetype == "text" - end - - local function wordcount() - local wc = vim.fn.wordcount() - local visual_words = wc.visual_words or wc.words - local word_string = visual_words == 1 and " word" or " words" - return tostring(visual_words) .. word_string - end - - table.insert(opts.sections.lualine_z, { wordcount, cond = is_textfile }) - end, - }, - - { - "ahmedkhalf/project.nvim", - event = "VeryLazy", - config = function() - require("project_nvim").setup({ - patterns = { "go.mod", ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json", ".obsidian" }, - }) - end, - }, - - { - "neovim/nvim-lspconfig", - opts = function() - local keys = require("lazyvim.plugins.lsp.keymaps").get() - -- disable mappings - keys[#keys + 1] = { "", false } - keys[#keys + 1] = { "", false } - end, - }, - - -- NOTE: until this issue is fixed in LazyVim: https://github.com/LazyVim/LazyVim/pull/5900 - { - "nvim-lualine/lualine.nvim", - opts = function(_, opts) - opts.sections.lualine_x[2] = LazyVim.lualine.status(LazyVim.config.icons.kinds.Copilot, function() - local clients = package.loaded["copilot"] and LazyVim.lsp.get_clients({ name = "copilot", bufnr = 0 }) or {} - if #clients > 0 then - local status = require("copilot.status").data.status - return (status == "InProgress" and "pending") or (status == "Warning" and "error") or "ok" - end - end) - end, - }, - - { - "williamboman/mason.nvim", - opts = { ensure_installed = { "sqlfluff" } }, - }, - - { - "mfussenegger/nvim-lint", - optional = true, - opts = { - linters_by_ft = { - sql = { "sqlfluff" }, - mysql = { "sqlfluff" }, - plsql = { "sqlfluff" }, - }, - linters = { - sqlfluff = { prepend_args = { "--dialect", "postgres" } }, - }, - }, - }, - - { - "stevearc/conform.nvim", - opts = { - formatters_by_ft = { - mojo = { "mojo" }, - sql = { "sqlfluff" }, - mysql = { "sqlfluff" }, - plsql = { "sqlfluff" }, - }, - formatters = { - sqlfluff = { - require_cwd = false, - args = { "format", "--dialect=postgres", "-" }, - }, - mojo = { - inherit = false, - command = "mojo", - args = { "format", "--quiet", "$FILENAME" }, - stdin = false, - }, - }, - }, - }, -} diff --git a/lua/plugins/lint-markdown.lua b/lua/plugins/lint-markdown.lua new file mode 100644 index 0000000..f34fae2 --- /dev/null +++ b/lua/plugins/lint-markdown.lua @@ -0,0 +1,12 @@ +-- Markdown linting configuration +-- Uses markdownlint-cli2 for linting markdown files +return { + "mfussenegger/nvim-lint", + opts = { + linters = { + ["markdownlint-cli2"] = { + args = { "--config", os.getenv("HOME") .. "/.config/nvim/.markdownlint-cli2.yaml", "--" }, + }, + }, + }, +} \ No newline at end of file diff --git a/lua/plugins/lint-sql.lua b/lua/plugins/lint-sql.lua new file mode 100644 index 0000000..03b12cf --- /dev/null +++ b/lua/plugins/lint-sql.lua @@ -0,0 +1,16 @@ +-- SQL linting configuration +-- Configures sqlfluff linter for SQL dialects +return { + "mfussenegger/nvim-lint", + optional = true, + opts = { + linters_by_ft = { + sql = { "sqlfluff" }, + mysql = { "sqlfluff" }, + plsql = { "sqlfluff" }, + }, + linters = { + sqlfluff = { prepend_args = { "--dialect", "postgres" } }, + }, + }, +} \ No newline at end of file diff --git a/lua/plugins/lspconfig-go.lua b/lua/plugins/lspconfig-go.lua new file mode 100644 index 0000000..1445bb7 --- /dev/null +++ b/lua/plugins/lspconfig-go.lua @@ -0,0 +1,10 @@ +-- LSP configuration for Go +-- Adds golangci_lint_ls server +return { + "neovim/nvim-lspconfig", + opts = { + servers = { + golangci_lint_ls = {}, + }, + }, +} \ No newline at end of file diff --git a/lua/plugins/lspconfig-keymaps.lua b/lua/plugins/lspconfig-keymaps.lua new file mode 100644 index 0000000..f9c357a --- /dev/null +++ b/lua/plugins/lspconfig-keymaps.lua @@ -0,0 +1,11 @@ +-- LSP keymaps configuration +-- Disables some default LSP keybindings +return { + "neovim/nvim-lspconfig", + opts = function() + local keys = require("lazyvim.plugins.lsp.keymaps").get() + -- disable mappings + keys[#keys + 1] = { "", false } + keys[#keys + 1] = { "", false } + end, +} \ No newline at end of file diff --git a/lua/plugins/lualine-copilot.lua b/lua/plugins/lualine-copilot.lua new file mode 100644 index 0000000..e019ff1 --- /dev/null +++ b/lua/plugins/lualine-copilot.lua @@ -0,0 +1,15 @@ +-- Lualine Copilot integration +-- Shows Copilot status in the status line +-- NOTE: This is a temporary fix until the issue is fixed in LazyVim: https://github.com/LazyVim/LazyVim/pull/5900 +return { + "nvim-lualine/lualine.nvim", + opts = function(_, opts) + opts.sections.lualine_x[2] = LazyVim.lualine.status(LazyVim.config.icons.kinds.Copilot, function() + local clients = package.loaded["copilot"] and LazyVim.lsp.get_clients({ name = "copilot", bufnr = 0 }) or {} + if #clients > 0 then + local status = require("copilot.status").data.status + return (status == "InProgress" and "pending") or (status == "Warning" and "error") or "ok" + end + end) + end, +} \ No newline at end of file diff --git a/lua/plugins/lualine-wordcount.lua b/lua/plugins/lualine-wordcount.lua new file mode 100644 index 0000000..5e4922d --- /dev/null +++ b/lua/plugins/lualine-wordcount.lua @@ -0,0 +1,25 @@ +-- Lualine word count extension +-- Shows word count in the status line for text files +return { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + opts = function(_, opts) + local function is_textfile() + local filetype = vim.bo.filetype + return filetype == "markdown" + or filetype == "asciidoc" + or filetype == "pandoc" + or filetype == "tex" + or filetype == "text" + end + + local function wordcount() + local wc = vim.fn.wordcount() + local visual_words = wc.visual_words or wc.words + local word_string = visual_words == 1 and " word" or " words" + return tostring(visual_words) .. word_string + end + + table.insert(opts.sections.lualine_z, { wordcount, cond = is_textfile }) + end, +} \ No newline at end of file diff --git a/lua/plugins/mason-sql.lua b/lua/plugins/mason-sql.lua new file mode 100644 index 0000000..06e6484 --- /dev/null +++ b/lua/plugins/mason-sql.lua @@ -0,0 +1,6 @@ +-- Mason SQL tools configuration +-- Ensures SQL linting and formatting tools are installed +return { + "williamboman/mason.nvim", + opts = { ensure_installed = { "sqlfluff" } }, +} \ No newline at end of file diff --git a/lua/plugins/orphans.lua b/lua/plugins/orphans.lua new file mode 100644 index 0000000..dc81ff6 --- /dev/null +++ b/lua/plugins/orphans.lua @@ -0,0 +1,9 @@ +-- Orphans plugin configuration +-- Helps to find orphaned files in your project +return { + "ZWindL/orphans.nvim", + config = function() + require("orphans").setup({}) + end, + cmd = { "Orphans" }, +} \ No newline at end of file diff --git a/lua/plugins/project.lua b/lua/plugins/project.lua new file mode 100644 index 0000000..460336b --- /dev/null +++ b/lua/plugins/project.lua @@ -0,0 +1,11 @@ +-- Project management configuration +-- Automatically detects and switches working directory based on project files +return { + "ahmedkhalf/project.nvim", + event = "VeryLazy", + config = function() + require("project_nvim").setup({ + patterns = { "go.mod", ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json", ".obsidian" }, + }) + end, +} \ No newline at end of file diff --git a/lua/plugins/snacks.lua b/lua/plugins/snacks.lua new file mode 100644 index 0000000..1b4c845 --- /dev/null +++ b/lua/plugins/snacks.lua @@ -0,0 +1,37 @@ +-- Snacks.nvim configuration +-- Provides dashboard, indent guides, and file picker +return { + "folke/snacks.nvim", + opts = { + dashboard = { + preset = { + header = [[Hey Joe 👋!]], + }, + }, + indent = { + scope = { enabled = false }, + animate = { enabled = false }, + }, + scroll = { + enabled = false, + }, + picker = { + formatters = { + file = { + filename_first = true, -- display filename before the file path + truncate = 100, -- truncate the file path to (roughly) this length + }, + }, + hidden = true, -- show hidden files by default + }, + }, + keys = { + { + "", + function() + Snacks.picker.files({ hidden = true }) + end, + desc = "Find Files (Root Dir)", + }, + }, +} \ No newline at end of file diff --git a/lua/plugins/text-case.lua b/lua/plugins/text-case.lua new file mode 100644 index 0000000..90d9f8a --- /dev/null +++ b/lua/plugins/text-case.lua @@ -0,0 +1,8 @@ +-- Text Case plugin configuration +-- Provides case conversion utilities +return { + "johmsalas/text-case.nvim", + config = function() + require("textcase").setup({}) + end, +} \ No newline at end of file diff --git a/lua/plugins/tokyonight.lua b/lua/plugins/tokyonight.lua new file mode 100644 index 0000000..6c7ef47 --- /dev/null +++ b/lua/plugins/tokyonight.lua @@ -0,0 +1,5 @@ +-- Tokyo Night colorscheme configuration +return { + "folke/tokyonight.nvim", + opts = { style = "night" }, +} \ No newline at end of file diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..21bf493 --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,7 @@ +-- Treesitter configuration +-- Additional language parsers configuration +return { + "nvim-treesitter/nvim-treesitter", + optional = true, + opts = { ensure_installed = { "sql", "gotmpl", "comment" } }, +} \ No newline at end of file diff --git a/lua/plugins/wakatime.lua b/lua/plugins/wakatime.lua new file mode 100644 index 0000000..c480899 --- /dev/null +++ b/lua/plugins/wakatime.lua @@ -0,0 +1,6 @@ +-- WakaTime plugin configuration +-- Measures the time spent on projects +return { + "wakatime/vim-wakatime", + event = "VeryLazy", +} \ No newline at end of file diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua new file mode 100644 index 0000000..f460536 --- /dev/null +++ b/lua/plugins/which-key.lua @@ -0,0 +1,18 @@ +-- Which-key configuration +-- Shows keybinding hints in a popup +return { + "folke/which-key.nvim", + opts = { + preset = "helix", + icons = { + mappings = false, + rules = false, + }, + spec = { + { + mode = { "n" }, + { "W", 'lua require("config.utils").sudo_write()', desc = "Write (sudo)" }, + }, + }, + }, +} \ No newline at end of file