Idea I will like to construct a simple emacs function that copies the
yy functionality in vim.
The function should yank a visual-line into kill ring without deleting the line.
Function Here is the function I came up with.
(defun vim-line-yank-func() (interactive) (beginning-of-visual-line) (mark-end-of-sentence 1) (end-of-visual-line) (copy-region-as-kill (mark) (point)) )
Let us run this program on some data. Consider the following text with original line breaks (► is position of the mark "\n" = newline mark).
Pellentesque dapibus suscipit ligula. ► Donec posuere augue in quam. Etiam \n vel tortor sodales tellus ultricies commodo. Suspendisse potenti. \n Aenean in sem ac leo mollis blandit.
The expected answer is
but the answer I keep getting is the following:
Pellentesque dapibus suscipit ligula. Donec posuere augue in quam. Etiam
Donec posuere augue in quam. Etiam
I am befuddled as to why this is happening. When I run these commands in succession things seem to work fine. Thank you for your help!