remove helm support

This was tangential at best and not still maturing.
This commit is contained in:
Jean-Philippe Bernardy 2016-09-10 20:06:06 +02:00
parent 8d944e30e7
commit b0a46def2b
9 changed files with 55 additions and 215 deletions

View file

@ -84,8 +84,7 @@ structure of Boon is as follows:
or not. A few commands also switch to insert mode. or not. A few commands also switch to insert mode.
5. boon-keys, boon-colemak, boon-qwerty, ...: 5. boon-keys, boon-colemak, boon-qwerty, ...:
frontends. Those require all the above and provide a mapping of frontends. Those require all the above and provide a mapping of
moves, selectors and commands onto keys. They may also bind keys moves, selectors and commands onto keys.
for other modes, such as helm.
Installation Installation
------------ ------------

View file

@ -51,60 +51,6 @@
(define-key boon-moves-map "h" 'avy-goto-word-1) (define-key boon-moves-map "h" 'avy-goto-word-1)
(define-key boon-moves-map "H" 'avy-goto-char) (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 "<C-return>") '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 "<down>") 'ivy-next-line)
(define-key ivy-minibuffer-map (kbd "<up>") '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 "<escape>") '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 ;; Special keys
;; LEFT HAND ;; LEFT HAND
@ -141,7 +87,7 @@
;; p ;; p
;; Pinpoint Place ;; Pinpoint Place
(define-key boon-command-map "p" 'helm-occur) (define-key boon-command-map "p" 'occur)
;; Misc crap ;; Misc crap
(define-key boon-command-map "P" 'kmacro-end-or-call-macro) ; Play (define-key boon-command-map "P" 'kmacro-end-or-call-macro) ; Play

View file

@ -54,59 +54,6 @@
(define-key minibuffer-local-must-match-map [escape] 'minibuffer-keyboard-quit) (define-key minibuffer-local-must-match-map [escape] 'minibuffer-keyboard-quit)
(define-key isearch-mode-map [escape] 'isearch-abort) (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-<KEY> in helm-map, and <KEY> 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-<down>") 'helm-narrow-window)
(define-key helm-map (kbd "C-<up>") 'helm-enlarge-window)
(define-key helm-map (kbd "C-<return>") '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) (defun boon-god-control-swap (event)
"Swap the control 'bit' in EVENT, if that is a good choice." "Swap the control 'bit' in EVENT, if that is a good choice."
(interactive (list (read-key))) (interactive (list (read-key)))

View file

@ -24,7 +24,7 @@ Search preferentially for a function, then a variable."
(cond (cond
((fboundp symb) (find-function-do-it symb nil 'switch-to-buffer)) ((fboundp symb) (find-function-do-it symb nil 'switch-to-buffer))
((boundp symb) (find-function-do-it symb 'defvar '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 () (defun boon-find-tag-at-point ()
"Find the symbol at point in the current tags table." "Find the symbol at point in the current tags table."

View file

@ -49,19 +49,6 @@
(define-key boon-moves-map "H" 'avy-goto-char) (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 ;; Special keys
@ -98,7 +85,7 @@
(define-key boon-moves-map "wu" 'mc/cycle-backward) (define-key boon-moves-map "wu" 'mc/cycle-backward)
;; r ;; r
(define-key boon-command-map "p" 'helm-occur) ;; occuR (define-key boon-command-map "p" 'occur) ;; occuR
;; Misc crap ;; Misc crap
(define-key boon-command-map "P" 'kmacro-end-or-call-macro) ; Play (define-key boon-command-map "P" 'kmacro-end-or-call-macro) ; Play

View file

@ -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 commands described in this tutorial should work out of the box with multiple
cursors. 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 <return>' 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'.
\\<boon-helm-command-map>
>> Use C-\\[helm-previous-line] and C-\\[helm-next-line] to select an occurrence, then type <return> to jump to
the currently selected occurrence
Note: after typing \\<helm-map>\\[helm-previous-line], it
suffices to type \\<helm-map>\\[helm-previous-line] to perform
`helm-previous-line'.
The keys which do not require repeating the C- prefix are:
\\{boon-helm-command-map}
\\<boon-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 * SPECIAL BUFFERS
----------------- -----------------

View file

@ -42,47 +42,6 @@
(define-key boon-moves-map (kbd "C-,") 'beginning-of-buffer) (define-key boon-moves-map (kbd "C-,") 'beginning-of-buffer)
(define-key boon-moves-map (kbd "C-.") 'end-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 ;; Special keys
@ -118,7 +77,7 @@
;; p ;; p
;; Pinpoint Place ;; Pinpoint Place
(define-key boon-command-map (kbd "w") 'helm-occur) (define-key boon-command-map (kbd "w") 'occur)
;; Misc crap ;; Misc crap
(define-key boon-command-map (kbd "W") 'kmacro-end-or-call-macro) ; Play (define-key boon-command-map (kbd "W") 'kmacro-end-or-call-macro) ; Play

View file

@ -50,11 +50,11 @@ colemakCS = CS {
,["Hop", "" , "", "", "" , "'"] ,["Hop", "" , "", "", "" , "'"]
,["bacK to marK", "", "", "", ""] ,["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)] ,[("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)] ,[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"] ,["Around", "Replace", "Splice", "Take", "Displace"]
,["", "eXtended", "Command", "⋎ (insert mark)", "Bank"] ,["", "eXtended", "Command", "⋎ (insert mark)", "Bank"]
] ]
@ -88,8 +88,8 @@ qwertyCS = colemakCS {
,["h","j","k","l",";","'"] ,["h","j","k","l",";","'"]
,["n","m",",",".","/"," "]] ,["n","m",",",".","/"," "]]
,leftHandL = [[("escape",Char), ("search backward",SearchObject), ("search forward",SearchObject), ("helm-occur",None), ("replace char", Char)] ,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), ("helm-...",Prefix)] ,[("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)] ,[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] ,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)] ,[reserved, reserved, reserved, ("open line",None), ("copy register",Char)]
] ]
,leftHandM = [["Quote", "backWard", "Elsewhere?", "occurR", "Transform"] ,leftHandM = [["Quote", "backWard", "Elsewhere?", "occurR", "Transform"]
,["Around", "Substitute", "Delete", "Flush", "Gather"] ,["Around", "Substitute", "Delete", "Flush", "Goto"]
,["", "eXtended", "Command", "⋎ (insert mark)", "Bank"] ,["", "eXtended", "Command", "⋎ (insert mark)", "Bank"]
] ]
,leftHandR = [[("quotes (string)",None), ("word",None), ("word",None), ("paragraph",None), reserved] ,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 "\"" "'" -> head "\""
";" -> ':' ";" -> ':'
"," -> '<' "," -> '<'

View file

@ -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 <return>' 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'.
\\<boon-helm-command-map>
>> Use C-\\[helm-previous-line] and C-\\[helm-next-line] to select an occurrence, then type <return> to jump to
the currently selected occurrence
Note: after typing \\<helm-map>\\[helm-previous-line], it
suffices to type \\<helm-map>\\[helm-previous-line] to perform
`helm-previous-line'.
The keys which do not require repeating the C- prefix are:
\\{boon-helm-command-map}
\\<boon-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 * explain what g and x maps are for
* swap-region * swap-region
* Fully Support Fundamental buffers (see evil code?) * Fully Support Fundamental buffers (see evil code?)