diff --git a/CHANGELOG.md b/CHANGELOG.md index b47e8bb..5382dbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,8 @@ * [Ruby] Don't auto-insert coding comments. * Hide (via `diminish`) `editorconfig-mode`, `super-save`, `company`, `abbrev` and `ivy` in the modeline. * Use `lsp-workspace-restart` function instead of deprecated `lsp-restart-workspace`. +* Bind all online search commands under `C-c C-/` to avoid a conflict with `counsel-git` or `magit-file-dispatch`. +* Bound `magit-file-mode` to `C-c g` (it's also bound to `C-c M-g` if you decide to utilize this keybinding for something else. ### Bugs fixed diff --git a/core/prelude-core.el b/core/prelude-core.el index fa022f3..d9cb5b7 100644 --- a/core/prelude-core.el +++ b/core/prelude-core.el @@ -77,10 +77,10 @@ PROMPT sets the `read-string prompt." "Press to run grep on a project." "Press to switch between projects." "Press to expand the selected region." - "Press to search in Google." - "Press to search in GitHub." - "Press to search in YouTube." - "Press to search in DuckDuckGo." + "Press to search in Google." + "Press to search in GitHub." + "Press to search in YouTube." + "Press to search in DuckDuckGo." "Press to rename the current buffer and the file it's visiting if any." "Press to open a terminal in Emacs." "Press to kill all the buffers, but the active one." diff --git a/core/prelude-global-keybindings.el b/core/prelude-global-keybindings.el index b03d015..7116b3d 100644 --- a/core/prelude-global-keybindings.el +++ b/core/prelude-global-keybindings.el @@ -95,8 +95,9 @@ ;; toggle menu-bar visibility (global-set-key (kbd "") 'menu-bar-mode) -(global-set-key (kbd "C-x g") 'magit-status) -(global-set-key (kbd "C-x M-g") 'magit-dispatch) +;; Magit creates some global keybindings by default +;; but it's a nice to complement them with this one +(global-set-key (kbd "C-c g") 'magit-file-dispatch) (global-set-key (kbd "C-=") 'er/expand-region) diff --git a/core/prelude-mode.el b/core/prelude-mode.el index edf4040..5fb8c16 100644 --- a/core/prelude-mode.el +++ b/core/prelude-mode.el @@ -36,10 +36,10 @@ (defvar prelude-mode-map (let ((map (make-sparse-keymap))) (define-key map (kbd "C-c o") 'crux-open-with) - (define-key map (kbd "C-c g") 'prelude-google) - (define-key map (kbd "C-c G") 'prelude-github) - (define-key map (kbd "C-c y") 'prelude-youtube) - (define-key map (kbd "C-c U") 'prelude-duckduckgo) + (define-key map (kbd "C-c C-/ g") 'prelude-google) + (define-key map (kbd "C-c C-/ h") 'prelude-github) + (define-key map (kbd "C-c C-/ y") 'prelude-youtube) + (define-key map (kbd "C-c C-/ d") 'prelude-duckduckgo) ;; mimic popular IDEs binding, note that it doesn't work in a terminal session (define-key map (kbd "C-a") 'crux-move-beginning-of-line) (define-key map [(shift return)] 'crux-smart-open-line) @@ -78,8 +78,9 @@ (define-key map (kbd "s-o") 'crux-smart-open-line-above) ;; magit (define-key map (kbd "s-m m") 'magit-status) - (define-key map (kbd "s-m l") 'magit-log) - (define-key map (kbd "s-m f") 'magit-log-buffer-file) + (define-key map (kbd "s-m j") 'magit-dispatch) + (define-key map (kbd "s-m k") 'magit-file-dispatch) + (define-key map (kbd "s-m l") 'magit-log-buffer-file) (define-key map (kbd "s-m b") 'magit-blame) ;; misc (define-key map (kbd "s-/") 'hippie-expand)) diff --git a/doc/prelude-cheatsheet.tex b/doc/prelude-cheatsheet.tex index 904719a..d012544 100644 --- a/doc/prelude-cheatsheet.tex +++ b/doc/prelude-cheatsheet.tex @@ -77,6 +77,7 @@ \item[] menu-bar-mode \item[C-x g] magit-status \item[C-x M-g] magit-dispatch + \item[C-c g] magit-file-dispatch \end{keylist} \subsection{prelude} @@ -84,10 +85,10 @@ \humanreadable{Keybindings defined in prelude mode} \begin{keylist} \item[C-c o] crux-open-with - \item[C-c g] prelude-google - \item[C-c G] prelude-github - \item[C-c y] prelude-youtube - \item[C-c U] prelude-duckduckgo + \item[C-c C-/ g] prelude-google + \item[C-c C-/ h] prelude-github + \item[C-c C-/ y] prelude-youtube + \item[C-c C-/ d] prelude-duckduckgo \item[C-a] crux-move-beginning-of-line \item[S-] crux-smart-open-line \item[M-o] crux-smart-open-line diff --git a/doc/usage.md b/doc/usage.md index 2613cdb..fec3a05 100644 --- a/doc/usage.md +++ b/doc/usage.md @@ -72,6 +72,7 @@ Keybinding | Description F12 | Toggle the Emacs menu bar. C-x g | Open Magit's status buffer. C-x M-g | Open Magit's popup of popups. +C-c g | Open Magit's file-related commands. M-Z | Zap up to char. C-= | Run `expand-region` (incremental text selection). C-a | Run `crux-move-beginning-of-line`. Read [this](http://emacsredux.com/blog/2013/05/22/smarter-navigation-to-the-beginning-of-a-line/) for details. diff --git a/modules/prelude-ivy.el b/modules/prelude-ivy.el index 826deb8..f49a696 100644 --- a/modules/prelude-ivy.el +++ b/modules/prelude-ivy.el @@ -71,7 +71,7 @@ (global-set-key (kbd " l") 'counsel-find-library) (global-set-key (kbd " i") 'counsel-info-lookup-symbol) (global-set-key (kbd " u") 'counsel-unicode-char) -(global-set-key (kbd "C-c g") 'counsel-git) +(global-set-key (kbd "C-c g") 'counsel-git) ; will override the keybinding for `magit-file-dispatch' (global-set-key (kbd "C-c j") 'counsel-git-grep) (global-set-key (kbd "C-c a") 'counsel-ag) (global-set-key (kbd "C-x l") 'counsel-locate)