|
|
|
@ -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
|
|
|
|
@ -618,10 +621,16 @@ require('lazy').setup({
|
|
|
|
|
'stevearc/conform.nvim',
|
|
|
|
|
opts = {
|
|
|
|
|
notify_on_error = false,
|
|
|
|
|
format_on_save = {
|
|
|
|
|
timeout_ms = 500,
|
|
|
|
|
lsp_fallback = true,
|
|
|
|
|
},
|
|
|
|
|
format_on_save = function(bufnr)
|
|
|
|
|
-- Disable "format_on_save lsp_fallback" for languages that don't
|
|
|
|
|
-- have a well standardized coding style. You can add additional
|
|
|
|
|
-- languages here or re-enable it for the disabled ones.
|
|
|
|
|
local disable_filetypes = { c = true, cpp = true }
|
|
|
|
|
return {
|
|
|
|
|
timeout_ms = 500,
|
|
|
|
|
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
|
|
|
|
|
}
|
|
|
|
|
end,
|
|
|
|
|
formatters_by_ft = {
|
|
|
|
|
lua = { 'stylua' },
|
|
|
|
|
python = { 'isort', 'black' },
|
|
|
|
@ -667,16 +676,15 @@ require('lazy').setup({
|
|
|
|
|
return 'make install_jsregexp'
|
|
|
|
|
end)(),
|
|
|
|
|
dependencies = {
|
|
|
|
|
-- 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()
|
|
|
|
|
require('luasnip.loaders.from_vscode').lazy_load()
|
|
|
|
|
end,
|
|
|
|
|
},
|
|
|
|
|
-- `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',
|
|
|
|
@ -711,6 +719,10 @@ require('lazy').setup({
|
|
|
|
|
-- 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.
|
|
|
|
@ -739,6 +751,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' },
|
|
|
|
@ -815,8 +830,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`
|
|
|
|
|