GithubHelp home page GithubHelp logo

fira-code-emacs's Introduction

fira-code-emacs

Some code to make Fira Code 2.0 work in Emacs.

To install, first run make. Copy some or all of the files in modified to you ~/.fonts directory. Put fira-code.el and fira-code-data.el into your load-path, and ensure fira-code-mode is enabled for any buffers where you want ligatures. Set your default font to one of the Fira Emacs variants. If you want to see all the ligatures variant characters, open fira-code-data.el in Emacs.

To control which ligatures and alternative characters are used, set fira-code-enable-substitution-predicate and fira-code-compose-predicate. Refer to the default values for an example of how to write your own predicates.

fira-code-emacs's People

Contributors

google-jrw avatar johnw42 avatar itoshkov avatar dlyr avatar

Stargazers

Yusuke Matsushita avatar Justin Schell avatar  avatar Minh Tran Nhat avatar Antares avatar Marin Atanasov Nikolov avatar  avatar John Hamelink avatar Rameez Khan avatar resister avatar Ujjwal Thaakar avatar Patrick Hildreth avatar  avatar Eude Kinsley Lesperance avatar Evgeny Kurnevsky avatar Alexander Svinarev avatar Bob Forgey avatar Kirill Poletaev avatar Jerry Peng avatar tianshu avatar Ankush Mishra avatar  avatar Jacob Sonnenberg avatar jilen avatar  avatar Steve Baker avatar Jinseop Kim avatar andrea denisse avatar Vincent Demeester avatar Ryan Pilgrim avatar Mohammed Ismail Ansari avatar Claire Connelly avatar Stephen Lempke avatar Sam Heaton avatar Ewan Dawson avatar Isak avatar Jonathan Raphaelson avatar Barry Roberts avatar tsohlacol avatar Akira Komamura avatar Jcaw avatar Tom Solberg avatar  avatar Arialdo Martini avatar  avatar Marcus Riemer avatar Joel Boehland avatar James Haydon avatar Matt Novenstern avatar bharat avatar Jumpei KAWAMI avatar Marcin Wiśniowski avatar  avatar P Ξ D R O L U Z avatar Dustin  Neumann avatar J Carr avatar Thomas Munoz avatar Khinshan Khan avatar Ivan Inozemtsev avatar Philippe  avatar

Watchers

 avatar  avatar James Cloos avatar  avatar

fira-code-emacs's Issues

Strange behavior with the last commit!

Great job, congratulations.

In the last commit you get a strange behavior as you can see in the attached image.

output-2019-09-15-21:15:38

In my configuration I have it like this:

(leaf pcache
  :straight t
  :init
  (setq pcache-directory (let ((dir (concat conf:cache-dir "pcache/")))
                           (make-directory dir t)
                           dir)))

(leaf unicode-fonts
  :straight t
  :init (unicode-fonts-setup))

(global-font-lock-mode 1)
(set-face-attribute 'default nil
                    :font "Fira Emacs Retina"
                    :height 115
                    :slant 'normal
                    :weight 'normal
                    :width 'normal)

(leaf fira-code
  :straight (fira-code
             :type git
             :host github
             :repo "johnw42/fira-code-emacs")
  :hook (prog-mode-hook . fira-code-mode))

Thanks

Wrong ligature mappings

Hi,

I've been using this package successfully since it's release without any issues. However, I just tried installing again on another system using a clean checkout of this repo and rerunning make to generate fira-code-data.el. This time, the ligatures are not correctly mapped/rendered. See for example the first few lines of the fira-code-data.el opened in emacs below

;; -*- coding: utf-8 -*-
(defconst fira-code--data
  '(["space.frac" " " "\xe100"]  ;
    ["exclam_exclam.liga" "!!" "\xe101"]  ;
    ["exclam_exclam_period.liga" "!!." "\xe102"]  ;
    ["exclam_equal.liga" "!=" "\xe103"]  ;
    ["exclam_equal_equal.liga" "!==" "\xe104"]  ;
    ["numbersign_exclam.liga" "#!" "\xe105"]  ;
    ["numbersign_numbersign.liga" "##" "\xe106"]  ;
    ["numbersign_numbersign_numbersign.liga" "###" "\xe107"]  ;
    ["numbersign_numbersign_numbersign_numbersign.liga" "####" "\xe108"]  ;

Making things work with Doom Emacs

Caution: Developer with no lisp experience coming in hot with probably incorrect yet well-intentioned thoughts

I had to remove the (load "fira-code-data") line from fira-code.el and load the files from my config.org like so:

  (load-file "/home/john/.config/doom/font-ligatures/ligature-font.el")
  (load-file "/home/john/.config/doom/font-ligatures/fira-code-data.el")
  (load-file "/home/john/.config/doom/font-ligatures/fira-code.el")

While I was there, I fixed some warnings on lines 72-80 (replacing t with _):

    (cond
     ;; Haskell-specific settings:
     ((derived-mode-p 'haskell-mode)
      (pcase input-string
        ("$" _)                         ; use alternate $
        ("/=" "!=")                     ; "not equal" is /=
        ("!=" nil)                      ; != is not special
        (_ default-enabled)))
     (_ default-enabled))))

After that, it works as expected, from what I can tell. Thanks for contributing this project :)

fira-code-mode working for all modes except Agda

Thanks for sharing fira-code-mode. I've installed it following the provided instructions and I found that it works beautifully in all modes except the one I'm most interested in (Agda mode). Below are two screenshots:

  1. fundamental mode and fira-code-mode enabled, the ligature is shown correctly
  2. agda mode and fira-code-mode enabled, the ligature is not shown (but in the mode line there's a ligature!)

I have no issues with fira-code-mode in other languages (C++, Haskell), so I suppose that fira-code-mode and agda-mode step onto each other in some way, but I have no idea where to look for the issue. Any clue that could point me in the right direction?

BTW, I'm on MacOS and use Emacs for MacOS.
1_fundamental
2_agda

How to use cascadia code support?

I saw there are cascadia-emacs-data.el file and Cascadia Emacs font.
but there's no cascadia-mode. If I use fira-code-mode, the ligature seems not correct.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.