Skip to content

Commit

Permalink
smartparens, swift-mode and some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ruph committed Mar 10, 2016
1 parent 1b19ca5 commit d7058e9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 23 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ EMACS PACKAGES
* [visual-regexp](https://github.com/benma/visual-regexp.el)
* [visual-regexp-steroids](https://github.com/benma/visual-regexp-steroids.el)
* [volatile-highlights](http://www.emacswiki.org/emacs/VolatileHighlights)
* [smartparens](https://github.com/Fuco1/smartparens)
* [sml-modeline](http://www.emacswiki.org/emacs/SmlModeLine)
* [yasnippet](https://github.com/capitaomorte/yasnippet)
* Languages
Expand All @@ -61,6 +62,7 @@ EMACS PACKAGES
* [racer](https://github.com/phildawes/racer)
* [rainbow-mode](https://julien.danjou.info/projects/emacs-packages#rainbow-mode)
* [skewer-less](https://github.com/purcell/skewer-less)
* [swift-mode](https://github.com/chrisbarrett/swift-mode)
* [tern](http://ternjs.net)
* [company-tern](https://github.com/proofit404/company-tern)
* [web-mode](http://web-mode.org)
Expand Down Expand Up @@ -137,7 +139,6 @@ CHEAT SHEET
* **S+M+k** - enlarge upper window
* **S+M+h** - enlarge left window
* **S+M+l** - enlarge right window
* **S+F6** - go full screen (osx specific)


### EDITOR ###
Expand Down
20 changes: 4 additions & 16 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
(delete-selection-mode 1) ;; delete the sel with a keyp

(setq search-highlight t ;; highlight when searching...
query-replace-highlight t) ;; ...and replacing
query-replace-highlight t) ;; ...and replacing
(fset 'yes-or-no-p 'y-or-n-p) ;; enable y/n answers to yes/no

(setq completion-ignore-case t ;; ignore case when completing...
Expand Down Expand Up @@ -60,8 +60,6 @@
(put 'downcase-region 'disabled nil) ;; Enable C-x C-l and C-x C-u
(put 'upcase-region 'disabled nil) ;; for down/up-case conversions

;; (electric-pair-mode 1) ;; automatic bracket insertion (emacs 24)

(global-unset-key (kbd "C-z")) ;; needed elsewhere

(setq savehist-file "~/.emacs.d/savehist" ;; save command history
Expand Down Expand Up @@ -196,19 +194,10 @@
(cua-mode t)


;; fullscreen in osx (emacs 24.3+)
(defun toggle-fullscreen ()
"Toggle full screen"
(interactive)
(set-frame-parameter
nil 'fullscreen
(when (not (frame-parameter nil 'fullscreen)) 'fullboth)))

;; especially for osx
(if (eq system-type 'darwin)
(progn
(setq ns-right-alternate-modifier nil) ;; unbind right alt
(global-set-key (kbd "S-<f6>") 'toggle-fullscreen) ;; full screen mode
(setq cua-enable-cua-keys nil))) ;; only for rectangles


Expand Down Expand Up @@ -391,12 +380,11 @@
(if (> (x-display-pixel-width) 1280)
(add-to-list 'default-frame-alist (cons 'width 100))
(add-to-list 'default-frame-alist (cons 'width 80)))
;; for the height, subtract a couple hundred pixels
;; from the screen height (for panels, menubars and
;; whatnot), then divide by the height of a char to
;; for the height, take the 60% of the screen height (for panels,
;; menubars and whatnot), then divide by the height of a char to
;; get the height we want
(add-to-list 'default-frame-alist
(cons 'height (/ (- (x-display-pixel-height) 200)
(cons 'height (/ (floor (* (x-display-pixel-height) 0.6))
(frame-char-height)))))))
(set-frame-size-according-to-resolution)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down
24 changes: 18 additions & 6 deletions lisp/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
(:name origami :type elpa)
(:name undo-tree :type elpa)
(:name company-racer :type elpa)
(:name smartparens :type elpa)
(:name swift-mode :type elpa)
(:name visual-fill-column :type elpa)
(:name csv-mode
:website "http://www.emacswiki.org/emacs/CsvMode"
Expand Down Expand Up @@ -272,17 +274,27 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


;; Smartparens
(use-package smartparens-config
:config
(progn
(show-smartparens-global-mode t)
(add-hook 'prog-mode-hook 'turn-on-smartparens-mode)
(add-hook 'markdown-mode-hook 'turn-on-smartparens-mode)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


;; Paredit () for lisps
(add-to-list 'load-path "~/.emacs.d/el-get/paredit")
(require 'paredit)
(autoload 'paredit-mode "paredit"
"Minor mode for pseudo-structurally editing Lisp code." t)
(add-hook 'emacs-lisp-mode-hook (lambda () (paredit-mode +1)))
(add-hook 'lisp-mode-hook (lambda () (paredit-mode +1)))
(add-hook 'lisp-interaction-mode-hook (lambda () (paredit-mode +1)))
(add-hook 'scheme-mode-hook (lambda () (paredit-mode +1)))
(add-hook 'slime-repl-mode-hook (lambda () (paredit-mode +1)))
(add-hook 'clojure-mode-hook (lambda () (paredit-mode +1)))
(add-hook 'emacs-lisp-mode-hook (lambda () (turn-off-smartparens-mode) (paredit-mode +1)))
(add-hook 'lisp-mode-hook (lambda () (turn-off-smartparens-mode) (paredit-mode +1)))
(add-hook 'lisp-interaction-mode-hook (lambda () (turn-off-smartparens-mode) (paredit-mode +1)))
(add-hook 'scheme-mode-hook (lambda () (turn-off-smartparens-mode) (paredit-mode +1)))
(add-hook 'slime-repl-mode-hook (lambda () (turn-off-smartparens-mode) (paredit-mode +1)))
(add-hook 'clojure-mode-hook (lambda () (turn-off-smartparens-mode) (paredit-mode +1)))

;; these are used for moving lines/regions
(keymap-unset-key (kbd "M-<up>") "paredit-mode")
Expand Down

0 comments on commit d7058e9

Please sign in to comment.