From e454b4a8b9f18d98ff632808ce066d8cbaed8ab9 Mon Sep 17 00:00:00 2001 From: David Ibia Date: Mon, 1 Jan 2024 21:03:31 +0100 Subject: [PATCH] feat: updated plugins and editor configuration --- init.lua | 3 + lazy-lock.json | 14 +- lua/absolute/after/bufferline.lua | 20 +++ lua/absolute/after/colorscheme.lua | 8 + lua/absolute/after/lsp-config.lua | 150 ++++++++++++++++++ lua/absolute/after/lsp-zero.lua | 51 ------ lua/absolute/after/lualine.lua | 65 ++++++++ lua/absolute/after/mason.lua | 16 ++ lua/absolute/after/mini.lua | 11 ++ lua/absolute/after/nvim-cmp.lua | 38 +++-- lua/absolute/after/nvim-tree.lua | 24 +-- lua/absolute/after/nvim-treesitter.lua | 34 ++-- lua/absolute/after/rose-pine.lua | 4 - lua/absolute/after/telescope.lua | 13 +- lua/absolute/lazy.lua | 33 ++-- lua/absolute/plugins/bufferline.lua | 8 + lua/absolute/plugins/comment.lua | 5 + lua/absolute/plugins/dressing.lua | 4 + lua/absolute/plugins/harpoon.lua | 10 +- lua/absolute/plugins/lsp-config.lua | 11 ++ lua/absolute/plugins/lsp-zero.lua | 15 -- lua/absolute/plugins/lualine.lua | 7 + lua/absolute/plugins/mason.lua | 10 ++ lua/absolute/plugins/mini.lua | 7 + lua/absolute/plugins/nightfly.lua | 5 + lua/absolute/plugins/nvim-cmp.lua | 9 +- lua/absolute/plugins/nvim-tree.lua | 2 +- .../plugins/nvim-treesitter-playground.lua | 5 +- lua/absolute/plugins/nvim-treesitter.lua | 10 +- lua/absolute/plugins/rose-pine.lua | 5 +- lua/absolute/plugins/telescope.lua | 25 ++- lua/absolute/plugins/undotree.lua | 8 +- lua/absolute/plugins/vim-fugitive.lua | 10 +- lua/absolute/plugins/vim-maximizer.lua | 3 + lua/absolute/plugins/vim-tmux-navigator.lua | 30 ++-- lua/absolute/remap.lua | 19 ++- 36 files changed, 497 insertions(+), 195 deletions(-) create mode 100644 lua/absolute/after/bufferline.lua create mode 100644 lua/absolute/after/colorscheme.lua create mode 100644 lua/absolute/after/lsp-config.lua delete mode 100644 lua/absolute/after/lsp-zero.lua create mode 100644 lua/absolute/after/lualine.lua create mode 100644 lua/absolute/after/mason.lua create mode 100644 lua/absolute/after/mini.lua delete mode 100644 lua/absolute/after/rose-pine.lua create mode 100644 lua/absolute/plugins/bufferline.lua create mode 100644 lua/absolute/plugins/comment.lua create mode 100644 lua/absolute/plugins/dressing.lua create mode 100644 lua/absolute/plugins/lsp-config.lua delete mode 100644 lua/absolute/plugins/lsp-zero.lua create mode 100644 lua/absolute/plugins/lualine.lua create mode 100644 lua/absolute/plugins/mason.lua create mode 100644 lua/absolute/plugins/mini.lua create mode 100644 lua/absolute/plugins/nightfly.lua create mode 100644 lua/absolute/plugins/vim-maximizer.lua diff --git a/init.lua b/init.lua index 35741cf..d1585f9 100644 --- a/init.lua +++ b/init.lua @@ -1 +1,4 @@ require("absolute") + +vim.g.loaded_perl_provider = 0 +vim.g.loaded_ruby_provider = 0 diff --git a/lazy-lock.json b/lazy-lock.json index aa9601f..3746bfe 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,27 +1,37 @@ { + "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, "LuaSnip": { "branch": "master", "commit": "8ae1dedd988eb56441b7858bd1e8554dfadaa46d" }, + "bufferline.nvim": { "branch": "main", "commit": "6c456b888823d9e4832aa91c482bccd19445c009" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "copilot.vim": { "branch": "release", "commit": "5b19fb001d7f31c4c7c5556d7a97b243bd29f45f" }, + "dressing.nvim": { "branch": "master", "commit": "94b0d24483d56f3777ee0c8dc51675f21709318c" }, + "friendly-snippets": { "branch": "main", "commit": "53d3df271d031c405255e99410628c26a8f0d2b0" }, "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, - "lsp-zero.nvim": { "branch": "v3.x", "commit": "81c25389c855dd0e0fad4863f7464e1389e45ca3" }, "lspkind.nvim": { "branch": "master", "commit": "7f26cf5e27e2bd910ce0ea00c514da2bf97423b8" }, + "lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "56e435e09f8729af2d41973e81a0db440f8fe9c9" }, "mason.nvim": { "branch": "main", "commit": "a09da6ac634926a299dd439da08bdb547a8ca011" }, + "mini.nvim": { "branch": "main", "commit": "b5645ac6eefce8e7af9d7dd4e5e296a81cba8a10" }, + "nightfly": { "branch": "master", "commit": "90d85c8a094266122fb1fd173e7bcc0cd0efdd49" }, "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, + "nvim-lsp-file-operations": { "branch": "master", "commit": "8e7223e138590c1bd9d86d3de810e65939d8b12f" }, "nvim-lspconfig": { "branch": "master", "commit": "9bedcfed749755e43fc8bed46f85ce2044fe3b77" }, "nvim-tree.lua": { "branch": "master", "commit": "f1b3e6a7eb92da492bd693257367d9256839ed3d" }, "nvim-treesitter": { "branch": "master", "commit": "e49f1e8ef3e8450a8446cb1f2bbb53c919f60b6d" }, "nvim-web-devicons": { "branch": "master", "commit": "cff25ce621e6d15fae0b0bfe38c00be50ce38468" }, + "nvim_lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, "rose-pine": { "branch": "main", "commit": "92762f4fa2144c05db760ea254f4c399a56a7ef5" }, - "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, + "telescope-dap.nvim": { "branch": "master", "commit": "4e2d5efb92062f0b865fe59b200b5ed7793833bf" }, + "telescope.nvim": { "branch": "0.1.x", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, "undotree": { "branch": "master", "commit": "36ff7abb6b60980338344982ad4cdf03f7961ecd" }, "vim-fugitive": { "branch": "master", "commit": "59659093581aad2afacedc81f009ed6a4bfad275" }, + "vim-maximizer": { "branch": "master", "commit": "2e54952fe91e140a2e69f35f22131219fcd9c5f1" }, "vim-tmux-navigator": { "branch": "master", "commit": "38b1d0402c4600543281dc85b3f51884205674b6" } } \ No newline at end of file diff --git a/lua/absolute/after/bufferline.lua b/lua/absolute/after/bufferline.lua new file mode 100644 index 0000000..f3239b2 --- /dev/null +++ b/lua/absolute/after/bufferline.lua @@ -0,0 +1,20 @@ +require("bufferline").setup { + options = { + mode = "tabs", + separator_style = "slant", + } +} + +local opts = { noremap = true, silent = true } + +vim.api.nvim_set_keymap("n", "1", "BufferLineGoToBuffer 1", opts) +vim.api.nvim_set_keymap("n", "2", "BufferLineGoToBuffer 2", opts) +vim.api.nvim_set_keymap("n", "3", "BufferLineGoToBuffer 3", opts) +vim.api.nvim_set_keymap("n", "4", "BufferLineGoToBuffer 4", opts) + + +-- I want to be to close the current tab with a single keypress +vim.api.nvim_set_keymap("n", "w", "tabclose", opts) + +-- I want to be able to create a new tab with a single keypress +vim.api.nvim_set_keymap("n", "t", "tabnew", opts) diff --git a/lua/absolute/after/colorscheme.lua b/lua/absolute/after/colorscheme.lua new file mode 100644 index 0000000..95ff424 --- /dev/null +++ b/lua/absolute/after/colorscheme.lua @@ -0,0 +1,8 @@ +function SetTheme(color) + color = color or "rose-pine" + vim.cmd.colorscheme(color) + vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) + vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) +end + +SetTheme("nightfly") diff --git a/lua/absolute/after/lsp-config.lua b/lua/absolute/after/lsp-config.lua new file mode 100644 index 0000000..5cca81f --- /dev/null +++ b/lua/absolute/after/lsp-config.lua @@ -0,0 +1,150 @@ +-- Setup language servers. +local lspconfig = require('lspconfig') +local cmp_nvim_lsp = require("cmp_nvim_lsp") + +local opts = { noremap = true, silent = true } +local on_attach = function(client, bufnr) + opts.buffer = bufnr + + -- Enable completion triggered by + -- vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' + + + opts.desc = "Go to declaration" + vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) + + opts.desc = "Go to definitions" + vim.keymap.set('n', 'gd', "Telescope lsp_definitions", opts) + + opts.desc = "Show documentation for what is under cursor" + vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) + + opts.desc = "Show LSP Implementation" + vim.keymap.set('n', 'gi', "Telescope lsp_implementations", opts) + + opts.desc = "Get Help" + vim.keymap.set('n', '', vim.lsp.buf.signature_help, opts) + + -- vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, opts) + -- vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, opts) + -- vim.keymap.set('n', 'wl', function() + -- print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + -- end, opts) + + opts.desc = "Show LSP type definitions" + vim.keymap.set('n', 'gt', "Telescope lsp_type_definitions", opts) + + opts.desc = "Smart rename" + vim.keymap.set('n', 'rn', vim.lsp.buf.rename, opts) + + opts.desc = "See available code actions" + vim.keymap.set({ 'n', 'v' }, 'vca', vim.lsp.buf.code_action, opts) + + opts.desc = "Show LSP references" + vim.keymap.set('n', 'vrr', "Telescope lsp_references", opts) + + opts.desc = "Format File" + vim.keymap.set('n', 'f', function() + vim.lsp.buf.format { async = true } + end, opts) + + opts.desc = "Restart LSP" + vim.keymap.set("n", "rs", "LspRestart", opts) +end + +local capabilities = cmp_nvim_lsp.default_capabilities() + +-- Change the Diagnostic symbols in the sign column (gutter) +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 = "" }) +end + + +-- configure html server +lspconfig["html"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +-- configure typescript server with plugin +lspconfig["tsserver"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +-- configure css server +lspconfig["cssls"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +-- configure tailwindcss server +lspconfig["tailwindcss"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +-- configure svelte server +lspconfig["svelte"].setup({ + capabilities = capabilities, + on_attach = function(client, bufnr) + on_attach(client, bufnr) + + vim.api.nvim_create_autocmd("BufWritePost", { + pattern = { "*.js", "*.ts" }, + callback = function(ctx) + if client.name == "svelte" then + client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.file }) + end + end, + }) + end, +}) + + +-- configure emmet language server +lspconfig["emmet_ls"].setup({ + capabilities = capabilities, + on_attach = on_attach, + filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "svelte" }, +}) + +-- configure python server +lspconfig["pyright"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +lspconfig.rust_analyzer.setup({ + -- Server-specific settings. See `:help lspconfig-setup` + on_attach = on_attach, + capabilities = capabilities, + settings = { + ['rust-analyzer'] = {}, + }, +}) + + + +-- configure lua server (with special settings) +lspconfig["lua_ls"].setup({ + capabilities = capabilities, + on_attach = on_attach, + settings = { -- custom settings for lua + Lua = { + -- make the language server recognize "vim" global + diagnostics = { + globals = { "vim" }, + }, + workspace = { + -- make language server aware of runtime files + library = { + [vim.fn.expand("$VIMRUNTIME/lua")] = true, + [vim.fn.stdpath("config") .. "/lua"] = true, + }, + }, + }, + }, +}) diff --git a/lua/absolute/after/lsp-zero.lua b/lua/absolute/after/lsp-zero.lua deleted file mode 100644 index 6222d62..0000000 --- a/lua/absolute/after/lsp-zero.lua +++ /dev/null @@ -1,51 +0,0 @@ -local lsp = require('lsp-zero') - - -require("mason").setup(); -require("mason-lspconfig").setup({ - ensure_installed = { - "tsserver", - "eslint", - "rust_analyzer" - }, -}) - - -lsp.preset("recommended") - - -local cmp = require("cmp") -local cmp_select = {behavior = cmp.SelectBehavior.Select} -local cmp_mappings = lsp.defaults.cmp_mappings({ - [""] = cmp.mapping.select_prev_item(cmp_select), - [""] = cmp.mapping.select_next_item(cmp_select), - [""] = cmp.mapping.confirm({select = true}), - [""] = cmp.mapping.complete(), -}) - - - -lsp.set_preferences({ - sign_icons = { } -}) - - -lsp.on_attach(function(client, bufnr) - local opts = {buffer = bufnr, remap = false} - - vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) - vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) - vim.keymap.set("n", "vws", function() vim.lsp.buf.workspace_symbol() end, opts) - vim.keymap.set("n", "vd", function() vim.lsp.buf.open_float() end, opts) - vim.keymap.set("n", "[d", function() vim.lsp.buf.goto_next() end, opts) - vim.keymap.set("n", "]d", function() vim.lsp.buf.goto_prev() end, opts) - vim.keymap.set("n", "vca", function() vim.lsp.buf.code_action() end, opts) - vim.keymap.set("n", "vrr", function() vim.lsp.buf.references() end, opts) - vim.keymap.set("n", "vrn", function() vim.lsp.buf.rename() end, opts) - vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, opts) - - -end) - - -lsp.setup() diff --git a/lua/absolute/after/lualine.lua b/lua/absolute/after/lualine.lua new file mode 100644 index 0000000..b50db42 --- /dev/null +++ b/lua/absolute/after/lualine.lua @@ -0,0 +1,65 @@ +local lualine = require("lualine") +local lazy_status = require("lazy.status") -- to configure lazy pending updates count + +local colors = { + blue = "#65D1FF", + green = "#3EFFDC", + violet = "#FF61EF", + yellow = "#FFDA7B", + red = "#FF4A4A", + fg = "#c3ccdc", + bg = "#112638", + inactive_bg = "#2c3043", +} + +local my_lualine_theme = { + normal = { + a = { bg = colors.blue, fg = colors.bg, gui = "bold" }, + b = { bg = colors.bg, fg = colors.fg }, + c = { bg = colors.bg, fg = colors.fg }, + }, + insert = { + a = { bg = colors.green, fg = colors.bg, gui = "bold" }, + b = { bg = colors.bg, fg = colors.fg }, + c = { bg = colors.bg, fg = colors.fg }, + }, + visual = { + a = { bg = colors.violet, fg = colors.bg, gui = "bold" }, + b = { bg = colors.bg, fg = colors.fg }, + c = { bg = colors.bg, fg = colors.fg }, + }, + command = { + a = { bg = colors.yellow, fg = colors.bg, gui = "bold" }, + b = { bg = colors.bg, fg = colors.fg }, + c = { bg = colors.bg, fg = colors.fg }, + }, + replace = { + a = { bg = colors.red, fg = colors.bg, gui = "bold" }, + b = { bg = colors.bg, fg = colors.fg }, + c = { bg = colors.bg, fg = colors.fg }, + }, + inactive = { + a = { bg = colors.inactive_bg, fg = colors.semilightgray, gui = "bold" }, + b = { bg = colors.inactive_bg, fg = colors.semilightgray }, + c = { bg = colors.inactive_bg, fg = colors.semilightgray }, + }, +} + +-- configure lualine with modified theme +lualine.setup({ + options = { + theme = my_lualine_theme, + }, + sections = { + lualine_x = { + { + lazy_status.updates, + cond = lazy_status.has_updates, + color = { fg = "#ff9e64" }, + }, + { "encoding" }, + { "fileformat" }, + { "filetype" }, + }, + }, +}) diff --git a/lua/absolute/after/mason.lua b/lua/absolute/after/mason.lua new file mode 100644 index 0000000..b9c71b4 --- /dev/null +++ b/lua/absolute/after/mason.lua @@ -0,0 +1,16 @@ +require("mason").setup(); +require("mason-lspconfig").setup({ + ensure_installed = { + "tsserver", + "eslint", + "rust_analyzer", + "html", + "emmet_ls", + "lua_ls", + "tailwindcss", + "svelte", + "cssls", + "pyright" + }, + automatic_installation = true, +}) diff --git a/lua/absolute/after/mini.lua b/lua/absolute/after/mini.lua new file mode 100644 index 0000000..a3a789c --- /dev/null +++ b/lua/absolute/after/mini.lua @@ -0,0 +1,11 @@ +local map = require("mini.map") +require("mini.map").setup({ + integrations = { + map.gen_integration.builtin_search(), + map.gen_integration.gitsigns(), + map.gen_integration.diagnostic() + }, +}) + +vim.keymap.set("n", "mc", map.close) +vim.keymap.set("n", "mo", map.open) diff --git a/lua/absolute/after/nvim-cmp.lua b/lua/absolute/after/nvim-cmp.lua index a4be42f..d262b91 100644 --- a/lua/absolute/after/nvim-cmp.lua +++ b/lua/absolute/after/nvim-cmp.lua @@ -2,31 +2,35 @@ local cmp = require("cmp") local luasnip = require("luasnip") local lspkind = require("lspkind") - -- loads vscode style snippets from installed plugins (e.g. friendly-snippets) +-- loads vscode style snippets from installed plugins (e.g. friendly-snippets) require("luasnip.loaders.from_vscode").lazy_load() + cmp.setup({ - completion = { completeopt = "menu,menuone,preview,noselect", - }, - snippet = { -- configure how nvim-cmp interacts with snippet engine + }, + snippet = { -- configure how nvim-cmp interacts with snippet engine expand = function(args) - luasnip.lsp_expand(args.body) + luasnip.lsp_expand(args.body) end, - }, - -- sources for autocompletion - sources = cmp.config.sources({ + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.complete(), -- show completion suggestions + [""] = cmp.mapping.confirm({ select = false }) -- accept current selection + }), + -- sources for autocompletion + sources = cmp.config.sources({ { name = "nvim_lsp" }, { name = "luasnip" }, -- snippets - { name = "buffer" }, -- text within current buffer - { name = "path" }, -- file system paths - }), - -- configure lspkind for vs-code like pictograms in completion menu - formatting = { + { name = "buffer" }, -- text within current buffer + { name = "path" }, -- file system paths + }), + -- configure lspkind for vs-code like pictograms in completion menu + formatting = { format = lspkind.cmp_format({ - maxwidth = 50, - ellipsis_char = "...", + maxwidth = 50, + ellipsis_char = "...", }), - }, - }) + }, +}) diff --git a/lua/absolute/after/nvim-tree.lua b/lua/absolute/after/nvim-tree.lua index 8c5d34a..1fb53a2 100644 --- a/lua/absolute/after/nvim-tree.lua +++ b/lua/absolute/after/nvim-tree.lua @@ -20,28 +20,28 @@ nvimtree.setup({ icons = { glyphs = { - folder = { - arrow_closed = "", -- arrow when folder is closed - arrow_open = "", -- arrow when folder is open + folder = { + arrow_closed = "", -- arrow when folder is closed + arrow_open = "", -- arrow when folder is open } } } }, -- disable window_picker for - -- explorer to work well with - -- window splits - actions = { - open_file = { - window_picker = { + -- explorer to work well with + -- window splits + actions = { + open_file = { + window_picker = { enable = false, + }, }, - }, - }, + }, filters = { custom = { ".DS_Store" }, - }, + }, git = { ignore = false, } - }) +}) diff --git a/lua/absolute/after/nvim-treesitter.lua b/lua/absolute/after/nvim-treesitter.lua index 6cb18c8..02e04ed 100644 --- a/lua/absolute/after/nvim-treesitter.lua +++ b/lua/absolute/after/nvim-treesitter.lua @@ -1,22 +1,22 @@ -require'nvim-treesitter.configs'.setup { - -- A list of parser names, or "all" (the five listed parsers should always be installed) - ensure_installed = {"rust", "javascript", "typescript", "python", "c", "lua", "vim", "vimdoc", "query" }, +require 'nvim-treesitter.configs'.setup { + -- A list of parser names, or "all" (the five listed parsers should always be installed) + ensure_installed = { "rust", "javascript", "typescript", "python", "c", "lua", "vim", "vimdoc", "query" }, - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = false, + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, - -- Automatically install missing parsers when entering buffer - -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally - auto_install = true, + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = true, - ---- If you need to change the installation directory of the parsers (see -> Advanced Setup) - -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")! + ---- If you need to change the installation directory of the parsers (see -> Advanced Setup) + -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")! - highlight = { - enable = true, - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = false, - }, + highlight = { + enable = true, + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = false, + }, } diff --git a/lua/absolute/after/rose-pine.lua b/lua/absolute/after/rose-pine.lua deleted file mode 100644 index 759fcc5..0000000 --- a/lua/absolute/after/rose-pine.lua +++ /dev/null @@ -1,4 +0,0 @@ -vim.cmd.colorscheme("rose-pine") -vim.api.nvim_set_hl(0, "Normal", {bg = "none"}) -vim.api.nvim_set_hl(0, "NormalFloat", {bg = "none"}) - diff --git a/lua/absolute/after/telescope.lua b/lua/absolute/after/telescope.lua index dcbf0cf..923de28 100644 --- a/lua/absolute/after/telescope.lua +++ b/lua/absolute/after/telescope.lua @@ -1,6 +1,11 @@ +local telescope = require("telescope") local builtin = require('telescope.builtin') -vim.keymap.set('n', 'pf', builtin.find_files, {}) -vim.keymap.set('n', '', builtin.git_files, {}) + +telescope.setup {} + +vim.keymap.set("n", 'pf', builtin.find_files, { desc = "Fuzzy find files in cwd" }) +vim.keymap.set("n", 'pr', builtin.oldfiles, { desc = "Fuzzy find recent files" }) +vim.keymap.set("n", '', builtin.git_files, { desc = "Fuzzy find files in git in cwd" }) vim.keymap.set('n', 'ps', function() - builtin.grep_string({search = vim.fn.input("Grep > ") }); -end) + builtin.grep_string({ search = vim.fn.input("Grep > ") }); +end, { desc = "Find string under cursor in cwd" }) diff --git a/lua/absolute/lazy.lua b/lua/absolute/lazy.lua index 28637ac..46c1f3e 100644 --- a/lua/absolute/lazy.lua +++ b/lua/absolute/lazy.lua @@ -1,14 +1,29 @@ 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("absolute.plugins") +require("lazy").setup({ + { import = "absolute.plugins" } +}, { + install = { + colorscheme = { "nightfly" }, + }, + checker = { + enabled = true, + notify = false, + }, + change_detection = { + notify = false + } +}) + +require("absolute.after.colorscheme"); diff --git a/lua/absolute/plugins/bufferline.lua b/lua/absolute/plugins/bufferline.lua new file mode 100644 index 0000000..4ff64ec --- /dev/null +++ b/lua/absolute/plugins/bufferline.lua @@ -0,0 +1,8 @@ +return { + "akinsho/bufferline.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + version = "*", + config = function() + require("absolute.after.bufferline") + end +} diff --git a/lua/absolute/plugins/comment.lua b/lua/absolute/plugins/comment.lua new file mode 100644 index 0000000..48eb2ed --- /dev/null +++ b/lua/absolute/plugins/comment.lua @@ -0,0 +1,5 @@ +return { + "numToStr/Comment.nvim", + event = { "BufReadPre", "BufNewFile" }, + config = true +} diff --git a/lua/absolute/plugins/dressing.lua b/lua/absolute/plugins/dressing.lua new file mode 100644 index 0000000..67724e2 --- /dev/null +++ b/lua/absolute/plugins/dressing.lua @@ -0,0 +1,4 @@ +return { + "stevearc/dressing.nvim", + event = "VeryLazy" +} diff --git a/lua/absolute/plugins/harpoon.lua b/lua/absolute/plugins/harpoon.lua index ca7577b..6d48b26 100644 --- a/lua/absolute/plugins/harpoon.lua +++ b/lua/absolute/plugins/harpoon.lua @@ -1,7 +1,7 @@ return { - "theprimeagen/harpoon", - dependencies = { 'nvim-lua/plenary.nvim' }, - config = function() - require("absolute.after.harpoon") - end + "theprimeagen/harpoon", + dependencies = { 'nvim-lua/plenary.nvim' }, + config = function() + require("absolute.after.harpoon") + end } diff --git a/lua/absolute/plugins/lsp-config.lua b/lua/absolute/plugins/lsp-config.lua new file mode 100644 index 0000000..19e3515 --- /dev/null +++ b/lua/absolute/plugins/lsp-config.lua @@ -0,0 +1,11 @@ +return { + "neovim/nvim-lspconfig", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + { "hrsh7th/cmp-nvim-lsp", name = "nvim_lsp" }, + { "antosha417/nvim-lsp-file-operations", config = true }, + }, + config = function() + require("absolute.after.lsp-config") + end +} diff --git a/lua/absolute/plugins/lsp-zero.lua b/lua/absolute/plugins/lsp-zero.lua deleted file mode 100644 index 8900e5c..0000000 --- a/lua/absolute/plugins/lsp-zero.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - - 'VonHeikemen/lsp-zero.nvim', branch = 'v3.x', - dependencies = { - 'williamboman/mason.nvim', - 'williamboman/mason-lspconfig.nvim', - 'neovim/nvim-lspconfig', - 'hrsh7th/cmp-nvim-lsp', - 'hrsh7th/nvim-cmp', - 'L3MON4D3/LuaSnip', - }, - config = function() - require("absolute.after.lsp-zero") - end -} diff --git a/lua/absolute/plugins/lualine.lua b/lua/absolute/plugins/lualine.lua new file mode 100644 index 0000000..d91f5b2 --- /dev/null +++ b/lua/absolute/plugins/lualine.lua @@ -0,0 +1,7 @@ +return { + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function() + require("absolute.after.lualine") + end +} diff --git a/lua/absolute/plugins/mason.lua b/lua/absolute/plugins/mason.lua new file mode 100644 index 0000000..8351d8b --- /dev/null +++ b/lua/absolute/plugins/mason.lua @@ -0,0 +1,10 @@ +return { + 'williamboman/mason.nvim', + dependencies = { + 'williamboman/mason-lspconfig.nvim', + }, + config = function() + require("absolute.after.mason") + end + +} diff --git a/lua/absolute/plugins/mini.lua b/lua/absolute/plugins/mini.lua new file mode 100644 index 0000000..dbd7461 --- /dev/null +++ b/lua/absolute/plugins/mini.lua @@ -0,0 +1,7 @@ +return { + "echasnovski/mini.nvim", + version = "*", -- Stable Version + config = function() + require("absolute.after.mini") + end +} diff --git a/lua/absolute/plugins/nightfly.lua b/lua/absolute/plugins/nightfly.lua new file mode 100644 index 0000000..d633705 --- /dev/null +++ b/lua/absolute/plugins/nightfly.lua @@ -0,0 +1,5 @@ +return { + "bluz71/vim-nightfly-colors", + name = "nightfly", + lazy = false, +} diff --git a/lua/absolute/plugins/nvim-cmp.lua b/lua/absolute/plugins/nvim-cmp.lua index e689604..9b91dae 100644 --- a/lua/absolute/plugins/nvim-cmp.lua +++ b/lua/absolute/plugins/nvim-cmp.lua @@ -4,14 +4,15 @@ return { dependencies = { 'neovim/nvim-lspconfig', 'hrsh7th/cmp-nvim-lsp', - 'hrsh7th/cmp-buffer', - 'hrsh7th/cmp-path', + 'hrsh7th/cmp-buffer', --source for text in buffer + 'hrsh7th/cmp-path', --source for file system paths 'hrsh7th/cmp-cmdline', - "saadparwaiz1/cmp_luasnip", + "saadparwaiz1/cmp_luasnip", --source for autocompletion "onsails/lspkind.nvim", + "L3MON4D3/LuaSnip", --Snippet Engine + "rafamadriz/friendly-snippets", --Useful snippets }, config = function() require("absolute.after.nvim-cmp") - end } diff --git a/lua/absolute/plugins/nvim-tree.lua b/lua/absolute/plugins/nvim-tree.lua index df5197e..2f835db 100644 --- a/lua/absolute/plugins/nvim-tree.lua +++ b/lua/absolute/plugins/nvim-tree.lua @@ -1,6 +1,6 @@ return { "nvim-tree/nvim-tree.lua", - dependencies = {"nvim-tree/nvim-web-devicons"}, + dependencies = { "nvim-tree/nvim-web-devicons" }, config = function() require("absolute.after.nvim-tree"); end diff --git a/lua/absolute/plugins/nvim-treesitter-playground.lua b/lua/absolute/plugins/nvim-treesitter-playground.lua index 8598bcd..819aed7 100644 --- a/lua/absolute/plugins/nvim-treesitter-playground.lua +++ b/lua/absolute/plugins/nvim-treesitter-playground.lua @@ -1,6 +1,3 @@ return { - "nvim-treesitter/playground", - - - + "nvim-treesitter/playground", } diff --git a/lua/absolute/plugins/nvim-treesitter.lua b/lua/absolute/plugins/nvim-treesitter.lua index ee50c9f..38b8814 100644 --- a/lua/absolute/plugins/nvim-treesitter.lua +++ b/lua/absolute/plugins/nvim-treesitter.lua @@ -1,7 +1,7 @@ return { - "nvim-treesitter/nvim-treesitter", - config = function() - vim.cmd([[:TSUpdate]]) - require("absolute.after.nvim-treesitter") - end + "nvim-treesitter/nvim-treesitter", + config = function() + vim.cmd([[:TSUpdate]]) + require("absolute.after.nvim-treesitter") + end } diff --git a/lua/absolute/plugins/rose-pine.lua b/lua/absolute/plugins/rose-pine.lua index 80c4687..e50e15d 100644 --- a/lua/absolute/plugins/rose-pine.lua +++ b/lua/absolute/plugins/rose-pine.lua @@ -1,7 +1,4 @@ - return { +return { 'rose-pine/neovim', name = 'rose-pine', - config = function() - require("absolute.after.rose-pine") - end } diff --git a/lua/absolute/plugins/telescope.lua b/lua/absolute/plugins/telescope.lua index 2f2050f..f877d29 100644 --- a/lua/absolute/plugins/telescope.lua +++ b/lua/absolute/plugins/telescope.lua @@ -1,16 +1,11 @@ return { - 'nvim-telescope/telescope.nvim', tag = '0.1.5', - dependencies = { 'nvim-lua/plenary.nvim'}, - requires = { - { - "nvim-telescope/telescope-fzf-native.nvim", - run = "make" - }, - { - "nvim-telescope/telescope-dap.nvim" - } - }, - config = function() - require("absolute.after.telescope") - end - } + 'nvim-telescope/telescope.nvim', + branch = '0.1.x', + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope-dap.nvim", + }, + config = function() + require("absolute.after.telescope") + end +} diff --git a/lua/absolute/plugins/undotree.lua b/lua/absolute/plugins/undotree.lua index ba42d34..d110485 100644 --- a/lua/absolute/plugins/undotree.lua +++ b/lua/absolute/plugins/undotree.lua @@ -1,6 +1,6 @@ return { - "mbbill/undotree", - config = function() - require("absolute.after.undotree") - end + "mbbill/undotree", + config = function() + require("absolute.after.undotree") + end } diff --git a/lua/absolute/plugins/vim-fugitive.lua b/lua/absolute/plugins/vim-fugitive.lua index c7e8412..46adf87 100644 --- a/lua/absolute/plugins/vim-fugitive.lua +++ b/lua/absolute/plugins/vim-fugitive.lua @@ -1,7 +1,7 @@ return { - "tpope/vim-fugitive", - config = function() - require("absolute.after.vim-fugitive") - end - + "tpope/vim-fugitive", + config = function() + require("absolute.after.vim-fugitive") + end + } diff --git a/lua/absolute/plugins/vim-maximizer.lua b/lua/absolute/plugins/vim-maximizer.lua new file mode 100644 index 0000000..b38ad89 --- /dev/null +++ b/lua/absolute/plugins/vim-maximizer.lua @@ -0,0 +1,3 @@ +return { + "szw/vim-maximizer" +} diff --git a/lua/absolute/plugins/vim-tmux-navigator.lua b/lua/absolute/plugins/vim-tmux-navigator.lua index ad47dd0..b88d5bb 100644 --- a/lua/absolute/plugins/vim-tmux-navigator.lua +++ b/lua/absolute/plugins/vim-tmux-navigator.lua @@ -1,17 +1,17 @@ return { "christoomey/vim-tmux-navigator", - cmd = { - "TmuxNavigateLeft", - "TmuxNavigateDown", - "TmuxNavigateUp", - "TmuxNavigateRight", - "TmuxNavigatePrevious", - }, - keys = { - { "", "TmuxNavigateLeft" }, - { "", "TmuxNavigateDown" }, - { "", "TmuxNavigateUp" }, - { "", "TmuxNavigateRight" }, - { "", "TmuxNavigatePrevious" }, - }, - } + cmd = { + "TmuxNavigateLeft", + "TmuxNavigateDown", + "TmuxNavigateUp", + "TmuxNavigateRight", + "TmuxNavigatePrevious", + }, + keys = { + { "", "TmuxNavigateLeft" }, + { "", "TmuxNavigateDown" }, + { "", "TmuxNavigateUp" }, + { "", "TmuxNavigateRight" }, + { "", "TmuxNavigatePrevious" }, + }, +} diff --git a/lua/absolute/remap.lua b/lua/absolute/remap.lua index 2965921..e85dd68 100644 --- a/lua/absolute/remap.lua +++ b/lua/absolute/remap.lua @@ -13,23 +13,38 @@ vim.keymap.set("n", "N", "Nzzzv") vim.keymap.set("x", "p", [["_dP]]) -vim.keymap.set({"n", "v"}, "y", [["+y]]) +vim.keymap.set({ "n", "v" }, "y", [["+y]]) vim.keymap.set("n", "Y", [["+Y]]) -vim.keymap.set({"n", "v"}, "d", [["_d]]) +vim.keymap.set({ "n", "v" }, "d", [["_d]]) + +-- Alternate Escape (Easy to Reach) vim.keymap.set("i", "", "") + +-- Disable Q - Nothing Good Ever Happens vim.keymap.set("n", "Q", "") + +-- Format document with LSP Formatter vim.keymap.set("n", "f", vim.lsp.buf.format) +-- Navigation Quick Fixes + vim.keymap.set("n", "", "cnextzz") vim.keymap.set("n", "", "cprevzz") vim.keymap.set("n", "k", "lnextzz") vim.keymap.set("n", "j", "lprevzz") + +-- Search Regex Keymap vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) + +-- Source File Keymap vim.keymap.set("n", "", function() vim.cmd("so") end) + +-- Manage VIM Maximizer +vim.keymap.set("n", "sm", "MaximizerToggle")