scrod / nv

Notational Velocity: modeless, mouseless Mac OS X note-taking application
http://notational.net
GNU General Public License v3.0
2.07k stars 404 forks source link

moving lines around #235

Open lukaseppler opened 13 years ago

lukaseppler commented 13 years ago

Can I have keys for moving lines up and down in a list?

I don't know about how you guys use NV - but I have a lot of lists. It would mean the world to me if I could move a line up or down with a keystroke, i.e., Alt-Command-Up and -Down. I use copy paste to reorder lists. That works - but is slow.

If you have ever used that keystroke in Eclipse you know how fast you get with organizing lines.

scrod commented 13 years ago

Interesting idea — I will have to experiment with Eclipse to see the behavior in action.

lazallen commented 13 years ago

Hi,

I've some thoughts on this, I had posted it as another issue but i'll add the comments here and close that one...

Hi,

I love NV, I've stopped using almost all other note taking tools in favour of it, it's great.

However, there is one teeny tiny feature I miss from Onenote, the ability to move a single line up and down the list, especially good for prioritising a todo list.

How it might work... With the cursor on the line you wish to move, the user presses cmd+up and the line is move above the preceeding line.

So the user can use up and down to quickly select different lines and then cmd+up/down to move the lines about.

If the user had some text seleted this could move all the lines that the selection encompasses.

This would be agnostic of wrapping, it should move the whole line from one line break to the next

I think onenote uses ctrl+up/down to do this.

Kind Regards

Laz

ghost commented 13 years ago

You can enable something like this globally by creating ~/Library/KeyBindings/DefaultKeybinding.dict with:

{
    "^\Uf700" = (selectParagraph:, setMark:, deleteToMark:, moveLeft:, moveToBeginningOfParagraph:, setMark:, yank:, moveLeft:, selectToMark:);
    "^\Uf701" = (selectParagraph:, setMark:, deleteToMark:, moveToEndOfParagraph:, moveRight:, setMark:, yank:, moveLeft:, selectToMark:);
}

I actually prefer Notational Velocity not having that many extra text editing features — that way they can be provided by some systemwide services or utilities and there will be less inconsistencies between applications.

lazallen commented 13 years ago

@Lri got this working in about 10 mins; thankyou thankyou thankyou thankyou thankyou thankyou thankyou thankyou thankyou thankyou thankyou thankyou thankyou thankyou thankyou thankyou thankyou

agree with you entirely about the minimal features, but this was one thing that I really wanted, and now I have it everywhere!

amazing

@lukaseppler and scrod: Suggest we close this issue now!

thanks again

Laz