未加星标

Tweeking Emacs Modeline for Clojure Development

字体大小 | |
[系统(linux) 所属分类 系统(linux) | 发布者 店小二05 | 时间 2017 | 作者 红领巾 ] 0人收藏点击收藏

Emacs is fun to configure and if you have the basics of LISP or Clojure then its pretty easy too. After reading how to replace the text on the modeline I decided to customise my mode-line to make it more efficient for Clojure development. I’ll cover how I tweaked the mode line and added this customisation to my Emacs Live based configuration.

Instead of a long list of Major and Minor modes that are active, I now have symbols representing those modes.

In the screen-shot you can see I have the following modes running

λ Clojure mode

τ undo-tree

γ yas

υ volatile highlights

ηζ nREPL minor mode

α auto-complete

φ paredit


Tweeking Emacs Modeline for Clojure Development

Some other modes are active, but hidden with a null string as I am assuing they are running all the time.

Configuring Emacs Live

Adding these to the Emacs Live configuration I use is easy, assuming you used the “bro-grammer” script provided by +Sam Aaron . This script creates a ~/.live-pack folder where you can add your own keybindings and configuration without it getting hit by Emacs Live updates.

I created a file called clean-mode-line.el , based on the one in the Mastering Emacs article. The file is located in my personal live-packs folder at:

~/.live-packs/jr0cket-pack/config/clean-mode-line.el

The code for the mode-line tweaks is a Github Gist:

To use this new mode-line tweak, we ask Emacs Live to load the configuration in clean-mode-lime.el. To do this, edit the init.el file in your live pack

~/.live-packs/jr0cket-pack/init.el

Then add the following code:

Emacs Tweaked

When you open a Clojure document, the mode line now displays the major and minor modes as symbols.


Tweeking Emacs Modeline for Clojure Development

Starting the Clojure REPL using M-x nrepl-jack-in gives you a similar modeline, this time with the major mode being nrepl-mode .


Tweeking Emacs Modeline for Clojure Development

Switching back to a Clojure file after running nREPL shows Clojure as the major mode and nREPL running as the minor mode.


Tweeking Emacs Modeline for Clojure Development
In Summary

The custom mode line was really easy to set up, thanks to the great info in the Matering Emacs article . The tricky part was finding the specific name for the nREPL minor mode that was running. Other than that it took a couple of minutes, most of which was deciding which symbols to use. I added a few others at the end of the file in case I change my mind or you want to use something more meaningful to yourself.

I havent tried this with Swank, but I assume that all it would take is adding of the swank mode to the clean-mode-line.el file.

When I get round to using other modes, I will see if I can add other symbols to my configuration where it makes sense. Let me know if you find this useful and what symbols you use.

Thank you.

@jr0cket

This work is licensed under a Creative Commons Attribution 4.0 ShareAlike License , including custom images & stylesheets. Permissions beyond the scope of this license may be available at @jr0cket


Tweeking Emacs Modeline for Clojure Development

本文系统(linux)相关术语:linux系统 鸟哥的linux私房菜 linux命令大全 linux操作系统

主题: ClojureGit
分页:12
转载请注明
本文标题:Tweeking Emacs Modeline for Clojure Development
本站链接:http://www.codesec.net/view/520221.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 系统(linux) | 评论(0) | 阅读(48)