justmoon / relative-numbers

Relative line numbers package for Atom
https://atom.io/packages/relative-numbers
MIT License
37 stars 16 forks source link

Toggle hotkey #16

Open anhari opened 8 years ago

anhari commented 8 years ago

Is there a way to set a hotkey to easily enable/disable this plugin?

esauter5 commented 8 years ago

@michaelanhari I don't know much about atom plugins and the API, but I did notice it seems to read these settings from the atom config (https://github.com/justmoon/relative-numbers/blob/master/lib/line-number-view.coffee#L8-L9).

There are also event listeners later in the code that listen for these config settings to change and update the variables appropriately. I'm not sure where the code actually toggles the mode when you switch to insert mode and back to normal ode - that may help provide a solution here.

Is it possible to update the atom config with keybindings or do you need a command for that? Probably wouldnt be that hard to add a command.

Sorry if this isn't much help. Just brainstorming a bit because I am interested in this feature as well. Maybe I can jump in with a PR if I have some time over the next few days.