# \[newbie\] can't figure out the LSP / object mode

**URL:** <https://discuss.kakoune.com/t/newbie-cant-figure-out-the-lsp-object-mode/2709>\
**Category:** Help\
**Tags:** lsp, plugins\
**Created:** [June 23, 2025, 2:16pm UTC](https://discuss.kakoune.com/t/newbie-cant-figure-out-the-lsp-object-mode/2709 "2025-06-23T14:16:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![niliaranet](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/niliaranet/32/1559_2.png) [@niliaranet](https://discuss.kakoune.com/u/niliaranet)\
**Post date:** [June 23, 2025, 2:16pm UTC](https://discuss.kakoune.com/t/newbie-cant-figure-out-the-lsp-object-mode/2709/1 "2025-06-23T14:16:53Z")

</div>

I’m having trouble figuring out how to use the mappings for kak-lsp. The documentation recommends using object mode mappings but I don’t quite get them.

For example, for this keybind:

```kak
map global object d '<a-semicolon>lsp-diagnostic-object --include-warnings<ret>' -docstring 'LSP errors and warnings'

```

I am expecting to recieve some sort of message on the error i’m highlighing. So I run:

```kak
<a-a>d

```

But that only selects the word I’m at. Pressing d again deletes it. I don’t understand object mode mappings and trying to map it to something like makes the lsp tell me that there’s nothing selected, so I believe it must be done through object-mode.

I am using the same configuration that the kak-lsp documentation recommends:

```kak
map global user l ':enter-user-mode lsp<ret>' -docstring 'LSP mode'

map global insert <tab> '<a-;>:try lsp-snippets-select-next-placeholders catch %{ execute-keys -with-hooks <lt>tab> }<ret>' -docstring 'Select next snippet placeholder'

map global object a '<a-semicolon>lsp-object<ret>' -docstring 'LSP any symbol'
map global object <a-a> '<a-semicolon>lsp-object<ret>' -docstring 'LSP any symbol'
map global object f '<a-semicolon>lsp-object Function Method<ret>' -docstring 'LSP function or method'
map global object t '<a-semicolon>lsp-object Class Interface Struct<ret>' -docstring 'LSP class interface or struct'
map global object d '<a-semicolon>lsp-diagnostic-object --include-warnings<ret>' -docstring 'LSP errors and warnings'
map global object D '<a-semicolon>lsp-diagnostic-object<ret>' -docstring 'LSP errors'

```

---

<div class="post-metadata">

**Author:** ![ficd](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/ficd/32/1560_2.png) [@ficd](https://discuss.kakoune.com/u/ficd)\
**Post date:** [June 24, 2025, 2:34am UTC](https://discuss.kakoune.com/t/newbie-cant-figure-out-the-lsp-object-mode/2709/2 "2025-06-24T02:34:31Z")

</div>

Hello,

There are more more mappings than _just_ the object mappings. The object  
mode mappings essentially let you select text in your document based  
on output from the LSP. So, the `<a-a>d` binding _selects the part of  
your code the diagnostic is applied to_. To see the _text contents_ of  
the diagnostic, you can use the `lsp-hover` command, which by default  
is bound to `<space>lh`.

As a general rule, object mappings help you **select** stuff. The other  
mappings, in the `lsp` `user-mode`, help you do other things.

---

<div class="post-metadata">

**Author:** ![niliaranet](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/niliaranet/32/1559_2.png) [@niliaranet](https://discuss.kakoune.com/u/niliaranet)\
**Post date:** [June 24, 2025, 11:27am UTC](https://discuss.kakoune.com/t/newbie-cant-figure-out-the-lsp-object-mode/2709/3 "2025-06-24T11:27:16Z")

</div>

Thank you, that’s exactly what I needed!
