From eb08fa76ecce9ad50d89f67b7161412e20800c20 Mon Sep 17 00:00:00 2001 From: Varris Date: Thu, 21 Dec 2023 20:22:52 +0100 Subject: [PATCH] update --- .../neovim/config/lua/plugins/bufferline.lua | 28 +-- .../configs/neovim/config/lua/plugins/cmp.lua | 178 +++++++++--------- .../neovim/config/lua/plugins/colorscheme.lua | 2 +- .../neovim/config/lua/plugins/lspconfig.lua | 46 ++--- .../neovim/config/lua/plugins/lualine.lua | 6 +- .../neovim/config/lua/plugins/neo-tree.lua | 64 +++---- .../neovim/config/lua/plugins/noice.lua | 32 ++-- .../neovim/config/lua/plugins/notify.lua | 2 +- .../neovim/config/lua/plugins/smartsplits.lua | 12 +- .../neovim/config/lua/plugins/telescope.lua | 10 +- .../neovim/config/lua/plugins/treesitter.lua | 4 +- .../neovim/config/lua/plugins/which-key.lua | 6 +- user/configs/neovim/config/lua/remaps.lua | 2 +- user/configs/neovim/config/lua/settings.lua | 10 +- 14 files changed, 201 insertions(+), 201 deletions(-) diff --git a/user/configs/neovim/config/lua/plugins/bufferline.lua b/user/configs/neovim/config/lua/plugins/bufferline.lua index 238666b..1356c76 100755 --- a/user/configs/neovim/config/lua/plugins/bufferline.lua +++ b/user/configs/neovim/config/lua/plugins/bufferline.lua @@ -1,16 +1,16 @@ require("bufferline").setup({ - options = { - show_tab_indicators = true, - -- separator_style = { "", "" }, - indicator = { style = "icon", icon = "" }, - color_icons = true, - offsets = { - { - filetype = "neo-tree", - text = "File Explorer", - text_align = "center", - separator = true, - }, - }, - }, + options = { + show_tab_indicators = true, + -- separator_style = { "", "" }, + indicator = { style = "icon", icon = "" }, + color_icons = true, + offsets = { + { + filetype = "neo-tree", + text = "File Explorer", + text_align = "center", + separator = true, + }, + }, + }, }) diff --git a/user/configs/neovim/config/lua/plugins/cmp.lua b/user/configs/neovim/config/lua/plugins/cmp.lua index 874ccda..7f07160 100755 --- a/user/configs/neovim/config/lua/plugins/cmp.lua +++ b/user/configs/neovim/config/lua/plugins/cmp.lua @@ -6,112 +6,112 @@ local luasnip = require("luasnip") require("luasnip.loaders.from_vscode").lazy_load() local has_words_before = function() - unpack = unpack or table.unpack - 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 + unpack = unpack or table.unpack + 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 cmp.setup({ - preselect = cmp.PreselectMode.None, - formatting = { - format = lspkind.cmp_format({ - mode = "symbol_text", + preselect = cmp.PreselectMode.None, + formatting = { + format = lspkind.cmp_format({ + mode = "symbol_text", - symbol_map = { - Text = "󰉿", - Method = "󰆧", - Function = "󰊕", - Constructor = "", - Field = "", - Variable = "󰀫", - Class = "", - Interface = "", - Module = "", - Property = "", - Unit = "", - Value = "󰎠", - Enum = "", - Keyword = "󰌋", - Snippet = "", - Color = "󰏘", - File = "󰈙", - Reference = "󰈇", - Folder = "󰉋", - EnumMember = "", - Constant = "󰏿", - Struct = "", - Event = "", - Operator = "󰆕", - TypeParameter = "", - }, - }), - }, + symbol_map = { + Text = "󰉿", + Method = "󰆧", + Function = "󰊕", + Constructor = "", + Field = "", + Variable = "󰀫", + Class = "", + Interface = "", + Module = "", + Property = "", + Unit = "", + Value = "󰎠", + Enum = "", + Keyword = "󰌋", + Snippet = "", + Color = "󰏘", + File = "󰈙", + Reference = "󰈇", + Folder = "󰉋", + EnumMember = "", + Constant = "󰏿", + Struct = "", + Event = "", + Operator = "󰆕", + TypeParameter = "", + }, + }), + }, - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, - sources = cmp.config.sources({ - { name = "buffer" }, - { name = "path" }, - { name = "nvim_lsp" }, - { name = "luasnip" }, - }), + sources = cmp.config.sources({ + { name = "buffer" }, + { name = "path" }, + { name = "nvim_lsp" }, + { name = "luasnip" }, + }), - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = false }), + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = false }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() - -- they way you will only jump inside the snippet region - elseif luasnip.expand_or_locally_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_next_item() + -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() + -- they way you will only jump inside the snippet region + elseif luasnip.expand_or_locally_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" }), - }), + [""] = 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" }), + }), }) local cmp_autopairs = require("nvim-autopairs.completion.cmp") cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) cmp.setup.cmdline(":", { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = "path" }, - { name = "cmdline" }, - }), + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = "path" }, + { name = "cmdline" }, + }), }) cmp.setup.cmdline("/", { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = "buffer" }, - }), + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = "buffer" }, + }), }) diff --git a/user/configs/neovim/config/lua/plugins/colorscheme.lua b/user/configs/neovim/config/lua/plugins/colorscheme.lua index 071b6d4..03bb8b2 100755 --- a/user/configs/neovim/config/lua/plugins/colorscheme.lua +++ b/user/configs/neovim/config/lua/plugins/colorscheme.lua @@ -1,4 +1,4 @@ require("gruvbox").setup({ - transparent_mode = true, + transparent_mode = true, }) vim.cmd("colorscheme gruvbox") diff --git a/user/configs/neovim/config/lua/plugins/lspconfig.lua b/user/configs/neovim/config/lua/plugins/lspconfig.lua index c91655a..6fdc7ce 100755 --- a/user/configs/neovim/config/lua/plugins/lspconfig.lua +++ b/user/configs/neovim/config/lua/plugins/lspconfig.lua @@ -1,8 +1,8 @@ local capabilities = require("cmp_nvim_lsp").default_capabilities() capabilities.textDocument.completion.completionItem.snippetSupport = true capabilities.textDocument.foldingRange = { - dynamicRegistration = false, - lineFoldingOnly = true, + dynamicRegistration = false, + lineFoldingOnly = true, } local lspconfig = require("lspconfig") @@ -11,27 +11,27 @@ local null_ls = require("null-ls") local null_ls_formatting = null_ls.builtins.formatting null_ls.setup({ - sources = { - null_ls_formatting.prettier, - null_ls_formatting.nixpkgs_fmt, - }, + sources = { + null_ls_formatting.prettier, + null_ls_formatting.nixpkgs_fmt, + }, }) lspconfig.nixd.setup({ capabilities = capabilities }) lspconfig.lua_ls.setup({ - capabilities = capabilities, - settings = { - Lua = { - runtime = { version = "LuaJIT" }, - diagnostics = { globals = { "vim" } }, - workspace = { - library = vim.api.nvim_get_runtime_file("", true), - checkThirdParty = false, - }, - telemetry = { enable = false }, - }, - }, + capabilities = capabilities, + settings = { + Lua = { + runtime = { version = "LuaJIT" }, + diagnostics = { globals = { "vim" } }, + workspace = { + library = vim.api.nvim_get_runtime_file("", true), + checkThirdParty = false, + }, + telemetry = { enable = false }, + }, + }, }) lspconfig.clangd.setup({ capabilities = capabilities }) @@ -42,9 +42,9 @@ lspconfig.bashls.setup({ capabilities = capabilities }) lspconfig.tsserver.setup({ capabilities = capabilities }) lspconfig.cssls.setup({ - capabilities = capabilities, - cmd = { "css-languageserver", "--stdio" }, - settings = { - css = { validate = false }, - }, + capabilities = capabilities, + cmd = { "css-languageserver", "--stdio" }, + settings = { + css = { validate = false }, + }, }) diff --git a/user/configs/neovim/config/lua/plugins/lualine.lua b/user/configs/neovim/config/lua/plugins/lualine.lua index 75673db..b56b7e9 100755 --- a/user/configs/neovim/config/lua/plugins/lualine.lua +++ b/user/configs/neovim/config/lua/plugins/lualine.lua @@ -1,5 +1,5 @@ require("lualine").setup({ - options = { - theme = "gruvbox_dark", - }, + options = { + theme = "gruvbox_dark", + }, }) diff --git a/user/configs/neovim/config/lua/plugins/neo-tree.lua b/user/configs/neovim/config/lua/plugins/neo-tree.lua index aa298f2..8db6503 100755 --- a/user/configs/neovim/config/lua/plugins/neo-tree.lua +++ b/user/configs/neovim/config/lua/plugins/neo-tree.lua @@ -1,35 +1,35 @@ require("neo-tree").setup({ - default_component_configs = { - icon = { - folder_empty = "󰜌", - folder_empty_open = "󰜌", - }, - git_status = { - symbols = { - renamed = "󰁕", - unstaged = "󰄱", - }, - }, - }, + default_component_configs = { + icon = { + folder_empty = "󰜌", + folder_empty_open = "󰜌", + }, + git_status = { + symbols = { + renamed = "󰁕", + unstaged = "󰄱", + }, + }, + }, - document_symbols = { - kinds = { - File = { icon = "󰈙", hl = "Tag" }, - Namespace = { icon = "󰌗", hl = "Include" }, - Package = { icon = "󰏖", hl = "Label" }, - Class = { icon = "󰌗", hl = "Include" }, - Property = { icon = "󰆧", hl = "@property" }, - Enum = { icon = "󰒻", hl = "@number" }, - Function = { icon = "󰊕", hl = "Function" }, - String = { icon = "󰀬", hl = "String" }, - Number = { icon = "󰎠", hl = "Number" }, - Array = { icon = "󰅪", hl = "Type" }, - Object = { icon = "󰅩", hl = "Type" }, - Key = { icon = "󰌋", hl = "" }, - Struct = { icon = "󰌗", hl = "Type" }, - Operator = { icon = "󰆕", hl = "Operator" }, - TypeParameter = { icon = "󰊄", hl = "Type" }, - StaticMethod = { icon = "󰠄 ", hl = "Function" }, - }, - }, + document_symbols = { + kinds = { + File = { icon = "󰈙", hl = "Tag" }, + Namespace = { icon = "󰌗", hl = "Include" }, + Package = { icon = "󰏖", hl = "Label" }, + Class = { icon = "󰌗", hl = "Include" }, + Property = { icon = "󰆧", hl = "@property" }, + Enum = { icon = "󰒻", hl = "@number" }, + Function = { icon = "󰊕", hl = "Function" }, + String = { icon = "󰀬", hl = "String" }, + Number = { icon = "󰎠", hl = "Number" }, + Array = { icon = "󰅪", hl = "Type" }, + Object = { icon = "󰅩", hl = "Type" }, + Key = { icon = "󰌋", hl = "" }, + Struct = { icon = "󰌗", hl = "Type" }, + Operator = { icon = "󰆕", hl = "Operator" }, + TypeParameter = { icon = "󰊄", hl = "Type" }, + StaticMethod = { icon = "󰠄 ", hl = "Function" }, + }, + }, }) diff --git a/user/configs/neovim/config/lua/plugins/noice.lua b/user/configs/neovim/config/lua/plugins/noice.lua index 1c99bcf..54d4135 100644 --- a/user/configs/neovim/config/lua/plugins/noice.lua +++ b/user/configs/neovim/config/lua/plugins/noice.lua @@ -1,18 +1,18 @@ require("noice").setup({ - lsp = { - -- 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 = false, -- use a classic bottom cmdline for search - command_palette = false, -- position the cmdline and popupmenu together - long_message_to_split = false, -- long messages will be sent to a split - inc_rename = false, -- enables an input dialog for inc-rename.nvim - lsp_doc_border = false, -- add a border to hover docs and signature help - }, + lsp = { + -- 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 = false, -- use a classic bottom cmdline for search + command_palette = false, -- position the cmdline and popupmenu together + long_message_to_split = false, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = false, -- add a border to hover docs and signature help + }, }) diff --git a/user/configs/neovim/config/lua/plugins/notify.lua b/user/configs/neovim/config/lua/plugins/notify.lua index 71a5184..e6ca3f8 100644 --- a/user/configs/neovim/config/lua/plugins/notify.lua +++ b/user/configs/neovim/config/lua/plugins/notify.lua @@ -1,3 +1,3 @@ require("notify").setup({ - background_colour = "#282828", + background_colour = "#282828", }) diff --git a/user/configs/neovim/config/lua/plugins/smartsplits.lua b/user/configs/neovim/config/lua/plugins/smartsplits.lua index 1b3c51d..9fd6faf 100755 --- a/user/configs/neovim/config/lua/plugins/smartsplits.lua +++ b/user/configs/neovim/config/lua/plugins/smartsplits.lua @@ -1,8 +1,8 @@ require("smart-splits").setup({ - ignored_filetypes = { - "neo-tree", - "nofile", - "quickfix", - "prompt", - }, + ignored_filetypes = { + "neo-tree", + "nofile", + "quickfix", + "prompt", + }, }) diff --git a/user/configs/neovim/config/lua/plugins/telescope.lua b/user/configs/neovim/config/lua/plugins/telescope.lua index 0338dbd..69d21dc 100755 --- a/user/configs/neovim/config/lua/plugins/telescope.lua +++ b/user/configs/neovim/config/lua/plugins/telescope.lua @@ -1,10 +1,10 @@ local telescope = require("telescope") telescope.setup({ - extensions = { - ["ui-select"] = { - require("telescope.themes").get_dropdown({}), - }, - }, + extensions = { + ["ui-select"] = { + require("telescope.themes").get_dropdown({}), + }, + }, }) telescope.load_extension("fzf") diff --git a/user/configs/neovim/config/lua/plugins/treesitter.lua b/user/configs/neovim/config/lua/plugins/treesitter.lua index 8945ace..3d71f76 100755 --- a/user/configs/neovim/config/lua/plugins/treesitter.lua +++ b/user/configs/neovim/config/lua/plugins/treesitter.lua @@ -1,4 +1,4 @@ require("nvim-treesitter.configs").setup({ - highlight = { enable = true }, - indent = { enable = true }, + highlight = { enable = true }, + indent = { enable = true }, }) diff --git a/user/configs/neovim/config/lua/plugins/which-key.lua b/user/configs/neovim/config/lua/plugins/which-key.lua index 2d430ab..6651cf5 100755 --- a/user/configs/neovim/config/lua/plugins/which-key.lua +++ b/user/configs/neovim/config/lua/plugins/which-key.lua @@ -1,7 +1,7 @@ vim.o.timeoutlen = 100 require("which-key").setup({ - window = { - padding = { 1, 5, 1, 5 }, - }, + window = { + padding = { 1, 5, 1, 5 }, + }, }) diff --git a/user/configs/neovim/config/lua/remaps.lua b/user/configs/neovim/config/lua/remaps.lua index efa7ba7..f548cde 100755 --- a/user/configs/neovim/config/lua/remaps.lua +++ b/user/configs/neovim/config/lua/remaps.lua @@ -10,7 +10,7 @@ map("n", "fb", telescope_builtin.buffers, { desc = "List Buffers" }) map("n", "fh", telescope_builtin.help_tags, { desc = "Help Tags" }) map("n", "fp", telescope_builtin.git_files, { desc = "Find Files (Git)" }) map("n", "fc", function() - telescope_builtin.git_files({ cwd = "~/.dotfiles" }) + telescope_builtin.git_files({ cwd = "~/.dotfiles" }) end, { desc = "Edit Dotfiles" }) map("n", "", "Neotree toggle", { desc = "Open NeoTree" }) map({ "n", "x" }, "ga", ":EasyAlign", { desc = "Align text" }) diff --git a/user/configs/neovim/config/lua/settings.lua b/user/configs/neovim/config/lua/settings.lua index ee391fa..85a892f 100755 --- a/user/configs/neovim/config/lua/settings.lua +++ b/user/configs/neovim/config/lua/settings.lua @@ -26,9 +26,9 @@ vim.wo.number = true vim.wo.relativenumber = true vim.api.nvim_create_autocmd("FileType", { - pattern = "nix", - callback = function() - vim.opt_local.shiftwidth = 2 - vim.opt_local.tabstop = 2 - end, + pattern = "nix", + callback = function() + vim.opt_local.shiftwidth = 2 + vim.opt_local.tabstop = 2 + end, })