Commit efda8e0e authored by Duncan Bayne's avatar Duncan Bayne

Add Slack, and refactor terminal spawning

parent 281d9f44

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -2,8 +2,8 @@
(require 'package)
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "https://marmalade-repo.org/packages/")
("melpa" . "http://melpa.org/packages/")))
("marmalade" . "https://marmalade-repo.org/packages/")
("melpa" . "http://melpa.org/packages/")))
(package-initialize)
(global-set-key (kbd "s-q") 'magit-status)
......@@ -24,9 +24,9 @@
;; hide the tool bar but show the menu bar
(if window-system
(progn
(tool-bar-mode 0)
(menu-bar-mode 0)))
(progn
(tool-bar-mode 0)
(menu-bar-mode 0)))
;; allow us to use the X-Windows clipboard
(setq x-select-enable-clipboard t) ; as above
......@@ -34,9 +34,9 @@
;; paths containing additional .el files
(duncans_emacs:add-to-load-path
'("~/.emacs.d/emotion-iconous-mode"
"~/.emacs.d/ws-trim"
"~/.emacs.d/yari.el"))
'("~/.emacs.d/emotion-iconous-mode"
"~/.emacs.d/ws-trim"
"~/.emacs.d/yari.el"))
;; Emacs itself
(setq auto-mode-alist (cons '("emacs$" . lisp-mode) auto-mode-alist))
......@@ -45,29 +45,29 @@
(global-font-lock-mode 1)
(autoload 'ruby-mode "ruby-mode" "Ruby editing mode." t)
(duncans_emacs:set-mode
'ruby-mode
'("Gemfile$"
"\\.gemspec$"
"Guardfile$"
"\\.prawn$"
"\\.rake$"
"Rakefile$"
"\\.rb$"
"\\.rsel$"))
'ruby-mode
'("Gemfile$"
"\\.gemspec$"
"Guardfile$"
"\\.prawn$"
"\\.rake$"
"Rakefile$"
"\\.rb$"
"\\.rsel$"))
;; HAML
(require 'haml-mode)
(duncans_emacs:set-mode
'haml-mode
'("\\.haml$"
"\\.hamlc$"
"\\.hamljs$"))
'haml-mode
'("\\.haml$"
"\\.hamlc$"
"\\.hamljs$"))
;; CSS
(duncans_emacs:set-mode
'css-mode
'("\\.css$"
"\\.scss$"))
'css-mode
'("\\.css$"
"\\.scss$"))
;; Coffeescript
(require 'js2-mode)
......@@ -122,21 +122,21 @@
;; launch some shells unless we're in Windows
(if (and
(not (equal system-type 'windows-nt)))
(duncans_emacs:create-terminals
'("*tests*"
"*server*"
"*guard*"
"*misc*")))
(not (equal system-type 'windows-nt)))
(duncans_emacs:create-terminals
'("tests"
"server"
"guard"
"misc")))
;; show full path in title bar
;; thanks to: http://www.arminsadeghi.com/slickedit_and_emacs
(setq-default frame-title-format
(list '((buffer-file-name " %f"
(dired-directory
dired-directory
(revert-buffer-function " %b"
("%b - Dir: " default-directory)))))))
(list '((buffer-file-name " %f"
(dired-directory
dired-directory
(revert-buffer-function " %b"
("%b - Dir: " default-directory)))))))
;; SLIME
(require 'slime)
......@@ -172,7 +172,7 @@
(require 'find-file-in-project)
(global-set-key (kbd "C-x t") 'find-file-in-project)
(mapc '(lambda (ext) (add-to-list 'ffip-patterns ext))
'("*"))
'("*"))
(setq ffip-limit 102400)
(setq ffip-find-options "-not -wholename '*.a' -not -regex '.*\/\.git\/.*' -not -regex '.*\/\.db\/.*' -not -regex '.*\/node_modules\/.*' -not -regex '.*\/tmp/.*'")
(setq ffip-prefer-ido-mode t)
......@@ -207,9 +207,9 @@
"Edit currently visited file as root. With a prefix ARG prompt for a file to visit. Will also prompt for a file to visit if current buffer is not visiting a file."
(interactive "P")
(if (or arg (not buffer-file-name))
(find-file (concat "/sudo:root@localhost:"
(ido-read-file-name "Find file(as root): ")))
(find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))))
(find-file (concat "/sudo:root@localhost:"
(ido-read-file-name "Find file(as root): ")))
(find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))))
(global-set-key (kbd "C-x C-r") 'sudo-edit)
;; Jabber client
......@@ -232,28 +232,28 @@
;; presentations in Emacs - yay, one more violation of the UNIX philosophy ;)
(autoload 'org-present "org-present" nil t)
(add-hook 'org-present-mode-hook
(lambda ()
(linum-mode 0)
(global-hl-line-mode 0)
(org-present-big)
(org-display-inline-images)
(visual-line-mode)))
(lambda ()
(linum-mode 0)
(global-hl-line-mode 0)
(org-present-big)
(org-display-inline-images)
(visual-line-mode)))
(add-hook 'org-present-mode-quit-hook
(lambda ()
(linum-mode 1)
(global-hl-line-mode 1)
(org-present-small)
(org-remove-inline-images)
(setq visual-line-mode nil)))
(lambda ()
(linum-mode 1)
(global-hl-line-mode 1)
(org-present-small)
(org-remove-inline-images)
(setq visual-line-mode nil)))
;; helper function to connect to HipChat rooms through jabber.el
(defun hipchat-join (room)
(interactive "sRoom name: ")
(jabber-groupchat-join
(jabber-read-account)
(concat hipchat-number "_" room "@conf.hipchat.com")
hipchat-nickname
t)
(jabber-read-account)
(concat hipchat-number "_" room "@conf.hipchat.com")
hipchat-nickname
t)
(require 'jabber-emoicon))
(custom-set-variables '(jabber-auto-reconnect t))
......@@ -293,9 +293,9 @@
;; load ALL THE MESSAGES AND SHOW ALL in Gnus; best of luck if on Usenet
(setq gnus-large-newsgroup nil)
(setq gnus-parameters
'(("nnimap.*"
(gnus-use-scoring nil)
(display . all))))
'(("nnimap.*"
(gnus-use-scoring nil)
(display . all))))
;; contacts DB
(require 'bbdb)
......@@ -330,10 +330,10 @@
(interactive)
(backward-kill-sexp)
(condition-case nil
(prin1 (eval (read (current-kill 0)))
(current-buffer))
(prin1 (eval (read (current-kill 0)))
(current-buffer))
(error (message "Invalid expression")
(insert (current-kill 0)))))
(insert (current-kill 0)))))
(global-set-key (kbd "C-c e") 'eval-and-replace)
(defun my-message-mode-setup ()
......@@ -343,16 +343,16 @@
;; Cypher / Neo4j
(duncans_emacs:set-mode
'cypher-mode
'("\\.cql$"))
'cypher-mode
'("\\.cql$"))
;; edit ccrypted files
(require 'ps-ccrypt)
;; edit emails nicely using It's All Text
(duncans_emacs:set-mode
'mail-mode
'("\\.eml$"))
'mail-mode
'("\\.eml$"))
(add-hook 'mail-mode-hook 'auto-fill-mode)
;; Clojure refactoring tools
......@@ -370,4 +370,7 @@
;; finally, load any personal customisation
(if (file-exists-p "~/.emacs.d/personal.el")
(load "~/.emacs.d/personal.el"))
(load "~/.emacs.d/personal.el"))
;; quickly spawn new terms
(global-set-key (kbd "C-x c") 'duncans_emacs:create-terminal)
......@@ -34,15 +34,22 @@
(term-send-raw-string (concat "cd " new-directory "\n"))))))
(buffer-list)))
(defun duncans_emacs:create-terminal (terminal-name)
"Creates a named terminal."
(interactive (list (read-string "Name: ")))
(require 'multi-term)
(setq multi-term-program "/usr/bin/zsh")
(multi-term)
(set-buffer "*terminal<1>*")
(rename-buffer (concat "*" terminal-name "*")))
(defun duncans_emacs:create-terminals (terminal-names)
"Creates terminals with the specified names using multi-term."
(require 'multi-term)
(setq multi-term-program "/usr/bin/zsh")
(mapcar
(lambda (desired-name)
(multi-term)
(set-buffer "*terminal<1>*")
(rename-buffer desired-name))
(duncans_emacs:create-terminal desired-name))
terminal-names))
(defun duncans_emacs:kill-unmodified-buffers ()
......