Find Me On

My Homepage





RSS Feeds

My Stuff

Shared Items

Search This Blog


Josh Braun’s Blog // I have it written down somewhere . . .

Emacs Keybindings for LibreOffice Jul 9, 2013

emacsofficeAs I wrote recently, I’ve had a difficult time finding a Linux word processor that meets my day to day needs and also allows me to easily use Emacs keybindings.

After that post, I finally bit the bullet and manually configured at least a few of the more commonly used Emacs keybindings in LibreOffice Writer.  As I mentioned previously, this process is made painful by the need to remap numerous conflicting default shortcuts along the way, while avoiding the creation of new conflicts with the application and the desktop environment.

Now that it’s done, though, I figured I share the fruits of my labor.  The final solution is far from elegant, but is better than any of my own previous attempts, and I’ve reduced the number of unresolved shortcut conflicts I found in other solutions around the web.

Here’s the saved shortcuts file, which can be imported as-is into LibreOffice, in the event it’s helpful to anyone else.  For the sake of posterity, I should note that it was created using LibreOffice v4.0.4.2, and I’m providing it, as usual, with no warranty express or implied:

Note that there’s no need to unzip the file—LibreOffice expects this file format.  To import it, download the file, open LibreOffice Writer, go to ‘Tools > Customize > Keyboard’ and click the ‘Load’ button.  Select the file, click “Okay,” and you’re done.

Here, specifically, are the Emacs keybindings I implemented, along with where to find them under LibreOffice’s ‘Tools > Customize > Keyboard’ interface if you want to reset them or mess with them yourself:

C-f: forward one character (Navigate > Go Right)
C-b: back one character (Navigate > To Character Left)
C-n: next line (Navigate > To Line Below)
C-p: previous line (Navigate > To Top Line)

M-f: forward one word (Navigate > To Word Right)
M-b: back one word (Navigate > To Word Left)

C-a: beginning of logical line (Navigate > To Paragraph Begin)
C-e: end of logical line (Navigate > To Paragraph End)

C-v: next page (Navigate > Next Page)
M-v: previous page (Navigate > Previous Page)

M-d: kill rest of word (Edit > Delete to End of Word)
C-k: kill rest of logical line (Edit > Delete to End of Paragraph)
C-w: kill selection (Edit > Cut)
M-w: copy selection (Edit > Copy)

C-y: yank clipboard content (Edit > Paste)

Note that I opted for logical lines, not screen lines, when it came to keybindings like C-a, C-e, and C-k.  This means that a line goes on until a carriage return, as opposed to ending each time the text wraps.  It’s possible, though, to have it either way if you care to futz with the shortcut configurations.

As indicated, implementing the above keybindings meant remapping some of LibreOffice’s default shortcuts.  Below are the new keybindings I gave to shortcuts that were overwritten by my new configuration:

Create New Document (Application > New)
Previously: C-n
Now: C-M-Shift-n

Print Document (Documents > Print)
Previously: C-n
Now: C-M-Shift-p

Close Document (Documents > Close)
Previously: C-w
Now: C-M-Shift-w

Center Text (Format > Centered)
Previously: C-e
Now: C-M-Shift-e

Make Text Bold (Format > Bold)
Previously: C-b
Now: C-M-Shift-b

Select All (Edit > Select All)
Previously: C-a
Now: C-M-Shift-a

Redo (Edit > Redo)
Previously: C-y
Now: C-Shift-Z (Common “redo” shortcut for other applications)

Paste (Edit > Paste)
Previously: C-v
Now: C-y (Another Emacs keybinding)

There is one still-broken keybinding. ‘M-w’ previously opened the “Window” dropdown menu, but is no longer mapped to this feature.  I’m sure this is fixable, but I haven’t yet found the menu option or configuration file for remapping LibreOffice’s menu shortcuts.

Note that, while the above replacement bindings are verbose, making them so prevents a snowball of other shortcut conflicts that would likely end up being worse in the long run.  And I tried to be consistent, so as to make the remappings easy to remember.

If, at any time, you want to undo these keybindings and go back to the LibreOffice defaults, you can use the ‘Tools > Customize > Keyboard’ interface in Libreoffice to change them back.  This requires a lot of work by hand, however.

