nvim: Improved lint and cmp configuration
This commit is contained in:
parent
9f6537f090
commit
b64ba47151
2 changed files with 12 additions and 10 deletions
|
@ -44,17 +44,18 @@
|
||||||
:<CR> (cmp.mapping.confirm {:select true})})
|
:<CR> (cmp.mapping.confirm {:select true})})
|
||||||
:completion {:keyword_length 2
|
:completion {:keyword_length 2
|
||||||
:completeopt "menu,menuone,noinsert"}
|
:completeopt "menu,menuone,noinsert"}
|
||||||
:window {:documentation {:border ["╭"
|
:window {:documentation (cmp.config.window.bordered {:border :rounded})}
|
||||||
"─"
|
|
||||||
"╮"
|
|
||||||
"│"
|
|
||||||
"╯"
|
|
||||||
"─"
|
|
||||||
"╰"
|
|
||||||
"│"]}}
|
|
||||||
:snippet {:expand (fn [args]
|
:snippet {:expand (fn [args]
|
||||||
(luasnip.lsp_expand args.body))}
|
(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 "/"
|
(cmp.setup.cmdline "/"
|
||||||
{:sources (cmp.config.sources [{:name :nvim_lsp_document_symbol}]
|
{:sources (cmp.config.sources [{:name :nvim_lsp_document_symbol}]
|
||||||
[{:name :buffer}])
|
[{:name :buffer}])
|
||||||
|
@ -64,3 +65,4 @@
|
||||||
[{:name :cmdline}])
|
[{:name :cmdline}])
|
||||||
:mapping (cmp.mapping.preset.cmdline)})
|
:mapping (cmp.mapping.preset.cmdline)})
|
||||||
(cmp.event:on :confirm_done (npairs.on_confirm_done {:map_char {:tex ""}})))
|
(cmp.event:on :confirm_done (npairs.on_confirm_done {:map_char {:tex ""}})))
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
(fn setup-linting [opts]
|
(fn setup-linting [opts]
|
||||||
(lint.try_lint)
|
(lint.try_lint)
|
||||||
(aucmd [:BufWritePost :InsertLeave]
|
(aucmd [:BufWinEnter :BufWritePost :InsertLeave]
|
||||||
{:callback #(lint.try_lint) :buffer opts.buf :group augroup}))
|
{:callback #(lint.try_lint) :buffer opts.buf :group augroup}))
|
||||||
|
|
||||||
(each [ft _ (pairs lint.linters_by_ft)]
|
(each [ft _ (pairs lint.linters_by_ft)]
|
||||||
|
|
Loading…
Reference in a new issue