diff --git a/lazy-lock.json b/lazy-lock.json index 0bea887..419c0de 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,87 +1,40 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, -<<<<<<< HEAD - "LuaSnip": { "branch": "master", "commit": "ac7cbc0e85710db7cba6510b1d8e6a1a551444f7" }, - "SchemaStore.nvim": { "branch": "main", "commit": "3e54f4bbebea598646b141aa8aeca8a01b6ba601" }, - "auto-session": { "branch": "main", "commit": "3cd531ce4d46fb156268ddedf5f3e6822ef26af7" }, -======= - "LuaSnip": { "branch": "master", "commit": "45db5addf8d0a201e1cf247cae4cdce605ad3768" }, - "SchemaStore.nvim": { "branch": "main", "commit": "ae75241aed204d829fe15595bbf05e6fbf3d49dd" }, - "auto-session": { "branch": "main", "commit": "0e9aa77525b5217e8eacb36007edd3d02bb2a91a" }, ->>>>>>> v0.7 + "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, + "SchemaStore.nvim": { "branch": "main", "commit": "b6ee84c6db9c8d557e0c8b71f1b6800e77611771" }, + "auto-session": { "branch": "main", "commit": "9c3f977aafb56bd73ba0d082c4dcbdba5666faf3" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "cosmic-ui": { "branch": "main", "commit": "c0b14531999f2bfef3d927c4dcd57a1a8fed5ee9" }, -<<<<<<< HEAD - "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, - "gitsigns.nvim": { "branch": "main", "commit": "ee7634ab4f0a6606438fe13e16cbf2065589a5ed" }, - "lazy.nvim": { "branch": "main", "commit": "cf8ecc2c5e4332760431a33534240b0cbc6680ab" }, - "lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, - "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, - "noice.nvim": { "branch": "main", "commit": "df448c649ef6bc5a6a633a44f2ad0ed8d4442499" }, - "none-ls-extras.nvim": { "branch": "main", "commit": "f2bb002c8aa644d1f253772ff5d4e75e45ff7f4f" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "cosmic-ui": { "branch": "main", "commit": "ab7de388576eaac02ce7bc2389e55b8e207aad12" }, + "dashboard-nvim": { "branch": "master", "commit": "000448d837f6e7a47f8f342f29526c4d7e49e9ce" }, + "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, + "gitsigns.nvim": { "branch": "main", "commit": "4c40357994f386e72be92a46f41fc1664c84c87d" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, + "lualine.nvim": { "branch": "master", "commit": "f4f791f67e70d378a754d02da068231d2352e5bc" }, + "luvit-meta": { "branch": "main", "commit": "1df30b60b1b4aecfebc785aa98943db6c6989716" }, + "none-ls-extras.nvim": { "branch": "main", "commit": "6557f20e631d2e9b2a9fd27a5c045d701a3a292c" }, "none-ls-shellcheck.nvim": { "branch": "main", "commit": "0f84461241e76e376a95fb7391deac82dc3efdbf" }, - "none-ls.nvim": { "branch": "main", "commit": "dcc8cd4efdcb29275681a3c95786a816330dbca6" }, - "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, - "nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" }, - "nvim-cmp": { "branch": "main", "commit": "29fb4854573355792df9e156cb779f0d31308796" }, + "none-ls.nvim": { "branch": "main", "commit": "a117163db44c256d53c3be8717f3e1a2a28e6299" }, + "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, + "nvim-autopairs": { "branch": "master", "commit": "68f0e5c3dab23261a945272032ee6700af86227a" }, + "nvim-cmp": { "branch": "main", "commit": "c27370703e798666486e3064b64d59eaf4bdc6d5" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-lspconfig": { "branch": "master", "commit": "0d62a16429dba5fded93a076237079b81527e8f3" }, - "nvim-notify": { "branch": "master", "commit": "fbef5d32be8466dd76544a257d3f3dce20082a07" }, - "nvim-tree.lua": { "branch": "master", "commit": "2a268f631da85e83b7a95291be589bcddfc785d8" }, - "nvim-treesitter": { "branch": "master", "commit": "bab7b0f20bd3e805b77231a77f516c7d69382693" }, + "nvim-lspconfig": { "branch": "master", "commit": "84e0cd5a3c58e88ef706fdf4a1eed59ded1d3ce2" }, + "nvim-treesitter": { "branch": "master", "commit": "55c5c762fee2e813b4e43bbfaf5b91d182bd2875" }, "nvim-treesitter-refactor": { "branch": "master", "commit": "d8b74fa87afc6a1e97b18da23e762efb032dc270" }, - "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "9c74db656c3d0b1c4392fc89a016b1910539e7c0" }, - "nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" }, - "nx.nvim": { "branch": "main", "commit": "f8a3a21b3d540889401a40d1f2803083794c0372" }, - "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, + "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, - "telescope.nvim": { "branch": "master", "commit": "df534c3042572fb958586facd02841e10186707c" }, - "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, - "tokyonight.nvim": { "branch": "main", "commit": "4867d10ead04e69872b24818d0d306539305cf87" }, - "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, - "which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" } -======= - "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, - "gitsigns.nvim": { "branch": "main", "commit": "899e993850084ea33d001ec229d237bc020c19ae" }, - "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, - "lazydev.nvim": { "branch": "main", "commit": "491452cf1ca6f029e90ad0d0368848fac717c6d2" }, - "lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" }, - "luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "482350b050bd413931c2cdd4857443c3da7d57cb" }, - "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "noice.nvim": { "branch": "main", "commit": "448bb9c524a7601035449210838e374a30153172" }, - "none-ls-extras.nvim": { "branch": "main", "commit": "dfdc998a8c7bb728abab156942bd43ed2345845a" }, - "none-ls-shellcheck.nvim": { "branch": "main", "commit": "0f84461241e76e376a95fb7391deac82dc3efdbf" }, - "none-ls.nvim": { "branch": "main", "commit": "203f5ebde4a1af48ba2eb146401b5be2e7866942" }, - "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, - "nvim-autopairs": { "branch": "master", "commit": "19606af7c039271d5aa96bceff101e7523af3136" }, - "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-lspconfig": { "branch": "master", "commit": "2a6f00ff66e276ab3289be8bb9f844f7ab385848" }, - "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, - "nvim-tree.lua": { "branch": "master", "commit": "d43ab67d0eb4317961c5e9d15fffe908519debe0" }, - "nvim-treesitter": { "branch": "master", "commit": "7a64148896289a91cb2a92e9da3f76d5512a3fb8" }, - "nvim-treesitter-refactor": { "branch": "master", "commit": "65ad2eca822dfaec2a3603119ec3cc8826a7859e" }, - "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "375c2d86cee6674afd75b4f727ce3a80065552f7" }, - "nvim-web-devicons": { "branch": "master", "commit": "3722e3d1fb5fe1896a104eb489e8f8651260b520" }, - "nx.nvim": { "branch": "main", "commit": "f8a3a21b3d540889401a40d1f2803083794c0372" }, - "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" }, - "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, - "telescope.nvim": { "branch": "master", "commit": "5972437de807c3bc101565175da66a1aa4f8707a" }, - "todo-comments.nvim": { "branch": "main", "commit": "8f45f353dc3649cb9b44cecda96827ea88128584" }, - "toggleterm.nvim": { "branch": "main", "commit": "137d06fb103952a0fb567882bb8527e2f92d327d" }, - "tokyonight.nvim": { "branch": "main", "commit": "b0e7c7382a7e8f6456f2a95655983993ffda745e" }, - "vim-fugitive": { "branch": "master", "commit": "0444df68cd1cdabc7453d6bd84099458327e5513" }, - "which-key.nvim": { "branch": "main", "commit": "6c1584eb76b55629702716995cca4ae2798a9cca" } ->>>>>>> v0.7 + "telescope-fzf-native.nvim": { "branch": "main", "commit": "2a5ceff981501cff8f46871d5402cd3378a8ab6a" }, + "telescope.nvim": { "branch": "master", "commit": "814f102cd1da3dc78c7d2f20f2ef3ed3cdf0e6e4" }, + "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, + "toggleterm.nvim": { "branch": "main", "commit": "e76134e682c1a866e3dfcdaeb691eb7b01068668" }, + "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, + "vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" }, + "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } } diff --git a/lua/config.lua b/lua/config.lua index 70c3cad..1b1ca2d 100644 --- a/lua/config.lua +++ b/lua/config.lua @@ -1,6 +1,5 @@ local config = { border = 'none', - disable_builtin_plugins = {}, add_plugins = {}, plugins = {}, lsp = { diff --git a/lua/plugins/auto-pairs.lua b/lua/plugins/auto-pairs.lua index f03358b..1304b42 100644 --- a/lua/plugins/auto-pairs.lua +++ b/lua/plugins/auto-pairs.lua @@ -1,10 +1,7 @@ -local config = require('config') -local u = require('utils') - return { 'windwp/nvim-autopairs', config = function() - require('nvim-autopairs').setup(u.merge({ + require('nvim-autopairs').setup({ check_ts = true, ts_config = { lua = { 'string', 'source' }, @@ -13,7 +10,6 @@ return { }, disable_filetype = { 'TelescopePrompt', 'vim' }, fast_wrap = {}, - }, config.plugins.nvim_autopairs or {})) + }) end, - enabled = not vim.tbl_contains(config.disable_builtin_plugins, 'autopairs'), } diff --git a/lua/plugins/auto-session/init.lua b/lua/plugins/auto-session/init.lua index 60839ac..2e4745d 100644 --- a/lua/plugins/auto-session/init.lua +++ b/lua/plugins/auto-session/init.lua @@ -1,8 +1,5 @@ -local config = require('config') -local u = require('utils') - -local defaults = { - pre_save_cmds = { 'NvimTreeClose', 'cclose', 'lua vim.notify.dismiss()' }, +local config = { + pre_save_cmds = { 'cclose', 'lua vim.notify.dismiss()' }, auto_session_enabled = true, auto_restore_enabled = true, auto_save_enabled = true, @@ -12,10 +9,9 @@ return { 'rmagatti/auto-session', lazy = false, config = function() - require('auto-session').setup(u.merge(defaults, config.plugins.auto_session or {})) + require('auto-session').setup(config) end, init = function() require('plugins.auto-session.mappings') end, - enabled = not vim.tbl_contains(config.disable_builtin_plugins, 'auto-session'), } diff --git a/lua/plugins/colorizer.lua b/lua/plugins/colorizer.lua index 60d6fda..36209fc 100644 --- a/lua/plugins/colorizer.lua +++ b/lua/plugins/colorizer.lua @@ -1,11 +1,7 @@ -local config = require('config') -local u = require('utils') - return { 'norcalli/nvim-colorizer.lua', cmd = { 'ColorizerToggle' }, config = function() - require('colorizer').setup(u.merge({}, config.plugins.colorizer or {})) + require('colorizer').setup() end, - enabled = not vim.tbl_contains(config.disable_builtin_plugins, 'colorizer'), } diff --git a/lua/plugins/comments.lua b/lua/plugins/comments.lua index 5e3c09d..9fe6451 100644 --- a/lua/plugins/comments.lua +++ b/lua/plugins/comments.lua @@ -1,10 +1,7 @@ -local config = require('config') -local u = require('utils') - return { 'numToStr/Comment.nvim', config = function() - require('Comment').setup(u.merge({ + require('Comment').setup({ pre_hook = function(ctx) local U = require('Comment.utils') local location = nil @@ -19,8 +16,7 @@ return { location = location, }) end, - }, config.plugins.comment_nvim or {})) + }) end, event = 'VeryLazy', - enabled = not vim.tbl_contains(config.disable_builtin_plugins, 'comment-nvim'), } diff --git a/lua/plugins/dashboard.lua b/lua/plugins/dashboard.lua index 3251078..3da6ee7 100644 --- a/lua/plugins/dashboard.lua +++ b/lua/plugins/dashboard.lua @@ -1,4 +1,3 @@ -local config = require('config') local icons = require('utils.icons') local g = vim.g @@ -55,5 +54,4 @@ return { }) end, event = 'VimEnter', - enabled = not vim.tbl_contains(config.disable_builtin_plugins, 'dashboard'), } diff --git a/lua/plugins/fugitive.lua b/lua/plugins/fugitive.lua index 334e318..673a302 100644 --- a/lua/plugins/fugitive.lua +++ b/lua/plugins/fugitive.lua @@ -1,6 +1,4 @@ -local config = require('config') return { 'tpope/vim-fugitive', cmd = 'Git', - enabled = not vim.tbl_contains(config.disable_builtin_plugins, 'fugitive'), } diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua index 475eb85..9b8837f 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/plugins/gitsigns.lua @@ -6,8 +6,8 @@ return { dependencies = { 'nvim-lua/plenary.nvim' }, event = 'VeryLazy', config = function() - local gs = require('gitsigns') - gs.setup(u.merge({ + local gitsigns = require('gitsigns') + gitsigns.setup({ --[[ signs = { ]] --[[ add = { hl = 'GitSignsAdd', text = '│', numhl = 'GitSignsAddNr', linehl = 'GitSignsAddLn' }, ]] --[[ change = { hl = 'GitSignsChange', text = '│', numhl = 'GitSignsChangeNr', linehl = 'GitSignsChangeLn' }, ]] @@ -31,7 +31,7 @@ return { return ']c' end vim.schedule(function() - gs.next_hunk() + gitsigns.nav_hunk('next') end) return '' end, { @@ -44,7 +44,7 @@ return { return '[c' end vim.schedule(function() - gs.prev_hunk() + gitsigns.nav_hunk('prev') end) return '' end, { @@ -53,38 +53,36 @@ return { }) -- Actions - map('n', 'vs', gs.stage_hunk, { desc = 'Stage hunk' }) - map('n', 'vr', gs.reset_hunk, { desc = 'Reset hunk' }) + map('n', 'vs', gitsigns.stage_hunk, { desc = 'Stage hunk' }) + map('n', 'vr', gitsigns.reset_hunk, { desc = 'Reset hunk' }) map('v', 'vs', function() - gs.stage_hunk({ vim.fn.line('.'), vim.fn.line('v') }) + gitsigns.stage_hunk({ vim.fn.line('.'), vim.fn.line('v') }) end, { desc = 'Stage hunk selection', }) map('v', 'vr', function() - gs.reset_hunk({ vim.fn.line('.'), vim.fn.line('v') }) + gitsigns.reset_hunk({ vim.fn.line('.'), vim.fn.line('v') }) end, { desc = 'Reset hunk selection', }) - map('n', 'vS', gs.stage_buffer, { desc = 'Stage buffer' }) - map('n', 'vu', gs.undo_stage_hunk, { desc = 'Undo stage hunk' }) - map('n', 'vR', gs.reset_buffer, { desc = 'Reset buffer' }) - map('n', 'vp', gs.preview_hunk, { desc = 'Preview hunk' }) + map('n', 'vS', gitsigns.stage_buffer, { desc = 'Stage buffer' }) + map('n', 'vR', gitsigns.reset_buffer, { desc = 'Reset buffer' }) + map('n', 'vp', gitsigns.preview_hunk, { desc = 'Preview hunk' }) map('n', 'vb', function() - gs.blame_line({ full = true }) + gitsigns.blame_line({ full = true }) end, { desc = 'Blame line', }) - map('n', 'vtb', gs.toggle_current_line_blame, { desc = 'Toggle blame current line' }) - map('n', 'vd', gs.diffthis, { desc = 'Diff buffer' }) + map('n', 'vtb', gitsigns.toggle_current_line_blame, { desc = 'Toggle blame current line' }) + map('n', 'vd', gitsigns.diffthis, { desc = 'Diff buffer' }) map('n', 'vD', function() - gs.diffthis('~') + gitsigns.diffthis('~') end, { desc = 'Diff project' }) - map('n', 'td', gs.toggle_deleted, { desc = 'Toggle delete' }) + map('n', 'td', gitsigns.toggle_deleted, { desc = 'Toggle delete' }) --[[ -- Text object ]] map({ 'o', 'x' }, 'ih', ':Gitsigns select_hunk', { desc = 'Select hunk' }) end, - }, config.plugins.gitsigns or {})) + }) end, - enabled = not vim.tbl_contains(config.disable_builtin_plugins, 'gitsigns'), } diff --git a/lua/plugins/lazydev.lua b/lua/plugins/lazydev.lua index e488ed8..f92b85e 100644 --- a/lua/plugins/lazydev.lua +++ b/lua/plugins/lazydev.lua @@ -1,4 +1,3 @@ -local config = require('config') return { 'folke/lazydev.nvim', ft = 'lua', -- only load on lua files @@ -13,6 +12,5 @@ return { }, }, dependencies = { { 'Bilal2453/luvit-meta', lazy = true } }, - enabled = not vim.tbl_contains(config.disable_builtin_plugins, 'lazydev'), event = 'VeryLazy', } diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 8eff9b5..c2627d2 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -1,4 +1,3 @@ -local config = require('config') local utils = require('utils') local lsp_utils = require('utils.lsp') local icons = require('utils.icons') @@ -30,80 +29,82 @@ local custom_sections = { }, } +local plugin_config = { + options = { + theme = 'tokyonight', + }, + sections = { + lualine_a = { 'mode' }, + lualine_b = { + { + 'filetype', + icon_only = true, + padding = { + left = 1, + right = 0, + }, + separator = '', + }, + custom_sections.shortenedFilePath, + }, + lualine_c = { + custom_sections.diff, + }, + lualine_x = { 'diagnostics' }, + lualine_y = { lsp_utils.buf_get_active_clients_str }, + lualine_z = { 'location', 'progress' }, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = { + { + 'filetype', + icon_only = true, + padding = { + left = 1, + right = 0, + }, + separator = '', + }, + custom_sections.shortenedFilePath, + }, + lualine_c = { + custom_sections.diff, + }, + lualine_x = { 'diagnostics' }, + lualine_y = { 'location', 'progress' }, + lualine_z = {}, + }, + winbar = { + lualine_a = { utils.get_short_cwd }, + lualine_b = { custom_sections.branch }, + lualine_c = { custom_sections.relativeFilePath }, + lualine_x = { + { + 'macro-recording', + fmt = utils.show_macro_recording, + }, + 'filetype', + }, + lualine_y = {}, + lualine_z = {}, + }, + inactive_winbar = { + lualine_a = { utils.get_short_cwd }, + lualine_b = { custom_sections.branch }, + lualine_c = { custom_sections.relativeFilePath }, + lualine_x = { 'filetype' }, + lualine_y = {}, + lualine_z = {}, + }, + extensions = { 'quickfix', 'fugitive', 'nvim-tree' }, +} + return { 'nvim-lualine/lualine.nvim', event = 'VeryLazy', config = function() - require('lualine').setup(utils.merge({ - options = { - theme = 'tokyonight', - }, - sections = { - lualine_a = { 'mode' }, - lualine_b = { - { - 'filetype', - icon_only = true, - padding = { - left = 1, - right = 0, - }, - separator = '', - }, - custom_sections.shortenedFilePath, - }, - lualine_c = { - custom_sections.diff, - }, - lualine_x = { 'diagnostics' }, - lualine_y = { lsp_utils.buf_get_active_clients_str }, - lualine_z = { 'location', 'progress' }, - }, - inactive_sections = { - lualine_a = {}, - lualine_b = { - { - 'filetype', - icon_only = true, - padding = { - left = 1, - right = 0, - }, - separator = '', - }, - custom_sections.shortenedFilePath, - }, - lualine_c = { - custom_sections.diff, - }, - lualine_x = { 'diagnostics' }, - lualine_y = { 'location', 'progress' }, - lualine_z = {}, - }, - winbar = { - lualine_a = { utils.get_short_cwd }, - lualine_b = { custom_sections.branch }, - lualine_c = { custom_sections.relativeFilePath }, - lualine_x = { - { - 'macro-recording', - fmt = utils.show_macro_recording, - }, - 'filetype', - }, - lualine_y = {}, - lualine_z = {}, - }, - inactive_winbar = { - lualine_a = { utils.get_short_cwd }, - lualine_b = { custom_sections.branch }, - lualine_c = { custom_sections.relativeFilePath }, - lualine_x = { 'filetype' }, - lualine_y = {}, - lualine_z = {}, - }, - extensions = { 'quickfix', 'fugitive', 'nvim-tree' }, - }, config.plugins.lualine or {})) + require('lualine').setup(plugin_config) vim.api.nvim_create_autocmd('RecordingEnter', { callback = function() @@ -136,5 +137,4 @@ return { end, }) end, - enabled = not vim.tbl_contains(config.disable_builtin_plugins, 'lualine'), } diff --git a/lua/plugins/null-ls.lua b/lua/plugins/null-ls.lua index 96245ec..748f82e 100644 --- a/lua/plugins/null-ls.lua +++ b/lua/plugins/null-ls.lua @@ -1,4 +1,3 @@ -local config = require('config') local u = require('utils') return { @@ -10,19 +9,9 @@ return { config = function() local defaults = require('lsp.servers.defaults') local null_ls = require('null-ls') - local config_opts = u.merge({ - default_cosmic_sources = true, - }, config.lsp.null_ls or {}) - if config_opts.default_cosmic_sources then - local function get_config_sources() - if not config_opts.add_sources then - return {} - end - return config_opts.add_sources() - end - - config_opts.sources = u.merge_list({ + local config_opts = { + sources = { null_ls.builtins.code_actions.gitsigns, null_ls.builtins.diagnostics.markdownlint, null_ls.builtins.formatting.prettierd.with({ @@ -32,12 +21,11 @@ return { extra_filetypes = { 'astro' }, }), null_ls.builtins.formatting.stylua, - }, get_config_sources()) - end + } + } null_ls.setup(u.merge(defaults, config_opts)) end, --[[ event = 'BufEnter', ]] lazy = false, - enabled = not vim.tbl_contains(config.disable_builtin_plugins, 'null_ls'), } diff --git a/lua/plugins/nvim-cmp/config.lua b/lua/plugins/nvim-cmp/config.lua index d2bc966..569f0f7 100644 --- a/lua/plugins/nvim-cmp/config.lua +++ b/lua/plugins/nvim-cmp/config.lua @@ -1,10 +1,8 @@ local cmp = require('cmp') -local u = require('utils') local config = require('config') local icons = require('utils.icons') local cmp_autopairs = require('nvim-autopairs.completion.cmp') -local user_has_luasnip = not vim.tbl_contains(config.disable_builtin_plugins, 'luasnip') local _, luasnip = pcall(require, 'luasnip') local has_words_before = function() @@ -13,16 +11,13 @@ local has_words_before = function() return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match('%s') == nil end -local snippet = {} -if user_has_luasnip then - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - } -end +local snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, +} -local default_cmp_opts = { +local cmp_opts = { enabled = function() -- disable completion in comments local context = require('cmp.config.context') @@ -49,7 +44,7 @@ local default_cmp_opts = { [''] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() - elseif user_has_luasnip and luasnip.expand_or_jumpable() then + elseif luasnip.expand_or_jumpable() then luasnip.expand_or_jump() elseif has_words_before() then cmp.complete() @@ -63,7 +58,7 @@ local default_cmp_opts = { [''] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_prev_item() - elseif user_has_luasnip and luasnip.jumpable(-1) then + elseif luasnip.jumpable(-1) then luasnip.jump(-1) else fallback() @@ -111,7 +106,7 @@ local default_cmp_opts = { -- set up autopairs cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) -cmp.setup(u.merge(default_cmp_opts, config.plugins.nvim_cmp or {})) +cmp.setup(cmp_opts) -- Set configuration for specific filetype. cmp.setup.filetype('gitcommit', { diff --git a/lua/plugins/nvim-cmp/init.lua b/lua/plugins/nvim-cmp/init.lua index 8b93d96..d8c0352 100644 --- a/lua/plugins/nvim-cmp/init.lua +++ b/lua/plugins/nvim-cmp/init.lua @@ -1,6 +1,3 @@ -local config = require('config') -local u = require('utils') - return { 'hrsh7th/nvim-cmp', config = function() @@ -10,7 +7,6 @@ return { 'hrsh7th/cmp-nvim-lsp', { 'saadparwaiz1/cmp_luasnip', - enabled = not vim.tbl_contains(config.disable_builtin_plugins, 'luasnip'), }, 'hrsh7th/cmp-buffer', 'hrsh7th/cmp-cmdline', @@ -19,12 +15,12 @@ return { 'L3MON4D3/LuaSnip', config = function() local ls = require('luasnip') - ls.config.set_config(u.merge({ + ls.config.set_config({ history = true, -- Update more often, :h events for more info. updateevents = 'TextChanged,TextChangedI', enable_autosnippets = true, - }, config.plugins.luasnip or {})) + }) -- extend html snippets to react files require('luasnip').filetype_extend('javascriptreact', { 'html' }) @@ -36,9 +32,7 @@ return { dependencies = { 'rafamadriz/friendly-snippets', }, - enabled = not vim.tbl_contains(config.disable_builtin_plugins, 'luasnip'), }, }, event = 'InsertEnter', - enabled = not vim.tbl_contains(config.disable_builtin_plugins, 'nvim-cmp'), } diff --git a/lua/plugins/todo-comments.lua b/lua/plugins/todo-comments.lua index 3d7ff32..85d7d0e 100644 --- a/lua/plugins/todo-comments.lua +++ b/lua/plugins/todo-comments.lua @@ -1,16 +1,14 @@ -local config = require('config') local icons = require('utils.icons') -local u = require('utils') return { 'folke/todo-comments.nvim', dependencies = 'nvim-lua/plenary.nvim', config = function() - require('todo-comments').setup(u.merge({ + require('todo-comments').setup({ keywords = { FIX = { - icon = icons.debug, -- icon used for the sign, and in search results - color = 'error', -- can be a hex color, or a named color (see below) + icon = icons.debug, -- icon used for the sign, and in search results + color = 'error', -- can be a hex color, or a named color (see below) alt = { 'FIXME', 'BUG', 'FIXIT', 'ISSUE', 'fix', 'fixme', 'bug' }, -- a set of other keywords that all map to this FIX keywords -- signs = false, -- configure signs for some keywords individually }, @@ -27,8 +25,7 @@ return { hint = { 'DiagnosticHint', '#10B981' }, default = { 'Identifier', '#7C3AED' }, }, - }, config.plugins.todo_comments or {})) + }) end, event = 'VeryLazy', - enabled = not vim.tbl_contains(config.disable_builtin_plugins, 'todo-comments'), } diff --git a/lua/plugins/tokyonight/init.lua b/lua/plugins/tokyonight.lua similarity index 52% rename from lua/plugins/tokyonight/init.lua rename to lua/plugins/tokyonight.lua index e5613f5..32f0e2b 100644 --- a/lua/plugins/tokyonight/init.lua +++ b/lua/plugins/tokyonight.lua @@ -1,13 +1,16 @@ -local config = require('config') +local config = { + style = 'night', + light_style = 'moon', + sidebars = { 'qf', 'packer', 'help' }, +} + return { { -- color scheme 'folke/tokyonight.nvim', lazy = false, config = function() - local config = require('plugins.tokyonight.config') require('tokyonight').setup(config) vim.cmd('color tokyonight') end, - enabled = not vim.tbl_contains(config.disable_builtin_plugins, 'tokyonight'), }, } diff --git a/lua/plugins/tokyonight/config.lua b/lua/plugins/tokyonight/config.lua deleted file mode 100644 index 3d97add..0000000 --- a/lua/plugins/tokyonight/config.lua +++ /dev/null @@ -1,12 +0,0 @@ -local config = require('config') -local u = require('utils') - -local config = u.merge({ - - -- use the night style - style = 'night', - light_style = 'moon', - sidebars = { 'qf', 'packer', 'help' }, -}, config.plugins.tokyonight or {}) - -return config diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua index 9979a42..65c2bc9 100644 --- a/lua/plugins/which-key.lua +++ b/lua/plugins/which-key.lua @@ -1,4 +1,5 @@ local config = require('config') + return { 'folke/which-key.nvim', config = function() @@ -20,25 +21,24 @@ return { }) wk.add({ - { 'c', group = 'quickfix' }, - { 'f', group = 'find' }, - { 'g', group = 'goto' }, - { 'h', group = 'gitsigns' }, + { 'c', group = 'quickfix' }, + { 'f', group = 'find' }, + { 'g', group = 'goto' }, + { 'h', group = 'gitsigns' }, { 'ht', group = 'toggle' }, - { 'k', group = 'buffer' }, - { 'l', group = 'lsp' }, + { 'k', group = 'buffer' }, + { 'l', group = 'lsp' }, { 'ld', group = 'diagnostics' }, { 'lt', group = 'toggle' }, { 'lw', group = 'workspace' }, - { 'n', group = 'tree' }, - { 'p', group = 'lazy (plugins)' }, - { 's', group = 'session' }, - { 't', group = 'tab' }, - { 'v', group = 'git (vsc)' }, + { 'n', group = 'tree' }, + { 'p', group = 'lazy (plugins)' }, + { 's', group = 'session' }, + { 't', group = 'tab' }, + { 'v', group = 'git (vsc)' }, { 'vt', group = 'toggle' }, - { 'x', group = 'terminal' }, + { 'x', group = 'terminal' }, }) end, event = 'VeryLazy', - enabled = not vim.tbl_contains(config.disable_builtin_plugins, 'which-key'), }