Просмотр исходного кода

Omnibus update of dotfiles I'm too lazy to split apart.

master
Mitch Tishmack 9 лет назад
Родитель
Сommit
9507d98287
3 измененных файлов: 164 добавлений и 130 удалений
  1. +61
    -56
      emacs.org
  2. +12
    -3
      git.org
  3. +91
    -71
      nix.org

+ 61
- 56
emacs.org Просмотреть файл

@@ -51,9 +51,10 @@ Add in the standard package archive urls.
(add-hook 'minibuffer-exit-hook #'my-minibuffer-exit-hook) (add-hook 'minibuffer-exit-hook #'my-minibuffer-exit-hook)
#+END_SRC #+END_SRC


*** use-package bootstrap
*** use-package/diminish bootstrap


This configuration is using *use-package* extensively. Install it straight away.
This configuration is using *use-package* extensively. Install it and diminish
straight away so we can use it elsewhere.


#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(unless (package-installed-p 'use-package) (unless (package-installed-p 'use-package)
@@ -64,6 +65,11 @@ This configuration is using *use-package* extensively. Install it straight away.


(require 'use-package) (require 'use-package)
(setq use-package-verbose t) (setq use-package-verbose t)
(use-package diminish :ensure t)
;; diminish away builtin modes right away as well
(diminish 'flyspell-mode)
(diminish 'whitespace-mode)
(diminish 'visual-line-mode)
#+END_SRC #+END_SRC


*** match end of string function *** match end of string function
@@ -77,24 +83,6 @@ This configuration is using *use-package* extensively. Install it straight away.
) )
#+END_SRC #+END_SRC


*** always babel tangle and byte compile emacs.org to init.el

Add a save hook to always tangle and byte compile emacs.org file when we save it.

#+BEGIN_SRC emacs-lisp :tangle no
(defun tangle-init ()
"If the current buffer is 'emacs.org' the code-blocks are
tangled, and the tangled file is compiled."
(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 "init.el")))
)
)

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

*** debug on error *** debug on error


Not having to start *emacs* with *--debug-init* is useful. Not having to start *emacs* with *--debug-init* is useful.
@@ -206,6 +194,9 @@ Because its derp to have to chmod 755 stuff after I save. Honestly, do it for me
#+END_SRC #+END_SRC


*** misc text related *** misc text related
#+BEGIN_SRC emacs-lisp
(put 'upcase-region 'disabled nil)
#+END_SRC
*** line wrap *** line wrap


Line wrapping is useful. Enable it globally for a start. Line wrapping is useful. Enable it globally for a start.
@@ -252,7 +243,7 @@ If I selected text, delete the selection, I probably meant it emacs.
(custom-set-variables '(fill-column 80)) (custom-set-variables '(fill-column 80))
#+END_SRC #+END_SRC


*** we aren't banging rocks anymore
*** we aren't banging rocks together anymore emacs


Double spacing after a line isn't needed. We aren't animals emacs, we have computers. Double spacing after a line isn't needed. We aren't animals emacs, we have computers.


@@ -440,12 +431,16 @@ All the packages I use.
*** tramp *** tramp


#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package tramp
:defer t
:config (custom-set-variables '(tramp-default-method "ssh"))
)
(use-package tramp
:defer t
:config
(progn
(custom-set-variables '(tramp-default-method "ssh"))
(add-to-list 'tramp-default-proxies-alist '(".*" "\`root\'" "/ssh:%h:")))
)
#+END_SRC #+END_SRC


(add-to-list 'tramp-default-proxies-alist '(".*" "\`root\'" "/ssh:%h:")))
*** exec-path-from-shell *** exec-path-from-shell


Turns out that someone wrote this exact thing already. Yay get to drop my own crap. Turns out that someone wrote this exact thing already. Yay get to drop my own crap.
@@ -471,42 +466,18 @@ Turns out that someone wrote this exact thing already. Yay get to drop my own cr
) )
#+END_SRC #+END_SRC


*** smart-mode-line
*** spaceline theme

Just use the silly spacemacs smart modeline theme cause I'm lazy.


#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package smart-mode-line
:ensure t
:config
(progn
(custom-set-variables '(sml/name-width 20)
'(sml/mode-width 'full)
'(sml/shorten-modes t)
'(sml/shorten-directory t)
'(sml/hidden-modes
'(" GitGutter"
" Fill"
" $"
" Wrap"
" MRev"
" Ind"
" Projectile"
" SP"
" Undo-Tree"
" yas"
" WSC"))
)
(sml/toggle-shorten-modes)
(add-to-list 'sml/replacer-regexp-list
'("^~/src/" ":src:"))
(sml/setup)
(column-number-mode)
)
)
(use-package spaceline :ensure t :init (progn (require 'spaceline-config) (spaceline-spacemacs-theme)))
#+END_SRC #+END_SRC


*** yasnippet *** yasnippet
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package yasnippet (use-package yasnippet
:diminish yas-minor-mode
:ensure t :ensure t
:init :init
(progn (progn
@@ -710,8 +681,20 @@ Org-mode keybindings and settings, pretty sparse really.
(0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•")))))) (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•"))))))
) )
) )
#+END_SRC

#+BEGIN_SRC emacs-lisp :tangle no
(require 'ox-latex)
ox-latex


(unless (boundp 'org-latex-classes)
(setq org-latex-classes nil))
nil


(add-to-list 'org-latex-classes
'("article"
"\\documentclass{article}"
("\\section{%s}" . "\\section*{%s}")))
#+END_SRC #+END_SRC


*** flycheck *** flycheck
@@ -720,6 +703,7 @@ Flycheck for on the fly checking of code.


#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package flycheck (use-package flycheck
:diminish flycheck-mode
:ensure t :ensure t
:init :init
(custom-set-variables '(flycheck-indication-mode 'left-fringe)) (custom-set-variables '(flycheck-indication-mode 'left-fringe))
@@ -759,6 +743,7 @@ Auto complete functionality is nice to have.


#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package auto-complete (use-package auto-complete
:diminish auto-complete-mode
:ensure t :ensure t
:init (progn (require 'auto-complete-config) :init (progn (require 'auto-complete-config)
(ac-config-default) (ac-config-default)
@@ -772,6 +757,7 @@ Helpfully inserts matching parens, can be a pita too.


#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package smartparens (use-package smartparens
:diminish smartparens-mode
:ensure t :ensure t
:config :config
(add-hook 'prog-mode-hook 'smartparens-mode) (add-hook 'prog-mode-hook 'smartparens-mode)
@@ -819,8 +805,24 @@ Desktop saving of session information handy to keep the same buffers between ses
(interactive) (interactive)
(if (eq (desktop-owner) (emacs-pid)) (if (eq (desktop-owner) (emacs-pid))
(desktop-save desktop-dirname))) (desktop-save desktop-dirname)))
#+END_SRC


(add-hook 'auto-save-hook 'desktop-save-in-desktop-dir)
*** TODO super-save

REMOVE ME && TODO IF THIS WORKS

Saves buffers like with auto-save but on focus loss, when idle etc...

#+BEGIN_SRC emacs-lisp
(use-package super-save
:diminish super-save-mode
:ensure t
:config (progn
(super-save-mode +1)
(setq super-save-auto-save-when-idle t)
(setq auto-save-default nil)
)
)
#+END_SRC #+END_SRC


*** fic-mode *** fic-mode
@@ -839,6 +841,7 @@ Highlight TODO/FIXME type messages in comments.


#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package projectile (use-package projectile
:diminish projectile-mode
:ensure t :ensure t
:init (projectile-global-mode) :init (projectile-global-mode)
) )
@@ -848,6 +851,7 @@ Highlight TODO/FIXME type messages in comments.


#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package git-gutter (use-package git-gutter
:diminish git-gutter-mode
:ensure t :ensure t
:config :config
(progn (global-git-gutter-mode t)) (progn (global-git-gutter-mode t))
@@ -1036,7 +1040,6 @@ Need to make haskell source be all pretty.
(push '("forall" . ?∀) prettify-symbols-alist) (push '("forall" . ?∀) prettify-symbols-alist)
(push '("sqrt" . ?√) prettify-symbols-alist) (push '("sqrt" . ?√) prettify-symbols-alist)
(push '("undefined" . ?⊥) prettify-symbols-alist) (push '("undefined" . ?⊥) prettify-symbols-alist)
(push '("sqrt" . ?√) prettify-symbols-alist)
(prettify-symbols-mode) (prettify-symbols-mode)
) )
) )
@@ -1050,6 +1053,7 @@ Make undo more useful, and treelike.


#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package undo-tree (use-package undo-tree
:diminish undo-tree-mode
:ensure t :ensure t
:init :init
(progn (global-undo-tree-mode)) (progn (global-undo-tree-mode))
@@ -1072,6 +1076,7 @@ Color variables for easy identification, its like a rainbow puked over everythin


#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package color-identifiers-mode (use-package color-identifiers-mode
:diminish color-identifiers-mode
:ensure t :ensure t
:config :config
(add-hook 'prog-mode-hook 'color-identifiers-mode) (add-hook 'prog-mode-hook 'color-identifiers-mode)


+ 12
- 3
git.org Просмотреть файл

@@ -72,15 +72,24 @@ General git configuration split out into sections mostly.
sup = !git pull --rebase && git submodule update --init --recursive sup = !git pull --rebase && git submodule update --init --recursive
# git clone with submodules # git clone with submodules
sc = !git clone --recursive $1 sc = !git clone --recursive $1
# what files are getting updated a lot
churn = !git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort | awk 'BEGIN {print "count,file"} {print $1 "," $2}'
# what files are getting updated a lot descending output
churn = !git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort -r | awk 'BEGIN {print "count,file"} {print $1 "," $2}' | egrep -v '^\\s+$'
# help the gc a bit and get a bit more space back for a local clone # help the gc a bit and get a bit more space back for a local clone
trim = !git reflog expire --expire=now --all && git gc --prune=now trim = !git reflog expire --expire=now --all && git gc --prune=now
# default remote
defremote = !git branch -rvv | egrep 'HEAD' | awk '{print $1}' | sed -e 's|/HEAD||g' defremote = !git branch -rvv | egrep 'HEAD' | awk '{print $1}' | sed -e 's|/HEAD||g'
# short sha
short = rev-parse --short short = rev-parse --short
# branch commits on lhs compared to rhs, use via g bcs $(g bn) ^other/branch
bcs = log --pretty="%H" --first-parent --no-merges
find-merge = !sh -c "commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 | uniq -f1 -d | sort -n | tail -1 | cut -f2" find-merge = !sh -c "commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 | uniq -f1 -d | sort -n | tail -1 | cut -f2"
show-merge = !sh -c "merge=$(git find-merge $0 $1) && [ -n \"$merge\" ] && git show $merge" show-merge = !sh -c "merge=$(git find-merge $0 $1) && [ -n \"$merge\" ] && git show $merge"
pbr = !git push --set-upstream $(git defremote) $(git bnam)
# push branch while setting the upstream to the default remote
pbr = !git push --set-upstream $(git defremote) $(git bn)
p = !sh -c 'git branch ${1:-$(git defremote)}pr$0@$(iso8601 -s) $(git ls-remote -q ${1:-$(git defremote)} | grep refs/pull-requests/$0/from | cut -c1-8)'
# kinda/sorta git pull -r without the git pull nonsense
cleanmerged = !sh -c "git branch --merged | grep -Ev '^(. master|\*)' | xargs -n1 git branch -d"
prune = !sh -c 'git cleanmerged; git fetch -p; git trim'
#+END_SRC #+END_SRC
** github ** github
#+BEGIN_SRC conf :tangle (when (eq git-p t) "tmp/.gitconfig") #+BEGIN_SRC conf :tangle (when (eq git-p t) "tmp/.gitconfig")


+ 91
- 71
nix.org Просмотреть файл

