aboutsummaryrefslogtreecommitdiff
path: root/lua/kickstart/plugins/cmp.lua
diff options
context:
space:
mode:
authorDamjan 9000 <damjan.9000@gmail.com>2024-03-15 18:15:40 +0100
committerDamjan 9000 <damjan.9000@gmail.com>2024-03-15 18:18:21 +0100
commit55008e9c684279c7606aadc9da7c07ec20fc8ed7 (patch)
tree71a06635df453a8aa76d7ad4dd8c03ce1f5150c0 /lua/kickstart/plugins/cmp.lua
parentf02070e07692bdcad7398642149e2093e8836344 (diff)
parent7892c0c354639985b1cf36f11d175201590e267b (diff)
Merge 'upstream' timeoutlen, cmp scroll, friendly snippets, luasnip, ruby
Merged: - fix: disable ts indenting for Ruby - doc: add note about advanced luasnip features - Move friendly snippets to dependencies of LuaSnip (#759) - Add <C-b>/<C-f> cmp mapping to scroll cmp docs (#750) - doc: add info about timeoutlen (#691)
Diffstat (limited to 'lua/kickstart/plugins/cmp.lua')
-rw-r--r--lua/kickstart/plugins/cmp.lua24
1 files changed, 18 insertions, 6 deletions
diff --git a/lua/kickstart/plugins/cmp.lua b/lua/kickstart/plugins/cmp.lua
index f42fc68..7ed2ba8 100644
--- a/lua/kickstart/plugins/cmp.lua
+++ b/lua/kickstart/plugins/cmp.lua
@@ -15,6 +15,17 @@ return {
end
return 'make install_jsregexp'
end)(),
+ dependencies = {
+ -- `friendly-snippets` contains a variety of premade snippets.
+ -- See the README about individual language/framework/plugin snippets:
+ -- https://github.com/rafamadriz/friendly-snippets
+ -- {
+ -- 'rafamadriz/friendly-snippets',
+ -- config = function()
+ -- require('luasnip.loaders.from_vscode').lazy_load()
+ -- end,
+ -- },
+ },
},
'saadparwaiz1/cmp_luasnip',
@@ -23,12 +34,6 @@ return {
-- into multiple repos for maintenance purposes.
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-path',
-
- -- If you want to add a bunch of pre-configured snippets,
- -- you can use this plugin to help you. It even has snippets
- -- for various frameworks/libraries/etc. but you will have to
- -- set up the ones that are useful for you.
- -- 'rafamadriz/friendly-snippets',
},
config = function()
-- See `:help cmp`
@@ -54,6 +59,10 @@ return {
-- Select the [p]revious item
['<C-p>'] = cmp.mapping.select_prev_item(),
+ -- scroll the documentation window [b]ack / [f]orward
+ ['<C-b>'] = cmp.mapping.scroll_docs(-4),
+ ['<C-f>'] = cmp.mapping.scroll_docs(4),
+
-- Accept ([y]es) the completion.
-- This will auto-import if your LSP supports it.
-- This will expand snippets if the LSP sent a snippet.
@@ -82,6 +91,9 @@ return {
luasnip.jump(-1)
end
end, { 'i', 's' }),
+
+ -- For more advanced luasnip keymaps (e.g. selecting choice nodes, expansion) see:
+ -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
},
sources = {
{ name = 'nvim_lsp' },