关于跳转到定义 弹窗模式

很多ide 具有在当前页面 弹窗模式 显示函数或变量定义的功能 刚接触emacs的时候看过一篇帖子 是基于rtags 实现的 现在大家都用lsp-mode了就想着能不能结合一下 奈何还不太会写插件 看看有没有人能贡献一下 感谢各位大神~~

https://tuhdo.github.io/emacs-frame-peek.html

效果应该是这样的 peek-definition-emacs 不知道为啥 这个链接的图打不开了 能看到图的补个图吧 链接很难打开 补上代码吧 At this point, implementing a peek definition in Emacs is simply automating these steps:

  1. Find the absolute position of the current beginning of the symbol at point, in pixels.
  2. Create a new invisible frame, with the current buffer in it.
  3. Position the new frame right under the beginning of the symbol at point.
  4. Jump to the symbol at point.
  5. Make frame visible again.

lsp-ui-peek-mode

只有一个索引的时候会直接跳转,如果要显示,设置lsp-ui-peek-always-show为t

2 个赞

好的 我去试试 感谢~

lsp-mode 早就实现了吧

还有你那个链接最好换成 https,否则打不开。

https://tuhdo.github.io/emacs-frame-peek.html

好的已经改正