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

View File

@ -7,11 +7,17 @@ local M = {}
local tmux_windows = {} local tmux_windows = {}
if global_config.tmux_autoclose_windows then if global_config.tmux_autoclose_windows then
vim.cmd([[ local harpoon_tmux_group = vim.api.nvim_create_augroup(
augroup HARPOON_TMUX "HARPOON_TMUX",
autocmd! { clear = true }
autocmd VimLeave * :lua require('harpoon.tmux').clear_all() )
]])
vim.api.nvim_create_autocmd("VimLeave", {
callback = function()
require("harpoon.tmux").clear_all()
end,
group = harpoon_tmux_group,
})
end end
local function create_terminal() 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