From 7715b7c2eed1a7e6ea02fd6a99a9f006c792dce4 Mon Sep 17 00:00:00 2001 From: TLW <58749948+TinyLittleWheatley@users.noreply.github.com> Date: Fri, 15 Mar 2024 17:24:49 +0330 Subject: [PATCH 1/5] doc: add info about timeoutlen (#691) Add separate comment for `timeoutlen` option `timeoutlen` option was under unrelated comment with `updatetime` option. --- init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.lua b/init.lua index 04cc6b7..964ff82 100644 --- a/init.lua +++ b/init.lua @@ -130,6 +130,9 @@ vim.opt.signcolumn = 'yes' -- Decrease update time vim.opt.updatetime = 250 + +-- Decrease mapped sequence wait time +-- Displays which-key popup sooner vim.opt.timeoutlen = 300 -- Configure how new splits should be opened From 452e3a73cfc87995c58f8d46effa370da4fd1131 Mon Sep 17 00:00:00 2001 From: Rafael Zasas <42390827+RafaelZasas@users.noreply.github.com> Date: Fri, 15 Mar 2024 16:12:41 +0200 Subject: [PATCH 2/5] Add / cmp mapping to scroll cmp docs (#750) --- init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/init.lua b/init.lua index 964ff82..26774a5 100644 --- a/init.lua +++ b/init.lua @@ -674,6 +674,10 @@ require('lazy').setup({ -- Select the [p]revious item [''] = cmp.mapping.select_prev_item(), + -- scroll the documentation window [b]ack / [f]orward + [''] = cmp.mapping.scroll_docs(-4), + [''] = 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. From 2f494e59cae64a2d62dc2377ab317a963fa2e5d5 Mon Sep 17 00:00:00 2001 From: Vladislav Grechannik <52157081+VlaDexa@users.noreply.github.com> Date: Fri, 15 Mar 2024 15:35:42 +0100 Subject: [PATCH 3/5] Move friendly snippets to dependencies of LuaSnip (#759) Co-authored-by: TJ DeVries --- init.lua | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/init.lua b/init.lua index 26774a5..552e16a 100644 --- a/init.lua +++ b/init.lua @@ -635,6 +635,17 @@ require('lazy').setup({ 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', @@ -643,12 +654,6 @@ require('lazy').setup({ -- 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` From 5ac4b58f85fe14992c5c9ff7fee894a69fff4010 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Fri, 15 Mar 2024 11:18:43 -0400 Subject: [PATCH 4/5] doc: add note about advanced luasnip features --- init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.lua b/init.lua index 552e16a..c504ccb 100644 --- a/init.lua +++ b/init.lua @@ -711,6 +711,9 @@ require('lazy').setup({ 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' }, From 7892c0c354639985b1cf36f11d175201590e267b Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Fri, 15 Mar 2024 11:35:07 -0400 Subject: [PATCH 5/5] fix: disable ts indenting for Ruby Tree-sitter indenting for ruby is pretty terrible. But the fix requires a few steps, so showed those and documented how you could do that for other languages as well (with the tricky part being the additional_vim_regex_highlighting trick) --- init.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index c504ccb..87133dd 100644 --- a/init.lua +++ b/init.lua @@ -790,8 +790,14 @@ require('lazy').setup({ ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' }, -- Autoinstall languages that are not installed auto_install = true, - highlight = { enable = true }, - indent = { enable = true }, + highlight = { + enable = true, + -- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules. + -- If you are experiencing weird indenting issues, add the language to + -- the list of additional_vim_regex_highlighting and disabled languages for indent. + additional_vim_regex_highlighting = { 'ruby' }, + }, + indent = { enable = true, disable = { 'ruby' } }, }, config = function(_, opts) -- [[ Configure Treesitter ]] See `:help nvim-treesitter`