diff options
author | William Carroll <wpcarro@gmail.com> | 2017-06-18T17·23-0400 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2017-06-18T17·23-0400 |
commit | 1ccaee9fa9e26898c62d9f9ac0eb208855a86330 (patch) | |
tree | f297d27079b5da8396c35a2877e2100e185e0de4 | |
parent | 6d13881ec2b28b899a9aea45b2ffd520235cf2ed (diff) |
Adds finer-grain control over Linum Mode
-rwxr-xr-x | bins/bin/edit-file-in-emacs.sh | 6 | ||||
-rw-r--r-- | configs/.emacs | 37 | ||||
-rwxr-xr-x | emacs/symlink_custom_functions.sh | 2 | ||||
-rw-r--r-- | emacs/wc-dired-functions.el (renamed from emacs/wc-dired-functions.lisp) | 0 | ||||
-rw-r--r-- | emacs/wc-helm-functions.el (renamed from emacs/wc-helm-functions.lisp) | 0 | ||||
-rw-r--r-- | emacs/wc-helper-functions.el (renamed from emacs/wc-helper-functions.lisp) | 1 |
6 files changed, 25 insertions, 21 deletions
diff --git a/bins/bin/edit-file-in-emacs.sh b/bins/bin/edit-file-in-emacs.sh index 0661da7335fe..650ccac12011 100755 --- a/bins/bin/edit-file-in-emacs.sh +++ b/bins/bin/edit-file-in-emacs.sh @@ -1,7 +1,7 @@ #/usr/bin/env zsh -file=$(mktemp -t "$USER-"XXXXXXXX.emacs-pager) || exit 127 -trap 'rm -f "$file"' EXIT -trap 'exit 255' HUP INT QUIT TERM +file=$(mktemp -t "$USER-XXXXXXXX.emacs-pager") || exit 127 +trap "rm -f $file" EXIT +trap "exit 255" HUP INT QUIT TERM cat "$@" >"$file" emacsclient -e "(wc/edit-file-in-emacs \"$file\")" diff --git a/configs/.emacs b/configs/.emacs index 8c6cfb367b36..7d0a263f85c7 100644 --- a/configs/.emacs +++ b/configs/.emacs @@ -32,7 +32,7 @@ '(neo-window-width 35) '(package-selected-packages (quote - (git markdown-mode yaml-mode haskell-mode color-theme-sanityinc-tomorrow graphql-mode flycheck-elm popup-kill-ring green-phosphor-theme green-screen-theme minimal-theme creamsody-theme autothemer solarized-theme avk-emacs-themes github-theme all-the-icons-dired ace-window yasnippet chess synonyms powerline doom-neotree doom-themes persp-mode use-package helm-projectile persp-projectile perspective projectile with-editor helm-core company helm-ag evil-leader flycheck-mix flycheck-elixir evil-matchit typescript-mode evil-surround erlang elixir-mode golden-ratio flycheck-credo flycheck command-log-mode atom-one-dark-theme exec-path-from-shell clues-theme gotham-theme dracula-theme zenburn-theme fill-column-indicator neotree evil iedit vimrc-mode helm-ispell transpose-frame helm-ack nyan-mode alchemist helm dockerfile-mode elm-mode ack))) + (linum-off git markdown-mode yaml-mode haskell-mode color-theme-sanityinc-tomorrow graphql-mode flycheck-elm popup-kill-ring green-phosphor-theme green-screen-theme minimal-theme creamsody-theme autothemer solarized-theme avk-emacs-themes github-theme all-the-icons-dired ace-window yasnippet chess synonyms powerline doom-neotree doom-themes persp-mode use-package helm-projectile persp-projectile perspective projectile with-editor helm-core company helm-ag evil-leader flycheck-mix flycheck-elixir evil-matchit typescript-mode evil-surround erlang elixir-mode golden-ratio flycheck-credo flycheck command-log-mode atom-one-dark-theme exec-path-from-shell clues-theme gotham-theme dracula-theme zenburn-theme fill-column-indicator neotree evil iedit vimrc-mode helm-ispell transpose-frame helm-ack nyan-mode alchemist helm dockerfile-mode elm-mode ack))) '(popwin-mode t) '(popwin:popup-window-height 25) '(popwin:special-display-config @@ -118,6 +118,10 @@ (balance-windows)) +;; Extend load-path +(add-to-list 'load-path "~/.emacs.d/wc-downloads") + + ;; Smart Mode Line (use-package smart-mode-line :ensure t @@ -132,7 +136,7 @@ ;; Load custom Emacs functions -(load "~/.emacs.d/wc-helper-functions.lisp") +(load "~/.emacs.d/wc-helper-functions.el") ;; ERC configuration (IRC in Emacs) @@ -146,7 +150,17 @@ (fringe-mode 0) -(setq linum-format " %d ") +;; Linum +(use-package linum + :init + (setq linum-disabled-modes-list '(term-mode dired-mode Man-mode)) + :config + (defun linum-on () + (if (memq major-mode linum-disabled-modes-list) + (linum-mode -1) + (linum-mode nil))) + (setq linum-format " %d ") + (global-linum-mode t)) ;; Command Log Mode @@ -208,13 +222,7 @@ (setq explicit-shell-file-name "/bin/zsh") :bind (("C-v" . wc/ansi-term-paste)) :config - (add-hook 'term-mode-hook 'wc/bootstrap-ansi-term) - (linum-mode nil)) - - -;; Disable linum-mode in terminal -(add-hook 'after-change-major-mode-hook - '(lambda () (linum-mode (if (equal major-mode 'term-mode) 0 1)))) + (add-hook 'term-mode-hook 'wc/bootstrap-ansi-term)) ;; Projectile Settings @@ -226,7 +234,7 @@ ;; Dired Settings (use-package dired :init - (load "~/.emacs.d/wc-dired-functions.lisp") + (load "~/.emacs.d/wc-dired-functions.el") :bind (:map dired-mode-map ("e" . wdired-change-to-wdired-mode) ("c" . find-file) @@ -403,9 +411,7 @@ :config (setq alchemist-mix-env "prod") (setq alchemist-goto-elixir-source-dir "~/source_code/elixir/") - (setq alchemist-goto-erlang-source-dir "~/source_code/otp/") - :init - (linum-mode)) + (setq alchemist-goto-erlang-source-dir "~/source_code/otp/")) (add-hook 'erlang-mode-hook 'wc/custom-erlang-mode-hook) @@ -468,7 +474,7 @@ (setq helm-imenu-fuzzy-match t) (setq helm-locate-fuzzy-match t) :config - (load "~/.emacs.d/wc-helm-functions.lisp")) + (load "~/.emacs.d/wc-helm-functions.el")) ;; Helm Projectile Settings @@ -494,7 +500,6 @@ (add-hook 'after-init-hook 'evil-mode) (add-hook 'after-init-hook 'global-whitespace-mode) (add-hook 'after-init-hook 'global-hl-line-mode) -(add-hook 'after-init-hook 'global-linum-mode) (add-hook 'after-init-hook 'global-flycheck-mode) (add-hook 'after-init-hook 'global-company-mode) (add-hook 'after-init-hook 'projectile-mode) diff --git a/emacs/symlink_custom_functions.sh b/emacs/symlink_custom_functions.sh index d317910214c4..9effd9b1058b 100755 --- a/emacs/symlink_custom_functions.sh +++ b/emacs/symlink_custom_functions.sh @@ -1,3 +1,3 @@ #!/usr/bin/env zsh -ln -s ~/pc_settings/emacs/*.lisp ~/.emacs.d/ +ln -s ~/pc_settings/emacs/*.el ~/.emacs.d/ diff --git a/emacs/wc-dired-functions.lisp b/emacs/wc-dired-functions.el index a6b446976c02..a6b446976c02 100644 --- a/emacs/wc-dired-functions.lisp +++ b/emacs/wc-dired-functions.el diff --git a/emacs/wc-helm-functions.lisp b/emacs/wc-helm-functions.el index 52319f18da5e..52319f18da5e 100644 --- a/emacs/wc-helm-functions.lisp +++ b/emacs/wc-helm-functions.el diff --git a/emacs/wc-helper-functions.lisp b/emacs/wc-helper-functions.el index 7d26e36ff8a2..7d6597b9e18c 100644 --- a/emacs/wc-helper-functions.lisp +++ b/emacs/wc-helper-functions.el @@ -135,7 +135,6 @@ "Custom `ansi-term' configuration." (interactive) (goto-address-mode t) - (linum-mode nil) (local-set-key (kbd "C-h") 'evil-window-left) (local-set-key (kbd "C-l") 'evil-window-right) (local-set-key (kbd "C-k") 'evil-window-up) |