(kill-line arg))
(if (not (string-equal major-mode "fundamental-mode"))
(indent-for-tab-command)))
-
-(defun my/yank (arg)
- "If the text to be yanked has a newline then move to beginning of line before yanking. Otherwise same as normal `yank'."
- (interactive "*P")
- (advice-add 'insert-for-yank :around #'my/yank/advice)
- (unwind-protect
- (yank arg)
- (advice-remove 'insert-for-yank #'my/yank/advice)))
-
-(defun my/yank/advice (original-function string)
- (if (string-match-p "\n" string)
- (beginning-of-line))
- (funcall original-function string))