Skip to content

0.7.0

Compare
Choose a tag to compare
@julienvincent julienvincent released this 12 Aug 12:21
· 142 commits to master since this release
3237777

New Features

Text object selections

Added support for form and element text object selections. This adds the af and if keybindings which work in operator-pending mode, allowing you to type chords like dif to delete everything inside a form or daf to delete everything around a form. This works with d, c, y, v and friends.

Form/Element deletions APIs

Internally using the text object selections, a programatic API for deleting forms and elements was added.

paredit.delete_form()
paredit.delete_in_form()
paredit.delete_element()

Fixes

  • Using motions with v:count now properly respects count. For example, d2E or y2B now work correctly.

Other

The way keybindings are setup has changed, specifically the operator = true option has been removed and a new modes = {} has been added as a replacement. This allows setting the modes for a keybinding explicitly.

The motions API's were changed to automatically detect operator-pending mode instead of them needing to be wrapped in normal! v when operator = true was set.

If you were using custom keybindings that used operator = true you will need to update your mappings. For example:

-- Before
require("nvim-paredit").setup({
  keys = {
    ["E"] = { 
      paredit.api.move_to_next_element,
      "Jump to next element tail",
      repeatable = false,
      operator = true,
    }
  }
})

-- after
require("nvim-paredit").setup({
  keys = {
    ["E"] = { 
      paredit.api.move_to_next_element,
      "Jump to next element tail",
      repeatable = false,
      mode = { "n", "x", "o", "v" },
    }
  }
})