vim-NotableFt : Changes 'f' and 't' to only match notable characters
| script karma
Downloaded by 582
Comments, bugs, improvements
script versions (upload new version)
|For the most up to date version see this github page:
This plugin changes the behaviour of the `f`, `F`, `t`, `T`, `;` and `,` commands to only match on characters that are considered 'notable'. This includes:
- The 'humps' of camel case words
- The beginning and end of words
- Any non-word characters like `. , : ( !`
Note that these rules only apply when the given search character is lower case. This is because while this behaviour is what you want almost all the time, sometimes you still want to be able to search for characters that are not 'notable'. You can do this using upper case search.
For example, given this line:
`this is a test line`
With your cursor at the beginning, if you search `fi`, your cursor will move to the word 'is' (^ represents cursor)
`this ^s a test line`
Whereas, if you search `fI` instead, your cursor will move to:
`th^s is a test line`
This plugin also adds the following behaviour:
- Multiline - Can search across multiple lines or continue searching across multiple lines using `;` and `,` keys
- Highlighting - Highlights all matching characters on current line, previous matching line, and next matching line
- Allows repeating `t` and `T` commands using `;` or `,` commands
It's also worth noting that it only adds the new position to the jumplist if you've changed lines
By default, NotableFt will preserve Vim's behaviour of searching left-to-right with `;` after using `f`, and searching right-to-left with `;` when using `t`. However, it also includes an alternative approach, which uses fixed directions for the `;` and `,` keys. So if that's something you want to use instead, you can enable it by including the following in your .vimrc:
let g:NotableFtUseFixedDirection = 1
In other words, when this option is enabled, the `;` key will always go left-to-right, and the `,` key will always go right-to-left.
If you have remapped any of the `f`/`F`/`t`/`T`/`;`/`,` keys you can still use the plugin without changing it, by including the following in your .vimrc:
`let g:NotableFtUseDefaults = 0`
With this set, NotableFT will not remap anything. You can then remap whatever keys you want to the following `<plug>NotableFt` mappings:
See the file `NotableFt.vim` for an example of how to map to these.
Click on the package to download.
ip used for rating: 184.108.40.206