diff options
author | Jackson Taylor <jtaylor@classicalconversations.com> | 2024-01-30 19:58:03 -0500 |
---|---|---|
committer | Jackson Taylor <jtaylor@classicalconversations.com> | 2024-01-30 19:58:03 -0500 |
commit | 82fae7bfb4269fe4b1123264bd594c6393784f5c (patch) | |
tree | d40845a9f66de8dd15fdedc1cbafda78aca7bec0 | |
parent | d576efd1ff1c9732fba82c8d5f625f9495f7ce4e (diff) |
NOT WORKING: enable personal snippetsjackson/fix-snippets
-rw-r--r-- | after/plugin/lsp.lua | 24 | ||||
-rw-r--r-- | my_snippets.bak/package.json (renamed from my_snippets/package.json) | 0 | ||||
-rw-r--r-- | my_snippets.bak/python.json (renamed from my_snippets/python.json) | 0 | ||||
-rw-r--r-- | my_snippets.bak/snippets/all.json (renamed from my_snippets/snippets/all.json) | 0 | ||||
-rw-r--r-- | my_snippets/lua.json | 7 |
5 files changed, 21 insertions, 10 deletions
diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua index a438d00..07ce999 100644 --- a/after/plugin/lsp.lua +++ b/after/plugin/lsp.lua @@ -2,6 +2,7 @@ local lsp = require("lsp-zero") lsp.preset("recommended") +-- Language servers I use most lsp.ensure_installed({ 'tsserver', 'eslint', @@ -10,7 +11,7 @@ lsp.ensure_installed({ 'lua_ls', }) --- Fix Undefined global 'vim' +-- Fix Undefined global 'vim'. Does not work lol, using vim outright is still shown as an issue. lsp.configure('lua-language-server', { settings = { Lua = { @@ -21,18 +22,22 @@ lsp.configure('lua-language-server', { } }) --- require("luasnip.loaders.from_vscode").lazy_load({ paths = { "./my-cool-snippets" } }) -require("luasnip.loaders.from_vscode").lazy_load({paths = {"~/snippets"}}) - -- Autocomplettion engine setup -- This is the drop downs that come up local cmp = require('cmp') +-- Not working as far as I can tell +-- require("luasnip.loaders.from_vscode").lazy_load('~') +require("luasnip.loaders.from_vscode").lazy_load() + cmp.setup({ performance = { debounce = 150 -- I'm pretty sure this is the god-sent setting that I have been looking for -}}) + } +}) + local cmp_select = {behavior = cmp.SelectBehavior.Select} + -- These are the mappings to use to navigate the dropdown menu. I usually use <CR> (Enter) the most, or the arrow keys, but these are nice. local cmp_mappings = lsp.defaults.cmp_mappings({ ['<C-p>'] = cmp.mapping.select_prev_item(cmp_select), @@ -50,11 +55,10 @@ lsp.setup_nvim_cmp({ -- NOTE: Priority matters for this. I put buffer on top because I was getting a lot of lag if I happened to type a snippet. -- I feel like what I'm writing is, more often than not, something I've already written so I don't mind scrolling down in the list if I have to make a function or actually use one of the snippets. sources = { - {name = 'buffer'}, -- words found in your buffer (cmp-buffer) - -- {name = 'nvim_lsp'}, -- everything the language server finds (neovim/nvim-lspconfig) - { name = 'nvim_lsp', max_item_count = 10, keyword_length = 4 }, - {name = 'luasnip'}, -- custom/popular snippets for languages (L3MON4D3/LuaSnip and rafamadriz/friendly-snippets) - {name = 'cmd_luasnip'}, -- custom/popular snippets for languages (L3MON4D3/LuaSnip and rafamadriz/friendly-snippets) + {name = 'buffer'}, -- words found in your buffer (cmp-buffer) + {name = 'nvim_lsp', max_item_count = 10, keyword_length = 4}, -- everything the language server finds (neovim/nvim-lspconfig) + {name = 'luasnip'}, -- custom/popular snippets for languages (L3MON4D3/LuaSnip and rafamadriz/friendly-snippets) + {name = 'cmd_luasnip'}, -- custom/popular snippets for languages (L3MON4D3/LuaSnip and rafamadriz/friendly-snippets) } }) diff --git a/my_snippets/package.json b/my_snippets.bak/package.json index 0059209..0059209 100644 --- a/my_snippets/package.json +++ b/my_snippets.bak/package.json diff --git a/my_snippets/python.json b/my_snippets.bak/python.json index 1ebe30a..1ebe30a 100644 --- a/my_snippets/python.json +++ b/my_snippets.bak/python.json diff --git a/my_snippets/snippets/all.json b/my_snippets.bak/snippets/all.json index 29df278..29df278 100644 --- a/my_snippets/snippets/all.json +++ b/my_snippets.bak/snippets/all.json diff --git a/my_snippets/lua.json b/my_snippets/lua.json new file mode 100644 index 0000000..0af009e --- /dev/null +++ b/my_snippets/lua.json @@ -0,0 +1,7 @@ +{ + "jackson": { + "prefix": "jackson", + "body": ["ohahahah"], + "description": "down with the sickness" + }, +} |