The simplest way to get back all the original LibreOffice keybindings is to close LibreOffice. Then, locate and delete the ‘registrymodifications.xcu’ file inside your LibreOffice settings folder (usually ‘~/.libreoffice’ or ‘~/.config/libreoffice’; and make a backup first, for the love of God—don’t just wipe it because I told you to), then restart LibreOffice.  ‘registrymodifications.xcu’ houses the tweaks we’ve made, so deleting it gets rid of them instantly, and restarting LibreOffice will regenerate the deleted file with default settings.  The downside of this, though, is that it has the potential to simultaneously destroy other customizations you may have made to LibreOffice.  If you want to do more precise surgery on registrymodifications.xcu, check out this LibreOffice help forum thread, which gives instructions for excising keybinding modifications from the file.

In any case, please enjoy, and feel free to post your own fixes/improvements/solutions in the comments.

Posted in Journalism, New Media & Digital Culture | Tagged , , | 2 Comments

A Feed of My Shared Links Jul 8, 2013

photoA while back, I mentioned that I’m now using Tiny Tiny RSS as my news reader.  I share some of my favorite quotes and items on this blog, but if you’d simply like a minimalist feed of my shared links, I make these items available by RSS and I also syndicate them to a Twitter account.

As with everything around here, my shared links tend to track my interests in media distribution, journalism, television, and open source software, though I’ll occasionally toss in other stuff as well.

Posted in Journalism, New Media & Digital Culture | Tagged , , | Leave a comment

“RSS represents the antithesis of this new world [of proprietary APIs]: it’s completely open, decentralized, and owned by nobody, just like the web itself. It allows anyone, large or small, to build something new and disrupt anyone else they’d like because nobody has to fly six salespeople out first to work out a partnership with anyone else’s salespeople.” Jul 3, 2013

Marco Arment, “Lockdown”

Posted in Clipped | Tagged | Leave a comment

“Being interested in both natural and programming languages, I decided to expand on this analysis of profanity in git commit messages per programming language.” Jul 3, 2013

Ramiro Gómez, “Exploring Expressions of Emotions in GitHub Commit Messages”

Posted in Clipped | Tagged | Leave a comment

In a Bind: Word Processing in Linux Jul 3, 2013

The year is 2013 and as far as I can tell, there is no good solution for word processing in Linux—at least according to my modest standards. Perhaps this is unsurprising, given that some early Linux FAQs concerning word processors basically suggest that they’re unnecessary nuisances for people unfamiliar with markup languages.  And while I’d happily forgo word processors all together, unfortunately, I’d have a hard time getting employers, collaborators, and publishers to agree to the suggestion.  And so my search for a good open source word processor is ongoing.

