Emacs: Disable Certain Pairs for electric-pair-mode

In Emacs, electric-pair-mode is a minor mode for manipulating pairs of (curly) braces/brackets/quotes, which was first introduced in Emacs 24. However, up till now, it still does not provide an easy option to disable a certain pair—we need to make use of electric-pair-inhibit-predicate. To disable a certain pair, such as double quotes, we can add the following to ~/.emacs or ~/.emacs.d/init.el:

To disable a certain pair for a specific mode, for example to disable the pairing of {} in web-mode (to allow web-mode to better handle the auto pairing of the template tags {% %}), we can add the following to ~/.emacs or ~/.emacs.d/init.el:

For more information, please read the documentation of the variable electric-pair-inhibit-predicate.

Make GNU Less More Powerful

Due to its speed and simplicity, GNU less is probably the most common default terminal pager on various GNU/Linux distributions—you may have probably used it explicitly via the less command, or implicitly when you execute the man command or git diff. Although the default configuration of less does not really offer much except for a basic text viewer, it is actually much more powerful than most people think. Here a few improvements over the default configuration are offered.

For macOS/OS X users: consider installing a newer version of less and other GNU command line utilities. To do so, you can follow the instructions here.

Continue reading

How to Achieve Different Open Source Levels on Your Laptop/Desktop

Open-source software, sometimes referred as free software, is a kind of software that permits the users to run, copy, distribute, study, change and improve it. Examples include Mozilla Firefox, Android, etc. For whatever reasons, many people care about whether the software they installed is open-source, while others don’t. Here I’ll show you how to achieve different open source levels, from 0% open source to 100% open source.

Continue reading

Optimization for Mobile: A Pair Programming Story at FullStackLA

Recently, I had the opportunity to pair with two fantastic developers: Ben @benjaminma and Ian @IanDCarroll at FullStackLA. This was also my first time at FullStackLA and it was great experience.

Ian had been working on a static website which lists and displays all the local meetups in Los Angeles. The challenge was simple: improve the website to look better on a mobile phone.

Continue reading