summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimeon Simeonov2017-09-15 07:52:22 +0200
committerSimeon Simeonov2017-09-15 07:52:22 +0200
commite022596155ba8335b9a4f73f855c1262c9cb8b01 (patch)
treebe54d3ed8ccf3c994f733b6f43f032fc0db4bb37
parent05b4f4ce4d6d2d655ed94c9de91cb530372eec0c (diff)
Update yasnippet, enable which-function-mode in .emacs, add snippets/python-mode/bang
-rw-r--r--.emacs4
-rw-r--r--.emacs.d/lisp/yasnippet.el9
-rw-r--r--.emacs.d/snippets/python-mode/bang6
3 files changed, 15 insertions, 4 deletions
diff --git a/.emacs b/.emacs
index 912f1fb..c1824cd 100644
--- a/.emacs
+++ b/.emacs
@@ -64,8 +64,8 @@
64(add-to-list 'auto-mode-alist '("\\.ino\\'" . c++-mode)) 64(add-to-list 'auto-mode-alist '("\\.ino\\'" . c++-mode))
65 65
66;; Enable which-function-mode for C, C++ and Python 66;; Enable which-function-mode for C, C++ and Python
67;; (setq which-func-modes '(c-mode c++-mode java-mode python-mode)) 67(setq which-func-modes '(c-mode c++-mode java-mode python-mode))
68;; (which-function-mode t) 68(which-function-mode t)
69 69
70;; Custom plugins 70;; Custom plugins
71(add-to-list 'load-path "~/.emacs.d/lisp/") 71(add-to-list 'load-path "~/.emacs.d/lisp/")
diff --git a/.emacs.d/lisp/yasnippet.el b/.emacs.d/lisp/yasnippet.el
index 94ccffb..aa9fe5e 100644
--- a/.emacs.d/lisp/yasnippet.el
+++ b/.emacs.d/lisp/yasnippet.el
@@ -3839,9 +3839,14 @@ considered when expanding the snippet."
3839 (when first-field 3839 (when first-field
3840 (sit-for 0) ;; fix issue 125 3840 (sit-for 0) ;; fix issue 125
3841 (yas--letenv (yas--snippet-expand-env snippet) 3841 (yas--letenv (yas--snippet-expand-env snippet)
3842 (yas--move-to-field snippet first-field)))) 3842 (yas--move-to-field snippet first-field))
3843 (when (and (eq (yas--field-number first-field) 0)
3844 (> (length (yas--field-text-for-display
3845 first-field))
3846 0))
3847 ;; Keep region for ${0:exit text}.
3848 (setq deactivate-mark nil))))
3843 (yas--message 4 "snippet %d expanded." (yas--snippet-id snippet)) 3849 (yas--message 4 "snippet %d expanded." (yas--snippet-id snippet))
3844 (setq deactivate-mark nil)
3845 t)))) 3850 t))))
3846 3851
3847(defun yas--take-care-of-redo (_beg _end snippet) 3852(defun yas--take-care-of-redo (_beg _end snippet)
diff --git a/.emacs.d/snippets/python-mode/bang b/.emacs.d/snippets/python-mode/bang
new file mode 100644
index 0000000..d70a4a2
--- /dev/null
+++ b/.emacs.d/snippets/python-mode/bang
@@ -0,0 +1,6 @@
1# -*- mode: snippet -*-
2# name: #!
3# key: #!
4# contributor : @avelino
5# --
6#!/usr/bin/env python \ No newline at end of file