markjump.vim : Code transversal functions, move to prev/next marker, insert/strip markers.
| script karma
Downloaded by 1070
Comments, bugs, improvements
script versions (upload new version)
|This is a normal PLUGIN not ftplugin.
Marker chars are configurable.
You can define global or buffer variables to specify the marker chars for both left and right chars. Buffer vars if present are used before global chars
The default marker chars are the same as Luc Hermitte's bracketing.base.vim which is the same as Stephen Riehm's braketing macros. Which is to say «»
If you do not have digraphs enabled these chars are still easy to insert via
<c-k><< which gives you '«' and <c-k>>> which is '»' (far easier to use the included commands however)
:MN Search forward for the next occurance of marker chars
:MP Search backwards for the next occurance of marker chars
:MI Insert marker chars, usefull for <c-o>:MI text to have markers around it<cr>
:MIV Wrap the visual selection (single line) with marker chars
:MA Append marker chars (like a)
:MAV Same as :MIV
:MS Strip marker chars, positioning is a touch picky; place cursor in the markers and all is well.
Insert mode mappings:
<plug>MjMark Defaults to `ˇmark!` Insert marker chars, cursor AFTER the marker chars.
<plug>MjJump Defaults to `ˇjump!` Jump to the next marker (as :MN)
VISUAL mode mappings:
<plug>MjMark Defaults to `ˇmark!` Wrap marker chars around the selection. (as MIV)
NOTE if you already have insert and or visual mappings for ˇmark!/ˇjump! these will NOT be made.
<plug>MjPrev Defaults to <M-Insert> in normal, insert and visual. Jumps to previous markers, as :MP
<plug>MjNext Defaults to <M-Del> in normal, insert and visual. Jumps to next marker, as :MN
<plug>MjInsMarker Defaults to <M-m> in insert. Shortcut for `<c-o>:MI ` Just hit <m-m>type your words<cr>
If there is gui and has menu adds the following plugin menu items:
Strip markers mens to remove the marker chars from either side; cursor generally needs to be within the marker chars.
This script would not be what it is with out Luc Hermitte's input!
|This may clash with other bracketing/mark jump type scripts; I've tried to minimise such colisions by giving way to existing mappings/commands. Even with existing scripts the commands defined in this script will probably be available, so you can at least take this for a test run to see if it meets your likes.
Install, drop in PLUGIN (not ftplugin) folder.
Unistall, as easy as removing from your plugin folder. (and if you have made any maps to this you'll want to do something with those as well)
install, open a test file and :MI some text<cr> then move cursor and play wiht :MN and :MP
Click on the package to download.
ip used for rating: 18.104.22.168