Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documenting codemirror shorcuts. #4591

Merged
merged 6 commits into from Nov 26, 2013
Merged

Conversation

damianavila
Copy link
Member

I found me looking for this inside the codemirror.js source, so I decided to document it here because I think it will be valuable for others.

Please, check the semantic (I mean the way to express things) because English it is not my mother language and it is important to be clear in the doc...

you can actually use a set of predetermined keyboard shortcuts to
write and manipulate your content in an easier way.

Below, you will find three tables listing the available shortcuts:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems unnecessarily complex. What about one table, with columns for 'PC shortcut' and 'Mac shortcut'?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, I will do the change...

@damianavila
Copy link
Member Author

Thomas comments addressed, I think ;-)

------------------------------------------------------------------------------
Basic Action pcDefault Action macDefault
========== ================== ============ ================= =============
Left go to char left Ctrl-A select all Cmd-A
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't generated the HTML, but I think this side-by-side view is also confusing. Let's have just three columns: Action, PC shortcut, Mac shortcut (and write the column headers out properly, not pcDefault - it's not a variable name). Where the shortcut is the same on PC and Mac, either leave one blank, or repeat it (or use a rowspan, but that requires creating the more cumbersome grid style tables).

Also, we don't need to list really obvious things like left/right/up/down or backspace/delete. That's just common vocabulary for editing any text-based document.

(And does anyone actually use 'Insert'? The only time I'm ever aware of it is when I hit it by mistake, find that I'm overwriting text I'd already written, curse a bit and turn it off)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I will do the changes in a couple of hours...
And regarding the "Insert", I had also find it by mistake, but I think that it can be useful for some people...

@damianavila
Copy link
Member Author

OK, not a few hours... just a few minutes 😉 , take a look and let me know.

go to line start Home Home
go to line end Alt-Right Cmd-Right
go to line end End End
del word before Ctrl-Back Alt-Back
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Back' is backspace? I think I'd rather write it out in full, even if it makes the columns wider.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@takluyver
Copy link
Member

Thanks, this looks much better. I'll build the docs to take a look at the result.

go to cell start Ctrl-Home Cmd-Up
go to cell start Alt-Up Cmd-End
go to cell start PageUp PageUp
go to cell end Ctrl-End -
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These dashes render as bullet points. -- or --- work - I prefer the weight of the latter.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I agree...

@damianavila
Copy link
Member Author

OK, comments addressed...

select all Ctrl-A Cmd-A
delete line Ctrl-D Cmd-D
undo Ctrl-Z Cmd-Z
redo Shift-Ctrl-Z Shift-Cmd-Z
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: I think it's more common to write 'Ctrl-Shift' than 'Shift-Ctrl'. Likewise, Min reckons that the norm for Mac shortcuts is 'Cmd-Shift', at least when written in words.

@damianavila
Copy link
Member Author

Done!

@ivanov
Copy link
Member

ivanov commented Nov 26, 2013

travis failed on its own, I just restarted it.

@takluyver
Copy link
Member

Travis has now succeeded, it just seems to have failed to post the results here. This is all fine unless @Carreau has anything to add about shortcuts on other keyboards when he wakes up.

@ivanov
Copy link
Member

ivanov commented Nov 26, 2013

would it be worth it to add a link to these codemirror shortcuts to IPython/html/static/notebook/js/quickhelp.js, or even include them in that popup menu that you get from accessing the help menu in the notebook?

@damianavila
Copy link
Member Author

I don't think it be worth to add a link inside quickhelp.js (it is nice right now, and adding a link would be disruptive), however I think very valuable to add it in the help menu as other links pointing to documentation. I can make this change if you want...

@takluyver
Copy link
Member

I would have thought that the 'Keyboard shortcuts' popup was the best place to put the link, but putting it in the menu as e.g. 'Editor shortcuts' would work too. Feel free to go ahead and do it in this PR.

@damianavila
Copy link
Member Author

I added the link to the menu.
I just point to the dev (not stable) documentation in the link because it will not be available at stable doc until the next release...

@takluyver
Copy link
Member

That makes sense. But how are we going to remember to update it at release time? Maybe make an issue with milestone 2.0?

@damianavila
Copy link
Member Author

Yes, I was thinking the same... I am opening an issue to deal with it before 2.0. Can you assign it to the 2.0 milestone, please? Thanks.

@takluyver
Copy link
Member

I've had another quick check through, and I think this looks good. Thanks for your patience, Damian.

takluyver added a commit that referenced this pull request Nov 26, 2013
Documenting codemirror shorcuts.
@takluyver takluyver merged commit da0a720 into ipython:master Nov 26, 2013
@damianavila damianavila deleted the cm_keys branch November 26, 2013 20:54
@damianavila
Copy link
Member Author

No problem! Thanks for your feedback 👍

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants