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:
ThePrimeagen 2022-08-09 20:36:36 -06:00 committed by GitHub
commit f4aff5bf9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 9 deletions

View file

@ -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 = {

View file

@ -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()

View file

@ -1,4 +0,0 @@
augroup THE_PRIMEAGEN_HARPOON
autocmd!
autocmd BufLeave,VimLeave * :lua require('harpoon.mark').store_offset()
augroup END