From 4c00a4bea6a16edaf280e6d1f91b47816ca1ae6c Mon Sep 17 00:00:00 2001 From: sgoudham Date: Mon, 6 Feb 2023 02:25:13 +0000 Subject: [PATCH] refactor(nvim): reformat with stylua --- dot_config/nvim/init.lua | 74 ++-- dot_config/nvim/lua/binds.lua | 46 +-- dot_config/nvim/lua/plugins/asciiblocks.lua | 2 +- dot_config/nvim/lua/plugins/asciitree.lua | 2 +- dot_config/nvim/lua/plugins/autopairs.lua | 25 +- dot_config/nvim/lua/plugins/catppuccin.lua | 112 +++--- dot_config/nvim/lua/plugins/ccc.lua | 2 +- dot_config/nvim/lua/plugins/cmp.lua | 200 +++++------ dot_config/nvim/lua/plugins/coverage.lua | 10 +- dot_config/nvim/lua/plugins/dap.lua | 152 ++++---- dot_config/nvim/lua/plugins/delaytrain.lua | 12 +- dot_config/nvim/lua/plugins/feline.lua | 48 +-- dot_config/nvim/lua/plugins/init.lua | 10 +- dot_config/nvim/lua/plugins/lsp.lua | 330 +++++++++--------- dot_config/nvim/lua/plugins/mason.lua | 10 +- dot_config/nvim/lua/plugins/mini.lua | 34 +- dot_config/nvim/lua/plugins/noice.lua | 66 ++-- dot_config/nvim/lua/plugins/overseer.lua | 16 +- dot_config/nvim/lua/plugins/quickscope.lua | 12 +- dot_config/nvim/lua/plugins/searchreplace.lua | 12 +- dot_config/nvim/lua/plugins/surround.lua | 2 +- dot_config/nvim/lua/plugins/telescope.lua | 52 +-- dot_config/nvim/lua/plugins/treesitter.lua | 58 +-- dot_config/nvim/lua/plugins/which_key.lua | 50 +-- dot_config/nvim/lua/plugins/zenmode.lua | 28 +- dot_config/nvim/stylua.toml | 7 + 26 files changed, 692 insertions(+), 680 deletions(-) create mode 100644 dot_config/nvim/stylua.toml diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua index cf21097..7c97291 100644 --- a/dot_config/nvim/init.lua +++ b/dot_config/nvim/init.lua @@ -7,32 +7,32 @@ vim.g.loaded_netrwPlugin = 1 -- bootstrap & set up lazy local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) end vim.opt.rtp:prepend(lazypath) require("lazy").setup("plugins", { - install = { - colorscheme = { "catppuccin" }, - missing = true, - }, - change_detection = { - enabled = true, - notify = false, - }, - ui = { - border = "rounded", - icons = { - list = { "●" }, - }, + install = { + colorscheme = { "catppuccin" }, + missing = true, + }, + change_detection = { + enabled = true, + notify = false, + }, + ui = { + border = "rounded", + icons = { + list = { "●" }, }, + }, }) -- load remaining config @@ -42,29 +42,29 @@ require("binds") -- highlight yank vim.api.nvim_create_augroup("highlight_yank", {}) vim.api.nvim_create_autocmd({ "TextYankPost" }, { - group = "highlight_yank", - pattern = { "*" }, - callback = function() - vim.highlight.on_yank({ - higroup = "Visual", - timeout = 150, - }) - end, + group = "highlight_yank", + pattern = { "*" }, + callback = function() + vim.highlight.on_yank({ + higroup = "Visual", + timeout = 150, + }) + end, }) -- Disable semantic highlights vim.api.nvim_create_autocmd("LspAttach", { - callback = function(args) - local client = vim.lsp.get_client_by_id(args.data.client_id) - client.server_capabilities.semanticTokensProvider = nil - end, + callback = function(args) + local client = vim.lsp.get_client_by_id(args.data.client_id) + client.server_capabilities.semanticTokensProvider = nil + end, }) -- Stop comments on new lines when pressing 'o' vim.api.nvim_create_augroup("stop_comments_on_o", {}) vim.api.nvim_create_autocmd("BufEnter", { - group = "stop_comments_on_o", - callback = function(_) - vim.opt.formatoptions:remove("o") - end, + group = "stop_comments_on_o", + callback = function(_) + vim.opt.formatoptions:remove("o") + end, }) diff --git a/dot_config/nvim/lua/binds.lua b/dot_config/nvim/lua/binds.lua index 94b68b3..2a65a33 100644 --- a/dot_config/nvim/lua/binds.lua +++ b/dot_config/nvim/lua/binds.lua @@ -4,55 +4,55 @@ local wk = require("which-key") -- https://github.com/wez/wezterm/discussions/2426 -- https://github.com/neovim/neovim/issues/2252 wk.register({ - [""] = { "lua io.popen('wezterm cli split-pane --right --cwd .')", "All my homies hate OSC 7" }, - [""] = { "lua io.popen('wezterm cli split-pane --bottom --cwd .')", "All my homies hate OSC 7" }, + [""] = { "lua io.popen('wezterm cli split-pane --right --cwd .')", "All my homies hate OSC 7" }, + [""] = { "lua io.popen('wezterm cli split-pane --bottom --cwd .')", "All my homies hate OSC 7" }, }, { mode = { "n", "i", "v", "t" } }) -- normal binds wk.register({ - ["0"] = { "0^", "Start of Line" }, - [""] = { "o", "New Line Without Insert" }, - [""] = { "write", "Save" }, - [""] = { "zz", "Half page down" }, - [""] = { "zz", "Half page up" }, - n = { "nzzzv", "Next result (centered)" }, - N = { "Nzzzv", "Previous result (centered)" }, - J = { "mzJ`z", "Join lines (stable)" }, + ["0"] = { "0^", "Start of Line" }, + [""] = { "o", "New Line Without Insert" }, + [""] = { "write", "Save" }, + [""] = { "zz", "Half page down" }, + [""] = { "zz", "Half page up" }, + n = { "nzzzv", "Next result (centered)" }, + N = { "Nzzzv", "Previous result (centered)" }, + J = { "mzJ`z", "Join lines (stable)" }, }) -- visual binds wk.register({ - J = { ":m '>+1gv=gv", "Move line down" }, - K = { ":m '<-2gv=gv", "Move line up" }, + J = { ":m '>+1gv=gv", "Move line down" }, + K = { ":m '<-2gv=gv", "Move line up" }, }, { mode = "v" }) -- terminal binds wk.register({ - [""] = { [[]], "Normal mode" }, + [""] = { [[]], "Normal mode" }, }, { mode = "t" }) -- normal + terminal binds wk.register({ - [""] = { "wincmd h", "Go to the left window" }, - [""] = { "wincmd j", "Go to the down window" }, - [""] = { "wincmd k", "Go to the up window" }, - [""] = { "wincmd l", "Go to the right window" }, + [""] = { "wincmd h", "Go to the left window" }, + [""] = { "wincmd j", "Go to the down window" }, + [""] = { "wincmd k", "Go to the up window" }, + [""] = { "wincmd l", "Go to the right window" }, }, { mode = { "n", "t" } }) -- leader binds wk.register({ - p = { [["+p]], "Put from clipboard" }, - w = { [[:w]], "Quick Save" }, - q = { [[:q]], "Quick Exit" }, + p = { [["+p]], "Put from clipboard" }, + w = { [[:w]], "Quick Save" }, + q = { [[:q]], "Quick Exit" }, }, { prefix = "" }) -- nv leader binds wk.register({ - d = { [["_d]], "Delete w/o yank" }, - y = { [["+y]], "Yank to clipboard" }, + d = { [["_d]], "Delete w/o yank" }, + y = { [["+y]], "Yank to clipboard" }, }, { prefix = "", mode = { "n", "v" } }) -- x leader binds wk.register({ - p = { [["_dP"]], "Put w/o yank" }, + p = { [["_dP"]], "Put w/o yank" }, }, { prefix = "", mode = "x" }) diff --git a/dot_config/nvim/lua/plugins/asciiblocks.lua b/dot_config/nvim/lua/plugins/asciiblocks.lua index 9e820d6..cf547d8 100644 --- a/dot_config/nvim/lua/plugins/asciiblocks.lua +++ b/dot_config/nvim/lua/plugins/asciiblocks.lua @@ -1,3 +1,3 @@ return { - { "superhawk610/ascii-blocks.nvim", cmd = "AsciiBlockify" }, + { "superhawk610/ascii-blocks.nvim", cmd = "AsciiBlockify" }, } diff --git a/dot_config/nvim/lua/plugins/asciitree.lua b/dot_config/nvim/lua/plugins/asciitree.lua index f991b24..4267ab4 100644 --- a/dot_config/nvim/lua/plugins/asciitree.lua +++ b/dot_config/nvim/lua/plugins/asciitree.lua @@ -1,3 +1,3 @@ return { - { "cloudysake/asciitree.nvim", cmd = "AsciiTree" }, + { "cloudysake/asciitree.nvim", cmd = "AsciiTree" }, } diff --git a/dot_config/nvim/lua/plugins/autopairs.lua b/dot_config/nvim/lua/plugins/autopairs.lua index 5a4f009..cc8e169 100644 --- a/dot_config/nvim/lua/plugins/autopairs.lua +++ b/dot_config/nvim/lua/plugins/autopairs.lua @@ -1,16 +1,13 @@ return { - { - "windwp/nvim-autopairs", - config = function() - require("nvim-autopairs").setup({ - disable_in_macro = true, - }) - local cmp_autopairs = require('nvim-autopairs.completion.cmp') - local cmp = require('cmp') - cmp.event:on( - 'confirm_done', - cmp_autopairs.on_confirm_done() - ) - end, - }, + { + "windwp/nvim-autopairs", + config = function() + require("nvim-autopairs").setup({ + disable_in_macro = true, + }) + local cmp_autopairs = require("nvim-autopairs.completion.cmp") + local cmp = require("cmp") + cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) + end, + }, } diff --git a/dot_config/nvim/lua/plugins/catppuccin.lua b/dot_config/nvim/lua/plugins/catppuccin.lua index a9e2e6d..aedf6ff 100644 --- a/dot_config/nvim/lua/plugins/catppuccin.lua +++ b/dot_config/nvim/lua/plugins/catppuccin.lua @@ -1,59 +1,59 @@ return { - { - "catppuccin/nvim", - name = "catppuccin", - lazy = false, - priority = 1000, - config = function() - local cp = require("catppuccin.palettes").get_palette() + { + "catppuccin/nvim", + name = "catppuccin", + lazy = false, + priority = 1000, + config = function() + local cp = require("catppuccin.palettes").get_palette() - require("catppuccin").setup({ - flavour = "mocha", - transparent_background = true, - term_colors = true, - no_italic = true, - integrations = { - mason = true, - native_lsp = { enabled = true }, - navic = { - enabled = true, - custom_bg = "NONE", - }, - noice = true, - notify = true, - dap = { - enabled = true, - enable_ui = true, - }, - cmp = true, - treesitter = true, - overseer = true, - telescope = true, - which_key = true, - }, - color_overrides = { - mocha = { - base = "#000000", - mantle = "#000000", - surface2 = cp.subtext0, - overlay0 = cp.subtext0, - }, - }, - custom_highlights = { - ErrorMsg = { fg = cp.red, style = { "bold" } }, - LspInfoBorder = { link = "FloatBorder" }, - PmenuSel = { bg = cp.surface0 }, - FloatBorder = { fg = cp.overlay0, bg = "NONE" }, - TelescopeBorder = { link = "FloatBorder" }, - TelescopeMatching = { link = "TelescopeNormal" }, - TelescopeSelection = { fg = "NONE", bg = cp.surface0 }, - TelescopeTitle = { fg = cp.subtext0 }, - QuickScopePrimary = { fg = cp.maroon }, - QuickScopeSecondary = { fg = cp.peach }, - -- MiniIndentscopeSymbol = { fg = cp.blue }, - }, - }) - vim.cmd.colorscheme("catppuccin") - end, - }, + require("catppuccin").setup({ + flavour = "mocha", + transparent_background = true, + term_colors = true, + no_italic = true, + integrations = { + mason = true, + native_lsp = { enabled = true }, + navic = { + enabled = true, + custom_bg = "NONE", + }, + noice = true, + notify = true, + dap = { + enabled = true, + enable_ui = true, + }, + cmp = true, + treesitter = true, + overseer = true, + telescope = true, + which_key = true, + }, + color_overrides = { + mocha = { + base = "#000000", + mantle = "#000000", + surface2 = cp.subtext0, + overlay0 = cp.subtext0, + }, + }, + custom_highlights = { + ErrorMsg = { fg = cp.red, style = { "bold" } }, + LspInfoBorder = { link = "FloatBorder" }, + PmenuSel = { bg = cp.surface0 }, + FloatBorder = { fg = cp.overlay0, bg = "NONE" }, + TelescopeBorder = { link = "FloatBorder" }, + TelescopeMatching = { link = "TelescopeNormal" }, + TelescopeSelection = { fg = "NONE", bg = cp.surface0 }, + TelescopeTitle = { fg = cp.subtext0 }, + QuickScopePrimary = { fg = cp.red }, + QuickScopeSecondary = { fg = cp.peach }, + -- MiniIndentscopeSymbol = { fg = cp.blue }, + }, + }) + vim.cmd.colorscheme("catppuccin") + end, + }, } diff --git a/dot_config/nvim/lua/plugins/ccc.lua b/dot_config/nvim/lua/plugins/ccc.lua index 7d5ee27..848a170 100644 --- a/dot_config/nvim/lua/plugins/ccc.lua +++ b/dot_config/nvim/lua/plugins/ccc.lua @@ -1,3 +1,3 @@ return { - { "uga-rosa/ccc.nvim", config = { highlighter = { auto_enable = true } } }, + { "uga-rosa/ccc.nvim", config = { highlighter = { auto_enable = true } } }, } diff --git a/dot_config/nvim/lua/plugins/cmp.lua b/dot_config/nvim/lua/plugins/cmp.lua index 2a5c735..87b62ac 100644 --- a/dot_config/nvim/lua/plugins/cmp.lua +++ b/dot_config/nvim/lua/plugins/cmp.lua @@ -1,110 +1,110 @@ local has_words_before = function() - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil end return { - { - "hrsh7th/nvim-cmp", - config = function() - local cmp = require("cmp") - local cmp_under_comparator = require("cmp-under-comparator") - local lspkind = require("lspkind") - local luasnip = require("luasnip") + { + "hrsh7th/nvim-cmp", + config = function() + local cmp = require("cmp") + local cmp_under_comparator = require("cmp-under-comparator") + local lspkind = require("lspkind") + local luasnip = require("luasnip") - cmp.setup({ - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }), - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete({}), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = true }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { "i", "s" }), - - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - }), - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "luasnip" }, - }, { - { name = "buffer" }, - { name = "path" }, - }), - sorting = { - comparators = { - cmp.config.compare.offset, - cmp.config.compare.exact, - cmp.config.compare.score, - cmp_under_comparator.under, - cmp.config.compare.kind, - cmp.config.compare.sort_text, - cmp.config.compare.length, - cmp.config.compare.order, - }, - }, - formatting = { - format = lspkind.cmp_format({ - mode = "symbol", - maxwidth = 30, - ellipsis_char = "…", - }), - }, - }) + cmp.setup({ + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }), + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete({}), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { "i", "s" }), - cmp.setup.cmdline({ "/", "?" }, { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = "buffer" }, - }, - }) + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, + }, { + { name = "buffer" }, + { name = "path" }, + }), + sorting = { + comparators = { + cmp.config.compare.offset, + cmp.config.compare.exact, + cmp.config.compare.score, + cmp_under_comparator.under, + cmp.config.compare.kind, + cmp.config.compare.sort_text, + cmp.config.compare.length, + cmp.config.compare.order, + }, + }, + formatting = { + format = lspkind.cmp_format({ + mode = "symbol", + maxwidth = 30, + ellipsis_char = "…", + }), + }, + }) - cmp.setup.cmdline(":", { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = "path" }, - }, { - { name = "cmdline" }, - }), - }) - end, - dependencies = { - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-nvim-lua", - "hrsh7th/cmp-cmdline", - "saadparwaiz1/cmp_luasnip", - "L3MON4D3/LuaSnip", - "lukas-reineke/cmp-under-comparator", + cmp.setup.cmdline({ "/", "?" }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = "buffer" }, }, + }) + + cmp.setup.cmdline(":", { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = "path" }, + }, { + { name = "cmdline" }, + }), + }) + end, + dependencies = { + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-nvim-lua", + "hrsh7th/cmp-cmdline", + "saadparwaiz1/cmp_luasnip", + "L3MON4D3/LuaSnip", + "lukas-reineke/cmp-under-comparator", }, + }, } diff --git a/dot_config/nvim/lua/plugins/coverage.lua b/dot_config/nvim/lua/plugins/coverage.lua index 5558514..bc2874a 100644 --- a/dot_config/nvim/lua/plugins/coverage.lua +++ b/dot_config/nvim/lua/plugins/coverage.lua @@ -1,7 +1,7 @@ return { - { - "andythigpen/nvim-coverage", - config = true, - dependencies = { "nvim-lua/plenary.nvim" }, - }, + { + "andythigpen/nvim-coverage", + config = true, + dependencies = { "nvim-lua/plenary.nvim" }, + }, } diff --git a/dot_config/nvim/lua/plugins/dap.lua b/dot_config/nvim/lua/plugins/dap.lua index 7612cf2..7bb34fa 100644 --- a/dot_config/nvim/lua/plugins/dap.lua +++ b/dot_config/nvim/lua/plugins/dap.lua @@ -1,90 +1,90 @@ local get_python_path = function() - for _, client in pairs(vim.lsp.buf_get_clients()) do - if client.name == "pyright" then - local path = client.config.settings.python.pythonPath - if path ~= nil then - return path - else - return "python" - end - end + for _, client in pairs(vim.lsp.buf_get_clients()) do + if client.name == "pyright" then + local path = client.config.settings.python.pythonPath + if path ~= nil then + return path + else + return "python" + end end + end end return { - { - "jayp0521/mason-nvim-dap.nvim", - config = function() - local dap = require("dap") - local mason_dap = require("mason-nvim-dap") + { + "jayp0521/mason-nvim-dap.nvim", + config = function() + local dap = require("dap") + local mason_dap = require("mason-nvim-dap") - mason_dap.setup({ - ensure_installed = { "python", "codelldb" }, - automatic_setup = true, - }) - mason_dap.setup_handlers({ - -- default handler - function(source) - require("mason-nvim-dap.automatic_setup")(source) - end, - - -- custom handlers - python = function(_) - dap.adapters.python = { - type = "executable", - command = "debugpy-adapter", - } - - dap.configurations.python = { - { - name = "Launch current file", - type = "python", - request = "launch", - program = "${file}", - pythonPath = get_python_path, - }, - { - name = "Launch pytest", - type = "python", - request = "launch", - module = "pytest", - pythonPath = get_python_path, - }, - } - end, - }) + mason_dap.setup({ + ensure_installed = { "python", "codelldb" }, + automatic_setup = true, + }) + mason_dap.setup_handlers({ + -- default handler + function(source) + require("mason-nvim-dap.automatic_setup")(source) + end, - -- apply suggestions from catppuccin theme - local sign = vim.fn.sign_define + -- custom handlers + python = function(_) + dap.adapters.python = { + type = "executable", + command = "debugpy-adapter", + } - sign("DapBreakpoint", { text = "●", texthl = "DapBreakpoint", linehl = "", numhl = "" }) - sign("DapBreakpointCondition", { text = "●", texthl = "DapBreakpointCondition", linehl = "", numhl = "" }) - sign("DapLogPoint", { text = "◆", texthl = "DapLogPoint", linehl = "", numhl = "" }) - end, - keys = { - { - "db", - vim.cmd.DapToggleBreakpoint, - desc = "Toggle breakpoint", - }, + dap.configurations.python = { { - "du", - function() - require("dapui").toggle({}) - end, - desc = "Toggle UI", + name = "Launch current file", + type = "python", + request = "launch", + program = "${file}", + pythonPath = get_python_path, }, { - "dx", - vim.cmd.DapContinue, - desc = "Start / Continue", + name = "Launch pytest", + type = "python", + request = "launch", + module = "pytest", + pythonPath = get_python_path, }, - }, - dependencies = { - "williamboman/mason.nvim", - "mfussenegger/nvim-dap", - { "rcarriga/nvim-dap-ui", config = true }, - { "theHamsta/nvim-dap-virtual-text", config = true }, - }, + } + end, + }) + + -- apply suggestions from catppuccin theme + local sign = vim.fn.sign_define + + sign("DapBreakpoint", { text = "●", texthl = "DapBreakpoint", linehl = "", numhl = "" }) + sign("DapBreakpointCondition", { text = "●", texthl = "DapBreakpointCondition", linehl = "", numhl = "" }) + sign("DapLogPoint", { text = "◆", texthl = "DapLogPoint", linehl = "", numhl = "" }) + end, + keys = { + { + "db", + vim.cmd.DapToggleBreakpoint, + desc = "Toggle breakpoint", + }, + { + "du", + function() + require("dapui").toggle({}) + end, + desc = "Toggle UI", + }, + { + "dx", + vim.cmd.DapContinue, + desc = "Start / Continue", + }, + }, + dependencies = { + "williamboman/mason.nvim", + "mfussenegger/nvim-dap", + { "rcarriga/nvim-dap-ui", config = true }, + { "theHamsta/nvim-dap-virtual-text", config = true }, }, + }, } diff --git a/dot_config/nvim/lua/plugins/delaytrain.lua b/dot_config/nvim/lua/plugins/delaytrain.lua index 7428ac1..d8ba6da 100644 --- a/dot_config/nvim/lua/plugins/delaytrain.lua +++ b/dot_config/nvim/lua/plugins/delaytrain.lua @@ -1,9 +1,9 @@ return { - { - "ja-ford/delaytrain.nvim", - config = { - grace_period = 3, - ignore_filetypes = { "help", "NvimTr*", "lazy", "mason" }, - }, + { + "ja-ford/delaytrain.nvim", + config = { + grace_period = 3, + ignore_filetypes = { "help", "NvimTr*", "lazy", "mason" }, }, + }, } diff --git a/dot_config/nvim/lua/plugins/feline.lua b/dot_config/nvim/lua/plugins/feline.lua index cae119c..6074233 100644 --- a/dot_config/nvim/lua/plugins/feline.lua +++ b/dot_config/nvim/lua/plugins/feline.lua @@ -1,27 +1,27 @@ return { - { - "feline-nvim/feline.nvim", - config = function() - local feline = require("feline") - local ctp_feline = require("catppuccin.groups.integrations.feline") + { + "feline-nvim/feline.nvim", + config = function() + local feline = require("feline") + local ctp_feline = require("catppuccin.groups.integrations.feline") - feline.setup({ - components = ctp_feline.get(), - force_inactive = { - filetypes = { - -- "^NvimTree$", - "^packer$", - "^startify$", - "^fugitive$", - "^fugitiveblame$", - "^qf$", - "^help$", - }, - }, - }) - -- catppuccin statusline - ctp_feline.setup({}) - end, - dependencies = { "nvim-tree/nvim-web-devicons" }, - }, + feline.setup({ + components = ctp_feline.get(), + force_inactive = { + filetypes = { + -- "^NvimTree$", + "^packer$", + "^startify$", + "^fugitive$", + "^fugitiveblame$", + "^qf$", + "^help$", + }, + }, + }) + -- catppuccin statusline + ctp_feline.setup({}) + end, + dependencies = { "nvim-tree/nvim-web-devicons" }, + }, } diff --git a/dot_config/nvim/lua/plugins/init.lua b/dot_config/nvim/lua/plugins/init.lua index 0acead5..feacb47 100644 --- a/dot_config/nvim/lua/plugins/init.lua +++ b/dot_config/nvim/lua/plugins/init.lua @@ -1,8 +1,8 @@ -- misc plugins return { - { "kana/vim-textobj-entire", dependencies = { "kana/vim-textobj-user" } }, - "kevinhwang91/nvim-bqf", - "stevearc/dressing.nvim", - "mong8se/actually.nvim", - "andweeb/presence.nvim", + { "kana/vim-textobj-entire", dependencies = { "kana/vim-textobj-user" } }, + "kevinhwang91/nvim-bqf", + "stevearc/dressing.nvim", + "mong8se/actually.nvim", + "andweeb/presence.nvim", } diff --git a/dot_config/nvim/lua/plugins/lsp.lua b/dot_config/nvim/lua/plugins/lsp.lua index 16c85f1..7738830 100644 --- a/dot_config/nvim/lua/plugins/lsp.lua +++ b/dot_config/nvim/lua/plugins/lsp.lua @@ -1,188 +1,196 @@ local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } for type, icon in pairs(signs) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) end vim.diagnostic.config({ - float = { border = "rounded" }, - update_in_insert = true, + float = { border = "rounded" }, + update_in_insert = true, }) vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded" }) vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = "rounded" }) local default_config = { - on_attach = function(client, bufnr) - require("lsp-format").on_attach(client) + on_attach = function(client, bufnr) + require("lsp-format").on_attach(client) - -- add lsp-only keybinds - local map = function(sequence, cmd, desc) - vim.keymap.set("n", sequence, cmd, { buffer = bufnr, desc = desc }) - end + -- add lsp-only keybinds + local map = function(sequence, cmd, desc) + vim.keymap.set("n", sequence, cmd, { buffer = bufnr, desc = desc }) + end - map("gd", function() - require("telescope.builtin").lsp_definitions() - end, "LSP Definitions") - map("gr", function() - require("telescope.builtin").lsp_references() - end, "LSP References") - map("gI", function() - require("telescope.builtin").lsp_implementations() - end, "LSP Implementations") - map("K", vim.lsp.buf.hover, "Hover") - map("]d", vim.diagnostic.goto_next, "Next diagnostic") - map("[d", vim.diagnostic.goto_prev, "Previous diagnostic") + map("K", vim.lsp.buf.hover, "Hover") + map("]d", vim.diagnostic.goto_next, "Next diagnostic") + map("[d", vim.diagnostic.goto_prev, "Previous diagnostic") - map("la", vim.lsp.buf.code_action, "Code Action") - map("lr", vim.lsp.buf.rename, "Rename") - map("lf", vim.lsp.buf.format, "Format") - map("li", "LspInfo", "LSP Info") - map("lI", "Mason", "Mason Info") - map("lw", function() - require("telescope.builtin").diagnostics() - end, "LSP Workplace Diagnostics") - map("ld", function() - require("telescope.builtin").diagnostics({ bufnr = 0 }) - end, "LSP Buffer Diagnostics") - map("ls", function() - require("telescope.builtin").lsp_document_symbols() - end, "LSP Document Symbols") - map("lS", function() - require("telescope.builtin").lsp_workspace_symbols() - end, "LSP Workplace Symbols") - end, + map("gs", vim.lsp.buf.signature_help, "LSP Signature Help") + map("gD", vim.lsp.buf.declaration, "LSP Declarations") + map("gd", function() + require("telescope.builtin").lsp_definitions() + end, "LSP Definitions") + map("gr", function() + require("telescope.builtin").lsp_references() + end, "LSP References") + map("gI", function() + require("telescope.builtin").lsp_implementations() + end, "LSP Implementations") + map("gl", function() + vim.diagnostic.open_float(0, { + scope = "line", + }) + end) + + map("la", vim.lsp.buf.code_action, "Code Action") + map("lr", vim.lsp.buf.rename, "Rename") + map("lf", vim.lsp.buf.format, "Format") + map("li", "LspInfo", "LSP Info") + map("lI", "Mason", "Mason Info") + map("lw", function() + require("telescope.builtin").diagnostics() + end, "LSP Workplace Diagnostics") + map("ld", function() + require("telescope.builtin").diagnostics({ bufnr = 0 }) + end, "LSP Buffer Diagnostics") + map("ls", function() + require("telescope.builtin").lsp_document_symbols() + end, "LSP Document Symbols") + map("lS", function() + require("telescope.builtin").lsp_workspace_symbols() + end, "LSP Workplace Symbols") + end, } local custom_config = function(config) - local merged_config = vim.deepcopy(default_config) - merged_config = vim.tbl_extend("force", merged_config, config) - return merged_config + local merged_config = vim.deepcopy(default_config) + merged_config = vim.tbl_extend("force", merged_config, config) + return merged_config end return { - { - "neovim/nvim-lspconfig", + { + "neovim/nvim-lspconfig", + config = function() + require("lspconfig.ui.windows").default_options.border = "rounded" + end, + dependencies = { + { + "williamboman/mason-lspconfig.nvim", config = function() - require("lspconfig.ui.windows").default_options.border = "rounded" - end, - dependencies = { - { - "williamboman/mason-lspconfig.nvim", - config = function() - require("mason-lspconfig").setup({ - ensure_installed = { "rust_analyzer", "pyright", "sumneko_lua" }, - }) - require("mason-lspconfig").setup_handlers({ - -- default handler - function(server_name) - require("lspconfig")[server_name].setup(default_config) - end, - ["rust_analyzer"] = function() - -- https://github.com/simrat39/rust-tools.nvim/issues/300 - local config = custom_config({ - settings = { - ["rust-analyzer"] = { - inlayHints = { locationLinks = false }, - }, - }, - }) - require("rust-tools").setup({ - server = config, - dap = { - adapter = { - type = "server", - port = "${port}", - host = "127.0.0.1", - executable = { - command = "codelldb", - args = { "--port", "${port}" }, - }, - }, - }, - }) - end, - ["pyright"] = function() - require("py_lsp").setup(default_config) - end, - ["hls"] = function() - local ht = require("haskell-tools") - local def_opts = { noremap = true, silent = true } - ht.setup({ - hls = { - on_attach = function(client, bufnr) - local opts = vim.tbl_extend("keep", def_opts, { buffer = bufnr }) - -- haskell-language-server relies heavily on codeLenses, - -- so auto-refresh (see advanced configuration) is enabled by default - -- vim.keymap.set("n", "ca", vim.lsp.codelens.run, opts) - -- vim.keymap.set("n", "hs", ht.hoogle.hoogle_signature, opts) - end, - }, - }) - -- Suggested keymaps that do not depend on haskell-language-server - -- Toggle a GHCi repl for the current package - vim.keymap.set("n", "rr", ht.repl.toggle, def_opts) - -- Toggle a GHCi repl for the current buffer - vim.keymap.set("n", "rf", function() - ht.repl.toggle(vim.api.nvim_buf_get_name(0)) - end, def_opts) - vim.keymap.set("n", "rq", ht.repl.quit, def_opts) - end, - ["sumneko_lua"] = function() - require("lspconfig")["sumneko_lua"].setup(custom_config({ - settings = { - Lua = { - format = { - enable = false, - }, - workspace = { - checkThirdParty = false, - }, - telemetry = { - enable = false, - }, - }, - }, - })) - end, - }) - end, - dependencies = { - "williamboman/mason.nvim", - { "folke/neodev.nvim", config = true }, + require("mason-lspconfig").setup({ + ensure_installed = { "rust_analyzer", "pyright", "sumneko_lua" }, + }) + require("mason-lspconfig").setup_handlers({ + -- default handler + function(server_name) + require("lspconfig")[server_name].setup(default_config) + end, + ["rust_analyzer"] = function() + -- https://github.com/simrat39/rust-tools.nvim/issues/300 + local config = custom_config({ + settings = { + ["rust-analyzer"] = { + inlayHints = { locationLinks = false }, + }, }, - }, - "simrat39/rust-tools.nvim", - "mrcjkb/haskell-tools.nvim", - "HallerPatrick/py_lsp.nvim", - { "SmiteshP/nvim-navic", config = { highlight = true } }, - "onsails/lspkind.nvim", - { "lukas-reineke/lsp-format.nvim", config = true }, - "folke/neodev.nvim", - "ray-x/lsp_signature.nvim", - }, - }, - { - "jose-elias-alvarez/null-ls.nvim", - config = function() - local null_ls = require("null-ls") - null_ls.setup({ - sources = { - null_ls.builtins.formatting.stylua.with({ - extra_args = { "--indent-type", "spaces" }, - }), - -- null_ls.builtins.formatting.black, - -- null_ls.builtins.formatting.isort.with({ - -- extra_args = { "--profile", "black" }, - -- }), + }) + require("rust-tools").setup({ + server = config, + dap = { + adapter = { + type = "server", + port = "${port}", + host = "127.0.0.1", + executable = { + command = "codelldb", + args = { "--port", "${port}" }, + }, + }, + }, + }) + end, + ["pyright"] = function() + require("py_lsp").setup(default_config) + end, + ["hls"] = function() + local ht = require("haskell-tools") + local def_opts = { noremap = true, silent = true } + ht.setup({ + hls = { + on_attach = function(client, bufnr) + local opts = vim.tbl_extend("keep", def_opts, { buffer = bufnr }) + -- haskell-language-server relies heavily on codeLenses, + -- so auto-refresh (see advanced configuration) is enabled by default + -- vim.keymap.set("n", "ca", vim.lsp.codelens.run, opts) + -- vim.keymap.set("n", "hs", ht.hoogle.hoogle_signature, opts) + end, + }, + }) + -- Suggested keymaps that do not depend on haskell-language-server + -- Toggle a GHCi repl for the current package + vim.keymap.set("n", "rr", ht.repl.toggle, def_opts) + -- Toggle a GHCi repl for the current buffer + vim.keymap.set("n", "rf", function() + ht.repl.toggle(vim.api.nvim_buf_get_name(0)) + end, def_opts) + vim.keymap.set("n", "rq", ht.repl.quit, def_opts) + end, + ["sumneko_lua"] = function() + require("lspconfig")["sumneko_lua"].setup(custom_config({ + settings = { + Lua = { + format = { + enable = false, + }, + workspace = { + checkThirdParty = false, + }, + telemetry = { + enable = false, + }, + }, }, - }) + })) + end, + }) end, - dependencies = { "nvim-lua/plenary.nvim" }, + dependencies = { + "williamboman/mason.nvim", + { "folke/neodev.nvim", config = true }, + }, + }, + "simrat39/rust-tools.nvim", + "mrcjkb/haskell-tools.nvim", + "HallerPatrick/py_lsp.nvim", + { "SmiteshP/nvim-navic", config = { highlight = true } }, + "onsails/lspkind.nvim", + { "lukas-reineke/lsp-format.nvim", config = true }, + "folke/neodev.nvim", + "ray-x/lsp_signature.nvim", }, - { - "jay-babu/mason-null-ls.nvim", - config = { - ensure_installed = { "stylua" }, + }, + { + "jose-elias-alvarez/null-ls.nvim", + config = function() + local null_ls = require("null-ls") + null_ls.setup({ + sources = { + null_ls.builtins.formatting.stylua.with({ + extra_args = { "--indent-type", "spaces" }, + }), + -- null_ls.builtins.formatting.black, + -- null_ls.builtins.formatting.isort.with({ + -- extra_args = { "--profile", "black" }, + -- }), }, + }) + end, + dependencies = { "nvim-lua/plenary.nvim" }, + }, + { + "jay-babu/mason-null-ls.nvim", + config = { + ensure_installed = { "stylua" }, }, + }, } diff --git a/dot_config/nvim/lua/plugins/mason.lua b/dot_config/nvim/lua/plugins/mason.lua index 5872a65..e67964c 100644 --- a/dot_config/nvim/lua/plugins/mason.lua +++ b/dot_config/nvim/lua/plugins/mason.lua @@ -1,8 +1,8 @@ return { - { - "williamboman/mason.nvim", - config = { - ui = { border = "rounded" }, - }, + { + "williamboman/mason.nvim", + config = { + ui = { border = "rounded" }, }, + }, } diff --git a/dot_config/nvim/lua/plugins/mini.lua b/dot_config/nvim/lua/plugins/mini.lua index c73cf73..a6fdfe5 100644 --- a/dot_config/nvim/lua/plugins/mini.lua +++ b/dot_config/nvim/lua/plugins/mini.lua @@ -1,22 +1,22 @@ return { - { - "echasnovski/mini.nvim", - config = function() - -- add gc/gcc actions, gc textobject - require("mini.comment").setup({}) + { + "echasnovski/mini.nvim", + config = function() + -- add gc/gcc actions, gc textobject + require("mini.comment").setup({}) - -- autochange dir - -- require("mini.misc").setup({}) - -- MiniMisc.setup_auto_root() + -- autochange dir + -- require("mini.misc").setup({}) + -- MiniMisc.setup_auto_root() - -- highlight word under cursor - require("mini.cursorword").setup({ delay = 0 }) + -- highlight word under cursor + require("mini.cursorword").setup({ delay = 0 }) - -- indent lines, `i` textobject, `]i`/`[i` motions - require("mini.indentscope").setup({ - draw = { delay = 0 }, - symbol = "│", - }) - end, - }, + -- indent lines, `i` textobject, `]i`/`[i` motions + require("mini.indentscope").setup({ + draw = { delay = 0 }, + symbol = "│", + }) + end, + }, } diff --git a/dot_config/nvim/lua/plugins/noice.lua b/dot_config/nvim/lua/plugins/noice.lua index 469caac..bb3f4d3 100644 --- a/dot_config/nvim/lua/plugins/noice.lua +++ b/dot_config/nvim/lua/plugins/noice.lua @@ -1,35 +1,35 @@ return { - -- disabled until https://github.com/folke/noice.nvim/issues/298 is fixed - -- { - -- "folke/noice.nvim", - -- config = { - -- lsp = { - -- progress = { enabled = false }, - -- - -- -- override markdown rendering so that **cmp** and other plugins use **Treesitter** - -- override = { - -- ["vim.lsp.util.convert_input_to_markdown_lines"] = true, - -- ["vim.lsp.util.stylize_markdown"] = true, - -- ["cmp.entry.get_documentation"] = true, - -- }, - -- }, - -- -- you can enable a preset for easier configuration - -- presets = { - -- bottom_search = true, - -- long_message_to_split = true, - -- lsp_doc_border = true, - -- }, - -- }, - -- dependencies = { - -- "MunifTanjim/nui.nvim", - -- { - -- "rcarriga/nvim-notify", - -- config = { - -- background_colour = require("catppuccin.palettes").get_palette("mocha").base, - -- render = "minimal", - -- top_down = false, - -- }, - -- }, - -- }, - -- }, + -- disabled until https://github.com/folke/noice.nvim/issues/298 is fixed + -- { + -- "folke/noice.nvim", + -- config = { + -- lsp = { + -- progress = { enabled = false }, + -- + -- -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + -- override = { + -- ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + -- ["vim.lsp.util.stylize_markdown"] = true, + -- ["cmp.entry.get_documentation"] = true, + -- }, + -- }, + -- -- you can enable a preset for easier configuration + -- presets = { + -- bottom_search = true, + -- long_message_to_split = true, + -- lsp_doc_border = true, + -- }, + -- }, + -- dependencies = { + -- "MunifTanjim/nui.nvim", + -- { + -- "rcarriga/nvim-notify", + -- config = { + -- background_colour = require("catppuccin.palettes").get_palette("mocha").base, + -- render = "minimal", + -- top_down = false, + -- }, + -- }, + -- }, + -- }, } diff --git a/dot_config/nvim/lua/plugins/overseer.lua b/dot_config/nvim/lua/plugins/overseer.lua index 5eb95db..26f3d51 100644 --- a/dot_config/nvim/lua/plugins/overseer.lua +++ b/dot_config/nvim/lua/plugins/overseer.lua @@ -1,11 +1,11 @@ return { - { - "stevearc/overseer.nvim", - config = true, - cmd = { "OverseerRun", "OverseerToggle" }, - keys = { - { "tr", vim.cmd.OverseerRun, desc = "Run Task" }, - { "tt", vim.cmd.OverseerToggle, desc = "Toggle task results" }, - }, + { + "stevearc/overseer.nvim", + config = true, + cmd = { "OverseerRun", "OverseerToggle" }, + keys = { + { "tr", vim.cmd.OverseerRun, desc = "Run Task" }, + { "tt", vim.cmd.OverseerToggle, desc = "Toggle task results" }, }, + }, } diff --git a/dot_config/nvim/lua/plugins/quickscope.lua b/dot_config/nvim/lua/plugins/quickscope.lua index 6dbebfc..4256b17 100644 --- a/dot_config/nvim/lua/plugins/quickscope.lua +++ b/dot_config/nvim/lua/plugins/quickscope.lua @@ -1,8 +1,8 @@ return { - { - "unblevable/quick-scope", - init = function() - vim.g.qs_highlight_on_keys = { "f", "F", "t", "T" } - end, - }, + { + "unblevable/quick-scope", + init = function() + vim.g.qs_highlight_on_keys = { "f", "F", "t", "T" } + end, + }, } diff --git a/dot_config/nvim/lua/plugins/searchreplace.lua b/dot_config/nvim/lua/plugins/searchreplace.lua index 4b73962..1f676b2 100644 --- a/dot_config/nvim/lua/plugins/searchreplace.lua +++ b/dot_config/nvim/lua/plugins/searchreplace.lua @@ -1,8 +1,8 @@ return { - { - "roobert/search-replace.nvim", - config = function() - require("search-replace").setup({}) - end, - }, + { + "roobert/search-replace.nvim", + config = function() + require("search-replace").setup({}) + end, + }, } diff --git a/dot_config/nvim/lua/plugins/surround.lua b/dot_config/nvim/lua/plugins/surround.lua index 164a33b..f3863df 100644 --- a/dot_config/nvim/lua/plugins/surround.lua +++ b/dot_config/nvim/lua/plugins/surround.lua @@ -1,3 +1,3 @@ return { - { "kylechui/nvim-surround", config = true }, + { "kylechui/nvim-surround", config = true }, } diff --git a/dot_config/nvim/lua/plugins/telescope.lua b/dot_config/nvim/lua/plugins/telescope.lua index e5de01f..e02d363 100644 --- a/dot_config/nvim/lua/plugins/telescope.lua +++ b/dot_config/nvim/lua/plugins/telescope.lua @@ -1,29 +1,29 @@ return { - { - "nvim-telescope/telescope.nvim", - config = function() - require("telescope").load_extension("projects") - require("telescope").load_extension("fzy_native") - require("telescope").load_extension("catppuccin") - require("telescope").load_extension("smart_open") - end, - keys = { - { "ff", "Telescope smart_open", "Find files" }, - { "fp", "Telescope projects", "All Projects" }, - { "fr", "Telescope oldfiles", "Recent Files" }, - { "fg", "Telescope live_grep", "Live grep" }, - { "fc", "Telescope catppuccin", "Catppuccin Colours" }, - { "fj", "Telescope jumplist", "Jumplist" }, - }, - cmd = "Telescope", - dependencies = { - "backwardspy/telescope-catppuccin.nvim", - { - "nvim-telescope/telescope-fzy-native.nvim", - dependencies = { "kkharji/sqlite.lua" }, - }, - "danielfalk/smart-open.nvim", - "backwardspy/telescope-catppuccin.nvim", - }, + { + "nvim-telescope/telescope.nvim", + config = function() + require("telescope").load_extension("projects") + require("telescope").load_extension("fzy_native") + require("telescope").load_extension("catppuccin") + require("telescope").load_extension("smart_open") + end, + keys = { + { "ff", "Telescope smart_open", "Find files" }, + { "fp", "Telescope projects", "All Projects" }, + { "fr", "Telescope oldfiles", "Recent Files" }, + { "fg", "Telescope live_grep", "Live grep" }, + { "fc", "Telescope catppuccin", "Catppuccin Colours" }, + { "fj", "Telescope jumplist", "Jumplist" }, }, + cmd = "Telescope", + dependencies = { + "backwardspy/telescope-catppuccin.nvim", + { + "nvim-telescope/telescope-fzy-native.nvim", + dependencies = { "kkharji/sqlite.lua" }, + }, + "danielfalk/smart-open.nvim", + "backwardspy/telescope-catppuccin.nvim", + }, + }, } diff --git a/dot_config/nvim/lua/plugins/treesitter.lua b/dot_config/nvim/lua/plugins/treesitter.lua index 58bdd54..5ca48d8 100644 --- a/dot_config/nvim/lua/plugins/treesitter.lua +++ b/dot_config/nvim/lua/plugins/treesitter.lua @@ -1,31 +1,31 @@ return { - { - "nvim-treesitter/nvim-treesitter", - build = function() - local ts_update = require("nvim-treesitter.install").update({ with_sync = true }) - ts_update() - end, - config = function() - require("nvim-treesitter.configs").setup({ - ensure_installed = "all", - highlight = { enable = true }, - indent = { enable = false }, - textobjects = { - select = { - enable = true, - lookahead = true, - keymaps = { - ["af"] = "@function.outer", - ["if"] = "@function.inner", - ["ac"] = "@class.outer", - ["ic"] = "@class.inner", - ["aa"] = "@parameter.outer", - ["ia"] = "@parameter.inner", - }, - }, - }, - }) - end, - dependencies = { "nvim-treesitter/nvim-treesitter-textobjects" }, - }, + { + "nvim-treesitter/nvim-treesitter", + build = function() + local ts_update = require("nvim-treesitter.install").update({ with_sync = true }) + ts_update() + end, + config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = "all", + highlight = { enable = true }, + indent = { enable = false }, + textobjects = { + select = { + enable = true, + lookahead = true, + keymaps = { + ["af"] = "@function.outer", + ["if"] = "@function.inner", + ["ac"] = "@class.outer", + ["ic"] = "@class.inner", + ["aa"] = "@parameter.outer", + ["ia"] = "@parameter.inner", + }, + }, + }, + }) + end, + dependencies = { "nvim-treesitter/nvim-treesitter-textobjects" }, + }, } diff --git a/dot_config/nvim/lua/plugins/which_key.lua b/dot_config/nvim/lua/plugins/which_key.lua index 7d61d37..52e694f 100644 --- a/dot_config/nvim/lua/plugins/which_key.lua +++ b/dot_config/nvim/lua/plugins/which_key.lua @@ -1,29 +1,29 @@ return { - { - "folke/which-key.nvim", - config = function() - local wk = require("which-key") - wk.setup({ - window = { - border = "rounded", - }, - }) + { + "folke/which-key.nvim", + config = function() + local wk = require("which-key") + wk.setup({ + window = { + border = "rounded", + }, + }) - wk.register({ - g = { name = "Go to" }, - ["]"] = { name = "Next" }, - ["["] = { name = "Previous" }, - }) + wk.register({ + g = { name = "Go to" }, + ["]"] = { name = "Next" }, + ["["] = { name = "Previous" }, + }) - wk.register({ - f = { name = "Find" }, - g = { name = "Git" }, - -- j = { name = "Jump" }, - l = { name = "LSP" }, - -- o = { name = "Open" }, - t = { name = "Tasks" }, - d = { name = "Debug" }, - }, { prefix = "" }) - end, - }, + wk.register({ + f = { name = "Find" }, + g = { name = "Git" }, + -- j = { name = "Jump" }, + l = { name = "LSP" }, + -- o = { name = "Open" }, + t = { name = "Tasks" }, + d = { name = "Debug" }, + }, { prefix = "" }) + end, + }, } diff --git a/dot_config/nvim/lua/plugins/zenmode.lua b/dot_config/nvim/lua/plugins/zenmode.lua index bd6793a..173f58c 100644 --- a/dot_config/nvim/lua/plugins/zenmode.lua +++ b/dot_config/nvim/lua/plugins/zenmode.lua @@ -1,20 +1,20 @@ local extremely_zen = function() - require("zen-mode").toggle({ plugins = { twilight = { enabled = true } } }) + require("zen-mode").toggle({ plugins = { twilight = { enabled = true } } }) end return { - { - "folke/zen-mode.nvim", - opts = { - plugins = { - twilight = { enabled = false }, - }, - }, - cmd = { "ZenMode" }, - keys = { - { "zz", "ZenMode", desc = "Zen Mode" }, - { "Z", extremely_zen, desc = "Extremely Zen Mode" }, - }, - dependencies = { "folke/twilight.nvim" }, + { + "folke/zen-mode.nvim", + opts = { + plugins = { + twilight = { enabled = false }, + }, }, + cmd = { "ZenMode" }, + keys = { + { "zz", "ZenMode", desc = "Zen Mode" }, + { "Z", extremely_zen, desc = "Extremely Zen Mode" }, + }, + dependencies = { "folke/twilight.nvim" }, + }, } diff --git a/dot_config/nvim/stylua.toml b/dot_config/nvim/stylua.toml new file mode 100644 index 0000000..cee468f --- /dev/null +++ b/dot_config/nvim/stylua.toml @@ -0,0 +1,7 @@ +column_width = 120 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 2 +quote_style = "AutoPreferDouble" +call_parentheses = "Always" +collapse_simple_statement = "Never"