My Emacs config, and other editor settings
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Macoy Madson fffbf2e3b3 Add script for making Cakelisp and Gamelib repos 2 weeks ago
..
iy-go-to-char@04ab4f5f3a Add iy-go-to-char submodule, small cleanup 8 months ago
Cheatsheet.org Added version control commands 2 years ago
EmacsOnWindowsSetup.txt Fixed crlf issue 3 years ago
ReadMe.org Delete trailing whitespace on whole line paste 3 years ago
build-systems.el Add script for making Cakelisp and Gamelib repos 2 weeks ago
clipboard.el Delete trailing whitespace on whole line paste 3 years ago
code-formatting.el Added Japanese dictionary lookup 2 years ago
core-settings.el Added macoy-create-select-system 5 months ago
debugger.el Added debugger config, other stuff 1 year ago
desktop-management.el Improved directory switching 2 years ago
dotEmacs.el Add index management to dotEmacs 2 years ago
drill-customizations.el Switch most recent desktop, org code block shortcuts 3 years ago
emacsPackages.txt Add iy-go-to-char submodule, small cleanup 8 months ago
idomenu.el Added idomenu, cquery test 3 years ago
index-management.el Minor cleanup, add active code dir escaped 6 months ago
install.sh Added helper copy script 1 year ago
jam-mode.el Added org-drill and jam-mode 3 years ago
keybinds.el Added debugger config, other stuff 1 year ago
language.el Added print branch, edict2 support 1 year ago
minimalDotEmacsDrilling.el Added minimal Emacs setup for my org-drill editor 3 years ago
navigation.el Fix iy-go-to-char not using load-user-file 5 months ago
org-customizations.el Small visual customization changes 5 months ago
org-drill.el Added org-drill and jam-mode 3 years ago
org-jira-customizations.el Ido really everywhere, colors, clipboard 3 years ago
org-learn.el Added org-drill and jam-mode 3 years ago
packages.el Only set TLS on Windows 5 months ago
search.el Adjusted Everything ido search 4 months ago
source-control.el Add support for p4 to macoy-commit-message-done 1 month ago
syntaxes.el Added debugger config, other stuff 1 year ago
tags-and-autocompletion.el Flailed with tags, added Search Everything support 4 months ago
visual-early.el Small visual customization changes 5 months ago
visual-late.el Fix default transparency, fix Windows TLS 5 months ago

ReadMe.org

Macoy's Emacs Configs

dotEmacs.el is meant to become \~/.emacs once installed. Open it for the latest instructions (below may be out of date; it's included here to give you an idea what you'll have to do).

Note that I recommend you cherry pick features you want instead of trying to use the entire config. This is better because you'll know all the features available to you.

Setup

Setting this up isn't very convenient yet, unfortunately.

Note that /code/macoy/editor-preferences/src/branch/master/Emacs/packages.el will auto-install several packages which this config requires.

  1. Copy the contents of dotEmacs.el to ~/.emacs

  2. Set the user-init-dir in your .emacs to the directory of this ReadMe.org. This will load my config files straight from this repository.

  3. Add macoyCopy, macoyCut, and macoyPaste to mc/cmds-to-run-once and restart Emacs

  4. For magit on Windows, fix credentials for server folder (may not be necessary, only do if you get errors using magit):

  5. Setup magit credentials (unnecessary if you have SSL support):

  6. If you want to use codesearch (fancy ultra fast indexed code searching), get the updated branch, or use the old Google branch (missing index-time filtering features) …then set codesearch-csearch-exe and codesearch-cindex-exe to their respective executable locations Search for codesearch in this file to adjust indexing settings

  7. Look over the Customization section for getting everything working properly per-machine.

Customization

Emacs shines in its ease of customization. Get used to tweaking settings and building new features. It's one of the pleasures of working with Emacs: making the perfect setup.

This config is meant only as a starting place. You should tear it to pieces and make it your own, or only refer to pieces of it while building up your own config.

If you take the whole config, you'll need to do a decent amount of setup work to get all features working properly. I can attest that it's well worth it once everything has been configured, so stick to it!

