From 9d0b79ea1fd56a0af2500a6d6d269131073e3f20 Mon Sep 17 00:00:00 2001 From: Willem Haffmans Date: Fri, 26 Jul 2024 15:40:33 +0200 Subject: [PATCH] lualine, noice, norminette, undotree added. :w on jk --- lua/custom/plugins/lualine.lua | 50 +++++++++++++++++++++++++++++++ lua/custom/plugins/noice.lua | 37 +++++++++++++++++++++++ lua/custom/plugins/norminette.lua | 13 ++++++++ lua/custom/plugins/undotree.lua | 29 ++++++++++++++++++ lua/keymaps.lua | 2 +- 5 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 lua/custom/plugins/lualine.lua create mode 100644 lua/custom/plugins/noice.lua create mode 100644 lua/custom/plugins/norminette.lua create mode 100644 lua/custom/plugins/undotree.lua diff --git a/lua/custom/plugins/lualine.lua b/lua/custom/plugins/lualine.lua new file mode 100644 index 0000000..c7b1c46 --- /dev/null +++ b/lua/custom/plugins/lualine.lua @@ -0,0 +1,50 @@ +return { + { + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function() + local custom_everforest = require 'lualine.themes.everforest' + custom_everforest.insert.a.bg = '#7fbbb3' + require('lualine').setup { + options = { + icons_enabled = true, + theme = custom_everforest, + component_separators = { left = '', right = '' }, + section_separators = { left = '', right = '' }, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + globalstatus = false, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + }, + }, + sections = { + lualine_a = { 'mode' }, + lualine_b = { 'branch', 'diff', 'diagnostics' }, + lualine_c = { 'filename' }, + lualine_x = { 'encoding', 'fileformat', 'filetype' }, + lualine_y = { 'progress' }, + lualine_z = { 'location' }, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { 'filename' }, + lualine_x = { 'location' }, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {}, + } + end, + }, +} diff --git a/lua/custom/plugins/noice.lua b/lua/custom/plugins/noice.lua new file mode 100644 index 0000000..ddc97f3 --- /dev/null +++ b/lua/custom/plugins/noice.lua @@ -0,0 +1,37 @@ +return { + { + 'folke/noice.nvim', + event = 'VeryLazy', + opts = { + -- add any options here + }, + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries + 'MunifTanjim/nui.nvim', + -- OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + -- 'rcarriga/nvim-notify', + }, + config = function() + require('noice').setup { + lsp = { + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ['vim.lsp.util.convert_input_to_markdown_lines'] = true, + ['vim.lsp.util.stylize_markdown'] = true, + ['cmp.entry.get_documentation'] = true, -- requires hrsh7th/nvim-cmp + }, + }, + -- you can enable a preset for easier configuration + presets = { + bottom_search = true, -- use a classic bottom cmdline for search + command_palette = true, -- position the cmdline and popupmenu together + long_message_to_split = true, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = false, -- add a border to hover docs and signature help + }, + } + end, + }, +} diff --git a/lua/custom/plugins/norminette.lua b/lua/custom/plugins/norminette.lua new file mode 100644 index 0000000..3e293b2 --- /dev/null +++ b/lua/custom/plugins/norminette.lua @@ -0,0 +1,13 @@ +return { + { + 'hardyrafael17/norminette42.nvim', + config = function() + local norminette = require 'norminette' + norminette.setup { + runOnSave = true, + maxErrorsToShow = 15, + active = true, + } + end, + }, +} diff --git a/lua/custom/plugins/undotree.lua b/lua/custom/plugins/undotree.lua new file mode 100644 index 0000000..4d918d1 --- /dev/null +++ b/lua/custom/plugins/undotree.lua @@ -0,0 +1,29 @@ +return { + { + 'jiaoshijie/undotree', + dependencies = 'nvim-lua/plenary.nvim', + config = true, + keys = { -- load the plugin only when using it's keybinding: + { 'u', "lua require('undotree').toggle()" }, + }, + opts = { + float_diff = true, -- using float window previews diff, set this `true` will disable layout option + layout = 'left_bottom', -- "left_bottom", "left_left_bottom" + position = 'left', -- "right", "bottom" + ignore_filetype = { 'undotree', 'undotreeDiff', 'qf', 'TelescopePrompt', 'spectre_panel', 'tsplayground' }, + window = { + winblend = 30, + }, + keymaps = { + ['j'] = 'move_next', + ['k'] = 'move_prev', + ['gj'] = 'move2parent', + ['J'] = 'move_change_next', + ['K'] = 'move_change_prev', + [''] = 'action_enter', + ['p'] = 'enter_diffbuf', + ['q'] = 'quit', + }, + }, + }, +} diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 01803a2..f78c24c 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -45,5 +45,5 @@ vim.api.nvim_create_autocmd('TextYankPost', { end, }) -vim.keymap.set('i', 'jk', '') +vim.keymap.set('i', 'jk', ':w') -- vim: ts=2 sts=2 sw=2 et