.
This commit is contained in:
1 parent
cff80541c9
commit
f8b9becdb8
98 files changed
-15609
No files matched your search
@@ -1,35 +0,0 @@
|
||||
local ai = require('mini.ai')
|
||||
|
||||
ai.setup({
|
||||
custom_textobjects = {
|
||||
o = ai.gen_spec.treesitter({
|
||||
a = { '@block.outer', '@conditional.outer', '@loop.outer' },
|
||||
i = { '@block.inner', '@conditional.inner', '@loop.inner' },
|
||||
}, {}),
|
||||
f = ai.gen_spec.treesitter({ a = '@function.outer', i = '@function.inner' }, {}),
|
||||
c = ai.gen_spec.treesitter({ a = '@class.outer', i = '@class.inner' }, {}),
|
||||
t = { '<([%p%w]-)%f[^<%w][^<>]->.-</%1>', '^<.->().*()</[^/]->$' },
|
||||
},
|
||||
|
||||
mappings = {
|
||||
-- Main textobject prefixes
|
||||
around = 'a',
|
||||
inside = 'i',
|
||||
|
||||
-- Next/last variants
|
||||
around_next = 'an',
|
||||
inside_next = 'in',
|
||||
around_last = 'al',
|
||||
inside_last = 'il',
|
||||
|
||||
-- Move cursor to corresponding edge of `a` textobject
|
||||
goto_left = 'g[',
|
||||
goto_right = 'g]',
|
||||
},
|
||||
|
||||
-- How to search for object
|
||||
-- 'cover', 'cover_or_next', 'cover_or_prev','cover_or_nearest', 'next', 'previous', 'nearest'.
|
||||
search_method = 'cover_or_next',
|
||||
n_lines = 500,
|
||||
silent = false,
|
||||
})
|
||||
@@ -1,26 +0,0 @@
|
||||
local npairs = require('nvim-autopairs')
|
||||
|
||||
npairs.setup({
|
||||
check_ts = true,
|
||||
ts_config = {
|
||||
lua = { 'string', 'source' },
|
||||
javascript = { 'string', 'template_string' },
|
||||
java = false,
|
||||
},
|
||||
disable_filetype = { 'TelescopePrompt', 'spectre_panel' },
|
||||
fast_wrap = {
|
||||
map = '<M-s>',
|
||||
chars = { '{', '[', '(', '"', "'" },
|
||||
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], '%s+', ''),
|
||||
offset = 0,
|
||||
end_key = '$',
|
||||
keys = 'qwertyuiopzxcvbnmasdfghjkl',
|
||||
check_comma = true,
|
||||
highlight = 'PmenuSel',
|
||||
highlight_grey = 'LineNr',
|
||||
},
|
||||
})
|
||||
|
||||
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
|
||||
local cmp = require('cmp')
|
||||
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = '' } }))
|
||||
@@ -1,246 +0,0 @@
|
||||
local cmp = require('cmp')
|
||||
local luasnip = require('luasnip')
|
||||
|
||||
require('luasnip/loaders/from_vscode').lazy_load()
|
||||
|
||||
local icons = require('lib.icons')
|
||||
local kind_icons = icons.kind
|
||||
|
||||
local max_count = 15
|
||||
local rounded_border = true
|
||||
|
||||
local function border(hl_name)
|
||||
if rounded_border then
|
||||
return {
|
||||
{ "╭", hl_name },
|
||||
{ "─", hl_name },
|
||||
{ "╮", hl_name },
|
||||
{ "│", hl_name },
|
||||
{ "╯", hl_name },
|
||||
{ "─", hl_name },
|
||||
{ "╰", hl_name },
|
||||
{ "│", hl_name },
|
||||
}
|
||||
else
|
||||
return {
|
||||
{ "┌", hl_name },
|
||||
{ "─", hl_name },
|
||||
{ "┐", hl_name },
|
||||
{ "│", hl_name },
|
||||
{ "┘", hl_name },
|
||||
{ "─", hl_name },
|
||||
{ "└", hl_name },
|
||||
{ "│", hl_name },
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
-- פּ ﯟ some other good icons
|
||||
local kind_icons = {
|
||||
Text = "",
|
||||
Method = " '",
|
||||
Function = "",
|
||||
Constructor = "",
|
||||
Field = "",
|
||||
Variable = "",
|
||||
Class = "",
|
||||
Interface = "",
|
||||
Module = "",
|
||||
Property = "",
|
||||
Unit = "",
|
||||
Value = " ",
|
||||
Enum = " ",
|
||||
Keyword = "",
|
||||
Snippet = "",
|
||||
Color = "",
|
||||
File = " ",
|
||||
Reference = "",
|
||||
Folder = "",
|
||||
EnumMember = "",
|
||||
Constant = "",
|
||||
Struct = "",
|
||||
Event = "",
|
||||
Operator = "",
|
||||
TypeParameter = "",
|
||||
}
|
||||
|
||||
cmp.setup({
|
||||
completion = {
|
||||
completeopt = 'menu,menuone,preview,noselect',
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
|
||||
mapping = {
|
||||
['<C-k>'] = cmp.mapping.select_prev_item(),
|
||||
['<C-j>'] = cmp.mapping.select_next_item(),
|
||||
['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-1), { 'i', 'c' }),
|
||||
['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(1), { 'i', 'c' }),
|
||||
['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
|
||||
['<C-u>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-y>'] = cmp.config.disable,
|
||||
['<C-c>'] = cmp.mapping({
|
||||
i = cmp.mapping.abort(),
|
||||
c = cmp.mapping.close(),
|
||||
}),
|
||||
['<CR>'] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = false,
|
||||
}),
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expandable() then
|
||||
luasnip.expand()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
},
|
||||
formatting = {
|
||||
fields = { 'kind', 'abbr', 'menu' },
|
||||
expandable_indicator = true,
|
||||
format = function(entry, vim_item)
|
||||
-- Kind icons
|
||||
vim_item.kind = kind_icons[vim_item.kind]
|
||||
vim_item.menu = ({
|
||||
codeium = '[Codeium]',
|
||||
nvim_lsp = '[LSP]',
|
||||
luasnip = '[Snippet]',
|
||||
buffer = '[Buffer]',
|
||||
path = '[Path]',
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'path' },
|
||||
{ name = 'nvim_lua' },
|
||||
{ name = 'luasnip', keyword_length = 2 },
|
||||
{ name = 'buffer', keyword_length = 3 },
|
||||
{ name = 'codeium'},
|
||||
{ name = 'lazydev', group_index = 0 },
|
||||
},
|
||||
confirm_opts = {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = false,
|
||||
},
|
||||
window = {
|
||||
documentation = {
|
||||
border = 'rounded',
|
||||
winhighlight = 'NormalFloat:Pmenu,NormalFloat:Pmenu,CursorLine:PmenuSel,Search:None',
|
||||
max_height = 15,
|
||||
scrollbar = false,
|
||||
},
|
||||
completion = {
|
||||
border = 'rounded',
|
||||
winhighlight = 'NormalFloat:Pmenu,NormalFloat:Pmenu,CursorLine:PmenuSel,Search:None',
|
||||
scrollbar = false,
|
||||
},
|
||||
},
|
||||
experimental = {
|
||||
ghost_text = true
|
||||
}
|
||||
})
|
||||
|
||||
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline({'/','?'}, {
|
||||
formatting = {
|
||||
fields = { "kind", "abbr" },
|
||||
format = function(entry, vim_item)
|
||||
-- Kind icons
|
||||
vim_item.kind = string.format("%s", kind_icons[vim_item.kind])
|
||||
vim_item.menu = ({
|
||||
buffer = "(buffer)"
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{
|
||||
name = 'buffer',
|
||||
option = { max_item_count = max_count }
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline(':', {
|
||||
formatting = {
|
||||
fields = { "kind", "abbr", "menu" },
|
||||
format = function(entry, vim_item)
|
||||
-- Kind icons
|
||||
vim_item.kind = string.format("%s", kind_icons[vim_item.kind])
|
||||
vim_item.menu = ({
|
||||
buffer = "(buffer)",
|
||||
path = "(path)",
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{
|
||||
name = 'path',
|
||||
option = { max_item_count = 10 }
|
||||
}
|
||||
},
|
||||
{
|
||||
{
|
||||
name = 'cmdline',
|
||||
option = { max_item_count = 10 }
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
cmp.setup.filetype("lua", {
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'luasnip' }, -- For luasnip users.
|
||||
{ name = 'nvim_lsp' },
|
||||
{
|
||||
name = "nvim_lua",
|
||||
option = { max_item_count = max_count }
|
||||
},
|
||||
{
|
||||
name = 'buffer',
|
||||
option = { keyword_length = 1 }
|
||||
},
|
||||
{ name = "path" },
|
||||
{ name = "orgmode" },
|
||||
}),
|
||||
})
|
||||
|
||||
cmp.setup.filetype("norg", {
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'luasnip' }, -- For luasnip users.
|
||||
{
|
||||
name = 'neorg',
|
||||
option = { max_item_count = max_count }
|
||||
},
|
||||
{ name = 'buffer', },
|
||||
{ name = "path" },
|
||||
})
|
||||
})
|
||||
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
local snippet_path = vim.fn.stdpath("config") .. "/snippets"
|
||||
require("luasnip.loaders.from_snipmate").load({ path = { snippet_path } })
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
require('codeium').setup({
|
||||
|
||||
})
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
local comment = require('mini.comment')
|
||||
|
||||
require('ts_context_commentstring').setup({
|
||||
enable_autocmd = false,
|
||||
-- languages = { typescript = '// %s' },
|
||||
})
|
||||
|
||||
comment.setup({
|
||||
options = {
|
||||
custom_commentstring = function()
|
||||
return require('ts_context_commentstring.internal').calculate_commentstring() or vim.bo.commentstring
|
||||
end,
|
||||
ignore_blank_line = true,
|
||||
start_of_line = false,
|
||||
pad_comment_parts = true,
|
||||
},
|
||||
|
||||
mappings = {
|
||||
-- Toggle comment (like `gcip` - comment inner paragraph) for both
|
||||
comment = 'gc',
|
||||
comment_line = 'gcc',
|
||||
comment_visual = 'gc',
|
||||
-- Define 'comment' textobject (like `dgc` - delete whole comment block)
|
||||
textobject = 'gc',
|
||||
},
|
||||
})
|
||||
@@ -1,152 +0,0 @@
|
||||
local dap = require('dap')
|
||||
local dapui = require('dapui')
|
||||
local icons = require('lib.icons')
|
||||
|
||||
dapui.setup({
|
||||
icons = { expanded = icons.ui.ArrowClosed, collapsed = icons.ui.ArrowOpen },
|
||||
mappings = {
|
||||
expand = { '<CR>', '<2-LeftMouse>' },
|
||||
open = 'o',
|
||||
remove = 'd',
|
||||
edit = 'e',
|
||||
repl = 'r',
|
||||
toggle = 't',
|
||||
},
|
||||
expand_lines = vim.fn.has('nvim-0.7'),
|
||||
layouts = {
|
||||
{
|
||||
elements = {
|
||||
{ id = 'scopes', size = 0.25 },
|
||||
'breakpoints',
|
||||
'stacks',
|
||||
'watches',
|
||||
},
|
||||
size = 40,
|
||||
position = 'right',
|
||||
},
|
||||
{
|
||||
elements = {
|
||||
'repl',
|
||||
'console',
|
||||
},
|
||||
size = 0.25,
|
||||
position = 'bottom',
|
||||
},
|
||||
},
|
||||
floating = {
|
||||
max_height = nil,
|
||||
max_width = nil,
|
||||
border = 'rounded',
|
||||
mappings = {
|
||||
close = { 'q', '<Esc>' },
|
||||
},
|
||||
},
|
||||
windows = { indent = 1 },
|
||||
render = {
|
||||
max_type_length = nil,
|
||||
},
|
||||
})
|
||||
|
||||
vim.fn.sign_define('DapBreakpoint', { text = icons.ui.Bug, texthl = 'DiagnosticSignError', linehl = '', numhl = '' })
|
||||
|
||||
dap.listeners.after.event_initialized['dapui_config'] = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated['dapui_config'] = function()
|
||||
dapui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited['dapui_config'] = function()
|
||||
dapui.close()
|
||||
end
|
||||
|
||||
dap.adapters.python = {
|
||||
type = 'executable',
|
||||
command = '/usr/bin/python',
|
||||
args = { '-m', 'debugpy.adapter' },
|
||||
}
|
||||
|
||||
dap.configurations.python = {
|
||||
{
|
||||
type = 'python',
|
||||
request = 'launch',
|
||||
name = 'Launch file',
|
||||
|
||||
program = '${file}',
|
||||
pythonPath = function()
|
||||
local cwd = vim.fn.getcwd()
|
||||
if vim.fn.executable(cwd .. '/venv/bin/python') == 1 then
|
||||
return cwd .. '/venv/bin/python'
|
||||
elseif vim.fn.executable(cwd .. '/.venv/bin/python') == 1 then
|
||||
return cwd .. '/.venv/bin/python'
|
||||
else
|
||||
return '/usr/bin/python'
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
dap.adapters.ruby = {
|
||||
type = 'executable',
|
||||
command = 'bundle',
|
||||
args = { 'exec', 'readapt', 'stdio' },
|
||||
}
|
||||
|
||||
dap.configurations.ruby = {
|
||||
{
|
||||
type = 'ruby',
|
||||
request = 'launch',
|
||||
name = 'Rails',
|
||||
program = 'bundle',
|
||||
programArgs = { 'exec', 'rails', 's' },
|
||||
useBundler = true,
|
||||
},
|
||||
}
|
||||
|
||||
dap.configurations.java = {
|
||||
{
|
||||
name = "Debug Launch (2GB)";
|
||||
type = 'java';
|
||||
request = 'launch';
|
||||
vmArgs = "" ..
|
||||
"-Xmx2g "
|
||||
},
|
||||
{
|
||||
name = "Debug Attach (8000)";
|
||||
type = 'java';
|
||||
request = 'attach';
|
||||
hostName = "127.0.0.1";
|
||||
port = 8000;
|
||||
},
|
||||
{
|
||||
name = "Debug Attach (5005)";
|
||||
type = 'java';
|
||||
request = 'attach';
|
||||
hostName = "127.0.0.1";
|
||||
port = 5005;
|
||||
},
|
||||
{
|
||||
name = "My Custom Java Run Configuration",
|
||||
type = "java",
|
||||
request = "launch",
|
||||
-- You need to extend the classPath to list your dependencies.
|
||||
-- `nvim-jdtls` would automatically add the `classPaths` property if it is missing
|
||||
-- classPaths = {},
|
||||
|
||||
-- If using multi-module projects, remove otherwise.
|
||||
-- projectName = "yourProjectName",
|
||||
|
||||
-- javaExec = "java",
|
||||
mainClass = "replace.with.your.fully.qualified.MainClass",
|
||||
|
||||
-- If using the JDK9+ module system, this needs to be extended
|
||||
-- `nvim-jdtls` would automatically populate this property
|
||||
-- modulePaths = {},
|
||||
vmArgs = "" ..
|
||||
"-Xmx2g "
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
vim.api.nvim_create_user_command('DapUIToggle', function()
|
||||
require('dapui').toggle()
|
||||
end, {})
|
||||
@@ -1,4 +0,0 @@
|
||||
local lsp_lines = require('lsp_lines')
|
||||
|
||||
lsp_lines.setup()
|
||||
vim.diagnostic.config({ virtual_text = false })
|
||||
@@ -1,49 +0,0 @@
|
||||
local lspconfig = require('lspconfig')
|
||||
local cmp_lsp = require('cmp_nvim_lsp')
|
||||
local icons = require('lib.icons').diagnostics
|
||||
|
||||
local auto_install = require('lib.util').get_user_config('auto_install', true)
|
||||
local installed_servers = {}
|
||||
if auto_install then
|
||||
installed_servers = require('plugins.list').lsp_servers
|
||||
end
|
||||
|
||||
local lsp_capabilities = cmp_lsp.default_capabilities()
|
||||
local default_setup = function(server)
|
||||
lspconfig[server].setup({
|
||||
capabilities = lsp_capabilities,
|
||||
})
|
||||
end
|
||||
|
||||
local signs = { Error = icons.Error, Warn = icons.Warning, Hint = icons.Hint, Info = icons.Information }
|
||||
for type, icon in pairs(signs) do
|
||||
local hl = 'DiagnosticSign' .. type
|
||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = '' })
|
||||
end
|
||||
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = installed_servers,
|
||||
handlers = {
|
||||
default_setup,
|
||||
lua_ls = function()
|
||||
lspconfig.lua_ls.setup({
|
||||
capabilities = lsp_capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = { version = 'LuaJIT' },
|
||||
diagnostics = { globals = { 'vim' } },
|
||||
workspace = { library = { vim.env.VIMRUNTIME } },
|
||||
format = {
|
||||
enable = true,
|
||||
defaultConfig = {
|
||||
align_continuous_assign_statement = false,
|
||||
align_continuous_rect_table_field = false,
|
||||
align_array_table = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
@@ -1,21 +0,0 @@
|
||||
local lspsaga = require('lspsaga')
|
||||
|
||||
local icons = require('lib.icons')
|
||||
|
||||
lspsaga.setup({
|
||||
ui = {
|
||||
theme = 'round',
|
||||
border = 'rounded',
|
||||
devicon = true,
|
||||
title = true,
|
||||
winblend = 1,
|
||||
expand = icons.ui.ArrowOpen,
|
||||
collapse = icons.ui.ArrowClosed,
|
||||
preview = icons.ui.List,
|
||||
code_action = icons.diagnostics.Hint,
|
||||
diagnostic = icons.ui.Bug,
|
||||
incoming = icons.ui.Incoming,
|
||||
outgoing = icons.ui.Outgoing,
|
||||
hover = icons.ui.Comment,
|
||||
},
|
||||
})
|
||||
@@ -1,35 +0,0 @@
|
||||
local mason = require('mason')
|
||||
|
||||
local icons = require('lib.icons')
|
||||
mason.setup({
|
||||
-- - "prepend": Use mason binary, "append": Use system binary
|
||||
PATH = 'append',
|
||||
|
||||
log_level = vim.log.levels.INFO,
|
||||
max_concurrent_installers = 8,
|
||||
|
||||
ui = {
|
||||
check_outdated_packages_on_open = true,
|
||||
border = 'rounded',
|
||||
width = 0.8,
|
||||
height = 0.8,
|
||||
|
||||
icons = {
|
||||
package_installed = icons.ui.Gear,
|
||||
package_pending = icons.ui.Download,
|
||||
package_uninstalled = icons.ui.Plus,
|
||||
},
|
||||
|
||||
keymaps = {
|
||||
toggle_package_expand = '<CR>',
|
||||
install_package = 'i',
|
||||
update_package = 'u',
|
||||
check_package_version = 'c',
|
||||
update_all_packages = 'U',
|
||||
check_outdated_packages = 'C',
|
||||
uninstall_package = 'x',
|
||||
cancel_installation = '<C-c>',
|
||||
apply_language_filter = '<C-f>',
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -1,20 +0,0 @@
|
||||
local neotest = require('neotest')
|
||||
|
||||
neotest.setup({
|
||||
adapters = {
|
||||
require('neotest-rspec')({
|
||||
rspec_cmd = function()
|
||||
return vim.tbl_flatten({
|
||||
'bundle',
|
||||
'exec',
|
||||
'rspec',
|
||||
})
|
||||
end,
|
||||
}),
|
||||
require('neotest-jest')({
|
||||
jestCommand = 'npx jest --',
|
||||
jestConfigFile = 'jest.config.js',
|
||||
}),
|
||||
require('neotest-python'),
|
||||
},
|
||||
})
|
||||
@@ -1,51 +0,0 @@
|
||||
local null_ls = require('null-ls')
|
||||
|
||||
local action = null_ls.builtins.code_actions
|
||||
local comp = null_ls.builtins.completion
|
||||
local diag = null_ls.builtins.diagnostics
|
||||
local format = null_ls.builtins.formatting
|
||||
local hover = null_ls.builtins.hover
|
||||
|
||||
-- Buily in sources: https://github.com/nvimtools/none-ls.nvim/blob/main/doc/BUILTINS.md
|
||||
null_ls.setup({
|
||||
debug = false,
|
||||
border = 'rounded',
|
||||
log_level = 'info',
|
||||
diagnostics_format = '#{c} #{m} (#{s})',
|
||||
sources = {
|
||||
action.proselint, -- markdown actions
|
||||
action.refactoring,
|
||||
action.ts_node_action, -- treesitter node actions
|
||||
comp.spell, -- spell completion
|
||||
comp.tags, -- tags completion
|
||||
diag.actionlint, -- github action lint
|
||||
diag.credo, -- elixir diagnostics
|
||||
diag.golangci_lint,
|
||||
diag.hadolint, -- docker lint
|
||||
diag.proselint, -- markdown lint
|
||||
diag.reek, -- ruby code smell
|
||||
diag.rubocop, -- ruby diagnostics
|
||||
diag.todo_comments,
|
||||
diag.trail_space, -- trailing space check
|
||||
diag.vint, -- vim lint
|
||||
diag.write_good, -- english writing style
|
||||
format.mix, -- elixir formatter
|
||||
format.prettier, -- js, md, css, etc formatter
|
||||
format.rubocop, -- ruby formatter
|
||||
format.shfmt, -- shell formatter
|
||||
format.stylua, -- lua formatter
|
||||
hover.dictionary, -- show word dictionary on hover
|
||||
hover.printenv, -- show env on hover
|
||||
},
|
||||
})
|
||||
|
||||
local auto_install = require('lib.util').get_user_config('auto_install', true)
|
||||
local installed_sources = {}
|
||||
if auto_install then
|
||||
installed_sources = require('plugins.list').null_ls_sources
|
||||
end
|
||||
|
||||
require('mason-null-ls').setup({
|
||||
ensure_installed = installed_sources,
|
||||
automatic_installation = auto_install,
|
||||
})
|
||||
@@ -1,25 +0,0 @@
|
||||
local refactoring = require('refactoring')
|
||||
|
||||
refactoring.setup({
|
||||
prompt_func_return_type = {
|
||||
go = false,
|
||||
java = false,
|
||||
cpp = false,
|
||||
c = false,
|
||||
h = false,
|
||||
hpp = false,
|
||||
cxx = false,
|
||||
},
|
||||
prompt_func_param_type = {
|
||||
go = false,
|
||||
java = false,
|
||||
|
||||
cpp = false,
|
||||
c = false,
|
||||
h = false,
|
||||
hpp = false,
|
||||
cxx = false,
|
||||
},
|
||||
printf_statements = {},
|
||||
print_var_statements = {},
|
||||
})
|
||||
@@ -1,20 +0,0 @@
|
||||
local ror = require('ror')
|
||||
local icons = require('lib.icons')
|
||||
|
||||
ror.setup({
|
||||
test = {
|
||||
message = {
|
||||
file = 'Running test file...',
|
||||
line = 'Running single test...',
|
||||
},
|
||||
coverage = {
|
||||
up = 'DiffAdd',
|
||||
down = 'DiffDelete',
|
||||
},
|
||||
notification = {
|
||||
timeout = false,
|
||||
},
|
||||
pass_icon = icons.ui.Check,
|
||||
fail_icon = icons.ui.Close,
|
||||
},
|
||||
})
|
||||
@@ -1,14 +0,0 @@
|
||||
local sniprun = require('sniprun')
|
||||
|
||||
sniprun.setup({
|
||||
display = { 'VirtualTextOk', 'VirtualTextErr' },
|
||||
show_no_output = { 'Classic', 'TempFloatingWindow' },
|
||||
|
||||
display_options = {
|
||||
terminal_width = 45,
|
||||
notification_timeout = 5,
|
||||
},
|
||||
|
||||
inline_messages = 0,
|
||||
borders = 'single',
|
||||
})
|
||||
@@ -1,25 +0,0 @@
|
||||
local surround = require('mini.surround')
|
||||
|
||||
surround.setup({
|
||||
custom_surroundings = nil,
|
||||
mappings = {
|
||||
add = 'gsa',
|
||||
delete = 'gsd',
|
||||
find = 'gsf',
|
||||
find_left = 'gsF',
|
||||
highlight = 'gsh',
|
||||
replace = 'gsr',
|
||||
update_n_lines = 'gsn',
|
||||
|
||||
suffix_last = 'l', -- Suffix to search with "prev" method
|
||||
suffix_next = 'n', -- Suffix to search with "next" method
|
||||
},
|
||||
|
||||
-- How to search for surrounding
|
||||
-- 'cover', 'cover_or_next', 'cover_or_prev','cover_or_nearest', 'next', 'previous', 'nearest'.
|
||||
search_method = 'cover_or_nearest',
|
||||
highlight_duration = 500,
|
||||
n_lines = 20,
|
||||
respect_selection_type = false,
|
||||
silent = false,
|
||||
})
|
||||
@@ -1,115 +0,0 @@
|
||||
local textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true,
|
||||
|
||||
keymaps = {
|
||||
['a='] = { query = '@assignment.outer', desc = 'Select outer part of an assignment' },
|
||||
['i='] = { query = '@assignment.inner', desc = 'Select inner part of an assignment' },
|
||||
['al='] = { query = '@assignment.lhs', desc = 'Select left hand side of an assignment' },
|
||||
['ar='] = {
|
||||
query = '@assignment.rhs',
|
||||
desc = 'Select right hand side of an assignment',
|
||||
},
|
||||
|
||||
['a:'] = { query = '@property.outer', desc = 'Select outer part of an object property' },
|
||||
['i:'] = { query = '@property.inner', desc = 'Select inner part of an object property' },
|
||||
['l:'] = { query = '@property.lhs', desc = 'Select left part of an object property' },
|
||||
['r:'] = { query = '@property.rhs', desc = 'Select right part of an object property' },
|
||||
|
||||
['aa'] = {
|
||||
query = '@parameter.outer',
|
||||
desc = 'Select outer part of a parameter/argument',
|
||||
},
|
||||
['ia'] = {
|
||||
query = '@parameter.inner',
|
||||
desc = 'Select inner part of a parameter/argument',
|
||||
},
|
||||
|
||||
['ai'] = { query = '@conditional.outer', desc = 'Select outer part of a conditional' },
|
||||
['ii'] = { query = '@conditional.inner', desc = 'Select inner part of a conditional' },
|
||||
|
||||
['al'] = { query = '@loop.outer', desc = 'Select outer part of a loop' },
|
||||
['il'] = { query = '@loop.inner', desc = 'Select inner part of a loop' },
|
||||
|
||||
['af'] = { query = '@call.outer', desc = 'Select outer part of a function call' },
|
||||
['if'] = { query = '@call.inner', desc = 'Select inner part of a function call' },
|
||||
|
||||
['am'] = {
|
||||
query = '@function.outer',
|
||||
desc = 'Select outer part of a method/function definition',
|
||||
},
|
||||
['im'] = {
|
||||
query = '@function.inner',
|
||||
desc = 'Select inner part of a method/function definition',
|
||||
},
|
||||
|
||||
['ac'] = { query = '@class.outer', desc = 'Select outer part of a class' },
|
||||
['ic'] = { query = '@class.inner', desc = 'Select inner part of a class' },
|
||||
},
|
||||
},
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
['<leader>rna'] = '@parameter.inner', -- swap object property with next
|
||||
['<leader>rn:'] = '@property.outer', -- swap parameters/argument with next
|
||||
['<leader>rnm'] = '@function.outer', -- swap function with next
|
||||
},
|
||||
swap_previous = {
|
||||
['<leader>rpa'] = '@parameter.inner', -- swap parameters/argument with prev
|
||||
['<leader>rp:'] = '@property.outer', -- swap object property with prev
|
||||
['<leader>rpm'] = '@function.outer', -- swap function with previous
|
||||
},
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = true, -- whether to set jumps in the jumplist
|
||||
goto_next_start = {
|
||||
[']f'] = { query = '@call.outer', desc = 'Next function call start' },
|
||||
[']m'] = { query = '@function.outer', desc = 'Next method/function def start' },
|
||||
[']c'] = { query = '@class.outer', desc = 'Next class start' },
|
||||
[']i'] = { query = '@conditional.outer', desc = 'Next conditional start' },
|
||||
[']l'] = { query = '@loop.outer', desc = 'Next loop start' },
|
||||
|
||||
-- You can pass a query group to use query from `queries/<lang>/<query_group>.scm file in your runtime path.
|
||||
-- Below example nvim-treesitter's `locals.scm` and `folds.scm`. They also provide highlights.scm and indent.scm.
|
||||
[']S'] = { query = '@scope', query_group = 'locals', desc = 'Next scope' },
|
||||
[']z'] = { query = '@fold', query_group = 'folds', desc = 'Next fold' },
|
||||
},
|
||||
goto_next_end = {
|
||||
[']F'] = { query = '@call.outer', desc = 'Next function call end' },
|
||||
[']M'] = { query = '@function.outer', desc = 'Next method/function def end' },
|
||||
[']C'] = { query = '@class.outer', desc = 'Next class end' },
|
||||
[']I'] = { query = '@conditional.outer', desc = 'Next conditional end' },
|
||||
[']L'] = { query = '@loop.outer', desc = 'Next loop end' },
|
||||
},
|
||||
goto_previous_start = {
|
||||
['[f'] = { query = '@call.outer', desc = 'Prev function call start' },
|
||||
['[m'] = { query = '@function.outer', desc = 'Prev method/function def start' },
|
||||
['[c'] = { query = '@class.outer', desc = 'Prev class start' },
|
||||
['[i'] = { query = '@conditional.outer', desc = 'Prev conditional start' },
|
||||
['[l'] = { query = '@loop.outer', desc = 'Prev loop start' },
|
||||
},
|
||||
goto_previous_end = {
|
||||
['[F'] = { query = '@call.outer', desc = 'Prev function call end' },
|
||||
['[M'] = { query = '@function.outer', desc = 'Prev method/function def end' },
|
||||
['[C'] = { query = '@class.outer', desc = 'Prev class end' },
|
||||
['[I'] = { query = '@conditional.outer', desc = 'Prev conditional end' },
|
||||
['[L'] = { query = '@loop.outer', desc = 'Prev loop end' },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
local ts_repeat_move = require('nvim-treesitter.textobjects.repeatable_move')
|
||||
|
||||
-- vim way: ; goes to the direction you were moving.
|
||||
vim.keymap.set({ 'n', 'x', 'o' }, ';', ts_repeat_move.repeat_last_move)
|
||||
vim.keymap.set({ 'n', 'x', 'o' }, ',', ts_repeat_move.repeat_last_move_opposite)
|
||||
|
||||
-- Optionally, make builtin f, F, t, T also repeatable with ; and ,
|
||||
vim.keymap.set({ 'n', 'x', 'o' }, 'f', ts_repeat_move.builtin_f)
|
||||
vim.keymap.set({ 'n', 'x', 'o' }, 'F', ts_repeat_move.builtin_F)
|
||||
vim.keymap.set({ 'n', 'x', 'o' }, 't', ts_repeat_move.builtin_t)
|
||||
vim.keymap.set({ 'n', 'x', 'o' }, 'T', ts_repeat_move.builtin_T)
|
||||
|
||||
return textobjects
|
||||
@@ -1,78 +0,0 @@
|
||||
local treesitter = require('nvim-treesitter.configs')
|
||||
local textobjects = require('plugins.lang.textobjects')
|
||||
|
||||
local auto_install = require('lib.util').get_user_config('auto_install', true)
|
||||
local installed_parsers = {}
|
||||
if auto_install then
|
||||
installed_parsers = require('plugins.list').ts_parsers
|
||||
end
|
||||
|
||||
treesitter.setup({
|
||||
ensure_installed = installed_parsers,
|
||||
sync_install = false,
|
||||
ignore_install = {},
|
||||
auto_install = true,
|
||||
|
||||
textobjects = textobjects,
|
||||
autopairs = { enable = true },
|
||||
endwise = { enable = true },
|
||||
autotag = { enable = true },
|
||||
matchup = { enable = true },
|
||||
indent = { enable = true },
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = {},
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = '<c-space>',
|
||||
node_incremental = '<c-space>',
|
||||
scope_incremental = false,
|
||||
node_decremental = '<bs>',
|
||||
},
|
||||
},
|
||||
|
||||
textsubjects = {
|
||||
enable = true,
|
||||
prev_selection = ',',
|
||||
keymaps = {
|
||||
['.'] = { 'textsubjects-smart', desc = 'Select the current text subject' },
|
||||
['a;'] = {
|
||||
'textsubjects-container-outer',
|
||||
desc = 'Select outer container (class, function, etc.)',
|
||||
},
|
||||
['i;'] = {
|
||||
'textsubjects-container-inner',
|
||||
desc = 'Select inside containers (classes, functions, etc.)',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
refactor = {
|
||||
highlight_definitions = {
|
||||
enable = true,
|
||||
clear_on_cursor_move = true,
|
||||
},
|
||||
highlight_current_scope = { enable = true },
|
||||
smart_rename = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
smart_rename = '<leader>rr',
|
||||
},
|
||||
},
|
||||
navigation = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
goto_definition = '<leader>rd',
|
||||
list_definitions = '<leader>rl',
|
||||
list_definitions_toc = '<leader>rh',
|
||||
goto_next_usage = '<leader>rj',
|
||||
goto_previous_usage = '<leader>rk',
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in new issue
Block a user