Browse Source

Fixed configs for fresh Emacs install

* Removed big comment block which is out of date anyways
* Install packages before requiring simpleclip (which needs to be
installed first)
* Use a default base16 theme instead of my custom one
* Remove package-selected-packages in case it confuses Emacs on first
* More debugging text in packages.el
* Added step-by-step guide to getting emacs set up on Windows
Macoy Madson 4 years ago
  1. 10
  2. 133
  3. 13


@ -0,0 +1,10 @@
1. Download
2. Extract it
3. Install git:
4. Run `git clone` (I like it in C:/editorPreferences)
5. Run Emacs: `Emacs27_Win64_WithDeps/Emacs27/bin/runemacs.exe`
6. Copy the default settings: `cp editorPreferences/Emacs/dotEmacs.el Users/your user name here/AppData/Roaming/.emacs`
7. Open Users/your user name here/AppData/Roaming/.emacs
8. Edit the line which says `(setq user-init-dir "~/.emacs.d/macoy")` to point to your editorPreferences dir: `(setq user-init-dir "C:/editorPreferences")`
9. Restart Emacs


@ -1,127 +1,4 @@
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
;; Added by Macoy
;; Macoy's .emacs
;; Goal: Make a dev environment with Sublime Text 3-like keybindings and features:
;; - [Done] Code completion
;; - [Done] Goto definition
;; - [Done] Multiple cursors
;; - [Done] Templates
;; - [Done] Workspaces ("desktops" by emacs terminology)
;; - [Done] Build systems
;; - [Done] One keypress builds
;; - [Done] Quick jump to compilation error
;; - [Done] Easy add build system
;; - [Done] Fuzzy file opening
;; - [Done] Fuzzy editor command execution
;; - [Done] Standard clipboard behavior (no copy on mark, no copy on kill etc., only on C-c!)
;; Ways Emacs excels over Sublime:
;; - More keyboard-only friendly
;; - More configurable
;; - Registers (for positions and saving strings)
;; - More minimal appearance
;; - Built-in help (Sublime's documentation can be spotty; Emacs docs can be too complicated)
;; Setup (more for my own help than anyone else's)
;; Copy the contents of emacsConfig.txt to .emacs
;; Set the user-init-dir in your .emacs to the directory of my .el files. This can load my config files straight from the repository.
;; 1. Install all packages in emacsPackages.txt
;; 2. Add macoyCopy, macoyCut, and macoyPaste to mc/cmds-to-run-once and restart Emacs
;; 3. For magit on windows, fix credentials for server folder:
;; 4. Setup magit credentials:
;; 5. If you want to use codesearch (fancy ultra fast indexed code searching), install it:
;; ...then set codesearch-csearch-exe and codesearch-cindex-exe to their respective executable locations
;; Search for codesearch in this file to adjust indexing settings
;; TODO (there are more scattered around this file; * = more important):
;; - TAGS has to be set up per-project; doesn't allow cross-repository finding afaik
;; It does, you just need to set tags-table-list.
;; See
;; - Would be nice to have buffers and files merged like Sublime's C-p (but not essential)
;; - Tab key behavior confuses me especially in plaintext files
;; - Get back and forward working (back doesn't work too well)
;; - Determine what smooth-scrolling actually does (if anything)
;; - Copy line when nothing is marked
;; - Multiple cursors copy and cut when whole line selected
;; - Ido jump to file anywhere does more harm than good (especially when creating new files)
;; This can be disabled with (setq ido-auto-merge-work-directories-length -1)
;; - Python indentation is troublesome in originally poorly formatted files
;; - Auto-install packages just by loading .emacs
;; (use-package? but I don't want to get locked in)
;; - Shortcuts:
;; Toggle whitespace mode
;; Swap windows (see rotate windows?)
;; - Indent-tabs-mode only in C/C++
;; - Auto-select actual struct definition when multiple xref results
;; - If use-region, C-k should delete region instead of line
;; - Powerline: Make mode colors comments so they aren't as bright (same color as percent complete)
;; - tags-query-replace use marked for tag to replace
;; - Recover from commit failed backup command (or at least quick-open recovery file)
;; - Fix windows OpenSSL/TLS support
;; - Jump copy thing at point then paste back at start
;; e.g. the macro would avy prompt, jump to destination, copy it, then go back and paste it at start mark
;; Is this just a problem with autocomplete not being fast enough?
;;* - This is probably a better solution: what if there are two autocomplete pools, one for function
;; or file-local symbols only which immediately prompts with dropdown (after a character)?
;; This could maybe work as some sort of delay hook: if I'm typing immediately show me file-local
;; source, but if I type and pause for N seconds enable the full tags source
;; Learn how to do custom mode for jumping back
;; - Expand-region does strange things with the region. Eg. C-s-' after moving cursor, expand region then type over (damn it; it went away after re-evaluating .emacs)
;; - Start using Abbrev more
;; - It seems like iy-goto-char will eventually trip me up in its temporary mode (so far it's fine)
;; - Seems like it would be cool to have a "copy to references" thing which would take marked and
;; put it in a file or something for deep code reading dives (what about projects?)
;; - Command to close all dired buffers
;; - User-specific emacs configs (see "Need different settings for different machines")
;; - Make it so mark is cleared if arrow key away (has to do with expand-region)
;; - Find file in dir (basically ido find file but actually useful; how does it work?)
;; - Macoy-Codesearch should have something for whole word searches as well as sanitizing regex symbols
;; I tried to do this but it doesn't work :/
;; - Isearch: Make reversing the isearch not find the same thing again
;; - Isearch: Always put cursor at end of search (try searching backwards; it'll put it at the front)
;; - Isearch: If you paste a thing into isearch, then go up or down a bit, then hit backspace, it returns
;; to the last search until you get to the original place, then it clears the search. This is confusing :(
;; - Mysterious thing which deletes the last half of the buffer (c-remove-stale-state-cache-backwards?)
;; - Codesearch: Regex filtering doesn't work (try e.g. "myfunc(") (TODO: Retest this with the new "quotes")
;; - Fix window splitting on Linux/4k
;; - Feature: filter lines in file (good for codesearch results etc.). Extra cool = as you type (hard) (install something for this)
;; keep-lines does this, although not as you type, and requires modifying the buffer (make a func which dupes and does it)
;; Use (clone-indirect-buffer) (
;; - Treacherous: vc-annotate uses the revision which the buffer has, which if you commit from DSVN
;; does not update (i.e. look at the mode line revision). You need to revert the buffer then do vc-annotate to see the true state
;; - Isearch: Customize colors
;; - Search Everything/projectile-find-files which will work on non-vc dirs
;; - Code reference to org: mark block of code, run command; command copies string to clipboard with file:line org link and code block. Good for deep dives where you have to take notes
;; - Quick shortcut to switch to header/source file
;; Split todo
;; - Put all things which are user-specific at the top of respective files
;; - Search: Make Codesearch data folder user-specific
;; Criticism improvements:
;; - [DONE] Select word at point
;; - [DONE] Reopen closed file
;; - [DONE-ish] Get find references working
;; - [DONE] Autorevert if no modifications (do tell me in modeline that this happened)
;; - [DONE] Faster/better Ag
;; - [DONE] Swiper is too damn slow
;; Eventually make tags-search and tags-loop-continue async and list results in a buffer
;; - Faster browse symbols (first, figure out where most symbols come from and eliminate; then separate projects?)
;; Separate lists by first letter for x26 speedup? (kindof defeats purpose if not knowing first letter)
;; Copy swiper-all requiring multiple letters? (this doesn't seem to help too much)
;; Emacs Notes
;; C-h k <the keybind> to find what a key does
;; C-h b to list all bindings (should've used this more when fighting binds...)
@ -158,15 +35,15 @@
;; Update: After keyboard-translate, this is no longer an issue. Leaving here in case I go back on keyboard-translate
(setq macoy-edebug-prefix-hack nil)
;; Handle installing packages
(load-user-file "packages.el")
;; Simpleclip makes system clipboard and emacs kill ring separate
;; This is sane copy paste behavior
;; I keep this near the top because many of my utilities rely on simpleclip
(when (require 'simpleclip)
(simpleclip-mode 1))
;; Handle installing packages
(load-user-file "packages.el")
;; Settings which affect the core behavior of Emacs as well as interface-changing things like ido
;; This also has random utilities for managing buffers and files
;; This should remain early in load order
@ -237,7 +114,7 @@
["black" "red3" "ForestGreen" "yellow3" "blue" "magenta3" "DeepSkyBlue" "gray50"])
[unspecified "#ffffff" "#c82829" "#718c00" "#eab700" "#4271ae" "#8959a8" "#4271ae" "#4d4d4c"] t)
'(custom-enabled-themes '(base16-my-auto))
'(custom-enabled-themes '(base16-ashes))
'(diary-entry-marker 'font-lock-variable-name-face)
'(ediff-split-window-function 'split-window-horizontally)
@ -293,8 +170,6 @@ static char *gnus-pointer[] = {
(("gnu" . "")
("melpa" . ""))))
'(web-mode rainbow-mode ivy-xref expand-region ivy engine-mode diminish iy-go-to-char magit dsvn delight adaptive-wrap web-beautify etags-select simpleclip yasnippet swiper company auto-complete clang-format avy ag xah-find flx-ido ido-vertical-mode sublime-themes smooth-scrolling alect-themes base16-theme powerline darktooth-theme projectile smex fiplr helm-dash better-defaults multiple-cursors zenburn-theme marmalade-demo))
'(pos-tip-background-color "#36473A")
'(pos-tip-foreground-color "#FFFFC8")


@ -1,5 +1,7 @@
;; Handle installing packages
(require 'seq)
;; Enable MELPA
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
@ -14,6 +16,10 @@
;; TODO: Test if melpa still works
;; (package-initialize)
(defun macoy-package-install (package)
(message "Installing %s" package)
(package-install package))
;; Install uninstalled packages
(let* ((package--builtins nil)
@ -38,7 +44,6 @@
@ -56,7 +61,9 @@
(let ((packages (remove-if 'package-installed-p packages)))
(message "Checking for packages to install...")
(let ((packages (seq-remove 'package-installed-p packages)))
(when packages
(message "Installing packages...")
(mapc 'package-install packages)))))
(mapc 'macoy-package-install packages)))))