From b0a46def2bd0acdacbbd291c194daa769df5124c Mon Sep 17 00:00:00 2001 From: Jean-Philippe Bernardy Date: Sat, 10 Sep 2016 20:06:06 +0200 Subject: [PATCH] remove helm support This was tangential at best and not still maturing. --- README.md | 3 +-- boon-colemak.el | 56 +----------------------------------------------- boon-keys.el | 53 --------------------------------------------- boon-moves.el | 2 +- boon-qwerty.el | 15 +------------ boon-tutorial.el | 41 ----------------------------------- boon-workman.el | 43 +------------------------------------ cheat-sheet.hs | 12 +++++------ todo.org | 45 +++++++++++++++++++++++++++++++++++++- 9 files changed, 55 insertions(+), 215 deletions(-) diff --git a/README.md b/README.md index beb0dd2..a72f29c 100644 --- a/README.md +++ b/README.md @@ -84,8 +84,7 @@ structure of Boon is as follows: or not. A few commands also switch to insert mode. 5. boon-keys, boon-colemak, boon-qwerty, ...: frontends. Those require all the above and provide a mapping of - moves, selectors and commands onto keys. They may also bind keys - for other modes, such as helm. + moves, selectors and commands onto keys. Installation ------------ diff --git a/boon-colemak.el b/boon-colemak.el index 79c0f7f..95a5bd2 100644 --- a/boon-colemak.el +++ b/boon-colemak.el @@ -51,60 +51,6 @@ (define-key boon-moves-map "h" 'avy-goto-word-1) (define-key boon-moves-map "H" 'avy-goto-char) - -(with-eval-after-load 'ivy - (define-key ivy-minibuffer-map (kbd "RET") 'ivy-done) - (define-key ivy-minibuffer-map (kbd "") 'ivy-call) - ;; (define-key ivy-minibuffer-map (kbd "C-j") 'ivy-alt-done) - ;; (define-key ivy-minibuffer-map (kbd "C-M-j") 'ivy-immediate-done) - (define-key ivy-minibuffer-map (kbd "C-n") 'ivy-partial) - (define-key ivy-minibuffer-map (kbd "C-y") 'ivy-next-line) - (define-key ivy-minibuffer-map (kbd "C-u") 'ivy-previous-line) - (define-key ivy-minibuffer-map (kbd "") 'ivy-next-line) - (define-key ivy-minibuffer-map (kbd "") 'ivy-previous-line) - ;; (define-key ivy-minibuffer-map (kbd "C-s") 'ivy-next-line-or-history) - ;; (define-key ivy-minibuffer-map (kbd "C-r") 'ivy-reverse-i-search) - (define-key ivy-minibuffer-map (kbd "SPC") 'boon-completer-space) - (define-key ivy-minibuffer-map (kbd "DEL") 'ivy-backward-delete-char) - (define-key ivy-minibuffer-map (kbd "C-w") 'ivy-backward-kill-word) - (define-key ivy-minibuffer-map (kbd "C-d") 'ivy-delete-char) - (define-key ivy-minibuffer-map (kbd "C-f") 'ivy-forward-char) - ;; (define-key ivy-minibuffer-map (kbd "M-<") 'ivy-beginning-of-buffer) - ;; (define-key ivy-minibuffer-map (kbd "M->") 'ivy-end-of-buffer) - (define-key ivy-minibuffer-map (kbd "C-.") 'ivy-next-history-element) - (define-key ivy-minibuffer-map (kbd "C-,") 'ivy-previous-history-element) - (define-key ivy-minibuffer-map (kbd "") 'minibuffer-keyboard-quit) - ;; (define-key ivy-minibuffer-map (kbd "C-v") 'ivy-scroll-up-command) - ;; (define-key ivy-minibuffer-map (kbd "M-v") 'ivy-scroll-down-command) - ;; (define-key ivy-minibuffer-map (kbd "C-M-n") 'ivy-next-line-and-call) - ;; (define-key ivy-minibuffer-map (kbd "C-M-p") 'ivy-previous-line-and-call) - (define-key ivy-minibuffer-map (kbd "C-q") 'ivy-toggle-regexp-quote) - ;; (define-key ivy-minibuffer-map (kbd "M-j") 'ivy-yank-word) - (define-key ivy-minibuffer-map (kbd "C-v") 'ivy-insert-current) - (define-key ivy-minibuffer-map (kbd "TAB") 'ivy-partial) ;; for counsel-find-file - (define-key ivy-minibuffer-map (kbd "C-TAB") 'ivy-dispatching-call) - (define-key ivy-minibuffer-map (kbd "C-k") 'ivy-kill-line) - (define-key ivy-minibuffer-map (kbd "S-SPC") 'ivy-restrict-to-matches) - (define-key ivy-minibuffer-map (kbd "C-t") 'ivy-kill-ring-save) - ;; (define-key ivy-minibuffer-map (kbd "C-h") 'ivy-avy) - ;; (define-key ivy-minibuffer-map (kbd "C-M-a") 'ivy-read-action) - (define-key ivy-minibuffer-map (kbd "C-o") 'ivy-occur) - ) - -(with-eval-after-load 'helm - (define-helm-key (kbd "u") 'helm-previous-line) - (define-helm-key (kbd "y") 'helm-next-line) - (define-helm-key (kbd ",") 'helm-previous-page) - (define-helm-key (kbd ".") 'helm-next-page) - (define-helm-key (kbd "n") 'helm-execute-persistent-action) - (define-helm-key (kbd "e") 'helm-select-action) -) - - -(define-key isearch-mode-map [(control p)] 'helm-occur-from-isearch) -(define-key isearch-mode-map [(control w)] 'isearch-repeat-backward) -(define-key isearch-mode-map [(control f)] 'isearch-repeat-forward) - ;; Special keys ;; LEFT HAND @@ -141,7 +87,7 @@ ;; p ;; Pinpoint Place -(define-key boon-command-map "p" 'helm-occur) +(define-key boon-command-map "p" 'occur) ;; Misc crap (define-key boon-command-map "P" 'kmacro-end-or-call-macro) ; Play diff --git a/boon-keys.el b/boon-keys.el index 2ff0d81..40ce17f 100644 --- a/boon-keys.el +++ b/boon-keys.el @@ -54,59 +54,6 @@ (define-key minibuffer-local-must-match-map [escape] 'minibuffer-keyboard-quit) (define-key isearch-mode-map [escape] 'isearch-abort) -(defun boon-completer-space () - (interactive) - (if (= (minibuffer-prompt-end) (point)) - ;(string= "" (ivy--input)) - (progn (next-history-element 1) - ;; alt: ivy-next-history-element - (move-end-of-line 1)) - (self-insert-command 1))) - -;; Helm keys -(defun boon-helm-browse (action) - "Run the ACTION and set 'boon-helm-command-map' as transient keymap." - (lambda () - (interactive) - (call-interactively action) - (setq cursor-type 'box) - (set-transient-map boon-helm-command-map t (lambda () (setq cursor-type 'bar))))) - -(defun define-helm-key (key action) - "Bind C- in helm-map, and in boon-helm-command-map (both to ACTION)." - (define-key helm-map (vconcat (mapcar 'boon-god-control-swap key)) (boon-helm-browse action)) - (define-key boon-helm-command-map key action)) - -(defvar boon-helm-command-map (make-sparse-keymap)) -(suppress-keymap boon-helm-command-map 't) - -(with-eval-after-load 'helm - (define-key helm-map [(tab)] 'helm-select-action) - (define-key helm-map (kbd "C-z") 'undefined) - (define-key helm-map [(escape)] 'helm-keyboard-quit) - (define-key helm-map (kbd "SPC") 'boon-completer-space) - (define-key helm-map (kbd "M-SPC") 'helm-toggle-visible-mark) - (define-key helm-map (kbd "C-") 'helm-narrow-window) - (define-key helm-map (kbd "C-") 'helm-enlarge-window) - (define-key helm-map (kbd "C-") 'helm-execute-persistent-action) - (define-key helm-map [(shift backspace)] 'helm-unmark-all) - (define-helm-key (kbd "f") 'helm-follow-mode)) - -(define-key boon-goto-map "a" 'helm-apropos) -(define-key boon-goto-map "b" 'helm-buffers-list) -(define-key boon-goto-map "e" 'helm-projectile-ag) -(define-key boon-goto-map "f" 'helm-projectile-find-file) -(define-key boon-goto-map "g" 'helm-resume) -(define-key boon-goto-map "i" 'helm-git-grep) -(define-key boon-goto-map "k" 'helm-show-kill-ring) -(define-key boon-goto-map "l" 'goto-line) ;; no helm version of this -(define-key boon-goto-map "m" 'helm-all-mark-ring) -(define-key boon-goto-map "o" 'helm-multi-occur) -(define-key boon-goto-map "p" 'helm-projectile) -(define-key boon-goto-map "r" 'helm-register) -(define-key boon-goto-map "t" 'helm-etags-select) -(define-key boon-goto-map "y" 'helm-flycheck) - (defun boon-god-control-swap (event) "Swap the control 'bit' in EVENT, if that is a good choice." (interactive (list (read-key))) diff --git a/boon-moves.el b/boon-moves.el index 469b767..989f01c 100644 --- a/boon-moves.el +++ b/boon-moves.el @@ -24,7 +24,7 @@ Search preferentially for a function, then a variable." (cond ((fboundp symb) (find-function-do-it symb nil 'switch-to-buffer)) ((boundp symb) (find-function-do-it symb 'defvar 'switch-to-buffer)) - (t (call-interactively 'helm-apropos))))) + (t (error "Unknown symbol"))))) (defun boon-find-tag-at-point () "Find the symbol at point in the current tags table." diff --git a/boon-qwerty.el b/boon-qwerty.el index 822d567..f6ad307 100644 --- a/boon-qwerty.el +++ b/boon-qwerty.el @@ -49,19 +49,6 @@ (define-key boon-moves-map "H" 'avy-goto-char) -(eval-after-load 'helm - '(progn - (define-helm-key (kbd "i") 'helm-previous-line) - (define-helm-key (kbd "o") 'helm-next-line) - (define-helm-key (kbd ",") 'helm-previous-page) - (define-helm-key (kbd ".") 'helm-next-page) - )) - -;; top row -(define-key boon-helm-command-map (kbd "f") 'helm-follow-mode) -(define-key boon-helm-command-map (kbd "y") 'helm-next-line) -(define-key boon-helm-command-map (kbd "u") 'helm-previous-line) - ;; Special keys @@ -98,7 +85,7 @@ (define-key boon-moves-map "wu" 'mc/cycle-backward) ;; r -(define-key boon-command-map "p" 'helm-occur) ;; occuR +(define-key boon-command-map "p" 'occur) ;; occuR ;; Misc crap (define-key boon-command-map "P" 'kmacro-end-or-call-macro) ; Play diff --git a/boon-tutorial.el b/boon-tutorial.el index 1bbfa55..5327c13 100644 --- a/boon-tutorial.el +++ b/boon-tutorial.el @@ -419,47 +419,6 @@ Boon has special support for multiple cursors, which means that all commands described in this tutorial should work out of the box with multiple cursors. -* HELM -------- - -Helm is a very useful package. Boon provides special support for it. - ->> If you have not done it yet, install helm now: (package-install 'helm) - -The command '\\[helm-occur]' starts `helm-occur'; which does a quick search for all -occurrences of a pattern in the current buffer. - ->> Type '\\[helm-occur]' now - ->> Within the helm prompt area, type 'helm ' to jump to - the beginning of this section. - -You can search for the current symbol by typing SPC in an empty -helm mini-buffer. - ->> Move the cursor to an occurrence of the helm word, and type '\\[helm-occur] SPC'. - -\\ ->> Use C-\\[helm-previous-line] and C-\\[helm-next-line] to select an occurrence, then type to jump to - the currently selected occurrence - -Note: after typing \\\\[helm-previous-line], it -suffices to type \\\\[helm-previous-line] to perform -`helm-previous-line'. -The keys which do not require repeating the C- prefix are: -\\{boon-helm-command-map} -\\ - - -Besides `helm-occur', a few other helm commands are bound to keys starting with the same prefix: - -\\[helm-apropos] --> `helm-apropos' -\\[helm-resume] --> `helm-resume' -\\[helm-show-kill-ring] --> `helm-show-kill-ring' - -The full list of key bound to that prefix is: -\\{boon-goto-map} - * SPECIAL BUFFERS ----------------- diff --git a/boon-workman.el b/boon-workman.el index f760495..cab8c30 100644 --- a/boon-workman.el +++ b/boon-workman.el @@ -42,47 +42,6 @@ (define-key boon-moves-map (kbd "C-,") 'beginning-of-buffer) (define-key boon-moves-map (kbd "C-.") 'end-of-buffer) -(define-key boon-helm-command-map (kbd "q") 'helm-keyboard-quit) -(define-key boon-helm-command-map (kbd "r") 'helm-follow-mode) -(define-key boon-helm-command-map (kbd "w") 'previous-history-element) - -;; home row: yanking/killing -(define-key boon-helm-command-map (kbd "s") 'helm-yank-selection) -(define-key boon-helm-command-map (kbd "h") 'next-history-element) ;; has the effect of getting the whole symbol at point -(define-key boon-helm-command-map (kbd "t") 'helm-yank-text-at-point) -(define-key boon-helm-command-map (kbd "g") 'helm-delete-minibuffer-contents) - -;; bottom row: actions -(define-key boon-helm-command-map (kbd "z") 'helm-select-3rd-action) -(define-key boon-helm-command-map (kbd "x") 'helm-select-2nd-action) -(define-key boon-helm-command-map (kbd "m") 'boon-c-map) -(define-key boon-helm-command-map (kbd "c") 'boon-helm-set-insert-state) ;; for consistency -(define-key boon-helm-command-map (kbd "v") 'helm-execute-persistent-action) - -(define-key boon-helm-command-map (kbd "'") 'helm-toggle-all-marks) -(define-key boon-helm-command-map (kbd "K") 'helm-mark-all) -(define-key boon-helm-command-map (kbd "C-k") 'helm-unmark-all) ;; use K ' for this -(define-key boon-helm-command-map (kbd "k") 'helm-toggle-visible-mark) - -(define-key boon-helm-command-map (kbd "f") 'previous-history-element) -(define-key boon-helm-command-map (kbd ";") 'next-history-element) -(define-key boon-helm-command-map (kbd "p") 'helm-next-line) -(define-key boon-helm-command-map (kbd "u") 'helm-previous-line) -(define-key boon-helm-command-map (kbd "U") 'helm-previous-source) -(define-key boon-helm-command-map (kbd "P") 'helm-next-source) -(define-key boon-helm-command-map (kbd ",") 'helm-previous-page) -(define-key boon-helm-command-map (kbd ".") 'helm-next-page) -(define-key boon-helm-command-map (kbd "C-p") 'helm-scroll-other-window) -(define-key boon-helm-command-map (kbd "C-u") 'helm-scroll-other-window-down) -(define-key boon-helm-command-map (kbd ",") 'helm-prev-visible-mark) -(define-key boon-helm-command-map (kbd ".") 'helm-next-visible-mark) -(define-key boon-helm-command-map (kbd ">") 'helm-goto-next-file) -(define-key boon-helm-command-map (kbd "<") 'helm-goto-precedent-file) - -; TODO -(define-key isearch-mode-map [(control w)] 'helm-occur-from-isearch) -(define-key isearch-mode-map [(control d)] 'isearch-repeat-backward) -(define-key isearch-mode-map [(control r)] 'isearch-repeat-forward) ;; Special keys @@ -118,7 +77,7 @@ ;; p ;; Pinpoint Place -(define-key boon-command-map (kbd "w") 'helm-occur) +(define-key boon-command-map (kbd "w") 'occur) ;; Misc crap (define-key boon-command-map (kbd "W") 'kmacro-end-or-call-macro) ; Play diff --git a/cheat-sheet.hs b/cheat-sheet.hs index b712df3..33012f2 100644 --- a/cheat-sheet.hs +++ b/cheat-sheet.hs @@ -50,11 +50,11 @@ colemakCS = CS { ,["Hop", "⇠" , "←", "→", "⇢" , "'"] ,["bacK to marK", "", "↜", "↝", ""] ] - ,leftHandL = [[("escape",Char), ("search backward",SearchObject), ("search forward",SearchObject), ("helm-occur",None), ("helm-...",Prefix)] + ,leftHandL = [[("escape",Char), ("search backward",SearchObject), ("search forward",SearchObject), ("occur",None), ("goto-...",Prefix)] ,[("enclose",Bin Enclosure TextRegion), ("kill+insert", TextRegion), ("yank", None), ("kill", TextRegion), ("replace char", Char)] ,[reserved, ("C-x",Prefix), ("C-c C-...",Prefix), ("insert mode",None), ("yank register",Char)] ] - ,leftHandM = [["Quote", "backWard", "Forward", "Pinpoint", "Gather"] + ,leftHandM = [["Quote", "backWard", "Forward", "Pinpoint", "Goto"] ,["Around", "Replace", "Splice", "Take", "Displace"] ,["", "eXtended", "Command", "⋎ (insert mark)", "Bank"] ] @@ -88,8 +88,8 @@ qwertyCS = colemakCS { ,["h","j","k","l",";","'"] ,["n","m",",",".","/"," "]] - ,leftHandL = [[("escape",Char), ("search backward",SearchObject), ("search forward",SearchObject), ("helm-occur",None), ("replace char", Char)] - ,[("enclose",Bin Enclosure TextRegion), ("kill+insert", TextRegion), ("kill", TextRegion), ("yank", None), ("helm-...",Prefix)] + ,leftHandL = [[("escape",Char), ("search backward",SearchObject), ("search forward",SearchObject), ("occur",None), ("replace char", Char)] + ,[("enclose",Bin Enclosure TextRegion), ("kill+insert", TextRegion), ("kill", TextRegion), ("yank", None), ("goto-...",Prefix)] ,[reserved, ("C-x",Prefix), ("C-c C-...",Prefix), ("insert mode",None), ("yank register",Char)] ] ,leftHandU = [[reserved, ("re-search backward",None), ("re-search forward",None), ("Record macro", None), reserved] @@ -97,7 +97,7 @@ qwertyCS = colemakCS { ,[reserved, reserved, reserved, ("open line",None), ("copy register",Char)] ] ,leftHandM = [["Quote", "backWard", "Elsewhere?", "occurR", "Transform"] - ,["Around", "Substitute", "Delete", "Flush", "Gather"] + ,["Around", "Substitute", "Delete", "Flush", "Goto"] ,["", "eXtended", "Command", "⋎ (insert mark)", "Bank"] ] ,leftHandR = [[("quotes (string)",None), ("word",None), ("word",None), ("paragraph",None), reserved] @@ -106,7 +106,7 @@ qwertyCS = colemakCS { ] } -upKey c = case [c] of +upKey c = case [c] "'" -> head "\"" ";" -> ':' "," -> '<' diff --git a/todo.org b/todo.org index 466a14e..fd219e6 100644 --- a/todo.org +++ b/todo.org @@ -1,4 +1,47 @@ -* expunge helm from boon? +* Helm/Ivy/? + +Here is the section from the tutorial + HELM +------- + +Helm is a very useful package. Boon provides special support for it. + +>> If you have not done it yet, install helm now: (package-install 'helm) + +The command '\\[helm-occur]' starts `helm-occur'; which does a quick search for all +occurrences of a pattern in the current buffer. + +>> Type '\\[helm-occur]' now + +>> Within the helm prompt area, type 'helm ' to jump to + the beginning of this section. + +You can search for the current symbol by typing SPC in an empty +helm mini-buffer. + +>> Move the cursor to an occurrence of the helm word, and type '\\[helm-occur] SPC'. + +\\ +>> Use C-\\[helm-previous-line] and C-\\[helm-next-line] to select an occurrence, then type to jump to + the currently selected occurrence + +Note: after typing \\\\[helm-previous-line], it +suffices to type \\\\[helm-previous-line] to perform +`helm-previous-line'. +The keys which do not require repeating the C- prefix are: +\\{boon-helm-command-map} +\\ + + +Besides `helm-occur', a few other helm commands are bound to keys starting with the same prefix: + +\\[helm-apropos] --> `helm-apropos' +\\[helm-resume] --> `helm-resume' +\\[helm-show-kill-ring] --> `helm-show-kill-ring' + +The full list of key bound to that prefix is: +\\{boon-goto-map} + * explain what g and x maps are for * swap-region * Fully Support Fundamental buffers (see evil code?)