From 7d2fb974a36b3c7773a90a749fcb92a40669e444 Mon Sep 17 00:00:00 2001 From: Rich Churcher Date: Tue, 12 Jan 2021 17:33:59 +1300 Subject: [PATCH] Add a note on binds for text object motions (#454) --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index f274b46..e606602 100644 --- a/README.md +++ b/README.md @@ -165,6 +165,14 @@ Most of the following mappings are for normal/visual mode only. The **|NERDComme Uncomments the selected line(s). +## Motions + +While the plugin does not directly support motions, you can leverage its support for selections to do something very similar. For example, to add motions to toggle comments on the paragraph text object you could use: +```vim +nnoremap c} V}:call NERDComment('x', 'toggle') +nnoremap c{ V{:call NERDComment('x', 'toggle') +``` + ## Contributions This plugin was originally written in 2007 by [Martin Grenfell (@scrooloose)](https://github.com/scrooloose/). Lots of features and many of the supported filetypes have come from [community contributors](https://github.com/preservim/nerdcommenter/graphs/contributors). Since 2016 it has been maintained primarily by [Caleb Maclennan (@alerque)](https://github.com/alerque). Additional file type support, bug fixes, and new feature contributons are all welcome, please send them as Pull Requests on Github. If you can't contribute yourself please also feel free to open issues to report problems or request features.