-
Notifications
You must be signed in to change notification settings - Fork 52
Simple mode implementation + mode keybindings #27
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
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
Compare
Added multimethod to describe mode.
8262122
to
9e47be3
Compare
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 [] {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.