I'm using the slick-cut function (as answered here by itsjeyd) for killing the entire line with minimal keystrokes. It's defined like so :-
(defun slick-cut (beg end)
(interactive
(if mark-active
(list (region-beginning) (region-end))
(list (line-beginning-position) (line-beginning-position 2)))))
(advice-add 'kill-region :before #'slick-cut)
But, I noticed this behaviour, whenever I kill a line, the cursor will be positioned to the beginning of the next line.
Before killing line 28 :- After killing line 28 :- Is there a way one can modify the slick-cut function so that, after killing a line, the cursor column position is also preserved. Like so :-
If unable to preserve cursor position, is it possible to at least move the cursor position to the indentation level ?
save-excursion
?