@span .kw {-local} ts_utils @span .op {-=} @span .fn {-require}(@span .str {-'nvim-treesitter.ts_utils'}) @span .kw {-local} @span .kw {-function} @span .fn {-map}(lhs, rhs) vim.keymap.@span .fn {-set}(@span .str {-'n'}, lhs, @span .kw {-function}() @span .kw {-local} node @span .op {-=} ts_utils.@span .fn {-get_node_at_cursor}() @span .kw {-if} node @span .op {-==} @span .cnst {-nil} @span .kw {-then} @span .fn {-error}(@span .str {-'No Tree-Sitter parser found.'}) @span .kw {-end} @span .kw {-while} node @span .op {-~=} @span .cnst {-nil} @span .op {-and} node:@span .fn {-type}() @span .op {-~=} @span .str {-'operation'} @span .kw {-do} node @span .op {-=} node:@span .fn {-parent}() @span .kw {-end} @span .kw {-if} node @span .op {-~=} @span .cnst {-nil} @span .kw {-then} @span .kw {-local} sr, sc, er, ec @span .op {-=} node:@span .fn {-child}(0):@span .fn {-range}() vim.api.@span .fn {-nvim_buf_set_text}(@span .str {-0}, sr, sc, er, ec, { rhs \}) @span .kw {-end} @span .kw {-end}, { buffer @span .op {-=} @span .cnst {-true}, noremap @span .op {-=} @span .cnst {-true}, silent @span .op {-=} @span .cnst {-true}, \}) @span .kw {-end} @span .fn {-map}(@span .str {-'p'}, @span .str {-'pick'}) @span .fn {-map}(@span .str {-'r'}, @span .str {-'reword'}) @span .fn {-map}(@span .str {-'s'}, @span .str {-'squash'}) @span .fn {-map}(@span .str {-'f'}, @span .str {-'fixup'})