Skip to content

coolcat702/targets.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

targets.nvim

Lua port of targets.vim for Neovim.

Features

  • Pairs: (, ), [, ], {, }, <, >
  • Quotes: ', ", `, q (any quote)
  • Separators: ,, ., ;, :, +, -, =, ~, _, /, |, \, &, $, #, *
  • Arguments: a (comma-separated function parameters)

Modifiers: a (around), i (inside), A (Around), I (Inside)
Seek keys: n (next), l (last), c (current, default)

Installation

With lazy.nvim:

{
    "coolcat702/targets.nvim",
    event = "VimEnter",
    opts = {}, -- your config here
    config = function(_, opts)
        require("targets").setup(opts)
    end
}

Config

This is the default config:

opts = {
  -- modifier keys
  aiAI = { 'a', 'i', 'A', 'I' },
  -- seek keys
  nl = { 'n', 'l' },
  -- seek preference order
  seek_ranges = 'cc cr cb cB lc ac Ac lr lb ar ab lB Ar aB Ab AB rr ll rb al rB Al bb aa bB Aa BB AA',
  -- ranges that add entries to jump list
  jump_ranges = 'bb bB BB aa Aa AA',
  -- separator characters
  separators = { ',', '.', ';', ':', '+', '-', '=', '~', '_', '/', '|', '\\', '&', '$', '#', '*' },
  -- enable 'ia'/'aa' objects
  arguments = true,
}

Usage Examples

di(    delete inside parens
da[    delete around brackets
cin"   change inside next double quote
ciq    change inside any quote
di,    delete between commas
cia    change inside argument
din(   change inside next parens
dil{   delete inside last braces

Keymaps

Automatically creates mappings in operator-pending (o) and visual (x) modes for all combinations:

  • a/i/A/I + ( ) [ ] { } < > b r q ' " \ , . ; : + - = ~ _ / | \ & $ # * + c/n/l

About

Lua port of targets.vim for Neovim

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages