Skip to content

Commit 3619282

Browse files
committed
add the otter config file
1 parent 51e4e17 commit 3619282

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
-- otter enables completion in markdown fenced code blocks
2+
-- https://github.com/jmbuhr/otter.nvim
3+
-- config stolen from:
4+
-- https://github.com/willothy/nvim-config/blob/80d82e0/lua/configs/editor/otter.lua#L16
5+
6+
local otter = require("otter")
7+
8+
otter.setup({
9+
set_filetype = true,
10+
})
11+
12+
vim.g.markdown_fenced_languages = {
13+
"js",
14+
}
15+
16+
vim.api.nvim_create_autocmd({ "BufEnter" }, {
17+
pattern = { "*.md" },
18+
callback = function()
19+
otter.activate({ "javascript", "typescript", "js", "ts" }, true, true)
20+
vim.api.nvim_buf_set_keymap(0, "n", "gd", ":lua require'otter'.ask_definition()<cr>", { silent = true })
21+
vim.api.nvim_buf_set_keymap(0, "n", "K", ":lua require'otter'.ask_hover()<cr>", { silent = true })
22+
end,
23+
})

0 commit comments

Comments
 (0)