"This machine only" config

To facilitate different settings per machine (e.g. your home config and work config differences), there's a simple mechanism:

;; Stuff unique to certain machines (mine here for reference)
(when (or (string-equal (user-login-name) "macoy")
          (string-equal (user-login-name) "mmadson"))
  (load-file "~/.emacs-this-machine-only.el"))

Change those string-equal comparisons to your machine(s) name(s). Multiple are there in case you have a home/work machine.

Create that ~/.emacs-this-machine-only.el file and put your per-machine settings in it.

Build Systems

Look at /code/macoy/editor-preferences/src/branch/master/Emacs/build-systems.el build-universal-jam for an example build system:

(defun build-universal-jam-clean ()
  "Build using jam (select directory first)"
  (interactive)
  (message "Jam clean")
  (let ((default-directory (read-directory-name "Directory: ")))
    (compile
     "jam clean")))

;;
;; Build system manager - select from multiple different compilation commands
;;

;; Note that names need to be unique (they should be anyways)
(setq macoy-build-system-list (list
                              '("Jam (current directory)" build-universal-jam)
                              '("Jam Clean (current directory)" build-universal-jam-clean)))

Simply override macoy-build-system-list with your own custom build systems.

Use F7 to build. S-F7 allows you to decide what happens when you hit F7 (it will build right after selection as well).

Ignored Files

For C-p (projectile), you may want to filter out some files/directories:

(setq projectile-globally-ignored-files
        (append '("*_ast.*") ;; This syntax might not be right
                projectile-globally-ignored-files))
  (setq projectile-globally-ignored-directories
        (append '("AutoGen"
               "3rdparty"
               ".build"
               ".cquery_cached_index")
                projectile-globally-ignored-files))

(You'll need to run projectile-invalidate-cache to see the changes after evaluating).

Keybinds

Many keybinds are set in /code/macoy/editor-preferences/src/branch/master/Emacs/keybinds.el. It's not exhaustive (things are set in other files too), but it's worth looking at.

Org

Set up your org stuff (multiple provided for reference):

;; My org files
(setq macoy-org-dir nil)

(when (string-equal (user-login-name) "macoy")
  (setq macoy-org-dir "~/Dropbox/Org/")
  (setq org-agenda-files (list (concat macoy-org-dir "1_Calendar.org")
                         (concat macoy-org-dir "0_Dump.org"))))

(when (string-equal (user-login-name) "mmadson")
  (setq macoy-org-dir "C:/Users/mmadson/Dropbox/Org/")
  (setq org-agenda-files (list (concat macoy-org-dir "1_Calendar.org")
                         (concat macoy-org-dir "0_Dump.org"))))

macoy-org-dir makes quick org opening possible via M-p.

Org-jira

If you want to use org-jira, set your company's JIRA url:

(setq jiralib-url "http://jira:8080")

Search

The search functionality (e.g. provided by C-e and C-S-f) is extensive and a bit complicated. I made it to handle searching rather large collections of text quickly (we're talking tens of gigabytes, full text search).

You should open /code/macoy/editor-preferences/src/branch/master/Emacs/search.el and read through it. Many directories, regex filters, and index locations should be customized to fit your project.

The tool you should use most often is codesearch, which is a very fast index-based search tool. ag serves as the general purpose, non-index-based but better than grep search tool.

C-e serves as a quick menu to searching using any of the techniques I've added. You should add your own techniques if you e.g. have multiple separate codesearch directories.

Source Control

In general, you should use vc- prefixed commands or magit for handling source control, but I've provided some TortoiseSVN commands in /code/macoy/editor-preferences/src/branch/master/Emacs/source-control.el. You'll need to tweak them for your repository (assuming you want to).

Tags and Autocompletion

Like searching, tag navigation (e.g. Go To Definition-like functionality) and autocompletion is extensive and complicated.

You should open /code/macoy/editor-preferences/src/branch/master/Emacs/tags-and-autocompletion.el and read through it, making sure your executable paths and project paths are set.

  • TODO: I need to make this more convenient for multiple projects…