Skip to content

Commit

Permalink
Add Paste without reformatting command
Browse files Browse the repository at this point in the history
It is bound to cmd-shift-V on macOS and ctrl-shift-V on Windows and
Linux. It is also available in the edit menu.
  • Loading branch information
Nathan Sobo committed Oct 23, 2017
1 parent 6701644 commit fd85c1b
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions keymaps/darwin.cson
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
'ctrl-shift-w': 'editor:select-word'
'cmd-ctrl-left': 'editor:move-selection-left'
'cmd-ctrl-right': 'editor:move-selection-right'
'cmd-shift-V': 'editor:paste-without-reformatting'

# Emacs
'alt-f': 'editor:move-to-end-of-word'
Expand Down
1 change: 1 addition & 0 deletions keymaps/linux.cson
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
'alt-shift-right': 'editor:select-to-next-subword-boundary'
'alt-backspace': 'editor:delete-to-beginning-of-subword'
'alt-delete': 'editor:delete-to-end-of-subword'
'ctrl-shift-V': 'editor:paste-without-reformatting'

# Sublime Parity
'ctrl-a': 'core:select-all'
Expand Down
1 change: 1 addition & 0 deletions keymaps/win32.cson
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
'alt-shift-right': 'editor:select-to-next-subword-boundary'
'alt-backspace': 'editor:delete-to-beginning-of-subword'
'alt-delete': 'editor:delete-to-end-of-subword'
'ctrl-shift-V': 'editor:paste-without-reformatting'

# Sublime Parity
'ctrl-a': 'core:select-all'
Expand Down
1 change: 1 addition & 0 deletions menus/darwin.cson
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
{ label: 'Copy', command: 'core:copy' }
{ label: 'Copy Path', command: 'editor:copy-path' }
{ label: 'Paste', command: 'core:paste' }
{ label: 'Paste Without Reformatting', command: 'editor:paste-without-reformatting' }
{ label: 'Select All', command: 'core:select-all' }
{ type: 'separator' }
{ label: 'Toggle Comments', command: 'editor:toggle-line-comments' }
Expand Down
1 change: 1 addition & 0 deletions menus/linux.cson
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
{ label: 'C&opy', command: 'core:copy' }
{ label: 'Copy Pat&h', command: 'editor:copy-path' }
{ label: '&Paste', command: 'core:paste' }
{ label: 'Paste Without Reformatting', command: 'editor:paste-without-reformatting' }
{ label: 'Select &All', command: 'core:select-all' }
{ type: 'separator' }
{ label: '&Toggle Comments', command: 'editor:toggle-line-comments' }
Expand Down
1 change: 1 addition & 0 deletions menus/win32.cson
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
{ label: '&Copy', command: 'core:copy' }
{ label: 'Copy Pat&h', command: 'editor:copy-path' }
{ label: '&Paste', command: 'core:paste' }
{ label: 'Paste Without Reformatting', command: 'editor:paste-without-reformatting' }
{ label: 'Select &All', command: 'core:select-all' }
{ type: 'separator' }
{ label: '&Toggle Comments', command: 'editor:toggle-line-comments' }
Expand Down
5 changes: 5 additions & 0 deletions src/register-default-commands.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ module.exports = ({commandRegistry, commandInstaller, config, notificationManage
'core:cut': -> @cutSelectedText()
'core:copy': -> @copySelectedText()
'core:paste': -> @pasteText()
'editor:paste-without-reformatting': -> @pasteText({
normalizeLineEndings: false,
autoIndent: false,
preserveTrailingLineIndentation: true
})
'editor:delete-to-previous-word-boundary': -> @deleteToPreviousWordBoundary()
'editor:delete-to-next-word-boundary': -> @deleteToNextWordBoundary()
'editor:delete-to-beginning-of-word': -> @deleteToBeginningOfWord()
Expand Down

0 comments on commit fd85c1b

Please sign in to comment.