From 5e258dca31a32f563eacd3a11dac19d441aff644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noah=20H=C3=A5kansson?= Date: Tue, 13 Feb 2024 17:11:07 +0100 Subject: [PATCH] add plugins --- lazy-lock.json | 35 +++++++++++++------------ lua/custom/plugins/colorizer.lua | 26 +++++++++---------- lua/custom/plugins/git-conflict.lua | 7 +++++ lua/custom/plugins/oil.lua | 40 +++++++++++++++++++++++++++++ lua/custom/plugins/persisted.lua | 18 ++++++------- 5 files changed, 87 insertions(+), 39 deletions(-) create mode 100644 lua/custom/plugins/git-conflict.lua create mode 100644 lua/custom/plugins/oil.lua diff --git a/lazy-lock.json b/lazy-lock.json index a20d2683..0a6b8f4f 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -5,51 +5,52 @@ "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "copilot.lua": { "branch": "master", "commit": "b03617a6dc4bc88b65ab5deac1631da9a9c2dcaf" }, + "copilot.lua": { "branch": "master", "commit": "03f825956ec49e550d07875d867ea6e7c4dc8c00" }, "dial.nvim": { "branch": "master", "commit": "27eb570085db2ef44bff4f620d3806039184651c" }, "dressing.nvim": { "branch": "master", "commit": "6f212262061a2120e42da0d1e87326e8a41c0478" }, "eyeliner.nvim": { "branch": "main", "commit": "c540d58bf52aa979d4cca639c60387ae0c0ccf88" }, - "fidget.nvim": { "branch": "main", "commit": "1d1042d418ee8cb70d68f1e38db639844331c093" }, + "fidget.nvim": { "branch": "main", "commit": "ad8873c16faa123fe3f9fd6539c41dfb0f97a9e9" }, "friendly-snippets": { "branch": "main", "commit": "b8fae73a479ae0a1c54f5c98fa687ae8a0addc53" }, "gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" }, - "go.nvim": { "branch": "master", "commit": "24d2fa373d55d9900cd4b502a88214dc17e6fab6" }, + "go.nvim": { "branch": "master", "commit": "9ccb57766e44458c233a1e4975f78a9340a4ce4b" }, "guihua.lua": { "branch": "master", "commit": "9fb6795474918b492d9ab01b1ebaf85e8bf6fe0b" }, "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, "indent-blankline.nvim": { "branch": "master", "commit": "12e92044d313c54c438bd786d11684c88f6f78cd" }, "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, "lsp_signature.nvim": { "branch": "master", "commit": "fed2c8389c148ff1dfdcdca63c2b48d08a50dea0" }, "lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "b9084b1f42f790d6230dc66dbcb6bcc35b148552" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "0954d7730e749d606ddf8d7ae8846848be435d53" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "3614a39aae98ccd34124b072939d6283853b3dd2" }, "mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" }, - "neodev.nvim": { "branch": "main", "commit": "345ed5843405126464119154f394d4298c1314c7" }, - "none-ls.nvim": { "branch": "main", "commit": "912f81829e9ab4ee3d54c3ea5a304c264f0003bc" }, + "neodev.nvim": { "branch": "main", "commit": "b49b976cf2c28cd8283e9d74cb10885f6dd9e3d0" }, + "none-ls.nvim": { "branch": "main", "commit": "c10b7be7751aee820a02f2d1fafe76bc316fe223" }, "nvim-autopairs": { "branch": "master", "commit": "096d0baecc34f6c5d8a6dd25851e9d5ad338209b" }, "nvim-bqf": { "branch": "main", "commit": "bdc2a4e5bb670b3c0e33ada9c0eec636d93a0748" }, - "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, + "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, - "nvim-dap": { "branch": "master", "commit": "9adbfdca13afbe646d09a8d7a86d5d031fb9c5a5" }, + "nvim-dap": { "branch": "master", "commit": "780fd4dd06b0744b235a520d71660c45279d9447" }, "nvim-dap-go": { "branch": "main", "commit": "a5cc8dcad43f0732585d4793deb02a25c4afb766" }, "nvim-dap-ui": { "branch": "master", "commit": "d845ebd798ad1cf30aa4abd4c4eff795cdcfdd4f" }, - "nvim-lspconfig": { "branch": "master", "commit": "1759ea68fbbb1303192020d3e59936189359e0ed" }, + "nvim-lspconfig": { "branch": "master", "commit": "f12f1b9e877b1e6e2ef7eae1a524d8253af4243d" }, "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, "nvim-surround": { "branch": "main", "commit": "703ec63aa798e5e07d309b35e42def34bebe0174" }, - "nvim-tree.lua": { "branch": "master", "commit": "f39f7b6fcd3865ac2146de4cb4045286308f2935" }, - "nvim-treesitter": { "branch": "master", "commit": "ba6454783493ac3a5dd209c25e491640b07bd8de" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "19a91a38b02c1c28c14e0ba468d20ae1423c39b2" }, - "nvim-web-devicons": { "branch": "master", "commit": "aaec87dbdaa776bfa0a13c8694bec9bcb7454719" }, + "nvim-tree.lua": { "branch": "master", "commit": "8cbb1db8e90b62fc56f379992e622e9f919792ce" }, + "nvim-treesitter": { "branch": "master", "commit": "4b00de5633be5f51a2e8da4db5cc0b5cdf9f89e1" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "dd0b2036c3a27cb6e6486f8bd24188c6ca43af0b" }, + "nvim-web-devicons": { "branch": "master", "commit": "313d9e7193354c5de7cdb1724f9e2d3f442780b0" }, + "oil.nvim": { "branch": "master", "commit": "bf753c3e3f8736939ad5597f92329dfe7b1df4f5" }, "onedark.nvim": { "branch": "master", "commit": "1230aaf2a427b2c5b73aba6e4a9a5881d3e69429" }, "persisted.nvim": { "branch": "main", "commit": "edd8aa41cd87f9da1b6ef0c584068dea192f65b7" }, "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, - "schemastore.nvim": { "branch": "main", "commit": "273cd742bf86aedc21c1154a2bcea044071f48d6" }, + "schemastore.nvim": { "branch": "main", "commit": "d30f650b1b1b3b059328230a7ed8edccf6aaa522" }, "ssr.nvim": { "branch": "main", "commit": "bb323ba621ac647b4ac5638b47666e3ef3c279e1" }, "substitute.nvim": { "branch": "main", "commit": "17ffaeb5a1dc2dbef39cf0865d8a4b6000836714" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, "telescope.nvim": { "branch": "0.1.x", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, "typescript-tools.nvim": { "branch": "master", "commit": "c43d9580c3ff5999a1eabca849f807ab33787ea7" }, - "undotree": { "branch": "main", "commit": "80552a0180b49e5ba072c89ae91ce5d4e3aed36b" }, - "vim-fugitive": { "branch": "master", "commit": "f116dcc8e21021e6fbfb6b0a9f8f7b9566d933f4" }, - "vim-illuminate": { "branch": "master", "commit": "97c1265ff0b67064b6cfdc15bafc50202a537ae2" }, + "undotree": { "branch": "main", "commit": "c6456101db0554fa0e9eb6a7d8ca9c2430953482" }, + "vim-fugitive": { "branch": "master", "commit": "fab00f7c0f3a08e860e39c7adeb8fbe849921a98" }, + "vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" }, "vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" }, "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } diff --git a/lua/custom/plugins/colorizer.lua b/lua/custom/plugins/colorizer.lua index 9bed948e..2063ca1f 100644 --- a/lua/custom/plugins/colorizer.lua +++ b/lua/custom/plugins/colorizer.lua @@ -1,33 +1,33 @@ local M = { 'NvChad/nvim-colorizer.lua', lazy = true, - event = 'VeryLazy', + event = 'BufRead', } function M.config() require('colorizer').setup({ filetypes = { '*' }, user_default_options = { - RGB = true, -- #RGB hex codes #ABC - RRGGBB = true, -- #RRGGBB hex codes #777AAA - names = true, -- "Name" codes like Blue or blue - RRGGBBAA = false, -- #RRGGBBAA hex codes - AARRGGBB = false, -- 0xAARRGGBB hex codes - rgb_fn = true, -- CSS rgb() and rgba() functions - hsl_fn = true, -- CSS hsl() and hsla() functions - css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB - css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn + RGB = true, -- #RGB hex codes #ABC + RRGGBB = true, -- #RRGGBB hex codes #777AAA + names = true, -- "Name" codes like Blue or blue + RRGGBBAA = false, -- #RRGGBBAA hex codes + AARRGGBB = false, -- 0xAARRGGBB hex codes + rgb_fn = true, -- CSS rgb() and rgba() functions + hsl_fn = true, -- CSS hsl() and hsla() functions + css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB + css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn -- Available modes for `mode`: foreground, background, virtualtext mode = 'background', -- Set the display mode. -- Available methods are false / true / "normal" / "lsp" / "both" -- True is same as normal - tailwind = true, -- Enable tailwind colors + tailwind = true, -- Enable tailwind colors -- parsers can contain values used in |user_default_options| - sass = { enable = false, parsers = { 'css' } }, -- Enable sass colors + sass = { enable = true, parsers = { 'css' } }, -- Enable sass colors virtualtext = '■', -- update color values even if buffer is not focused -- example use: cmp_menu, cmp_docs - always_update = false, + always_update = true, }, -- all the sub-options of filetypes apply to buftypes buftypes = {}, diff --git a/lua/custom/plugins/git-conflict.lua b/lua/custom/plugins/git-conflict.lua new file mode 100644 index 00000000..71d20002 --- /dev/null +++ b/lua/custom/plugins/git-conflict.lua @@ -0,0 +1,7 @@ +local M = { + 'akinsho/git-conflict.nvim', + version = '*', + config = true, +} + +return M diff --git a/lua/custom/plugins/oil.lua b/lua/custom/plugins/oil.lua new file mode 100644 index 00000000..ebe2c3bd --- /dev/null +++ b/lua/custom/plugins/oil.lua @@ -0,0 +1,40 @@ +local M = { + 'stevearc/oil.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, +} + +function M.config() + require('oil').setup({ + float = { + max_height = 30, + max_width = 120, + }, + keymaps = { + ['g?'] = 'actions.show_help', + [''] = 'actions.select', + [''] = 'actions.select_vsplit', + [''] = 'actions.select_split', + [''] = 'actions.select_tab', + [''] = 'actions.preview', + ['q'] = 'actions.close', + [''] = 'actions.refresh', + [''] = 'actions.parent', + ['_'] = 'actions.open_cwd', + -- ['`'] = 'actions.cd', + -- ['~'] = 'actions.tcd', + ['`'] = 'false', + ['~'] = 'false', + ['gs'] = 'actions.change_sort', + ['gx'] = 'actions.open_external', + ['g.'] = 'actions.toggle_hidden', + -- ['g\\'] = 'actions.toggle_trash', + ['g\\'] = 'false', + }, + view_options = { + show_hidden = true, + }, + }) + vim.keymap.set('n', '', 'Oil --float', { desc = 'Open parent directory' }) +end + +return M diff --git a/lua/custom/plugins/persisted.lua b/lua/custom/plugins/persisted.lua index 4b3d54bb..186373ea 100644 --- a/lua/custom/plugins/persisted.lua +++ b/lua/custom/plugins/persisted.lua @@ -10,27 +10,27 @@ local M = { function M.config() require('persisted').setup({ save_dir = vim.fn.expand(vim.fn.stdpath('data') .. '/sessions/'), -- directory where session files are saved: Resolves to ~/.local/share/lvim/sessions/ - silent = false, -- silent nvim message when sourcing session file - use_git_branch = true, -- create session files based on the branch of the git enabled repository - autosave = true, -- automatically save session files when exiting Neovim - should_autosave = function() -- function to determine if a session should be autosaved + silent = false, -- silent nvim message when sourcing session file + use_git_branch = true, -- create session files based on the branch of the git enabled repository + autosave = true, -- automatically save session files when exiting Neovim + should_autosave = function() -- function to determine if a session should be autosaved -- do not autosave if the current filetype is ""(empty buffer), NvimTree or alpha if vim.bo.filetype == '' or vim.bo.filetype == 'NvimTree' or vim.bo.filetype == 'alpha' then return false end return true end, - autoload = true, -- automatically load the session for the cwd on Neovim startup + autoload = true, -- automatically load the session for the cwd on Neovim startup on_autoload_no_session = function() -- function to run when `autoload = true` but there is no session to load end, - follow_cwd = true, -- change session file name to match current working directory if it changes + follow_cwd = true, -- change session file name to match current working directory if it changes allowed_dirs = { '~/Flexfiles', '~/projects', '~/work', - }, -- table of dirs that the plugin will auto-save and auto-load from - ignored_dirs = nil, -- table of dirs that are ignored when auto-saving and auto-loading - telescope = { -- options for the telescope extension + }, -- table of dirs that the plugin will auto-save and auto-load from + ignored_dirs = nil, -- table of dirs that are ignored when auto-saving and auto-loading + telescope = { -- options for the telescope extension reset_prompt_after_deletion = true, -- whether to reset prompt after session deleted }, })