-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for defining cycles for use in a specific filetype, impro…
…ve documentation.
- Loading branch information
Showing
2 changed files
with
88 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,36 @@ | ||
*cycle.txt* Quickly toggle between related words. | ||
|
||
ABOUT *cycle* | ||
ABOUT *cycle* | ||
|
||
Cycle.vim allows you to toggle between pairs or lists of related words. The | ||
default mappings are the same as those with which you can increment and decrement | ||
a number under the cursor — <C-A> and <C-X>, respectively. | ||
|
||
default mappings are the same as those with which you can increment and | ||
decrement a number under the cursor — <C-A> and <C-X>, respectively. | ||
|
||
CUSTOMIZATION | ||
|
||
You can add your own word groups: > | ||
call AddCycleGroup(['one', 'two', 'three']) | ||
You can add your own word groups: | ||
> | ||
call AddCycleGroup(['one', 'two', 'three']) | ||
< | ||
To deal with conflicts, Cycle.vim also supports adding groups that are specific | ||
to a certain filetype: | ||
> | ||
call AddCycleGroup('ruby', ['class', 'module']) | ||
call AddCycleGroup('python', ['else', 'elif']) | ||
< | ||
When multiple groups define the same word, groups belonging to specific | ||
filetypes will be used instead of global groups. This is useful in the cases | ||
above, since in HTML we would want 'class' to cycle with 'id' and Python uses | ||
'elif' while some other languages use 'elsif'. | ||
|
||
Providing a list of filetypes is also supported: | ||
> | ||
call AddCycleGroup(['ruby', 'eruby', 'perl'], ['else', 'elsif']) | ||
< | ||
However, if there are no conflicting cases it is preferable to define all | ||
cycle groups in the global namespace, using filetype-specific groups only in | ||
case of conflict. Instead of specifying multiple languages we define that | ||
group in the global space and override it only for python. | ||
|
||
vim:tw=78:ts=8:ft=help:norl: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters