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

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)
#+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
(unless (package-installed-p 'use-package)
@@ -64,6 +65,11 @@ This configuration is using *use-package* extensively. Install it straight away.

(require 'use-package)
(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

*** match end of string function
@@ -77,24 +83,6 @@ This configuration is using *use-package* extensively. Install it straight away.
)
#+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

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

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

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))
#+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.

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

#+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

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

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

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

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

#+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

*** yasnippet
#+BEGIN_SRC emacs-lisp
(use-package yasnippet
:diminish yas-minor-mode
:ensure t
:init
(progn
@@ -710,8 +681,20 @@ Org-mode keybindings and settings, pretty sparse really.
(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

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

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

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

#+BEGIN_SRC emacs-lisp
(use-package smartparens
:diminish smartparens-mode
:ensure t
:config
(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)
(if (eq (desktop-owner) (emacs-pid))
(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

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

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

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

#+BEGIN_SRC emacs-lisp
(use-package undo-tree
:diminish undo-tree-mode
:ensure t
:init
(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
(use-package color-identifiers-mode
:diminish color-identifiers-mode
:ensure t
:config
(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
# git clone with submodules
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
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'
# short sha
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"
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
** github
#+BEGIN_SRC conf :tangle (when (eq git-p t) "tmp/.gitconfig")


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

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

packageOverrides = pkgs: with pkgs;
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-gnupg = gnupg.override { x11Support = false; };
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 {
pythonSupport = false;
@@ -30,107 +43,114 @@ in
name = "default";
ignoreCollisions = true;
paths = [
ansible
ack
ansible
aria
iperf
aspell
aspellDicts.en
bazaarTools
cacert
curl
clang
clang-analyzer
cloc
cscope
ctags
diffutils
patchutils
curl
custom-git
gitAndTools.gitFull
gitAndTools.git-extras
bazaarTools
mercurial
subversionClient
gist
mercurial
custom-pinentry
custom-pybugz
custom-pylint
custom-youtube-dl
diffutils
docbook5
entr
duply
emacs
entr
gcc
gdbm
ghostscript
gist
gitAndTools.git-extras
gitAndTools.gitFull
gnumake
gnupg
gnupg1compat
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
imagemagick
iperf
jq
keychain
silver-searcher
aspell
aspellDicts.en
lastpass-cli
less
llvm
mercurial
moreutils
mosh
multimarkdown
multitail
mutt
mr
nox
openssl
custom-pinentry
poppler_utils
ghostscript
p7zip
patchutils
pbzip2
pigz
pv
pixz
pkgconfig
poppler_utils
postgresql
pv
python27Packages.bugzilla
python27Packages.flake8
python27Packages.howdoi
python27Packages.pip
python27Packages.pyflakes
python27Packages.virtualenv
readline
rlwrap
rsync
rtags
gmp
silver-searcher
sloccount
sqlite
tmux
sshpass
subversionClient
texlive.combined.scheme-full
tmux
tree
wget
wakelan
unrar
unzip
upx
xz
multimarkdown
jq
p7zip
unrar
wakelan
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 [
# xhyve compiles normally, figure out hypervisor framework issue
# xhyve
];
};
};
allowUnfree = true;
allowBroken = true;
}
#+END_SRC

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