emacs - some polish
This commit is contained in:
parent
3808c96763
commit
02f5429c44
1 changed files with 22 additions and 2 deletions
|
@ -35,7 +35,7 @@
|
|||
(defun silence ()
|
||||
(interactive))
|
||||
|
||||
;; Disable backup
|
||||
;; Enable backup
|
||||
(setq make-backup-files t)
|
||||
(setq
|
||||
version-control t
|
||||
|
@ -45,6 +45,15 @@
|
|||
kept-new-versions 6
|
||||
kept-old-versions 2)
|
||||
|
||||
;; Scroll behaviour
|
||||
(setq
|
||||
scroll-step 1
|
||||
scroll-margin 5
|
||||
scroll-conservatively 9999)
|
||||
|
||||
;; Auto-fill in text
|
||||
(add-hook 'text-mode-hook 'turn-on-auto-fill)
|
||||
(setq-default fill-column 80)
|
||||
|
||||
(push '("melpa" . "http://melpa.milkbox.net/packages/") package-archives)
|
||||
|
||||
|
@ -222,6 +231,13 @@
|
|||
(interactive)
|
||||
(kill-buffer (current-buffer)))
|
||||
|
||||
(defun my/kill-window ()
|
||||
"Closes current window if not last"
|
||||
(interactive)
|
||||
(if (one-window-p (selected-window))
|
||||
(message "Last window, won't kill")
|
||||
(delete-window (selected-window))))
|
||||
|
||||
(use-package evil
|
||||
:ensure t
|
||||
:demand t
|
||||
|
@ -229,7 +245,11 @@
|
|||
(evil-mode 1)
|
||||
(setq evil-ex-substitute-global t)
|
||||
(define-key evil-normal-state-map "/" 'swiper)
|
||||
(evil-ex-define-cmd "q" 'my/kill-current-buffer)
|
||||
(evil-ex-define-cmd "q" 'my/kill-window)
|
||||
(evil-ex-define-cmd "wq" (lambda ()
|
||||
(interactive)
|
||||
(save-buffer)
|
||||
(my/kill-window)))
|
||||
(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)
|
||||
|
|
Loading…
Reference in a new issue