Skip to content

Commit fd85c1b

Browse files
author
Nathan Sobo
committed
Add Paste without reformatting command
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.
1 parent 6701644 commit fd85c1b

File tree

7 files changed

+11
-0
lines changed

7 files changed

+11
-0
lines changed

keymaps/darwin.cson

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
'ctrl-shift-w': 'editor:select-word'
133133
'cmd-ctrl-left': 'editor:move-selection-left'
134134
'cmd-ctrl-right': 'editor:move-selection-right'
135+
'cmd-shift-V': 'editor:paste-without-reformatting'
135136

136137
# Emacs
137138
'alt-f': 'editor:move-to-end-of-word'

keymaps/linux.cson

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
'alt-shift-right': 'editor:select-to-next-subword-boundary'
106106
'alt-backspace': 'editor:delete-to-beginning-of-subword'
107107
'alt-delete': 'editor:delete-to-end-of-subword'
108+
'ctrl-shift-V': 'editor:paste-without-reformatting'
108109

109110
# Sublime Parity
110111
'ctrl-a': 'core:select-all'

keymaps/win32.cson

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
'alt-shift-right': 'editor:select-to-next-subword-boundary'
111111
'alt-backspace': 'editor:delete-to-beginning-of-subword'
112112
'alt-delete': 'editor:delete-to-end-of-subword'
113+
'ctrl-shift-V': 'editor:paste-without-reformatting'
113114

114115
# Sublime Parity
115116
'ctrl-a': 'core:select-all'

menus/darwin.cson

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
{ label: 'Copy', command: 'core:copy' }
6666
{ label: 'Copy Path', command: 'editor:copy-path' }
6767
{ label: 'Paste', command: 'core:paste' }
68+
{ label: 'Paste Without Reformatting', command: 'editor:paste-without-reformatting' }
6869
{ label: 'Select All', command: 'core:select-all' }
6970
{ type: 'separator' }
7071
{ label: 'Toggle Comments', command: 'editor:toggle-line-comments' }

menus/linux.cson

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
{ label: 'C&opy', command: 'core:copy' }
3939
{ label: 'Copy Pat&h', command: 'editor:copy-path' }
4040
{ label: '&Paste', command: 'core:paste' }
41+
{ label: 'Paste Without Reformatting', command: 'editor:paste-without-reformatting' }
4142
{ label: 'Select &All', command: 'core:select-all' }
4243
{ type: 'separator' }
4344
{ label: '&Toggle Comments', command: 'editor:toggle-line-comments' }

menus/win32.cson

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
{ label: '&Copy', command: 'core:copy' }
4747
{ label: 'Copy Pat&h', command: 'editor:copy-path' }
4848
{ label: '&Paste', command: 'core:paste' }
49+
{ label: 'Paste Without Reformatting', command: 'editor:paste-without-reformatting' }
4950
{ label: 'Select &All', command: 'core:select-all' }
5051
{ type: 'separator' }
5152
{ label: '&Toggle Comments', command: 'editor:toggle-line-comments' }

src/register-default-commands.coffee

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,11 @@ module.exports = ({commandRegistry, commandInstaller, config, notificationManage
174174
'core:cut': -> @cutSelectedText()
175175
'core:copy': -> @copySelectedText()
176176
'core:paste': -> @pasteText()
177+
'editor:paste-without-reformatting': -> @pasteText({
178+
normalizeLineEndings: false,
179+
autoIndent: false,
180+
preserveTrailingLineIndentation: true
181+
})
177182
'editor:delete-to-previous-word-boundary': -> @deleteToPreviousWordBoundary()
178183
'editor:delete-to-next-word-boundary': -> @deleteToNextWordBoundary()
179184
'editor:delete-to-beginning-of-word': -> @deleteToBeginningOfWord()

0 commit comments

Comments
 (0)