Disable mouse support like vim?


#1

Hi, how can i disable mouse support in atom like on vim ? I’m on LinuxMint17.2(Ubuntu based).

Thanks !
PS : It seems that it is faster not to use the mouse. True ?


#2

There is no method to disable the mouse in Atom.

It depends for what. I haven’t seen any research that concludes that all keyboard is faster in all situations than keyboard and mouse, only anecdotal evidence and opinion.


#3

You could stick a transparent div on top of everything… The following will prevent any mouse event from reaching any element in the <atom-workspace>. Put this in your init.coffee.

div = document.body.appendChild(document.createElement('div'));
Object.assign(div.style, {
  position: 'fixed',
  top: 0,
  left: 0,
  width: '100%',
  height: '100%',
  z-index: 10000,
});

#4

Please note: Not all packages are guaranteed to work in a keyboard only manner, one well-known example is the Settings View. Using @olmokramer’s solution could prevent some packages from working correctly or at all.


#5

IMHO, if you need to hop around a lot and work on small areas a mouse is faster. Some people prefer to use the keyboard to navigate instead of the mouse, even if it slower, so they don’t have to move their hands to the mouse and back. (Many vim and emacs users will strongly disagree with me on all of this).


#6

Yes that’s a valid concern. Mouse events can be enabled again by setting display: none; on the div. To make this a little easier, one could also add the following to their init.coffee to add a command that toggles between mouse enabled and disabled. It can also be bound to a key in keymap.cson.

atom.commands.add('body', 'custom:toggle-mouse-support', () =>
  div.style.display = div.style.display ? '' : 'none';
);

Or if you want to disable mouse only on the <atom-text-editor>, you could use some atom.workspace.observeTextEditors() magic and apply the same method to each editor’s element’s shadowRoot.


#7

Wouldn’t it be easier to just leave the mouse alone and not touch it?