@@ -12,12 +12,25 @@ let
pkgs = import <nixpkgs> {}; pkgs = import <nixpkgs> {};
in in
{ {

packageOverrides = pkgs: with pkgs; packageOverrides = pkgs: with pkgs;
let in rec { let in rec {
custom-pybugz = with python34Packages; buildPythonPackage rec {
name = "pybugz-${version}";
version = "0.13";
src = pkgs.fetchgit {
url = https://github.com/williamh/pybugz.git;
rev = "4dec396d43061c1def9aa19601c89c8aa00742b3";
sha256 = "1s21jma83cyynmv3696hbrgy0d3sq4j027iplhnw22q2237bk1xd";
};
# TODO: Fix this, something to do with how its using unittest
doCheck = false;
buildInputs = [ pkgs.glibcLocales ];
propagatedBuildInputs = [ six ];
};
custom-pinentry = pinentry.override { gtk2 = null; qt4 = null; ncurses = null; }; custom-pinentry = pinentry.override { gtk2 = null; qt4 = null; ncurses = null; };
custom-gnupg = gnupg.override { x11Support = false; };
custom-youtube-dl = python27Packages.youtube-dl.override { pandoc = null; }; custom-youtube-dl = python27Packages.youtube-dl.override { pandoc = null; };
# 3 unit tests fail on both 27 pylint and 35 pylint, so ignore it
custom-pylint = python35Packages.pylint.override { doCheck = false; };


custom-git = git.override { custom-git = git.override {
pythonSupport = false; pythonSupport = false;
@@ -30,107 +43,114 @@ in
name = "default"; name = "default";
ignoreCollisions = true; ignoreCollisions = true;
paths = [ paths = [
ansible
ack ack
ansible
aria aria
iperf
aspell
aspellDicts.en
bazaarTools
cacert cacert
curl
clang clang
clang-analyzer clang-analyzer
cloc
cscope
ctags ctags
diffutils
patchutils
curl
custom-git custom-git
gitAndTools.gitFull
gitAndTools.git-extras
bazaarTools
mercurial
subversionClient
gist
mercurial
custom-pinentry
custom-pybugz
custom-pylint
custom-youtube-dl
diffutils
docbook5 docbook5
entr
duply
emacs emacs
entr
gcc
gdbm
ghostscript
gist
gitAndTools.git-extras
gitAndTools.gitFull
gnumake
gnupg gnupg
gnupg1compat gnupg1compat
gnutar gnutar
gnumake
sloccount
cloc
less
multitail
rlwrap
gdbm
mosh
graphviz-nox
haskellPackages.ShellCheck
haskellPackages.bake
haskellPackages.cabal-dependency-licenses
haskellPackages.ghc-core
haskellPackages.ghc-mod
haskellPackages.hasktags
haskellPackages.hindent
haskellPackages.hoogle
haskellPackages.hspec
haskellPackages.idris
haskellPackages.intero
haskellPackages.network
haskellPackages.pandoc
haskellPackages.shake
haskellPackages.stack
htop htop
imagemagick imagemagick
iperf
jq
keychain keychain
silver-searcher
aspell
aspellDicts.en
lastpass-cli
less
llvm
mercurial
moreutils
mosh
multimarkdown
multitail
mutt
mr
nox
openssl openssl
custom-pinentry
poppler_utils
ghostscript
p7zip
patchutils
pbzip2 pbzip2
pigz pigz
pv
pixz
pkgconfig pkgconfig
poppler_utils
postgresql postgresql
pv
python27Packages.bugzilla
python27Packages.flake8
python27Packages.howdoi
python27Packages.pip
python27Packages.pyflakes
python27Packages.virtualenv
readline readline
rlwrap
rsync rsync
rtags
gmp
silver-searcher
sloccount
sqlite sqlite
tmux
sshpass
subversionClient
texlive.combined.scheme-full texlive.combined.scheme-full
tmux
tree tree
wget
wakelan
unrar
unzip unzip
upx upx
xz
multimarkdown
jq
p7zip
unrar
wakelan
watch watch
nox
graphviz-nox
mutt
duply
lastpass-cli
custom-youtube-dl
python27Packages.howdoi
python27Packages.pyflakes
python27Packages.flake8
python27Packages.virtualenv
python27Packages.pip
python27Packages.pylint
haskellPackages.bake
haskellPackages.cabal-dependency-licenses
# haskellPackages.cabal-install
haskellPackages.ghc-core
haskellPackages.ghc-mod
haskellPackages.hasktags
haskellPackages.hindent
haskellPackages.hoogle
haskellPackages.hspec
haskellPackages.pandoc
haskellPackages.shake
haskellPackages.ShellCheck
haskellPackages.stack
] ++ stdenv.lib.optionals stdenv.isLinux [
# some of these are broken on osx, fix them
rtags
cscope
gcc
# disabled for now
wget
xz
# If I ever come up with some linux only stuff or figure out xhyve
# ] ++ stdenv.lib.optionals stdenv.isLinux [
# ] ++ stdenv.lib.optionals stdenv.isDarwin [ # ] ++ stdenv.lib.optionals stdenv.isDarwin [
# xhyve compiles normally, figure out hypervisor framework issue
# xhyve
]; ];
}; };
}; };
allowUnfree = true; allowUnfree = true;
allowBroken = true;
} }
#+END_SRC #+END_SRC

Загрузка…
Отмена
Сохранить