forked from colonelpanic/dotfiles
[Emacs] Disable yasnippet in term-mode
This commit is contained in:
parent
9d94a09b58
commit
64f448c6c5
@ -937,6 +937,15 @@ This was stolen from https://github.com/jwiegley/dot-emacs
|
|||||||
(imalison:let-around imalison:projectile-helm-command-from-zsh helm-command-from-zsh
|
(imalison:let-around imalison:projectile-helm-command-from-zsh helm-command-from-zsh
|
||||||
(default-directory (projectile-project-root)))
|
(default-directory (projectile-project-root)))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
** Disable hooks
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(cl-defmacro imalison:disable-mode-hook (mode-name &optional (disable-value -1))
|
||||||
|
`(defun ,(imalison:concat-symbols 'imalison:disable- mode-name) ()
|
||||||
|
(,mode-name ,disable-value)))
|
||||||
|
|
||||||
|
(imalison:disable-mode-hook linum-mode)
|
||||||
|
(imalison:disable-mode-hook yas-minor-mode)
|
||||||
|
#+END_SRC
|
||||||
** Other
|
** Other
|
||||||
The stuff in this section is pretty crusty. I don't think its used anywhere, but
|
The stuff in this section is pretty crusty. I don't think its used anywhere, but
|
||||||
I keep it around just in case I need it.
|
I keep it around just in case I need it.
|
||||||
@ -953,9 +962,6 @@ I keep it around just in case I need it.
|
|||||||
(interactive)
|
(interactive)
|
||||||
(s-replace "\n" "" (shell-command-to-string "uuid")))
|
(s-replace "\n" "" (shell-command-to-string "uuid")))
|
||||||
|
|
||||||
(defun imalison:disable-linum-mode ()
|
|
||||||
(linum-mode 0))
|
|
||||||
|
|
||||||
(defun imalison:disable-smartparens-mode ()
|
(defun imalison:disable-smartparens-mode ()
|
||||||
(smartparens-mode 0))
|
(smartparens-mode 0))
|
||||||
|
|
||||||
@ -3643,17 +3649,65 @@ emr (emacs refactor) provides support for refactoring in many programming langua
|
|||||||
(defun imalison:avy-term (arg)
|
(defun imalison:avy-term (arg)
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(term-line-mode)
|
(term-line-mode)
|
||||||
(imalison:avy arg)))
|
(imalison:avy arg))
|
||||||
:bind (:map term-raw-escape-map
|
|
||||||
|
(defun imalison:term-paste (&optional string)
|
||||||
|
(interactive)
|
||||||
|
(process-send-string
|
||||||
|
(get-buffer-process (current-buffer))
|
||||||
|
(if string string (current-kill 0))))
|
||||||
|
|
||||||
|
(require 'helm)
|
||||||
|
|
||||||
|
(defvar helm-kill-ring-for-term-actions
|
||||||
|
'(("Yank" . imalison:term-paste)
|
||||||
|
("Delete" . (lambda (_candidate)
|
||||||
|
(cl-loop for cand in (helm-marked-candidates)
|
||||||
|
do (setq kill-ring
|
||||||
|
(delete cand kill-ring)))))))
|
||||||
|
(defvar helm-source-kill-ring-for-term
|
||||||
|
(helm-build-sync-source "Kill Ring"
|
||||||
|
:init (lambda () (helm-attrset 'last-command last-command))
|
||||||
|
:candidates #'helm-kill-ring-candidates
|
||||||
|
:filtered-candidate-transformer #'helm-kill-ring-transformer
|
||||||
|
:action 'helm-kill-ring-for-term-actions
|
||||||
|
:persistent-action 'ignore
|
||||||
|
:persistent-help "DoNothing"
|
||||||
|
:migemo t
|
||||||
|
:multiline t))
|
||||||
|
|
||||||
|
(defun helm-show-kill-ring-for-term ()
|
||||||
|
"Preconfigured `helm' for `kill-ring'.
|
||||||
|
It is drop-in replacement of `yank-pop'.
|
||||||
|
|
||||||
|
First call open the kill-ring browser, next calls move to next line."
|
||||||
|
(interactive)
|
||||||
|
(let ((enable-recursive-minibuffers t))
|
||||||
|
(helm :sources helm-source-kill-ring-for-term
|
||||||
|
:buffer "*helm kill ring*"
|
||||||
|
:resume 'noresume
|
||||||
|
:allow-nest t)))
|
||||||
|
|
||||||
|
(defun imalison:term-char-mode ()
|
||||||
|
(interactive)
|
||||||
|
(term-char-mode)
|
||||||
|
(goto-char (point-max))))
|
||||||
|
:bind (:map term-mode-map
|
||||||
|
("C-c C-k" . imalison:term-char-mode)
|
||||||
|
:map term-raw-escape-map
|
||||||
("M-x" . helm-M-x)
|
("M-x" . helm-M-x)
|
||||||
("C-j" . imalison:avy-term)
|
("C-j" . imalison:avy-term)
|
||||||
:map term-raw-map
|
:map term-raw-map
|
||||||
("M-x" . helm-M-x)
|
("M-x" . helm-M-x)
|
||||||
("C-j" . imalison:avy-term))
|
("C-j" . imalison:avy-term)
|
||||||
|
("M-:" . eval-expression)
|
||||||
|
("C-y" . imalison:term-paste)
|
||||||
|
("M-y" . helm-show-kill-ring-for-term))
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(define-key term-raw-map (kbd "C-h") help-map)
|
(define-key term-raw-map (kbd "C-h") help-map)
|
||||||
(add-hook 'term-mode-hook 'imalison:disable-linum-mode)
|
(add-hook 'term-mode-hook 'imalison:disable-linum-mode)
|
||||||
|
(add-hook 'term-mode-hook 'imalison:disable-yas-minor-mode)
|
||||||
(add-hook 'term-mode-hook 'imalison:disable-show-trailing-whitespace)
|
(add-hook 'term-mode-hook 'imalison:disable-show-trailing-whitespace)
|
||||||
(setq term-buffer-maximum-size 0)))
|
(setq term-buffer-maximum-size 0)))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
Loading…
Reference in New Issue
Block a user