ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Argument Noun

by nliberg ALL

Sublime Text plugin that extends Vintage with a function argument ('a') noun

Details

  • 2013.10.30.11.46.25
  • github.​com
  • github.​com
  • 11 years ago
  • 2 hours ago
  • 11 years ago

Installs

  • Total 552
  • Win 383
  • Mac 83
  • Linux 86
Jul 27 Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0
Mac 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

Argument Noun

Overview

Argument Noun is a Sublime Text 3 plugin that extends the Vintage mode with a new arguments noun (text object): 'a'. It is is similar to the argtextobj plugin for Vim by Takahiro Suzuki.

Example: let's say you are editing foo(a, b*(c+d)) and the caret is somewhere inside the second argument. Triggering the change-inner-argument operation by typing cia then gives you foo(a, ) and you can insert some text to replace the old argument.

Read more about verbs, nouns and modifiers

Usage

  • delete an argument with daa
  • change inner argument with cia
  • select inner argument with via
  • yank inner argument with yia

Installation

or

  • clone to your Sublime Text 3 Packages folder located at
    • Windows: %APPDATA%\Sublime Text 3
    • OS X: ~/Library/Application Support/Sublime Text 3
    • Linux: ~/.config/sublime-text-3

Notes

The plugin is quite syntax agnostic. It however makes the assumption that an argument list is wrapped in parenthesis, is preceded by a function name identifier, and that arguments are comma separated.

If two identifiers are separated by only a newline and white space it is assumed that a right parenthesis after the first identifier is missing, i.e.

myfunction(a, b, c
x = 5

is handled as if c had been followed by ). This ensures that the argument region does not get too large in case of incorrect syntax.

Only commas at the correct level of nesting are treated as argument separators so eg. usage of Python tuples shouldn't pose any problem.

Limitations

Method calls without parenthesis (like in Ruby) are not supported at this time.

Comments intermingled with arguments are not supported at this time.

License

MIT License

Contributors

Created by Nils Liberg