Modify core:paste


#1

Hello, im used to vim pasting (paste below current line instead of above) what approach is adviced to override or change the core paste behaviour?


#2

Can be elaborate on what you are trying to do? Vim-Mode pastes below (when using p). Also, insert mode pastes inline or below depending on the clipboard item.


#3

i want to achieve this without using vim mode i’ll think i’ll dig into vim-mode source


#4

If you copy without a selection, it copies the whole line. Then, you can paste below. Is this what you want?


#5

Exactly, just like a Y + p would do in vim


#6

Give this a try:

init.coffee

atom.commands.add 'atom-text-editor',
  'user:paste-below': (event) ->
    editor = @getModel()
    editor.transact ->
      editor.moveToEndOfLine()
      editor.insertNewline()
      editor.pasteText()

keymap.cson

'atom-text-editor':
  'cmd-shift-u': 'user:paste-below'

But copying without a selection should work, by default.