Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add text object motion 'vap' to visually select paragraph

  • Loading branch information...
commit db156332b8677c91713c0ad7267b9c12e94468e4 1 parent 0913362
@behrends authored
Showing with 9 additions and 0 deletions.
  1. +5 −0 Default.sublime-keymap
  2. +4 −0 vintage_motions.py
View
5 Default.sublime-keymap
@@ -920,6 +920,11 @@
"motion_args": {"character": "{", "outer": true}},
"context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
},
+ { "keys": ["a", "p"], "command": "set_motion", "args": {
+ "motion": "vi_expand_to_paragraph",
+ "motion_args": {"repeat": 1}},
+ "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
+ },
//
// Repeat digits
View
4 vintage_motions.py
@@ -272,6 +272,10 @@ def run(self, edit, character, outer = False):
if outer:
self.view.run_command('expand_selection', {'to': 'brackets', 'brackets': character})
+class ViExpandToParagraph(sublime_plugin.TextCommand):
+ def run(self, edit, outer = False, repeat = 1):
+ self.view.run_command('expand_selection_to_paragraph')
+
class ScrollCurrentLineToScreenTop(sublime_plugin.TextCommand):
def run(self, edit, repeat, extend=False):
bos = self.view.visible_region().a
Please sign in to comment.
Something went wrong with that request. Please try again.