Skip to content

[FEATURE] autocmd event to set up keybinds on the buffer #96

@tsukimizake

Description

@tsukimizake

Feature Description

I want an autocmd User event for addding specific keybind on the claude code buffer.

Use Case

I want to toggle claudecode buffer with some keymap when the mode is terminal insert mode.

Proposed Solution

ugaterm.nvim has this feature.

uga-rosa/ugaterm.nvim@c12135a

With this event, I can add autocmds like this, and can close ugaterm buffer from terminal insert mode with just hitting <Esc><Esc>.

vim.api.nvim_create_autocmd('User',
  {
    pattern = 'UgatermEnter',
    callback =
        function(args)
          vim.keymap.set('t', '<Esc>', '<C-\\><C-n>', { buffer = args.buf })
          vim.keymap.set('n', '<Esc>', '<cmd>UgatermHide<CR>', { buffer = args.buf })
        end
  })

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions