Sfoglia il codice sorgente

merge conflict

cray
Mitch Tishmack 11 anni fa
parent
commit
d4dc830579
6 ha cambiato i file con 159 aggiunte e 37 eliminazioni
  1. +3
    -0
      .gitignore
  2. +5
    -2
      Makefile
  3. +134
    -34
      emacs/.emacs.d/emacs.org
  4. +1
    -1
      emacs/.emacs.d/init.el
  5. +8
    -0
      nix/.profile.d/20-functions-nix.sh
  6. +8
    -0
      nix/.profile.d/99-final-nix.sh

+ 3
- 0
.gitignore Vedi File

@@ -8,3 +8,6 @@ emacs/.emacs.d/ac-comphist.dat
emacs/.emacs.d/elpa
emacs/.emacs.d/emacs.el
emacs/.emacs.d/url
emacs/.emacs.d/.emacs.desktop.lock
emacs/.emacs.d/tramp
emacs/.emacs.d/projectile-bookmarks.eld

+ 5
- 2
Makefile Vedi File

@@ -5,12 +5,12 @@ STOWOPTS=-target $(HOME) -d $(PWD)
DOTGITCONFIG=~/.gitconfig
DOTPROFILE=~/.profile

.PHONY: mosh common emacs git ruby haskell perl tmux vim zsh list home osx linux ws
.PHONY: mosh common emacs git ruby haskell perl tmux vim zsh list home osx linux ws nix

home: $(DOTGITCONFIG) $(DOTPROFILE)
$(DOTDEE) $(DOTPROFILE)

ws: common mosh git ruby haskell perl tmux vim zsh home
ws: common emacs nix mosh git ruby haskell perl tmux vim zsh home

all: home

@@ -64,3 +64,6 @@ haskell:

perl:
$(STOW) $(STOWOPTS) perl

nix:
$(STOW) $(STOWOPTS) nix

+ 134
- 34
emacs/.emacs.d/emacs.org Vedi File

@@ -9,6 +9,7 @@ This is my emacs configuration file. I don't encourage anyone to use this verbat
but if you wanted to this is how you would do so:

** Clone this repo

#+BEGIN_SRC sh :tangle no
git clone https://github.com/mitchty/dotfiles
#+END_SRC
@@ -19,7 +20,6 @@ Always good to back things up, just in case you hate how I did things.

#+BEGIN_SRC sh :tangle no
tar cvf ~/.emacs-backup.tar ~/.emacs.d ~/.emacs

#+END_SRC

** Remove/move your old configuration
@@ -31,6 +31,7 @@ rm -fr ~/.emacs.d ~/.emacs
#+END_SRC

** Lastly copy necessary files

