mirror of
https://github.com/ThePrimeagen/harpoon
synced 2024-09-16 21:44:02 +02:00
Merge pull request #181 from yonikosiner/auto-group
feat: No longer using `vim.cmd` for auto commands, as there is now a lua api
This commit is contained in:
commit
f4aff5bf9b
3 changed files with 23 additions and 9 deletions
|
@ -10,6 +10,18 @@ local cache_config = string.format("%s/harpoon.json", data_path)
|
|||
|
||||
local M = {}
|
||||
|
||||
local the_primeagen_harpoon = vim.api.nvim_create_augroup(
|
||||
"THE_PRIMEAGEN_HARPOON",
|
||||
{ clear = true }
|
||||
)
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufLeave, VimLeave" }, {
|
||||
callback = function()
|
||||
require("harpoon.mark").store_offset()
|
||||
end,
|
||||
group = the_primeagen_harpoon,
|
||||
})
|
||||
|
||||
--[[
|
||||
{
|
||||
projects = {
|
||||
|
|
|
@ -7,11 +7,17 @@ local M = {}
|
|||
local tmux_windows = {}
|
||||
|
||||
if global_config.tmux_autoclose_windows then
|
||||
vim.cmd([[
|
||||
augroup HARPOON_TMUX
|
||||
autocmd!
|
||||
autocmd VimLeave * :lua require('harpoon.tmux').clear_all()
|
||||
]])
|
||||
local harpoon_tmux_group = vim.api.nvim_create_augroup(
|
||||
"HARPOON_TMUX",
|
||||
{ clear = true }
|
||||
)
|
||||
|
||||
vim.api.nvim_create_autocmd("VimLeave", {
|
||||
callback = function()
|
||||
require("harpoon.tmux").clear_all()
|
||||
end,
|
||||
group = harpoon_tmux_group,
|
||||
})
|
||||
end
|
||||
|
||||
local function create_terminal()
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
augroup THE_PRIMEAGEN_HARPOON
|
||||
autocmd!
|
||||
autocmd BufLeave,VimLeave * :lua require('harpoon.mark').store_offset()
|
||||
augroup END
|
Loading…
Reference in a new issue