Skip to content

Commit

Permalink
Introduced KeyBindingCategory Emacs
Browse files Browse the repository at this point in the history
  • Loading branch information
calixtus committed Oct 21, 2020
1 parent aad47bf commit 5b9498c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 17 deletions.
32 changes: 17 additions & 15 deletions src/main/java/org/jabref/gui/keyboard/KeyBinding.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@
import org.jabref.logic.l10n.Localization;

public enum KeyBinding {
EMACS_DELETE("Emacs delete", Localization.lang("Delete text"), "ctrl+D", KeyBindingCategory.EDIT),
EMACS_BACKWARD("Emacs move caret left", Localization.lang("Move caret left"), "ctrl+B", KeyBindingCategory.EDIT),
EMACS_FORWARD("Emacs move caret right", Localization.lang("Move caret right"), "ctrl+F", KeyBindingCategory.EDIT),
EMACS_BEGINNING("Emacs move caret to beginning of line", Localization.lang("Move caret to beginning of line"), "ctrl+A", KeyBindingCategory.EDIT),
EMACS_END("Emacs move caret to of line", Localization.lang("Move caret to end of line"), "ctrl+E", KeyBindingCategory.EDIT),
EMACS_BEGINNING_DOC("Emacs move caret to beginning of text", Localization.lang("Move the caret to the beginning of text"), "alt+LESS", KeyBindingCategory.EDIT),
EMACS_END_DOC("Emacs move caret to end of text", Localization.lang("Move the caret to the end of text"), "alt+shift+LESS", KeyBindingCategory.EDIT),
EMACS_UP("Emacs move caret up", Localization.lang("Move the caret up"), "ctrl+P", KeyBindingCategory.EDIT),
EMACS_DOWN("Emacs move caret down", Localization.lang("Move the caret down"), "ctrl+N", KeyBindingCategory.EDIT),
EMACS_CAPITALIZE("Emacs capitalize word", Localization.lang("Capitalize current word"), "alt+C", KeyBindingCategory.EDIT),
EMACS_LOWERCASE("Emacs lowercase word", Localization.lang("Make current word lowercase"), "alt+L", KeyBindingCategory.EDIT),
EMACS_UPPERCASE("Emacs uppercase word", Localization.lang("Make current word uppercase"), "alt+U", KeyBindingCategory.EDIT),
EMACS_KILL_LINE("Emacs remove all characters caret to end of line", Localization.lang("Remove line after caret"), "ctrl+K", KeyBindingCategory.EDIT),
EMACS_KILL_WORD("Emacs remove characters until next word", Localization.lang("Remove characters until next word"), "alt+D", KeyBindingCategory.EDIT),
EMACS_KILL_WORD_BACKWARD("Emacs characters until previous word", Localization.lang("Remove the current word backwards"), "alt+DELETE", KeyBindingCategory.EDIT),
EMACS_DELETE("Emacs delete", Localization.lang("Delete text"), "ctrl+D", KeyBindingCategory.EMACS),
EMACS_BACKWARD("Emacs move caret left", Localization.lang("Move caret left"), "ctrl+B", KeyBindingCategory.EMACS),
EMACS_FORWARD("Emacs move caret right", Localization.lang("Move caret right"), "ctrl+F", KeyBindingCategory.EMACS),
EMACS_WORD_BACKWARD("Emacs move caret to previous word", Localization.lang("Move caret to previous word"), "alt+B", KeyBindingCategory.EMACS),
EMACS_WORD_FORWARD("Emacs move caret to next word", Localization.lang("Move caret to next word"), "alt+B", KeyBindingCategory.EMACS),
EMACS_BEGINNING("Emacs move caret to beginning of line", Localization.lang("Move caret to beginning of line"), "ctrl+A", KeyBindingCategory.EMACS),
EMACS_END("Emacs move caret to of line", Localization.lang("Move caret to end of line"), "ctrl+E", KeyBindingCategory.EMACS),
EMACS_BEGINNING_DOC("Emacs move caret to beginning of text", Localization.lang("Move the caret to the beginning of text"), "alt+LESS", KeyBindingCategory.EMACS),
EMACS_END_DOC("Emacs move caret to end of text", Localization.lang("Move the caret to the end of text"), "alt+shift+LESS", KeyBindingCategory.EMACS),
EMACS_UP("Emacs move caret up", Localization.lang("Move the caret up"), "ctrl+P", KeyBindingCategory.EMACS),
EMACS_DOWN("Emacs move caret down", Localization.lang("Move the caret down"), "ctrl+N", KeyBindingCategory.EMACS),
EMACS_CAPITALIZE("Emacs capitalize word", Localization.lang("Capitalize current word"), "alt+C", KeyBindingCategory.EMACS),
EMACS_LOWERCASE("Emacs lowercase word", Localization.lang("Make current word lowercase"), "alt+L", KeyBindingCategory.EMACS),
EMACS_UPPERCASE("Emacs uppercase word", Localization.lang("Make current word uppercase"), "alt+U", KeyBindingCategory.EMACS),
EMACS_KILL_LINE("Emacs remove all characters caret to end of line", Localization.lang("Remove line after caret"), "ctrl+K", KeyBindingCategory.EMACS),
EMACS_KILL_WORD("Emacs remove characters until next word", Localization.lang("Remove characters until next word"), "alt+D", KeyBindingCategory.EMACS),
EMACS_KILL_WORD_BACKWARD("Emacs characters until previous word", Localization.lang("Remove the current word backwards"), "alt+DELETE", KeyBindingCategory.EMACS),

ABBREVIATE("Abbreviate", Localization.lang("Abbreviate journal names"), "ctrl+alt+A", KeyBindingCategory.TOOLS),
AUTOGENERATE_CITATION_KEYS("Autogenerate citation keys", Localization.lang("Autogenerate citation keys"), "ctrl+G", KeyBindingCategory.QUALITY),
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/org/jabref/gui/keyboard/KeyBindingCategory.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ public enum KeyBindingCategory {
VIEW(Localization.lang("View")),
BIBTEX(BibDatabaseMode.BIBTEX.getFormattedName()),
QUALITY(Localization.lang("Quality")),
TOOLS(Localization.lang("Tools"));
TOOLS(Localization.lang("Tools")),
EMACS(Localization.lang("Emacs"));

private final String name;

private KeyBindingCategory(String name) {
KeyBindingCategory(String name) {
this.name = name;
}

Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2109,6 +2109,8 @@ Make\ current\ word\ lowercase=Make current word lowercase
Make\ current\ word\ uppercase=Make current word uppercase
Move\ caret\ left=Move caret left
Move\ caret\ right=Move caret right
Move\ caret\ to\ previous\ word=Move caret to previous word
Move\ caret\ to\ next\ word=Move caret to next word
Move\ caret\ to\ beginning\ of\ line=Move caret to beginning of line
Move\ caret\ to\ end\ of\ line=Move caret to end of line
Move\ the\ caret\ down=Move the caret down
Expand Down

0 comments on commit 5b9498c

Please sign in to comment.