summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbenj <benj@rse8.com>2018-04-10 18:59:20 -0700
committerbenj <benj@rse8.com>2018-04-10 18:59:20 -0700
commita7f61d6bc345aef3333d19b52bf8a0fe57cfefd2 (patch)
tree481b6cc8ef157f29a0afffccc7aeef8c5ca68d6b
parent52148e06b54000a1c0670c821271a309245ab633 (diff)
downloademacs-a7f61d6bc345aef3333d19b52bf8a0fe57cfefd2.tar
emacs-a7f61d6bc345aef3333d19b52bf8a0fe57cfefd2.tar.gz
emacs-a7f61d6bc345aef3333d19b52bf8a0fe57cfefd2.tar.bz2
emacs-a7f61d6bc345aef3333d19b52bf8a0fe57cfefd2.tar.lz
emacs-a7f61d6bc345aef3333d19b52bf8a0fe57cfefd2.tar.xz
emacs-a7f61d6bc345aef3333d19b52bf8a0fe57cfefd2.tar.zst
emacs-a7f61d6bc345aef3333d19b52bf8a0fe57cfefd2.zip
added projectile and some other config changes
-rw-r--r--.gitignore3
-rw-r--r--init.el3
-rw-r--r--settings/sane-defaults.el54
-rw-r--r--settings/setup-projectile-mode.el2
4 files changed, 58 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index 8bb518a..923db4b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,4 +10,5 @@ ido*
derby*
auto-save-list*
metastore_db*
-projectile-bookmarks.eld \ No newline at end of file
+projectile-bookmarks.eld
+projectile.cache \ No newline at end of file
diff --git a/init.el b/init.el
index 31467f5..97c4ae4 100644
--- a/init.el
+++ b/init.el
@@ -44,6 +44,7 @@
;; Are we in gui or terminal?
(if (display-graphic-p)
+ ;; load the theme so we don't have a block of white for too long upon startup
(load-theme 'solarized-dark))
@@ -74,11 +75,13 @@
paredit
play-routes-mode
projectile
+ projectile-ripgrep
purescript-mode
org-bullets
sbt-mode
scala-mode
slime
+ smart-mode-line
visual-regexp
web-mode
yaml-mode
diff --git a/settings/sane-defaults.el b/settings/sane-defaults.el
index a793498..9f3249c 100644
--- a/settings/sane-defaults.el
+++ b/settings/sane-defaults.el
@@ -1,4 +1,4 @@
-;; Stolen from Magnars, with small mods
+;; Stolen from Magnars, with mods
;; https://github.com/magnars/.emacs.d/blob/master/settings/sane-defaults.el
;; Allow pasting selection outside of Emacs
@@ -18,6 +18,9 @@
(setq global-auto-revert-non-file-buffers t)
(setq auto-revert-verbose nil)
+;; dired listing switches
+(setq dired-listing-switches "-lisah")
+
;; Show keystrokes in progress
(setq echo-keystrokes 0.1)
@@ -64,7 +67,7 @@
;; Allow recursive minibuffers
(setq enable-recursive-minibuffers t)
-;; More memory than even Magnars...cause the future keeps happening
+;; More memory than even Magnars...'cause the future keeps happening
;; 100 MB should be good
(setq gc-cons-threshold 100000000)
@@ -82,7 +85,6 @@
(setq ediff-split-window-function 'split-window-horizontally)
(setq ediff-window-setup-function 'ediff-setup-windows-plain)
-
;; Offer to create parent directories if they do not exist
;; http://iqbalansari.github.io/blog/2014/12/07/automatically-create-parent-directories-on-visiting-a-new-file-in-emacs/
(defun my-create-non-existent-directory ()
@@ -102,4 +104,50 @@
(prefer-coding-system 'utf-8)
+(global-set-key (kbd "C-x C-b") 'ibuffer)
+
+;; swap regexp search and regular search bindings
+(global-set-key (kbd "C-s") 'isearch-forward-regexp)
+(global-set-key (kbd "C-r") 'isearch-backward-regexp)
+(global-set-key (kbd "C-M-s") 'isearch-forward)
+(global-set-key (kbd "C-M-r") 'isearch-backward)
+
+;; eval mode in region buffer
+(global-set-key (kbd "C-c C-e") 'eval-last-sexp)
+
+;; undo should not need shift
+(global-set-key (kbd "C--") 'undo)
+
+;; compilation commands
+(global-set-key (kbd "C-x C-m C-c") 'compile)
+(global-set-key (kbd "C-x C-m C-m") 'recompile)
+
+
+;; copy/paste commands for linux
+(global-set-key (kbd "s-c") 'clipboard-kill-region)
+(global-set-key (kbd "s-v") 'clipboard-yank)
+
+(defun beautify-json ()
+ (interactive)
+ (let ((b (if mark-active (min (point) (mark)) (point-min)))
+ (e (if mark-active (max (point) (mark)) (point-max))))
+ (shell-command-on-region b e
+ "python -mjson.tool" (current-buffer) t)))
+
+;; Override C-x C-c to open the default ansi-term buffer
+;; 0. check if we are in GUI or user want to override behavior
+;; 1. check if ansi-term buffer exists
+;; 2. load that buffer if it does exist
+;; 3. create and load that buffer if it does not, and delete other windows
+(if (display-graphic-p)
+ (let ((ansi-buffer "*ansi-term*")
+ (quit-command "C-x C-c"))
+ (if (not (get-buffer ansi-buffer))
+ (ansi-term "/bin/bash"))
+ (define-key global-map (kbd quit-command)
+ (lambda () (interactive)
+ (delete-other-windows)
+ (switch-to-buffer "*ansi-term*")))))
+
(provide 'sane-defaults)
+;;; sane-defaults.el ends here
diff --git a/settings/setup-projectile-mode.el b/settings/setup-projectile-mode.el
index 791b4d0..3ad9ee8 100644
--- a/settings/setup-projectile-mode.el
+++ b/settings/setup-projectile-mode.el
@@ -26,5 +26,7 @@
(projectile-global-mode)
+(define-key projectile-command-map (kbd "s g") 'projectile-ripgrep)
+
(provide 'setup-projectile-mode)
;;; setup-projectile-mode.el ends here