

GitHub - jming422/fira-code-mode: Emacs minor mode for Fira Code ligatures using...
source link: https://github.com/jming422/fira-code-mode
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md
fira-code-mode
Minor mode for Fira Code ligatures using prettify-symbols.
This is a simple minor mode for Fira Code ligatures, built from these instructions on the FiraCode repo.
You don't need to use Fira Code as your main font in Emacs for this to work! Using this minor mode will give you just the ligatures from the Fira Code font; it won't alter your fonts or faces in any other way. (Of course, you're free to use Fira Code as your main font alongside this package - that's what I do!)
Getting Started
-
Install the Fira Code Symbol font to your system (Download) (Original post).
- If you don't know how to install a font to your system, check out Fira Code's main repo. They have some good instructions here.
- Thanks to @siegebell for creating this font.
-
Clone this repo. I keep mine in
~/.emacs.d/git-lisp/fira-code-mode
, but you can put it wherever you like. -
Enable
fira-code-mode
in your config. Here are some examples:
With use-package (this is the config that I use personally):
(use-package fira-code-mode :load-path "git-lisp/fira-code-mode" :custom (fira-code-mode-disabled-ligatures '("[]" "#{" "#(" "#_" "#_(" "x")) ;; List of ligatures to turn off :hook prog-mode) ;; Enables fira-code-mode automatically for programming major modes
Feel free to remove or change the :custom
and :hook
values of course, but those are the ones I've found useful. Most of the ligatures I've disabled are purely preferential; some of them conflicted with other syntax styling for e.g. Clojure reader macros.
Without use-package:
(add-to-list 'load-path "~/.emacs.d/git-lisp/fira-code-mode") (require 'fira-code-mode) (custom-set-variable 'fira-code-mode-disabled-ligatures '("[]" "#{" "#(" "#_" "#_(" "x")) ;; List of ligatures to turn off (add-hook 'prog-mode-hook 'fira-code-mode) ;; Enables fira-code-mode automatically for modes descended from prog-mode
Again, the last two lines are optional, but they're a reasonable starting point.
- Done, enjoy the ligatures!
Customization
As of now, fira-code-mode-disabled-ligatures
is the only customizable option. Add a string to this list to prevent that string from being displayed with a ligature.
Contributing
This is the first Emacs package that I've made, and I'm making it available in hopes that it will make your lives easier as it did mine. I welcome suggestions and contributions, but here are a couple things to be aware of:
- I'm quite new to writing Emacs Lisp, so please be nice! I know I have a lot to learn.
- I don't have a ton of time to spend on this, but I'll do my best to respond to issues and PRs quickly!
- If you've read this far, thank you! I'm very grateful for the chance to make something useful/interesting.
Recommend
-
138
Irony-Mode A C/C++ minor mode powered by libclang irony-mode is an Emacs minor-mode that aims at i...
-
148
IMPORTANT This package is not maintained anymore. User should go and checkout weirdNox/org-noter as an alternative. Interleaved Textbooks? Some history, w...
-
39
README.md fira-code-emacs Some code to make Fira Code 2.0 work in Emacs. To install, first run make. Copy some or all of...
-
5
Typographic Ligatures in Emacs This package maps ordinary graphemes (characters) to fancy ligatures, if both your version of Emacs and the font supports it. With this package you can control where Emacs must display ligatures....
-
15
gorepl-mode A minor emacs mode for Go REPL. Synopsis gorepl-mode is a Go REPL interaction library for Emacs. It's built on top of gore. Gorepl pack...
-
7
在Spacemacs中配置Fira Code并启用ligatures特性 发表于 2019-09-09 | 分类于 技术控 |
-
19
auto-minor-mode This package lets you enable minor modes based on file name and contents. To find the right modes, it checks filenames against patterns in auto-minor-mode-alist and file contents against auto-minor-...
-
18
yard-mode Rudimentary support for fontifying YARD tags and directives in ruby comments. Installation Use MELPA: M-x package-install yard-mode. Ad...
-
8
【vscode高级玩家】设置酷炫字体Fira Code发表于2021-12-20更新于2023-05-04字数统计794阅读次数654阅读次数136
-
6
How I falling in love with Fira Code Font – – I'm a developer, son, big brother and husband.
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK