Skip to content

map7/emacs-config

Repository files navigation

Emacs

Emacs Version tested: 26.2.90 (stable) 2019-07-12

Installation

Emacs latest from github for linux (debian)

Section Last updated: <2019-07-25 Thu 19:21>

  1. Requires packages
    sudo apt-get install libxaw7-dev libxpm-dev libpng12-dev libtiff5-dev libgif-dev libjpeg8-dev libgtk2.0-dev libncurses5-dev libdbus-1-dev libxft-dev texinfo libgnutls-dev libgnutls28-dev libjpeg62-turbo-dev
        
  2. Install requirements for emacs xwidgets to work
    sudo apt-get install libwebkitgtk-3.0-0 libwebkitgtk-3.0-dev
        
  3. Clone from git like so
    git clone --depth 1 https://github.com/emacs-mirror/emacs.git
        
  4. Compile (Note xwidgets may not work on your machine)
    ./autogen.sh
    ./autogen.sh git
    ./configure --prefix=/opt/emacs --with-xft --with-xwidgets --with-imagemagick
    make -j32
        
  5. Start
    src/emacs
        
  6. Install
    sudo make install
        
  7. Update alternatives to use the new emacs & set the priority to 100 so it’s automatically selected
    sudo update-alternatives --install /usr/bin/emacs emacs /opt/emacs/bin/emacs 100
    sudo update-alternatives --install /usr/bin/emacsclient emacsclient /opt/emacs/bin/emacsclient 100
        
  8. Configure the alternatives
    sudo update-alternatives --config emacs
    sudo update-alternatives --config emacsclient
        
  9. Manually check alternatives are correctly set
    ls -al /etc/alternatives | grep emacs
        
  10. Manually check bin directory is correctly set
    ls -al /usr/bin | grep emacs
        
  11. Start the new emacs
    emacs
        
  12. Start package listing and accept certificates using ‘a’
    M-x package-listing
        
  13. Start emacs & install use-package
    M-x package-install
    use-package
        
  14. Restart emacs & install pdf-tools
    C-x b
    compile-pdftools (respond with Y) (also M-x pdf-tools-install then exit & restart emacs answer Y to reinstall prompt on restart)
        
  15. Restart a number of times until everything is starting correctly.

(Optional fix) Create/update symlinks if they are pointing to an old emacs version

ln -s -f target symlink_name #update existing symlink

Custom Configuration

This configuration is based on the latest use-package system as created by John Wiegley, who is also steering emacs development. Our configuration also includes a custom dark theme that is completely customisable.

  1. Clone my repo
    git clone https://github.com/map7/emacs-config.git ~/.emacs.d
        
  2. Run installation script
    cd ~/.emacs.d
    ./install
        
  3. Start emacs
    emacs
        
  4. List packages (Note: M-x is emacs way of saying Alt + x)
    M-x list-packages
        
  5. Install use-package with
    M-x package-install use-package
        

Then restart emacs and it should start building the packages, if it asks you to build pdf-tools say yes and in the compile buffer it will show the results. If this compile is needed then after the compile is finished you will need to restart emacs again for the final run of packages.

Modeline(to be updated)

A nice iconised based modeline. Used to save horizontal modeline space.

Setup

The package all-the-icons is needed. This package has been added to the init.el file and should be automatically installed.

The next step must be done manually. You will need to download and install the fonts and icons from the following link: all-the-icons.el/fonts

Linux

Clone

cd ~/src
git clone https://github.com/domtronn/all-the-icons.el.git

copy fonts into (for all users)

sudo cp all-the-icons.el/fonts/*ttf /usr/local/share/fonts

or (for a specific user)

cp all-the-icons.el/fonts/*ttf ~/.fonts

manually rebuild the font cache

fc-cache -fv
Use

To manually invoke the iconised modeline theme:

M-x dark-lord-modeline

Cask package management (outdated)

Install my sub modules

git submodule init

Based upon Cask & Pallet.

Install cask

curl -fsSkL https://raw.github.com/cask/cask/master/go | python

Add path to your ~/.zshenv or ~/.bashrc file

# Add Cask to the path
export PATH="$HOME/.cask/bin:$PATH"

Run cask which will install the pallet package management tool

cd ~/.emacs.d
cask install

Optional - Initialise your cask file from within emacs

M-x pallet-init

exwm - Emacs X Windows Manager notes

Setup the session

Copy the xinitrc.sample

cp xinitrc.sample ~/.xinitrc

Link it to .xsession to work with a desktop manager like lightdm as the default session.

ln -s ~/.xinitrc ~/.xsession

Autostart GUI apps

To autostart things like dropbox or spideroak you need to put them into a file called ~/.emacs.autostart.el and this will automatically load.

Here is an example of starting dropbox & spideroak

;; Autostart Dropbox
(call-process-shell-command "(sleep 10s && ~/.dropbox-dist/dropboxd) &" nil 0)
(call-process-shell-command "(sleep 10s && SpiderOakONE) &" nil 0)

Multiple screens

Create a ~/.emacs.randr.el file and put the following

(setq exwm-randr-workspace-output-plist '(0 "LVDS1" 1 "LVDS1" 2 "DP2"))
(add-hook 'exwm-randr-screen-change-hook
         (lambda ()
           (start-process-shell-command
            "xrandr" nil "xrandr --output DP2 --right-of LVDS1 --output DP2 --mode 1920x1080")))
(exwm-randr-enable)

Remember to change the LVDS1 & DP2 to your screens which you can find out by typing in xrandr at the command line and looking for the active screens.

flycheck configure

Installing

npm install -g coffeelint eslint
gem install scss_lint rubocop

Add this to your ~/.emacs.d/.emacs.custom.el file.

(custom-set-variables
 '(flycheck-ruby-rubocop-executable "/usr/local/rbenv/shims/rubocop" )
 '(flycheck-javascript-eslint-executable "/opt/node-v5.5.0-linux-x64/bin/eslint")
 '(flycheck-coffee-coffeelint-executable "/opt/node-v5.5.0-linux-x64/bin/coffeelint")
 '(flycheck-coffeelintrc "~/coffeelint.json"))

Make the config file for coffeelint

coffeelint --makeconfig > coffeelint.json

Requirements

ag - Compile the silver searcher, first check if you already have the ‘ag’ command

flyspell - install ‘ispell’

ripgrep - install ‘ripgrep’

Specific package notes

paradox

If you want to use the paradox package list instead of the normal boring listing then you have to make a file ~/.emacs.paradox.el and add the following

(setq paradox-github-token TOKEN)

Where TOKEN is your github token.

Yasnippet + ruby

For ruby mode I use enh-ruby-mode, which is just a symlink of ruby-mode snippets. I’ve also added all the rails snippets to this as well.

org-clock-csv

Add the following to your crontab

# Export all my timesheets to a csv file
00 5    * * *   map7    /usr/bin/emacs -batch -l ~/.emacs.d/init.el -eval "(org-clock-csv-batch (org-agenda-files nil t))" > /home/map7/timesheets.csv

References

http://crypt.codemancers.com/posts/2013-09-26-setting-up-emacs-as-development-environment-on-osx/

Issues

Projectile not finding files

Try to invalidate the project cache, first sit in a file within a project dir

C-c p i

Changelog

2015-02-09

Added

  • sunshine - weather
  • symon - system monitor, replaces gkrellm
  • ox-reveal - reveal.js presentation tool

2019-07-25

Added

  • Installation

Updated

  • CustomConfiguration
  • Cask
  • Modeline

About

My emacs config using use-package

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published