Delete words without storing them in the kill buffer,

and mark 'projectile-project-configure-cmd as save.
This commit is contained in:
tastytea 2019-04-10 14:42:57 +02:00
parent 36ec172588
commit 64c28b5544
2 changed files with 25 additions and 9 deletions

32
init.el
View File

@ -1,5 +1,5 @@
;;; init.el --- tastytea's Emacs init file.
;; Time-stamp: <2019-04-10T12:29:27+00:00>
;; Time-stamp: <2019-04-10T12:42:14+00:00>
;;; Commentary:
;; I am using this file with Emacs 26, but most of it will probably work with
@ -146,18 +146,32 @@
;;;;;;;;;;;;;;;;;;;; Keybindings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(use-package bind-key
:init
(defun my/delete-word (arg)
"Delete characters forward until encountering the end of a word.
With argument, do this that many times."
(interactive "p")
(if (use-region-p)
(delete-region (region-beginning) (region-end))
(delete-region (point) (progn (forward-word arg) (point)))))
(defun my/backward-delete-word (arg)
"Delete characters backward until encountering the end of a word.
With argument, do this that many times."
(interactive "p")
(my/delete-word (- arg)))
:config
(bind-keys
;; ;; Scroll in other window.
;; ("S-<prior>" . scroll-other-window-down)
;; ("S-<next>" . scroll-other-window)
;; Switch window
("C-<tab>" . other-window)
("C-<tab>" . other-window)
;; Reduce whitespace around cursor to 0 or 1, according to context.
("C-S-<delete>" . fixup-whitespace)
("C-S-<delete>" . fixup-whitespace)
;; Scroll without moving the cursor.
("M-<down>" . scroll-up-line)
("M-<up>" . scroll-down-line)))
("M-<down>" . scroll-up-line)
("M-<up>" . scroll-down-line)
;; Delete words without storing them in the kill buffer.
("C-<delete>" . my/delete-word)
("C-<backspace>" . my/backward-delete-word)))
;;;;;;;;;;;;;;;;;;;; Programming / general ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Online documentation mode.
@ -221,6 +235,8 @@
(projectile-switch-project-action 'neotree-projectile-action)
:config
(projectile-mode +1)
;; Mark variables as safe. This prevents prompts when using .dir-locals.el.
(put 'projectile-project-configure-cmd 'safe-local-variable #'stringp)
:bind
("C-c p" . 'projectile-command-map)
(:map projectile-command-map

View File

@ -1,2 +1,2 @@
127.0.0.1:51313 4508
127.0.0.1:51313 25228
phahw2ohVoh0oopheish7IVie9desh8aequeenei3uo8wahShe%thuadaeNa4ieh