Commit 16d8e1af authored by Duncan Bayne's avatar Duncan Bayne

Add function to open filename in region

parent 378b64ce
......@@ -84,3 +84,12 @@
(defun utils:term-p (buffer)
"Returns t if buffer is a terminal, nil otherwise."
(equal 'term-mode (buffer-local-value 'major-mode buffer)))
(defun utils:region-string ()
"Returns a string containing the currently selected region."
(buffer-substring (mark) (point)))
(defun utils:visit-buffer-named-in-region ()
"Opens the file named in the currently selected region."
(find-file (utils:region-string)))
......@@ -76,3 +76,5 @@
(global-set-key (kbd "C-x w") 'elfeed)
(global-set-key (kbd "s-f") 'utils:visit-buffer-named-in-region)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment