From 971dae3da8114375bd6b60a16d1bf8d0f8520b68 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Fri, 6 Oct 2017 11:24:09 +0200 Subject: [PATCH] Emacs: cperl-mode, and kill-current-buffer --- emacs/.emacs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/emacs/.emacs b/emacs/.emacs index 1b5c810..5ad0882 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -44,8 +44,10 @@ '(blink-cursor-mode nil) '(cperl-close-paren-offset -2) '(cperl-electric-parens nil) + '(cperl-electric-parens-mark nil) '(cperl-indent-level 2) '(cperl-indent-parens-as-block t) + '(cperl-under-as-char t) '(custom-enabled-themes (quote (heroku))) '(custom-safe-themes (quote @@ -151,6 +153,10 @@ (interactive) (evil--jump-forward 1)) +(defun my/kill-current-buffer () + (interactive) + (kill-buffer (current-buffer))) + (use-package evil :ensure t :demand t @@ -158,7 +164,7 @@ (evil-mode 1) (setq evil-ex-substitute-global t) (define-key evil-normal-state-map "/" 'swiper) - (evil-ex-define-cmd "q" 'kill-buffer) + (evil-ex-define-cmd "q" 'my/kill-current-buffer) (define-key evil-normal-state-map "gb" 'my/evil-go-back) (define-key evil-normal-state-map "gn" 'my/evil-go-forward) (define-key evil-motion-state-map [down-mouse-1] 'silence) @@ -386,8 +392,7 @@ (defun treat-underscore () (modify-syntax-entry ?_ "w")) -(add-hook 'cperl-mode-hook 'treat-underscore) -(add-hook 'c-mode-hook 'treat-underscore) +(add-hook 'prog-mode-hook 'treat-underscore) ;; Split windows horizontally preferred (setq split-height-threshold 6)