diff --git a/README.md b/README.md index 8e1ac92..94d1019 100644 --- a/README.md +++ b/README.md @@ -11,18 +11,12 @@ -- image provided by **Bob Rust** ## ⇁ TOC -* [Note to legacy Harpoon 1 users](#-Note-to-legacy-Harpoon-1-users) * [The Problems](#-The-Problems) * [The Solutions](#-The-Solutions) * [Installation](#-Installation) * [Getting Started](#-Getting-Started) * [Social](#-Social) - -## ⇁ Note to legacy Harpoon 1 users -Original Harpoon will remain in a frozen state and i will merge PRs in with _no -code review_ for those that wish to remain on that. Harpoon 2 is significantly -better and allows for MUCH greater control. Please migrate to that (will -become `master` within the next few months). +* [Note to legacy Harpoon 1 users](#-Note-to-legacy-Harpoon-1-users) ## ⇁ The Problems 1. You're working on a codebase. medium, large, tiny, whatever. You find @@ -37,17 +31,39 @@ to go to the files you want. 1. Unlimited terminals and navigation. ## ⇁ Installation -* neovim 0.5.0+ required -* install using your favorite plugin manager (`vim-plug` in this example) -```vim -Plug 'nvim-lua/plenary.nvim' " don't forget to add this one if you don't have it yet! -Plug 'ThePrimeagen/harpoon' +* neovim 0.8.0+ required +* install using your favorite plugin manager (i am using `packer` in this case) +```lua +use "nvim-lua/plenary.nvim" -- don't forget to add this one if you don't have it yet! +use { + "ThePrimeagen/harpoon", + branch = "0.1.x", + requires = { {"nvim-lua/plenary.nvim"} } +} ``` ## ⇁ Getting Started +### Quick Note +You will want to add your style of remaps and such to your neovim dotfiles with +the shortcuts you like. My shortcuts are for me. Me alone. Which also means +they are designed with dvorak in mind (My layout btw, I use dvorak btw). + +```lua +local harpoon = require("harpoon") + +harpoon.ui:toggle_quick_menu(harpoon:list()) +``` + ## ⇁ Social -For questions about Harpoon, there's a #harpoon channel on [the Primagen's Discord](https://discord.gg/theprimeagen) server. +For questions about Harpoon, there's a #harpoon channel on [the Primeagen's Discord](https://discord.gg/theprimeagen) server. * [Discord](https://discord.gg/theprimeagen) * [Twitch](https://www.twitch.tv/theprimeagen) * [Twitter](https://twitter.com/ThePrimeagen) + +## ⇁ Note to legacy Harpoon 1 users +Original Harpoon will remain in a frozen state and i will merge PRs in with _no +code review_ for those that wish to remain on that. Harpoon 2 is significantly +better and allows for MUCH greater control. Please migrate to that (will +become `master` within the next few months). + diff --git a/lua/harpoon2/buffer.lua b/lua/harpoon2/buffer.lua index bad8558..e0bdc9f 100644 --- a/lua/harpoon2/buffer.lua +++ b/lua/harpoon2/buffer.lua @@ -1,4 +1,4 @@ -local utils = require("harpoon2.utils") +local utils = require("harpoon.utils") local M = {} local HARPOON_MENU = "__harpoon-menu__" @@ -47,27 +47,27 @@ function M.setup_autocmds_and_keymaps(bufnr) bufnr, "n", "q", - "lua require('harpoon2').ui:toggle_quick_menu()", + "lua require('harpoon').ui:toggle_quick_menu()", { silent = true } ) vim.api.nvim_buf_set_keymap( bufnr, "n", "", - "lua require('harpoon2').ui:toggle_quick_menu()", + "lua require('harpoon').ui:toggle_quick_menu()", { silent = true } ) vim.api.nvim_buf_set_keymap( bufnr, "n", "", - "lua require('harpoon2').ui:select_menu_item()", + "lua require('harpoon').ui:select_menu_item()", {} ) -- TODO: Update these to use the new autocmd api vim.cmd( string.format( - "autocmd BufWriteCmd lua require('harpoon2').ui:save()", + "autocmd BufWriteCmd lua require('harpoon').ui:save()", bufnr ) ) @@ -77,7 +77,7 @@ function M.setup_autocmds_and_keymaps(bufnr) if global_config.save_on_change then vim.cmd( string.format( - "autocmd TextChanged,TextChangedI lua require('harpoon2').ui:save()", + "autocmd TextChanged,TextChangedI lua require('harpoon').ui:save()", bufnr ) ) @@ -90,7 +90,7 @@ function M.setup_autocmds_and_keymaps(bufnr) ) ) vim.cmd( - "autocmd BufLeave ++nested ++once silent lua require('harpoon2').ui:toggle_quick_menu()" + "autocmd BufLeave ++nested ++once silent lua require('harpoon').ui:toggle_quick_menu()" ) end diff --git a/lua/harpoon2/data.lua b/lua/harpoon2/data.lua index b2cd42c..a031b7e 100644 --- a/lua/harpoon2/data.lua +++ b/lua/harpoon2/data.lua @@ -1,7 +1,7 @@ local Path = require("plenary.path") local data_path = vim.fn.stdpath("data") -local full_data_path = string.format("%s/harpoon2.json", data_path) +local full_data_path = string.format("%s/harpoon.json", data_path) ---@param data any local function write_data(data) diff --git a/lua/harpoon2/init.lua b/lua/harpoon2/init.lua index 1da18dd..45857c6 100644 --- a/lua/harpoon2/init.lua +++ b/lua/harpoon2/init.lua @@ -1,8 +1,8 @@ -local Ui = require("harpoon2.ui") -local Data = require("harpoon2.data") -local Config = require("harpoon2.config") -local List = require("harpoon2.list") -local Listeners = require("harpoon2.listeners") +local Ui = require("harpoon.ui") +local Data = require("harpoon.data") +local Config = require("harpoon.config") +local List = require("harpoon.list") +local Listeners = require("harpoon.listeners") -- setup -- read from a config file @@ -141,7 +141,7 @@ function Harpoon:dump() end function Harpoon:__debug_reset() - require("plenary.reload").reload_module("harpoon2") + require("plenary.reload").reload_module("harpoon") end return Harpoon:new() diff --git a/lua/harpoon2/list.lua b/lua/harpoon2/list.lua index bb79ced..a0e7771 100644 --- a/lua/harpoon2/list.lua +++ b/lua/harpoon2/list.lua @@ -1,5 +1,5 @@ -local Listeners = require("harpoon2.listeners") -local Buffer = require("harpoon2.buffer") +local Listeners = require("harpoon.listeners") +local Buffer = require("harpoon.buffer") local function index_of(items, element, config) local equals = config and config.equals diff --git a/lua/harpoon2/scratch/toggle.lua b/lua/harpoon2/scratch/toggle.lua index 7485984..2b8857b 100644 --- a/lua/harpoon2/scratch/toggle.lua +++ b/lua/harpoon2/scratch/toggle.lua @@ -1,3 +1,3 @@ -local harpoon = require("harpoon2") +local harpoon = require("harpoon") harpoon.ui:toggle_quick_menu(harpoon:list()) diff --git a/lua/harpoon2/test/config_spec.lua b/lua/harpoon2/test/config_spec.lua index 4df9340..b0b66d3 100644 --- a/lua/harpoon2/test/config_spec.lua +++ b/lua/harpoon2/test/config_spec.lua @@ -1,4 +1,4 @@ -local Config = require("harpoon2.config") +local Config = require("harpoon.config") local eq = assert.are.same describe("config", function() diff --git a/lua/harpoon2/test/harpoon_spec.lua b/lua/harpoon2/test/harpoon_spec.lua index dca68f6..af71a03 100644 --- a/lua/harpoon2/test/harpoon_spec.lua +++ b/lua/harpoon2/test/harpoon_spec.lua @@ -1,5 +1,5 @@ -local utils = require("harpoon2.test.utils") -local harpoon = require("harpoon2") +local utils = require("harpoon.test.utils") +local harpoon = require("harpoon") local eq = assert.are.same @@ -8,7 +8,7 @@ local be = utils.before_each(os.tmpname()) describe("harpoon", function() before_each(function() be() - harpoon = require("harpoon2") + harpoon = require("harpoon") end) it("when we change buffers we update the row and column", function() diff --git a/lua/harpoon2/test/list_spec.lua b/lua/harpoon2/test/list_spec.lua index 8407d3e..476ad31 100644 --- a/lua/harpoon2/test/list_spec.lua +++ b/lua/harpoon2/test/list_spec.lua @@ -1,5 +1,5 @@ -local List = require("harpoon2.list") -local Config = require("harpoon2.config") +local List = require("harpoon.list") +local Config = require("harpoon.config") local eq = assert.are.same describe("list", function() diff --git a/lua/harpoon2/test/ui_spec.lua b/lua/harpoon2/test/ui_spec.lua index 9c31443..2d5adee 100644 --- a/lua/harpoon2/test/ui_spec.lua +++ b/lua/harpoon2/test/ui_spec.lua @@ -1,6 +1,6 @@ -local utils = require("harpoon2.test.utils") -local Buffer = require("harpoon2.buffer") -local harpoon = require("harpoon2") +local utils = require("harpoon.test.utils") +local Buffer = require("harpoon.buffer") +local harpoon = require("harpoon") local eq = assert.are.same local be = utils.before_each(os.tmpname()) @@ -8,7 +8,7 @@ local be = utils.before_each(os.tmpname()) describe("harpoon", function() before_each(function() be() - harpoon = require("harpoon2") + harpoon = require("harpoon") end) it("open the ui without any items in the list", function() diff --git a/lua/harpoon2/test/utils.lua b/lua/harpoon2/test/utils.lua index a348171..0cf284a 100644 --- a/lua/harpoon2/test/utils.lua +++ b/lua/harpoon2/test/utils.lua @@ -1,4 +1,4 @@ -local Data = require("harpoon2.data") +local Data = require("harpoon.data") local M = {} @@ -10,10 +10,10 @@ function M.before_each(name) Data.set_data_path(name) Data.__dangerously_clear_data() - require("plenary.reload").reload_module("harpoon2") - Data = require("harpoon2.data") + require("plenary.reload").reload_module("harpoon") + Data = require("harpoon.data") Data.set_data_path(name) - local harpoon = require("harpoon2") + local harpoon = require("harpoon") M.clean_files() diff --git a/lua/harpoon2/ui.lua b/lua/harpoon2/ui.lua index 2b7690c..66814cc 100644 --- a/lua/harpoon2/ui.lua +++ b/lua/harpoon2/ui.lua @@ -1,5 +1,5 @@ local popup = require("plenary").popup -local Buffer = require("harpoon2.buffer") +local Buffer = require("harpoon.buffer") local DEFAULT_WINDOW_WIDTH = 69 -- nice ---@class HarpoonUI