From ff9bf47099190e1e6aba821ed69b341efbf3865a Mon Sep 17 00:00:00 2001 From: fiplox Date: Wed, 21 Jun 2023 22:18:24 +0200 Subject: [PATCH] feat: replace hop with flash --- lua/plugins/init.lua | 72 ++++++++++++++------------------------------ 1 file changed, 23 insertions(+), 49 deletions(-) diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index b7be47e..80b48d4 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -12,9 +12,27 @@ return { -- event = 'VeryLazy' }, { - 'phaazon/hop.nvim', -- event = 'BufRead', - keys = { { 's', ':HopChar2' }, { 'S', ':HopWord' } }, - config = true, + 'folke/flash.nvim', + -- event = 'VeryLazy', + ---@type Flash.Config + opts = {}, + keys = { + { + 's', + mode = { 'n', 'x', 'o' }, + function() + -- default options: exact mode, multi window, all directions, with a backdrop + require('flash').jump() + end, + }, + { + 'S', + mode = { 'o', 'x' }, + function() + require('flash').treesitter() + end, + }, + }, }, { 'numToStr/Comment.nvim', @@ -197,42 +215,17 @@ return { }, { 'stevearc/oil.nvim', - lazy = false, - -- event = 'Syntax', + -- lazy = false, + event = 'Syntax', opts = { - -- Id is automatically added at the beginning, and name at the end - -- See :help oil-columns - columns = { - 'icon', - -- "permissions", - -- "size", - -- "mtime", - }, -- Buffer-local options to use for oil buffers buf_options = { buflisted = false, }, -- Window-local options to use for oil buffers win_options = { - wrap = false, - signcolumn = 'no', - cursorcolumn = false, - foldcolumn = '0', - spell = false, - list = false, - conceallevel = 3, concealcursor = 'nvic', }, - -- Restore window options to previous values when leaving an oil buffer - restore_win_options = true, - -- Skip the confirmation popup for simple operations - skip_confirm_for_simple_edits = false, - -- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap - -- options with a `callback` (e.g. { callback = function() ... end, desc = "", nowait = true }) - -- Additionally, if it is a string that matches "actions.", - -- it will use the mapping at require("oil.actions"). - -- Set to `false` to remove a keymap - -- See :help oil-actions for a list of all available actions keymaps = { ['g?'] = 'actions.show_help', [''] = 'actions.select', @@ -250,23 +243,6 @@ return { ['~'] = 'actions.tcd', ['g.'] = 'actions.toggle_hidden', }, - -- Set to false to disable all of the above keymaps - use_default_keymaps = true, - view_options = { - -- Show files and directories that start with "." - show_hidden = false, - }, - -- Configuration for the floating window in oil.open_float - float = { - -- Padding around the floating window - padding = 2, - max_width = 0, - max_height = 0, - border = 'rounded', - win_options = { - winblend = 10, - }, - }, }, }, { @@ -343,8 +319,6 @@ return { 'j-morano/buffer_manager.nvim', opts = { -- line_keys = '', -- deactivate line keybindings - short_file_names = false, - short_term_names = false, select_menu_item_commands = { edit = { key = '',