brunetton / atom-overtype-mode Goto Github PK
View Code? Open in Web Editor NEWAtom package to add overtype mode to Atom
License: MIT License
Atom package to add overtype mode to Atom
License: MIT License
Hi!
I'm one of the freaks who really loves this feature on macOS.
I have the following in my keymap.cson (and nothing else - I keep atom light):
'atom-workspace': 'insert': 'overtype-mode:toggle' 'f18': 'overtype-mode:toggle'
Overtype mode works fine when tested with the f18 key (and presumably other keys), but does not respond to the insert key.
Keyboard is a Logitech MXKeys (multi-OS version, NOT the macOS version) operating in Windows mode (Fn + p rather than Fn + o)
This website registers my Insert Key, as does karabiner elements' event logger:
Screenshot 1
Screenshot with hex
but Atom refuses to do so.
A similar plugin in VSCode accepts the same Insert keypress without issue:
Would love to get this one resolved!
Can this enhanced version be deployed to atom, as an update to the current package?
So I have a sort of odd feature request. I haven't seen this done anywhere so far. The idea is to push edited text over and overtype the nearest white space to the right until reaching 0 spaces.
For example I have some jade code like this, using whitespace to keep all the items aligned. If I wanted to change the name of Home
to Homepage
I would have to re-align my spaces, but with "whitespace overtype", it would push text after the carret and overtype into the whitespace while leaving the rest of the line intact.
+item('Home', '0')(href='#home')
+item('Dashboard', '0')(href='#dashboard')
+item('Profile', '0')(href='#profile')
+item('Messages', '0')(href='#messages')
+item('Notifications', '0')(href='#notifications')
+item('Compose', '0')(href='#compose')
+item('Inbox', '0')(href='#inbox')
+item('Sent', '0')(href='#sent')
+item('Trash', '0')(href='#trash')
+item('Settings', '0')(href='#settings')
I couldn't find any plugins like this out there, but I thought I would take a shot at a feature request.
Use activationCommands
instead of activationEvents
in your package.json
Commands should be grouped by selector as follows:
"activationCommands": {
"atom-workspace": ["foo:bar", "foo:baz"],
"atom-text-editor": ["foo:quux"]
}
Package.getActivationCommands (C:\Users\spalmer1009\AppData\Local\atom\app-0.208.0\resources\app.asar\src\package.js:806:9)
Package.hasActivationCommands (C:\Users\spalmer1009\AppData\Local\atom\app-0.208.0\resources\app.asar\src\package.js:731:20)
<unknown> (C:\Users\spalmer1009\AppData\Local\atom\app-0.208.0\resources\app.asar\src\package.js:185:24)
Package.measure (C:\Users\spalmer1009\AppData\Local\atom\app-0.208.0\resources\app.asar\src\package.js:163:15)
Package.load (C:\Users\spalmer1009\AppData\Local\atom\app-0.208.0\resources\app.asar\src\package.js:177:12)
PackageManager.loadPackage (C:\Users\spalmer1009\AppData\Local\atom\app-0.208.0\resources\app.asar\src\package-manager.js:372:14)
Is it possible to show the status in status bar? It is a nice feature.
I am using Atom on my MacBookPro and I do miss an INSERT key on my keyboard. It is possible to add a custom shortcut key instead of the INS key? In SublimeText I do use the CMD+ALT+O shortcut to switch between normal and overtype mode.
When pasting, if overtype mode is on, I would expect the pasted text to overtype any existing characters within the length of the pasted text. Currently it just does a normal insert paste.
Would be nice for pasting into formatted Markdown tables, for example.
[Enter steps to reproduce:]
Atom: 1.34.0 x64
Electron: 2.0.16
OS: Microsoft Windows 10 Pro
Thrown From: atom-overtype-mode package 0.4.0
Failed to activate the atom-overtype-mode package
At Arguments to CompositeDisposable.add must have a .dispose() method
TypeError: Arguments to CompositeDisposable.add must have a .dispose() method
at assertDisposable (~/AppData/Local/atom/app-1.34.0/resources/app/static/<embedded>:11:1175864)
at CompositeDisposable.add (~/AppData/Local/atom/app-1.34.0/resources/app/static/<embedded>:11:1176832)
at OvertypeMode.activate (/packages/atom-overtype-mode/lib/atom-overtype-mode.coffee:14:13)
at Package.activateNow (~/AppData/Local/atom/app-1.34.0/resources/app/static/<embedded>:11:3017814)
at activationCommandSubscriptions.add.commandRegistry.onWillDispatch.n (~/AppData/Local/atom/app-1.34.0/resources/app/static/<embedded>:14:1717)
at Function.simpleDispatch (~/AppData/Local/atom/app-1.34.0/resources/app/static/<embedded>:11:1172318)
at Emitter.emit (~/AppData/Local/atom/app-1.34.0/resources/app/static/<embedded>:11:1173759)
at CommandRegistry.handleCommandEvent (~/AppData/Local/atom/app-1.34.0/resources/app/static/<embedded>:11:349649)
at KeymapManager.t.exports.KeymapManager.dispatchCommandEvent (~/AppData/Local/atom/app-1.34.0/resources/app/static/<embedded>:11:1212945)
at KeymapManager.t.exports.KeymapManager.handleKeyboardEvent (~/AppData/Local/atom/app-1.34.0/resources/app/static/<embedded>:11:1209079)
at WindowEventHandler.handleDocumentKeyEvent (~/AppData/Local/atom/app-1.34.0/resources/app/static/<embedded>:11:285196)
-5:23.9.0 editor:move-to-beginning-of-next-word (input.hidden-input)
-5:21.7.0 overtype-mode:toggle (input.hidden-input)
2x -5:20.2.0 core:delete (input.hidden-input)
-5:19 editor:move-to-beginning-of-next-word (input.hidden-input)
-5:18.3.0 editor:move-to-beginning-of-word (input.hidden-input)
7x -5:15.7.0 core:delete (input.hidden-input)
-5:13.7.0 core:save (input.hidden-input)
-5:10.3.0 settings-view:open (input.hidden-input)
-5:00.1.0 core:confirm (input.hidden-input)
13x -4:17.6.0 core:page-up (input.hidden-input)
-1:13.9.0 overtype-mode:toggle (input.hidden-input)
-1:13.9.0 whitespace:normalize-all (atom-text-editor.editor.overtype-cursor.is-focused)
-1:13.9.0 whitespace:convert-all-tabs-to-spaces (atom-text-editor.editor.overtype-cursor.is-focused)
-1:13.9.0 whitespace:remove-trailing-whitespace (atom-text-editor.editor.is-focused.overtype-cursor)
-1:13.9.0 line-ending-selector:convert-to-LF (atom-text-editor.editor.is-focused.overtype-cursor)
-1:13.8.0 core:save (atom-text-editor.editor.is-focused.overtype-cursor)
atom-overtype-mode 0.4.0
autosave-onchange 1.5.1
block-comment 0.4.3
color-picker 2.3.0
column-select 1.0.1
css-declaration-sorter 1.2.3
ctrl-dir-scroll 0.2.5
file-templates 0.2.0
highlight-line 0.12.0
justright-latte-syntax 0.1.0
justright-latte-ui 0.1.0
language-batchfile 0.7.5
language-ini 1.20.0
markdown-preview-plus 3.7.1
multi-cursor-plus 1.2.0
pigments 0.40.2
process-palette 0.17.0
project-manager 3.3.6
sort-lines 0.18.0
sync-settings 0.8.6
tree-view-auto-collapse 1.0.2
In atom-overtype-mode\styles\overtype-mode.atom-text-editor.less
:
Starting from Atom v1.13.0, the contents of atom-text-editor
elements are no longer encapsulated within a shadow DOM boundary. This means you should stop using :host
and ::shadow
pseudo-selectors, and prepend all your syntax selectors with syntax--
. To prevent breakage with existing style sheets, Atom will automatically upgrade the following selectors:
atom-text-editor.overtype-cursor::shadow .cursors .cursor
=> atom-text-editor.overtype-cursor.editor .cursors .cursor
atom-text-editor.overtype-cursor::shadow .cursors.blink-off .cursor
=> atom-text-editor.overtype-cursor.editor .cursors.blink-off .cursor
atom-text-editor[mini]:not(.is-focused)::shadow .cursors .cursor
=> atom-text-editor[mini]:not(.is-focused).editor .cursors .cursor
Automatic translation of selectors will be removed in a few release cycles to minimize startup time. Please, make sure to upgrade the above selectors as soon as possible.
Store package style sheets in the styles/
directory instead of stylesheets/
in the atom-overtype-mode
package
Package.getStylesheetsPath (C:\Users\spalmer1009\AppData\Local\atom\app-0.208.0\resources\app.asar\src\package.js:458:9)
Package.getStylesheetPaths (C:\Users\spalmer1009\AppData\Local\atom\app-0.208.0\resources\app.asar\src\package.js:469:32)
Package.loadStylesheets (C:\Users\spalmer1009\AppData\Local\atom\app-0.208.0\resources\app.asar\src\package.js:451:38)
<unknown> (C:\Users\spalmer1009\AppData\Local\atom\app-0.208.0\resources\app.asar\src\package.js:183:19)
Package.measure (C:\Users\spalmer1009\AppData\Local\atom\app-0.208.0\resources\app.asar\src\package.js:163:15)
Package.load (C:\Users\spalmer1009\AppData\Local\atom\app-0.208.0\resources\app.asar\src\package.js:177:12)
[Enter steps to reproduce below:]
Atom Version: 1.0.0
System: Microsoft Windows 8.1 Enterprise
Thrown From: atom-overtype-mode package, v0.2.3
Failed to activate the atom-overtype-mode package
At Cannot read property 'command' of undefined
TypeError: Cannot read property 'command' of undefined
at OvertypeMode.activate (C:\Users\spalmer1009\.atom\packages\atom-overtype-mode\lib\atom-overtype-mode.coffee:11:23)
at Package.module.exports.Package.activateNow (C:\Users\spalmer1009\AppData\Local\atom\app-1.0.0\resources\app.asar\src\package.js:240:19)
at C:\Users\spalmer1009\AppData\Local\atom\app-1.0.0\resources\app.asar\src\package.js:772:25
at Emitter.module.exports.Emitter.emit (C:\Users\spalmer1009\AppData\Local\atom\app-1.0.0\resources\app.asar\node_modules\event-kit\lib\emitter.js:82:11)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\spalmer1009\AppData\Local\atom\app-1.0.0\resources\app.asar\src\command-registry.js:222:20)
at C:\Users\spalmer1009\AppData\Local\atom\app-1.0.0\resources\app.asar\src\command-registry.js:3:61
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (C:\Users\spalmer1009\AppData\Local\atom\app-1.0.0\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:520:16)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (C:\Users\spalmer1009\AppData\Local\atom\app-1.0.0\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:355:22)
at HTMLDocument.module.exports.WindowEventHandler.onKeydown (C:\Users\spalmer1009\AppData\Local\atom\app-1.0.0\resources\app.asar\src\window-event-handler.js:180:20)
-0:03.4.0 overtype-mode:toggle (atom-text-editor.editor.is-focused)
{
"core": {
"disabledPackages": [
"autocomplete-plus-python-jedi",
"linter-flake8"
],
"projectHome": "C:\\Development",
"themes": [
"one-dark-ui",
"solarized-dark-syntax"
]
}
}
# User
atom-html-preview, v0.1.8
atom-overtype-mode, v0.2.3
autocomplete-python, v0.5.1
linter, v1.1.0
Sublime-Style-Column-Selection, v1.3.0
# Dev
No dev packages
I read that the cursor should change when I press Insert. However, it actually stays the same all the time. I am using Atom 0.176.0 under Manjaro Linux.
[Enter steps to reproduce:]
Atom: 1.45.0 x64
Electron: 4.2.7
OS: Microsoft Windows 10 Pro
Thrown From: atom-overtype-mode package 0.5.0
Uncaught TypeError: Cannot read property 'mutateSelectedText' of undefined
At c:\data\user\lawrence\programming\opensource\code\atom-overtype-mode\lib\actions.js:178
TypeError: Cannot read property 'mutateSelectedText' of undefined
at OvertypeMode.cmd.delete (c:/data/user/lawrence/programming/opensource/code/atom-overtype-mode/lib/actions.js:178:17)
at HTMLElement.ref.delete (c:/data/user/lawrence/programming/opensource/code/atom-overtype-mode/lib/atom-overtype-mode.js:237:33)
at CommandRegistry.handleCommandEvent (D:/user/lawrence/setting/windows/AppData/Local/Atom/app-1.45.0/resources/app/static/<embedded>:11:349290)
at KeymapManager.dispatchCommandEvent (D:/user/lawrence/setting/windows/AppData/Local/Atom/app-1.45.0/resources/app/static/<embedded>:11:1254747)
at KeymapManager.handleKeyboardEvent (D:/user/lawrence/setting/windows/AppData/Local/Atom/app-1.45.0/resources/app/static/<embedded>:11:1250881)
at WindowEventHandler.handleDocumentKeyEvent (D:/user/lawrence/setting/windows/AppData/Local/Atom/app-1.45.0/resources/app/static/<embedded>:11:284496)
2x -1:00.6.0 editor:move-to-first-character-of-line (input.hidden-input)
40x -0:56.3.0 core:move-up (input.hidden-input)
4x -0:51.7.0 core:move-down (input.hidden-input)
-0:49.4.0 editor:move-to-end-of-screen-line (input.hidden-input)
2x -0:45 editor:move-to-first-character-of-line (input.hidden-input)
-0:25.4.0 core:move-up (input.hidden-input)
2x -0:22.3.0 core:select-down (input.hidden-input)
-0:21.2.0 overtype-mode:delete (input.hidden-input)
-0:14.8.0 editor:consolidate-selections (input.hidden-input)
-0:14.8.0 core:cancel (input.hidden-input)
-0:12.9.0 overtype-mode:delete (input.hidden-input)
atom-overtype-mode 0.5.0
autosave-onchange 1.5.1
block-comment 0.4.3
color-picker 2.3.0
ctrl-dir-scroll 0.2.5
file-templates 0.2.0
grammar-token-limit 0.1.1
highlight-line 0.12.0
justright-latte-syntax 0.1.0
justright-latte-ui 0.1.0
language-batchfile 0.7.5
language-ini 1.23.0
magic-reflow 0.3.0
multi-cursor-plus 1.2.0
process-palette 0.17.0
project-manager 3.3.8
sort-lines 0.19.0
sync-settings 4.3.2
tree-view-sort 0.11.3
In atom-overtype-mode/styles/overtype-mode.atom-text-editor.less
:
Starting from Atom v1.13.0, the contents of atom-text-editor
elements are no longer encapsulated within a shadow DOM boundary. This means you should stop using :host
and ::shadow
pseudo-selectors, and prepend all your syntax selectors with syntax--
. To prevent breakage with existing style sheets, Atom will automatically upgrade the following selectors:
atom-text-editor.overtype-cursor::shadow .cursors .cursor
=> atom-text-editor.overtype-cursor.editor .cursors .cursor
atom-text-editor.overtype-cursor::shadow .cursors.blink-off .cursor
=> atom-text-editor.overtype-cursor.editor .cursors.blink-off .cursor
atom-text-editor[mini]:not(.is-focused)::shadow .cursors .cursor
=> atom-text-editor[mini]:not(.is-focused).editor .cursors .cursor
Automatic translation of selectors will be removed in a few release cycles to minimize startup time. Please, make sure to upgrade the above selectors as soon as possible.
Delete is problematic- there's nothing that can be done about that, but Backspace could work better with overtype mode: it would be best if it shifted the cursor left and overwrote the character with a space but kept the line length as-is (i.e. no deletion of characters). This would work nicely when editing Markdown tables and keeping the "cells" the same size.
[Enter steps to reproduce:]
Atom: 1.19.0-beta2 x64
Electron: 1.6.9
OS: Microsoft Windows 10 Pro
Thrown From: atom-overtype-mode package 0.3.4
Failed to activate the atom-overtype-mode package
At editor.getLastCursor(...).onDidChangeVisibility is not a function
TypeError: editor.getLastCursor(...).onDidChangeVisibility is not a function
at OvertypeMode.prepareEditor (/packages/atom-overtype-mode/lib/atom-overtype-mode.coffee:46:40)
at /packages/atom-overtype-mode/lib/atom-overtype-mode.coffee:15:8
at Workspace.observeTextEditors (~/AppData/Local/atom/app-1.19.0-beta2/resources/app/src/workspace.js:717:15)
at OvertypeMode.activate (/packages/atom-overtype-mode/lib/atom-overtype-mode.coffee:14:32)
at Package.module.exports.Package.activateNow (~/AppData/Local/atom/app-1.19.0-beta2/resources/app/src/package.js:253:25)
at ~/AppData/Local/atom/app-1.19.0-beta2/resources/app/src/package.js:968:31
at Function.module.exports.Emitter.simpleDispatch (~/AppData/Local/atom/app-1.19.0-beta2/resources/app/node_modules/event-kit/lib/emitter.js:25:20)
at Emitter.module.exports.Emitter.emit (~/AppData/Local/atom/app-1.19.0-beta2/resources/app/node_modules/event-kit/lib/emitter.js:141:34)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (~/AppData/Local/atom/app-1.19.0-beta2/resources/app/src/command-registry.js:246:26)
at ~/AppData/Local/atom/app-1.19.0-beta2/resources/app/src/command-registry.js:3:65
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (~/AppData/Local/atom/app-1.19.0-beta2/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:610:22)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (~/AppData/Local/atom/app-1.19.0-beta2/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:401:28)
at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (~/AppData/Local/atom/app-1.19.0-beta2/resources/app/src/window-event-handler.js:100:42)
at HTMLDocument.<anonymous> (~/AppData/Local/atom/app-1.19.0-beta2/resources/app/src/window-event-handler.js:3:65)
-1:59.2.0 find-and-replace:show (div.panels-item)
7x -1:55 core:backspace (input.hidden-input)
-1:50.7.0 editor:consolidate-selections (input.hidden-input)
2x -1:50.7.0 core:cancel (input.hidden-input)
-1:44.4.0 core:confirm (input.hidden-input)
-1:16.8.0 docblockr:parse-enter (input.hidden-input)
-1:16.8.0 editor:newline (input.hidden-input)
-1:16.7.0 docblockr:parse-enter (input.hidden-input)
-1:16.7.0 editor:newline (input.hidden-input)
-1:16.6.0 core:move-up (input.hidden-input)
-1:09.8.0 docblockr:parse-enter (input.hidden-input)
-1:09.8.0 editor:newline (input.hidden-input)
-1:01.8.0 core:backspace (input.hidden-input)
-0:55.7.0 core:move-right (input.hidden-input)
-0:51.7.0 window:save-all (input.hidden-input)
-0:37.4.0 overtype-mode:toggle (input.hidden-input)
atom-alignment 0.13.0
atom-beautify 0.30.3
atom-overtype-mode 0.3.4
autocomplete-clang 0.11.3
docblockr 0.10.5
file-icons 2.1.8
git-time-machine 1.5.9
highlight-selected 0.13.1
keybinding-cheatsheet 0.1.1
minimap 4.28.2
minimap-bookmarks 0.4.2
minimap-find-and-replace 4.5.2
minimap-git-diff 4.3.1
minimap-highlight-selected 4.6.1
multi-cursor 2.1.5
open-recent 5.0.0
simple-drag-drop-text 0.3.4
symbols-tree-view 0.14.0
tab-smart-sort 0.3.0
todo-show 1.11.0
If I press Insert and start typing, everything works ok. However, if I select a suggestion from the autocomplete module, the word is not written over previous text (as I expect from "overtyping").
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.