From a010833bc33d6e061b070b9c5e75c6dc944bf689 Mon Sep 17 00:00:00 2001 From: "Lackermeier, Florian" Date: Thu, 16 May 2024 14:34:39 +0200 Subject: [PATCH] More stuff --- init.lua | 10 +++++----- lua/custom/plugins/auto_session.lua | 18 ++++++++++++++++++ .../{gruvbox_material.lua => colorschemes.lua} | 18 ++++++++++++++++++ lua/custom/plugins/undotree.lua | 6 ++++++ lua/custom/plugins/vim_fugitive.lua | 2 +- 5 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 lua/custom/plugins/auto_session.lua rename lua/custom/plugins/{gruvbox_material.lua => colorschemes.lua} (63%) create mode 100644 lua/custom/plugins/undotree.lua diff --git a/init.lua b/init.lua index 01aa51e4..a1bbe4ce 100644 --- a/init.lua +++ b/init.lua @@ -718,9 +718,9 @@ require('lazy').setup({ -- No, but seriously. Please read `:help ins-completion`, it is really good! mapping = cmp.mapping.preset.insert { -- Select the [n]ext item - [''] = cmp.mapping.select_next_item(), + -- [''] = cmp.mapping.select_next_item(), -- Select the [p]revious item - [''] = cmp.mapping.select_prev_item(), + -- [''] = cmp.mapping.select_prev_item(), -- Scroll the documentation window [b]ack / [f]orward [''] = cmp.mapping.scroll_docs(-4), @@ -729,13 +729,13 @@ require('lazy').setup({ -- Accept ([y]es) the completion. -- This will auto-import if your LSP supports it. -- This will expand snippets if the LSP sent a snippet. - [''] = cmp.mapping.confirm { select = true }, + [''] = cmp.mapping.confirm { select = true }, -- If you prefer more traditional completion keymaps, -- you can uncomment the following lines --[''] = cmp.mapping.confirm { select = true }, - --[''] = cmp.mapping.select_next_item(), - --[''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_prev_item(), -- Manually trigger a completion from nvim-cmp. -- Generally you don't need this, because nvim-cmp will display diff --git a/lua/custom/plugins/auto_session.lua b/lua/custom/plugins/auto_session.lua new file mode 100644 index 00000000..066dca78 --- /dev/null +++ b/lua/custom/plugins/auto_session.lua @@ -0,0 +1,18 @@ +return { + 'rmagatti/auto-session', + config = function() + require("auto-session").setup { + log_level = "error", + + cwd_change_handling = { + restore_upcoming_session = true, -- already the default, no need to specify like this, only here as an example + pre_cwd_changed_hook = nil, -- already the default, no need to specify like this, only here as an example + post_cwd_changed_hook = function() -- example refreshing the lualine status line _after_ the cwd changes + require("lualine").refresh() -- refresh lualine so the new session name is displayed in the status bar + end, + }, + } + end +} + + diff --git a/lua/custom/plugins/gruvbox_material.lua b/lua/custom/plugins/colorschemes.lua similarity index 63% rename from lua/custom/plugins/gruvbox_material.lua rename to lua/custom/plugins/colorschemes.lua index 8b82f2a0..cd942ae0 100644 --- a/lua/custom/plugins/gruvbox_material.lua +++ b/lua/custom/plugins/colorschemes.lua @@ -1,4 +1,6 @@ return{ + { + -- Gruvbox colorscheme 'sainnhe/gruvbox-material', priority = 1000, -- Make sure to load this before all the other start plugins. init = function() @@ -10,4 +12,20 @@ return{ -- You can configure highlights by doing something like: -- vim.cmd.hi 'Comment gui=none' end, + }, + { + -- catpuccin colorscheme + "catppuccin/nvim", + priority = 1000, + }, + { + -- kanagawa.nvim colorscheme + 'rebelot/kanagawa.nvim', + priority = 1000, + }, + { + -- onedark colorscheme + 'navarasu/onedark.nvim', + priority = 1000, + }, } diff --git a/lua/custom/plugins/undotree.lua b/lua/custom/plugins/undotree.lua new file mode 100644 index 00000000..86ea4b89 --- /dev/null +++ b/lua/custom/plugins/undotree.lua @@ -0,0 +1,6 @@ +return { + 'mbbill/undotree', + config = function() + vim.keymap.set('n', 'ut', vim.cmd.UndotreeToggle, { desc = "[u]ndo [t]ree"}) + end, +} diff --git a/lua/custom/plugins/vim_fugitive.lua b/lua/custom/plugins/vim_fugitive.lua index 16788849..a0f4779c 100644 --- a/lua/custom/plugins/vim_fugitive.lua +++ b/lua/custom/plugins/vim_fugitive.lua @@ -1,6 +1,6 @@ return { 'tpope/vim-fugitive', config = function() - + vim.keymap.set('n', 'G', vim.cmd.G, { desc = 'Open [G]it Window' }) end, }