Run an instance of emacs per directory.

This commit is contained in:
Ivan Malison 2014-10-27 01:55:02 -07:00
parent d60be4274d
commit b32765b9c5
2 changed files with 12 additions and 3 deletions

View File

@ -1,6 +1,3 @@
alias emacs="emacsclient -c -n --server-filename=$(pwd)"
alias temacs="emacsclient -t"
alias cemacs="emacsclient -c -n"
alias tmux="tmux -2"
alias reload_tmux_conf="tmux source-file .tmux.conf"
alias tmux_cb_to_remote_cb='tmux saveb - | linux_nc_paste_to_remote_clipboard'

View File

@ -0,0 +1,12 @@
alias emacs='_emacs -c'
alias cemacs'_emacs -c'
alias temacs'_emacs -t'
function _emacs {
test -z "$(ps aux | grep -v grep | grep -i "\emacs -nw --daemon=.*`dotted_directory`")" && \emacs --daemon="$(dotted_directory)"
emacsclient $* -n --server-file="$(dotted_directory)"
}
function dotted_directory {
pwd | sed "s:/:.:g"
}