#+BEGIN_SRC sh :tangle no
mkdir ~/.emacs.d
cp dotfiles/init.el dotfiles/emacs.org ~/.emacs.d
@@ -43,7 +44,19 @@ For some reason init.el doesn't always seem to get reflecte here. Weird reaserch
#+BEGIN_SRC emacs-lisp
(require 'use-package)
#+END_SRC

* prelude
** match end of string function

#+BEGIN_SRC emacs-lisp
(defun string/ends-with (string suffix)
"Return t if STRING ends with SUFFIX."
(and (string-match (rx-to-string `(: ,suffix eos) t)
string)
t)
)
#+END_SRC

** always babel tangle and byte compile emacs.org

Add a save hook to always tangle and byte compile emacs.org file when we save it.
@@ -52,21 +65,24 @@ Add a save hook to always tangle and byte compile emacs.org file when we save it
(defun tangle-init ()
"If the current buffer is 'emacs.org' the code-blocks are
tangled, and the tangled file is compiled."
(when (equal (buffer-file-name)
(expand-file-name (concat user-emacs-directory "emacs.org")))
(when (string/ends-with (buffer-file-name) ".emacs.d/emacs.org")
(let ((prog-mode-hook nil))
(org-babel-tangle)
(byte-compile-file (concat user-emacs-directory "emacs.el")))))
(byte-compile-file (concat user-emacs-directory "emacs.el")))
)
)

(add-hook 'after-save-hook 'tangle-init)
#+END_SRC

** debug on error

Not having to start *emacs* with *--debug-init* is useful.

#+BEGIN_SRC emacs-lisp
(customize-set-variable 'debug-on-error t)
(setq debug-on-error t)
#+END_SRC

** emacs server

Start up the emacs server if it isn't running.
@@ -75,6 +91,7 @@ Start up the emacs server if it isn't running.
(load "server")
(unless (server-running-p) (server-start))
#+END_SRC

** os detection

Make it easier to determine what os we're running on.
@@ -87,6 +104,7 @@ Make it easier to determine what os we're running on.
(defvar on-linux (string-match "gnu/linux" (symbol-name system-type))
"Am I running under linux?")
#+END_SRC

*** Mac OS X Gui emacs PATH setup

This is here because if gui emacs gets started say from Finder, one can
@@ -97,6 +115,7 @@ then parse that to setup emacs exec-path.

For now we restrict this only to OSX. It may be more generally useful
however.

#+BEGIN_SRC emacs-lisp
(defun set-exec-path-from-shell-PATH ()
(let ((path-from-shell
@@ -115,6 +134,7 @@ Like the startup screen and the echo hooey.
(customize-set-variable 'inhibit-startup-message t)
(customize-set-variable 'inhibit-startup-echo-area-message t)
#+END_SRC

** temporary files

Keep temporary stuff isolated from everyone else. It infects everything otherwise. As bad as the .DS_Store files on osx.
@@ -131,6 +151,7 @@ Keep temporary stuff isolated from everyone else. It infects everything otherwis
(customize-set-variable 'backup-directory-alist `((".*" . ,temporary-file-directory)))
(customize-set-variable 'auto-save-file-name-transforms `((".*" ,temporary-file-directory t)))
#+END_SRC

** auto revert

Update files in open buffers as they're changed on disk, freaking annoying without this on.
@@ -146,6 +167,7 @@ Use dired-x.
#+BEGIN_SRC emacs-lisp
(add-hook 'dired-load-hook (function (lambda () (load "dired-x"))))
#+END_SRC

** ediff

For those rare times I use it, make it a bit less derp on output.
@@ -154,6 +176,7 @@ For those rare times I use it, make it a bit less derp on output.
(setq ediff-window-setup-function 'ediff-setup-windows-plain)
(setq ediff-split-window-function 'split-window-horizontally)
#+END_SRC

** tramp

Tramp configuration.
@@ -186,6 +209,7 @@ Its a hack, but it work(ed). Will remove it at some date in the future.
(tramp-copy-keep-date nil)
(tramp-password-end-of-line nil)))
#+END_SRC

** always remove trailing whitespace

Trailing whitespace is not normally useful. Remove it always on save in the *before-save-hook*.
@@ -201,13 +225,14 @@ Because its derp to have to chmod 755 stuff after I save. Honestly, do it for me
#+BEGIN_SRC emacs-lisp
(add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p)
#+END_SRC

** misc text related

Not sure what to categorize this crap as tbh.

*** wtf does this do?

TOOD: find out why I added this ages ago.
TODO: find out why I added this ages ago.

#+BEGIN_SRC emacs-lisp :tangle no
(move-text-default-bindings)
@@ -297,6 +322,7 @@ Global key bindings.
(global-set-key (kbd "C-]") 'er/expand-region)
(global-set-key (kbd "C-x C-m") 'compile)
#+END_SRC

* appearance
** theme

@@ -307,9 +333,11 @@ Solarized light is decent. I'll just use that.
:ensure t
:init (load-theme 'solarized-light 't))
#+END_SRC

** modeline

Updat the time every ~3 seconds in the mode line.

#+BEGIN_SRC emacs-lisp
(custom-set-variables '(display-time-default-load-average nil))
(custom-set-variables '(display-time-format "%T"))
@@ -362,9 +390,11 @@ Format the mode line, I... can't decipher this anymore nor do I care to, it work
"%-"
)))
#+END_SRC

** whitespace

Customize whitespace mode to make tabs obvious as boxes, and to highlight lines over 80 characters in length.

#+BEGIN_SRC emacs-lisp
(require 'whitespace)

@@ -378,6 +408,7 @@ Customize whitespace mode to make tabs obvious as boxes, and to highlight lines
:foreground "#2075c7"
:background "lightgrey")
#+END_SRC

** gui chrome

When i'm running in a terminal emacs, most of this junk isn't needed. For that matter gui counts for most.
@@ -390,6 +421,7 @@ Basically, never show the tool bar or the scroll bar in gui or tty. In gui its o
(when (not window-system)
(menu-bar-mode -1))
#+END_SRC

** fonts

Fonts. Let me specify them for gui emacs.
@@ -416,6 +448,7 @@ Fonts. Let me specify them for gui emacs.
)

#+END_SRC

* packages

All the packages I use.
@@ -439,55 +472,59 @@ By Helms Deep use Helm to do ALL THE THINGS. IDO is ass in comparison.
(require 'helm-config)
(helm-mode 1)))
#+END_SRC

** helm-descbinds

Its nice being able to describe helm things you know?

#+BEGIN_SRC emacs-lisp
(use-package helm-descbinds
:ensure t
:bind (("C-h b" . helm-descbinds)
("C-h w" . helm-descbinds))
)
:ensure t
:bind (("C-h b" . helm-descbinds)
("C-h w" . helm-descbinds))
)
#+END_SRC

** helm-ag

Helm search plugin for [[Ag%20(The%20Silver%20Searcher)][Ag (The Silver Searcher)]] so much nicer than regular searching in helm imo.

#+BEGIN_SRC emacs-lisp
(use-package helm-ag
:ensure t
)
:ensure t
)
#+END_SRC

** magit

Make git not ass to use. At least in emacs. magit is the best git interface... in the world.

#+BEGIN_SRC emacs-lisp
(use-package magit
:ensure t
:commands (magit-init
magit-status
magit-diff
magit-commit)
:bind ("C-x m" . magit-status)
:config
(progn
(defadvice magit-status (around magit-fullscreen activate)
(window-configuration-to-register :magit-fullscreen)
ad-do-it
(delete-other-windows))
(defadvice magit-quit-window (around magit-restore-screen activate)
ad-do-it
(jump-to-register :magit-fullscreen)))
)
:ensure t
:commands (magit-init
magit-status
magit-diff
magit-commit)
:bind ("C-x m" . magit-status)
:config
(progn
(defadvice magit-status (around magit-fullscreen activate)
(window-configuration-to-register :magit-fullscreen)
ad-do-it
(delete-other-windows))
(defadvice magit-quit-window (around magit-restore-screen activate)
ad-do-it
(jump-to-register :magit-fullscreen)))
)

(use-package magit-blame
:ensure magit
:commands (magit-blame-mode)
)
:ensure magit
:commands (magit-blame-mode)
)
#+END_SRC

** workgroups2

Save workgroup layouts. Similar..ish to desktop-save.
@@ -519,6 +556,7 @@ Highlight matching ()'s []'s etc...
:config (customize-set-variable 'autopair-blink 'nil)
)
#+END_SRC

** org

Org mode keybindings and settings, pretty sparse really.
@@ -535,6 +573,7 @@ Org mode keybindings and settings, pretty sparse really.
)

#+END_SRC

** flycheck

Flycheck for on the fly checking of code.
@@ -579,17 +618,24 @@ Auto complete functionality is nice to have.
#+BEGIN_SRC emacs-lisp
(use-package auto-complete
:ensure t
:defer t
:init
(progn (require 'auto-complete-config)
(ac-config-default)
(global-auto-complete-mode t))
)
#+END_SRC

** smartparens

Helpfully inserts matching parens, can be a pita too.

#+BEGIN_SRC emacs-lisp
(use-package smartparens
:ensure t
)
:ensure t
)
#+END_SRC

** uniquify

Make buffer names unique based on their directory and not have <N> or other nonsense.
@@ -598,6 +644,7 @@ Make buffer names unique based on their directory and not have <N> or other nons
(require 'uniquify)
(customize-set-variable 'uniquify-buffer-name-style 'post-forward)
#+END_SRC

** desktop-save

Desktop saving of session information handy to keep the same buffers between sessions.
@@ -620,12 +667,65 @@ Desktop saving of session information handy to keep the same buffers between ses
(add-hook 'auto-save-hook 'desktop-save-in-desktop-dir)
#+END_SRC

<<<<<<< HEAD
** fic-mode

Highlight TODO/FIXME type messages in comments.

#+BEGIN_SRC emacs-lisp
(use-package fic-mode :ensure t)
=======
** projectile

#+BEGIN_SRC emacs-lisp
(use-package projectile
:ensure t
:defer t
:idle (projectile-global-mode)
:config (progn (require 'helm-projectile)
(helm-projectile-on))
)
#+END_SRC

** git gutter

#+BEGIN_SRC emacs-lisp
(use-package git-gutter
:ensure t
:defer t
:idle (global-git-gutter-mode t)
)
#+END_SRC

** clang-format

#+BEGIN_SRC emacs-lisp
(use-package clang-format
:ensure t
:bind (([C-M-tab] . clang-format-region))
)
#+END_SRC

** ggtags

#+BEGIN_SRC emacs-lisp :tangle no
(use-package ggtags
:ensure t
)
#+END_SRC

** company-mode

#+BEGIN_SRC emacs-lisp :tangle no
(use-package company-mode
:ensure t
)
#+END_SRC

** helm-gtags

#+BEGIN_SRC emacs-lisp
(use-package helm-gtags :ensure t)
#+END_SRC

* mode related


+ 1
- 1
emacs/.emacs.d/init.el Vedi File

@@ -19,7 +19,7 @@

;; Somewhat needed so we can use org to manage things.
(use-package org
:ensure org-plus-contrib)
:ensure org-plus-contrib)

(require 'org)
(org-babel-load-file "~/.emacs.d/emacs.org")

+ 8
- 0
nix/.profile.d/20-functions-nix.sh Vedi File

@@ -0,0 +1,8 @@
# nix/.profile.d/20-functions-nix.sh
mk_nix_shell()
{
cabal2nix --sha256="0" . \
| perl -0777 -p -e 's/{.+}:/{ haskellPackages ? (import <nixpkgs> {}).haskellPackages }:/s' \
| sed -E -e 's/(cabal\.mkDerivation)/with haskellPackages; \1/' -e 'sXsha256 = "0";Xsrc = "./.";X' \
> shell.nix;
}

+ 8
- 0
nix/.profile.d/99-final-nix.sh Vedi File

@@ -0,0 +1,8 @@
# nix.profile.d/99-final-nix.sh

# The nix installer put something like this into the .profile.
# BAD INSTALLER NO COOKIE!
if [ -e ${HOME}/.nix-profile/etc/profile.d/nix.sh ]; then
. ${HOME}/.nix-profile/etc/profile.d/nix.sh;
export NIX_PATH=${HOME}/Developer/github.com/NixOS/nixpkgs:nixpkgs=${HOME}/Developer/github.com/NixOS/nixpkgs
fi

Caricamento…
Annulla
Salva