Open qoor opened 3 years ago
Same here wondering how to get the Shift+K or some toggle thing for focusing and unfocusing doc frames.
Same here wondering how to get the Shift+K or some toggle thing for focusing and unfocusing doc frames.
Ok, I got it. However, I basically know that the q
key is used to unfocus the focused hover document. In my case it doesn't work that way.
It's not a bug? Then I must bind the key q
?
Ok, I got it.
What did you do to get the Shift+K thing working?
Ok, I got it.
What did you do to get the Shift+K thing working?
I'm skip that. I think binding the key using general seems to solve it. What I really want is to close the document with the q
key.
Yea but I don't really want to have 2 separate bindings for focusing and unfocusing I kinda want a toggle kinda thing.
Can you try the following function?
(defun lsp-ui-doc-toggle-focus-frame ()
"Toggle focus and unfocus `lsp-ui-doc-frame'."
(interactive)
(if (lsp-ui-doc--frame-visible-p) (lsp-ui-doc-unfocus-frame)
(lsp-ui-doc-focus-frame)))
Doesn't work when I run it while there is a doc buffer in the corner of screen.
Can you try the following function?
(defun lsp-ui-doc-toggle-focus-frame () "Toggle focus and unfocus `lsp-ui-doc-frame'." (interactive) (if (lsp-ui-doc--frame-visible-p) (lsp-ui-doc-unfocus-frame) (lsp-ui-doc-focus-frame)))
No, it is not working.
@qoor Can you try adding this key binding into your init?
(evil-define-key 'normal 'lsp-ui-doc-frame-mode
[?q] #'lsp-ui-doc-unfocus-frame)
(evil-normalize-keymaps)
Alternatively you can go into edit
mode when inside doc frame and press q
(default keybind for hiding doc frame).
@kiennq thanks it worked, with that I can know unfocus frame with q. Do you know how to make it focus with Shift+K?
@theCow61 Actually in the image in lsp-ui
, the Shift + K
is used to make the doc frame appeared on demand (lsp-ui-doc-glance
), and the doc frame is focused with tab
key.
If you want to bind the Shift + K
to make it focus into doc frame. The easiest is
(evil-define-key 'normal 'lsp-ui-doc-mode
[?K] #'lsp-ui-doc-focus-frame)
Thank you for the help.
@theCow61 Actually in the image in
lsp-ui
, theShift + K
is used to make the doc frame appeared on demand (lsp-ui-doc-glance
), and the doc frame is focused withtab
key.If you want to bind the
Shift + K
to make it focus into doc frame. The easiest is(evil-define-key 'normal 'lsp-ui-doc-mode [?K] #'lsp-ui-doc-focus-frame)
Why my Emacs does not work lsp-ui-doc-glance
? If I call lsp-ui-doc-glance
after cursor position to symbol, Nothing happen. Only work lsp-ui-doc-show
My Emacs version is 28.0.x (with native-compilation)
@qoor
Can you try adding this key binding into your init?
(evil-define-key 'normal 'lsp-ui-doc-frame-mode [?q] #'lsp-ui-doc-unfocus-frame) (evil-normalize-keymaps)
Alternatively you can go into
edit
mode when inside doc frame and pressq
(default keybind for hiding doc frame).
That's work. But why I should bind the key manually? In lsp-ui-doc.el
, q
key to hide frame bind is already defined at lsp-ui-doc-frame-mode
.
That's work. But why I should bind the key manually? In
lsp-ui-doc.el
,q
key to hide frame bind is already defined atlsp-ui-doc-frame-mode
.
That's emacs binding, not evil-mode
binding. If you press i
to enter edit
mode for evil-mode
, you can press q
and have the doc frame unfocused.
The key bind I posted if for binding q
to lsp-ui-unfocus-frame
for normal
mode. So you can press q
right away without entering insert
mode
@theCow61 Actually in the image in
lsp-ui
, theShift + K
is used to make the doc frame appeared on demand (lsp-ui-doc-glance
), and the doc frame is focused withtab
key.If you want to bind the
Shift + K
to make it focus into doc frame. The easiest is(evil-define-key 'normal 'lsp-ui-doc-mode [?K] #'lsp-ui-doc-focus-frame)
Why my Emacs does not work
lsp-ui-doc-glance
? If I calllsp-ui-doc-glance
after cursor position to symbol, Nothing happen. Only worklsp-ui-doc-show
My Emacs version is 28.0.x (with native-compilation)
@kiennq And this, Why lsp-ui-doc-glance
is not working on my Emacs? When I call the lsp-ui-doc-show
before lsp-ui-doc-glance
, it work. glance feature is just 'have effect what already OPENED that'?
When I call
lsp-ui-doc-focus-frame
manually, Then I can focus to doc frame.After I read document and press
q
key, starting record key mode from evil.if I want unfocus doc, always need to call
lsp-ui-doc-unfocus-frame
this situation?And I have one more question. lsp-ui-doc example image is showing when press the key
Shift+K
. But in my case My emacs launched man page search mode. How can I see doc withShift+K
hotkey?Here is my init.el.