In most contexts and about most things, I am a firm exponent of open source software generally and the Linux ecosystem in particular. But here is one area in which I am flummoxed. All I want are three simple things:

  1. To open and create MS Word-compatible comments and annotations.  I may be willing to work in programs other than Microsoft Word, but I can’t count on my collaborators doing the same.  If they mark up a document, or ask me for comments, it’s generally in .doc/.docx format.
  2. To export in a format acceptable to academic journals in the social sciences. In terms of the text itself, this generally means APA—or occasionally Chicago-style—headings, in-text citations, and references.  With regard to filetype, it almost always means .doc or .docx.
  3. To use Emacs/*nix keybindings.  The program should come with the option to use—or I should be able to implement—basic Emacs keybindings without creating horrible conflicts with other keyboard shortcuts.

This last point may seem nitpicky, but part of the joy of Linux for me is the ability to navigate my whole OS nimbly with the keyboard, and Emacs keybindings—along with vim’s—are pretty much as close as Linux comes to universal shortcuts. They’re present, or at least available, in just about every environment where one edits or works with text. And like many people who’ve used programming text editors along the lines of Emacs/vim or spent any length of time on the command line, these efficient keyboard shortcuts have ruined me when it comes to working in a word processor.

Here are the things I have tried, and how they stack up.

LibreOffice Writer

libreofficePart of probably the largest open source office suite project, LibreOffice Writer seems like it should be the go-to software for word processing in Linux.  And it does pass several of my tests.

Comments + annotations. Until recently, comments and annotations were a bit lousy in LibreOffice, but as of version 4.0 it now has full support for MS Word annotations.

APA formatting. With formatting tools standard to pretty much any word processor and the ability to save in almost every popular document format, formatting for social science journals is no problem for LibreOffice.

Emacs keybindings. Here’s where things get sticky.  Marcus Nitzschke has released a configuration file that ostensibly allows you to use simple Emacs keybindings with LibreOffice, but (a) it doesn’t always work as advertised (the CTL-B keybinding for moving back a space doesn’t work for me, even in the latest version of LibreOffice), and (b) there are conflicts all over the place.  For example, CTL-A for jumping to the beginning of a line overrides the program’s existing shortcut for “select all,” and CTL-E for end-of-line overrides the program’s default shortcut for centering text.  Remapping these other shortcuts only makes matters worse.  For example, any alternative key combo that uses the Command/Windows/Super key is likely to conflict with one’s desktop shortcuts, and using the Alt key overrides yet more existing LibreOffice keybindings that have to be remapped in turn.  All this gets messy very quickly.  I imagine the person who finally and successfully remaps every LibreOffice shortcut to make it compatible with Emacs keybindings will find their online tip jar very full within a matter of hours.

Calligra Words

wordsAs part of another major open source office suite, Calligra Words, would seem to be another good candidate for a word processor that meets all my requirements.  Alas…

Comments + annotations. While it’s on the roadmap, Words sadly does not support MS Word-style comments and annotations.

APA formatting. Like LibreOffice, Words does a fine job when it comes to APA style and the creation of numerous document types.

Emacs keybindings. Admittedly, I haven’t searched very hard, since the annotations problem prevents me from using Words anyhow, but I’ve yet to find a good Emacs keybindings solution for this application.


AbiWordAbiWord is another popular open source word processor that has shipped with many Linux distros over the years.  I was quick to try it, but…

Comments + annotations. AbiWord supports comments, but it has its own unique system for comments and annotations that never seems to play well with MS Word.

APA formatting. Again, AbiWord does a fine job when it comes to APA style and the creation of numerous document types.

Emacs keybindings. Of all the Linux word processors, AbiWord is, surprisingly, the only one I’ve found that has built-in, out-of-the-box support for Emacs keybindings.  If its system for comments and annotations were a bit more standard and more compatible with MS Word, I’d happily use it.


200px-EmacsIcon.svgNow, you may ask, if I love Emacs so much, why don’t I use it as my word processor?  Well, the answer is I’ve tried.  Specifically, I’ve tried to use Emacs’ various TeX/LaTeX modes, as well as Org Mode‘s export features.  While keybindings obviously cease to be an issue in these scenarios, other annoyances quickly become apparent.

TeX/LaTeX Modes

Oh, to be a computer scientist, a mathematician, or a physicist, whose communities happily accept TeX files.  Unfortunately, the whole point of TeX appears to be to allow folks who’re comfortable with Emacs and other programming editors to create beautifully typeset documents, while avoiding having to use a word processor altogether.  Unfortunately for me, this means that reviewing MS Word comments, or exporting a TeX file to .doc/.docx format is a pain, and—for TeX’s core user base—beside the point.  So, even though it’s relatively simple to create an APA-formatted TeX document, it’s hard to commute it into a file format that collaborators or social science journals will accept.

Org Mode

200px-Org-mode-unicorn.svgOrg Mode is pretty awesome in that it allows you to write entire articles in Emacs and then export them in a format that can be opened in a word processor. It even works with a common citation manager. Unfortunately, it won’t as easily open or allow you to review comments on a document created in a word processor. What’s more, Org Mode’s core function is outlining, and an Org Mode document wants, with all its heart, to be exported in an outline format. It’s theoretically possible to override this behavior by editing the document’s settings, but Org Mode’s word processor compatibility still seems to be in its infancy and I’ve yet to be able to successfully configure a document such that it didn’t need a ton of reformatting after having been exported as a word processor document.

In short, I’m frustrated.  If all you’ve ever used is Microsoft Word, you could probably make the jump to LibreOffice without skipping a beat.  But once you’re hooked on those damn Emacs/shell keyboard shortcuts, it’s surprisingly hard to live without them.

So what word processor do I use? Sadly, in this one area I’ve forgone Linux and open source.  I use Apple’s Pages.  Ironically, despite the fact that Apple has gleefully blown up tons of Unix defaults, Pages (and other Apple software) support all the basic Unix keybindings, while open source word processors mostly fail miserably in this area.

If you have the solution here, please let me know. If there’s a Linux word processor that meets my three simple requirements, I’ll be immensely happy to be proven wrong.

Posted in Journalism, New Media & Digital Culture | Tagged , | 3 Comments

My Linux Desktop(s) Jul 2, 2013

You know those days where something about your operating system is bugging you?  The inability to drag and drop some piece of information from one place to another, some process that always wants to run in the background, slowing down your whole machine, or some other default behavior that annoys the crap out of you?  Whether it’s Windows or Mac, I always encounter these yak shaving moments where a task that seems like it should be simple turns out to be needlessly complicated.

This is why I love Linux.  Are Linux desktop interfaces perfect? Hell no. But when they bug me, I can switch between them at will.  That’s because under Linux (as with many *nix systems), the graphical desktop interface is handled separately from lower level functions like file storage and device management.  So when something bugs me about a particular desktop environment’s behavior, I just toggle over to a different one and continue working with my files and applications there.  In fact, I keep three separate desktops on my Linux machine.

First, there’s Openbox, a very speedy, lightweight “window manager” that’s highly customizable and great for things like editing photos or other tasks that require manipulating lots of windows and applets at once:


Second, there’s HerbsluftWM, a “tiling window manager” that maximizes your screen real estate, is good at placing code snippets side by side, and requires very little mouse manipulation, allowing you to keep your hands on the keyboard at pretty much all times.  It’s superior for programming tasks, and its ability to obviate use of the mouse probably saved me from a repetitive stress injury to my wrist earlier this year during grading season.


And lastly, for those times when I want an OS X-like “everything’s integrated” experience, I also have Gnome 3.  It’s a very powerful and full-featured desktop environment.  If Gnome 3 has a downfall, it’s that it’s less configurable than the others.  But it’s also the most novice-friendly of the bunch and is straightforward for even first-time Linux users.  Plus, since I’ve customized my other window managers to the point that they probably only make sense to me, Gnome 3 is nice to have around for those times when someone asks, “Can I use your computer for a second?”


[Image Credits: The screenshots are obviously mine, but I should mention that both of the visible desktop backgrounds come from Google+ Arch Linux Community user, Kemal E]

Posted in Journalism, New Media & Digital Culture | Tagged , , , , , | 2 Comments

Back Up Your Google Reader Data Jun 29, 2013

Via Tiny Tiny RSS forum user cqrt, a solution for making a complete backup of your Google Reader data before the lights go out on July 1st:

This should probably belong in knowledge base but in a few days it will be obsolete. Former Google Reader engineer, Mihai Parparita, has created some python scripts that will enable you to download you entire Google Reader content, including subscriptions, notes, starred items, shared items, liked items, the list of followers, people you were following, the items shared by the people you were following and also including the entire content of the posts from your subscriptions. If you have a lot of subscriptions, make sure you have plenty of storage space available.

Posted in Journalism, New Media & Digital Culture | Tagged , , , | Leave a comment

William Gibson’s “Pattern Recognition” Jun 29, 2013


I recently finished reading William Gibson’s novel, Pattern Recognition.  Published in 2003, it’s a prescient social critique of surveillance marketing, the post-9/11 security state, and the uncomfortable blurring of the two.  While reviews of the book when it came out apparently fretted at times as to whether it would seem dated within a few years, the topics it deals with, ranging from the discontents of globalization to NSA monitoring of Internet traffic, are in many places as relevant today or more so than they were a decade ago.  A few of Gibson’s more memorable quotes from the book:

The site had come to feel like a second home, but she’d always known that it was also a fishbowl; it felt like a friend’s living room, but it was a sort of text-based broadcast, available in its entirety to anyone who cared to access it.

You ‘know’ in your limbic brain. The seat of instinct. The mammalian brain. Deeper, wider, beyond logic. That is where advertising works, not in the upstart cortex. What we think of as ‘mind’ is only a sort of jumped-up gland, piggybacking on the reptilian brainstem and the older, mammalian mind, but our culture tricks us into recognizing it as all consciousness. The mammalian spreads continent-wide beneath it, mute and muscular, attending its ancient agenda. And makes us buy things.

Everything Lenin taught us of communism was false, and everything he taught us of capitalism, true.


Posted in Clipped | Tagged , , , | Leave a comment

Merriam-Webster on “Irregardless” Jun 28, 2013

I watched the explanation.  This word still ticks me off regardless.

Posted in One-Off Musings | Tagged , , | Leave a comment

“When Unix was created and when it formed its cultural values, there were no end users. Computers were expensive, CPU time was expensive, and learning about computers meant learning how to program. It’s no wonder that the culture which emerged valued things which are useful to other programmers.” Jun 28, 2013

Joel Spolsky, “Biculturalism”

In this essay, Spolsky reviews Eric S. Raymond’s recent book, and examines differences between the cultural values of Windows and Unix programmers and how that translates into different user experiences.  I like the essay quite a bit—it has a nice “communitarianism meets software development” vibe to it.

Posted in Clipped | Tagged , , , , | Leave a comment