1
0
Fork 0

nvim: Improved lint and cmp configuration

This commit is contained in:
Daniel Kempkens 2022-04-24 20:10:14 +02:00
parent 9f6537f090
commit b64ba47151
2 changed files with 12 additions and 10 deletions

View file

@ -44,17 +44,18 @@
:<CR> (cmp.mapping.confirm {:select true})})
:completion {:keyword_length 2
:completeopt "menu,menuone,noinsert"}
:window {:documentation {:border ["╭"
"─"
"╮"
"│"
"╯"
"─"
"╰"
"│"]}}
:window {:documentation (cmp.config.window.bordered {:border :rounded})}
:snippet {:expand (fn [args]
(luasnip.lsp_expand args.body))}
:formatting {:format (lspkind.cmp_format)}})
:formatting {:format (lspkind.cmp_format {:mode :symbol_text
:menu {:buffer "[Buffer]"
:cmdline "[Cmd]"
:luasnip "[LuaSnip]"
:nvim_lsp "[LSP]"
:nvim_lsp_document_symbol "[Symbol]"
:nvim_lua "[Lua]"
:path "[Path]"
:treesitter "[Treesitter]"}})}})
(cmp.setup.cmdline "/"
{:sources (cmp.config.sources [{:name :nvim_lsp_document_symbol}]
[{:name :buffer}])
@ -64,3 +65,4 @@
[{:name :cmdline}])
:mapping (cmp.mapping.preset.cmdline)})
(cmp.event:on :confirm_done (npairs.on_confirm_done {:map_char {:tex ""}})))

View file

@ -32,7 +32,7 @@
(fn setup-linting [opts]
(lint.try_lint)
(aucmd [:BufWritePost :InsertLeave]
(aucmd [:BufWinEnter :BufWritePost :InsertLeave]
{:callback #(lint.try_lint) :buffer opts.buf :group augroup}))
(each [ft _ (pairs lint.linters_by_ft)]