XWiki Keyboard Shortcuts: Developers & Extensions edition

21 Dec 2022 5 min read

Written by

Alexandra Nicolae

, Account Manager

No matter what your operating system of choice is or your preferred keyboard layout, the XWiki experience can be seamless. XWiki's default set of commands enables you to smoothly jump from one point to the other and perform actions without using a mouse or touchpad. What's even better is that you can fully set up and customize your own commands.

A short recap of XWiki's basic keyboard shortcuts

The following key sequences can be used to toggle specific actions on the currently logged-in user. These sequences allow you to easily perform actions using our standard shortcuts by switching to advanced user mode and displaying hidden pages:

x x x aToggle advanced user mode for the current user
x x x hToggle hidden pages for the current user

After pressing the x x x a key sequence, you will be notified that the REST request is successful and can now freely use the keyboard shortcuts.

You can find the full comprehensive guide on XWiki's keyboard shortcuts here.

Configuring keyboard shortcuts for developers

Of course, if you're looking to fully customize your typing experience with XWiki, there are multiple ways you can change the default settings. You can modify, add your own, as well as remove specific keyboard shortcuts. Did we mention there's also a command that allows you to entirely get rid of them?

Modifying keyboard shortcuts

  • Create a new page in your wiki - for example XWiki.KeyboardShortcuts and paste the following content inside:

    core.shortcuts.view.edit=e
    core.shortcuts.view.wiki=k
    core.shortcuts.view.wysiwyg=g
    core.shortcuts.view.inline=f
    core.shortcuts.view.rights=r
    core.shortcuts.view.objects=o
    core.shortcuts.view.class=s
    core.shortcuts.view.comments=c
    core.shortcuts.view.attachments=a
    core.shortcuts.view.history=h
    core.shortcuts.view.information=i
    core.shortcuts.view.code=d
    core.shortcuts.view.delete=Delete
    core.shortcuts.view.rename=F2
    core.shortcuts.edit.cancel=Alt+C
    core.shortcuts.edit.backtoedit=Alt+B
    core.shortcuts.edit.preview=Alt+P
    core.shortcuts.edit.saveandcontinue=Alt+Shift+S
    core.shortcuts.edit.saveandview=Alt+S

  • Modify entries in this list at your convenience
  • Save the page
  • Edit the page in object mode and add an XWiki.TranslationDocumentClass xobject
    • Select the wiki scope for the new translations (i.e. the new keyboard shortcuts) to apply to the whole wiki. You'll need to have Admin permissions for it to work.

Adding your own shortcuts

 You can add your own keyboard shortcuts in a few Javascript lines.

You can do that, for example, by adding a JavaScript StyleSheet Extension and inputting the following content:

shortcut.add("Ctrl+Alt+n", function() { alert("Hey there! Congratulations on typing this one."); });

Check out the complete documentation in order to start fully customizing your typing experience.

Removing keyboard shortcuts

To remove a shortcut adapt the following snippet to your needs and use it by inputting it in the same JavaScript StyleSheet Extension from above:

shortcut.remove("Ctrl+Alt+n");

Removing all shortcuts at once

for (binding in shortcut.all_shortcuts()) {
  shortcut.remove(binding.keys.join(' '));
}

Keyboard shortcuts for XWiki Extensions

Navigating and editing through our 800+ extensions can become just as easy as using our WYSIWYG editor. Just follow the tips & tricks below for a fast, seamless experience when editing within one of the numerous extensions you can find in our directory:

CtrlA

Selects all the content inside the editing area

CtrlB

          or

MetaB 

Formats the selected text as bold

CtrlC

         or

CtrlInsert

 

Copies the current selection to the clipboard

Ctrl

Creates an empty paragraph after the table containing the caret or the selection and places the caret in it. This is useful when you can't move the caret after a table because the page ends with it

CtrlI

         or

MetaI

Formats the selected text as italic

Ctrl U

          or

Meta U

Formats the selected text as underline

Ctrl ↑

Creates an empty paragraph before the table containing the caret or the selection and places the caret in it. This is useful when you can't move the caret before a table because the page starts with it

Ctrl V

          or

ShiftInsert    

Pastes the data from the clipboard

Ctrl X

          or

ShiftDelete     

Cuts the current selection

Ctrl Y

          or

Meta Y

Triggers the redo function

Ctrl Z

          or

Meta Z

Triggers the undo function

We've also outlined in a previous article that you can check out the main differences between Pro, Recommended, and Community extensions.

WYSIWYG Macro Support (since XE 3.0)

 or  ↑

 or  ←

 or 

 Navigate the macro output
EnterEdit macro
SpaceToggle between collapsed and expanded macro state

CtrlShift +  R

Reloads the macros

CtrlShift + E

Expands all/selected macros

CtrlShift + C

Collapses all/selected macros

CtrlShift + M

Opens the insert macro wizard

Congratulations! You are now an expert user in the XWiki environment and can seamlessly navigate within your instance.

Don't forget that we gladly welcome you as part of our community and you can easily contribute by spreading the word, giving us feedback, and even discussing on the forum with fellow peers in the community.

You may also be interested in: