From dbc1095cb44248179bd53e099293a6584f22a869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Kmie=C4=87?= Date: Mon, 20 Nov 2023 10:30:28 +0100 Subject: [PATCH] Nvim: update plugins with newer maintainers --- .config/nvim/lua/plugins/ascii_image.lua | 13 +++++ .config/nvim/lua/plugins/colorschemes.lua | 24 ++++---- .config/nvim/lua/plugins/gitlinker.lua | 40 ++++++------- .config/nvim/lua/plugins/illuminate.lua | 60 ++++++++++---------- .config/nvim/lua/plugins/image.lua | 43 ++++++++++---- .config/nvim/lua/plugins/jupyter.lua | 40 +++++++++++++ .config/nvim/lua/plugins/leap.lua | 26 ++++----- .config/nvim/lua/plugins/note.lua | 4 -- .config/nvim/lua/plugins/rainbow.lua | 27 +++++++++ .config/nvim/lua/plugins/symbols-outline.lua | 2 +- .config/nvim/lua/plugins/treesitter.lua | 20 ------- 11 files changed, 188 insertions(+), 111 deletions(-) create mode 100644 .config/nvim/lua/plugins/ascii_image.lua create mode 100644 .config/nvim/lua/plugins/jupyter.lua delete mode 100644 .config/nvim/lua/plugins/note.lua create mode 100644 .config/nvim/lua/plugins/rainbow.lua diff --git a/.config/nvim/lua/plugins/ascii_image.lua b/.config/nvim/lua/plugins/ascii_image.lua new file mode 100644 index 0000000..3d9f1af --- /dev/null +++ b/.config/nvim/lua/plugins/ascii_image.lua @@ -0,0 +1,13 @@ +return { + 'samodostal/image.nvim', + opts = { + render = { + min_padding = 5, + show_label = true, + use_dither = true, + }, + events = { + update_on_nvim_resize = true, + }, + } +} diff --git a/.config/nvim/lua/plugins/colorschemes.lua b/.config/nvim/lua/plugins/colorschemes.lua index 6015c4b..7779e01 100644 --- a/.config/nvim/lua/plugins/colorschemes.lua +++ b/.config/nvim/lua/plugins/colorschemes.lua @@ -10,84 +10,84 @@ return {{ "wuelnerdotexe/vim-enfocado", lazy = false, config = function() - --vim.cmd([[ colorscheme enfocado]]) + --vim.cmd.colorscheme('enfocado') end }, { "fenetikm/falcon", lazy = false, config = function() - --vim.cmd([[ colorscheme falcon]]) + --vim.cmd.colorscheme('falcon') end }, { "casr/vim-colors-reference", lazy = false, config = function() - --vim.cmd([[ colorscheme reference]]) + --vim.cmd.colorscheme('reference') end }, { "blazkowolf/gruber-darker.nvim", lazy = false, config = function() - --vim.cmd([[ colorscheme gruber-darker]]) + --vim.cmd.colorscheme('gruber-darker') end }, { "rebelot/kanagawa.nvim", lazy = false, config = function() - --vim.cmd([[ colorscheme kanagawa]]) + --vim.cmd.colorscheme('kanagawa') end }, { "jaredgorski/spacecamp", lazy = false, config = function() - --vim.cmd([[ colorscheme spacecamp]]) + --vim.cmd.colorscheme('spacecamp') end }, { "lifepillar/vim-gruvbox8", lazy = false, config = function() - --vim.cmd([[ colorscheme gruvbox8]]) + --vim.cmd.colorscheme('gruvbox8') end }, { "marko-cerovac/material.nvim", lazy = false, config = function() - --vim.cmd([[ colorscheme material]]) + --vim.cmd.colorscheme('material') end }, { "srcery-colors/srcery-vim", lazy = false, config = function() - --vim.cmd([[ colorscheme srcery]]) + --vim.cmd.colorscheme('srcery') end }, { "tanvirtin/monokai.nvim", lazy = false, config = function() - --vim.cmd([[ colorscheme monokai]]) + --vim.cmd.colorscheme('monokai') end }, { "dasupradyumna/midnight.nvim", lazy = false, config = function() - --vim.cmd([[ colorscheme midnight]]) + --vim.cmd.colorscheme('midnight') end }, { "bluz71/vim-moonfly-colors", lazy = false, config = function() - vim.cmd([[ colorscheme moonfly]]) + vim.cmd.colorscheme('moonfly') end } } diff --git a/.config/nvim/lua/plugins/gitlinker.lua b/.config/nvim/lua/plugins/gitlinker.lua index 9d415e1..2e23908 100644 --- a/.config/nvim/lua/plugins/gitlinker.lua +++ b/.config/nvim/lua/plugins/gitlinker.lua @@ -1,28 +1,28 @@ return { - 'ruifm/gitlinker.nvim', + 'linrongbin16/gitlinker.nvim', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { - callbacks = { - ["git.viessmann.com"] = function(url_data) - local url = require'gitlinker.hosts'.get_base_https_url(url_data) - if not url_data.file or not url_data.rev then - return url - end - url = url .. "/src/" .. url_data.rev .. "/" .. url_data.file - - if not url_data.lstart then - return url - end - url = url .. "#lines-" .. url_data.lstart - if url_data.lend then - url = url .. ":" .. url_data.lend - end - - return url - end - }, + -- callbacks = { + -- ["git.viessmann.com"] = function(url_data) + -- local url = require'gitlinker.hosts'.get_base_https_url(url_data) + -- if not url_data.file or not url_data.rev then + -- return url + -- end + -- url = url .. "/src/" .. url_data.rev .. "/" .. url_data.file + -- + -- if not url_data.lstart then + -- return url + -- end + -- url = url .. "#lines-" .. url_data.lstart + -- if url_data.lend then + -- url = url .. ":" .. url_data.lend + -- end + -- + -- return url + -- end + -- }, -- default mapping to call url generation with action_callback mappings = "gl" } diff --git a/.config/nvim/lua/plugins/illuminate.lua b/.config/nvim/lua/plugins/illuminate.lua index 0992b6d..5443acd 100644 --- a/.config/nvim/lua/plugins/illuminate.lua +++ b/.config/nvim/lua/plugins/illuminate.lua @@ -19,37 +19,37 @@ return { exclude_filetypes = {'log'}, callbacks = { -- -- to trigger the close_events of vim.diagnostic.open_float. - -- function () - -- -- Close floating diag. and make it triggerable again. - -- vim.api.nvim_exec_autocmds("User", { pattern = "MurmurDiagnostics"}) - -- vim.w.diag_shown = false - -- end, + function () + -- Close floating diag. and make it triggerable again. + vim.api.nvim_exec_autocmds("User", { pattern = "MurmurDiagnostics"}) + vim.w.diag_shown = false + end, } } - vim.api.nvim_create_autocmd('CursorHold', { - group = HIGHLIGHT, - pattern = '*', - callback = function () - -- skip when a float-win already exists. - if vim.w.diag_shown then return end - - -- open float-win when hovering on a cursor-word. - if vim.w.cursor_word ~= '' then - vim.diagnostic.open_float({ - scope = 'cursor', - close_events = { "InsertEnter", "User MurmurDiagnostics" }, - }) - vim.api.nvim_create_autocmd("WinClosed", { - group = HIGHLIGHT, - buffer = buf, - once = true, - callback = function() vim.w.diag_shown = false end, - }) - vim.w.diag_shown = true - else - vim.w.diag_shown = false - end - end - }) + -- vim.api.nvim_create_autocmd('CursorHold', { + -- group = HIGHLIGHT, + -- pattern = '*', + -- callback = function () + -- -- skip when a float-win already exists. + -- if vim.w.diag_shown then return end + -- + -- -- open float-win when hovering on a cursor-word. + -- if vim.w.cursor_word ~= '' then + -- vim.diagnostic.open_float({ + -- scope = 'cursor', + -- close_events = { "InsertEnter", "User MurmurDiagnostics" }, + -- }) + -- vim.api.nvim_create_autocmd("WinClosed", { + -- group = HIGHLIGHT, + -- buffer = buf, + -- once = true, + -- callback = function() vim.w.diag_shown = false end, + -- }) + -- vim.w.diag_shown = true + -- else + -- vim.w.diag_shown = false + -- end + -- end + -- }) end } diff --git a/.config/nvim/lua/plugins/image.lua b/.config/nvim/lua/plugins/image.lua index 3d9f1af..2b3a4ff 100644 --- a/.config/nvim/lua/plugins/image.lua +++ b/.config/nvim/lua/plugins/image.lua @@ -1,13 +1,34 @@ return { - 'samodostal/image.nvim', - opts = { - render = { - min_padding = 5, - show_label = true, - use_dither = true, - }, - events = { - update_on_nvim_resize = true, - }, - } + '3rd/image.nvim', + -- default config + config = function () + require('image').setup({ + backend = "kitty", + integrations = { + markdown = { + enabled = true, + clear_in_insert_mode = false, + download_remote_images = true, + only_render_image_at_cursor = false, + filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here + }, + neorg = { + enabled = true, + clear_in_insert_mode = false, + download_remote_images = true, + only_render_image_at_cursor = false, + filetypes = { "norg" }, + }, + }, + max_width = nil, + max_height = nil, + max_width_window_percentage = nil, + max_height_window_percentage = 50, + window_overlap_clear_enabled = false, -- toggles images when windows are overlapped + window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "" }, + editor_only_render_when_focused = false, -- auto show/hide images when the editor gains/looses focus + tmux_show_only_in_active_window = false, -- auto show/hide images in the correct Tmux window (needs visual-activity off) + hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp" }, -- render image files as images when opened + }) + end } diff --git a/.config/nvim/lua/plugins/jupyter.lua b/.config/nvim/lua/plugins/jupyter.lua new file mode 100644 index 0000000..b5171a9 --- /dev/null +++ b/.config/nvim/lua/plugins/jupyter.lua @@ -0,0 +1,40 @@ +return { + { + "benlubas/molten-nvim", + dependencies = { "3rd/image.nvim" }, + build = ":UpdateRemotePlugins", + config = function() + -- these are examples, not defaults. Please see the readme + vim.g.molten_image_provider = "image.nvim" + vim.g.molten_output_win_max_height = 20 + vim.g.molten_auto_open_output = false + vim.keymap.set("n", "R", ":MoltenEvaluateOperator", + { silent = true, noremap = true, desc = "run operator selection" }) + vim.keymap.set("n", "rl", ":MoltenEvaluateLine", + { silent = true, noremap = true, desc = "evaluate line" }) + vim.keymap.set("n", "rc", ":MoltenReevaluateCell", + { silent = true, noremap = true, desc = "re-evaluate cell" }) + vim.keymap.set("v", "r", ":MoltenEvaluateVisualgv", + { silent = true, noremap = true, desc = "evaluate visual selection" }) + end, + }, + { + -- see the image.nvim readme for more information about configuring this plugin + "3rd/image.nvim", + opts = { + backend = "kitty", -- whatever backend you would like to use + max_width = 100, + max_height = 12, + max_height_window_percentage = math.huge, + max_width_window_percentage = math.huge, + window_overlap_clear_enabled = true, -- toggles images when windows are overlapped + window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "" }, + }, + }, + { + 'goerz/jupytext.vim', + config = function() + vim.cmd([[ let g:jupytext_enable = 1 ]]) + end + } +} diff --git a/.config/nvim/lua/plugins/leap.lua b/.config/nvim/lua/plugins/leap.lua index a445165..689addd 100644 --- a/.config/nvim/lua/plugins/leap.lua +++ b/.config/nvim/lua/plugins/leap.lua @@ -5,18 +5,18 @@ return { -- place this in one of your configuration file(s) local hop = require('hop') hop.setup() - local directions = require('hop.hint').HintDirection - vim.keymap.set('', 'f', function() - hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = false }) - end, {remap=true}) - vim.keymap.set('', 'F', function() - hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = false }) - end, {remap=true}) - vim.keymap.set('', 't', function() - hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = false, hint_offset = -1 }) - end, {remap=true}) - vim.keymap.set('', 'T', function() - hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = false, hint_offset = 1 }) - end, {remap=true}) + -- local directions = require('hop.hint').HintDirection + -- vim.keymap.set('', 'f', function() + -- hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = false }) + -- end, {remap=true}) + -- vim.keymap.set('', 'F', function() + -- hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = false }) + -- end, {remap=true}) + -- vim.keymap.set('', 't', function() + -- hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = false, hint_offset = -1 }) + -- end, {remap=true}) + -- vim.keymap.set('', 'T', function() + -- hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = false, hint_offset = 1 }) + -- end, {remap=true}) end, } diff --git a/.config/nvim/lua/plugins/note.lua b/.config/nvim/lua/plugins/note.lua deleted file mode 100644 index 6a96d99..0000000 --- a/.config/nvim/lua/plugins/note.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - 'gsuuon/note.nvim', - config = true -} diff --git a/.config/nvim/lua/plugins/rainbow.lua b/.config/nvim/lua/plugins/rainbow.lua new file mode 100644 index 0000000..05f487f --- /dev/null +++ b/.config/nvim/lua/plugins/rainbow.lua @@ -0,0 +1,27 @@ +return { + 'HiPhish/rainbow-delimiters.nvim', + config = function() + -- This module contains a number of default definitions + local rainbow_delimiters = require 'rainbow-delimiters' + + vim.g.rainbow_delimiters = { + strategy = { + [''] = rainbow_delimiters.strategy['global'], + vim = rainbow_delimiters.strategy['local'], + }, + query = { + [''] = 'rainbow-delimiters', + lua = 'rainbow-blocks', + }, + highlight = { + 'RainbowDelimiterRed', + 'RainbowDelimiterYellow', + 'RainbowDelimiterBlue', + 'RainbowDelimiterOrange', + 'RainbowDelimiterGreen', + 'RainbowDelimiterViolet', + 'RainbowDelimiterCyan', + }, + } + end +} diff --git a/.config/nvim/lua/plugins/symbols-outline.lua b/.config/nvim/lua/plugins/symbols-outline.lua index 50208d7..80e0cc4 100644 --- a/.config/nvim/lua/plugins/symbols-outline.lua +++ b/.config/nvim/lua/plugins/symbols-outline.lua @@ -1,4 +1,4 @@ return { - 'simrat39/symbols-outline.nvim', + 'hedyhli/outline.nvim', config = true } diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua index 027295b..6e7b5ed 100644 --- a/.config/nvim/lua/plugins/treesitter.lua +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -3,7 +3,6 @@ return { dependencies = { 'mizlan/iswap.nvim', 'romgrk/nvim-treesitter-context', - 'HiPhish/nvim-ts-rainbow2', 'Wansmer/sibling-swap.nvim', --"nvim-treesitter/nvim-treesitter-textobjects", --"nvim-treesitter/playground", @@ -79,25 +78,6 @@ return { node_decremental = "td", }, }, - rainbow = { - enable = false, - -- disable = { "jsx", "cpp" }, list of languages you want to disable the plugin for - extended_mode = false, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean - max_file_lines = 5000, -- Do not enable for files with more than n lines, int - -- colors = {}, -- table of hex strings - -- termcolors = {} -- table of colour name strings - }, - --textobjects = { - -- swap = { - -- enable = true, - -- swap_next = { - -- ["tan"] = "@parameter.inner", - -- }, - -- swap_previous = { - -- ["tap"] = "@parameter.inner", - -- }, - -- }, - --}, matchup = { enable = true, -- disable = { "c", "ruby" },