From 0c741c3f4a335c95bf9a7829269f6dd175d7ebee Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Thu, 25 May 2017 03:45:30 +0200 Subject: [PATCH 1/2] =?UTF-8?q?Snippet=20f=C3=BCr=20python=20und=20binding?= =?UTF-8?q?=20f=C3=BCr=20neotree.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- emacs/.emacs | 5 +++-- emacs/.emacs.d/snippets/python-mode/ifmain | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 emacs/.emacs.d/snippets/python-mode/ifmain diff --git a/emacs/.emacs b/emacs/.emacs index 6f9a46a..5eab476 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -35,7 +35,7 @@ '(menu-bar-mode nil) '(package-selected-packages (quote - (swiper neotree centered-cursor-mode ivy avy heroku-theme auto-complete use-package yasnippet evil-surround org evil-magit magit makefile-runner evil))) + (shell-pop swiper neotree centered-cursor-mode ivy avy heroku-theme auto-complete use-package yasnippet evil-surround org evil-magit magit makefile-runner evil))) '(scroll-bar-mode nil) '(shell-pop-shell-type (quote @@ -164,7 +164,8 @@ (evil-define-key 'normal neotree-mode-map (kbd "c") 'neotree-rename-node) (evil-define-key 'normal neotree-mode-map (kbd "TAB") 'neotree-enter) (evil-define-key 'normal neotree-mode-map (kbd "RET") 'neotree-enter) - (evil-define-key 'normal neotree-mode-map (kbd "q") 'neotree-hide)) + (evil-define-key 'normal neotree-mode-map (kbd "q") 'neotree-hide) + (evil-define-key 'normal neotree-mode-map (kbd "DEL") 'neotree-select-up-node)) ;; Cursor centered diff --git a/emacs/.emacs.d/snippets/python-mode/ifmain b/emacs/.emacs.d/snippets/python-mode/ifmain new file mode 100644 index 0000000..8cfb55d --- /dev/null +++ b/emacs/.emacs.d/snippets/python-mode/ifmain @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: ifmain +# key: ifmain +# -- +if __name__ == "__main__": + $0 \ No newline at end of file From ec8fbec3c4c89b011ca2aa06b8b15282fe1e843f Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Thu, 25 May 2017 16:47:41 +0200 Subject: [PATCH 2/2] Exit prompt attempt --- emacs/.emacs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/emacs/.emacs b/emacs/.emacs index 6f9a46a..213472f 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -166,7 +166,6 @@ (evil-define-key 'normal neotree-mode-map (kbd "RET") 'neotree-enter) (evil-define-key 'normal neotree-mode-map (kbd "q") 'neotree-hide)) - ;; Cursor centered (use-package centered-cursor-mode :ensure t @@ -257,6 +256,22 @@ (global-set-key (kbd "") 'cycle-window) +;; Exit prompt +(defun foreach (alist func) + (while alist + (progn + (funcall func (car alist)) + (setq alist (cdr alist))))) + +;(defun emacs-exit-prompt () +; (foreach +; (buffer-list) +; (lambda (buffer) +; (cond +; ((string-match "^\\*.*\\*$" (buffer-name buffer)) nil) +; ((null (buffer-modified-p buffer)) nil) +; (t nil))))) + ;; Latex german (quail-define-package "latex-german" "UTF-8" "LaGe" t "Transforms umlauts to the better latex notation.