mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-23 14:03:44 -05:00
Yet another big update
This commit is contained in:
@@ -159,8 +159,6 @@
|
||||
;; Tools/defuns ;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(push '("*compilation*" :height 0.5 :position bottom :noselect t) popwin:special-display-config)
|
||||
|
||||
(add-hook! 'c++-mode-hook (setq my-make-command "make %s"))
|
||||
))
|
||||
|
||||
|
||||
|
@@ -35,21 +35,23 @@
|
||||
;; Code building
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defvar my-build-command "make %s")
|
||||
(defvar my-build-command '("make %s" . "Makefile"))
|
||||
(make-variable-buffer-local 'my-build-command)
|
||||
(add-hook! 'enh-ruby-mode-hook (setq my-build-command "rake %s"))
|
||||
|
||||
(defun set-build-command (command &optional file)
|
||||
(setq my-build-command (command . file)))
|
||||
|
||||
(evil-define-command my:build (arg)
|
||||
"Call a build command in the current directory.
|
||||
If ARG is nil this function calls `recompile', otherwise it calls
|
||||
`compile' passing ARG as build command."
|
||||
(interactive "<sh>")
|
||||
(let ((makepath (f-traverse-upwards
|
||||
(lambda (path)
|
||||
(f-exists? (f-expand "Makefile" path)))
|
||||
default-directory)))
|
||||
(if makepath
|
||||
(compile (format "cd '%s' && %s" makepath (format my-build-command (or arg ""))))
|
||||
(when (null my-build-command)
|
||||
(user-error "No build command was set"))
|
||||
(let ((build-file (cdr my-build-command))
|
||||
(build-cmd (car my-build-command)))
|
||||
(if (project-has-files build-file)
|
||||
(compile (format "cd '%s' && %s" build-file (format build-cmd (or arg ""))))
|
||||
(error "Could not find Makefile"))))
|
||||
|
||||
|
||||
|
@@ -6,16 +6,15 @@
|
||||
flycheck-disabled-checkers '(emacs-lisp-checkdoc make))
|
||||
:config
|
||||
(progn ; flycheck settings
|
||||
(dolist (hook '(ruby-mode-hook
|
||||
python-mode-hook
|
||||
php-mode-hook
|
||||
lua-mode-hook
|
||||
shell-mode-hook
|
||||
scss-mode-hook
|
||||
c++-mode-hook
|
||||
c-mode-hook
|
||||
))
|
||||
(add-hook hook 'flycheck-mode))
|
||||
(add-hooks '(ruby-mode-hook
|
||||
python-mode-hook
|
||||
php-mode-hook
|
||||
lua-mode-hook
|
||||
shell-mode-hook
|
||||
scss-mode-hook
|
||||
c++-mode-hook
|
||||
c-mode-hook)
|
||||
'flycheck-mode)
|
||||
|
||||
(my--cleanup-buffers-add "^\\*Flycheck.*\\*$")
|
||||
|
||||
|
@@ -12,6 +12,14 @@
|
||||
|
||||
(my--cleanup-buffers-add "^\\*[Hh]elm.*\\*$")
|
||||
|
||||
;; disable popwin-mode in an active Helm session It should be disabled
|
||||
;; otherwise it will conflict with other window opened by Helm persistent
|
||||
;; action, such as *Help* window.
|
||||
(add-hook! 'helm-after-initialize-hook (popwin-mode -1))
|
||||
|
||||
;; Restore popwin-mode after a Helm session finishes.
|
||||
(add-hook! 'helm-cleanup-hook (popwin-mode 1))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(use-package helm-ag
|
||||
@@ -23,7 +31,7 @@
|
||||
:type inclusive
|
||||
:repeat nil
|
||||
(interactive "<r><a><!>")
|
||||
(let* ((helm-ag-default-directory (my--project-root pwd-p))
|
||||
(let* ((helm-ag-default-directory (if pwd-p default-directory (project-root)))
|
||||
(helm-ag-command-option (concat (unless regex-p "-Q ")
|
||||
(if hidden-files-p "--hidden ")))
|
||||
(input "")
|
||||
@@ -32,7 +40,6 @@
|
||||
(progn
|
||||
(helm-attrset 'search-this-file nil helm-ag-source)
|
||||
(setq helm-ag--last-query search))
|
||||
(helm-ag-save-current-context)
|
||||
(if (and beg end (/= beg (1- end)))
|
||||
(setq input (buffer-substring-no-properties beg end))))
|
||||
(helm-attrset 'name header-name helm-ag-source)
|
||||
|
@@ -1,7 +1,7 @@
|
||||
(defun my-java-project-package ()
|
||||
(if (eq major-mode 'java-mode)
|
||||
(s-chop-suffix "." (s-replace "/" "." (f-dirname (f-relative (buffer-file-name)
|
||||
(concat (my--project-root) "src/")))))
|
||||
(concat (project-root) "src/")))))
|
||||
""))
|
||||
|
||||
(defun my-java-class-name ()
|
||||
@@ -37,7 +37,7 @@
|
||||
:defer t
|
||||
:init
|
||||
(add-hook! 'java-mode-hook
|
||||
(when (f-exists? (concat (my--project-root) "AndroidManifest.xml"))
|
||||
(when (project-has-files "AndroidManifest.xml")
|
||||
(android-mode +1))))
|
||||
|
||||
(use-package groovy-mode :mode "\\.gradle$")
|
||||
|
@@ -57,6 +57,11 @@
|
||||
(enable-tab-width-2)
|
||||
(setq js-indent-level 2))))
|
||||
|
||||
(define-minor-mode lb6-mode
|
||||
:lighter " lb6"
|
||||
:keymap (make-sparse-keymap)
|
||||
(my--init-yas-mode 'lb6-mode))
|
||||
(associate-minor-mode "/Contents/\\(Scripts\\|Resources\\)/.*$" 'lb6-mode)
|
||||
|
||||
(provide 'init-js)
|
||||
;;; init-js.el ends here
|
||||
|
@@ -7,13 +7,15 @@
|
||||
"Buffer local minor mode for Love2D"
|
||||
:init-value nil
|
||||
:lighter " <3"
|
||||
:keymap (make-sparse-keymap))
|
||||
(associate-minor-mode "[\\.-]love/.+\\.lua$" 'love-mode)
|
||||
:keymap (make-sparse-keymap)
|
||||
(my--init-yas-mode 'love-mode))
|
||||
(add-hook! 'lua-mode-hook
|
||||
(setq lua-indent-level tab-width)
|
||||
(set-build-command "open -a love.app '%s'" "main.lua")
|
||||
(when (project-has-files "main.lua")
|
||||
(love-mode +1)))
|
||||
|
||||
(add-hook 'lua-mode-hook 'enable-tab-width-2)
|
||||
(add-hook! 'lua-mode-hook (setq lua-indent-level tab-width))
|
||||
|
||||
(add-hook! 'love-mode-hook (setq my-build-command (format "open -a love.app %s" (my--project-root))))))
|
||||
(add-hook 'lua-mode-hook 'enable-tab-width-2)))
|
||||
|
||||
|
||||
(provide 'init-lua)
|
||||
|
@@ -1,26 +1,18 @@
|
||||
(use-package projectile
|
||||
:init
|
||||
(setq-default projectile-cache-file (concat my-tmp-dir "projectile.cache")
|
||||
projectile-known-projects-file (concat my-tmp-dir "projectile.projects")
|
||||
projectile-enable-caching t
|
||||
projectile-indexing-method 'alien)
|
||||
:init (setq-default projectile-enable-caching t)
|
||||
:config
|
||||
(progn
|
||||
(projectile-global-mode +1)
|
||||
|
||||
(setq projectile-sort-order 'recentf
|
||||
projectile-cache-file (concat my-tmp-dir "projectile.cache")
|
||||
projectile-known-projects-file (concat my-tmp-dir "projectile.projects")
|
||||
projectile-indexing-method 'alien)
|
||||
|
||||
(add-to-list 'projectile-globally-ignored-files "ido.last")
|
||||
(add-to-list 'projectile-globally-ignored-directories "assets")
|
||||
(add-to-list 'projectile-other-file-alist '("scss" "css"))
|
||||
(add-to-list 'projectile-other-file-alist '("css" "scss"))
|
||||
|
||||
;; For setting project-specific settings
|
||||
(defmacro my-project-settings (project-name &rest body)
|
||||
(declare (indent 1))
|
||||
`(progn
|
||||
(add-hook 'find-file-hook
|
||||
(lambda ()
|
||||
(when (string-match-p ,project-name (projectile-project-name))
|
||||
,@body)))))))
|
||||
(add-to-list 'projectile-other-file-alist '("css" "scss"))))
|
||||
|
||||
|
||||
(provide 'init-projectile)
|
||||
|
@@ -23,6 +23,7 @@
|
||||
(setq enh-ruby-check-syntax nil)
|
||||
|
||||
(add-hook 'enh-ruby-mode-hook 'enable-tab-width-2)
|
||||
(add-hook! 'enh-ruby-mode-hook (set-build-command "rake %s" "Rakefile"))
|
||||
|
||||
(define-key enh-ruby-mode-map [?\n] nil)
|
||||
|
||||
@@ -54,7 +55,8 @@
|
||||
|
||||
(define-minor-mode rake-mode
|
||||
"Buffer local minor mode for rake files"
|
||||
:lighter " Rake")
|
||||
:lighter " Rake"
|
||||
(my--init-yas-mode 'rake-mode))
|
||||
|
||||
(use-package inf-ruby
|
||||
:commands (inf-ruby inf-ruby-console-auto)
|
||||
|
@@ -18,14 +18,14 @@
|
||||
(message "[Tmux] %s" command)))
|
||||
|
||||
(evil-define-command my:tmux-chdir (&optional path bang)
|
||||
"CDs in tmux using `my--project-root'"
|
||||
"CDs in tmux using `project-root'"
|
||||
(interactive "<f><!>")
|
||||
(let ((dir (shell-quote-argument
|
||||
(if (and path (not (s-blank? path)))
|
||||
(if (file-directory-p path)
|
||||
(file-truename path)
|
||||
(error "Directory doesn't exist %s" path))
|
||||
(my--project-root bang)))))
|
||||
(if bang default-directory (project-root))))))
|
||||
(my--tmux-send (format "C-u cd Space %s Enter" (shell-quote-argument dir)))
|
||||
(when (evil-ex-p)
|
||||
(message "[Tmux] cd %s" dir)))))
|
||||
|
@@ -65,6 +65,17 @@
|
||||
(kbd "M-e") 'emmet-expand-yas
|
||||
(kbd "M-E") 'emmet-expand-line)))
|
||||
|
||||
(define-minor-mode jekyll-mode
|
||||
:init-value nil
|
||||
:lighter " :{"
|
||||
:keymap (make-sparse-keymap)
|
||||
(my--init-yas-mode 'jekyll-mode))
|
||||
(associate-minor-mode "/_\\(layouts\\|posts\\)/.+$" 'jekyll-mode)
|
||||
(add-hooks '(web-mode-hook scss-mode-hook html-mode-hook markdown-mode markdown-mode-hook)
|
||||
(lambda ()
|
||||
(when (project-has-files "_config.yml" "_layouts")
|
||||
(jekyll-mode 1))))
|
||||
|
||||
|
||||
(provide 'init-web)
|
||||
;;; init-web.el ends here
|
||||
|
@@ -52,10 +52,9 @@
|
||||
;; create a new workgroup for the new project.
|
||||
(after "projectile"
|
||||
(defun my-projectile-workgroup-switch-project ()
|
||||
(let ((workgroup-name (file-name-nondirectory (directory-file-name (my--project-root)))))
|
||||
(let ((workgroup-name (file-name-nondirectory (directory-file-name (project-root)))))
|
||||
(wg-create-workgroup workgroup-name t)
|
||||
(helm-projectile-find-file)))
|
||||
|
||||
(setq projectile-switch-project-action 'my-projectile-workgroup-switch-project))
|
||||
|
||||
(workgroups-mode 1)))
|
||||
|
@@ -14,7 +14,6 @@
|
||||
(add-hook 'snippet-mode-hook 'yas-minor-mode)
|
||||
(add-hook 'text-mode-hook 'yas-minor-mode)
|
||||
(add-hook 'prog-mode-hook 'yas-minor-mode)
|
||||
(add-hook 'emacs-lisp-mode-hook 'yas-minor-mode)
|
||||
;; (add-hook 'markdown-mode-hook 'yas-minor-mode)
|
||||
(add-hook 'org-mode-hook 'yas-minor-mode))
|
||||
:config
|
||||
@@ -145,13 +144,21 @@
|
||||
(when (and field (> (point) sof))
|
||||
(delete-region sof (point)))))
|
||||
|
||||
(defun my--init-yas-mode (&rest modes)
|
||||
;; Yasnippet 0.8.1+
|
||||
(when (boundp 'yas-extra-modes)
|
||||
(if (symbol-value mode)
|
||||
(dolist (mode modes)
|
||||
(yas-activate-extra-mode mode))
|
||||
(setq yas-extra-modes (delq mode yas-extra-modes)))))
|
||||
|
||||
;; keybinds
|
||||
(bind yas-keymap
|
||||
"C-e" 'my/yas-goto-end-of-field
|
||||
"C-a" 'my/yas-goto-start-of-field
|
||||
"<M-right>" 'my/yas-goto-end-of-field
|
||||
"<M-left>" 'my/yas-goto-start-of-field
|
||||
"<S-tab>" 'yas-prev-field
|
||||
"C-e" 'my/yas-goto-end-of-field
|
||||
"C-a" 'my/yas-goto-start-of-field
|
||||
"<M-right>" 'my/yas-goto-end-of-field
|
||||
"<M-left>" 'my/yas-goto-start-of-field
|
||||
"<S-tab>" 'yas-prev-field
|
||||
"<M-backspace>" 'my/yas-clear-to-sof
|
||||
|
||||
[backspace] 'my/yas-backspace
|
||||
|
@@ -44,41 +44,45 @@
|
||||
"M" 'helm-projectile-recentf ; recent PROJECT files
|
||||
"]" 'helm-etags-select
|
||||
"a" 'helm-projectile-find-other-file
|
||||
"b" 'my:build
|
||||
"e" 'ido-find-file
|
||||
"g" 'git-gutter+-show-hunk
|
||||
"h" 'helm-apropos
|
||||
"m" 'helm-recentf
|
||||
"p" 'helm-projectile-switch-project
|
||||
"y" 'helm-show-kill-ring
|
||||
"r" 'emr-show-refactor-menu) ; init-dev.el
|
||||
"qq" 'evil-save-and-quit
|
||||
"QQ" 'evil-quit-all
|
||||
"r" 'emr-show-refactor-menu ; init-dev.el
|
||||
"y" 'helm-show-kill-ring)
|
||||
|
||||
;; <localleader>
|
||||
(bind my-localleader-map
|
||||
"\\" 'neotree-toggle
|
||||
";" 'linum-mode
|
||||
"=" 'toggle-transparency
|
||||
"E" 'evil-emacs-state
|
||||
"\\" 'neotree-toggle
|
||||
";" 'linum-mode
|
||||
"=" 'toggle-transparency
|
||||
"E" 'evil-emacs-state
|
||||
|
||||
"of" (λ (my-send-dir-to-finder default-directory))
|
||||
"oF" 'my-send-dir-to-finder
|
||||
"ou" (λ (my-send-to-transmit buffer-file-name))
|
||||
"oU" 'my-send-to-transmit
|
||||
"ol" (λ (my-send-to-launchbar buffer-file-name))
|
||||
"oL" 'my-send-to-launchbar
|
||||
"oo" 'my-open-with
|
||||
"of" (λ (my-open-with "Finder" default-directory))
|
||||
"oF" (λ (my-open-with "Finder" (project-root)))
|
||||
"ou" (λ (my-open-with "Transmit"))
|
||||
"oU" (λ (my-open-with "Transmit" default-directory))
|
||||
"ol" (λ (my-open-with "LaunchBar"))
|
||||
"oL" (λ (my-open-with "LaunchBar" default-directory))
|
||||
|
||||
;; tmux: cd (default-directory)
|
||||
"ot" (λ (my:tmux-chdir nil t))
|
||||
;; tmux: cd [project root]
|
||||
"oT" 'my:tmux-chdir
|
||||
|
||||
"]" 'next-buffer
|
||||
"[" 'previous-buffer
|
||||
"]" 'next-buffer
|
||||
"[" 'previous-buffer
|
||||
|
||||
"g" 'git-gutter+-show-hunk
|
||||
"e" (λ (flycheck-buffer) (flycheck-list-errors))
|
||||
"p" 'helm-show-kill-ring
|
||||
"b" 'helm-projectile-switch-to-buffer
|
||||
"w" 'helm-wg)
|
||||
"g" 'git-gutter+-show-hunk
|
||||
"e" (λ (flycheck-buffer) (flycheck-list-errors))
|
||||
"p" 'helm-show-kill-ring
|
||||
"b" 'helm-projectile-switch-to-buffer
|
||||
"w" 'helm-wg)
|
||||
|
||||
|
||||
(bind 'normal
|
||||
@@ -87,10 +91,10 @@
|
||||
|
||||
;; behave like D and C; yank to end of line
|
||||
"Y" (λ (evil-yank (point) (point-at-eol)))
|
||||
"zx" 'kill-this-buffer
|
||||
"zx" 'my-kill-real-buffer
|
||||
"ZX" 'bury-buffer
|
||||
"]b" 'next-buffer
|
||||
"[b" 'previous-buffer
|
||||
"]b" 'my-next-real-buffer
|
||||
"[b" 'my-previous-real-buffer
|
||||
"]w" 'wg-switch-to-workgroup-right
|
||||
"[w" 'wg-switch-to-workgroup-left
|
||||
|
||||
@@ -117,8 +121,8 @@
|
||||
"]g" 'git-gutter+-next-hunk
|
||||
"[g" 'git-gutter+-previous-hunk
|
||||
|
||||
"]e" 'next-error
|
||||
"[e" 'previous-error
|
||||
"]e" (λ (call-interactively (if flycheck-mode 'flycheck-next-error 'next-error)))
|
||||
"[e" (λ (call-interactively (if flycheck-mode 'flycheck-previous-error 'previous-error)))
|
||||
|
||||
"]\\" 'er/expand-region
|
||||
"[\\" 'er/contract-region
|
||||
@@ -169,6 +173,38 @@
|
||||
"]]" 'help-go-forward
|
||||
"[[" 'help-go-back))
|
||||
|
||||
(bind '(insert normal)
|
||||
;; Textmate-esque insert-line before/after
|
||||
(kbd "<M-return>") 'evil-open-below
|
||||
(kbd "<S-M-return>") 'evil-open-above)
|
||||
|
||||
(when is-mac
|
||||
;; Restore text nav keys
|
||||
(bind (kbd "<A-left>") 'backward-word
|
||||
(kbd "<A-right>") 'forward-word
|
||||
(kbd "<M-backspace>") 'my.backward-kill-to-bol-and-indent
|
||||
(kbd "M-a") 'mark-whole-buffer
|
||||
(kbd "M-c") 'evil-yank
|
||||
(kbd "M-v") 'evil-paste-after
|
||||
(kbd "M-s") 'save-buffer))
|
||||
|
||||
;; Fix osx keymappings and then some
|
||||
(use-package smart-forward
|
||||
:config
|
||||
(bind 'insert
|
||||
"<M-left>" 'my.move-to-bol
|
||||
"<M-right>" 'my.move-to-eol
|
||||
"<M-up>" 'beginning-of-buffer
|
||||
"<M-down>" 'end-of-buffer
|
||||
"<A-up>" 'smart-up
|
||||
"<A-down>" 'smart-down))
|
||||
|
||||
;; Line selection via linum
|
||||
(bind "<left-margin> <down-mouse-1>" 'my-select-linum
|
||||
"<left-margin> <mouse-1>" 'my-select-linum
|
||||
"<left-margin> <drag-mouse-1>" 'my-select-linum
|
||||
"<left-margin> <double-mouse-1>" 'my-select-block)
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Keymap fixes ;;
|
||||
@@ -205,32 +241,18 @@
|
||||
;; Fixes delete
|
||||
(kbd "<kp-delete>") 'delete-char)
|
||||
|
||||
(bind '(insert normal)
|
||||
;; Textmate-esque insert-line before/after
|
||||
(kbd "<M-return>") 'evil-open-below
|
||||
(kbd "<S-M-return>") 'evil-open-above)
|
||||
;; Make ESC quit all the things
|
||||
(dolist (map (list minibuffer-local-map
|
||||
minibuffer-local-ns-map
|
||||
minibuffer-local-completion-map
|
||||
minibuffer-local-must-match-map
|
||||
minibuffer-local-isearch-map))
|
||||
(bind map "<escape>" 'keyboard-escape-quit))
|
||||
|
||||
(when is-mac
|
||||
;; Restore text nav keys
|
||||
(bind (kbd "<A-left>") 'backward-word
|
||||
(kbd "<A-right>") 'forward-word
|
||||
(kbd "<M-backspace>") 'my.backward-kill-to-bol-and-indent
|
||||
(kbd "M-a") 'mark-whole-buffer
|
||||
(kbd "M-c") 'evil-yank
|
||||
(kbd "M-v") 'evil-paste-after
|
||||
(kbd "M-s") 'save-buffer))
|
||||
|
||||
;; Fix osx keymappings and then some
|
||||
(use-package smart-forward
|
||||
:config
|
||||
(bind 'insert
|
||||
"<M-left>" 'my.move-to-bol
|
||||
"<M-right>" 'my.move-to-eol
|
||||
"<M-up>" 'beginning-of-buffer
|
||||
"<M-down>" 'end-of-buffer
|
||||
"<A-up>" 'smart-up
|
||||
"<A-down>" 'smart-down))
|
||||
(dolist (map (list evil-ex-search-keymap minibuffer-local-map))
|
||||
(bind map "\C-w" 'evil-delete-backward-word))
|
||||
|
||||
(global-unset-key (kbd "<drag-mouse-1>"))
|
||||
|
||||
(provide 'my-bindings)
|
||||
;;; my-bindings.el ends here
|
||||
|
@@ -1,21 +1,24 @@
|
||||
(defalias 'exmap 'evil-ex-define-cmd)
|
||||
|
||||
(exmap "full[scr]" 'toggle-frame-fullscreen)
|
||||
(exmap "l[ast]" 'popwin:popup-last-buffer)
|
||||
(exmap "m[sg]" 'popwin:messages)
|
||||
|
||||
(exmap "full[scr]" 'toggle-fullscreen)
|
||||
(exmap "ini" 'my:init-files)
|
||||
(exmap "n[otes]" 'my:notes)
|
||||
(exmap "recompile" 'my:byte-compile)
|
||||
(exmap "cd" 'my:cd)
|
||||
(exmap "en[ew]" 'my:create-file)
|
||||
(exmap "ren[ame]" 'my:rename-this-file) ; Rename file . Bang: Delete old one
|
||||
(exmap "ren[ame]" 'my:rename-this-file) ; rename [NEWNAME] # rename file
|
||||
(exmap "al[ign]" 'my:align)
|
||||
(exmap "retab" 'my:retab)
|
||||
(exmap "sq[uint]" 'my:narrow-indirect) ; Narrow buffer to selection
|
||||
(exmap "x" 'my:scratch-buffer)
|
||||
|
||||
(exmap "k[ill]" 'kill-this-buffer) ; Kill current buffer
|
||||
(exmap "k[ill]o" 'my-cleanup-buffers) ; Kill current project buffers
|
||||
(exmap "k[ill]all" 'my:kill-buffers) ; Kill all buffers (bang = project buffers only)
|
||||
(exmap "k[ill]buried" 'my:kill-buried-buffers) ; Kill all buffers (bang = project buffers only)
|
||||
(exmap "k[ill]" 'kill-this-buffer) ; Kill current buffer
|
||||
(exmap "k[ill]o" 'my-cleanup-buffers) ; Kill current project buffers
|
||||
(exmap "k[ill]all" 'my:kill-buffers) ; Kill all buffers (bang = project buffers only)
|
||||
(exmap "k[ill]buried" 'my:kill-buried-buffers) ; Kill all buffers (bang = project buffers only)
|
||||
|
||||
(exmap "ma[ke]" 'my:build)
|
||||
|
||||
|
@@ -1,11 +1,4 @@
|
||||
|
||||
(defmacro -defreplace (name search replace)
|
||||
`(evil-define-operator ,(make-symbol (concat "replace:" (symbol-name name))) (beg end)
|
||||
:type inclusive
|
||||
:repeat nil
|
||||
(interactive "<r>")
|
||||
(replace-regexp ,search ,replace t beg end)))
|
||||
|
||||
;;;; HTML ;;;;
|
||||
;; Replace smart quotes and other MS Word verbiage into plain text
|
||||
(defun replace:plain-textify (beg end)
|
||||
|
@@ -42,14 +42,6 @@
|
||||
(kbd "<backspace>") 'ido-delete-backward-updir
|
||||
"\C-w" 'ido-delete-backward-word-updir))
|
||||
|
||||
;; Make ESC quit all the things
|
||||
;; (bind minibuffer-inactive-mode-map [escape] (λ (other-window 1)))
|
||||
(dolist (map (list minibuffer-local-map
|
||||
minibuffer-local-ns-map
|
||||
minibuffer-local-completion-map
|
||||
minibuffer-local-must-match-map
|
||||
minibuffer-local-isearch-map))
|
||||
(bind map [escape] 'my--minibuffer-quit))
|
||||
(bind 'emacs [escape] 'my--minibuffer-quit)
|
||||
(bind 'normal evil-command-window-mode-map [escape] 'kill-buffer-and-window)
|
||||
;; (bind evil-ex-map [escape] 'my--minibuffer-quit)
|
||||
@@ -61,27 +53,23 @@
|
||||
"\C-u" 'evil-delete-whole-line)
|
||||
|
||||
;; Redefine to get rid of that silly delete-other-windows nonsense
|
||||
(defun keyboard-escape-quit ()
|
||||
(interactive)
|
||||
(cond ((eq last-command 'mode-exited) nil)
|
||||
((region-active-p)
|
||||
(deactivate-mark))
|
||||
((> (minibuffer-depth) 0)
|
||||
(abort-recursive-edit))
|
||||
(current-prefix-arg
|
||||
nil)
|
||||
((> (recursion-depth) 0)
|
||||
(exit-recursive-edit))
|
||||
(buffer-quit-function
|
||||
(funcall buffer-quit-function))
|
||||
((string-match "^ \\*" (buffer-name (current-buffer)))
|
||||
(bury-buffer))))
|
||||
;; (defun keyboard-escape-quit ()
|
||||
;; (interactive)
|
||||
;; (cond ((eq last-command 'mode-exited) nil)
|
||||
;; ((region-active-p)
|
||||
;; (deactivate-mark))
|
||||
;; ((> (minibuffer-depth) 0)
|
||||
;; (abort-recursive-edit))
|
||||
;; (current-prefix-arg
|
||||
;; nil)
|
||||
;; ((> (recursion-depth) 0)
|
||||
;; (exit-recursive-edit))
|
||||
;; (buffer-quit-function
|
||||
;; (funcall buffer-quit-function))
|
||||
;; ((string-match "^ \\*" (buffer-name (current-buffer)))
|
||||
;; (bury-buffer))))
|
||||
|
||||
(defun my-emacs-is-not-kill ()
|
||||
(interactive)
|
||||
(message "Gee, I dunno Brain..."))
|
||||
|
||||
(if is-mac (global-set-key (kbd "M-q") 'my-emacs-is-not-kill))
|
||||
(if is-mac (global-set-key (kbd "M-q") (λ (message "Gee, I dunno Brain..."))))
|
||||
|
||||
|
||||
(provide 'my-settings)
|
||||
|
Reference in New Issue
Block a user