Quickly view file-contents without visiting the file, as if you had second-sight.
You can view file-contents without visiting the file.
This package will reduce the number of times you open a buffer.
For example, after you call find-file
, you can see the file-content without jumping to the file.
This package requires posframe.el.
You need to install posframe
before.
git clone
and edit your init.el as below.
(add-to-list 'load-path "/pscp/to/second-sight")
(require 'second-sight)
;; optional but recommended
(global-set-key (kbd "YOUR KEY") 'second-sight)
After evaluating this expression, posframe
will appear with the file-content.
(second-sight-file "filepath")
When your cursor is on the filepath like below, you can execute M-x second-sight
.
"/pa|th/to/file"
↑ your cursor
This package partially supports ivy/counsel.
After you execute counsel-find-file
, counsel-recentf
, counsel-git
etc, you can call second-sight
.
Notice:
This package use a bit hacks to get one of ivy
candidates like (ivy-state-current ivy-last)
So if you want to use this package with counsel
, you should assign a short-cut key as below to avoid selecting a wrong candidate.
(global-set-key (kbd "YOUR KEY") 'second-sight)
second-sight
provides (second-sight-file filepath)
function.
This function can generate posframe with file-contents. If you want to use it with your favorite commands like vanilla find-file
, helm
etc, you should call second-sight-file
with filepath while selecting candidates.
Of course, PR to support other commands is also welcome!