From 89934e9c95d95becfe8dc34e5900a1d0b296868b Mon Sep 17 00:00:00 2001 From: Steven Medeiros Melo <63684299+stevenmelo588@users.noreply.github.com> Date: Tue, 8 Apr 2025 15:10:24 -0400 Subject: [PATCH] Added Formatters --- lazy-lock.json | 49 ++--- lua/stevenmm/init.lua | 75 +++---- lua/stevenmm/lazy/_laravel_nvim.lua | 4 +- lua/stevenmm/lazy/cmp.lua | 175 +++++++++-------- lua/stevenmm/lazy/colorful_winsep.lua | 26 +-- lua/stevenmm/lazy/colors.lua | 46 ++--- lua/stevenmm/lazy/commentstring.lua | 12 +- lua/stevenmm/lazy/emoji.lua | 2 +- lua/stevenmm/lazy/formatting.lua | 42 ++++ lua/stevenmm/lazy/git-integrations.lua | 13 ++ lua/stevenmm/lazy/harpoon.lua | 49 +++-- lua/stevenmm/lazy/init.lua | 14 +- lua/stevenmm/lazy/jest.lua | 10 + lua/stevenmm/lazy/lazydev.lua | 19 ++ lua/stevenmm/lazy/lsp.lua | 117 ++++++----- lua/stevenmm/lazy/lualine.lua | 262 ++++++++++++------------- lua/stevenmm/lazy/mason.lua | 139 +++++++------ lua/stevenmm/lazy/minicomment.lua | 22 +-- lua/stevenmm/lazy/miniindentscope.lua | 10 +- lua/stevenmm/lazy/minimove.lua | 10 +- lua/stevenmm/lazy/minipairs.lua | 10 +- lua/stevenmm/lazy/minisurround.lua | 10 +- lua/stevenmm/lazy/nvim-autopairs.lua | 6 +- lua/stevenmm/lazy/nvimtree.lua | 46 ++--- lua/stevenmm/lazy/prettier.lua | 7 - lua/stevenmm/lazy/telescope.lua | 10 +- lua/stevenmm/lazy_init.lua | 8 +- lua/stevenmm/remap.lua | 30 ++- lua/stevenmm/set.lua | 33 +++- 29 files changed, 729 insertions(+), 527 deletions(-) create mode 100644 lua/stevenmm/lazy/formatting.lua create mode 100644 lua/stevenmm/lazy/git-integrations.lua create mode 100644 lua/stevenmm/lazy/jest.lua create mode 100644 lua/stevenmm/lazy/lazydev.lua delete mode 100644 lua/stevenmm/lazy/prettier.lua diff --git a/lazy-lock.json b/lazy-lock.json index 039a553..09e21dd 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,41 +1,46 @@ { "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, + "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "colorful-winsep.nvim": { "branch": "alpha", "commit": "0070484536ea55ec64a8453d41e3badace04a61a" }, "emoji.nvim": { "branch": "main", "commit": "5c68359b56d2470583832b6b2b559566c5b39dc8" }, "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, - "fzf-lua": { "branch": "main", "commit": "9b84b53f3297d4912d7eb95b979e9b27e2e61281" }, + "fzf-lua": { "branch": "main", "commit": "6488ada2f376e47789391dc353b6d91a3f9de6f6" }, + "gitsigns.nvim": { "branch": "main", "commit": "3c76f7fabac723aa682365ef782f88a83ccdb4ac" }, "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, - "lazy.nvim": { "branch": "main", "commit": "e5e9bf48211a13d9ee6c1077c88327c49c1ab4a0" }, + "jest.nvim": { "branch": "master", "commit": "1ec13b863512f3673116986e6d27dc49bc17b829" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, "lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" }, - "lualine.nvim": { "branch": "master", "commit": "f4f791f67e70d378a754d02da068231d2352e5bc" }, + "lualine.nvim": { "branch": "master", "commit": "1517caa8fff05e4b4999857319d3b0609a7f57fa" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, + "mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" }, "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, - "mini.comment": { "branch": "main", "commit": "264b8a63edd5a9a41d5361a1d52c13131c3c51a2" }, - "mini.indentscope": { "branch": "main", "commit": "8ce41a77eed7f4121c83c67fda5e2e86af999e6d" }, - "mini.move": { "branch": "main", "commit": "c8b30e92dd2668dd6e56a9a23cb7d4ee38c2266d" }, - "mini.pairs": { "branch": "main", "commit": "1a3e73649c0eaef2f6c48ce1e761c6f0a7c11918" }, - "mini.surround": { "branch": "main", "commit": "f90069c7441a5fb04c3de42eacf93e16b64dd3eb" }, - "nvim-autopairs": { "branch": "master", "commit": "68f0e5c3dab23261a945272032ee6700af86227a" }, - "nvim-cmp": { "branch": "main", "commit": "12509903a5723a876abd65953109f926f4634c30" }, - "nvim-lspconfig": { "branch": "master", "commit": "6b63bdf2399b9bedf93297d98419550523a9ad68" }, - "nvim-svelte-snippets": { "branch": "main", "commit": "0b8ceaebd528e52656303ddf66c584e9b67a52ba" }, - "nvim-tree.lua": { "branch": "master", "commit": "6709463b2d18e77f7a946027917aa00d4aaed6f4" }, - "nvim-treesitter": { "branch": "master", "commit": "5774e7d3da4f681296a87fcd85d17779ad362a4f" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, + "mini.comment": { "branch": "main", "commit": "fb867a9246f9b892cf51a8c84a3f8479cdf1558c" }, + "mini.indentscope": { "branch": "main", "commit": "8af2569a7d7fd37300dfa760e44e71efbbf322fd" }, + "mini.move": { "branch": "main", "commit": "4fe4a855fee53c66b0f3255a4b54ddc2ae6b308c" }, + "mini.pairs": { "branch": "main", "commit": "69864a2efb36c030877421634487fd90db1e4298" }, + "mini.surround": { "branch": "main", "commit": "5aab42fcdcf31fa010f012771eda5631c077840a" }, + "none-ls.nvim": { "branch": "main", "commit": "a117163db44c256d53c3be8717f3e1a2a28e6299" }, + "nvim-autopairs": { "branch": "master", "commit": "84a81a7d1f28b381b32acf1e8fe5ff5bef4f7968" }, + "nvim-cmp": { "branch": "main", "commit": "059e89495b3ec09395262f16b1ad441a38081d04" }, + "nvim-lspconfig": { "branch": "master", "commit": "40f120c10ea4b87311175539a183c3b75eab95a3" }, + "nvim-svelte-snippets": { "branch": "main", "commit": "1afae9e05c8488d4cc956c0ddaf127844816ce5f" }, + "nvim-tree.lua": { "branch": "master", "commit": "44d9b58f11d5a426c297aafd0be1c9d45617a849" }, + "nvim-treesitter": { "branch": "master", "commit": "30654ee72a69e7c76a54b66d748dae088429e863" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "9937e5e356e5b227ec56d83d0a9d0a0f6bc9cad4" }, "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, - "nvim-web-devicons": { "branch": "master", "commit": "1020869742ecb191f260818234517f4a1515cfe8" }, + "nvim-web-devicons": { "branch": "master", "commit": "4c3a5848ee0b09ecdea73adcd2a689190aeb728c" }, "plenary": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "telescope-file-browser.nvim": { "branch": "master", "commit": "626998e5c1b71c130d8bc6cf7abb6709b98287bb" }, - "telescope.nvim": { "branch": "master", "commit": "78857db9e8d819d3cc1a9a7bdc1d39d127a36495" }, - "vim-prettier": { "branch": "master", "commit": "7dbdbb12c50a9f4ba72390cce2846248e4368fd0" }, - "vscode": { "branch": "main", "commit": "298c5ce4750a256ea208b72d7a472b8824ef2a49" }, + "telescope.nvim": { "branch": "master", "commit": "a4ed82509cecc56df1c7138920a1aeaf246c0ac5" }, + "vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" }, + "vscode": { "branch": "main", "commit": "49d6014ba151fc6cc585b8d5f057ca7839077bf8" }, "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }, "winbar.nvim": { "branch": "main", "commit": "13739fdb31be51a1000486189662596f07a59a31" } } diff --git a/lua/stevenmm/init.lua b/lua/stevenmm/init.lua index 1bdb75a..da90270 100644 --- a/lua/stevenmm/init.lua +++ b/lua/stevenmm/init.lua @@ -4,55 +4,62 @@ require("stevenmm.remap") require("stevenmm.lazy_init") local augroup = vim.api.nvim_create_augroup -local StevenmmGroup = augroup('Stevenmm', {}) +local StevenmmGroup = augroup("Stevenmm", {}) local autocmd = vim.api.nvim_create_autocmd -local yank_group = augroup('HighlightYank', {}) +local yank_group = augroup("HighlightYank", {}) function R(name) - require("plenary.reload").reload_module(name) + require("plenary.reload").reload_module(name) end vim.filetype.add({ - extension = { - templ = 'templ', - } + extension = { + templ = "templ", + }, }) -autocmd('TextYankPost', { - group = yank_group, - pattern = '*', - callback = function () - vim.highlight.on_yank({ - higroup = 'IncSearch', - timeout = 40, - }) - end, +autocmd("TextYankPost", { + group = yank_group, + pattern = "*", + callback = function() + vim.highlight.on_yank({ + higroup = "IncSearch", + timeout = 40, + }) + end, }) -autocmd({"BufWritePre"}, { - group = StevenmmGroup, - pattern = "*", - command = [[%s/\s\+$//e]], +autocmd({ "BufWritePre" }, { + group = StevenmmGroup, + pattern = "*", + command = [[%s/\s\+$//e]], }) -autocmd('LspAttach', { - group = StevenmmGroup, - callback = function (e) - local opts = { buffer = e.buf } - 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.diagnostic.open_float() end, opts) - vim.keymap.set("n", "vca", function() vim.lsp.buf.code_action() end, opts) - vim.keymap.set("n", "vrr", function() vim.lsp.buf.reference() 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) - 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) - end +autocmd("LspAttach", { + group = StevenmmGroup, + callback = function(e) + local opts = { buffer = e.buf } + -- vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) + vim.keymap.set("n", "gd", ":lua vim.lsp.buf.definition()", 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.diagnostic.open_float() 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) + 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) + end, }) vim.g.netrw_browse_split = 0 vim.g.netrw_banner = 0 vim.g.netrw_winsize = 25 +vim.g.have_nerd_font = true +vim.g.lazydev_enabled = true + +vim.g.jest_command = "npx jest" +vim.g.jest_options = "--silent --coverage --no-cache" +vim.g.jest_run_watch = 1 diff --git a/lua/stevenmm/lazy/_laravel_nvim.lua b/lua/stevenmm/lazy/_laravel_nvim.lua index 291f883..7e39bbe 100644 --- a/lua/stevenmm/lazy/_laravel_nvim.lua +++ b/lua/stevenmm/lazy/_laravel_nvim.lua @@ -1,6 +1,4 @@ -return { - -} +return {} -- return { -- "adalessa/laravel.nvim", -- dependencies = { diff --git a/lua/stevenmm/lazy/cmp.lua b/lua/stevenmm/lazy/cmp.lua index d2a9bf9..91c994f 100644 --- a/lua/stevenmm/lazy/cmp.lua +++ b/lua/stevenmm/lazy/cmp.lua @@ -1,92 +1,105 @@ return { - "hrsh7th/nvim-cmp", + "hrsh7th/nvim-cmp", - dependencies = { - "windwp/nvim-autopairs", + dependencies = { + "windwp/nvim-autopairs", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", - "L3MON4D3/LuaSnip", - "saadparwaiz1/cmp_luasnip", - "onsails/lspkind.nvim", - }, + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", + "onsails/lspkind.nvim", + }, - config = function () - print("cmp.lua") - local cmp_autopairs = require("nvim-autopairs.completion.cmp") - local cmp = require('cmp') - local cmp_select = { behavior = cmp.SelectBehavior.Select } - local lspkind = require("lspkind") + -- opts = function(_, opts) + -- opts.sources = vim.tbl_filter(function(source) + -- return not vim.tbl_contains({ "buffer", "nvim_lsp" }, source.name) + -- end, opts.sources) + -- table.insert(opts.sources, 1, { + -- name = "nvim_lsp", + -- entry_filter = function(entry, _) + -- return require("cmp.types").lsp.CompletionItemKind[entry:get_kind()] ~= "Text" + -- end, + -- }) + -- end, - cmp.event:on( - 'confirm_done', - cmp_autopairs.on_confirm_done() - ) + config = function() + -- print("cmp.lua") + local cmp_autopairs = require("nvim-autopairs.completion.cmp") + local cmp = require("cmp") + local cmp_select = { behavior = cmp.SelectBehavior.Select } + local lspkind = require("lspkind") - cmp.setup({ - enabled = function() - -- disable completion in comments - local context = require('cmp.config.context') - -- keep command mode completion enabled when cursor is in a comment - if vim.api.nvim_get_mode().mode == 'c' then - return true - else - return not context.in_treesitter_capture("comment") and not context.in_syntax_group("Comment") - end - end, + cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) - formatting = { - format = lspkind.cmp_format({ - mode = 'symbol_text', - max_width = { - menu = 50, - abbr = 50, - }, - show_labelDetails = true - }), - }, + cmp.setup({ + enabled = function() + -- disable completion in comments + local context = require("cmp.config.context") + -- keep command mode completion enabled when cursor is in a comment + if vim.api.nvim_get_mode().mode == "c" then + return true + else + return not context.in_treesitter_capture("comment") and not context.in_syntax_group("Comment") + end + end, - -- preselect = { cmp.PreselectMode.Item }, - performance = { - max_view_entries = 10, - }, - snippet = { - expand = function(args) - require('luasnip').lsp_expand(args.body) -- For `luasnip` users. - -- require('nvim-svelte-snippets'). - end, - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.select_next_item(cmp_select), - [''] = cmp.mapping.select_prev_item(cmp_select), - [''] = cmp.mapping.select_next_item(cmp_select), - [''] = cmp.mapping.select_prev_item(cmp_select), - [''] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }), - [''] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }), - [''] = cmp.mapping.complete({ - config = { - sources = { - { name = 'luasnip' } - } - } - }), - [''] = cmp.mapping({ - i = cmp.mapping.abort(), - c = cmp.mapping.close(), - }), - --[''] = cmp.mapping.confirm({ select = true }), - [''] = cmp.mapping.confirm({ select = true }), - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - }, { - { name = 'buffer' }, - }), + formatting = { + format = lspkind.cmp_format({ + mode = "symbol_text", + max_width = { + menu = 50, + abbr = 50, + }, + show_labelDetails = true, + }), + }, - }) - end + -- preselect = { cmp.PreselectMode.Item }, + performance = { + max_view_entries = 10, + }, + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) -- For `luasnip` users. + -- require('nvim-svelte-snippets'). + end, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.select_next_item(cmp_select), + [""] = cmp.mapping.select_prev_item(cmp_select), + [""] = cmp.mapping.select_next_item(cmp_select), + [""] = cmp.mapping.select_prev_item(cmp_select), + [""] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }), + -- [''] = function () + -- vim.lsp.completion.get() + -- end,sV + -- cmp.mapping.complete(), + -- { + -- config = { + -- sources = { + -- { name = 'luasnip' } + -- } + -- } + -- }), + [""] = cmp.mapping({ + i = cmp.mapping.abort(), + c = cmp.mapping.close(), + }), + --[''] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping.confirm({ select = true }), + }), + + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, + }, { + { name = "buffer" }, + }), + }) + end, } diff --git a/lua/stevenmm/lazy/colorful_winsep.lua b/lua/stevenmm/lazy/colorful_winsep.lua index 7b9f895..10d575d 100644 --- a/lua/stevenmm/lazy/colorful_winsep.lua +++ b/lua/stevenmm/lazy/colorful_winsep.lua @@ -1,16 +1,16 @@ require("stevenmm.variables") return { - 'nvim-zh/colorful-winsep.nvim', - config = function () - local winsep = require("colorful-winsep") - local bg = require("vscode.colors").get_colors().vscBack - winsep.setup({ - highlight = { - fg = "#A066E8", - bg = bg, - }, - no_exec_files = EXCLUDED_FILETYPES_ARRAY, - symbols = { "─", "│", "╭", "╮", "╰", "╯" }, - }) - end + "nvim-zh/colorful-winsep.nvim", + config = function() + local winsep = require("colorful-winsep") + local bg = require("vscode.colors").get_colors().vscBack + winsep.setup({ + highlight = { + fg = "#A066E8", + bg = bg, + }, + no_exec_files = EXCLUDED_FILETYPES_ARRAY, + symbols = { "─", "│", "╭", "╮", "╰", "╯" }, + }) + end, } diff --git a/lua/stevenmm/lazy/colors.lua b/lua/stevenmm/lazy/colors.lua index 783fc82..cd83967 100644 --- a/lua/stevenmm/lazy/colors.lua +++ b/lua/stevenmm/lazy/colors.lua @@ -1,36 +1,36 @@ function ColorMyPencils(color) - -- color = color or "rose-pine-moon" - color = color or "vscode" - vim.cmd.colorscheme(color) + -- color = color or "rose-pine-moon" + color = color or "vscode" + vim.cmd.colorscheme(color) - vim.api.nvim_set_hl(0, "Normal", {bg = "none" }) - vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) + vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) + vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) end return { - { + { -- "rose-pine/neovim", "Mofiqul/vscode.nvim", -- name = "rose-pine", name = "vscode", - lazy = false, - prority = 1000, + lazy = false, + prority = 1000, config = function() - -- require("rose-pine").setup({ - require("vscode").setup({ - transparent = true, - italic_comments = true, - -- styles = { - -- bold = false, - -- italic = false, - -- transparency = true, - -- }, - -- disable_background = true, - }) + -- require("rose-pine").setup({ + require("vscode").setup({ + transparent = true, + italic_comments = true, + -- styles = { + -- bold = false, + -- italic = false, + -- transparency = true, + -- }, + -- disable_background = true, + }) - vim.cmd("colorscheme vscode") + vim.cmd("colorscheme vscode") - ColorMyPencils() - end - }, + ColorMyPencils() + end, + }, } diff --git a/lua/stevenmm/lazy/commentstring.lua b/lua/stevenmm/lazy/commentstring.lua index f8c524e..a5db8f5 100644 --- a/lua/stevenmm/lazy/commentstring.lua +++ b/lua/stevenmm/lazy/commentstring.lua @@ -1,8 +1,8 @@ return { - 'JoosepAlviste/nvim-ts-context-commentstring', - config = function () - require('ts_context_commentstring').setup({ - enable_autocmd = false, - }) - end + "JoosepAlviste/nvim-ts-context-commentstring", + config = function() + require("ts_context_commentstring").setup({ + enable_autocmd = false, + }) + end, } diff --git a/lua/stevenmm/lazy/emoji.lua b/lua/stevenmm/lazy/emoji.lua index 9b1f6a9..2c23a8d 100644 --- a/lua/stevenmm/lazy/emoji.lua +++ b/lua/stevenmm/lazy/emoji.lua @@ -1,7 +1,7 @@ return { "allaman/emoji.nvim", version = "1.0.0", -- optionally pin to a tag - ft = "markdown", -- adjust to your needs + ft = "markdown", -- adjust to your needs dependencies = { -- util for handling paths "nvim-lua/plenary.nvim", diff --git a/lua/stevenmm/lazy/formatting.lua b/lua/stevenmm/lazy/formatting.lua new file mode 100644 index 0000000..f978730 --- /dev/null +++ b/lua/stevenmm/lazy/formatting.lua @@ -0,0 +1,42 @@ +return { + "nvimtools/none-ls.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + }, + config = function() + local null_ls = require("null-ls") + + null_ls.setup({ + sources = { + null_ls.builtins.formatting.prettierd.with({ + filetypes = { + "javascript", + "javascriptreact", + "typescript", + "typescriptreact", + "css", + "html", + "json", + }, + }), + + null_ls.builtins.formatting.stylua.with({ + syntax = "All", + indent_type = "Tabs", + indent_width = 4, + quote_style = "AutoPreferDouble", + space_after_function_names = "Always", + collapse_simple_statement = "FunctionOnly", + }), + + -- require("none-ls.diagnostics.eslint"), + }, + on_attach = function(client, bufnr) + if client.supports_method("textDocument/formatting") then + -- vim.api.nvim_buf_set_option(bufnr, "formatexpr", "v:lua.vim.lsp.formatexpr()") + vim.api.nvim_set_option_value("formatexpr", "v:lua.vim.lsp.formatexpr()", { buf = bufnr }) + end + end, + }) + end, +} diff --git a/lua/stevenmm/lazy/git-integrations.lua b/lua/stevenmm/lazy/git-integrations.lua new file mode 100644 index 0000000..2220bfe --- /dev/null +++ b/lua/stevenmm/lazy/git-integrations.lua @@ -0,0 +1,13 @@ +return { + { + "tpope/vim-fugitive", + }, + { + "lewis6991/gitsigns.nvim", + config = function() + require("gitsigns").setup() + + -- vim.keymap + end, + }, +} diff --git a/lua/stevenmm/lazy/harpoon.lua b/lua/stevenmm/lazy/harpoon.lua index b906d38..8413a89 100644 --- a/lua/stevenmm/lazy/harpoon.lua +++ b/lua/stevenmm/lazy/harpoon.lua @@ -1,20 +1,39 @@ - return { - "ThePrimeagen/harpoon", - branch = "harpoon2", - -- dependencies = { - -- "nvim-lua/plenary.nvim" - -- }, + "ThePrimeagen/harpoon", + branch = "harpoon2", + dependencies = { + "nvim-lua/plenary.nvim", + }, - global_settings = { + -- global_settings = { + -- + -- }, - }, + config = function() + local harpoon = require("harpoon") - -- config = function () - -- local harpoon = require('harpoon') - -- harpoon:setup({}) - -- - -- -- vim.keymap.set("n", "a", function () harpoon:list():add() end) - -- - -- end + harpoon:setup() + + vim.keymap.set("n", "a", function() harpoon:list():add() end) + vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) + + vim.keymap.set("n", "", function() harpoon:list():select(1) end) + vim.keymap.set("n", "", function() harpoon:list():select(2) end) + vim.keymap.set("n", "", function() harpoon:list():select(3) end) + vim.keymap.set("n", "", function() harpoon:list():select(4) end) + + vim.keymap.set("n", "", function() harpoon:list():prev() end) + vim.keymap.set("n", "", function() harpoon:list():next() end) + + -- vim.keymap.set("n", "a", ":lua harpoon:list():add()") + -- vim.keymap.set("n", "", ":lua harpoon.ui:toggle_quick_menu(harpoon:list())") + -- + -- vim.keymap.set("n", "", "harpoon:list():select(1)") + -- vim.keymap.set("n", "", "harpoon:list():select(2)") + -- vim.keymap.set("n", "", "harpoon:list():select(3)") + -- vim.keymap.set("n", "", "harpoon:list():select(4)") + -- + -- vim.keymap.set("n", "", "harpoon:list():prev()") + -- vim.keymap.set("n", "", "harpoon:list():next()") + end, } diff --git a/lua/stevenmm/lazy/init.lua b/lua/stevenmm/lazy/init.lua index 0ec5fdb..73124c6 100644 --- a/lua/stevenmm/lazy/init.lua +++ b/lua/stevenmm/lazy/init.lua @@ -1,10 +1,10 @@ return { - { - "nvim-lua/plenary.nvim", - name = "plenary" - }, + { + "nvim-lua/plenary.nvim", + name = "plenary", + }, --- "github/copilot.vim", --- "eandrju/cellular-automaton.nvim", --- "gpanders/editorconfig.nvim", + -- "github/copilot.vim", + -- "eandrju/cellular-automaton.nvim", + -- "gpanders/editorconfig.nvim", } diff --git a/lua/stevenmm/lazy/jest.lua b/lua/stevenmm/lazy/jest.lua new file mode 100644 index 0000000..18b4e7d --- /dev/null +++ b/lua/stevenmm/lazy/jest.lua @@ -0,0 +1,10 @@ +return { + "mattkubej/jest.nvim", + config = function() + local jest = require("nvim-jest") + + jest.setup({ + silent = false, + }) + end, +} diff --git a/lua/stevenmm/lazy/lazydev.lua b/lua/stevenmm/lazy/lazydev.lua new file mode 100644 index 0000000..f9187a4 --- /dev/null +++ b/lua/stevenmm/lazy/lazydev.lua @@ -0,0 +1,19 @@ +return { + "folke/lazydev.nvim", + ft = "lua", + opts = { + library = { + { path = "${3rd}/luv/library", words = { "vim%.uv" } }, + "LazyVim", + }, + integrations = { + cmp = true, + lspconfig = true, + }, + }, + -- config = function() + -- local lazydev = require("lazydev.nvim") + -- + -- lazydev.setup({}) + -- end, +} diff --git a/lua/stevenmm/lazy/lsp.lua b/lua/stevenmm/lazy/lsp.lua index a6b2642..2de2517 100644 --- a/lua/stevenmm/lazy/lsp.lua +++ b/lua/stevenmm/lazy/lsp.lua @@ -1,58 +1,83 @@ return { - "neovim/nvim-lspconfig", + "neovim/nvim-lspconfig", - -- Load each package config using the dependencies order - dependencies = { + -- Load each package config using the dependencies order + dependencies = { - -- mason configs: - "williamboman/mason.nvim", - "williamboman/mason-lspconfig.nvim", + -- mason configs: + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", - -- cmp configs: - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - "hrsh7th/nvim-cmp", + "folke/lazydev.nvim", - -- LuaSnip config: - "L3MON4D3/LuaSnip", - "saadparwaiz1/cmp_luasnip", + -- cmp configs: + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + "hrsh7th/nvim-cmp", - "nvim-svelte/nvim-svelte-snippets", + -- LuaSnip config: + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", - -- fidget config: - "j-hui/fidget.nvim", - }, + "nvim-svelte/nvim-svelte-snippets", - config = function() - print("lsp.lua") + -- fidget config: + "j-hui/fidget.nvim", + }, - require("fidget").setup({}) + config = function() + -- print("lsp.lua") + local lspconfig = require("lspconfig") + require("fidget").setup({}) - vim.diagnostic.config({ - -- virtual_text = false, - signs = { - text = { - [vim.diagnostic.severity.ERROR] = '', - [vim.diagnostic.severity.WARN] = '', - [vim.diagnostic.severity.INFO] = '', - [vim.diagnostic.severity.HINT] = '󰌶', - } - }, - update_in_insert = true, - float = { - focusable = true, - style = "minimal", - border = "rounded", - source = "always", - header = "", - prefix = "", - }, - }) + lspconfig.lua_ls.setup({ + settings = { + Lua = { + runtime = { + version = "LuaJIT", + }, + format = { + enable = false, + }, + diagnostics = { + globals = { + "vim", + }, + }, + workspace = { + library = vim.api.nvim_get_runtime_file("", true), + }, + telemetry = { + enable = false, + }, + }, + }, + }) - -- vim.o.updatetime = 250 - -- vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]] - end + vim.diagnostic.config({ + -- virtual_text = false, + signs = { + text = { + [vim.diagnostic.severity.ERROR] = "", + [vim.diagnostic.severity.WARN] = "", + [vim.diagnostic.severity.INFO] = "", + [vim.diagnostic.severity.HINT] = "󰌶", + }, + }, + update_in_insert = true, + float = { + focusable = true, + style = "minimal", + border = "rounded", + source = "always", + header = "", + prefix = "", + }, + }) + + -- vim.o.updatetime = 250 + -- vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]] + end, } - diff --git a/lua/stevenmm/lazy/lualine.lua b/lua/stevenmm/lazy/lualine.lua index 6fca356..a3c1a64 100644 --- a/lua/stevenmm/lazy/lualine.lua +++ b/lua/stevenmm/lazy/lualine.lua @@ -19,136 +19,134 @@ local nvimtree = { -- } return { - "nvim-lualine/lualine.nvim", - dependencies = { - -- "lua.stevenmm.variables", - "nvim-tree/nvim-web-devicons", - }, - lazy = false, - priority = 999, - config = function() - local lualine = require('lualine') - lualine.setup({ - options = { - theme = 'auto', - section_separators = { left = "", right = "" }, - -- always_show_tabline = false, - -- ignore_focus = {}, - -- icons_enabled = true, - -- refresh = { - -- statusline = 100, - -- tabline = 100, - -- winbar = 100, - -- }, - disabled_filetypes = { - statusline = EXCLUDED_FILETYPES_ARRAY, - winbar = EXCLUDED_FILETYPES_ARRAY, - }, - globalstatus = true, - }, - sections = { - lualine_a = { - -- { - -- 'buffers', - -- show_filename_only = true, - -- show_modified_status = false, - -- mode = 4, - -- filetype_names = { - -- NvimTree = 'NvimTree' - -- }, - -- }, - { - 'mode', - -- fmt = function(str) return '[' .. str:sub(1,2) .. ']' end, - -- separator = "|" - }, - }, - lualine_b = { - { - 'branch', - separator = "" - }, - { - 'diff', - }, - }, - lualine_c = { - { - 'filetype', - -- icons_enabled = true, - icon_only = false, - icon = { align = 'left' }, - separator = "", - }, - -- { - -- -- 'filetype', - -- 'filename', - -- -- icons_enabled = true, - -- -- file_status = false, - -- -- newfile_status = false, - -- -- path = 0, - -- -- fmt = string.lower, - -- -- shorting_target = 40, - -- - -- symbols = { - -- modified = '[+]', - -- readonly = '[-]', - -- unamed = '[No Name]', - -- newfile = '[New]', - -- }, - -- } - }, - lualine_x = { - { - require("lazy.status").updates, - cond = require("lazy.status").has_updates, - color = { fg = "#ff9e64" }, - }, - { - 'diagnostics', - update_in_insert = true, - separator = "", - }, - }, - lualine_y = { - { - 'location', - }, - }, - lualine_z = { - { - 'datetime', - -- icons_enabled = true, - -- icon = { '' }, - -- separator = "🌴", - style = '%H:%M:%S', - }, - }, - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = { - { - "filetypes", - icon_only = true, - }, - { - "filename", - path = 1, - -- fmt = format_name - - }, - }, - lualine_x = {}, - lualine_y = {}, - lualine_z = {}, - }, - winbar = { - }, - extensions = { - nvimtree - }, - }) - end, + "nvim-lualine/lualine.nvim", + dependencies = { + -- "lua.stevenmm.variables", + "nvim-tree/nvim-web-devicons", + }, + lazy = false, + priority = 999, + config = function() + local lualine = require("lualine") + lualine.setup({ + options = { + theme = "auto", + section_separators = { left = "", right = "" }, + -- always_show_tabline = false, + -- ignore_focus = {}, + -- icons_enabled = true, + -- refresh = { + -- statusline = 100, + -- tabline = 100, + -- winbar = 100, + -- }, + disabled_filetypes = { + statusline = EXCLUDED_FILETYPES_ARRAY, + winbar = EXCLUDED_FILETYPES_ARRAY, + }, + globalstatus = true, + }, + sections = { + lualine_a = { + -- { + -- 'buffers', + -- show_filename_only = true, + -- show_modified_status = false, + -- mode = 4, + -- filetype_names = { + -- NvimTree = 'NvimTree' + -- }, + -- }, + { + "mode", + -- fmt = function(str) return '[' .. str:sub(1,2) .. ']' end, + -- separator = "|" + }, + }, + lualine_b = { + { + "branch", + separator = "", + }, + { + "diff", + }, + }, + lualine_c = { + { + "filetype", + -- icons_enabled = true, + icon_only = false, + icon = { align = "left" }, + separator = "", + }, + -- { + -- -- 'filetype', + -- 'filename', + -- -- icons_enabled = true, + -- -- file_status = false, + -- -- newfile_status = false, + -- -- path = 0, + -- -- fmt = string.lower, + -- -- shorting_target = 40, + -- + -- symbols = { + -- modified = '[+]', + -- readonly = '[-]', + -- unamed = '[No Name]', + -- newfile = '[New]', + -- }, + -- } + }, + lualine_x = { + { + require("lazy.status").updates, + cond = require("lazy.status").has_updates, + color = { fg = "#ff9e64" }, + }, + { + "diagnostics", + update_in_insert = true, + separator = "", + }, + }, + lualine_y = { + { + "location", + }, + }, + lualine_z = { + { + "datetime", + -- icons_enabled = true, + -- icon = { '' }, + -- separator = "🌴", + style = "%H:%M:%S", + }, + }, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { + { + "filetypes", + icon_only = true, + }, + { + "filename", + path = 1, + -- fmt = format_name + }, + }, + lualine_x = {}, + lualine_y = {}, + lualine_z = {}, + }, + winbar = {}, + extensions = { + nvimtree, + }, + }) + end, } diff --git a/lua/stevenmm/lazy/mason.lua b/lua/stevenmm/lazy/mason.lua index 0a44517..d9f060d 100644 --- a/lua/stevenmm/lazy/mason.lua +++ b/lua/stevenmm/lazy/mason.lua @@ -1,62 +1,87 @@ return { - "williamboman/mason.nvim", - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "williamboman/mason-lspconfig.nvim", - }, - config = function () - print('mason.lua') - local capabilities = vim.tbl_deep_extend( - "force", - {}, - vim.lsp.protocol.make_client_capabilities(), - require('cmp_nvim_lsp').default_capabilities() - ) + "williamboman/mason.nvim", + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "williamboman/mason-lspconfig.nvim", + "jay-babu/mason-null-ls.nvim", + }, + config = function() + -- print('mason.lua') + local lspconfig = require("lspconfig") - require('mason').setup({}) - require('mason-lspconfig').setup({ - ensure_installed = { - "gopls", - "clangd", - "lua_ls", - "rust_analyzer", - -- "php" - -- "tsserver", - }, - handlers = { - function(server_name) -- default handler (optional) - require("lspconfig")[server_name].setup { - capabilities = capabilities - } - end, + local capabilities = vim.tbl_deep_extend( + "force", + {}, + vim.lsp.protocol.make_client_capabilities(), + require("cmp_nvim_lsp").default_capabilities() + ) - ["lua_ls"] = function() - local lspconfig = require("lspconfig") - lspconfig.lua_ls.setup { - capabilities = capabilities, - settings = { - Lua = { - diagnostics = { - globals = { "vim", "it", "describe", "before_each", "after_each" }, - } - } - } - } - end, + require("mason").setup({}) + require("mason-lspconfig").setup({ + ensure_installed = { + "ts_ls", + "gopls", + "clangd", + "rust_analyzer", + -- "lua_ls", + -- "php" + }, + handlers = { + function(server_name) -- default handler (optional) + require("lspconfig")[server_name].setup({ + capabilities = capabilities, + }) + end, + ["ts_ls"] = function() + -- local function organize_imports() + -- local params = { + -- command = "_typescript.organizeImports", + -- arguments = { vim.api.nvim_buf_get_name(0) }, + -- title = "", + -- } + -- vim.lsp.buf.execute_command(params) + -- end + lspconfig.ts_ls.setup({ + capabilities = capabilities, + -- commands = { + -- OrganizeImports = { + -- organize_imports(), + -- description = "Organize Imports", + -- }, + -- }, + }) + end, + -- ["lua_ls"] = function() + -- local lspconfig = require("lspconfig") + -- lspconfig.lua_ls.setup({ + -- capabilities = capabilities, + -- settings = { + -- Lua = { + -- -- workspace = { + -- -- checkThirdParty = false, + -- -- library = vim.api.nvim_get_runtime_file("", true), + -- -- }, + -- diagnostics = { + -- globals = { "vim", "it", "describe", "before_each", "after_each" }, + -- }, + -- }, + -- }, + -- }) + -- end, - ["clangd"] = function () - local lspconfig = require("lspconfig") - lspconfig.clangd.setup({ - capabilities = capabilities, - }) - end, - ["gopls"] = function () - local lspconfig = require("lspconfig") - lspconfig.gopls.setup { - capabilities = capabilities, - } - end - } - }) - end + ["clangd"] = function() + -- local lspconfig = require("lspconfig") + lspconfig.clangd.setup({ + capabilities = capabilities, + }) + end, + ["gopls"] = function() + -- local lspconfig = require("lspconfig") + lspconfig.gopls.setup({ + capabilities = capabilities, + }) + end, + }, + }) + end, } diff --git a/lua/stevenmm/lazy/minicomment.lua b/lua/stevenmm/lazy/minicomment.lua index e5718c9..3bc6fe6 100644 --- a/lua/stevenmm/lazy/minicomment.lua +++ b/lua/stevenmm/lazy/minicomment.lua @@ -1,13 +1,13 @@ return { - 'echasnovski/mini.comment', - version = false, - config = function() - require('mini.comment').setup({ - options = { - custom_commentstring = function() - return require('ts_context_commentstring').calculate_commentstring() or vim.bo.commentstring - end - }, - }) - end + "echasnovski/mini.comment", + version = false, + config = function() + require("mini.comment").setup({ + options = { + custom_commentstring = function() + return require("ts_context_commentstring").calculate_commentstring() or vim.bo.commentstring + end, + }, + }) + end, } diff --git a/lua/stevenmm/lazy/miniindentscope.lua b/lua/stevenmm/lazy/miniindentscope.lua index a91ec67..2c0d470 100644 --- a/lua/stevenmm/lazy/miniindentscope.lua +++ b/lua/stevenmm/lazy/miniindentscope.lua @@ -1,7 +1,7 @@ return { - 'echasnovski/mini.indentscope', - version = false, - config = function () - require('mini.indentscope').setup() - end + "echasnovski/mini.indentscope", + version = false, + config = function() + require("mini.indentscope").setup() + end, } diff --git a/lua/stevenmm/lazy/minimove.lua b/lua/stevenmm/lazy/minimove.lua index 082c120..733987a 100644 --- a/lua/stevenmm/lazy/minimove.lua +++ b/lua/stevenmm/lazy/minimove.lua @@ -1,7 +1,7 @@ return { - 'echasnovski/mini.move', - version = false, - config = function () - require('mini.move').setup() - end, + "echasnovski/mini.move", + version = false, + config = function() + require("mini.move").setup() + end, } diff --git a/lua/stevenmm/lazy/minipairs.lua b/lua/stevenmm/lazy/minipairs.lua index 5abfdba..34f3b18 100644 --- a/lua/stevenmm/lazy/minipairs.lua +++ b/lua/stevenmm/lazy/minipairs.lua @@ -1,7 +1,7 @@ return { - 'echasnovski/mini.pairs', - version = false, - config = function () - require('mini.pairs').setup() - end, + "echasnovski/mini.pairs", + version = false, + config = function() + require("mini.pairs").setup() + end, } diff --git a/lua/stevenmm/lazy/minisurround.lua b/lua/stevenmm/lazy/minisurround.lua index 5db9968..c8c451c 100644 --- a/lua/stevenmm/lazy/minisurround.lua +++ b/lua/stevenmm/lazy/minisurround.lua @@ -1,7 +1,7 @@ return { - 'echasnovski/mini.surround', - version = false, - config = function () - require('mini.surround').setup() - end + "echasnovski/mini.surround", + version = false, + config = function() + require("mini.surround").setup() + end, } diff --git a/lua/stevenmm/lazy/nvim-autopairs.lua b/lua/stevenmm/lazy/nvim-autopairs.lua index 4a22436..b83282d 100644 --- a/lua/stevenmm/lazy/nvim-autopairs.lua +++ b/lua/stevenmm/lazy/nvim-autopairs.lua @@ -1,5 +1,5 @@ return { - "windwp/nvim-autopairs", - event = "InsertEnter", - config = true + "windwp/nvim-autopairs", + event = "InsertEnter", + config = true, } diff --git a/lua/stevenmm/lazy/nvimtree.lua b/lua/stevenmm/lazy/nvimtree.lua index a1d52d5..edac4bb 100644 --- a/lua/stevenmm/lazy/nvimtree.lua +++ b/lua/stevenmm/lazy/nvimtree.lua @@ -1,26 +1,26 @@ return { - "nvim-tree/nvim-tree.lua", - lazy = false, - dependencies = { - "nvim-tree/nvim-web-devicons", - }, + "nvim-tree/nvim-tree.lua", + lazy = false, + dependencies = { + "nvim-tree/nvim-web-devicons", + }, - config = function() - require("nvim-tree").setup({ - renderer = { - icons = { - web_devicons = { - file = { - enable = true, - color = true, - }, - folder = { - enable = true, - color = true, - }, - }, - }, - }, - }) - end, + config = function() + require("nvim-tree").setup({ + renderer = { + icons = { + web_devicons = { + file = { + enable = true, + color = true, + }, + folder = { + enable = true, + color = true, + }, + }, + }, + }, + }) + end, } diff --git a/lua/stevenmm/lazy/prettier.lua b/lua/stevenmm/lazy/prettier.lua deleted file mode 100644 index 41e2fa2..0000000 --- a/lua/stevenmm/lazy/prettier.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - "prettier/vim-prettier", - - -- config = function() - -- require("vim-prettier").setup() - -- end, -} \ No newline at end of file diff --git a/lua/stevenmm/lazy/telescope.lua b/lua/stevenmm/lazy/telescope.lua index e3c6d63..c3f83a5 100644 --- a/lua/stevenmm/lazy/telescope.lua +++ b/lua/stevenmm/lazy/telescope.lua @@ -2,12 +2,12 @@ -- print('telescope.lua loaded') return { - "nvim-telescope/telescope-file-browser.nvim", + "nvim-telescope/telescope-file-browser.nvim", - dependencies = { - "nvim-telescope/telescope.nvim", --- "nvim-lua/plenary.nvim" - }, + dependencies = { + "nvim-telescope/telescope.nvim", + -- "nvim-lua/plenary.nvim" + }, config = function () local telescope = require('telescope') diff --git a/lua/stevenmm/lazy_init.lua b/lua/stevenmm/lazy_init.lua index fc28238..03794a7 100644 --- a/lua/stevenmm/lazy_init.lua +++ b/lua/stevenmm/lazy_init.lua @@ -12,8 +12,8 @@ end vim.opt.rtp:prepend(lazypath) require("lazy").setup({ - spec = "stevenmm.lazy", - change_detection = { notify = false }, - 'JoosepAlviste/nvim-ts-context-commentstring', - -- "nvim-lua/plenary.nvim" + spec = "stevenmm.lazy", + change_detection = { notify = false }, + "JoosepAlviste/nvim-ts-context-commentstring", + -- "nvim-lua/plenary.nvim" }) diff --git a/lua/stevenmm/remap.lua b/lua/stevenmm/remap.lua index 5bd32e1..83f158e 100644 --- a/lua/stevenmm/remap.lua +++ b/lua/stevenmm/remap.lua @@ -1,11 +1,31 @@ vim.g.mapleader = " " local keyset = vim.keymap.set +local function noremap_opts(cmd_description) + return { noremap = true, silent = true, desc = cmd_description } +end -keyset("", "", "") +-- Lazy: +keyset("n", "la", ":Lazy", { silent = true }) + +-- Mason: keyset("n", "ma", ":Mason", { silent = true }) + +-- NvimTree keyset("n", "na", ":NvimTreeToggle", { silent = true }) -keyset('n', 'la', ":Lazy", { silent = true }) -keyset("n", "fb", ":Telescope file_browser path=%:p:h", { noremap = true, silent = true }) -keyset("n", "ha", ":Telescope harpoon marks", { noremap = true, silent = true }) -keyset('n', 'se', ":Telescope emoji", { desc = '[S]earch [E]moji' }) + +-- Telescope: +keyset("n", "fb", ":Telescope file_browser path=%:p:h", noremap_opts("Telescope File Browser")) +keyset("n", "ha", ":Telescope harpoon marks", noremap_opts("Telescope Harpoon")) +keyset("n", "se", ":Telescope emoji", { desc = "[S]earch [E]moji" }) + +-- Gitsigns: +keyset("n", "gp", ":Gitsigns preview_hunk", {}) +keyset("n", "gt", ":Gitsigns toggle_current_line_blame", {}) + +-- Formatting: +keyset("n", "ff", ":lua vim.lsp.buf.format()", noremap_opts("Format Current File")) + +-- keyset("", "", "") +-- keyset("n", "p", ":Prettier", { noremap = true, silent = true }) +-- keyset("n", "ff", ":lua vim.lsp.buf.format()", { noremap = true, silent = true, desc = "Format Current File" }) diff --git a/lua/stevenmm/set.lua b/lua/stevenmm/set.lua index 2ffe52e..dd45ba8 100644 --- a/lua/stevenmm/set.lua +++ b/lua/stevenmm/set.lua @@ -3,12 +3,23 @@ vim.opt.number = true vim.opt.relativenumber = true -vim.opt.encoding = 'UTF-8' -vim.opt.guifont = 'NotoSansM Nerd Font Mono' +vim.opt.encoding = "UTF-8" +vim.opt.guifont = "NotoSansM Nerd Font Mono" + +vim.opt.clipboard = "unnamedplus" + +vim.opt.inccommand = "split" +vim.opt.splitright = true +-- vim.opt.splitbelow = true + +-- vim.opt.tabstop = 4 +-- vim.opt.softtabstop = 4 +-- vim.opt.shiftwidth = 4 + +vim.opt.tabstop = 2 +vim.opt.softtabstop = 2 +vim.opt.shiftwidth = 2 -vim.opt.tabstop = 4 -vim.opt.softtabstop = 4 -vim.opt.shiftwidth = 4 vim.opt.smarttab = false vim.opt.expandtab = true @@ -24,12 +35,12 @@ vim.opt.colorcolumn = "80" vim.opt.swapfile = false vim.opt.backup = false -if vim.fn.has('win32') or vim.fn.has('win64') then +if vim.fn.has("win32") or vim.fn.has("win64") then vim.opt.undodir = os.getenv("XDG_CONFIG_HOME") .. "/.vim/undodir" - vim.opt.shell = 'powershell.exe' + vim.opt.shell = "powershell.exe" else vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" - vim.opt.shell = 'bash' + vim.opt.shell = "bash" end vim.opt.undofile = true @@ -39,8 +50,12 @@ vim.opt.incsearch = true vim.opt.termguicolors = true -vim.opt.scrolloff = 8 +-- vim.opt.scrolloff = 8 +vim.opt.scrolloff = 10 vim.opt.signcolumn = "yes" vim.opt.isfname:append("@-@") vim.opt.updatetime = 50 + +vim.opt.grepprg = "rg --vimgrep" +vim.opt.grepformat = "%f:%l:%c:%m"