From e9bfff77b8e65a4aab247cd1a991dea8ea0a42c5 Mon Sep 17 00:00:00 2001 From: Jaroslaw Konik Date: Sun, 30 Jul 2023 11:10:04 +0200 Subject: [PATCH] update --- init.lua | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/init.lua b/init.lua index dd29db7..4ca429b 100644 --- a/init.lua +++ b/init.lua @@ -12,7 +12,7 @@ end vim.opt.rtp:prepend(lazypath) require("lazy").setup({ - { "NeogitOrg/neogit", dependencies = "nvim-lua/plenary.nvim" }, + { "NeogitOrg/neogit", dependencies = "nvim-lua/plenary.nvim" }, "lewis6991/fileline.nvim", "mfussenegger/nvim-dap", { @@ -121,9 +121,9 @@ require("lazy").setup({ -- refer to the configuration section below }, }, - { "ellisonleao/glow.nvim", config = true, cmd = "Glow" }, + { "ellisonleao/glow.nvim", config = true, cmd = "Glow" }, "nvim-pack/nvim-spectre", - { "rcarriga/nvim-dap-ui", requires = { "mfussenegger/nvim-dap" } }, + { "rcarriga/nvim-dap-ui", requires = { "mfussenegger/nvim-dap" } }, { "nvim-neorg/neorg", build = ":Neorg sync-parsers", @@ -144,8 +144,31 @@ require("lazy").setup({ }) end, }, + { + "phaazon/hop.nvim", + branch = "v2", -- optional but strongly recommended + config = function() + -- you can configure Hop the way you like here; see :h hop-config + require("hop").setup({ keys = "etovxqpdygfblzhckisuran" }) + end, + }, }) +local hop = require("hop") +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 }) + require("dapui").setup() require("lualine").setup() @@ -218,14 +241,14 @@ end, { TablineFileNameBlock }) local function get_terminal_bufs() return vim.tbl_filter(function(bufnr) return vim.api.nvim_buf_get_option(bufnr, "buftype") == "terminal" - and vim.api.nvim_buf_get_option(bufnr, "buflisted") + and vim.api.nvim_buf_get_option(bufnr, "buflisted") end, vim.api.nvim_list_bufs()) end local function get_non_terminal_bufs() return vim.tbl_filter(function(bufnr) return vim.api.nvim_buf_get_option(bufnr, "buftype") ~= "terminal" - and vim.api.nvim_buf_get_option(bufnr, "buflisted") + and vim.api.nvim_buf_get_option(bufnr, "buflisted") end, vim.api.nvim_list_bufs()) end @@ -514,8 +537,8 @@ wk.register({ local current_buf_nr = vim.fn.bufnr() local all = vim.tbl_filter(function(bufnr) return current_buf_nr ~= bufnr - and vim.api.nvim_buf_get_option(bufnr, "buftype") ~= "terminal" - and vim.api.nvim_buf_get_option(bufnr, "buflisted") + and vim.api.nvim_buf_get_option(bufnr, "buftype") ~= "terminal" + and vim.api.nvim_buf_get_option(bufnr, "buflisted") end, vim.api.nvim_list_bufs()) for _, bufnr in ipairs(all) do require("bufdelete").bufdelete(bufnr, false)