diff --git a/modules/coding/editor/neovim/nvim/init.lua b/modules/coding/editor/neovim/nvim/init.lua index 1a94d64..2594757 100644 --- a/modules/coding/editor/neovim/nvim/init.lua +++ b/modules/coding/editor/neovim/nvim/init.lua @@ -6,4 +6,3 @@ require("langs.langs-setup") require("plugins.plugins-setup") require("core.autostart") - diff --git a/modules/coding/editor/neovim/nvim/lua/core/globals.lua b/modules/coding/editor/neovim/nvim/lua/core/globals.lua index 80fe78a..400da1d 100644 --- a/modules/coding/editor/neovim/nvim/lua/core/globals.lua +++ b/modules/coding/editor/neovim/nvim/lua/core/globals.lua @@ -36,77 +36,77 @@ function G.switch_input_method(req) return input_status end - function G.buf_kill(kill_command, bufnr, force) - kill_command = kill_command or "bd" + kill_command = kill_command or "bd" - local bo = vim.bo - local api = vim.api - local fmt = string.format - local fn = vim.fn + local bo = vim.bo + local api = vim.api + local fmt = string.format + local fn = vim.fn - if bufnr == 0 or bufnr == nil then - bufnr = api.nvim_get_current_buf() - end + if bufnr == 0 or bufnr == nil then + bufnr = api.nvim_get_current_buf() + end - local bufname = api.nvim_buf_get_name(bufnr) + local bufname = api.nvim_buf_get_name(bufnr) - if not force then - local choice - if bo[bufnr].modified then - choice = fn.confirm(fmt([[Save changes to "%s"?]], bufname), "&Yes\n&No\n&Cancel") - if choice == 1 then - vim.api.nvim_buf_call(bufnr, function() - vim.cmd("w") - end) - elseif choice == 2 then - force = true - else return - end - elseif api.nvim_buf_get_option(bufnr, "buftype") == "terminal" then - choice = fn.confirm(fmt([[Close "%s"?]], bufname), "&Yes\n&No\n&Cancel") - if choice == 1 then - force = true - else - return - end - end - end + if not force then + local choice + if bo[bufnr].modified then + choice = fn.confirm(fmt([[Save changes to "%s"?]], bufname), "&Yes\n&No\n&Cancel") + if choice == 1 then + vim.api.nvim_buf_call(bufnr, function() + vim.cmd("w") + end) + elseif choice == 2 then + force = true + else + return + end + elseif api.nvim_buf_get_option(bufnr, "buftype") == "terminal" then + choice = fn.confirm(fmt([[Close "%s"?]], bufname), "&Yes\n&No\n&Cancel") + if choice == 1 then + force = true + else + return + end + end + end - -- Get list of windows IDs with the buffer to close - local windows = vim.tbl_filter(function(win) - return api.nvim_win_get_buf(win) == bufnr - end, api.nvim_list_wins()) + -- Get list of windows IDs with the buffer to close + local windows = vim.tbl_filter(function(win) + return api.nvim_win_get_buf(win) == bufnr + end, api.nvim_list_wins()) - if force then - kill_command = kill_command .. "!" - end + if force then + kill_command = kill_command .. "!" + end - -- Get list of active buffers - local buffers = vim.tbl_filter(function(buf) - return api.nvim_buf_is_valid(buf) and bo[buf].buflisted - end, api.nvim_list_bufs()) + -- Get list of active buffers + local buffers = vim.tbl_filter(function(buf) + return api.nvim_buf_is_valid(buf) and bo[buf].buflisted + end, api.nvim_list_bufs()) - -- If there is only one buffer (which has to be the current one), vim will - -- create a new buffer on :bd. - -- For more than one buffer, pick the previous buffer (wrapping around if necessary) - if #buffers > 1 and #windows > 0 then - for i, v in ipairs(buffers) do - if v == bufnr then - local prev_buf_idx = i == 1 and #buffers or (i - 1) - local prev_buffer = buffers[prev_buf_idx] - for _, win in ipairs(windows) do - api.nvim_win_set_buf(win, prev_buffer) - end - end - end - end + -- If there is only one buffer (which has to be the current one), vim will + -- create a new buffer on :bd. + -- For more than one buffer, pick the previous buffer (wrapping around if necessary) + if #buffers > 1 and #windows > 0 then + for i, v in ipairs(buffers) do + if v == bufnr then + local prev_buf_idx = i == 1 and #buffers or (i - 1) + local prev_buffer = buffers[prev_buf_idx] + for _, win in ipairs(windows) do + api.nvim_win_set_buf(win, prev_buffer) + end + end + end + end - -- Check if buffer still exists, to ensure the target buffer wasn't killed - -- due to options like bufhidden=wipe. - if api.nvim_buf_is_valid(bufnr) and bo[bufnr].buflisted then - vim.cmd(string.format("%s %d", kill_command, bufnr)) - end + -- Check if buffer still exists, to ensure the target buffer wasn't killed + -- due to options like bufhidden=wipe. + if api.nvim_buf_is_valid(bufnr) and bo[bufnr].buflisted then + vim.cmd(string.format("%s %d", kill_command, bufnr)) + end return true end diff --git a/modules/coding/editor/neovim/nvim/lua/core/keymaps.lua b/modules/coding/editor/neovim/nvim/lua/core/keymaps.lua index 261b3df..a4afbe5 100644 --- a/modules/coding/editor/neovim/nvim/lua/core/keymaps.lua +++ b/modules/coding/editor/neovim/nvim/lua/core/keymaps.lua @@ -39,7 +39,9 @@ keymap.set("n", "ww", ":w", opt) keymap.set("n", "so", ":so", opt) keymap.set("n", "qq", ":q", opt) keymap.set("n", "qa", ":qa", opt) -keymap.set("n", "c", function () buf_kill("bd", nil, false) end, opt) +keymap.set("n", "c", function() + buf_kill("bd", nil, false) +end, opt) keymap.set("n", "", ":resize +5", opt) keymap.set("n", "", ":resize -5", opt) @@ -63,9 +65,8 @@ keymap.set("n", "wr", ":WorkspacesRemove", opt) -- Neovide config if vim.g.neovide then - keymap.set("v", "", "\"+y", opt) - keymap.set("n", "", "\"+P", opt) - keymap.set("i", "", "l\"+Pli", opt) + keymap.set("v", "", '"+y', opt) + keymap.set("n", "", '"+P', opt) + keymap.set("i", "", 'l"+Pli', opt) keymap.set("c", "", "+", opt) end - diff --git a/modules/coding/editor/neovim/nvim/lua/core/options.lua b/modules/coding/editor/neovim/nvim/lua/core/options.lua index 483f592..7048f4b 100644 --- a/modules/coding/editor/neovim/nvim/lua/core/options.lua +++ b/modules/coding/editor/neovim/nvim/lua/core/options.lua @@ -36,8 +36,8 @@ vim.g.autoread = true vim.g.loaded_ruby_provider = 0 -- Hightlight on yank -local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) -vim.api.nvim_create_autocmd('TextYankPost', { +local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true }) +vim.api.nvim_create_autocmd("TextYankPost", { callback = function() vim.highlight.on_yank() end, @@ -62,7 +62,7 @@ vim.api.nvim_create_autocmd("InsertLeave", { callback = function() Last_input_method = require("core.globals").switch_input_method(1) end, - group = "AutoInputMethod" + group = "AutoInputMethod", }) vim.api.nvim_create_autocmd("CmdlineLeave", { pattern = "*", @@ -70,7 +70,7 @@ vim.api.nvim_create_autocmd("CmdlineLeave", { callback = function() require("core.globals").switch_input_method(1) end, - group = "AutoInputMethod" + group = "AutoInputMethod", }) vim.api.nvim_create_autocmd("InsertEnter", { pattern = "*", @@ -78,7 +78,7 @@ vim.api.nvim_create_autocmd("InsertEnter", { callback = function() require("core.globals").switch_input_method(Last_input_method) end, - group = "AutoInputMethod" + group = "AutoInputMethod", }) vim.api.nvim_create_autocmd("FileType", { @@ -89,8 +89,8 @@ vim.api.nvim_create_autocmd("FileType", { -- credit: https://github.com/sam4llis/nvim-lua-gf vim.opt_local.include = [[\v<((do|load)file|require|reload)[^''"]*[''"]\zs[^''"]+]] vim.opt_local.includeexpr = "substitute(v:fname,'\\.','/','g')" - vim.opt_local.suffixesadd:prepend ".lua" - vim.opt_local.suffixesadd:prepend "init.lua" + vim.opt_local.suffixesadd:prepend(".lua") + vim.opt_local.suffixesadd:prepend("init.lua") for _, path in pairs(vim.api.nvim_list_runtime_paths()) do vim.opt_local.path:append(path .. "/lua") diff --git a/modules/coding/editor/neovim/nvim/lua/langs/go.lua b/modules/coding/editor/neovim/nvim/lua/langs/go.lua index 471d2a3..c19138c 100644 --- a/modules/coding/editor/neovim/nvim/lua/langs/go.lua +++ b/modules/coding/editor/neovim/nvim/lua/langs/go.lua @@ -10,4 +10,3 @@ vim.api.nvim_create_autocmd("BufWritePre", { end, group = "Go", }) - diff --git a/modules/coding/editor/neovim/nvim/lua/langs/lualang.lua b/modules/coding/editor/neovim/nvim/lua/langs/lualang.lua index cdce079..eac4d3c 100644 --- a/modules/coding/editor/neovim/nvim/lua/langs/lualang.lua +++ b/modules/coding/editor/neovim/nvim/lua/langs/lualang.lua @@ -32,4 +32,3 @@ vim.api.nvim_create_autocmd("BufLeave", { end, group = "Lua", }) - diff --git a/modules/coding/editor/neovim/nvim/lua/langs/markdown.lua b/modules/coding/editor/neovim/nvim/lua/langs/markdown.lua index de722b9..5004675 100644 --- a/modules/coding/editor/neovim/nvim/lua/langs/markdown.lua +++ b/modules/coding/editor/neovim/nvim/lua/langs/markdown.lua @@ -32,4 +32,3 @@ vim.api.nvim_create_autocmd("BufLeave", { end, group = "Markdown", }) - diff --git a/modules/coding/editor/neovim/nvim/lua/langs/nix.lua b/modules/coding/editor/neovim/nvim/lua/langs/nix.lua index ea0990c..8d3037f 100644 --- a/modules/coding/editor/neovim/nvim/lua/langs/nix.lua +++ b/modules/coding/editor/neovim/nvim/lua/langs/nix.lua @@ -32,4 +32,3 @@ vim.api.nvim_create_autocmd("BufLeave", { end, group = "Nix", }) - diff --git a/modules/coding/editor/neovim/nvim/lua/langs/rust.lua b/modules/coding/editor/neovim/nvim/lua/langs/rust.lua index 8a6456f..9326525 100644 --- a/modules/coding/editor/neovim/nvim/lua/langs/rust.lua +++ b/modules/coding/editor/neovim/nvim/lua/langs/rust.lua @@ -8,4 +8,3 @@ vim.api.nvim_create_autocmd("BufWritePost", { end, group = "Rust", }) - diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/autopairs.lua b/modules/coding/editor/neovim/nvim/lua/plugins/autopairs.lua index fc29859..575076d 100644 --- a/modules/coding/editor/neovim/nvim/lua/plugins/autopairs.lua +++ b/modules/coding/editor/neovim/nvim/lua/plugins/autopairs.lua @@ -5,14 +5,14 @@ M = { javascript = { "string", "template_string" }, }, fast_wrap = { - map = '', - chars = { '{', '[', '(', '"', "'" }, + map = "", + chars = { "{", "[", "(", '"', "'" }, pattern = [=[[%'%"%)%>%]%)%}%,]]=], - end_key = '$', - keys = 'qwertyuiopzxcvbnmasdfghjkl', + end_key = "$", + keys = "qwertyuiopzxcvbnmasdfghjkl", check_comma = true, - highlight = 'Search', - highlight_grey='Comment' + highlight = "Search", + highlight_grey = "Comment", }, } @@ -23,4 +23,3 @@ if ok then end return M - diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/bufferline.lua b/modules/coding/editor/neovim/nvim/lua/plugins/bufferline.lua index 831b660..7b9e97b 100644 --- a/modules/coding/editor/neovim/nvim/lua/plugins/bufferline.lua +++ b/modules/coding/editor/neovim/nvim/lua/plugins/bufferline.lua @@ -1,31 +1,30 @@ local buf_kill = require("core.globals").buf_kill M = { - highlights = { - buffer_selected = { - bold = true - } - }, - options = { - diagnostics = "nvim_lsp", - offsets = { + highlights = { + buffer_selected = { + bold = true, + }, + }, + options = { + diagnostics = "nvim_lsp", + offsets = { { filetype = "NvimTree", text = "File Explorer", highlight = "Directory", - text_align = "center" + text_align = "center", }, }, - close_command = function (bufnr) - buf_kill("bd", bufnr, false) - end, - right_mouse_command = function (bufnr) - buf_kill("bd", bufnr, true) - end - } + close_command = function(bufnr) + buf_kill("bd", bufnr, false) + end, + right_mouse_command = function(bufnr) + buf_kill("bd", bufnr, true) + end, + }, } vim.opt.termguicolors = true return M - diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/cmp/cmp.lua b/modules/coding/editor/neovim/nvim/lua/plugins/cmp/cmp.lua index ffbc7f4..1f1e12e 100644 --- a/modules/coding/editor/neovim/nvim/lua/plugins/cmp/cmp.lua +++ b/modules/coding/editor/neovim/nvim/lua/plugins/cmp/cmp.lua @@ -3,21 +3,21 @@ local cmp = require("cmp") M = { window = { completion = { - border = 'rounded', - scrollbar = '║', + border = "rounded", + scrollbar = "║", }, documentation = { - border = 'rounded', - scrollbar = '║', + border = "rounded", + scrollbar = "║", }, }, formatting = { - format = require('lspkind').cmp_format({ + format = require("lspkind").cmp_format({ mode = "symbol", maxwidth = 50, - ellipsis_char = '...', - symbol_map = { Codeium = "", } - }) + ellipsis_char = "...", + symbol_map = { Codeium = "" }, + }), }, snippet = { expand = function(args) @@ -29,7 +29,7 @@ M = { [""] = cmp.mapping.scroll_docs(4), [""] = cmp.mapping.abort(), [""] = cmp.mapping.confirm({ select = true }), - [""] = cmp.mapping(function (fallback) + [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_prev_item() else @@ -37,9 +37,9 @@ M = { end end, { "i", - "s" + "s", }), - [""] = cmp.mapping(function (fallback) + [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() else @@ -47,22 +47,20 @@ M = { end end, { "i", - "s" + "s", }), }), sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "luasnip" }, + { name = "nvim_lsp" }, + { name = "luasnip" }, -- { name = "codeium" }, - { name = "path" }, - }, { - { name = "buffer" }, - }) - + { name = "path" }, + }, { + { name = "buffer" }, + }), } vim.o.wildmenu = true vim.o.pumheight = 10 return M - diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/cmp/luasnip.lua b/modules/coding/editor/neovim/nvim/lua/plugins/cmp/luasnip.lua index 622bae4..e16a600 100644 --- a/modules/coding/editor/neovim/nvim/lua/plugins/cmp/luasnip.lua +++ b/modules/coding/editor/neovim/nvim/lua/plugins/cmp/luasnip.lua @@ -1,34 +1,30 @@ M = { sources = { - friendly_snippets = true + friendly_snippets = true, }, history = true, - updateevents = { "TextChanged", "TextChangedI" } + updateevents = { "TextChanged", "TextChangedI" }, } -- vscode format require("luasnip.loaders.from_vscode").lazy_load() -require("luasnip.loaders.from_vscode").lazy_load { paths = vim.g.vscode_snippets_path or "" } +require("luasnip.loaders.from_vscode").lazy_load({ paths = vim.g.vscode_snippets_path or "" }) -- snipmate format require("luasnip.loaders.from_snipmate").load() -require("luasnip.loaders.from_snipmate").lazy_load { paths = vim.g.snipmate_snippets_path or "" } +require("luasnip.loaders.from_snipmate").lazy_load({ paths = vim.g.snipmate_snippets_path or "" }) -- lua format require("luasnip.loaders.from_lua").load() -require("luasnip.loaders.from_lua").lazy_load { paths = vim.g.lua_snippets_path or "" } +require("luasnip.loaders.from_lua").lazy_load({ paths = vim.g.lua_snippets_path or "" }) local luasnip = require("luasnip") vim.api.nvim_create_autocmd("InsertLeave", { callback = function() - if - luasnip.session.current_nodes[vim.api.nvim_get_current_buf()] - and not luasnip.session.jump_active - then + if luasnip.session.current_nodes[vim.api.nvim_get_current_buf()] and not luasnip.session.jump_active then luasnip.unlink_current() end end, }) return M - diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/comment.lua b/modules/coding/editor/neovim/nvim/lua/plugins/comment.lua index fbb6c5c..3646fd0 100644 --- a/modules/coding/editor/neovim/nvim/lua/plugins/comment.lua +++ b/modules/coding/editor/neovim/nvim/lua/plugins/comment.lua @@ -1,4 +1,3 @@ M = {} return M - diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/gitsigns.lua b/modules/coding/editor/neovim/nvim/lua/plugins/gitsigns.lua index c9da38e..63b86ab 100644 --- a/modules/coding/editor/neovim/nvim/lua/plugins/gitsigns.lua +++ b/modules/coding/editor/neovim/nvim/lua/plugins/gitsigns.lua @@ -1,19 +1,18 @@ M = { - signs = { - add = { text = '▎', color = "green" }, - change = { text = '▎', color = "blue" }, - delete = { text = '_' }, - topdelete = { text = '‾' }, - changedelete = { text = '~' }, - }, + signs = { + add = { text = "▎", color = "green" }, + change = { text = "▎", color = "blue" }, + delete = { text = "_" }, + topdelete = { text = "‾" }, + changedelete = { text = "~" }, + }, current_line_blame = true, current_line_blame_opts = { virt_text = true, - virt_text_pos = 'eol', + virt_text_pos = "eol", delay = 0, ignore_whitespace = false, }, } return M - diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/indent-blankline.lua b/modules/coding/editor/neovim/nvim/lua/plugins/indent-blankline.lua index 32bdbde..11efc03 100644 --- a/modules/coding/editor/neovim/nvim/lua/plugins/indent-blankline.lua +++ b/modules/coding/editor/neovim/nvim/lua/plugins/indent-blankline.lua @@ -1,15 +1,14 @@ M = { enabled = true, indent = { - tab_char = "▎" + tab_char = "▎", }, scope = { enabled = true, show_start = false, - } + }, } vim.opt.list = true return M - diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/lsp/fidget.lua b/modules/coding/editor/neovim/nvim/lua/plugins/lsp/fidget.lua index fbb6c5c..3646fd0 100644 --- a/modules/coding/editor/neovim/nvim/lua/plugins/lsp/fidget.lua +++ b/modules/coding/editor/neovim/nvim/lua/plugins/lsp/fidget.lua @@ -1,4 +1,3 @@ M = {} return M - diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/lsp/lspconfig.lua b/modules/coding/editor/neovim/nvim/lua/plugins/lsp/lspconfig.lua index e437f72..8202573 100644 --- a/modules/coding/editor/neovim/nvim/lua/plugins/lsp/lspconfig.lua +++ b/modules/coding/editor/neovim/nvim/lua/plugins/lsp/lspconfig.lua @@ -20,24 +20,24 @@ local extra_config = { vim.api.nvim_get_runtime_file("", true), "${3rd}/luv/library", "${3rd}/luassert/library", - } + }, }, diagnostics = { globals = { - "vim" - } + "vim", + }, }, completion = { - callSnippet = "Replace" - } - } + callSnippet = "Replace", + }, + }, }, }, rust_analyzer = { settings = { rust_analyzer = { check = { - command = "clippy" + command = "clippy", }, diagnostics = { experimental = true, @@ -45,7 +45,7 @@ local extra_config = { formatting = { command = { "rustfmt" }, }, - } + }, }, }, nixd = { @@ -56,12 +56,12 @@ local extra_config = { }, options = { nixos = { - expr = '(builtins.getFlake ("git+file://" + toString ./.)).nixosConfigurations.imxyy-nix.options', + expr = '(builtins.getFlake ("git+file://" + toString ./.)).nixosConfigurations.imxyy-nix.options', }, }, - } - } - } + }, + }, + }, } local capabilities = require("cmp_nvim_lsp").default_capabilities() @@ -74,7 +74,7 @@ local lspconfig = require("lspconfig") for _, server in ipairs(servers) do local extra = extra_config[server] or {} local config = { - capabilities = capabilities + capabilities = capabilities, } for k, v in pairs(extra) do config[k] = v diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/lsp/mason-lspconfig.lua b/modules/coding/editor/neovim/nvim/lua/plugins/lsp/mason-lspconfig.lua index 60fc320..9dd591a 100644 --- a/modules/coding/editor/neovim/nvim/lua/plugins/lsp/mason-lspconfig.lua +++ b/modules/coding/editor/neovim/nvim/lua/plugins/lsp/mason-lspconfig.lua @@ -1,7 +1,6 @@ M = { -- ensure_installed = require("plugins.lsp.servers") - ensure_installed = {} + ensure_installed = {}, } return M - diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/lsp/mason.lua b/modules/coding/editor/neovim/nvim/lua/plugins/lsp/mason.lua index fe68018..48edead 100644 --- a/modules/coding/editor/neovim/nvim/lua/plugins/lsp/mason.lua +++ b/modules/coding/editor/neovim/nvim/lua/plugins/lsp/mason.lua @@ -3,10 +3,9 @@ M = { icons = { package_installed = "✓", package_pending = "➜", - package_uninstalled = "✗" - } - } + package_uninstalled = "✗", + }, + }, } return M - diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/lsp/others.lua b/modules/coding/editor/neovim/nvim/lua/plugins/lsp/others.lua index a84a454..9ca5e1f 100644 --- a/modules/coding/editor/neovim/nvim/lua/plugins/lsp/others.lua +++ b/modules/coding/editor/neovim/nvim/lua/plugins/lsp/others.lua @@ -4,13 +4,13 @@ local opt = require("core.globals").keymap_opt vim.keymap.set("n", "K", vim.lsp.buf.hover, opt) vim.keymap.set("n", "lR", vim.lsp.buf.rename, opt) -local icons = { } +local icons = {} local sev = vim.diagnostic.severity local signs = { [sev.ERROR] = " ", [sev.WARN] = " ", [sev.HINT] = " ", - [sev.INFO] = " " + [sev.INFO] = " ", } for type, icon in pairs(icons) do local hl = vim.diagnostic.severity[type] @@ -18,7 +18,7 @@ for type, icon in pairs(icons) do end vim.diagnostic.config({ signs = { - text = signs + text = signs, }, underline = true, update_in_insert = true, @@ -26,7 +26,7 @@ vim.diagnostic.config({ }) vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { - border = "single", + border = "single", }) local diag_config1 = { @@ -35,7 +35,7 @@ local diag_config1 = { max = vim.diagnostic.severity.WARN, }, spacing = 4, - prefix = "●" + prefix = "●", }, virtual_lines = { severity = { diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/lsp/outline.lua b/modules/coding/editor/neovim/nvim/lua/plugins/lsp/outline.lua index a3069cd..4b69c7d 100644 --- a/modules/coding/editor/neovim/nvim/lua/plugins/lsp/outline.lua +++ b/modules/coding/editor/neovim/nvim/lua/plugins/lsp/outline.lua @@ -1,7 +1,7 @@ M = { symbols = { - icon_source = "lspkind" - } + icon_source = "lspkind", + }, } vim.keymap.set("n", "o", "Outline", { desc = "Toggle Outline" }) diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/lsp/servers.lua b/modules/coding/editor/neovim/nvim/lua/plugins/lsp/servers.lua index e3378d3..ed9039c 100644 --- a/modules/coding/editor/neovim/nvim/lua/plugins/lsp/servers.lua +++ b/modules/coding/editor/neovim/nvim/lua/plugins/lsp/servers.lua @@ -12,4 +12,3 @@ M = { } return M - diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/lsp/signature.lua b/modules/coding/editor/neovim/nvim/lua/plugins/lsp/signature.lua index 4212231..14f6c9d 100644 --- a/modules/coding/editor/neovim/nvim/lua/plugins/lsp/signature.lua +++ b/modules/coding/editor/neovim/nvim/lua/plugins/lsp/signature.lua @@ -1,16 +1,19 @@ M = { bind = true, -- This is mandatory, otherwise border config won't get registered. handler_opts = { - border = "rounded" + border = "rounded", }, hint_prefix = "^ ", toggle_key = "", } -vim.keymap.set({ 'n' }, 'k', require('lsp_signature').toggle_float_win, - { silent = true, noremap = true, desc = 'toggle signature' }) +vim.keymap.set( + { "n" }, + "k", + require("lsp_signature").toggle_float_win, + { silent = true, noremap = true, desc = "toggle signature" } +) -vim.keymap.set({ 'n' }, 'K', vim.lsp.buf.signature_help, - { silent = true, noremap = true, desc = 'toggle signature' }) +vim.keymap.set({ "n" }, "K", vim.lsp.buf.signature_help, { silent = true, noremap = true, desc = "toggle signature" }) return M diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/lualine.lua b/modules/coding/editor/neovim/nvim/lua/plugins/lualine.lua index abba20e..f632ade 100644 --- a/modules/coding/editor/neovim/nvim/lua/plugins/lualine.lua +++ b/modules/coding/editor/neovim/nvim/lua/plugins/lualine.lua @@ -1,10 +1,12 @@ M = { options = { - theme = "tokyonight" + theme = "tokyonight", }, sections = { lualine_y = { - 'encoding', 'fileformat', 'filetype', + "encoding", + "fileformat", + "filetype", }, lualine_x = { { diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/markdown-preview.lua b/modules/coding/editor/neovim/nvim/lua/plugins/markdown-preview.lua deleted file mode 100644 index bb20239..0000000 --- a/modules/coding/editor/neovim/nvim/lua/plugins/markdown-preview.lua +++ /dev/null @@ -1,31 +0,0 @@ -M = {} - -vim.api.nvim_create_augroup("MarkdownPreviewAuto", {}) - -vim.api.nvim_create_user_command("MarkdownPreviewAutoEnable", function() - vim.api.nvim_create_autocmd("BufEnter", { - group = "MarkdownPreviewAuto", - pattern = { "*.md" }, - desc = "Auto enable MarkdownPreview", - callback = function() - vim.cmd("MarkdownPreview") - end, - }) - vim.api.nvim_create_autocmd("BufLeave", { - group = "MarkdownPreviewAuto", - pattern = { "*.md" }, - desc = "Auto disable MarkdownPreview", - callback = function() - vim.cmd("MarkdownPreviewStop") - end, - }) -end, { desc = "Auto enable MarkdownPreview" }) - -vim.api.nvim_create_user_command("MarkdownPreviewAutoDisable", - function() - vim.api.nvim_clear_autocmds({ group = "MarkdownPreviewAuto" }) - end, {} -) - -return M - diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/neodev.lua b/modules/coding/editor/neovim/nvim/lua/plugins/neodev.lua deleted file mode 100644 index fbb6c5c..0000000 --- a/modules/coding/editor/neovim/nvim/lua/plugins/neodev.lua +++ /dev/null @@ -1,4 +0,0 @@ -M = {} - -return M - diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/nvim-tree.lua b/modules/coding/editor/neovim/nvim/lua/plugins/nvim-tree.lua index e24c106..36f2fc5 100644 --- a/modules/coding/editor/neovim/nvim/lua/plugins/nvim-tree.lua +++ b/modules/coding/editor/neovim/nvim/lua/plugins/nvim-tree.lua @@ -3,11 +3,11 @@ M = { diagnostics = { enable = false, debounce_delay = 50, - show_on_dirs = true + show_on_dirs = true, }, filters = { - git_ignored = false - } + git_ignored = false, + }, } vim.g.loaded_netrw = 1 @@ -18,4 +18,3 @@ vim.keymap.set("n", "e", ":NvimTreeToggle", opt) vim.keymap.set("n", "te", ":NvimTreeFocus", opt) return M - diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/plugins-setup.lua b/modules/coding/editor/neovim/nvim/lua/plugins/plugins-setup.lua index 11b947f..bc4e78e 100644 --- a/modules/coding/editor/neovim/nvim/lua/plugins/plugins-setup.lua +++ b/modules/coding/editor/neovim/nvim/lua/plugins/plugins-setup.lua @@ -5,7 +5,7 @@ if not vim.loop.fs_stat(lazypath) then "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", - lazypath + lazypath, }) end vim.opt.rtp:prepend(lazypath) @@ -18,7 +18,7 @@ local plugins = { priority = 1000, config = function() vim.cmd.colorscheme("tokyonight-storm") - end + end, }, { "nvim-lualine/lualine.nvim", @@ -26,41 +26,41 @@ local plugins = { dependencies = { { "nvim-tree/nvim-web-devicons", lazy = true } }, config = function() require("lualine").setup(require("plugins.lualine")) - end + end, }, { "nvim-tree/nvim-tree.lua", dependencies = { { "nvim-tree/nvim-web-devicons", lazy = true } }, - event = "VeryLazy", + lazy = false, config = function() require("nvim-tree").setup(require("plugins.nvim-tree")) - end + end, }, { "nvim-treesitter/nvim-treesitter", - event = "VeryLazy", + lazy = false, dependencies = { "nvim-treesitter/nvim-treesitter-textobjects", - "nushell/tree-sitter-nu" + "nushell/tree-sitter-nu", }, config = function() require("nvim-treesitter.configs").setup(require("plugins.treesitter")) end, - build = ":TSUpdate" + build = ":TSUpdate", }, { url = "https://gitlab.com/HiPhish/rainbow-delimiters.nvim", event = "BufEnter", config = function() require("plugins.rainbow-delimiters") - end + end, }, { "lukas-reineke/indent-blankline.nvim", event = "BufEnter", config = function() require("ibl").setup(require("plugins.indent-blankline")) - end + end, }, { "neovim/nvim-lspconfig", @@ -69,7 +69,7 @@ local plugins = { config = function() require("plugins.lsp.lspconfig") require("plugins.lsp.others") - end + end, }, { "folke/trouble.nvim", @@ -107,7 +107,7 @@ local plugins = { desc = "Quickfix List (Trouble)", }, }, - opts = {} + opts = {}, }, { "MysticalDevil/inlay-hints.nvim", @@ -115,7 +115,7 @@ local plugins = { dependencies = { "neovim/nvim-lspconfig" }, config = function() require("inlay-hints").setup() - end + end, }, { "hedyhli/outline.nvim", @@ -131,7 +131,7 @@ local plugins = { build = "make install_jsregexp", config = function() require("luasnip").setup(require("plugins.cmp.luasnip")) - end + end, }, { "hrsh7th/nvim-cmp", @@ -141,19 +141,19 @@ local plugins = { "saadparwaiz1/cmp_luasnip", "rafamadriz/friendly-snippets", "hrsh7th/cmp-path", - "onsails/lspkind.nvim" + "onsails/lspkind.nvim", }, event = "BufEnter", config = function() require("cmp").setup(require("plugins.cmp.cmp")) - end + end, }, { "numToStr/Comment.nvim", event = "BufEnter", config = function() require("Comment").setup(require("plugins.comment")) - end + end, }, { "windwp/nvim-autopairs", @@ -161,20 +161,20 @@ local plugins = { dependencies = { "hrsh7th/nvim-cmp" }, config = function() require("nvim-autopairs").setup(require("plugins.autopairs")) - end + end, }, { "akinsho/bufferline.nvim", config = function() require("bufferline").setup(require("plugins.bufferline")) - end + end, }, { "lewis6991/gitsigns.nvim", event = "BufEnter", config = function() require("gitsigns").setup(require("plugins.gitsigns")) - end + end, }, { "nvim-telescope/telescope.nvim", @@ -182,46 +182,18 @@ local plugins = { dependencies = { "nvim-lua/plenary.nvim", "BurntSushi/ripgrep" }, config = function() require("telescope").setup(require("plugins.telescope")) - end + end, }, { "alexghergh/nvim-tmux-navigation", event = "VeryLazy", config = function() require("nvim-tmux-navigation").setup(require("plugins.tmuxnav")) - end - }, - { - "natecraddock/workspaces.nvim", - event = "VeryLazy", - dependencies = { "nvim-telescope/telescope.nvim", "natecraddock/sessions.nvim" }, - config = function() - require("workspaces").setup(require("plugins.workspaces")) - require("telescope").load_extension("workspaces") - end - }, - --[[ { - "iamcco/markdown-preview.nvim", - cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop", "MarkdownPreviewAutoEnable", "MarkdownPreviewAutoDisable" }, - ft = { "markdown" }, - build = function() - vim.fn["mkdp#util#install"]() end, - config = function() - require("plugins.markdown-preview") - end - }, ]] - --[[ { - "dhruvasagar/vim-table-mode", - lazy = true, - event = "BufEnter *.md", - config = function() - require("plugins.table-mode") - end - }, ]] + }, { - 'MeanderingProgrammer/render-markdown.nvim', - dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons + "MeanderingProgrammer/render-markdown.nvim", + dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" }, opts = {}, }, { @@ -236,15 +208,15 @@ local plugins = { ["vim.lsp.util.convert_input_to_markdown_lines"] = true, ["vim.lsp.util.stylize_markdown"] = true, ["cmp.entry.get_documentation"] = true, - } - } + }, + }, }, { "voldikss/vim-floaterm", event = "VeryLazy", config = function() require("plugins.floaterm") - end + end, }, { "folke/todo-comments.nvim", @@ -256,27 +228,21 @@ local plugins = { event = "BufEnter", config = function() require("osc52").setup({ - tmux_passthrough = true + tmux_passthrough = true, }) local function copy() if vim.v.event.operator == "y" and vim.v.event.regname == "+" then require("osc52").copy_register("+") end end - vim.api.nvim_create_autocmd("TextYankPost", {callback = copy}) - end + vim.api.nvim_create_autocmd("TextYankPost", { callback = copy }) + end, }, { "pest-parser/pest.vim", ft = "pest", - opts = {} - } + opts = {}, + }, } -local opts = { - rocks = { - enabled = false - } -} - -require("lazy").setup(plugins, opts) +require("lazy").setup(plugins, {}) diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/rainbow-delimiters.lua b/modules/coding/editor/neovim/nvim/lua/plugins/rainbow-delimiters.lua index dd801bf..5d07753 100644 --- a/modules/coding/editor/neovim/nvim/lua/plugins/rainbow-delimiters.lua +++ b/modules/coding/editor/neovim/nvim/lua/plugins/rainbow-delimiters.lua @@ -1,21 +1,20 @@ local rainbow_delimiters = require("rainbow-delimiters") vim.g.rainbow_delimiters = { strategy = { - [''] = rainbow_delimiters.strategy['global'], - vim = rainbow_delimiters.strategy['local'], + [""] = rainbow_delimiters.strategy["global"], + vim = rainbow_delimiters.strategy["local"], }, query = { - [''] = 'rainbow-delimiters', - lua = 'rainbow-blocks', + [""] = "rainbow-delimiters", + lua = "rainbow-blocks", }, highlight = { - 'RainbowDelimiterRed', - 'RainbowDelimiterYellow', - 'RainbowDelimiterBlue', - 'RainbowDelimiterOrange', - 'RainbowDelimiterGreen', - 'RainbowDelimiterViolet', - 'RainbowDelimiterCyan', + "RainbowDelimiterRed", + "RainbowDelimiterYellow", + "RainbowDelimiterBlue", + "RainbowDelimiterOrange", + "RainbowDelimiterGreen", + "RainbowDelimiterViolet", + "RainbowDelimiterCyan", }, } - diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/table-mode.lua b/modules/coding/editor/neovim/nvim/lua/plugins/table-mode.lua deleted file mode 100644 index 889cd16..0000000 --- a/modules/coding/editor/neovim/nvim/lua/plugins/table-mode.lua +++ /dev/null @@ -1,34 +0,0 @@ -M = {} - -vim.g.table_mode_corner = "|" - -vim.api.nvim_create_augroup("TableModeAuto", {}) - -vim.api.nvim_create_user_command("TableModeAutoEnable", function() - vim.api.nvim_clear_autocmds({ group = "TableModeAuto" }) - vim.api.nvim_create_autocmd("BufEnter", { - group = "TableModeAuto", - pattern = { "*.md" }, - desc = "Auto enable TableMode", - callback = function() - vim.cmd("TableModeEnable") - end, - }) - vim.api.nvim_create_autocmd("BufWrite", { - group = "TableModeAuto", - pattern = { "*.md" }, - desc = "Auto enable TableMode", - callback = function() - vim.cmd("TableModeRealign") - end, - }) -end, { desc = "Auto enable TableMode" }) - -vim.api.nvim_create_user_command("TableModeAutoDisable", - function() - vim.api.nvim_clear_autocmds({ group = "TableModeAuto" }) - end, {} -) - -return M - diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/telescope.lua b/modules/coding/editor/neovim/nvim/lua/plugins/telescope.lua index 07c3291..d111b36 100644 --- a/modules/coding/editor/neovim/nvim/lua/plugins/telescope.lua +++ b/modules/coding/editor/neovim/nvim/lua/plugins/telescope.lua @@ -3,13 +3,13 @@ M = { winblend = 50, path_display = { "smart", - shorten = 3 - } + shorten = 3, + }, }, pickers = { lsp_definitions = { theme = "cursor", - layout_config = { width = 0.6, height = 0.3}, + layout_config = { width = 0.6, height = 0.3 }, }, lsp_references = { theme = "cursor", @@ -17,29 +17,28 @@ M = { }, current_buffer_fuzzy_find = { theme = "dropdown", - layout_config = { height = 0.7, width = 0.55, preview_cutoff = 0 ,prompt_position = "top" } + layout_config = { height = 0.7, width = 0.55, preview_cutoff = 0, prompt_position = "top" }, }, lsp_document_symbols = { theme = "ivy", - layout_config = { height = 0.25 } - } + layout_config = { height = 0.25 }, + }, }, } local opt = require("core.globals").keymap_opt local keymap = vim.keymap -local builtin = require('telescope.builtin') +local builtin = require("telescope.builtin") -keymap.set('n', 'ff', builtin.find_files, opt) -keymap.set('n', 'gf', builtin.git_files, opt) -keymap.set('n', 'fg', builtin.live_grep, opt) -keymap.set('n', 'fb', builtin.buffers, opt) -keymap.set('n', 'fh', builtin.help_tags, opt) +keymap.set("n", "ff", builtin.find_files, opt) +keymap.set("n", "gf", builtin.git_files, opt) +keymap.set("n", "fg", builtin.live_grep, opt) +keymap.set("n", "fb", builtin.buffers, opt) +keymap.set("n", "fh", builtin.help_tags, opt) -- keymap.set('n', 'lD', builtin.diagnostics, opt) -keymap.set('n', 'ld', builtin.lsp_definitions, opt) -keymap.set('n', 'lr', builtin.lsp_references, opt) -keymap.set('n', 'ls', builtin.lsp_document_symbols, opt) -keymap.set('n', '/', builtin.current_buffer_fuzzy_find, opt) +keymap.set("n", "ld", builtin.lsp_definitions, opt) +keymap.set("n", "lr", builtin.lsp_references, opt) +keymap.set("n", "ls", builtin.lsp_document_symbols, opt) +keymap.set("n", "/", builtin.current_buffer_fuzzy_find, opt) return M - diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/tmuxnav.lua b/modules/coding/editor/neovim/nvim/lua/plugins/tmuxnav.lua index ae03443..95cf22a 100644 --- a/modules/coding/editor/neovim/nvim/lua/plugins/tmuxnav.lua +++ b/modules/coding/editor/neovim/nvim/lua/plugins/tmuxnav.lua @@ -11,4 +11,3 @@ keymap.set("n", "", tmuxnav.NvimTmuxNavigateLastActive) keymap.set("n", "", tmuxnav.NvimTmuxNavigateNext) return M - diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/treesitter.lua b/modules/coding/editor/neovim/nvim/lua/plugins/treesitter.lua index 8820a90..678a295 100644 --- a/modules/coding/editor/neovim/nvim/lua/plugins/treesitter.lua +++ b/modules/coding/editor/neovim/nvim/lua/plugins/treesitter.lua @@ -6,15 +6,14 @@ M = { ignore_install = {}, highlight = { enable = true }, - indent = { enable = true } + indent = { enable = true }, } vim.filetype.add({ pattern = { [".*/hypr/.*%.conf"] = "hyprlang", - [".*%.hl"] = "hyprlang" + [".*%.hl"] = "hyprlang", }, }) return M - diff --git a/modules/coding/editor/neovim/nvim/lua/plugins/workspaces.lua b/modules/coding/editor/neovim/nvim/lua/plugins/workspaces.lua deleted file mode 100644 index 8794f35..0000000 --- a/modules/coding/editor/neovim/nvim/lua/plugins/workspaces.lua +++ /dev/null @@ -1,14 +0,0 @@ -M = { - hooks = { - open = function () - require("core.globals").close_empty_buffer() - vim.cmd("enew") - vim.cmd("bufdo bd") - require("sessions").load(nil, { silent = true }) - vim.cmd("NvimTreeFocus") - end - }, -} - -return M -