format with stylua
This commit is contained in:
@ -1,23 +1,23 @@
|
||||
return {
|
||||
'stevearc/aerial.nvim',
|
||||
config = function()
|
||||
require('aerial').setup({
|
||||
backends = { 'lsp', 'treesitter', 'markdown' },
|
||||
layout = {
|
||||
default_direction = 'prefer_left'
|
||||
},
|
||||
filter_kind = false,
|
||||
show_guides = true,
|
||||
})
|
||||
end,
|
||||
cmd = 'AerialToggle',
|
||||
keys = {
|
||||
{
|
||||
'<leader>s',
|
||||
function()
|
||||
require('aerial').toggle()
|
||||
end,
|
||||
desc = 'Symbols outline',
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
'stevearc/aerial.nvim',
|
||||
config = function()
|
||||
require('aerial').setup({
|
||||
backends = { 'lsp', 'treesitter', 'markdown' },
|
||||
layout = {
|
||||
default_direction = 'prefer_left',
|
||||
},
|
||||
filter_kind = false,
|
||||
show_guides = true,
|
||||
})
|
||||
end,
|
||||
cmd = 'AerialToggle',
|
||||
keys = {
|
||||
{
|
||||
'<leader>s',
|
||||
function()
|
||||
require('aerial').toggle()
|
||||
end,
|
||||
desc = 'Symbols outline',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -1,37 +1,37 @@
|
||||
return {
|
||||
'Civitasv/cmake-tools.nvim',
|
||||
opts = {
|
||||
cmake_command = 'cmake',
|
||||
cmake_generate_options = { '-D', 'CMAKE_EXPORT_COMPILE_COMMANDS=1', '-G', 'Ninja' },
|
||||
cmake_show_console = 'always',
|
||||
cmake_build_directory = 'build_nvim',
|
||||
cmake_dap_configuration = { name = 'cpp', type = 'codelldb', request = 'launch' }, -- dap configuration, optional
|
||||
},
|
||||
cmd = {
|
||||
'CMakeGenerate',
|
||||
'CMakeBuild',
|
||||
'CMakeRun',
|
||||
'CMakeDebug',
|
||||
'CMakeSelectBuildType',
|
||||
'CMakeSelectBuildTarget',
|
||||
'CMakeSelectLaunchTarget',
|
||||
'CMakeSelectKit',
|
||||
'CMakeSelectConfigurePreset',
|
||||
'CMakeSelectBuildPreset',
|
||||
'CMakeSelectLaunchTarget',
|
||||
'CMakeOpen',
|
||||
'CMakeClose',
|
||||
'CMakeInstall',
|
||||
'CMakeClean',
|
||||
'CMakeStop',
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
'<S-F6>',
|
||||
function()
|
||||
require('cmake-tools').debug({})
|
||||
end,
|
||||
desc = 'Run and debug target from cmake'
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
'Civitasv/cmake-tools.nvim',
|
||||
opts = {
|
||||
cmake_command = 'cmake',
|
||||
cmake_generate_options = { '-D', 'CMAKE_EXPORT_COMPILE_COMMANDS=1', '-G', 'Ninja' },
|
||||
cmake_show_console = 'always',
|
||||
cmake_build_directory = 'build_nvim',
|
||||
cmake_dap_configuration = { name = 'cpp', type = 'codelldb', request = 'launch' }, -- dap configuration, optional
|
||||
},
|
||||
cmd = {
|
||||
'CMakeGenerate',
|
||||
'CMakeBuild',
|
||||
'CMakeRun',
|
||||
'CMakeDebug',
|
||||
'CMakeSelectBuildType',
|
||||
'CMakeSelectBuildTarget',
|
||||
'CMakeSelectLaunchTarget',
|
||||
'CMakeSelectKit',
|
||||
'CMakeSelectConfigurePreset',
|
||||
'CMakeSelectBuildPreset',
|
||||
'CMakeSelectLaunchTarget',
|
||||
'CMakeOpen',
|
||||
'CMakeClose',
|
||||
'CMakeInstall',
|
||||
'CMakeClean',
|
||||
'CMakeStop',
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
'<S-F6>',
|
||||
function()
|
||||
require('cmake-tools').debug({})
|
||||
end,
|
||||
desc = 'Run and debug target from cmake',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -70,18 +70,19 @@ return {
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's', }),
|
||||
['<c-x>'] = cmp.mapping(cmp.mapping.complete(
|
||||
{
|
||||
end, { 'i', 's' }),
|
||||
['<c-x>'] = cmp.mapping(
|
||||
cmp.mapping.complete({
|
||||
config = {
|
||||
sources = {
|
||||
{
|
||||
name = 'cmdline_history'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
), { 'c' }),
|
||||
name = 'cmdline_history',
|
||||
},
|
||||
},
|
||||
},
|
||||
}),
|
||||
{ 'c' }
|
||||
),
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
@ -89,15 +90,15 @@ return {
|
||||
end,
|
||||
},
|
||||
sources = {
|
||||
{ name = 'neorg', priority = 8 },
|
||||
{ name = 'neorg', priority = 8 },
|
||||
{ name = 'luasnip', priority = 8 },
|
||||
{
|
||||
name = 'nvim_lsp',
|
||||
option = {
|
||||
markdown_oxide = {
|
||||
keyword_pattern = [[\(\k\| \|\/\|#\)\+]]
|
||||
}
|
||||
}
|
||||
keyword_pattern = [[\(\k\| \|\/\|#\)\+]],
|
||||
},
|
||||
},
|
||||
},
|
||||
{ name = 'nvim_lsp_signature_help', priority = 7 },
|
||||
-- { name = 'treesitter', priority = 6 },
|
||||
@ -111,8 +112,8 @@ return {
|
||||
bufs[vim.api.nvim_win_get_buf(win)] = true
|
||||
end
|
||||
return vim.tbl_keys(bufs)
|
||||
end
|
||||
}
|
||||
end,
|
||||
},
|
||||
},
|
||||
-- { name = 'nvim_lua' },
|
||||
-- { name = 'look' },
|
||||
@ -124,9 +125,9 @@ return {
|
||||
},
|
||||
enabled = function()
|
||||
return vim.api.nvim_buf_get_option(0, 'buftype') ~= 'prompt'
|
||||
or vim.api.nvim_buf_get_option(0, 'filetype') == 'dap-repl'
|
||||
or vim.api.nvim_buf_get_option(0, 'filetype') == 'dapui_watches'
|
||||
or vim.api.nvim_buf_get_option(0, 'filetype') == 'dapui_hover'
|
||||
or vim.api.nvim_buf_get_option(0, 'filetype') == 'dap-repl'
|
||||
or vim.api.nvim_buf_get_option(0, 'filetype') == 'dapui_watches'
|
||||
or vim.api.nvim_buf_get_option(0, 'filetype') == 'dapui_hover'
|
||||
end,
|
||||
-- completion = {
|
||||
-- completeopt = 'menu,menuone,noinsert, noselect',
|
||||
|
@ -1,21 +1,21 @@
|
||||
return {
|
||||
'numToStr/Comment.nvim',
|
||||
version = '*',
|
||||
opts = {
|
||||
mappings = false,
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
'<c-c>',
|
||||
'<Plug>(comment_toggle_linewise_current)',
|
||||
desc = 'Toggle comment'
|
||||
},
|
||||
|
||||
{
|
||||
'<c-c>',
|
||||
'<Plug>(comment_toggle_linewise_visual)gv',
|
||||
mode = 'v',
|
||||
desc = 'Toggle comment'
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
'numToStr/Comment.nvim',
|
||||
version = '*',
|
||||
opts = {
|
||||
mappings = false,
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
'<c-c>',
|
||||
'<Plug>(comment_toggle_linewise_current)',
|
||||
desc = 'Toggle comment',
|
||||
},
|
||||
|
||||
{
|
||||
'<c-c>',
|
||||
'<Plug>(comment_toggle_linewise_visual)gv',
|
||||
mode = 'v',
|
||||
desc = 'Toggle comment',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -1,225 +1,224 @@
|
||||
return {
|
||||
'mfussenegger/nvim-dap',
|
||||
dependencies = {
|
||||
'mfussenegger/nvim-dap-python',
|
||||
'theHamsta/nvim-dap-virtual-text',
|
||||
{
|
||||
'rcarriga/nvim-dap-ui',
|
||||
dependencies = {
|
||||
'nvim-neotest/nvim-nio'
|
||||
}
|
||||
},
|
||||
'rcarriga/cmp-dap',
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
'<F5>',
|
||||
function()
|
||||
require('dap').continue()
|
||||
end,
|
||||
desc = 'DAP start or continue'
|
||||
},
|
||||
{
|
||||
'<S-F5>',
|
||||
function()
|
||||
require('dap').run_last()
|
||||
end,
|
||||
desc = 'DAP run last'
|
||||
},
|
||||
{
|
||||
'<F6>',
|
||||
function()
|
||||
loadConfigs()
|
||||
end,
|
||||
desc = 'DAP configs'
|
||||
},
|
||||
{
|
||||
'<F7>',
|
||||
function()
|
||||
require('dap').goto_()
|
||||
end,
|
||||
desc = 'DAP goto'
|
||||
},
|
||||
{
|
||||
'<F8>',
|
||||
function()
|
||||
require('dap.ui.widgets').hover()
|
||||
end,
|
||||
desc = 'DAP Hover'
|
||||
},
|
||||
{
|
||||
'<F9>',
|
||||
function()
|
||||
require('dap').toggle_breakpoint()
|
||||
end,
|
||||
desc = 'DAP breakpoint'
|
||||
},
|
||||
{
|
||||
'<F10>',
|
||||
function()
|
||||
require('dap').step_over()
|
||||
end,
|
||||
desc = 'DAP step_over'
|
||||
},
|
||||
{
|
||||
'<F11>',
|
||||
function()
|
||||
require('dap').step_into()
|
||||
end,
|
||||
desc = 'DAP step_into'
|
||||
},
|
||||
{
|
||||
'<S-F11>',
|
||||
function()
|
||||
require('dap').step_out()
|
||||
end,
|
||||
desc = 'DAP step_out'
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local dap = require('dap')
|
||||
vim.fn.sign_define('DapBreakpoint', { text = '🛑', texthl = '', linehl = '', numhl = '' })
|
||||
require('cmp_dap').is_dap_buffer()
|
||||
|
||||
|
||||
-- make sure we can exit the terminal with esc
|
||||
vim.api.nvim_create_autocmd({ 'TermOpen' }, {
|
||||
pattern = { '*dap-terminal*' },
|
||||
callback = function()
|
||||
local opts = { noremap = true }
|
||||
vim.api.nvim_buf_set_keymap(0, 't', '<esc>', [[<C-\><C-n>]], opts)
|
||||
end
|
||||
})
|
||||
|
||||
local pythonVenv = require('utils.python_venv')
|
||||
|
||||
function loadConfigs()
|
||||
require('dap.ext.vscode').load_launchjs()
|
||||
-- Make sure we use the correct python env even for the configs from launch.json
|
||||
for _, config in pairs(dap.configurations.python) do
|
||||
config.pythonPath = pythonVenv.getPythonEnv()
|
||||
config.cwd = vim.fn.getcwd()
|
||||
end
|
||||
require('fzf-lua').dap_configurations()
|
||||
end
|
||||
|
||||
local masonpath = vim.fn.stdpath('data') .. '/mason'
|
||||
|
||||
-- PYTHON
|
||||
dap.adapters.python = {
|
||||
type = 'executable',
|
||||
command = 'python',
|
||||
args = { '-m', 'debugpy.adapter' },
|
||||
options = {
|
||||
detached = true,
|
||||
},
|
||||
}
|
||||
|
||||
local dapui = require('dapui')
|
||||
dapui.setup()
|
||||
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.configurations.python = {
|
||||
{
|
||||
type = 'python',
|
||||
request = 'launch',
|
||||
name = 'Launch file with venv',
|
||||
justMyCode = false,
|
||||
program = '${file}',
|
||||
cwd = vim.fn.getcwd(),
|
||||
pythonPath = pythonVenv.getPythonEnv
|
||||
},
|
||||
}
|
||||
|
||||
-- require('dap-python').setup('C:\\Users\\oli\\AppData\\Local\\nvim\\venv_debugpy\\Scripts\\python')
|
||||
-- table.insert(require('dap').configurations.python, {
|
||||
-- -- type = 'python',
|
||||
-- -- request = 'launch',
|
||||
-- -- name = 'My custom launch configuration',
|
||||
-- -- program = '${file}',
|
||||
-- justMyCode = false
|
||||
-- -- ... more options, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings
|
||||
-- })
|
||||
-- require('dap-python').setup('C:/Users/oli/AppData/Local/nvim-data/mason/packages/debugpy/venv/Scripts/python.exe')
|
||||
|
||||
-- CPP
|
||||
dap.adapters.codelldb = {
|
||||
type = 'server',
|
||||
port = '${port}',
|
||||
executable = {
|
||||
command = require 'mason-core.path'.bin_prefix 'codelldb',
|
||||
args = { '--port', '${port}' },
|
||||
|
||||
-- On windows you may have to uncomment this:
|
||||
detached = false,
|
||||
}
|
||||
}
|
||||
|
||||
dap.adapters.cppdbg = {
|
||||
id = 'cppdbg',
|
||||
type = 'executable',
|
||||
command = masonpath .. '/bin/OpenDebugAD7',
|
||||
}
|
||||
|
||||
dap.adapters.lldb = {
|
||||
type = 'executable',
|
||||
command = function()
|
||||
if vim.loop.os_uname().sysname == 'Linux' then
|
||||
return 'lldb-vscode'
|
||||
else
|
||||
return os.getenv('SCOOP') .. '/apps/llvm/current/bin/lldb-vscode.exe'
|
||||
end
|
||||
end,
|
||||
name = 'lldb'
|
||||
}
|
||||
|
||||
dap.configurations.cpp = {
|
||||
{
|
||||
name = 'Launch codelldb',
|
||||
type = 'codelldb',
|
||||
request = 'launch',
|
||||
program = function()
|
||||
return vim.fn.input({ 'Path to executable: ', vim.fn.getcwd() .. '/build_nvim/', 'file' })
|
||||
end,
|
||||
cwd = '${workspaceFolder}',
|
||||
stopOnEntry = false,
|
||||
},
|
||||
{
|
||||
name = 'Launch lldb',
|
||||
type = 'lldb',
|
||||
request = 'launch',
|
||||
program = function()
|
||||
return vim.fn.input({ 'Path to executable: ', vim.fn.getcwd() .. '/build_nvim', 'file' })
|
||||
end,
|
||||
cwd = '${workspaceFolder}',
|
||||
stopOnEntry = false,
|
||||
args = {},
|
||||
|
||||
-- 💀
|
||||
-- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
|
||||
--
|
||||
-- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
|
||||
--
|
||||
-- Otherwise you might get the following error:
|
||||
--
|
||||
-- Error on launch: Failed to attach to the target process
|
||||
--
|
||||
-- But you should be aware of the implications:
|
||||
-- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
|
||||
-- runInTerminal = false,
|
||||
},
|
||||
}
|
||||
|
||||
-- EXTENSIONS
|
||||
|
||||
require('nvim-dap-virtual-text').setup({})
|
||||
end,
|
||||
}
|
||||
return {
|
||||
'mfussenegger/nvim-dap',
|
||||
dependencies = {
|
||||
'mfussenegger/nvim-dap-python',
|
||||
'theHamsta/nvim-dap-virtual-text',
|
||||
{
|
||||
'rcarriga/nvim-dap-ui',
|
||||
dependencies = {
|
||||
'nvim-neotest/nvim-nio',
|
||||
},
|
||||
},
|
||||
'rcarriga/cmp-dap',
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
'<F5>',
|
||||
function()
|
||||
require('dap').continue()
|
||||
end,
|
||||
desc = 'DAP start or continue',
|
||||
},
|
||||
{
|
||||
'<S-F5>',
|
||||
function()
|
||||
require('dap').run_last()
|
||||
end,
|
||||
desc = 'DAP run last',
|
||||
},
|
||||
{
|
||||
'<F6>',
|
||||
function()
|
||||
loadConfigs()
|
||||
end,
|
||||
desc = 'DAP configs',
|
||||
},
|
||||
{
|
||||
'<F7>',
|
||||
function()
|
||||
require('dap').goto_()
|
||||
end,
|
||||
desc = 'DAP goto',
|
||||
},
|
||||
{
|
||||
'<F8>',
|
||||
function()
|
||||
require('dap.ui.widgets').hover()
|
||||
end,
|
||||
desc = 'DAP Hover',
|
||||
},
|
||||
{
|
||||
'<F9>',
|
||||
function()
|
||||
require('dap').toggle_breakpoint()
|
||||
end,
|
||||
desc = 'DAP breakpoint',
|
||||
},
|
||||
{
|
||||
'<F10>',
|
||||
function()
|
||||
require('dap').step_over()
|
||||
end,
|
||||
desc = 'DAP step_over',
|
||||
},
|
||||
{
|
||||
'<F11>',
|
||||
function()
|
||||
require('dap').step_into()
|
||||
end,
|
||||
desc = 'DAP step_into',
|
||||
},
|
||||
{
|
||||
'<S-F11>',
|
||||
function()
|
||||
require('dap').step_out()
|
||||
end,
|
||||
desc = 'DAP step_out',
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local dap = require('dap')
|
||||
vim.fn.sign_define('DapBreakpoint', { text = '🛑', texthl = '', linehl = '', numhl = '' })
|
||||
require('cmp_dap').is_dap_buffer()
|
||||
|
||||
-- make sure we can exit the terminal with esc
|
||||
vim.api.nvim_create_autocmd({ 'TermOpen' }, {
|
||||
pattern = { '*dap-terminal*' },
|
||||
callback = function()
|
||||
local opts = { noremap = true }
|
||||
vim.api.nvim_buf_set_keymap(0, 't', '<esc>', [[<C-\><C-n>]], opts)
|
||||
end,
|
||||
})
|
||||
|
||||
local pythonVenv = require('utils.python_venv')
|
||||
|
||||
function loadConfigs()
|
||||
require('dap.ext.vscode').load_launchjs()
|
||||
-- Make sure we use the correct python env even for the configs from launch.json
|
||||
for _, config in pairs(dap.configurations.python) do
|
||||
config.pythonPath = pythonVenv.getPythonEnv()
|
||||
config.cwd = vim.fn.getcwd()
|
||||
end
|
||||
require('fzf-lua').dap_configurations()
|
||||
end
|
||||
|
||||
local masonpath = vim.fn.stdpath('data') .. '/mason'
|
||||
|
||||
-- PYTHON
|
||||
dap.adapters.python = {
|
||||
type = 'executable',
|
||||
command = 'python',
|
||||
args = { '-m', 'debugpy.adapter' },
|
||||
options = {
|
||||
detached = true,
|
||||
},
|
||||
}
|
||||
|
||||
local dapui = require('dapui')
|
||||
dapui.setup()
|
||||
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.configurations.python = {
|
||||
{
|
||||
type = 'python',
|
||||
request = 'launch',
|
||||
name = 'Launch file with venv',
|
||||
justMyCode = false,
|
||||
program = '${file}',
|
||||
cwd = vim.fn.getcwd(),
|
||||
pythonPath = pythonVenv.getPythonEnv,
|
||||
},
|
||||
}
|
||||
|
||||
-- require('dap-python').setup('C:\\Users\\oli\\AppData\\Local\\nvim\\venv_debugpy\\Scripts\\python')
|
||||
-- table.insert(require('dap').configurations.python, {
|
||||
-- -- type = 'python',
|
||||
-- -- request = 'launch',
|
||||
-- -- name = 'My custom launch configuration',
|
||||
-- -- program = '${file}',
|
||||
-- justMyCode = false
|
||||
-- -- ... more options, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings
|
||||
-- })
|
||||
-- require('dap-python').setup('C:/Users/oli/AppData/Local/nvim-data/mason/packages/debugpy/venv/Scripts/python.exe')
|
||||
|
||||
-- CPP
|
||||
dap.adapters.codelldb = {
|
||||
type = 'server',
|
||||
port = '${port}',
|
||||
executable = {
|
||||
command = require('mason-core.path').bin_prefix('codelldb'),
|
||||
args = { '--port', '${port}' },
|
||||
|
||||
-- On windows you may have to uncomment this:
|
||||
detached = false,
|
||||
},
|
||||
}
|
||||
|
||||
dap.adapters.cppdbg = {
|
||||
id = 'cppdbg',
|
||||
type = 'executable',
|
||||
command = masonpath .. '/bin/OpenDebugAD7',
|
||||
}
|
||||
|
||||
dap.adapters.lldb = {
|
||||
type = 'executable',
|
||||
command = function()
|
||||
if vim.loop.os_uname().sysname == 'Linux' then
|
||||
return 'lldb-vscode'
|
||||
else
|
||||
return os.getenv('SCOOP') .. '/apps/llvm/current/bin/lldb-vscode.exe'
|
||||
end
|
||||
end,
|
||||
name = 'lldb',
|
||||
}
|
||||
|
||||
dap.configurations.cpp = {
|
||||
{
|
||||
name = 'Launch codelldb',
|
||||
type = 'codelldb',
|
||||
request = 'launch',
|
||||
program = function()
|
||||
return vim.fn.input({ 'Path to executable: ', vim.fn.getcwd() .. '/build_nvim/', 'file' })
|
||||
end,
|
||||
cwd = '${workspaceFolder}',
|
||||
stopOnEntry = false,
|
||||
},
|
||||
{
|
||||
name = 'Launch lldb',
|
||||
type = 'lldb',
|
||||
request = 'launch',
|
||||
program = function()
|
||||
return vim.fn.input({ 'Path to executable: ', vim.fn.getcwd() .. '/build_nvim', 'file' })
|
||||
end,
|
||||
cwd = '${workspaceFolder}',
|
||||
stopOnEntry = false,
|
||||
args = {},
|
||||
|
||||
-- 💀
|
||||
-- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
|
||||
--
|
||||
-- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
|
||||
--
|
||||
-- Otherwise you might get the following error:
|
||||
--
|
||||
-- Error on launch: Failed to attach to the target process
|
||||
--
|
||||
-- But you should be aware of the implications:
|
||||
-- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
|
||||
-- runInTerminal = false,
|
||||
},
|
||||
}
|
||||
|
||||
-- EXTENSIONS
|
||||
|
||||
require('nvim-dap-virtual-text').setup({})
|
||||
end,
|
||||
}
|
||||
|
@ -1,20 +1,20 @@
|
||||
return {
|
||||
'sindrets/diffview.nvim',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim'
|
||||
'nvim-lua/plenary.nvim',
|
||||
},
|
||||
opts = {
|
||||
keymaps = {
|
||||
view = {
|
||||
['<leader>b'] = false
|
||||
['<leader>b'] = false,
|
||||
},
|
||||
file_panel = {
|
||||
['<leader>b'] = false
|
||||
['<leader>b'] = false,
|
||||
},
|
||||
file_history_panel = {
|
||||
['<leader>b'] = false
|
||||
['<leader>b'] = false,
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
cmd = 'DiffviewOpen',
|
||||
keys = {
|
||||
@ -33,5 +33,5 @@ return {
|
||||
'<cmd>DiffviewOpen origin/master...<cr>',
|
||||
desc = 'Diffview vs master',
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
return {
|
||||
'stevearc/dressing.nvim'
|
||||
}
|
||||
return {
|
||||
'stevearc/dressing.nvim',
|
||||
}
|
||||
|
@ -1,34 +1,34 @@
|
||||
return {
|
||||
'folke/flash.nvim',
|
||||
event = 'VeryLazy',
|
||||
---@type Flash.Config
|
||||
opts = {
|
||||
modes = {
|
||||
search = {
|
||||
enabled = false
|
||||
},
|
||||
char = {
|
||||
keys = { 'f', 'F', 't', 'T', ';' },
|
||||
}
|
||||
}
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
's',
|
||||
mode = { 'n', 'x', 'o' },
|
||||
function()
|
||||
-- default options: exact mode, multi window, all directions, with a backdrop
|
||||
require('flash').jump()
|
||||
end,
|
||||
desc = 'Flash jump'
|
||||
},
|
||||
{
|
||||
'S',
|
||||
mode = { 'n', 'o', 'x' },
|
||||
function()
|
||||
require('flash').treesitter()
|
||||
end,
|
||||
desc = 'Flash treesitter'
|
||||
},
|
||||
},
|
||||
}
|
||||
return {
|
||||
'folke/flash.nvim',
|
||||
event = 'VeryLazy',
|
||||
---@type Flash.Config
|
||||
opts = {
|
||||
modes = {
|
||||
search = {
|
||||
enabled = false,
|
||||
},
|
||||
char = {
|
||||
keys = { 'f', 'F', 't', 'T', ';' },
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
's',
|
||||
mode = { 'n', 'x', 'o' },
|
||||
function()
|
||||
-- default options: exact mode, multi window, all directions, with a backdrop
|
||||
require('flash').jump()
|
||||
end,
|
||||
desc = 'Flash jump',
|
||||
},
|
||||
{
|
||||
'S',
|
||||
mode = { 'n', 'o', 'x' },
|
||||
function()
|
||||
require('flash').treesitter()
|
||||
end,
|
||||
desc = 'Flash treesitter',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ return {
|
||||
'ibhagwan/fzf-lua',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
config = function()
|
||||
local actions = require 'fzf-lua.actions'
|
||||
local actions = require('fzf-lua.actions')
|
||||
require('fzf-lua').setup({
|
||||
'borderless_full',
|
||||
actions = {
|
||||
@ -17,12 +17,12 @@ return {
|
||||
},
|
||||
buffers = {
|
||||
['default'] = actions.buf_edit,
|
||||
['ctrl-s'] = actions.buf_split,
|
||||
['ctrl-v'] = actions.buf_vsplit,
|
||||
['ctrl-t'] = actions.buf_tabedit,
|
||||
['ctrl-x'] = actions.buf_split
|
||||
}
|
||||
}
|
||||
['ctrl-s'] = actions.buf_split,
|
||||
['ctrl-v'] = actions.buf_vsplit,
|
||||
['ctrl-t'] = actions.buf_tabedit,
|
||||
['ctrl-x'] = actions.buf_split,
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
cmd = 'FzfLua',
|
||||
@ -121,5 +121,5 @@ return {
|
||||
mode = { 'n', 'v', 'i' },
|
||||
desc = 'Fuzzy complete path',
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
|
@ -9,5 +9,5 @@ return {
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ return {
|
||||
'RainbowCyan',
|
||||
}
|
||||
|
||||
local hooks = require 'ibl.hooks'
|
||||
local hooks = require('ibl.hooks')
|
||||
-- create the highlight groups in the highlight setup hook, so they are reset
|
||||
-- every time the colorscheme changes
|
||||
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
|
||||
@ -35,12 +35,12 @@ return {
|
||||
end)
|
||||
|
||||
vim.g.rainbow_delimiters = { highlight = highlight }
|
||||
require('ibl').setup {
|
||||
require('ibl').setup({
|
||||
scope = {
|
||||
highlight = highlight,
|
||||
show_start = false
|
||||
}
|
||||
}
|
||||
show_start = false,
|
||||
},
|
||||
})
|
||||
|
||||
hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
|
||||
end,
|
||||
|
@ -1,2 +1 @@
|
||||
return {
|
||||
}
|
||||
return {}
|
||||
|
@ -12,9 +12,9 @@ return {
|
||||
},
|
||||
{
|
||||
'Bilal2453/luvit-meta',
|
||||
lazy = true
|
||||
lazy = true,
|
||||
}, -- optional `vim.uv` typings
|
||||
{ -- optional completion source for require statements and module annotations
|
||||
{ -- optional completion source for require statements and module annotations
|
||||
'hrsh7th/nvim-cmp',
|
||||
opts = function(_, opts)
|
||||
opts.sources = opts.sources or {}
|
||||
|
@ -1,66 +1,49 @@
|
||||
local lspKeys = function(client, bufnr)
|
||||
local fzf = require('fzf-lua')
|
||||
local options = { noremap = true, silent = false, buffer = bufnr }
|
||||
vim.keymap.set('n', '<space>,', vim.diagnostic.goto_prev,
|
||||
vim.tbl_extend('error', options, { desc = 'Diag prev' }))
|
||||
vim.keymap.set('n', '<space>;', vim.diagnostic.goto_next,
|
||||
vim.tbl_extend('error', options, { desc = 'Diag next' }))
|
||||
vim.keymap.set({ 'n', 'x' }, '<space>a', vim.lsp.buf.code_action,
|
||||
vim.tbl_extend('error', options, { desc = 'Code action' }))
|
||||
vim.keymap.set('n', '<space>d', function() fzf.lsp_definitions({ jump_to_single_result = true }) end,
|
||||
vim.tbl_extend('error', options, { desc = 'Definition' }))
|
||||
vim.keymap.set('n', '<space>e',
|
||||
vim.lsp.buf.declaration, vim.tbl_extend('error', options, { desc = 'Declaration' }))
|
||||
vim.keymap.set('n', '<space>h', function() require('pretty_hover').hover() end,
|
||||
vim.tbl_extend('error', options, { desc = 'Hover' }))
|
||||
vim.keymap.set('n', '<space>c', vim.lsp.buf.outgoing_calls,
|
||||
vim.tbl_extend('error', options, { desc = 'Outgoing calls' }))
|
||||
vim.keymap.set('n', '<space>C', vim.lsp.buf.incoming_calls,
|
||||
vim.tbl_extend('error', options, { desc = 'Incoming calls' }))
|
||||
vim.keymap.set('n', '<space>m', vim.lsp.buf.rename,
|
||||
vim.tbl_extend('error', options, { desc = 'Rename' }))
|
||||
vim.keymap.set('n', '<C-t>', fzf.lsp_live_workspace_symbols,
|
||||
vim.tbl_extend('error', options, { desc = 'Workspace symbols' }))
|
||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition,
|
||||
vim.tbl_extend('error', options, { desc = 'Type definition' }))
|
||||
vim.keymap.set({ 'n', 'i', 'x' }, '<C-k>', vim.lsp.buf.signature_help,
|
||||
vim.tbl_extend('error', options, { desc = 'Signature help' }))
|
||||
vim.keymap.set('n', '<space>r', fzf.lsp_references,
|
||||
vim.tbl_extend('error', options, { desc = 'References' }))
|
||||
vim.keymap.set('n', '<A-m>', fzf.lsp_document_symbols,
|
||||
vim.tbl_extend('error', options, { desc = 'Document symbols' }))
|
||||
vim.keymap.set('n', '<space>s', fzf.lsp_live_workspace_symbols,
|
||||
vim.tbl_extend('error', options, { desc = 'Workspace symbols' }))
|
||||
vim.keymap.set('n', '<space>v', vim.diagnostic.open_float,
|
||||
vim.tbl_extend('error', options, { desc = 'Diagnostics Float' }))
|
||||
vim.keymap.set('n', '<space>V', fzf.diagnostics_document,
|
||||
vim.tbl_extend('error', options, { desc = 'Diagnostics' }))
|
||||
vim.keymap.set('n', '<A-o>', '<cmd>ClangdSwitchSourceHeader<CR>',
|
||||
vim.tbl_extend('error', options, { desc = 'Switch Source/Header' }))
|
||||
vim.keymap.set('n', '<space>,', vim.diagnostic.goto_prev, vim.tbl_extend('error', options, { desc = 'Diag prev' }))
|
||||
vim.keymap.set('n', '<space>;', vim.diagnostic.goto_next, vim.tbl_extend('error', options, { desc = 'Diag next' }))
|
||||
vim.keymap.set({ 'n', 'x' }, '<space>a', vim.lsp.buf.code_action, vim.tbl_extend('error', options, { desc = 'Code action' }))
|
||||
vim.keymap.set('n', '<space>d', function()
|
||||
fzf.lsp_definitions({ jump_to_single_result = true })
|
||||
end, vim.tbl_extend('error', options, { desc = 'Definition' }))
|
||||
vim.keymap.set('n', '<space>e', vim.lsp.buf.declaration, vim.tbl_extend('error', options, { desc = 'Declaration' }))
|
||||
vim.keymap.set('n', '<space>h', function()
|
||||
require('pretty_hover').hover()
|
||||
end, vim.tbl_extend('error', options, { desc = 'Hover' }))
|
||||
vim.keymap.set('n', '<space>c', vim.lsp.buf.outgoing_calls, vim.tbl_extend('error', options, { desc = 'Outgoing calls' }))
|
||||
vim.keymap.set('n', '<space>C', vim.lsp.buf.incoming_calls, vim.tbl_extend('error', options, { desc = 'Incoming calls' }))
|
||||
vim.keymap.set('n', '<space>m', vim.lsp.buf.rename, vim.tbl_extend('error', options, { desc = 'Rename' }))
|
||||
vim.keymap.set('n', '<C-t>', fzf.lsp_live_workspace_symbols, vim.tbl_extend('error', options, { desc = 'Workspace symbols' }))
|
||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, vim.tbl_extend('error', options, { desc = 'Type definition' }))
|
||||
vim.keymap.set({ 'n', 'i', 'x' }, '<C-k>', vim.lsp.buf.signature_help, vim.tbl_extend('error', options, { desc = 'Signature help' }))
|
||||
vim.keymap.set('n', '<space>r', fzf.lsp_references, vim.tbl_extend('error', options, { desc = 'References' }))
|
||||
vim.keymap.set('n', '<A-m>', fzf.lsp_document_symbols, vim.tbl_extend('error', options, { desc = 'Document symbols' }))
|
||||
vim.keymap.set('n', '<space>s', fzf.lsp_live_workspace_symbols, vim.tbl_extend('error', options, { desc = 'Workspace symbols' }))
|
||||
vim.keymap.set('n', '<space>v', vim.diagnostic.open_float, vim.tbl_extend('error', options, { desc = 'Diagnostics Float' }))
|
||||
vim.keymap.set('n', '<space>V', fzf.diagnostics_document, vim.tbl_extend('error', options, { desc = 'Diagnostics' }))
|
||||
vim.keymap.set('n', '<A-o>', '<cmd>ClangdSwitchSourceHeader<CR>', vim.tbl_extend('error', options, { desc = 'Switch Source/Header' }))
|
||||
|
||||
-- Set some keybinds conditional on server capabilities
|
||||
if client.server_capabilities.documentFormattingProvider then
|
||||
vim.keymap.set('n', '<space>f', function()
|
||||
vim.lsp.buf.format({ timeout_ms = 10000 })
|
||||
end,
|
||||
{ noremap = true, silent = false, desc = 'Format file', buffer = bufnr })
|
||||
vim.lsp.buf.format({ timeout_ms = 10000 })
|
||||
end, { noremap = true, silent = false, desc = 'Format file', buffer = bufnr })
|
||||
end
|
||||
if client.server_capabilities.documentRangeFormattingProvider then
|
||||
vim.keymap.set('x', '<space>f', function()
|
||||
vim.lsp.buf.format({ timeout_ms = 10000 })
|
||||
end,
|
||||
{ noremap = true, silent = false, desc = 'Format visual', buffer = bufnr })
|
||||
vim.lsp.buf.format({ timeout_ms = 10000 })
|
||||
end, { noremap = true, silent = false, desc = 'Format visual', buffer = bufnr })
|
||||
end
|
||||
if client.supports_method('inlayHintProvider') then
|
||||
vim.keymap.set('n', '<space>i', function()
|
||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = bufnr }), { bufnr = bufnr })
|
||||
end,
|
||||
{
|
||||
noremap = true,
|
||||
silent = false,
|
||||
desc = 'Toggle inlay hints',
|
||||
buffer = bufnr
|
||||
})
|
||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = bufnr }), { bufnr = bufnr })
|
||||
end, {
|
||||
noremap = true,
|
||||
silent = false,
|
||||
desc = 'Toggle inlay hints',
|
||||
buffer = bufnr,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
@ -88,10 +71,10 @@ local document_highlight = function(bufnr)
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
vim.lsp.buf.clear_references()
|
||||
vim.api.nvim_clear_autocmds {
|
||||
vim.api.nvim_clear_autocmds({
|
||||
group = group,
|
||||
buffer = bufnr
|
||||
}
|
||||
buffer = bufnr,
|
||||
})
|
||||
end,
|
||||
})
|
||||
end
|
||||
@ -127,8 +110,8 @@ return {
|
||||
config = function()
|
||||
require('mason').setup({
|
||||
ui = {
|
||||
border = 'rounded'
|
||||
}
|
||||
border = 'rounded',
|
||||
},
|
||||
})
|
||||
require('mason-lspconfig').setup({
|
||||
automatic_installation = false,
|
||||
@ -141,7 +124,7 @@ return {
|
||||
'lua_ls',
|
||||
'jsonls',
|
||||
-- 'groovyls', -- Doesn't work in WSL
|
||||
}
|
||||
},
|
||||
})
|
||||
local lspconfig = require('lspconfig')
|
||||
|
||||
@ -161,9 +144,9 @@ return {
|
||||
}
|
||||
local signs = {
|
||||
{ name = 'DiagnosticSignError', text = diagnostics.Error },
|
||||
{ name = 'DiagnosticSignWarn', text = diagnostics.Warning },
|
||||
{ name = 'DiagnosticSignHint', text = diagnostics.Hint },
|
||||
{ name = 'DiagnosticSignInfo', text = diagnostics.Information },
|
||||
{ name = 'DiagnosticSignWarn', text = diagnostics.Warning },
|
||||
{ name = 'DiagnosticSignHint', text = diagnostics.Hint },
|
||||
{ name = 'DiagnosticSignInfo', text = diagnostics.Information },
|
||||
}
|
||||
|
||||
for _, sign in ipairs(signs) do
|
||||
@ -179,13 +162,12 @@ return {
|
||||
vim.diagnostic.open_float({ focusable = false, width = 80 })
|
||||
end
|
||||
|
||||
|
||||
-- lspconfig['pyright'].setup {
|
||||
-- capabilities = capabilities,
|
||||
-- on_attach = on_attach,
|
||||
-- }
|
||||
|
||||
lspconfig['basedpyright'].setup {
|
||||
lspconfig['basedpyright'].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
@ -193,12 +175,12 @@ return {
|
||||
typeCheckingMode = 'standard',
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
lspconfig['groovyls'].setup {
|
||||
lspconfig['groovyls'].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
}
|
||||
})
|
||||
|
||||
-- lspconfig['cmake'].setup {
|
||||
-- capabilities = capabilities,
|
||||
@ -215,8 +197,8 @@ return {
|
||||
return lspconfig.util.find_git_ancestor(fname)
|
||||
end,
|
||||
single_file_support = true, -- suggested
|
||||
on_attach = on_attach -- on_attach is the on_attach function you defined
|
||||
}
|
||||
on_attach = on_attach, -- on_attach is the on_attach function you defined
|
||||
},
|
||||
}
|
||||
lspconfig.neocmake.setup({})
|
||||
end
|
||||
@ -224,48 +206,42 @@ return {
|
||||
local clangd_capabilities = capabilities
|
||||
clangd_capabilities.textDocument.semanticHighlighting = true
|
||||
clangd_capabilities.offsetEncoding = { 'utf-16' }
|
||||
lspconfig['clangd'].setup {
|
||||
lspconfig['clangd'].setup({
|
||||
capabilities = clangd_capabilities,
|
||||
on_attach = on_attach,
|
||||
cmd = { 'clangd',
|
||||
cmd = {
|
||||
'clangd',
|
||||
'--compile-commands-dir=build_nvim',
|
||||
'--query-driver', '/opt/cortex-a78-2022.08-gcc12.1-linux5.15/bin/aarch64-linux-gnu-g*',
|
||||
'--query-driver',
|
||||
'/opt/cortex-a78-2022.08-gcc12.1-linux5.15/bin/aarch64-linux-gnu-g*',
|
||||
'--clang-tidy',
|
||||
'--background-index',
|
||||
'--use-dirty-headers',
|
||||
'--completion-style=detailed' },
|
||||
root_dir = lspconfig.util.root_pattern(
|
||||
'.clangd',
|
||||
'.clang-tidy',
|
||||
'.clang-format',
|
||||
'compile_flags.txt',
|
||||
'configure.ac',
|
||||
'.git',
|
||||
'build_nvim'
|
||||
)
|
||||
}
|
||||
'--completion-style=detailed',
|
||||
},
|
||||
root_dir = lspconfig.util.root_pattern('.clangd', '.clang-tidy', '.clang-format', 'compile_flags.txt', 'configure.ac', '.git', 'build_nvim'),
|
||||
})
|
||||
|
||||
require('clangd_extensions').setup({
|
||||
extensions =
|
||||
{
|
||||
extensions = {
|
||||
inlay_hints = {
|
||||
-- Only show inlay hints for the current line
|
||||
only_current_line = true,
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
lspconfig['jsonls'].setup {
|
||||
lspconfig['jsonls'].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
}
|
||||
})
|
||||
|
||||
-- lspconfig['rust_analyzer'].setup {
|
||||
-- capabilities = capabilities,
|
||||
-- on_attach = on_attach,
|
||||
-- }
|
||||
|
||||
lspconfig['lua_ls'].setup {
|
||||
lspconfig['lua_ls'].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
@ -274,7 +250,7 @@ return {
|
||||
checkThirdParty = false,
|
||||
},
|
||||
completion = {
|
||||
callSnippet = 'Replace'
|
||||
callSnippet = 'Replace',
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = {
|
||||
@ -286,36 +262,36 @@ return {
|
||||
indent_style = 'space',
|
||||
indent_size = '2',
|
||||
quote_style = 'single',
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
lspconfig['dockerls'].setup {
|
||||
lspconfig['dockerls'].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
}
|
||||
})
|
||||
|
||||
lspconfig['markdown_oxide'].setup {
|
||||
lspconfig['markdown_oxide'].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
}
|
||||
})
|
||||
|
||||
-- lspconfig['marksman'].setup {
|
||||
-- capabilities = capabilities,
|
||||
-- on_attach = on_attach,
|
||||
-- }
|
||||
|
||||
lspconfig['yamlls'].setup {
|
||||
lspconfig['yamlls'].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
yaml = {
|
||||
validate = true
|
||||
}
|
||||
}
|
||||
}
|
||||
validate = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local prettier = require('efmls-configs.formatters.prettier')
|
||||
local stylua = require('efmls-configs.formatters.stylua')
|
||||
@ -352,15 +328,10 @@ return {
|
||||
float = {
|
||||
border = 'single',
|
||||
format = function(diagnostic)
|
||||
return string.format(
|
||||
'%s (%s) [%s]',
|
||||
diagnostic.message,
|
||||
diagnostic.source,
|
||||
diagnostic.code or diagnostic.user_data.lsp.code
|
||||
)
|
||||
return string.format('%s (%s) [%s]', diagnostic.message, diagnostic.source, diagnostic.code or diagnostic.user_data.lsp.code)
|
||||
end,
|
||||
},
|
||||
})
|
||||
end,
|
||||
event = 'VeryLazy'
|
||||
event = 'VeryLazy',
|
||||
}
|
||||
|
@ -2,10 +2,10 @@ return {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
'Isrothy/lualine-diagnostic-message'
|
||||
'Isrothy/lualine-diagnostic-message',
|
||||
},
|
||||
config = function()
|
||||
require('lualine').setup {
|
||||
require('lualine').setup({
|
||||
options = {
|
||||
theme = 'bamboo',
|
||||
disabled_filetypes = {
|
||||
@ -22,17 +22,17 @@ return {
|
||||
'diff',
|
||||
{
|
||||
'diagnostics',
|
||||
sources = { 'nvim_diagnostic' }
|
||||
}
|
||||
sources = { 'nvim_diagnostic' },
|
||||
},
|
||||
},
|
||||
lualine_c = {
|
||||
'hostname',
|
||||
'getcwd',
|
||||
{ 'filename', path = 1, file_status = true }
|
||||
{ 'filename', path = 1, file_status = true },
|
||||
},
|
||||
lualine_y = {
|
||||
'searchcount',
|
||||
'progress'
|
||||
'progress',
|
||||
},
|
||||
},
|
||||
inactive_sections = {
|
||||
@ -41,9 +41,9 @@ return {
|
||||
{
|
||||
'filename',
|
||||
path = 1,
|
||||
file_status = true
|
||||
}
|
||||
}
|
||||
file_status = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
winbar = {
|
||||
lualine_a = {
|
||||
@ -65,15 +65,13 @@ return {
|
||||
warn = ' ',
|
||||
info = ' ',
|
||||
hint = ' ',
|
||||
}
|
||||
}
|
||||
},
|
||||
lualine_c = {
|
||||
},
|
||||
},
|
||||
},
|
||||
lualine_c = {},
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {
|
||||
}
|
||||
lualine_z = {},
|
||||
},
|
||||
inactive_winbar = {
|
||||
lualine_a = {
|
||||
@ -82,7 +80,7 @@ return {
|
||||
path = 0,
|
||||
file_status = true,
|
||||
separator = { left = '', right = '' },
|
||||
}
|
||||
},
|
||||
},
|
||||
lualine_b = {
|
||||
{
|
||||
@ -92,7 +90,7 @@ return {
|
||||
lualine_c = {},
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {
|
||||
lualine_a = {},
|
||||
@ -101,12 +99,12 @@ return {
|
||||
{
|
||||
'tabs',
|
||||
mode = 2,
|
||||
}
|
||||
},
|
||||
},
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
lualine_z = {},
|
||||
},
|
||||
}
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
@ -5,5 +5,5 @@ return {
|
||||
-- Mandatory setup function
|
||||
require('luasnip_snippets.common.snip_utils').setup()
|
||||
end,
|
||||
enabled = false
|
||||
enabled = false,
|
||||
}
|
||||
|
@ -44,29 +44,68 @@ return {
|
||||
|
||||
ls.snippets = {
|
||||
cpp = {
|
||||
s('TEST_F_getset',
|
||||
{
|
||||
t('TEST_F('), i(1, 'TestClass'), t(' ,test_'), p(getRegA, false), t({ '_set_get)', '{', ' ' }),
|
||||
i(2, 'm_object'), t('.set'), p(getRegA, true), t('('), i(3, '32.F'), t({ ');', ' ' }),
|
||||
i(4, 'EXPECT_EQ('), rep(3), t(', '), rep(2), t('.get'), p(getRegA, true), t({ '());', '' }),
|
||||
t({ '', '}', '' })
|
||||
}),
|
||||
s('TEST_fn_getset',
|
||||
{
|
||||
t('void '), p(getRegA, false), t('_'), i(1, 'get'), t('_'), i(2, 'set'), t({ '()', '{', ' ' }),
|
||||
i(3, 'm_object'), t('.set'), p(getRegA, true), t('('), i(4, '32.F'), t({ ');', ' ' }),
|
||||
i(5, 'EXPECT_EQ('), rep(4), t(', '), rep(3), t('.get'), p(getRegA, true), t({ '());', '' }),
|
||||
t({ '', '}', '', '' }),
|
||||
s('TEST_F_getset', {
|
||||
t('TEST_F('),
|
||||
i(1, 'TestClass'),
|
||||
t(' ,test_'),
|
||||
p(getRegA, false),
|
||||
t({ '_set_get)', '{', ' ' }),
|
||||
i(2, 'm_object'),
|
||||
t('.set'),
|
||||
p(getRegA, true),
|
||||
t('('),
|
||||
i(3, '32.F'),
|
||||
t({ ');', ' ' }),
|
||||
i(4, 'EXPECT_EQ('),
|
||||
rep(3),
|
||||
t(', '),
|
||||
rep(2),
|
||||
t('.get'),
|
||||
p(getRegA, true),
|
||||
t({ '());', '' }),
|
||||
t({ '', '}', '' }),
|
||||
}),
|
||||
s('TEST_fn_getset', {
|
||||
t('void '),
|
||||
p(getRegA, false),
|
||||
t('_'),
|
||||
i(1, 'get'),
|
||||
t('_'),
|
||||
i(2, 'set'),
|
||||
t({ '()', '{', ' ' }),
|
||||
i(3, 'm_object'),
|
||||
t('.set'),
|
||||
p(getRegA, true),
|
||||
t('('),
|
||||
i(4, '32.F'),
|
||||
t({ ');', ' ' }),
|
||||
i(5, 'EXPECT_EQ('),
|
||||
rep(4),
|
||||
t(', '),
|
||||
rep(3),
|
||||
t('.get'),
|
||||
p(getRegA, true),
|
||||
t({ '());', '' }),
|
||||
t({ '', '}', '', '' }),
|
||||
|
||||
t('TEST_F('), i(5), t(' ,test_'), p(getRegA, false), t({ '_set_get)', '{', ' ' }),
|
||||
p(getRegA, false), t('_'), rep(1), t('_'), rep(2), t({ '();' }),
|
||||
t({ '', '}' }),
|
||||
})
|
||||
t('TEST_F('),
|
||||
i(5),
|
||||
t(' ,test_'),
|
||||
p(getRegA, false),
|
||||
t({ '_set_get)', '{', ' ' }),
|
||||
p(getRegA, false),
|
||||
t('_'),
|
||||
rep(1),
|
||||
t('_'),
|
||||
rep(2),
|
||||
t({ '();' }),
|
||||
t({ '', '}' }),
|
||||
}),
|
||||
},
|
||||
}
|
||||
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
require('luasnip.loaders.from_vscode').lazy_load({ paths = { './my-snippets' } })
|
||||
end,
|
||||
cmd = 'LuaSnipListAvailable'
|
||||
cmd = 'LuaSnipListAvailable',
|
||||
}
|
||||
|
@ -3,17 +3,17 @@ return {
|
||||
cmd = {
|
||||
'MarkdownPreviewToggle',
|
||||
'MarkdownPreview',
|
||||
'MarkdownPreviewStop'
|
||||
'MarkdownPreviewStop',
|
||||
},
|
||||
branch = 'master',
|
||||
ft = { 'markdown' },
|
||||
build = function()
|
||||
vim.fn['mkdp#util#install']()
|
||||
end,
|
||||
init = function ()
|
||||
init = function()
|
||||
vim.g.mkdp_auto_close = 0
|
||||
vim.g.mkdp_auto_start = 1
|
||||
vim.g.mkdp_combine_preview = 1
|
||||
vim.g.mkdp_combine_preview_auto_refresh = 1
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
@ -1,34 +1,34 @@
|
||||
return {
|
||||
'danymat/neogen',
|
||||
dependencies = 'nvim-treesitter/nvim-treesitter',
|
||||
opts = {
|
||||
enabled = true,
|
||||
languages = {
|
||||
cpp = {
|
||||
template = {
|
||||
annotation_convention = 'custom',
|
||||
custom = {
|
||||
{ nil, '/// file', { no_results = true, type = { 'file' } } },
|
||||
{ nil, '/// $1', { no_results = true, type = { 'func', 'file' } } },
|
||||
{ nil, '', { no_results = true, type = { 'file' } } },
|
||||
|
||||
{ nil, '/// $1', { type = { 'func' } } },
|
||||
{ 'tparam', '/// \\tparam %s $1' },
|
||||
{ 'parameters', '/// \\param %s $1' },
|
||||
{ 'return_statement', '/// \\return $1' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
'<leader>n',
|
||||
function()
|
||||
require('neogen').generate({})
|
||||
end,
|
||||
desc = 'Add comment',
|
||||
}
|
||||
},
|
||||
cmd = 'Neogen'
|
||||
}
|
||||
return {
|
||||
'danymat/neogen',
|
||||
dependencies = 'nvim-treesitter/nvim-treesitter',
|
||||
opts = {
|
||||
enabled = true,
|
||||
languages = {
|
||||
cpp = {
|
||||
template = {
|
||||
annotation_convention = 'custom',
|
||||
custom = {
|
||||
{ nil, '/// file', { no_results = true, type = { 'file' } } },
|
||||
{ nil, '/// $1', { no_results = true, type = { 'func', 'file' } } },
|
||||
{ nil, '', { no_results = true, type = { 'file' } } },
|
||||
|
||||
{ nil, '/// $1', { type = { 'func' } } },
|
||||
{ 'tparam', '/// \\tparam %s $1' },
|
||||
{ 'parameters', '/// \\param %s $1' },
|
||||
{ 'return_statement', '/// \\return $1' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
'<leader>n',
|
||||
function()
|
||||
require('neogen').generate({})
|
||||
end,
|
||||
desc = 'Add comment',
|
||||
},
|
||||
},
|
||||
cmd = 'Neogen',
|
||||
}
|
||||
|
@ -1,27 +1,27 @@
|
||||
return {
|
||||
'TimUntersberger/neogit',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'sindrets/diffview.nvim'
|
||||
},
|
||||
config = function()
|
||||
local neogit = require('neogit')
|
||||
neogit.setup {
|
||||
integrations = {
|
||||
diffview = true,
|
||||
telescope = false,
|
||||
fzf_lua = true
|
||||
},
|
||||
graph_style = "unicode",
|
||||
}
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
'<space>t',
|
||||
function()
|
||||
require('neogit').open()
|
||||
end
|
||||
}
|
||||
},
|
||||
cmd = { 'Neogit ' }
|
||||
}
|
||||
return {
|
||||
'TimUntersberger/neogit',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'sindrets/diffview.nvim',
|
||||
},
|
||||
config = function()
|
||||
local neogit = require('neogit')
|
||||
neogit.setup({
|
||||
integrations = {
|
||||
diffview = true,
|
||||
telescope = false,
|
||||
fzf_lua = true,
|
||||
},
|
||||
graph_style = 'unicode',
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
'<space>t',
|
||||
function()
|
||||
require('neogit').open()
|
||||
end,
|
||||
},
|
||||
},
|
||||
cmd = { 'Neogit ' },
|
||||
}
|
||||
|
@ -1,39 +1,39 @@
|
||||
return {
|
||||
'nvim-neotest/neotest',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
'antoinemadec/FixCursorHold.nvim',
|
||||
'nvim-neotest/neotest-python'
|
||||
},
|
||||
config = function()
|
||||
local pythonVenv = require('utils.python_venv')
|
||||
require('neotest').setup({
|
||||
adapters = {
|
||||
require('neotest-python')({
|
||||
dap = {
|
||||
justMyCode = false
|
||||
},
|
||||
runner = 'pytest',
|
||||
python = pythonVenv.getPythonEnv
|
||||
})
|
||||
}
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
'<F3>',
|
||||
function()
|
||||
require('neotest').run.run()
|
||||
end,
|
||||
desc = 'Run nearest test'
|
||||
},
|
||||
{
|
||||
'<S-F3>',
|
||||
function()
|
||||
require('neotest').run.run({ strategy = 'dap' })
|
||||
end,
|
||||
desc = 'Run nearest test'
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
'nvim-neotest/neotest',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
'antoinemadec/FixCursorHold.nvim',
|
||||
'nvim-neotest/neotest-python',
|
||||
},
|
||||
config = function()
|
||||
local pythonVenv = require('utils.python_venv')
|
||||
require('neotest').setup({
|
||||
adapters = {
|
||||
require('neotest-python')({
|
||||
dap = {
|
||||
justMyCode = false,
|
||||
},
|
||||
runner = 'pytest',
|
||||
python = pythonVenv.getPythonEnv,
|
||||
}),
|
||||
},
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
'<F3>',
|
||||
function()
|
||||
require('neotest').run.run()
|
||||
end,
|
||||
desc = 'Run nearest test',
|
||||
},
|
||||
{
|
||||
'<S-F3>',
|
||||
function()
|
||||
require('neotest').run.run({ strategy = 'dap' })
|
||||
end,
|
||||
desc = 'Run nearest test',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -5,5 +5,5 @@ return {
|
||||
render = 'background', -- or 'foreground' or 'virtual',
|
||||
enable_named_colors = true,
|
||||
},
|
||||
cmd = { 'HighlightColors' }
|
||||
cmd = { 'HighlightColors' },
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ return {
|
||||
'mfussenegger/nvim-lint',
|
||||
config = function()
|
||||
require('lint').linters_by_ft = {
|
||||
cpp = { 'clangtidy', }
|
||||
cpp = { 'clangtidy' },
|
||||
}
|
||||
vim.api.nvim_create_autocmd({ 'BufWritePost' }, {
|
||||
callback = function()
|
||||
@ -15,5 +15,5 @@ return {
|
||||
-- require('lint').try_lint('cspell')
|
||||
end,
|
||||
})
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
@ -1,7 +1,8 @@
|
||||
return {
|
||||
'notjedi/nvim-rooter.lua',
|
||||
opts = {
|
||||
rooter_patterns = { '.git',
|
||||
rooter_patterns = {
|
||||
'.git',
|
||||
'_darcs',
|
||||
'.hg',
|
||||
'.bzr',
|
||||
@ -10,6 +11,7 @@ return {
|
||||
'package.json',
|
||||
'build_nvim',
|
||||
'real_path.txt',
|
||||
'conaninfo.txt' },
|
||||
}
|
||||
'conaninfo.txt',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
return {
|
||||
'kylechui/nvim-surround',
|
||||
version = '*', -- Use for stability; omit to use `main` branch for the latest features
|
||||
version = '*', -- Use for stability; omit to use `main` branch for the latest features
|
||||
event = 'VeryLazy',
|
||||
config = function()
|
||||
require('nvim-surround').setup({
|
||||
-- Configuration here, or leave empty to use defaults
|
||||
})
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
@ -26,6 +26,6 @@ return {
|
||||
require('oil').open()
|
||||
end,
|
||||
desc = 'Open oil',
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -28,6 +28,6 @@ return {
|
||||
'OverseerBuild',
|
||||
'OverseerQuickAction',
|
||||
'OverseerTaskAction',
|
||||
'OverseerClearCache'
|
||||
}
|
||||
'OverseerClearCache',
|
||||
},
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
return {
|
||||
'Fildo7525/pretty_hover',
|
||||
event = 'LspAttach',
|
||||
opts = {},
|
||||
}
|
||||
return {
|
||||
'Fildo7525/pretty_hover',
|
||||
event = 'LspAttach',
|
||||
opts = {},
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
return {
|
||||
'HiPhish/rainbow-delimiters.nvim',
|
||||
dependencies = 'nvim-treesitter/nvim-treesitter',
|
||||
event = 'VeryLazy'
|
||||
}
|
||||
return {
|
||||
'HiPhish/rainbow-delimiters.nvim',
|
||||
dependencies = 'nvim-treesitter/nvim-treesitter',
|
||||
event = 'VeryLazy',
|
||||
}
|
||||
|
@ -6,8 +6,9 @@ return {
|
||||
server = {
|
||||
on_attach = function(client, bufnr)
|
||||
local options = { noremap = true, silent = false, buffer = bufnr }
|
||||
vim.keymap.set('n', '<space>y', function() vim.cmd.RustLsp { 'hover', 'actions' } end,
|
||||
vim.tbl_extend('error', options, { desc = 'Hover' }))
|
||||
vim.keymap.set('n', '<space>y', function()
|
||||
vim.cmd.RustLsp({ 'hover', 'actions' })
|
||||
end, vim.tbl_extend('error', options, { desc = 'Hover' }))
|
||||
|
||||
local group = vim.api.nvim_create_augroup('lsp_document_highlight', { clear = false })
|
||||
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
||||
@ -31,14 +32,14 @@ return {
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
vim.lsp.buf.clear_references()
|
||||
vim.api.nvim_clear_autocmds {
|
||||
vim.api.nvim_clear_autocmds({
|
||||
group = group,
|
||||
buffer = bufnr
|
||||
}
|
||||
buffer = bufnr,
|
||||
})
|
||||
end,
|
||||
})
|
||||
end
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ return {
|
||||
config = function()
|
||||
function _G.set_terminal_keymaps(term)
|
||||
local opts = { noremap = true }
|
||||
if (term.cmd ~= 'lazygit') then
|
||||
if term.cmd ~= 'lazygit' then
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, 't', '<esc>', [[<C-\><C-n>]], opts)
|
||||
end
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, 't', 'jk', [[<C-\><C-n>]], opts)
|
||||
@ -14,7 +14,7 @@ return {
|
||||
end
|
||||
|
||||
require('toggleterm').setup({
|
||||
on_open = set_terminal_keymaps
|
||||
on_open = set_terminal_keymaps,
|
||||
})
|
||||
|
||||
local Terminal = require('toggleterm.terminal').Terminal
|
||||
@ -46,8 +46,8 @@ return {
|
||||
function()
|
||||
_lazygit_toggle()
|
||||
end,
|
||||
desc = 'LazyGit'
|
||||
}
|
||||
desc = 'LazyGit',
|
||||
},
|
||||
},
|
||||
cmd = 'ToggleTerm',
|
||||
}
|
||||
|
@ -1,55 +1,55 @@
|
||||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
version = '*',
|
||||
build = ':TSUpdate',
|
||||
config = function()
|
||||
require('nvim-treesitter.install').compilers = { 'clang' }
|
||||
require('nvim-treesitter.configs').setup({
|
||||
ensure_installed = '',
|
||||
modules = {},
|
||||
sync_install = true,
|
||||
auto_install = true,
|
||||
ignore_install = {},
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = { 'markdown' }
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
|
||||
max_file_lines = nil, -- Do not enable for files with more than n lines, int
|
||||
-- colors = {}, -- table of hex strings
|
||||
-- termcolors = {} -- table of colour name strings
|
||||
},
|
||||
indent = {
|
||||
enable = false -- maybe buggy
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
|
||||
-- Automatically jump forward to textobj, similar to targets.vim
|
||||
lookahead = true,
|
||||
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
['af'] = '@function.outer',
|
||||
['if'] = '@function.inner',
|
||||
['ac'] = '@class.outer',
|
||||
['ic'] = '@class.inner',
|
||||
},
|
||||
},
|
||||
lsp_interop = {
|
||||
enable = true,
|
||||
border = 'none',
|
||||
peek_definition_code = {
|
||||
['<leader>df'] = '@function.outer',
|
||||
['<leader>dF'] = '@class.outer',
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.treesitter.language.register('groovy', 'java')
|
||||
require('nvim-treesitter.install').prefer_git = false
|
||||
end
|
||||
}
|
||||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
version = '*',
|
||||
build = ':TSUpdate',
|
||||
config = function()
|
||||
require('nvim-treesitter.install').compilers = { 'clang' }
|
||||
require('nvim-treesitter.configs').setup({
|
||||
ensure_installed = '',
|
||||
modules = {},
|
||||
sync_install = true,
|
||||
auto_install = true,
|
||||
ignore_install = {},
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = { 'markdown' },
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
|
||||
max_file_lines = nil, -- Do not enable for files with more than n lines, int
|
||||
-- colors = {}, -- table of hex strings
|
||||
-- termcolors = {} -- table of colour name strings
|
||||
},
|
||||
indent = {
|
||||
enable = false, -- maybe buggy
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
|
||||
-- Automatically jump forward to textobj, similar to targets.vim
|
||||
lookahead = true,
|
||||
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
['af'] = '@function.outer',
|
||||
['if'] = '@function.inner',
|
||||
['ac'] = '@class.outer',
|
||||
['ic'] = '@class.inner',
|
||||
},
|
||||
},
|
||||
lsp_interop = {
|
||||
enable = true,
|
||||
border = 'none',
|
||||
peek_definition_code = {
|
||||
['<leader>df'] = '@function.outer',
|
||||
['<leader>dF'] = '@class.outer',
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.treesitter.language.register('groovy', 'java')
|
||||
require('nvim-treesitter.install').prefer_git = false
|
||||
end,
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
return {
|
||||
'folke/which-key.nvim',
|
||||
version = '*',
|
||||
opts = {
|
||||
plugins = {
|
||||
marks = false,
|
||||
registers = false,
|
||||
presets = {
|
||||
operators = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
'folke/which-key.nvim',
|
||||
version = '*',
|
||||
opts = {
|
||||
plugins = {
|
||||
marks = false,
|
||||
registers = false,
|
||||
presets = {
|
||||
operators = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -1,45 +1,44 @@
|
||||
return {
|
||||
'natecraddock/workspaces.nvim',
|
||||
config = function()
|
||||
require('workspaces').setup()
|
||||
end,
|
||||
branch = 'master',
|
||||
keys = {
|
||||
{
|
||||
'<space>p',
|
||||
function()
|
||||
local workspaces = require('workspaces')
|
||||
local fzf_lua = require('fzf-lua')
|
||||
fzf_lua.fzf_exec(function(cb)
|
||||
local results = workspaces.get()
|
||||
for _, e in ipairs(results) do
|
||||
cb(e['name'])
|
||||
end
|
||||
cb()
|
||||
end,
|
||||
{
|
||||
actions = {
|
||||
['default'] = {
|
||||
function(selected)
|
||||
workspaces.open(selected[1])
|
||||
fzf_lua.git_files()
|
||||
end,
|
||||
},
|
||||
['ctrl-d'] = {
|
||||
function(selected)
|
||||
workspaces.remove(selected[1])
|
||||
end,
|
||||
fzf_lua.actions.resume
|
||||
},
|
||||
['ctrl-a'] = {
|
||||
function()
|
||||
workspaces.add()
|
||||
end,
|
||||
fzf_lua.actions.resume
|
||||
}
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
'natecraddock/workspaces.nvim',
|
||||
config = function()
|
||||
require('workspaces').setup()
|
||||
end,
|
||||
branch = 'master',
|
||||
keys = {
|
||||
{
|
||||
'<space>p',
|
||||
function()
|
||||
local workspaces = require('workspaces')
|
||||
local fzf_lua = require('fzf-lua')
|
||||
fzf_lua.fzf_exec(function(cb)
|
||||
local results = workspaces.get()
|
||||
for _, e in ipairs(results) do
|
||||
cb(e['name'])
|
||||
end
|
||||
cb()
|
||||
end, {
|
||||
actions = {
|
||||
['default'] = {
|
||||
function(selected)
|
||||
workspaces.open(selected[1])
|
||||
fzf_lua.git_files()
|
||||
end,
|
||||
},
|
||||
['ctrl-d'] = {
|
||||
function(selected)
|
||||
workspaces.remove(selected[1])
|
||||
end,
|
||||
fzf_lua.actions.resume,
|
||||
},
|
||||
['ctrl-a'] = {
|
||||
function()
|
||||
workspaces.add()
|
||||
end,
|
||||
fzf_lua.actions.resume,
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user