move-less : plugin for faster navigation without changing the cursor position
| script karma
Downloaded by 1681
Comments, bugs, improvements
script versions (upload new version)
|This plugin is a tool for navigating inside of a file without moving the cursor to another line.
The idea is that you fold the space between your line and the target destination and then jump to the target position.
To archive this there is a so called move-less-mode which you can enter by typing <leader>m.
You can now also use it to generate a temporary upper and or bottom folding. So, you can place to distance section from the upper and the bottom together. (see meaning of 'p' while in move less mode)
If you want to remap the setting you can just create a mapping which calls the function MoveLessMode.
If you are in the move-less mode you can navigate like the following:
j: Type once and your line will be displayed at the top (if possible). Every further click will fold lines below your cursor. So you can see the text under your cursor. The number of lines which are fold are defined by the scroll attribute.
k: Type once and your line will be displayed at the bottom (if possible). Every further click will fold lines below your cursor, so you can see the upper text. The number of lines which are fold are defined by the scroll attribute.
J: Type once and your line will be displayed at the top (if possible). Any further click will reduce the fold below your cursor position. So, that you are able to see text again which you already have fold (kind of an undo of j)
K: Type once and your line will be displayed at the bottom. Any further click will reduce the fold above your cursor position. So, that you are able to see text again which you already have fold (kind of an undo of k)
k: Type once and your line will be displayed at the middle. Any further click will fold the text above and below your cursor position. So, that you are able to search your target positon in both directions.
h: Type once and your line will be displayed at the middle. Any further click will reduce the fold above and below your cursor position. So, you can see the text again which you already fold. It's kind of an undo for k.
<esc>: Abort move less mode and delete all foldings, you are not able to jump to Any distance place now.
p: Stop the move less mode but let the folding remain (p)ermanently. In fact it's just more permanent then the normal behaviour it's also temporary until you use the mode less mode next time. If you just want to unfold later you can go to move less mode and end it directly with . This new feature permanent feature should be handy if you want to edit two places in the file which has a big distance.
Any other key: Move less mode will directly be ended, but folding will be temporary remain. From now on, you can jump over the folding to get to your target position. You can use Any vim method you like for this action. For example move-less is intended to work pretty well with easymotion.
After such an action the folding will be immediately removed. It is only intended to be used for navigation without moving.
It's also available at github:
Click on the package to download.
ip used for rating: 22.214.171.124
||* record the jump over the fold regardless if the user navigation was a jump command
* Provides mappings for shortcuts used in MoveLess Mode
||If move less mode is ended with p (for permanent) the folding will remain.
Handy for editing far away distances form up and below together.
Then you can more easily yank, paste, replace, create macros etc. between this two places.
||* just fix a bug when ending move less mode via ESC
||* move-less navigation will not add entries to the jumplist any more
* make buffer local variables more unique to avoid collisions
||* support a walk over the folding where the folding remains until the cursor is outside of the folding area
* if the move less mode was ended but no jump or walk over the fold appears the move less code will be continued where it was stopped when it is started again
* remove duplicate tag in move less doc