Skip to content

Trying Emacs

Bare bones emacs configuration from when I first started using Emacs

Srijan Choudhary
1 min read

I have been using Vim as my text editor for the last few years, and have been very happy with it. But lately, some features of Emacs have got me interested (especially org-mode), and I wanted to try it out. After all, I won't know the difference until I actually try it, and opinions on text editors vary widely on the internet.

So, I decided to give it a try. First I went through the built-in Emacs Tutorial, and it seemed easy enough. I got used to the basic commands fairly quickly. I guess the real benefits will start to show a little later, when I try to optimize some ways of doing things.

For now, I just wanted to do some basic configuration so that I could start using emacs right now. So, I did the following changes (scroll to the bottom of this page for the full init.el file):

  • Hide the menu, tool, and scroll bars

  • Add line numbers

  • Hide splash screen and banner

  • Setup Marmalade
    Marmalade is a package archive for emacs, which makes it easier to install non-official packages.

  • Maximize emacs window on startup
    My emacs was not starting up maximized, and I did not want to maximize it manually every time I started it. I found this page addressing this issue, and tried out one of the solutions for linux, and it worked great.

For now, it all looks good, and I can start using it with only this small configuration.

For example, for writing this post, I installed markdown-mode using marmalade, and I got syntax highlighting and stuff.

I will keep using this, and adding to my setup as required, for a few weeks, and then evaluate whether I should switch completely.

Complete ~/.emacs.d/init.el file:

; init.el

; Remove GUI extras
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)

; Add line numbers
(global-linum-mode 1)

; Hide splash screen and banner
(setq
 inhibit-startup-message t
 inhibit-startup-echo-area-message t)
(define-key global-map (kbd "RET") 'newline-and-indent)

; Set up marmalade
(require 'package)
(add-to-list 'package-archives 
    '("marmalade" .
      "http://marmalade-repo.org/packages/"))
(package-initialize)

; Make window maximized
(shell-command "wmctrl -r :ACTIVE: -btoggle,maximized_vert,maximized_horz")
emacs development

Related Posts

Exploring conflicting oneshot services in systemd

Exploring ways to make two systemd services using a shared resource work with each other

Exploring conflicting oneshot services in systemd

Slackbot using google cloud serverless functions

Slack bot using Google Cloud Functions to post a roundup of recently created channels

Slackbot using google cloud serverless functions

Erlang: Dialyzer HTML Reports using rebar3

How I made a custom rebar3 plugin to generate HTML reports for dialyzer warnings