Skip to content

Commit

Permalink
synch dotfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
massemanet committed Sep 11, 2015
1 parent 5739b10 commit 19c7641
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 47 deletions.
37 changes: 19 additions & 18 deletions .bashrc
Expand Up @@ -5,8 +5,6 @@
# one path to rule them all
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
[ -d /opt/bin ] && export PATH=$PATH:/opt/bin
CU=$(brew --prefix coreutils)
[ -n "$CU" ] && export PATH=$CU/libexec/gnubin:$PATH

# one locale to rule them all
unset LC_ALL
Expand All @@ -25,11 +23,14 @@ set +f
shopt -s checkwinsize

# check for GNU ls
LS=ls ; [ `which gls 2> /dev/null` ] && LS=gls
DIRCOLS=dircolors ; [ `which gdircolors 2> /dev/null` ] && DIRCOLS=gdircolors
CU=$(brew --prefix coreutils)
[ -n "$CU" ] && export PATH=$CU/libexec/gnubin:$PATH
GREP=grep ; [ $(which ggrep) ] && GREP=ggrep
LS=ls ; [ $(which gls) ] && LS=gls
DIRCOLORS=dircolors ; [ $(which gdircolors) ] && DIRCOLORS=gdircolors
bash_completion=$(brew --prefix)/etc/bash_completion

# Enable sane completion
bash_completion=$(brew --prefix)/etc/bash_completion
[ -f $bash_completion ] && . $bash_completion

# define some git helpers
Expand Down Expand Up @@ -96,19 +97,19 @@ else
fi

# macos doesn't have pgrep/pkill
grep() { $(brew --prefix grep)/bin/ggrep --color=auto "$@"; }
fgrep() { ~/.fgrep.sh "$@"; }
tmx() { ~/.tmux.sh; }
pgrep() { ps -ef > $$ ; egrep -i "$1" $$ ; rm $$ ; }
pkill() { pgrep "$1" | awk '{print $2}' | xargs sudo kill -9 ; }
dir() { $LS --color=$lscols -lFh "$@";}
dirt() { dir -rt "$@";}
dird() { dir -d "$@";}
dira() { for d in "${@:-.}"; do (cd "$d";pwd; dird .*); done;}
rea() { history | egrep "${@:-}";}
m() { less "$@";}
e() { emacs -nw "$@";}
c() { cat "$@";}
function grep() { $GREP --color=auto "$@"; }
function fgrep() { ~/.fgrep.sh "$@"; }
function tmx() { ~/.tmux.sh; }
function pgrep() { ps -ef > $$ ; egrep -i "$1" $$ ; rm $$ ; }
function pkill() { pgrep "$1" | awk '{print $2}' | xargs sudo kill -9 ; }
function dir() { $LS --color=$lscols -lFh "$@";}
function dirt() { dir -rt "$@";}
function dird() { dir -d "$@";}
function dira() { for d in "${@:-.}"; do (cd "$d";pwd; dird .*); done;}
function rea() { history | egrep "${@:-}";}
function m() { less "$@";}
function e() { emacs -nw "$@";}
function c() { cat "$@";}

## history
# lots of history
Expand Down
42 changes: 23 additions & 19 deletions .emacs
@@ -1,17 +1,22 @@
;; -*- mode: lisp -*-

(defvar my-packages
'(magit highlight-parentheses rw-hunspell markdown-mode
purescript-mode sml-modeline js2-mode flymake-jshint json-mode)
"my packages, to be installed by package")

;; try to find and add my favourite paths
(let ((ps (list "~/elisp/*.el"
"~/git/distel/elisp/*.el"
(concat (shell-command-to-string
"echo -n `/usr/local/bin/brew --prefix erlang`")
"/lib/erlang/lib/tools-*/emacs/*.el"))))
(dolist (f0 (nreverse ps))
(let ((f (car (file-expand-wildcards f0))))
(let ((f (car (ignore-errors (file-expand-wildcards f0)))))
(when (and (stringp f) (file-exists-p f))
(add-to-list 'load-path (file-name-directory f))))))

; turn on good shit
;; turn on good shit
(set-language-environment "ASCII")
(show-paren-mode t)
(transient-mark-mode t)
Expand All @@ -33,16 +38,6 @@
(if (member 'tango-dark (custom-available-themes))
(load-theme 'tango-dark)))

; init package handler
(if (locate-library "package")
(progn
(require 'package)
(package-initialize)
(setq package-archives
'(("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "https://marmalade-repo.org/packages/")
("melpa" . "http://melpa.milkbox.net/packages/")))))

(setq-default
indent-tabs-mode nil)

Expand Down Expand Up @@ -369,16 +364,25 @@
(erc :server "irc.freenode.net" :nick "massemanet")
(erc :server "irc.hq.kred" :nick "masse"))

;; init package handler
(if (locate-library "package")
(progn
(require 'package)
(package-initialize)
(setq package-archives
'(("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "https://marmalade-repo.org/packages/")
("melpa" . "http://melpa.milkbox.net/packages/")))))

;;my pyckages
(defun my-elpa ()
(interactive)
(package-refresh-contents)
(dolist (p '(magit highlight-parentheses rw-hunspell markdown-mode
sml-modeline js2-mode flymake-jshint json-mode))
(progn
(if (package-installed-p p)
(message "already installed %s" p)
(package-install p)))))

(dolist (p my-packages)
(if (not (package-installed-p p))
(package-install p)))
(dolist (p (package-menu--find-upgrades))
(package-install p)))

;; automatically added stuff

Expand Down
14 changes: 8 additions & 6 deletions .fgrep.sh
Expand Up @@ -5,11 +5,13 @@ set -f
[ -z "$1" ] && set +f && exit 1
[ -n "$2" ] && d="$2" || d="."
[ -n "$3" ] && n="-name $3"
find "$d" -path "*/.svn" -prune -o \
-path "*/.git" -prune -o \
find "$d" \
-path "*/.svn" -prune -o \
-path "*/.git" -prune -o \
-path "*/.eunit" -prune -o \
-path "*/.deps" -prune -o \
-path "*/deps" -prune -o \
-path "*~" -prune -o \
-type f $n -exec grep -inIH "$1" {} \;
-path "*/.deps" -prune -o \
-path "*/#*" -prune -o \
-path "*~" -prune -o \
-type f $n \
-exec grep -inIH "$1" {} \;
set +f
8 changes: 4 additions & 4 deletions user_default.erl
Expand Up @@ -122,16 +122,16 @@ ineti() ->

ineti(P) ->
{_Fam,Type} = proplists:get_value(type,P),
[Status|_] = proplists:get_value(status,P),
[Status|_] = proplists:get_value(status,P),
{LIP,LPort} = proplists:get_value(local,P),
Sent = proplists:get_value(sent,P),
Recvd = proplists:get_value(received,P),
Sent = proplists:get_value(sent,P),
Recvd = proplists:get_value(received,P),
{RIP,RPort} =
case proplists:get_value(remote,P) of
enotconn -> {"*","*"};
{Rip,Rp} -> {inet_parse:ntoa(Rip),integer_to_list(Rp)}
end,
io:fwrite("~14s:~-5w ~14s:~-5s ~w ~w ~w ~w~n",
io:fwrite("~15s:~-5w ~15s:~-5s ~7w ~9w ~w/~w~n",
[inet_parse:ntoa(LIP),LPort,RIP,RPort,Type,Status,Sent,Recvd]).

ports() ->
Expand Down

0 comments on commit 19c7641

Please sign in to comment.