Simple mode implementation + mode keybindings #27
Conversation
Ohh very cool! This was something I wanted do look at for a long time. I'll check it out later! Just on the first look, maybe it makes sense to put these modes in a separate multimethod like |
@dvcrn agree about multimethod I'll try. I was thinking about something similar to emacs modes in the future, like provide ability to compose several modes, major/minor modes definitions etc. That's why I put it to separate file. But I'm ok with multimethod |
That is so awesome! I'm excited to see this. Good work! You even hooked up Julia for me, thanks! |
Tested it and works really great :) Is this already ready for merge or do you have some more changes? With multimethod I meant that you currently put the stuff in For linking: #9 |
Also just an idea but one thing that I think would be pretty cool is if the user can bind files to languages from the Something like, I want |
I've used the file-types package for this in the past |
^ might need to check if we can somehow integrate with this I only saw inside clojure/core.cljs that he is doing something similar here:
That's why the question |
Basic implementation almost done. Few things left. |
37b2625
to
811bfc0
Added multimethod to describe mode.
8262122
to
9e47be3
Added multimethod (defmethod describe-mode :lang/clojure []
{:mode-name :clojure
:atom-grammars ["Clojure"]
:file-extensions [#"\.proton$"]
:mode-keybindings
{:t {:category "toggles"
:p {:action "parinfer:toggleMode" :title "Toggle Parinfer Mode"}}}
:init clojure-mode-init}) Added quick access key for mode specific keybindings by ,. |
Cool :) I'm actually very excited about this! |
@dvcrn ok, will do. |
@@ -35,3 +35,4 @@ | |||
(defmethod get-keybindings :git [] (get-keybindings :tools/git)) | |||
(defmethod get-initial-config :git [] (get-initial-config :tools/git)) | |||
(defmethod init-layer! :git [] (init-layer! :tools/git)) | |||
(defmethod describe-mode :git [] {}) |
dvcrn
Dec 14, 2015
Owner
We need to add the multimethod for :tools/git
here. Changing this code to:
(defmethod describe-mode :git [] (describe-mode :tools/git))
Will make sure that backwards compatibility to the first version exists
We need to add the multimethod for :tools/git
here. Changing this code to:
(defmethod describe-mode :git [] (describe-mode :tools/git))
Will make sure that backwards compatibility to the first version exists
Ah I just do that myself :) Merging this now |
Simple mode implementation + mode keybindings
Simple mode implementation + mode keybindings
Implemented basic mode functionality.
Added function to define mode with extra info.
Prefer to use inside
init-layer!
function, for example:Mode actions available via SPC m.
@dvcrn can you please review? Thanks.