This repository provides LibreOffice configuration files that map common Microsoft Office keyboard shortcuts to their LibreOffice equivalents. It covers Writer (Word), Calc (Excel), and Impress (PowerPoint).
- Word -> Writer: Maps shortcuts like Clear Formatting (
Ctrl+Space), Go To (Ctrl+G), Font Size (Ctrl+Shift+<,>), etc. - Excel -> Calc: Maps shortcuts like Insert/Delete Rows (
Ctrl++,Ctrl+-), Insert Date/Time (Ctrl+;,Ctrl+Shift+:), etc. - PowerPoint -> Impress: Maps shortcuts like New Slide (
Ctrl+M), Duplicate Slide (Ctrl+D), Presentation Mode (F5,Shift+F5). - Customization Tool: Includes a Python script to easily modify shortcuts and generate your own configuration files.
-
Download the
.cfgfile for the application you want to configure from thedist/folder:Word_Shortcuts_for_Writer.cfgExcel_Shortcuts_for_Calc.cfgPowerPoint_Shortcuts_for_Impress.cfg
-
Open LibreOffice (Writer, Calc, or Impress).
-
Go to Tools > Customize...
-
Select the Keyboard tab.
-
Click the Load... button on the right side.
-
Select the downloaded
.cfgfile. -
Click Open.
-
Verify the shortcuts are loaded and click OK.
If you want to change any of the mappings or add new ones, you can use the included Python script.
-
Clone this repository.
git clone https://github.com/Zaki101Aslam/MS-office-shortcuts-for-Libre-Office cd MS-office-shortcuts-for-Libre-Office -
Run the customization script in interactive mode:
python3 src/generate_config.py --interactive
-
Follow the on-screen prompts:
- Select the application (Writer, Calc, or Impress).
- Edit (E): Change an existing shortcut.
- Add (A): Add a new shortcut mapping (requires knowing the UNO command).
- Save (S): Save your changes and generate a new
.cfgfile.
-
Import the generated
.cfgfile into LibreOffice as described in the Installation section.
To verify that the generated configuration files are valid (correct XML structure, valid UNO command format, and no duplicate keys), you can run the included verification script:
python3 src/verify_config.pyThis static analysis tool checks:
- Integrity of the Zip archive.
- Presence of required XML files.
- Correct XML namespaces.
- Duplicate key assignments within a single file.
- Valid command format (must start with
.uno:).
To verify that the shortcuts actually work in a real LibreOffice instance, you can run the GUI verification script. This script simulates keystrokes (typing, deleting, selecting, saving) and verifies the resulting document content.
Prerequisites:
- A graphical desktop environment (Windows, Linux with X11/Wayland, or macOS).
- LibreOffice installed and reachable via
libreofficeorsofficecommand. - Python libraries:
pip install pyautogui odfpy
Running the Test:
python3 src/verify_shortcuts_gui.pyNote: Do not touch your mouse or keyboard while the test is running. The test will perform typing, backspace, delete, and selection operations and strictly verify the output document content.
Feel free to open issues or pull requests to suggest more mappings! The mappings are stored in JSON files in the mappings/ directory.