Skip to content

fix: add perl af#870

Open
rwxrob wants to merge 3 commits intonvim-treesitter:mainfrom
rwxrob:rwxrob-add-perl-af
Open

fix: add perl af#870
rwxrob wants to merge 3 commits intonvim-treesitter:mainfrom
rwxrob:rwxrob-add-perl-af

Conversation

@rwxrob
Copy link

@rwxrob rwxrob commented Mar 10, 2026

This simply allows code like the following to be added to init.lua to enable any of the useful af key mapping combinations (vaf, yaf, daf, gcaf,!af), :

-- requires >0.11
require("nvim-treesitter-textobjects").setup({
  select = {
    lookahead = true,
  },
})

vim.keymap.set({ "x", "o" }, "af", function()
  require("nvim-treesitter-textobjects.select").select_textobject("@function.outer", "textobjects")
end)

vim.keymap.set({ "x", "o" }, "if", function()
  require("nvim-treesitter-textobjects.select").select_textobject("@function.inner", "textobjects")
end)

And yes, there is still a lot of perl out there. 🤪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant