Thanks to visit codestin.com
Credit goes to github.com

Skip to content

jcs-emacs/jcs-emacs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

License Emacs Release Tag CI

Windows macOS Linux

Table of Contents

jcs-emacs

Consistent Emacs configuration for all platforms.

This is Jen-Chieh Shen's emacs configuration. This configuration started from Casey Muratori's Emacs configuration. It has been repeatedly utilized and modified since 2015 and is now very different to his configuration.

I wouldn't claim this is the best Emacs config, but this is the best config to myself. If you wish to learn Emacs, this could be a good start, because this configuration has been rewritten basically from scratch. Hopefully, this config will help someone who is new or struggle to Emacs. This configuration should work on most OSs, indicates Windows, macOS, and Linux.

Emacs itself supports multiple programming languages. I managed all the programming languages I personally used. I dabble in numerous technologies, incorporate hardware, firmware and software. Here is the list of programming languages I know and are extended from this configuration.

  • ActionScript 2.0 or 3.0 / Ada / Agda / AppleScript / Assembly Language
  • BASIC / Batchfile
  • C / C++ / C# / Clojure / CMake / COBOL / CSS
  • Dart / Dockerfile
  • Elixir / Elm / Emacs Lisp / Erlang
  • F# / Fountain
  • GLSL / Go / GDScript / Groovy
  • Haskell / Haxe / HTML
  • INI
  • Java / JavaScript / JSON / JSX
  • Kotlin
  • LESS / Lisp / Lua
  • Makefile / Markdown
  • Nix
  • Object Pascal (Delphi) / Objective-C
  • Pascal / Perl / PHP / PowerShell / Properties / Python
  • R / Ruby / Rust
  • Sass / Scala / SCSS / Shader / Shell script / SQL / Swift
  • TOML / TSX / TypeScript
  • Verilog / Vimscript / Vue
  • XML
  • YAML

This configuration polished and goes toward to the modern text editor, or even better, it goes beyond modern IDE. e.g. Atom, Brackets, Sublime Text 2 or 3, Visual Studio Code, etc.

Philosophy

I have experienced many different kinds of IDEs and text editors. But I’ve had a hard time finding the best tool to use. I’ve jumped from one working field to another trying to find something that suits my needs. So instead of struggling with the tool itself, I chose Emacs and configured the entire thing from scratch, to suit my needs.

Here are a few goals that I want this config to accomplished.

  • Having the same set of key bindings across different IDEs and text editors as many as possible.
  • Having the same font and theme across different OSs and environments.
  • Automating trivial or redundant tasks.
  • Improve user experiences approach to modern text editor or IDE.
  • Make compatible to most features work inside terminal as well.

Having these implementations makes my life easier, and having a genuinely portable workspace, which is great because it lets me work on different machine efficiently, without having to get used to an new IDE.

πŸ“° News

Here is the list of few important and recent changes to this configuration.

  • 7.0.1 - Replace quelpa with github-elpa.
  • 7.0.0 - Switch from quickhelp to box for company frontend.
  • 6.5.0 - Add pinned archive feature to package module.
  • 6.4.2 - You can now resolve package dependency graph while deleting package.
  • 6.4.1 - Start with tree-sitter support.
  • 6.4.0 - Switched from projectile to built-in project for project management.
  • 6.3.1 - Replaced docstring module to external docstr package.
  • 6.2.5 - Use recipes folder instead to specify manually installed packages in the configuration.
  • 6.2.4 - Replaced ag silver searcher to searcher.
  • 6.2.2 - Correct upgrade logic for manually installed packages.

πŸ’Ύ Installation

To install, clone this repo and copy the core files/directories to the emacs config directory accordingly. Make sure you backup your own configuration before you start the installation.

# clone this repo
$ git clone https://github.com/jcs-emacs/jcs-emacs.git

# change current directory to project directory
$ cd jcs-emacs

# copy init file to home
$ cp ./.emacs ~/

# copy core directories to home
$ cp -r ./.emacs.d ~/
$ cp -r ./.emacs.jcs ~/

Then startup Emacs; it will automatically installs all necessary packages due to this configuration.

❗❗ [ATTENTION] ❗❗ -- MAKE SURE YOU INSTALLED THE CORRECT VERSION OF EMACS!

πŸ•’ Startup Time

The average startup time for this configuration is around 15 to 25 seconds. You can use command emacs-init-time to check the startup time on your machine. Not quite sure what causes that much of performance, hopefully, I'm able to lower the startup time down to 5 to 15 seconds.

Edit 1: After version 5.3.2, the average startup time is around 5 to 15 seconds. Solved this issue by removing unnecessary require keyword load file and use :defer keyword with use-package package to delay some packages load time.

πŸ“ P.S. Here is a great article about Speeding Up Emacs written by Anurag Peshne.

Edit 2: If you compiled the source code then the startup time can lower down more from 0.5 to 1.5 seconds.

Edit 3: Using esup package to test and optimize the configuration. Call package-refresh-contents only when package installation is needed. By doing thing, lower the startup time from around 4 to 8 seconds.

πŸ“ P.S. Some good hints from one StackExchange question, What can I do to speed up my start-up? answered by Jordon Biondo.

πŸ“ P.S. The above cases are tested on Windows. Other OS that are not Windows should start up under a second.

πŸ† Features

Highlight

Here is the list of the major highlights to this configuration. Hope you would like my taste!

  • Out of the box - Out of the box anywhere.
  • Cross Platform - Work on all operating system including terminal.
  • Fast Startup - Lazy loading for all unnecessary packages on startup.
  • Old-Fashioned - Doesn't use any beatiful GUI because it may not work in terminal.
  • Multiple Languages - Support multiple programming languages.
  • Consistent - Having the same coding experience in different major mode.
  • Easy to use - Design close to other modern text editors. Shouldn't spend you too much time.
  • Dual Windows - Design to people who like multiple windows opened simultaneously.
  • Keyboard Focused - You can do everything by using keyboard and mouse are just optional.

Details

This is the list of features that are built-in to this configuration. These features are heavily base on my personal habits, and so these could be very tiny things. But I believed detials make things better and make life smoother.

πŸ“ Package Archives

A list of package archives that this configuration uses.

  • ELPA - Emacs Lisp Package Archive
  • MELPA - Milkypostman’s Emacs Lisp Package Archive
  • elpa (jcs) - Emacs Lisp Package Archive for this configuration

πŸ“ P.S. Here is a good talk comparing all package archives from a StackExchange question, What are the practical differences between the various Emacs Package Repositories? answered by Tikhon Jelvis.

πŸ† Powered by

Here is the list of all packages that powered and make this configuration works. Thanks to all the package maintainers; this configuration cannot be made without them, and if you wish to support them you can go to this elisp-maintainers repo/site and search for the maintainer you want to support. There should be some kind of methods that you could support the maintainer you want.

Functionalities

File Modes

If you want to change the default mode to certain file type, you might want to checkout the ./.emacs.jcs/jcs-mode.el file. You will see a list of mode that are opened by default mode to certain extension.

πŸ“ P.S. The awesome-emacs is a list of Emacs package that you can choose other alternatives to replace any similar packages listed here. Is also a good place to seek and learn what's inside Emacs!

Key Bindings

This configuration have all modes bind to the same set of key bindings. It benefits the developer would not need to change their key bindings while after the mode swichted. The key bindings set can be modified in ./.emacs.jcs/jcs-key.el file.

πŸ“ P.S. * My work requires me to use Visual Studio IDE that being said the key bindings set are most likely compatible to Visual Studio IDE.

  • Excepts keys that bind to C-x and C-c, Emacs are deeply binds to these two keys, and many packages also use these two keys for there preset keys. As you may know these two keys are often cut and copy, is awkward that I solved this by adding the same key stroke once again, hence the cut key is C-x C-x and the copy key is C-c C-c.

Edit 1: After version 5.8.3, the cut and copy keys had been corrected and no longer the hassle to this configuration. Thanks to use-package again, letting me bind C-x and C-c keys for higher precedence.

Themes

Default

The theme was to design close to Visual Studio IDE preset light/dark theme. I believed Microsoft has a great UI/UX team, since I don't have any experience or work related to UI/UX, I would just like to have the theme color as close to it as possible. Anyway, if you want to customize the theme yourself, then check out the ./.emacs.jcs/jcs-theme.el file. All the theme related variables can be found in that file.

Light Theme Dark Theme

Customization

In common, you can install any theme you want as long it is available on the internet. You can check out the Emacs Theme Gallery site here. For instance, vs-dark-theme and vs-light-theme are now individual packages built outside from this configuration.

Font

Font uses use-ttf package to keep cross OS consistency. The default font is Ubuntu Mono and loaded by using UbuntuMono-R.ttf located under ./.emacs.jcs/fonts/ folder. If you don't like the this font, you can add your own .ttf file and add the path to use-ttf-default-ttf-fonts list. Lastly, set the name of the .ttf file to use-ttf-default-ttf-font-name variable.

πŸ“ P.S.

  • See the file ./.emacs.jcs/jcs-plugin.el to see how the font is been set in (leaf use-ttf) section.
  • For more details about the font settings in this configuration, check out the use-ttfpackage repo.

πŸ”¨ Optimization

If you would like to optimize the configuration, you can run the following command compile all the source code to byte code so Emacs can run faster during both initial time and run time.

# change directory to the `jcs` config directory
$ cd ./.emacs.jcs

# compile all the config source code
$ emacs --batch --eval "(byte-recompile-directory \"./\" 0)"

Write your own customization

You are able to customize the configuration by editing the file locate at ~/.emacs.jcs/jcs-config.el. You should put all your own customize code there, then other than that are the core files.

🎍 Supported Emacs versions

The config should run on Emacs 27.1 or higher, but I will recommend to always run on the latest Emacs version available on your machine. The ultimate goal is to design to have each version of config can run on their each according Emacs version base on the version what I'm currently running on my present machine. For each version record, you can check the version_record file at the root of the project directory.

❓ FAQ

Here is the list of Frequently Asked Questions.

Contribute

PRs Welcome Elisp styleguide Donate on paypal

If you would like to contribute to this project, you may either clone and make pull requests to this repository. Or you can clone the project and establish your own branch of this tool. Any methods are welcome!

About

Emacs configuration works across all OSs

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

  •  
  •  

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages