Wrote plugin to quickly format functions into multi-line params, added orgmode plugin, moved completion plugin into its own file, commented out lspconfig/mason dependencies and utilized nvim 0.12 builtin commands in plugin/lsp.lua to handle lsp. Added treesitter context for text blocks within functions, changed default color to tokyonight, added a few keybinds.
This commit is contained in:
parent
db83c74814
commit
ea35497903
11 changed files with 520 additions and 251 deletions
40
lua/plugins/completion.lua
Normal file
40
lua/plugins/completion.lua
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
return {
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-buffer",
|
||||
},
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
|
||||
cmp.setup({
|
||||
preselect = cmp.PreselectMode.Item, -- <— preselect first item
|
||||
completion = { completeopt = "menu,menuone,noinsert" },
|
||||
window = { documentation = cmp.config.window.bordered() },
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<C-Space>"] = cmp.mapping.complete(), -- manual trigger if you want it
|
||||
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-u>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then cmp.select_next_item() else fallback() end
|
||||
end, { "i", "s" }),
|
||||
["<S-Tab>"] = cmp.mapping(function()
|
||||
if cmp.visible() then cmp.select_prev_item() end
|
||||
end, { "i", "s" }),
|
||||
}),
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "path" },
|
||||
{ name = "buffer", keyword_length = 3 },
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue