New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hydra template #88

Closed
novoid opened this Issue Jul 1, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@novoid

novoid commented Jul 1, 2018

Hi,

I'd love to see a section in the README where users may copy a hydra for eyebrowse with the main functionality (e.g., functions that have a default key binding).

To circumvent my personal sparse space problem in the modeline, I'd love to see the eyebrowse-mode-line-indicator in that hydra as well ;-)

Therefore, it should look like that:

1:orgmode, 2, 3:python, 4:dired, 5:misc

_p_revious window config         _0_ switch to window config
_n_next window config     	 _1_ switch to window config
_l_ast window config     	 ...                        
_r_ename current window config   _9_ switch to window config  
_c_reate new window config         
_C_lose current window config      

I can help with the bottom section but I don't know how to get the list of current configs. I guess that this should provide the necessary functionality somehow.

(defhydra hydra-eyebrowse (:color red)
  "
  ^
  1:orgmode, 2, 3:python, 4:dired, 5:misc  <- FIXXME: needs to be replaced with the dynamic string
  
  _p_revious window config         _0_ switch to window config
  _n_next window config            _1_ switch to window config
  _l_ast window config     	   ...                        
  _r_ename current window config   _9_ switch to window config  
  _c_reate new window config         
  _C_lose current window config      
  ^^
  "
  ("q" nil "quit")
  ("p" eyebrowse-prev-window-config nil)
  ("n" eyebrowse-next-window-config nil)
  ("l" eyebrowse-last-window-config nil)
  ("r" eyebrowse-rename-window-config nil)
  ("c" eyebrowse-create-window-config nil)
  ("C" eyebrowse-close-window-config nil)
  ("0" eyebrowse-switch-to-window-config-0 nil)
  ("1" eyebrowse-switch-to-window-config-1 nil)
  ("2" eyebrowse-switch-to-window-config-2 nil)
  ("3" eyebrowse-switch-to-window-config-3 nil)
  ("4" eyebrowse-switch-to-window-config-4 nil)
  ("5" eyebrowse-switch-to-window-config-5 nil)
  ("6" eyebrowse-switch-to-window-config-6 nil)
  ("7" eyebrowse-switch-to-window-config-7 nil)
  ("8" eyebrowse-switch-to-window-config-8 nil)
  ("9" eyebrowse-switch-to-window-config-9 nil)
)

Thanks for your awesome work!

@wasamasa

This comment has been minimized.

Show comment
Hide comment
@wasamasa

wasamasa Jul 5, 2018

Owner

I don't see the point honestly. If you managed making such a thing and believe others are interested, share it elsewhere. The list of configs lives in the current frame and is retrieved with (eyebrowse--get 'window-configs).

Owner

wasamasa commented Jul 5, 2018

I don't see the point honestly. If you managed making such a thing and believe others are interested, share it elsewhere. The list of configs lives in the current frame and is retrieved with (eyebrowse--get 'window-configs).

@wasamasa wasamasa closed this Jul 5, 2018

@novoid

This comment has been minimized.

Show comment
Hide comment
@novoid

novoid Jul 13, 2018

Hi,

I found out how to re-use the list of configs via eyebrowse-mode-line-indicator() that returns the current modeline indicator in a formatted way. This works for me as long as I did not find out how to generate the "numbers-only" modeline I was referring to in #89.

Here is my current hydra for anybody interested:

(defhydra hydra-eyebrowse (:color red)
  "
  ^
  %s(eyebrowse-mode-line-indicator)  

  _,_ left window config            _0_ switch to window config
  _._ right window config           _1_ switch to window config
  ↦ previous window config  ^^        ...                        
  _r_ename current window config    _9_ switch to window config  
  _c_reate new window config         
  _C_lose current window config      
  ^^
  "
  ("q" nil "quit")
  ("," eyebrowse-prev-window-config nil)
  ("." eyebrowse-next-window-config nil)
  ("<tab>" eyebrowse-last-window-config nil)
  ("r" eyebrowse-rename-window-config nil)
  ("c" eyebrowse-create-window-config nil)
  ("C" eyebrowse-close-window-config nil)
  ("0" eyebrowse-switch-to-window-config-0 nil)
  ("1" eyebrowse-switch-to-window-config-1 nil)
  ("2" eyebrowse-switch-to-window-config-2 nil)
  ("3" eyebrowse-switch-to-window-config-3 nil)
  ("4" eyebrowse-switch-to-window-config-4 nil)
  ("5" eyebrowse-switch-to-window-config-5 nil)
  ("6" eyebrowse-switch-to-window-config-6 nil)
  ("7" eyebrowse-switch-to-window-config-7 nil)
  ("8" eyebrowse-switch-to-window-config-8 nil)
  ("9" eyebrowse-switch-to-window-config-9 nil)
)

(define-key global-map [(f8)] 'hydra-eyebrowse/body) ;; I personally do use my own map: http://karl-voit.at/2018/07/08/emacs-key-bindings

novoid commented Jul 13, 2018

Hi,

I found out how to re-use the list of configs via eyebrowse-mode-line-indicator() that returns the current modeline indicator in a formatted way. This works for me as long as I did not find out how to generate the "numbers-only" modeline I was referring to in #89.

Here is my current hydra for anybody interested:

(defhydra hydra-eyebrowse (:color red)
  "
  ^
  %s(eyebrowse-mode-line-indicator)  

  _,_ left window config            _0_ switch to window config
  _._ right window config           _1_ switch to window config
  ↦ previous window config  ^^        ...                        
  _r_ename current window config    _9_ switch to window config  
  _c_reate new window config         
  _C_lose current window config      
  ^^
  "
  ("q" nil "quit")
  ("," eyebrowse-prev-window-config nil)
  ("." eyebrowse-next-window-config nil)
  ("<tab>" eyebrowse-last-window-config nil)
  ("r" eyebrowse-rename-window-config nil)
  ("c" eyebrowse-create-window-config nil)
  ("C" eyebrowse-close-window-config nil)
  ("0" eyebrowse-switch-to-window-config-0 nil)
  ("1" eyebrowse-switch-to-window-config-1 nil)
  ("2" eyebrowse-switch-to-window-config-2 nil)
  ("3" eyebrowse-switch-to-window-config-3 nil)
  ("4" eyebrowse-switch-to-window-config-4 nil)
  ("5" eyebrowse-switch-to-window-config-5 nil)
  ("6" eyebrowse-switch-to-window-config-6 nil)
  ("7" eyebrowse-switch-to-window-config-7 nil)
  ("8" eyebrowse-switch-to-window-config-8 nil)
  ("9" eyebrowse-switch-to-window-config-9 nil)
)

(define-key global-map [(f8)] 'hydra-eyebrowse/body) ;; I personally do use my own map: http://karl-voit.at/2018/07/08/emacs-key-bindings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment