Skip to content

Instantly share code, notes, and snippets.

@pogin503
Last active January 28, 2017 13:36
Show Gist options
  • Save pogin503/e1b2ad6d920ac831a907dab7d8b68c65 to your computer and use it in GitHub Desktop.
Save pogin503/e1b2ad6d920ac831a907dab7d8b68c65 to your computer and use it in GitHub Desktop.
(require 'f)
(defun current-line-number ()
"Print the current line number (in the buffer) of point."
(interactive)
(save-restriction
(widen)
(save-excursion
(beginning-of-line)
(1+ (count-lines 1 (point))))))
(defun my-copy-current-line-info ()
(interactive)
(let ((path (f-this-file)))
(when (not (null path))
(kill-new (format "%s L%s"
(f-filename (f-this-file))
(current-line-number))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment