format with stylua

This commit is contained in:
2024-06-06 23:56:11 +02:00
parent d57eca961d
commit ae5b5fd06b
57 changed files with 994 additions and 989 deletions

View File

@@ -1,27 +1,27 @@
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim' local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ vim.fn.system({
'git', 'git',
'clone', 'clone',
'--filter=blob:none', '--filter=blob:none',
'https://github.com/folke/lazy.nvim.git', 'https://github.com/folke/lazy.nvim.git',
'--branch=stable', -- latest stable release '--branch=stable', -- latest stable release
lazypath, lazypath,
}) })
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
require('lazy').setup({ require('lazy').setup({
defaults = { defaults = {
version = '', version = '',
}, },
spec = { spec = {
{ import = 'plugins' }, { import = 'plugins' },
{ import = 'themes' } { import = 'themes' },
}, },
change_detection = { change_detection = {
-- automatically check for config file changes and reload the ui -- automatically check for config file changes and reload the ui
enabled = true, enabled = true,
notify = false, -- get a notification when changes are found notify = false, -- get a notification when changes are found
}, },
}) })

View File

@@ -3,24 +3,24 @@ vim.cmd('language en_US.utf-8')
local opt = vim.opt local opt = vim.opt
local indent = 2 local indent = 2
opt.termguicolors = true -- Enable colors in terminal opt.termguicolors = true -- Enable colors in terminal
opt.hlsearch = true --Set highlight on search opt.hlsearch = true --Set highlight on search
opt.number = true --Make line numbers default opt.number = true --Make line numbers default
opt.relativenumber = false --Make relative number default opt.relativenumber = false --Make relative number default
opt.mouse = 'a' --Enable mouse mode opt.mouse = 'a' --Enable mouse mode
opt.breakindent = true --Enable break indent opt.breakindent = true --Enable break indent
opt.undofile = true --Save undo history opt.undofile = true --Save undo history
opt.ignorecase = true --Case insensitive searching unless /C or capital in search opt.ignorecase = true --Case insensitive searching unless /C or capital in search
opt.smartcase = true -- Smart case opt.smartcase = true -- Smart case
opt.updatetime = 300 --Decrease update time opt.updatetime = 300 --Decrease update time
opt.signcolumn = 'yes' -- Always show sign column opt.signcolumn = 'yes' -- Always show sign column
opt.timeoutlen = 300 -- Time in milliseconds to wait for a mapped sequence to complete. opt.timeoutlen = 300 -- Time in milliseconds to wait for a mapped sequence to complete.
opt.ttimeoutlen = 10 opt.ttimeoutlen = 10
opt.showmode = false -- Do not need to show the mode. We use the statusline instead. opt.showmode = false -- Do not need to show the mode. We use the statusline instead.
opt.scrolloff = 999 -- Lines of context opt.scrolloff = 999 -- Lines of context
opt.joinspaces = false -- No double spaces with join after a dot opt.joinspaces = false -- No double spaces with join after a dot
opt.showmatch = true -- Show matching braces opt.showmatch = true -- Show matching braces
opt.wrap = true -- When on, lines longer than the width of the window will wrap and displaying continues on the next line opt.wrap = true -- When on, lines longer than the width of the window will wrap and displaying continues on the next line
opt.list = true opt.list = true
opt.hidden = true opt.hidden = true
opt.scrolloff = 4 opt.scrolloff = 4
@@ -90,7 +90,7 @@ opt.completeopt = 'menu,menuone,noselect'
opt.expandtab = true opt.expandtab = true
opt.smartindent = true opt.smartindent = true
opt.title = true opt.title = true
opt.titlestring = '%(%{fnamemodify(getcwd(),\":t\")}%) Neovim' opt.titlestring = '%(%{fnamemodify(getcwd(),":t")}%) Neovim'
opt.laststatus = 3 -- for lualine opt.laststatus = 3 -- for lualine
opt.background = 'dark' opt.background = 'dark'

View File

@@ -78,16 +78,11 @@ vim.api.nvim_create_autocmd('BufReadPost', {
end, end,
}) })
-- Check if we need to reload the file when it changed -- Check if we need to reload the file when it changed
api.nvim_create_autocmd({ 'FocusGained', 'BufEnter' }, api.nvim_create_autocmd({ 'FocusGained', 'BufEnter' }, { command = [[if !bufexists("[Command Line]") | checktime | endif]] })
{ command = [[if !bufexists("[Command Line]") | checktime | endif]] })
-- windows to close with "q" -- windows to close with "q"
api.nvim_create_autocmd( api.nvim_create_autocmd('FileType', { pattern = { 'help', 'startuptime', 'qf', 'lspinfo' }, command = [[nnoremap <buffer><silent> q :close<CR>]] })
'FileType',
{ pattern = { 'help', 'startuptime', 'qf', 'lspinfo' }, command = [[nnoremap <buffer><silent> q :close<CR>]] }
)
api.nvim_create_autocmd('FileType', { pattern = 'man', command = [[nnoremap <buffer><silent> q :quit<CR>]] }) api.nvim_create_autocmd('FileType', { pattern = 'man', command = [[nnoremap <buffer><silent> q :quit<CR>]] })
-- don't auto comment new line -- don't auto comment new line

View File

@@ -53,7 +53,6 @@ vim.keymap.set('x', "'", 'y/\\V<C-R>"<CR>N', { noremap = true, silent = true, de
vim.keymap.set('n', '<space>x', 'za', { desc = 'Toggle fold' }) vim.keymap.set('n', '<space>x', 'za', { desc = 'Toggle fold' })
vim.keymap.set({ 'n', 'x' }, '<leader>y', '"+y', { desc = 'Copy from system clipboard' }) vim.keymap.set({ 'n', 'x' }, '<leader>y', '"+y', { desc = 'Copy from system clipboard' })
vim.keymap.set({ 'n', 'x' }, '<leader>Y', '"+yg_', { desc = 'Copy from system clipboard' }) vim.keymap.set({ 'n', 'x' }, '<leader>Y', '"+yg_', { desc = 'Copy from system clipboard' })
vim.keymap.set({ 'n', 'x' }, '<leader>p', '"+p', { desc = 'Paste from system clipboard' }) vim.keymap.set({ 'n', 'x' }, '<leader>p', '"+p', { desc = 'Paste from system clipboard' })
@@ -68,9 +67,16 @@ if vim.g.neovide then
vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * delta vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * delta
print(string.format('scaling: %f', vim.g.neovide_scale_factor)) print(string.format('scaling: %f', vim.g.neovide_scale_factor))
end end
vim.keymap.set('n', '<C-=>', function() change_scale_factor(1.25) end) vim.keymap.set('n', '<C-=>', function()
vim.keymap.set('n', '<C-->', function() change_scale_factor(1 / 1.25) end) change_scale_factor(1.25)
vim.keymap.set('n', '<C-ScrollWheelUp>', function() change_scale_factor(1.25) end) end)
vim.keymap.set('n', '<C-ScrollWheelDown>', function() change_scale_factor(1 / 1.25) end) vim.keymap.set('n', '<C-->', function()
change_scale_factor(1 / 1.25)
end)
vim.keymap.set('n', '<C-ScrollWheelUp>', function()
change_scale_factor(1.25)
end)
vim.keymap.set('n', '<C-ScrollWheelDown>', function()
change_scale_factor(1 / 1.25)
end)
end end

View File

@@ -10,11 +10,12 @@ return {
args = { file, '-p', 'build_nvim', '--quiet', '--config-file', dir .. '/.clang-tidy' }, args = { file, '-p', 'build_nvim', '--quiet', '--config-file', dir .. '/.clang-tidy' },
cwd = dir, cwd = dir,
components = { components = {
{ 'on_result_diagnostics_quickfix', open = false}, { 'on_result_diagnostics_quickfix', open = false },
{ 'on_output_parse', problem_matcher = '$gcc' }, { 'on_output_parse', problem_matcher = '$gcc' },
{ 'on_result_diagnostics', remove_on_restart = true }, { 'on_result_diagnostics', remove_on_restart = true },
{ 'restart_on_save'}, { 'restart_on_save' },
'default' }, 'default',
},
} }
end, end,
condition = { condition = {

View File

@@ -1,26 +1,22 @@
return { return {
name = 'CMake Build for nvim', name = 'CMake Build for nvim',
builder = function() builder = function()
return { return {
cmd = { 'cmake' }, cmd = { 'cmake' },
args = { '--build', '.', args = { '--build', '.', '--', '-j8' },
'--', '-j8' },
cwd = 'build_nvim', cwd = 'build_nvim',
-- components = {"on_output_parse", problem_matcher = "$gcc"} -- components = {"on_output_parse", problem_matcher = "$gcc"}
-- components = {'on_output_quickfix', set_diagnostics = true, open = true} -- components = {'on_output_quickfix', set_diagnostics = true, open = true}
components = { { "on_output_quickfix", open = true, open_on_match = true }, components = { { 'on_output_quickfix', open = true, open_on_match = true }, { 'on_output_parse', problem_matcher = '$gcc' }, 'default' },
{ 'on_output_parse', problem_matcher = '$gcc' },
'default' },
} }
end, end,
condition = { condition = {
callback = function(opts) callback = function(opts)
if vim.fn.executable("cmake") == 0 then if vim.fn.executable('cmake') == 0 then
return false, 'Command "cmake" not found' return false, 'Command "cmake" not found'
end end
if vim.fn.findfile("CMakeLists.txt", opts.dir .. ";") == "" then if vim.fn.findfile('CMakeLists.txt', opts.dir .. ';') == '' then
return false, "No CMakeLists.txt found" return false, 'No CMakeLists.txt found'
end end
return true return true
end, end,

View File

@@ -1,21 +1,19 @@
return { return {
name = 'CMake Clean for nvim', name = 'CMake Clean for nvim',
builder = function() builder = function()
return { return {
cmd = { 'cmake' }, cmd = { 'cmake' },
args = { '--build', '.', args = { '--build', '.', '-t', 'clean' },
'-t', 'clean' },
cwd = 'build_nvim', cwd = 'build_nvim',
} }
end, end,
condition = { condition = {
callback = function(opts) callback = function(opts)
if vim.fn.executable("cmake") == 0 then if vim.fn.executable('cmake') == 0 then
return false, 'Command "cmake" not found' return false, 'Command "cmake" not found'
end end
if vim.fn.findfile("CMakeLists.txt", opts.dir .. ";") == "" then if vim.fn.findfile('CMakeLists.txt', opts.dir .. ';') == '' then
return false, "No CMakeLists.txt found" return false, 'No CMakeLists.txt found'
end end
return true return true
end, end,

View File

@@ -1,6 +1,7 @@
return { return {
'builtin', 'builtin',
'user.cmake.configure', 'user.cmake.configure',
'user.cmake.build', 'user.cmake.build',
'user.cmake.clean'} 'user.cmake.clean',
}
-- https://gitlab.com/ranjithshegde/dotbare/-/tree/master/.config/nvim/lua/overseer -- https://gitlab.com/ranjithshegde/dotbare/-/tree/master/.config/nvim/lua/overseer

View File

@@ -4,19 +4,17 @@ return {
local cwd = vim.fn.getcwd() local cwd = vim.fn.getcwd()
return { return {
cmd = { 'cmake' }, cmd = { 'cmake' },
args = { '-B', 'build_nvim', args = { '-B', 'build_nvim', '-S', cwd, '-G', 'Ninja' },
'-S', cwd,
'-G', 'Ninja' },
cwd = build_nvim, cwd = build_nvim,
} }
end, end,
condition = { condition = {
callback = function(opts) callback = function(opts)
if vim.fn.executable("cmake") == 0 then if vim.fn.executable('cmake') == 0 then
return false, 'Command "cmake" not found' return false, 'Command "cmake" not found'
end end
if vim.fn.findfile("CMakeLists.txt", opts.dir .. ";") == "" then if vim.fn.findfile('CMakeLists.txt', opts.dir .. ';') == '' then
return false, "No CMakeLists.txt found" return false, 'No CMakeLists.txt found'
end end
return true return true
end, end,

View File

@@ -1,23 +1,23 @@
return { return {
'stevearc/aerial.nvim', 'stevearc/aerial.nvim',
config = function() config = function()
require('aerial').setup({ require('aerial').setup({
backends = { 'lsp', 'treesitter', 'markdown' }, backends = { 'lsp', 'treesitter', 'markdown' },
layout = { layout = {
default_direction = 'prefer_left' default_direction = 'prefer_left',
}, },
filter_kind = false, filter_kind = false,
show_guides = true, show_guides = true,
}) })
end, end,
cmd = 'AerialToggle', cmd = 'AerialToggle',
keys = { keys = {
{ {
'<leader>s', '<leader>s',
function() function()
require('aerial').toggle() require('aerial').toggle()
end, end,
desc = 'Symbols outline', desc = 'Symbols outline',
} },
} },
} }

View File

@@ -1,37 +1,37 @@
return { return {
'Civitasv/cmake-tools.nvim', 'Civitasv/cmake-tools.nvim',
opts = { opts = {
cmake_command = 'cmake', cmake_command = 'cmake',
cmake_generate_options = { '-D', 'CMAKE_EXPORT_COMPILE_COMMANDS=1', '-G', 'Ninja' }, cmake_generate_options = { '-D', 'CMAKE_EXPORT_COMPILE_COMMANDS=1', '-G', 'Ninja' },
cmake_show_console = 'always', cmake_show_console = 'always',
cmake_build_directory = 'build_nvim', cmake_build_directory = 'build_nvim',
cmake_dap_configuration = { name = 'cpp', type = 'codelldb', request = 'launch' }, -- dap configuration, optional cmake_dap_configuration = { name = 'cpp', type = 'codelldb', request = 'launch' }, -- dap configuration, optional
}, },
cmd = { cmd = {
'CMakeGenerate', 'CMakeGenerate',
'CMakeBuild', 'CMakeBuild',
'CMakeRun', 'CMakeRun',
'CMakeDebug', 'CMakeDebug',
'CMakeSelectBuildType', 'CMakeSelectBuildType',
'CMakeSelectBuildTarget', 'CMakeSelectBuildTarget',
'CMakeSelectLaunchTarget', 'CMakeSelectLaunchTarget',
'CMakeSelectKit', 'CMakeSelectKit',
'CMakeSelectConfigurePreset', 'CMakeSelectConfigurePreset',
'CMakeSelectBuildPreset', 'CMakeSelectBuildPreset',
'CMakeSelectLaunchTarget', 'CMakeSelectLaunchTarget',
'CMakeOpen', 'CMakeOpen',
'CMakeClose', 'CMakeClose',
'CMakeInstall', 'CMakeInstall',
'CMakeClean', 'CMakeClean',
'CMakeStop', 'CMakeStop',
}, },
keys = { keys = {
{ {
'<S-F6>', '<S-F6>',
function() function()
require('cmake-tools').debug({}) require('cmake-tools').debug({})
end, end,
desc = 'Run and debug target from cmake' desc = 'Run and debug target from cmake',
} },
} },
} }

View File

@@ -70,18 +70,19 @@ return {
else else
fallback() fallback()
end end
end, { 'i', 's', }), end, { 'i', 's' }),
['<c-x>'] = cmp.mapping(cmp.mapping.complete( ['<c-x>'] = cmp.mapping(
{ cmp.mapping.complete({
config = { config = {
sources = { sources = {
{ {
name = 'cmdline_history' name = 'cmdline_history',
} },
} },
} },
} }),
), { 'c' }), { 'c' }
),
}, },
snippet = { snippet = {
expand = function(args) expand = function(args)
@@ -89,15 +90,15 @@ return {
end, end,
}, },
sources = { sources = {
{ name = 'neorg', priority = 8 }, { name = 'neorg', priority = 8 },
{ name = 'luasnip', priority = 8 }, { name = 'luasnip', priority = 8 },
{ {
name = 'nvim_lsp', name = 'nvim_lsp',
option = { option = {
markdown_oxide = { markdown_oxide = {
keyword_pattern = [[\(\k\| \|\/\|#\)\+]] keyword_pattern = [[\(\k\| \|\/\|#\)\+]],
} },
} },
}, },
{ name = 'nvim_lsp_signature_help', priority = 7 }, { name = 'nvim_lsp_signature_help', priority = 7 },
-- { name = 'treesitter', priority = 6 }, -- { name = 'treesitter', priority = 6 },
@@ -111,8 +112,8 @@ return {
bufs[vim.api.nvim_win_get_buf(win)] = true bufs[vim.api.nvim_win_get_buf(win)] = true
end end
return vim.tbl_keys(bufs) return vim.tbl_keys(bufs)
end end,
} },
}, },
-- { name = 'nvim_lua' }, -- { name = 'nvim_lua' },
-- { name = 'look' }, -- { name = 'look' },
@@ -124,9 +125,9 @@ return {
}, },
enabled = function() enabled = function()
return vim.api.nvim_buf_get_option(0, 'buftype') ~= 'prompt' 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') == 'dap-repl'
or vim.api.nvim_buf_get_option(0, 'filetype') == 'dapui_watches' 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') == 'dapui_hover'
end, end,
-- completion = { -- completion = {
-- completeopt = 'menu,menuone,noinsert, noselect', -- completeopt = 'menu,menuone,noinsert, noselect',

View File

@@ -1,21 +1,21 @@
return { return {
'numToStr/Comment.nvim', 'numToStr/Comment.nvim',
version = '*', version = '*',
opts = { opts = {
mappings = false, mappings = false,
}, },
keys = { keys = {
{ {
'<c-c>', '<c-c>',
'<Plug>(comment_toggle_linewise_current)', '<Plug>(comment_toggle_linewise_current)',
desc = 'Toggle comment' desc = 'Toggle comment',
}, },
{ {
'<c-c>', '<c-c>',
'<Plug>(comment_toggle_linewise_visual)gv', '<Plug>(comment_toggle_linewise_visual)gv',
mode = 'v', mode = 'v',
desc = 'Toggle comment' desc = 'Toggle comment',
} },
} },
} }

View File

@@ -1,225 +1,224 @@
return { return {
'mfussenegger/nvim-dap', 'mfussenegger/nvim-dap',
dependencies = { dependencies = {
'mfussenegger/nvim-dap-python', 'mfussenegger/nvim-dap-python',
'theHamsta/nvim-dap-virtual-text', 'theHamsta/nvim-dap-virtual-text',
{ {
'rcarriga/nvim-dap-ui', 'rcarriga/nvim-dap-ui',
dependencies = { dependencies = {
'nvim-neotest/nvim-nio' 'nvim-neotest/nvim-nio',
} },
}, },
'rcarriga/cmp-dap', 'rcarriga/cmp-dap',
}, },
keys = { keys = {
{ {
'<F5>', '<F5>',
function() function()
require('dap').continue() require('dap').continue()
end, end,
desc = 'DAP start or continue' desc = 'DAP start or continue',
}, },
{ {
'<S-F5>', '<S-F5>',
function() function()
require('dap').run_last() require('dap').run_last()
end, end,
desc = 'DAP run last' desc = 'DAP run last',
}, },
{ {
'<F6>', '<F6>',
function() function()
loadConfigs() loadConfigs()
end, end,
desc = 'DAP configs' desc = 'DAP configs',
}, },
{ {
'<F7>', '<F7>',
function() function()
require('dap').goto_() require('dap').goto_()
end, end,
desc = 'DAP goto' desc = 'DAP goto',
}, },
{ {
'<F8>', '<F8>',
function() function()
require('dap.ui.widgets').hover() require('dap.ui.widgets').hover()
end, end,
desc = 'DAP Hover' desc = 'DAP Hover',
}, },
{ {
'<F9>', '<F9>',
function() function()
require('dap').toggle_breakpoint() require('dap').toggle_breakpoint()
end, end,
desc = 'DAP breakpoint' desc = 'DAP breakpoint',
}, },
{ {
'<F10>', '<F10>',
function() function()
require('dap').step_over() require('dap').step_over()
end, end,
desc = 'DAP step_over' desc = 'DAP step_over',
}, },
{ {
'<F11>', '<F11>',
function() function()
require('dap').step_into() require('dap').step_into()
end, end,
desc = 'DAP step_into' desc = 'DAP step_into',
}, },
{ {
'<S-F11>', '<S-F11>',
function() function()
require('dap').step_out() require('dap').step_out()
end, end,
desc = 'DAP step_out' desc = 'DAP step_out',
}, },
}, },
config = function() config = function()
local dap = require('dap') local dap = require('dap')
vim.fn.sign_define('DapBreakpoint', { text = '🛑', texthl = '', linehl = '', numhl = '' }) vim.fn.sign_define('DapBreakpoint', { text = '🛑', texthl = '', linehl = '', numhl = '' })
require('cmp_dap').is_dap_buffer() require('cmp_dap').is_dap_buffer()
-- make sure we can exit the terminal with esc
-- make sure we can exit the terminal with esc vim.api.nvim_create_autocmd({ 'TermOpen' }, {
vim.api.nvim_create_autocmd({ 'TermOpen' }, { pattern = { '*dap-terminal*' },
pattern = { '*dap-terminal*' }, callback = function()
callback = function() local opts = { noremap = true }
local opts = { noremap = true } vim.api.nvim_buf_set_keymap(0, 't', '<esc>', [[<C-\><C-n>]], opts)
vim.api.nvim_buf_set_keymap(0, 't', '<esc>', [[<C-\><C-n>]], opts) end,
end })
})
local pythonVenv = require('utils.python_venv')
local pythonVenv = require('utils.python_venv')
function loadConfigs()
function loadConfigs() require('dap.ext.vscode').load_launchjs()
require('dap.ext.vscode').load_launchjs() -- Make sure we use the correct python env even for the configs from launch.json
-- Make sure we use the correct python env even for the configs from launch.json for _, config in pairs(dap.configurations.python) do
for _, config in pairs(dap.configurations.python) do config.pythonPath = pythonVenv.getPythonEnv()
config.pythonPath = pythonVenv.getPythonEnv() config.cwd = vim.fn.getcwd()
config.cwd = vim.fn.getcwd() end
end require('fzf-lua').dap_configurations()
require('fzf-lua').dap_configurations() end
end
local masonpath = vim.fn.stdpath('data') .. '/mason'
local masonpath = vim.fn.stdpath('data') .. '/mason'
-- PYTHON
-- PYTHON dap.adapters.python = {
dap.adapters.python = { type = 'executable',
type = 'executable', command = 'python',
command = 'python', args = { '-m', 'debugpy.adapter' },
args = { '-m', 'debugpy.adapter' }, options = {
options = { detached = true,
detached = true, },
}, }
}
local dapui = require('dapui')
local dapui = require('dapui') dapui.setup()
dapui.setup() dap.listeners.after.event_initialized['dapui_config'] = function()
dap.listeners.after.event_initialized['dapui_config'] = function() dapui.open({})
dapui.open({}) end
end dap.listeners.before.event_terminated['dapui_config'] = function()
dap.listeners.before.event_terminated['dapui_config'] = function() dapui.close({})
dapui.close({}) end
end dap.listeners.before.event_exited['dapui_config'] = function()
dap.listeners.before.event_exited['dapui_config'] = function() dapui.close({})
dapui.close({}) end
end
dap.configurations.python = {
dap.configurations.python = { {
{ type = 'python',
type = 'python', request = 'launch',
request = 'launch', name = 'Launch file with venv',
name = 'Launch file with venv', justMyCode = false,
justMyCode = false, program = '${file}',
program = '${file}', cwd = vim.fn.getcwd(),
cwd = vim.fn.getcwd(), pythonPath = pythonVenv.getPythonEnv,
pythonPath = pythonVenv.getPythonEnv },
}, }
}
-- require('dap-python').setup('C:\\Users\\oli\\AppData\\Local\\nvim\\venv_debugpy\\Scripts\\python')
-- require('dap-python').setup('C:\\Users\\oli\\AppData\\Local\\nvim\\venv_debugpy\\Scripts\\python') -- table.insert(require('dap').configurations.python, {
-- table.insert(require('dap').configurations.python, { -- -- type = 'python',
-- -- type = 'python', -- -- request = 'launch',
-- -- request = 'launch', -- -- name = 'My custom launch configuration',
-- -- name = 'My custom launch configuration', -- -- program = '${file}',
-- -- program = '${file}', -- justMyCode = false
-- justMyCode = false -- -- ... more options, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings
-- -- ... 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')
-- require('dap-python').setup('C:/Users/oli/AppData/Local/nvim-data/mason/packages/debugpy/venv/Scripts/python.exe')
-- CPP
-- CPP dap.adapters.codelldb = {
dap.adapters.codelldb = { type = 'server',
type = 'server', port = '${port}',
port = '${port}', executable = {
executable = { command = require('mason-core.path').bin_prefix('codelldb'),
command = require 'mason-core.path'.bin_prefix 'codelldb', args = { '--port', '${port}' },
args = { '--port', '${port}' },
-- On windows you may have to uncomment this:
-- On windows you may have to uncomment this: detached = false,
detached = false, },
} }
}
dap.adapters.cppdbg = {
dap.adapters.cppdbg = { id = 'cppdbg',
id = 'cppdbg', type = 'executable',
type = 'executable', command = masonpath .. '/bin/OpenDebugAD7',
command = masonpath .. '/bin/OpenDebugAD7', }
}
dap.adapters.lldb = {
dap.adapters.lldb = { type = 'executable',
type = 'executable', command = function()
command = function() if vim.loop.os_uname().sysname == 'Linux' then
if vim.loop.os_uname().sysname == 'Linux' then return 'lldb-vscode'
return 'lldb-vscode' else
else return os.getenv('SCOOP') .. '/apps/llvm/current/bin/lldb-vscode.exe'
return os.getenv('SCOOP') .. '/apps/llvm/current/bin/lldb-vscode.exe' end
end end,
end, name = 'lldb',
name = 'lldb' }
}
dap.configurations.cpp = {
dap.configurations.cpp = { {
{ name = 'Launch codelldb',
name = 'Launch codelldb', type = 'codelldb',
type = 'codelldb', request = 'launch',
request = 'launch', program = function()
program = function() return vim.fn.input({ 'Path to executable: ', vim.fn.getcwd() .. '/build_nvim/', 'file' })
return vim.fn.input({ 'Path to executable: ', vim.fn.getcwd() .. '/build_nvim/', 'file' }) end,
end, cwd = '${workspaceFolder}',
cwd = '${workspaceFolder}', stopOnEntry = false,
stopOnEntry = false, },
}, {
{ name = 'Launch lldb',
name = 'Launch lldb', type = 'lldb',
type = 'lldb', request = 'launch',
request = 'launch', program = function()
program = function() return vim.fn.input({ 'Path to executable: ', vim.fn.getcwd() .. '/build_nvim', 'file' })
return vim.fn.input({ 'Path to executable: ', vim.fn.getcwd() .. '/build_nvim', 'file' }) end,
end, cwd = '${workspaceFolder}',
cwd = '${workspaceFolder}', stopOnEntry = false,
stopOnEntry = false, args = {},
args = {},
-- 💀
-- 💀 -- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
-- 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
-- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope --
-- -- Otherwise you might get the following error:
-- Otherwise you might get the following error: --
-- -- Error on launch: Failed to attach to the target process
-- Error on launch: Failed to attach to the target process --
-- -- But you should be aware of the implications:
-- But you should be aware of the implications: -- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
-- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html -- runInTerminal = false,
-- runInTerminal = false, },
}, }
}
-- EXTENSIONS
-- EXTENSIONS
require('nvim-dap-virtual-text').setup({})
require('nvim-dap-virtual-text').setup({}) end,
end, }
}

View File

@@ -1,20 +1,20 @@
return { return {
'sindrets/diffview.nvim', 'sindrets/diffview.nvim',
dependencies = { dependencies = {
'nvim-lua/plenary.nvim' 'nvim-lua/plenary.nvim',
}, },
opts = { opts = {
keymaps = { keymaps = {
view = { view = {
['<leader>b'] = false ['<leader>b'] = false,
}, },
file_panel = { file_panel = {
['<leader>b'] = false ['<leader>b'] = false,
}, },
file_history_panel = { file_history_panel = {
['<leader>b'] = false ['<leader>b'] = false,
}, },
} },
}, },
cmd = 'DiffviewOpen', cmd = 'DiffviewOpen',
keys = { keys = {
@@ -33,5 +33,5 @@ return {
'<cmd>DiffviewOpen origin/master...<cr>', '<cmd>DiffviewOpen origin/master...<cr>',
desc = 'Diffview vs master', desc = 'Diffview vs master',
}, },
} },
} }

View File

@@ -1,3 +1,3 @@
return { return {
'stevearc/dressing.nvim' 'stevearc/dressing.nvim',
} }

View File

@@ -1,34 +1,34 @@
return { return {
'folke/flash.nvim', 'folke/flash.nvim',
event = 'VeryLazy', event = 'VeryLazy',
---@type Flash.Config ---@type Flash.Config
opts = { opts = {
modes = { modes = {
search = { search = {
enabled = false enabled = false,
}, },
char = { char = {
keys = { 'f', 'F', 't', 'T', ';' }, keys = { 'f', 'F', 't', 'T', ';' },
} },
} },
}, },
keys = { keys = {
{ {
's', 's',
mode = { 'n', 'x', 'o' }, mode = { 'n', 'x', 'o' },
function() function()
-- default options: exact mode, multi window, all directions, with a backdrop -- default options: exact mode, multi window, all directions, with a backdrop
require('flash').jump() require('flash').jump()
end, end,
desc = 'Flash jump' desc = 'Flash jump',
}, },
{ {
'S', 'S',
mode = { 'n', 'o', 'x' }, mode = { 'n', 'o', 'x' },
function() function()
require('flash').treesitter() require('flash').treesitter()
end, end,
desc = 'Flash treesitter' desc = 'Flash treesitter',
}, },
}, },
} }

View File

@@ -2,7 +2,7 @@ return {
'ibhagwan/fzf-lua', 'ibhagwan/fzf-lua',
dependencies = { 'nvim-tree/nvim-web-devicons' }, dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function() config = function()
local actions = require 'fzf-lua.actions' local actions = require('fzf-lua.actions')
require('fzf-lua').setup({ require('fzf-lua').setup({
'borderless_full', 'borderless_full',
actions = { actions = {
@@ -17,12 +17,12 @@ return {
}, },
buffers = { buffers = {
['default'] = actions.buf_edit, ['default'] = actions.buf_edit,
['ctrl-s'] = actions.buf_split, ['ctrl-s'] = actions.buf_split,
['ctrl-v'] = actions.buf_vsplit, ['ctrl-v'] = actions.buf_vsplit,
['ctrl-t'] = actions.buf_tabedit, ['ctrl-t'] = actions.buf_tabedit,
['ctrl-x'] = actions.buf_split ['ctrl-x'] = actions.buf_split,
} },
} },
}) })
end, end,
cmd = 'FzfLua', cmd = 'FzfLua',
@@ -121,5 +121,5 @@ return {
mode = { 'n', 'v', 'i' }, mode = { 'n', 'v', 'i' },
desc = 'Fuzzy complete path', desc = 'Fuzzy complete path',
}, },
} },
} }

View File

@@ -9,5 +9,5 @@ return {
delay = 1000, delay = 1000,
ignore_whitespace = false, ignore_whitespace = false,
}, },
} },
} }

View File

@@ -21,7 +21,7 @@ return {
'RainbowCyan', 'RainbowCyan',
} }
local hooks = require 'ibl.hooks' local hooks = require('ibl.hooks')
-- create the highlight groups in the highlight setup hook, so they are reset -- create the highlight groups in the highlight setup hook, so they are reset
-- every time the colorscheme changes -- every time the colorscheme changes
hooks.register(hooks.type.HIGHLIGHT_SETUP, function() hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
@@ -35,12 +35,12 @@ return {
end) end)
vim.g.rainbow_delimiters = { highlight = highlight } vim.g.rainbow_delimiters = { highlight = highlight }
require('ibl').setup { require('ibl').setup({
scope = { scope = {
highlight = highlight, highlight = highlight,
show_start = false show_start = false,
} },
} })
hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark) hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
end, end,

View File

@@ -1,2 +1 @@
return { return {}
}

View File

@@ -12,9 +12,9 @@ return {
}, },
{ {
'Bilal2453/luvit-meta', 'Bilal2453/luvit-meta',
lazy = true lazy = true,
}, -- optional `vim.uv` typings }, -- 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', 'hrsh7th/nvim-cmp',
opts = function(_, opts) opts = function(_, opts)
opts.sources = opts.sources or {} opts.sources = opts.sources or {}

View File

@@ -1,66 +1,49 @@
local lspKeys = function(client, bufnr) local lspKeys = function(client, bufnr)
local fzf = require('fzf-lua') local fzf = require('fzf-lua')
local options = { noremap = true, silent = false, buffer = bufnr } local options = { noremap = true, silent = false, buffer = bufnr }
vim.keymap.set('n', '<space>,', vim.diagnostic.goto_prev, vim.keymap.set('n', '<space>,', vim.diagnostic.goto_prev, vim.tbl_extend('error', options, { desc = 'Diag 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', '<space>;', vim.diagnostic.goto_next, vim.keymap.set({ 'n', 'x' }, '<space>a', vim.lsp.buf.code_action, vim.tbl_extend('error', options, { desc = 'Code action' }))
vim.tbl_extend('error', options, { desc = 'Diag next' })) vim.keymap.set('n', '<space>d', function()
vim.keymap.set({ 'n', 'x' }, '<space>a', vim.lsp.buf.code_action, fzf.lsp_definitions({ jump_to_single_result = true })
vim.tbl_extend('error', options, { desc = 'Code action' })) end, vim.tbl_extend('error', options, { desc = 'Definition' }))
vim.keymap.set('n', '<space>d', function() fzf.lsp_definitions({ jump_to_single_result = true }) end, vim.keymap.set('n', '<space>e', vim.lsp.buf.declaration, vim.tbl_extend('error', options, { desc = 'Declaration' }))
vim.tbl_extend('error', options, { desc = 'Definition' })) vim.keymap.set('n', '<space>h', function()
vim.keymap.set('n', '<space>e', require('pretty_hover').hover()
vim.lsp.buf.declaration, vim.tbl_extend('error', options, { desc = 'Declaration' })) end, vim.tbl_extend('error', options, { desc = 'Hover' }))
vim.keymap.set('n', '<space>h', function() require('pretty_hover').hover() end, vim.keymap.set('n', '<space>c', vim.lsp.buf.outgoing_calls, vim.tbl_extend('error', options, { desc = 'Outgoing calls' }))
vim.tbl_extend('error', options, { desc = 'Hover' })) vim.keymap.set('n', '<space>C', vim.lsp.buf.incoming_calls, vim.tbl_extend('error', options, { desc = 'Incoming calls' }))
vim.keymap.set('n', '<space>c', vim.lsp.buf.outgoing_calls, vim.keymap.set('n', '<space>m', vim.lsp.buf.rename, vim.tbl_extend('error', options, { desc = 'Rename' }))
vim.tbl_extend('error', options, { desc = 'Outgoing calls' })) vim.keymap.set('n', '<C-t>', fzf.lsp_live_workspace_symbols, vim.tbl_extend('error', options, { desc = 'Workspace symbols' }))
vim.keymap.set('n', '<space>C', vim.lsp.buf.incoming_calls, vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, vim.tbl_extend('error', options, { desc = 'Type definition' }))
vim.tbl_extend('error', options, { desc = 'Incoming calls' })) 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>m', vim.lsp.buf.rename, vim.keymap.set('n', '<space>r', fzf.lsp_references, vim.tbl_extend('error', options, { desc = 'References' }))
vim.tbl_extend('error', options, { desc = 'Rename' })) vim.keymap.set('n', '<A-m>', fzf.lsp_document_symbols, vim.tbl_extend('error', options, { desc = 'Document symbols' }))
vim.keymap.set('n', '<C-t>', fzf.lsp_live_workspace_symbols, vim.keymap.set('n', '<space>s', fzf.lsp_live_workspace_symbols, vim.tbl_extend('error', options, { desc = '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>D', vim.lsp.buf.type_definition, vim.keymap.set('n', '<space>V', fzf.diagnostics_document, vim.tbl_extend('error', options, { desc = 'Diagnostics' }))
vim.tbl_extend('error', options, { desc = 'Type definition' })) vim.keymap.set('n', '<A-o>', '<cmd>ClangdSwitchSourceHeader<CR>', vim.tbl_extend('error', options, { desc = 'Switch Source/Header' }))
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 -- Set some keybinds conditional on server capabilities
if client.server_capabilities.documentFormattingProvider then if client.server_capabilities.documentFormattingProvider then
vim.keymap.set('n', '<space>f', function() vim.keymap.set('n', '<space>f', function()
vim.lsp.buf.format({ timeout_ms = 10000 }) vim.lsp.buf.format({ timeout_ms = 10000 })
end, end, { noremap = true, silent = false, desc = 'Format file', buffer = bufnr })
{ noremap = true, silent = false, desc = 'Format file', buffer = bufnr })
end end
if client.server_capabilities.documentRangeFormattingProvider then if client.server_capabilities.documentRangeFormattingProvider then
vim.keymap.set('x', '<space>f', function() vim.keymap.set('x', '<space>f', function()
vim.lsp.buf.format({ timeout_ms = 10000 }) vim.lsp.buf.format({ timeout_ms = 10000 })
end, end, { noremap = true, silent = false, desc = 'Format visual', buffer = bufnr })
{ noremap = true, silent = false, desc = 'Format visual', buffer = bufnr })
end end
if client.supports_method('inlayHintProvider') then if client.supports_method('inlayHintProvider') then
vim.keymap.set('n', '<space>i', function() vim.keymap.set('n', '<space>i', function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = bufnr }), { bufnr = bufnr }) vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = bufnr }), { bufnr = bufnr })
end, end, {
{ noremap = true,
noremap = true, silent = false,
silent = false, desc = 'Toggle inlay hints',
desc = 'Toggle inlay hints', buffer = bufnr,
buffer = bufnr })
})
end end
end end
@@ -88,10 +71,10 @@ local document_highlight = function(bufnr)
buffer = bufnr, buffer = bufnr,
callback = function() callback = function()
vim.lsp.buf.clear_references() vim.lsp.buf.clear_references()
vim.api.nvim_clear_autocmds { vim.api.nvim_clear_autocmds({
group = group, group = group,
buffer = bufnr buffer = bufnr,
} })
end, end,
}) })
end end
@@ -127,8 +110,8 @@ return {
config = function() config = function()
require('mason').setup({ require('mason').setup({
ui = { ui = {
border = 'rounded' border = 'rounded',
} },
}) })
require('mason-lspconfig').setup({ require('mason-lspconfig').setup({
automatic_installation = false, automatic_installation = false,
@@ -141,7 +124,7 @@ return {
'lua_ls', 'lua_ls',
'jsonls', 'jsonls',
-- 'groovyls', -- Doesn't work in WSL -- 'groovyls', -- Doesn't work in WSL
} },
}) })
local lspconfig = require('lspconfig') local lspconfig = require('lspconfig')
@@ -161,9 +144,9 @@ return {
} }
local signs = { local signs = {
{ name = 'DiagnosticSignError', text = diagnostics.Error }, { name = 'DiagnosticSignError', text = diagnostics.Error },
{ name = 'DiagnosticSignWarn', text = diagnostics.Warning }, { name = 'DiagnosticSignWarn', text = diagnostics.Warning },
{ name = 'DiagnosticSignHint', text = diagnostics.Hint }, { name = 'DiagnosticSignHint', text = diagnostics.Hint },
{ name = 'DiagnosticSignInfo', text = diagnostics.Information }, { name = 'DiagnosticSignInfo', text = diagnostics.Information },
} }
for _, sign in ipairs(signs) do for _, sign in ipairs(signs) do
@@ -179,13 +162,12 @@ return {
vim.diagnostic.open_float({ focusable = false, width = 80 }) vim.diagnostic.open_float({ focusable = false, width = 80 })
end end
-- lspconfig['pyright'].setup { -- lspconfig['pyright'].setup {
-- capabilities = capabilities, -- capabilities = capabilities,
-- on_attach = on_attach, -- on_attach = on_attach,
-- } -- }
lspconfig['basedpyright'].setup { lspconfig['basedpyright'].setup({
capabilities = capabilities, capabilities = capabilities,
on_attach = on_attach, on_attach = on_attach,
settings = { settings = {
@@ -193,12 +175,12 @@ return {
typeCheckingMode = 'standard', typeCheckingMode = 'standard',
}, },
}, },
} })
lspconfig['groovyls'].setup { lspconfig['groovyls'].setup({
capabilities = capabilities, capabilities = capabilities,
on_attach = on_attach, on_attach = on_attach,
} })
-- lspconfig['cmake'].setup { -- lspconfig['cmake'].setup {
-- capabilities = capabilities, -- capabilities = capabilities,
@@ -215,8 +197,8 @@ return {
return lspconfig.util.find_git_ancestor(fname) return lspconfig.util.find_git_ancestor(fname)
end, end,
single_file_support = true, -- suggested 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({}) lspconfig.neocmake.setup({})
end end
@@ -224,48 +206,42 @@ return {
local clangd_capabilities = capabilities local clangd_capabilities = capabilities
clangd_capabilities.textDocument.semanticHighlighting = true clangd_capabilities.textDocument.semanticHighlighting = true
clangd_capabilities.offsetEncoding = { 'utf-16' } clangd_capabilities.offsetEncoding = { 'utf-16' }
lspconfig['clangd'].setup { lspconfig['clangd'].setup({
capabilities = clangd_capabilities, capabilities = clangd_capabilities,
on_attach = on_attach, on_attach = on_attach,
cmd = { 'clangd', cmd = {
'clangd',
'--compile-commands-dir=build_nvim', '--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', '--clang-tidy',
'--background-index', '--background-index',
'--use-dirty-headers', '--use-dirty-headers',
'--completion-style=detailed' }, '--completion-style=detailed',
root_dir = lspconfig.util.root_pattern( },
'.clangd', root_dir = lspconfig.util.root_pattern('.clangd', '.clang-tidy', '.clang-format', 'compile_flags.txt', 'configure.ac', '.git', 'build_nvim'),
'.clang-tidy', })
'.clang-format',
'compile_flags.txt',
'configure.ac',
'.git',
'build_nvim'
)
}
require('clangd_extensions').setup({ require('clangd_extensions').setup({
extensions = extensions = {
{
inlay_hints = { inlay_hints = {
-- Only show inlay hints for the current line -- Only show inlay hints for the current line
only_current_line = true, only_current_line = true,
} },
} },
}) })
lspconfig['jsonls'].setup { lspconfig['jsonls'].setup({
capabilities = capabilities, capabilities = capabilities,
on_attach = on_attach, on_attach = on_attach,
} })
-- lspconfig['rust_analyzer'].setup { -- lspconfig['rust_analyzer'].setup {
-- capabilities = capabilities, -- capabilities = capabilities,
-- on_attach = on_attach, -- on_attach = on_attach,
-- } -- }
lspconfig['lua_ls'].setup { lspconfig['lua_ls'].setup({
capabilities = capabilities, capabilities = capabilities,
on_attach = on_attach, on_attach = on_attach,
settings = { settings = {
@@ -274,7 +250,7 @@ return {
checkThirdParty = false, checkThirdParty = false,
}, },
completion = { completion = {
callSnippet = 'Replace' callSnippet = 'Replace',
}, },
-- Do not send telemetry data containing a randomized but unique identifier -- Do not send telemetry data containing a randomized but unique identifier
telemetry = { telemetry = {
@@ -286,36 +262,36 @@ return {
indent_style = 'space', indent_style = 'space',
indent_size = '2', indent_size = '2',
quote_style = 'single', quote_style = 'single',
} },
} },
}, },
} },
} })
lspconfig['dockerls'].setup { lspconfig['dockerls'].setup({
capabilities = capabilities, capabilities = capabilities,
on_attach = on_attach, on_attach = on_attach,
} })
lspconfig['markdown_oxide'].setup { lspconfig['markdown_oxide'].setup({
capabilities = capabilities, capabilities = capabilities,
on_attach = on_attach, on_attach = on_attach,
} })
-- lspconfig['marksman'].setup { -- lspconfig['marksman'].setup {
-- capabilities = capabilities, -- capabilities = capabilities,
-- on_attach = on_attach, -- on_attach = on_attach,
-- } -- }
lspconfig['yamlls'].setup { lspconfig['yamlls'].setup({
capabilities = capabilities, capabilities = capabilities,
on_attach = on_attach, on_attach = on_attach,
settings = { settings = {
yaml = { yaml = {
validate = true validate = true,
} },
} },
} })
local prettier = require('efmls-configs.formatters.prettier') local prettier = require('efmls-configs.formatters.prettier')
local stylua = require('efmls-configs.formatters.stylua') local stylua = require('efmls-configs.formatters.stylua')
@@ -352,15 +328,10 @@ return {
float = { float = {
border = 'single', border = 'single',
format = function(diagnostic) format = function(diagnostic)
return string.format( return string.format('%s (%s) [%s]', diagnostic.message, diagnostic.source, diagnostic.code or diagnostic.user_data.lsp.code)
'%s (%s) [%s]',
diagnostic.message,
diagnostic.source,
diagnostic.code or diagnostic.user_data.lsp.code
)
end, end,
}, },
}) })
end, end,
event = 'VeryLazy' event = 'VeryLazy',
} }

View File

@@ -2,10 +2,10 @@ return {
'nvim-lualine/lualine.nvim', 'nvim-lualine/lualine.nvim',
dependencies = { dependencies = {
'nvim-tree/nvim-web-devicons', 'nvim-tree/nvim-web-devicons',
'Isrothy/lualine-diagnostic-message' 'Isrothy/lualine-diagnostic-message',
}, },
config = function() config = function()
require('lualine').setup { require('lualine').setup({
options = { options = {
theme = 'bamboo', theme = 'bamboo',
disabled_filetypes = { disabled_filetypes = {
@@ -22,17 +22,17 @@ return {
'diff', 'diff',
{ {
'diagnostics', 'diagnostics',
sources = { 'nvim_diagnostic' } sources = { 'nvim_diagnostic' },
} },
}, },
lualine_c = { lualine_c = {
'hostname', 'hostname',
'getcwd', 'getcwd',
{ 'filename', path = 1, file_status = true } { 'filename', path = 1, file_status = true },
}, },
lualine_y = { lualine_y = {
'searchcount', 'searchcount',
'progress' 'progress',
}, },
}, },
inactive_sections = { inactive_sections = {
@@ -41,9 +41,9 @@ return {
{ {
'filename', 'filename',
path = 1, path = 1,
file_status = true file_status = true,
} },
} },
}, },
winbar = { winbar = {
lualine_a = { lualine_a = {
@@ -65,15 +65,13 @@ return {
warn = '', warn = '',
info = '', info = '',
hint = '', hint = '',
} },
} },
},
lualine_c = {
}, },
lualine_c = {},
lualine_x = {}, lualine_x = {},
lualine_y = {}, lualine_y = {},
lualine_z = { lualine_z = {},
}
}, },
inactive_winbar = { inactive_winbar = {
lualine_a = { lualine_a = {
@@ -82,7 +80,7 @@ return {
path = 0, path = 0,
file_status = true, file_status = true,
separator = { left = '', right = '' }, separator = { left = '', right = '' },
} },
}, },
lualine_b = { lualine_b = {
{ {
@@ -92,7 +90,7 @@ return {
lualine_c = {}, lualine_c = {},
lualine_x = {}, lualine_x = {},
lualine_y = {}, lualine_y = {},
lualine_z = {} lualine_z = {},
}, },
tabline = { tabline = {
lualine_a = {}, lualine_a = {},
@@ -101,12 +99,12 @@ return {
{ {
'tabs', 'tabs',
mode = 2, mode = 2,
} },
}, },
lualine_x = {}, lualine_x = {},
lualine_y = {}, lualine_y = {},
lualine_z = {} lualine_z = {},
}, },
} })
end, end,
} }

View File

@@ -5,5 +5,5 @@ return {
-- Mandatory setup function -- Mandatory setup function
require('luasnip_snippets.common.snip_utils').setup() require('luasnip_snippets.common.snip_utils').setup()
end, end,
enabled = false enabled = false,
} }

View File

@@ -44,29 +44,68 @@ return {
ls.snippets = { ls.snippets = {
cpp = { cpp = {
s('TEST_F_getset', s('TEST_F_getset', {
{ t('TEST_F('),
t('TEST_F('), i(1, 'TestClass'), t(' ,test_'), p(getRegA, false), t({ '_set_get)', '{', ' ' }), i(1, 'TestClass'),
i(2, 'm_object'), t('.set'), p(getRegA, true), t('('), i(3, '32.F'), t({ ');', ' ' }), t(' ,test_'),
i(4, 'EXPECT_EQ('), rep(3), t(', '), rep(2), t('.get'), p(getRegA, true), t({ '());', '' }), p(getRegA, false),
t({ '', '}', '' }) t({ '_set_get)', '{', ' ' }),
}), i(2, 'm_object'),
s('TEST_fn_getset', t('.set'),
{ p(getRegA, true),
t('void '), p(getRegA, false), t('_'), i(1, 'get'), t('_'), i(2, 'set'), t({ '()', '{', ' ' }), t('('),
i(3, 'm_object'), t('.set'), p(getRegA, true), t('('), i(4, '32.F'), t({ ');', ' ' }), i(3, '32.F'),
i(5, 'EXPECT_EQ('), rep(4), t(', '), rep(3), t('.get'), p(getRegA, true), t({ '());', '' }), t({ ');', ' ' }),
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)', '{', ' ' }), t('TEST_F('),
p(getRegA, false), t('_'), rep(1), t('_'), rep(2), t({ '();' }), i(5),
t({ '', '}' }), 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()
require('luasnip.loaders.from_vscode').lazy_load({ paths = { './my-snippets' } }) require('luasnip.loaders.from_vscode').lazy_load({ paths = { './my-snippets' } })
end, end,
cmd = 'LuaSnipListAvailable' cmd = 'LuaSnipListAvailable',
} }

View File

@@ -3,17 +3,17 @@ return {
cmd = { cmd = {
'MarkdownPreviewToggle', 'MarkdownPreviewToggle',
'MarkdownPreview', 'MarkdownPreview',
'MarkdownPreviewStop' 'MarkdownPreviewStop',
}, },
branch = 'master', branch = 'master',
ft = { 'markdown' }, ft = { 'markdown' },
build = function() build = function()
vim.fn['mkdp#util#install']() vim.fn['mkdp#util#install']()
end, end,
init = function () init = function()
vim.g.mkdp_auto_close = 0 vim.g.mkdp_auto_close = 0
vim.g.mkdp_auto_start = 1 vim.g.mkdp_auto_start = 1
vim.g.mkdp_combine_preview = 1 vim.g.mkdp_combine_preview = 1
vim.g.mkdp_combine_preview_auto_refresh = 1 vim.g.mkdp_combine_preview_auto_refresh = 1
end end,
} }

View File

@@ -1,34 +1,34 @@
return { return {
'danymat/neogen', 'danymat/neogen',
dependencies = 'nvim-treesitter/nvim-treesitter', dependencies = 'nvim-treesitter/nvim-treesitter',
opts = { opts = {
enabled = true, enabled = true,
languages = { languages = {
cpp = { cpp = {
template = { template = {
annotation_convention = 'custom', annotation_convention = 'custom',
custom = { custom = {
{ nil, '/// file', { no_results = true, type = { 'file' } } }, { nil, '/// file', { no_results = true, type = { 'file' } } },
{ nil, '/// $1', { no_results = true, type = { 'func', 'file' } } }, { nil, '/// $1', { no_results = true, type = { 'func', 'file' } } },
{ nil, '', { no_results = true, type = { 'file' } } }, { nil, '', { no_results = true, type = { 'file' } } },
{ nil, '/// $1', { type = { 'func' } } }, { nil, '/// $1', { type = { 'func' } } },
{ 'tparam', '/// \\tparam %s $1' }, { 'tparam', '/// \\tparam %s $1' },
{ 'parameters', '/// \\param %s $1' }, { 'parameters', '/// \\param %s $1' },
{ 'return_statement', '/// \\return $1' }, { 'return_statement', '/// \\return $1' },
}, },
}, },
}, },
}, },
}, },
keys = { keys = {
{ {
'<leader>n', '<leader>n',
function() function()
require('neogen').generate({}) require('neogen').generate({})
end, end,
desc = 'Add comment', desc = 'Add comment',
} },
}, },
cmd = 'Neogen' cmd = 'Neogen',
} }

View File

@@ -1,27 +1,27 @@
return { return {
'TimUntersberger/neogit', 'TimUntersberger/neogit',
dependencies = { dependencies = {
'nvim-lua/plenary.nvim', 'nvim-lua/plenary.nvim',
'sindrets/diffview.nvim' 'sindrets/diffview.nvim',
}, },
config = function() config = function()
local neogit = require('neogit') local neogit = require('neogit')
neogit.setup { neogit.setup({
integrations = { integrations = {
diffview = true, diffview = true,
telescope = false, telescope = false,
fzf_lua = true fzf_lua = true,
}, },
graph_style = "unicode", graph_style = 'unicode',
} })
end, end,
keys = { keys = {
{ {
'<space>t', '<space>t',
function() function()
require('neogit').open() require('neogit').open()
end end,
} },
}, },
cmd = { 'Neogit ' } cmd = { 'Neogit ' },
} }

View File

@@ -1,39 +1,39 @@
return { return {
'nvim-neotest/neotest', 'nvim-neotest/neotest',
dependencies = { dependencies = {
'nvim-lua/plenary.nvim', 'nvim-lua/plenary.nvim',
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
'antoinemadec/FixCursorHold.nvim', 'antoinemadec/FixCursorHold.nvim',
'nvim-neotest/neotest-python' 'nvim-neotest/neotest-python',
}, },
config = function() config = function()
local pythonVenv = require('utils.python_venv') local pythonVenv = require('utils.python_venv')
require('neotest').setup({ require('neotest').setup({
adapters = { adapters = {
require('neotest-python')({ require('neotest-python')({
dap = { dap = {
justMyCode = false justMyCode = false,
}, },
runner = 'pytest', runner = 'pytest',
python = pythonVenv.getPythonEnv python = pythonVenv.getPythonEnv,
}) }),
} },
}) })
end, end,
keys = { keys = {
{ {
'<F3>', '<F3>',
function() function()
require('neotest').run.run() require('neotest').run.run()
end, end,
desc = 'Run nearest test' desc = 'Run nearest test',
}, },
{ {
'<S-F3>', '<S-F3>',
function() function()
require('neotest').run.run({ strategy = 'dap' }) require('neotest').run.run({ strategy = 'dap' })
end, end,
desc = 'Run nearest test' desc = 'Run nearest test',
} },
} },
} }

View File

@@ -5,5 +5,5 @@ return {
render = 'background', -- or 'foreground' or 'virtual', render = 'background', -- or 'foreground' or 'virtual',
enable_named_colors = true, enable_named_colors = true,
}, },
cmd = { 'HighlightColors' } cmd = { 'HighlightColors' },
} }

View File

@@ -2,7 +2,7 @@ return {
'mfussenegger/nvim-lint', 'mfussenegger/nvim-lint',
config = function() config = function()
require('lint').linters_by_ft = { require('lint').linters_by_ft = {
cpp = { 'clangtidy', } cpp = { 'clangtidy' },
} }
vim.api.nvim_create_autocmd({ 'BufWritePost' }, { vim.api.nvim_create_autocmd({ 'BufWritePost' }, {
callback = function() callback = function()
@@ -15,5 +15,5 @@ return {
-- require('lint').try_lint('cspell') -- require('lint').try_lint('cspell')
end, end,
}) })
end end,
} }

View File

@@ -1,7 +1,8 @@
return { return {
'notjedi/nvim-rooter.lua', 'notjedi/nvim-rooter.lua',
opts = { opts = {
rooter_patterns = { '.git', rooter_patterns = {
'.git',
'_darcs', '_darcs',
'.hg', '.hg',
'.bzr', '.bzr',
@@ -10,6 +11,7 @@ return {
'package.json', 'package.json',
'build_nvim', 'build_nvim',
'real_path.txt', 'real_path.txt',
'conaninfo.txt' }, 'conaninfo.txt',
} },
},
} }

View File

@@ -1,10 +1,10 @@
return { return {
'kylechui/nvim-surround', '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', event = 'VeryLazy',
config = function() config = function()
require('nvim-surround').setup({ require('nvim-surround').setup({
-- Configuration here, or leave empty to use defaults -- Configuration here, or leave empty to use defaults
}) })
end end,
} }

View File

@@ -26,6 +26,6 @@ return {
require('oil').open() require('oil').open()
end, end,
desc = 'Open oil', desc = 'Open oil',
} },
} },
} }

View File

@@ -28,6 +28,6 @@ return {
'OverseerBuild', 'OverseerBuild',
'OverseerQuickAction', 'OverseerQuickAction',
'OverseerTaskAction', 'OverseerTaskAction',
'OverseerClearCache' 'OverseerClearCache',
} },
} }

View File

@@ -1,5 +1,5 @@
return { return {
'Fildo7525/pretty_hover', 'Fildo7525/pretty_hover',
event = 'LspAttach', event = 'LspAttach',
opts = {}, opts = {},
} }

View File

@@ -1,5 +1,5 @@
return { return {
'HiPhish/rainbow-delimiters.nvim', 'HiPhish/rainbow-delimiters.nvim',
dependencies = 'nvim-treesitter/nvim-treesitter', dependencies = 'nvim-treesitter/nvim-treesitter',
event = 'VeryLazy' event = 'VeryLazy',
} }

View File

@@ -6,8 +6,9 @@ return {
server = { server = {
on_attach = function(client, bufnr) on_attach = function(client, bufnr)
local options = { noremap = true, silent = false, buffer = bufnr } local options = { noremap = true, silent = false, buffer = bufnr }
vim.keymap.set('n', '<space>y', function() vim.cmd.RustLsp { 'hover', 'actions' } end, vim.keymap.set('n', '<space>y', function()
vim.tbl_extend('error', options, { desc = 'Hover' })) 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 }) local group = vim.api.nvim_create_augroup('lsp_document_highlight', { clear = false })
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
@@ -31,14 +32,14 @@ return {
buffer = bufnr, buffer = bufnr,
callback = function() callback = function()
vim.lsp.buf.clear_references() vim.lsp.buf.clear_references()
vim.api.nvim_clear_autocmds { vim.api.nvim_clear_autocmds({
group = group, group = group,
buffer = bufnr buffer = bufnr,
} })
end, end,
}) })
end end,
} },
} }
end end,
} }

View File

@@ -3,7 +3,7 @@ return {
config = function() config = function()
function _G.set_terminal_keymaps(term) function _G.set_terminal_keymaps(term)
local opts = { noremap = true } 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) vim.api.nvim_buf_set_keymap(term.bufnr, 't', '<esc>', [[<C-\><C-n>]], opts)
end end
vim.api.nvim_buf_set_keymap(term.bufnr, 't', 'jk', [[<C-\><C-n>]], opts) vim.api.nvim_buf_set_keymap(term.bufnr, 't', 'jk', [[<C-\><C-n>]], opts)
@@ -14,7 +14,7 @@ return {
end end
require('toggleterm').setup({ require('toggleterm').setup({
on_open = set_terminal_keymaps on_open = set_terminal_keymaps,
}) })
local Terminal = require('toggleterm.terminal').Terminal local Terminal = require('toggleterm.terminal').Terminal
@@ -46,8 +46,8 @@ return {
function() function()
_lazygit_toggle() _lazygit_toggle()
end, end,
desc = 'LazyGit' desc = 'LazyGit',
} },
}, },
cmd = 'ToggleTerm', cmd = 'ToggleTerm',
} }

View File

@@ -1,55 +1,55 @@
return { return {
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
version = '*', version = '*',
build = ':TSUpdate', build = ':TSUpdate',
config = function() config = function()
require('nvim-treesitter.install').compilers = { 'clang' } require('nvim-treesitter.install').compilers = { 'clang' }
require('nvim-treesitter.configs').setup({ require('nvim-treesitter.configs').setup({
ensure_installed = '', ensure_installed = '',
modules = {}, modules = {},
sync_install = true, sync_install = true,
auto_install = true, auto_install = true,
ignore_install = {}, ignore_install = {},
highlight = { highlight = {
enable = true, enable = true,
additional_vim_regex_highlighting = { 'markdown' } additional_vim_regex_highlighting = { 'markdown' },
}, },
rainbow = { rainbow = {
enable = true, enable = true,
extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean 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 max_file_lines = nil, -- Do not enable for files with more than n lines, int
-- colors = {}, -- table of hex strings -- colors = {}, -- table of hex strings
-- termcolors = {} -- table of colour name strings -- termcolors = {} -- table of colour name strings
}, },
indent = { indent = {
enable = false -- maybe buggy enable = false, -- maybe buggy
}, },
textobjects = { textobjects = {
select = { select = {
enable = true, enable = true,
-- Automatically jump forward to textobj, similar to targets.vim -- Automatically jump forward to textobj, similar to targets.vim
lookahead = true, lookahead = true,
keymaps = { keymaps = {
-- You can use the capture groups defined in textobjects.scm -- You can use the capture groups defined in textobjects.scm
['af'] = '@function.outer', ['af'] = '@function.outer',
['if'] = '@function.inner', ['if'] = '@function.inner',
['ac'] = '@class.outer', ['ac'] = '@class.outer',
['ic'] = '@class.inner', ['ic'] = '@class.inner',
}, },
}, },
lsp_interop = { lsp_interop = {
enable = true, enable = true,
border = 'none', border = 'none',
peek_definition_code = { peek_definition_code = {
['<leader>df'] = '@function.outer', ['<leader>df'] = '@function.outer',
['<leader>dF'] = '@class.outer', ['<leader>dF'] = '@class.outer',
}, },
}, },
}, },
}) })
vim.treesitter.language.register('groovy', 'java') vim.treesitter.language.register('groovy', 'java')
require('nvim-treesitter.install').prefer_git = false require('nvim-treesitter.install').prefer_git = false
end end,
} }

View File

@@ -1,13 +1,13 @@
return { return {
'folke/which-key.nvim', 'folke/which-key.nvim',
version = '*', version = '*',
opts = { opts = {
plugins = { plugins = {
marks = false, marks = false,
registers = false, registers = false,
presets = { presets = {
operators = false operators = false,
} },
} },
} },
} }

View File

@@ -1,45 +1,44 @@
return { return {
'natecraddock/workspaces.nvim', 'natecraddock/workspaces.nvim',
config = function() config = function()
require('workspaces').setup() require('workspaces').setup()
end, end,
branch = 'master', branch = 'master',
keys = { keys = {
{ {
'<space>p', '<space>p',
function() function()
local workspaces = require('workspaces') local workspaces = require('workspaces')
local fzf_lua = require('fzf-lua') local fzf_lua = require('fzf-lua')
fzf_lua.fzf_exec(function(cb) fzf_lua.fzf_exec(function(cb)
local results = workspaces.get() local results = workspaces.get()
for _, e in ipairs(results) do for _, e in ipairs(results) do
cb(e['name']) cb(e['name'])
end end
cb() cb()
end, end, {
{ actions = {
actions = { ['default'] = {
['default'] = { function(selected)
function(selected) workspaces.open(selected[1])
workspaces.open(selected[1]) fzf_lua.git_files()
fzf_lua.git_files() end,
end, },
}, ['ctrl-d'] = {
['ctrl-d'] = { function(selected)
function(selected) workspaces.remove(selected[1])
workspaces.remove(selected[1]) end,
end, fzf_lua.actions.resume,
fzf_lua.actions.resume },
}, ['ctrl-a'] = {
['ctrl-a'] = { function()
function() workspaces.add()
workspaces.add() end,
end, fzf_lua.actions.resume,
fzf_lua.actions.resume },
} },
} })
}) end,
end },
} },
} }
}

View File

@@ -5,11 +5,11 @@ return {
config = function() config = function()
local C = require('astrotheme.palettes.astrodark') local C = require('astrotheme.palettes.astrodark')
require('astrotheme').setup({ require('astrotheme').setup({
palette = 'astrodark', -- String of the default palette to use when calling `:colorscheme astrotheme` palette = 'astrodark', -- String of the default palette to use when calling `:colorscheme astrotheme`
termguicolors = true, -- Bool value, toggles if termguicolors are set by AstroTheme. termguicolors = true, -- Bool value, toggles if termguicolors are set by AstroTheme.
terminal_color = true, -- Bool value, toggles if terminal_colors are set by AstroTheme. terminal_color = true, -- Bool value, toggles if terminal_colors are set by AstroTheme.
plugin_default = 'auto', -- Sets how all plugins will be loaded plugin_default = 'auto', -- Sets how all plugins will be loaded
-- "auto": Uses lazy / packer enabled plugins to load highlights. -- "auto": Uses lazy / packer enabled plugins to load highlights.
@@ -21,15 +21,12 @@ return {
}, },
palettes = { palettes = {
global = { global = {},
}, astrodark = {},
astrodark = {
},
}, },
highlights = { highlights = {
global = { global = {
modify_hl_groups = function(hl, c) modify_hl_groups = function(hl, c) end,
end,
}, },
astrodark = { astrodark = {
modify_hl_groups = function(hl, c) -- modify_hl_groups function allows you to modify hl groups, modify_hl_groups = function(hl, c) -- modify_hl_groups function allows you to modify hl groups,
@@ -57,10 +54,10 @@ return {
['TelescopeTitle'] = { bg = C.surface0 }, ['TelescopeTitle'] = { bg = C.surface0 },
['TelescopePromptNormal'] = { bg = C.surface0 }, ['TelescopePromptNormal'] = { bg = C.surface0 },
['TelescopePromptBorder'] = { link = 'TelescopeBorder' }, ['TelescopePromptBorder'] = { link = 'TelescopeBorder' },
} },
} },
}) })
vim.cmd('colorscheme astrodark') vim.cmd('colorscheme astrodark')
end, end,
enabled = true enabled = true,
} }

View File

@@ -4,7 +4,7 @@ return {
priority = 1000, priority = 1000,
config = function() config = function()
local colors = require('bamboo.palette') local colors = require('bamboo.palette')
require('bamboo').setup { require('bamboo').setup({
dim_inactive = true, -- Dim inactive windows/buffers dim_inactive = true, -- Dim inactive windows/buffers
cmp_itemkind_reverse = true, cmp_itemkind_reverse = true,
lualine = { lualine = {
@@ -33,8 +33,8 @@ return {
['LspReferenceText'] = { bg = colors.vulgaris.cyan, fg = colors.vulgaris.bg1, fmt = 'nocombine' }, ['LspReferenceText'] = { bg = colors.vulgaris.cyan, fg = colors.vulgaris.bg1, fmt = 'nocombine' },
['Delimiter'] = { fg = colors.vulgaris.fg }, ['Delimiter'] = { fg = colors.vulgaris.fg },
}, },
} })
require('bamboo').load() require('bamboo').load()
end, end,
enabled = true enabled = true,
} }

View File

@@ -1,5 +1,4 @@
return return {
{
'catppuccin/nvim', 'catppuccin/nvim',
name = 'catppuccin', name = 'catppuccin',
lazy = true, lazy = true,
@@ -63,7 +62,7 @@ return
['@namespace'] = { fg = colors.red }, ['@namespace'] = { fg = colors.red },
['@function.builtin'] = { link = 'Function' }, ['@function.builtin'] = { link = 'Function' },
['@property'] = { fg = colors.pink }, ['@property'] = { fg = colors.pink },
Macro = { fg = colors.rosewater } Macro = { fg = colors.rosewater },
} }
end, end,
}, },
@@ -100,5 +99,5 @@ return
}) })
vim.cmd('colorscheme catppuccin') vim.cmd('colorscheme catppuccin')
end, end,
enabled = true enabled = true,
} }

View File

@@ -11,5 +11,5 @@ return {
}) })
require('everforest').load() require('everforest').load()
end, end,
enabled = true enabled = true,
} }

View File

@@ -1,7 +1,6 @@
return return {
{
'projekt0n/github-nvim-theme', 'projekt0n/github-nvim-theme',
lazy = false, -- make sure we load this during startup if it is your main colorscheme lazy = false, -- make sure we load this during startup if it is your main colorscheme
priority = 1000, -- make sure to load this before all the other start plugins priority = 1000, -- make sure to load this before all the other start plugins
config = function() config = function()
require('github-theme').setup({ require('github-theme').setup({
@@ -32,7 +31,7 @@ return
'treesitter', 'treesitter',
'treesitter_context', 'treesitter_context',
'whichkey', 'whichkey',
} },
}, },
}) })

View File

@@ -5,5 +5,5 @@ return {
config = function() config = function()
vim.cmd('colorscheme gruvbox-baby') vim.cmd('colorscheme gruvbox-baby')
end, end,
enabled = true enabled = true,
} }

View File

@@ -33,5 +33,5 @@ return {
}) })
vim.cmd('colorscheme gruvbox') vim.cmd('colorscheme gruvbox')
end, end,
enabled = true enabled = true,
} }

View File

@@ -1,19 +1,19 @@
return { return {
'eddyekofo94/gruvbox-flat.nvim', 'eddyekofo94/gruvbox-flat.nvim',
priority = 1000, priority = 1000,
config = function() config = function()
local colors = require('gruvbox.colors') local colors = require('gruvbox.colors')
vim.g.gruvbox_flat_style = 'dark' vim.g.gruvbox_flat_style = 'dark'
vim.g.gruvbox_colors = { vim.g.gruvbox_colors = {
bg_search = 'purple', bg_search = 'purple',
fg_search = 'black', fg_search = 'black',
} }
vim.g.gruvbox_theme = { vim.g.gruvbox_theme = {
Pmenu = { bg = 'bg_visual' }, Pmenu = { bg = 'bg_visual' },
NormalFloat = { bg = 'bg_visual' } NormalFloat = { bg = 'bg_visual' },
} }
vim.g.gruvbox_dark_float = false vim.g.gruvbox_dark_float = false
vim.cmd('colorscheme gruvbox-flat') vim.cmd('colorscheme gruvbox-flat')
end, end,
enabled = false enabled = false,
} }

View File

@@ -1,42 +1,42 @@
return { return {
'sainnhe/gruvbox-material', 'sainnhe/gruvbox-material',
priority = 1000, priority = 1000,
config = function() config = function()
-- local colors = require('gruvbox.colors') -- local colors = require('gruvbox.colors')
-- vim.g.gruvbox_flat_style = "dark" -- vim.g.gruvbox_flat_style = "dark"
-- vim.g.gruvbox_colors = { -- vim.g.gruvbox_colors = {
-- bg_search = 'purple', -- bg_search = 'purple',
-- fg_search = 'black', -- fg_search = 'black',
-- } -- }
-- vim.g.gruvbox_theme = { -- vim.g.gruvbox_theme = {
-- Pmenu = { bg = 'bg_visual' }, -- Pmenu = { bg = 'bg_visual' },
-- NormalFloat = { bg = 'bg_visual' } -- NormalFloat = { bg = 'bg_visual' }
-- } -- }
-- vim.g.gruvbox_dark_float = false -- vim.g.gruvbox_dark_float = false
vim.g.gruvbox_material_ui_contrast = 'high' vim.g.gruvbox_material_ui_contrast = 'high'
vim.g.gruvbox_material_dim_inactive_windows = 1 -- Dim inactive windows. Only works in neovim currently. vim.g.gruvbox_material_dim_inactive_windows = 1 -- Dim inactive windows. Only works in neovim currently.
vim.g.gruvbox_material_disable_terminal_colors = 0 vim.g.gruvbox_material_disable_terminal_colors = 0
local links = { local links = {
['@lsp.type.namespace'] = '@namespace', ['@lsp.type.namespace'] = '@namespace',
['@lsp.type.type'] = '@type', ['@lsp.type.type'] = '@type',
['@lsp.type.class'] = '@type', ['@lsp.type.class'] = '@type',
['@lsp.type.enum'] = '@type', ['@lsp.type.enum'] = '@type',
['@lsp.type.interface'] = '@type', ['@lsp.type.interface'] = '@type',
['@lsp.type.struct'] = '@structure', ['@lsp.type.struct'] = '@structure',
['@lsp.type.parameter'] = '@parameter', ['@lsp.type.parameter'] = '@parameter',
['@lsp.type.variable'] = '@variable', ['@lsp.type.variable'] = '@variable',
['@lsp.type.property'] = '@property', ['@lsp.type.property'] = '@property',
['@lsp.type.enumMember'] = '@constant', ['@lsp.type.enumMember'] = '@constant',
['@lsp.type.function'] = '@function', ['@lsp.type.function'] = '@function',
['@lsp.type.method'] = '@method', ['@lsp.type.method'] = '@method',
['@lsp.type.macro'] = '@macro', ['@lsp.type.macro'] = '@macro',
['@lsp.type.decorator'] = '@function', ['@lsp.type.decorator'] = '@function',
} }
-- for newgroup, oldgroup in pairs(links) do -- for newgroup, oldgroup in pairs(links) do
-- vim.api.nvim_set_hl(0, newgroup, { link = oldgroup, default = true }) -- vim.api.nvim_set_hl(0, newgroup, { link = oldgroup, default = true })
-- end -- end
vim.cmd('colorscheme gruvbox-material') vim.cmd('colorscheme gruvbox-material')
vim.api.nvim_set_hl(0, '@lsp.mod.readonly', { italic = true, fg = 'Purple' }) vim.api.nvim_set_hl(0, '@lsp.mod.readonly', { italic = true, fg = 'Purple' })
end, end,
enabled = false enabled = false,
} }

View File

@@ -3,15 +3,15 @@ return {
lazy = true, lazy = true,
config = function() config = function()
require('kanagawa').setup({ require('kanagawa').setup({
compile = false, -- enable compiling the colorscheme compile = false, -- enable compiling the colorscheme
undercurl = true, -- enable undercurls undercurl = true, -- enable undercurls
commentStyle = { italic = true }, commentStyle = { italic = true },
functionStyle = {}, functionStyle = {},
keywordStyle = { italic = true }, keywordStyle = { italic = true },
statementStyle = { bold = true }, statementStyle = { bold = true },
typeStyle = {}, typeStyle = {},
transparent = false, -- do not set background color transparent = false, -- do not set background color
dimInactive = true, -- dim inactive window `:h hl-NormalNC` dimInactive = true, -- dim inactive window `:h hl-NormalNC`
terminalColors = true, -- define vim.g.terminal_color_{0,17} terminalColors = true, -- define vim.g.terminal_color_{0,17}
colors = { colors = {
-- add/modify theme and palette colors -- add/modify theme and palette colors
@@ -28,11 +28,11 @@ return {
background = { background = {
-- map the value of 'background' option to a theme -- map the value of 'background' option to a theme
dark = 'wave', -- try "dragon" ! dark = 'wave', -- try "dragon" !
light = 'lotus' light = 'lotus',
}, },
}) })
vim.cmd('colorscheme kanagawa') vim.cmd('colorscheme kanagawa')
end, end,
enabled = true enabled = true,
} }

View File

@@ -2,7 +2,7 @@ return {
'marko-cerovac/material.nvim', 'marko-cerovac/material.nvim',
priority = 1000, priority = 1000,
config = function() config = function()
local colors = require 'material.colors' local colors = require('material.colors')
require('material').setup({ require('material').setup({
contrast = { contrast = {
@@ -15,10 +15,14 @@ return {
}, },
styles = { -- Give comments style such as bold, italic, underline etc. styles = { -- Give comments style such as bold, italic, underline etc.
comments = { --[[ italic = true ]] }, comments = { --[[ italic = true ]]
strings = { --[[ bold = true ]] }, },
keywords = { --[[ underline = true ]] }, strings = { --[[ bold = true ]]
functions = { --[[ bold = true, undercurl = true ]] }, },
keywords = { --[[ underline = true ]]
},
functions = { --[[ bold = true, undercurl = true ]]
},
variables = {}, variables = {},
operators = {}, operators = {},
types = {}, types = {},
@@ -26,23 +30,23 @@ return {
plugins = { -- Uncomment the plugins that you use to highlight them plugins = { -- Uncomment the plugins that you use to highlight them
-- Available plugins: -- Available plugins:
"dap", 'dap',
-- "dashboard", -- "dashboard",
"gitsigns", 'gitsigns',
-- "hop", -- "hop",
"indent-blankline", 'indent-blankline',
-- "lspsaga", -- "lspsaga",
-- "mini", -- "mini",
-- "neogit", -- "neogit",
-- "neorg", -- "neorg",
"nvim-cmp", 'nvim-cmp',
"nvim-navic", 'nvim-navic',
-- "nvim-tree", -- "nvim-tree",
"nvim-web-devicons", 'nvim-web-devicons',
-- "sneak", -- "sneak",
"telescope", 'telescope',
-- "trouble", -- "trouble",
"which-key", 'which-key',
}, },
disable = { disable = {
@@ -50,12 +54,12 @@ return {
borders = false, -- Disable borders between verticaly split windows borders = false, -- Disable borders between verticaly split windows
background = false, -- Prevent the theme from setting the background (NeoVim then uses your terminal background) background = false, -- Prevent the theme from setting the background (NeoVim then uses your terminal background)
term_colors = false, -- Prevent the theme from setting terminal colors term_colors = false, -- Prevent the theme from setting terminal colors
eob_lines = false -- Hide the end-of-buffer lines eob_lines = false, -- Hide the end-of-buffer lines
}, },
high_visibility = { high_visibility = {
lighter = false, -- Enable higher contrast text for lighter style lighter = false, -- Enable higher contrast text for lighter style
darker = true-- Enable higher contrast text for darker style darker = true, -- Enable higher contrast text for darker style
}, },
lualine_style = 'default', -- Lualine style ( can be 'stealth' or 'default' ) lualine_style = 'default', -- Lualine style ( can be 'stealth' or 'default' )
@@ -66,8 +70,8 @@ return {
custom_highlights = {}, -- Overwrite highlights with your own custom_highlights = {}, -- Overwrite highlights with your own
}) })
vim.g.material_style = "darker" vim.g.material_style = 'darker'
vim.cmd('colorscheme material') vim.cmd('colorscheme material')
end, end,
enabled = false enabled = false,
} }

View File

@@ -43,9 +43,9 @@ return {
-- ["@lsp.typemod.interface"] = {}, -- ["@lsp.typemod.interface"] = {},
-- ["@lsp.typemod.macro"] = {}, -- ["@lsp.typemod.macro"] = {},
-- ["@lsp.typemod.method"] = {}, -- ["@lsp.typemod.method"] = {},
["@lsp.typemod.namespace"] = { fg = c.base.red }, ['@lsp.typemod.namespace'] = { fg = c.base.red },
-- ['@lsp.typemod.parameter.declaration'] = { fg = c.base.blue, italic = styles.parameter.italic }, -- ['@lsp.typemod.parameter.declaration'] = { fg = c.base.blue, italic = styles.parameter.italic },
["@lsp.typemod.property"] = { fg = '#9699f2' }, ['@lsp.typemod.property'] = { fg = '#9699f2' },
-- ["@lsp.typemod.struct"] = {}, -- ["@lsp.typemod.struct"] = {},
-- ["@lsp.typemod.type"] = {}, -- ["@lsp.typemod.type"] = {},
-- ["@lsp.typemod.typeParameter"] = {}, -- ["@lsp.typemod.typeParameter"] = {},
@@ -60,5 +60,5 @@ return {
}) })
vim.cmd('colorscheme monokai-pro') vim.cmd('colorscheme monokai-pro')
end, end,
enabled = true enabled = true,
} }

View File

@@ -62,14 +62,14 @@ function M.getPythonEnvs()
if venv ~= nil then if venv ~= nil then
table.insert(venvs, { table.insert(venvs, {
name = 'VIRTUAL_ENV', name = 'VIRTUAL_ENV',
path = string.format('%s/%s', venv, M.getVenvSuffix()) path = string.format('%s/%s', venv, M.getVenvSuffix()),
}) })
end end
local conda = os.getenv('CONDA_PREFIX') local conda = os.getenv('CONDA_PREFIX')
if conda ~= nil then if conda ~= nil then
table.insert(venvs, { table.insert(venvs, {
name = 'CONDA_PREFIX', name = 'CONDA_PREFIX',
path = string.format('%s/%s', conda, 'python.exe') path = string.format('%s/%s', conda, 'python.exe'),
}) })
end end
@@ -79,7 +79,7 @@ function M.getPythonEnvs()
if jsonVenv ~= nil then if jsonVenv ~= nil then
table.insert(venvs, { table.insert(venvs, {
name = 'pyrightconfig.json', name = 'pyrightconfig.json',
path = jsonVenv .. '/' .. M.getVenvSuffix() path = jsonVenv .. '/' .. M.getVenvSuffix(),
}) })
end end
@@ -88,20 +88,20 @@ function M.getPythonEnvs()
if vim.fn.executable(cwd .. '/' .. envDir .. '/' .. M.getVenvSuffix()) == 1 then if vim.fn.executable(cwd .. '/' .. envDir .. '/' .. M.getVenvSuffix()) == 1 then
table.insert(venvs, { table.insert(venvs, {
name = envDir, name = envDir,
path = cwd .. '/' .. envDir .. '/' .. M.getVenvSuffix() path = cwd .. '/' .. envDir .. '/' .. M.getVenvSuffix(),
}) })
end end
end end
if vim.loop.os_uname().sysname == 'Linux' then if vim.loop.os_uname().sysname == 'Linux' then
table.insert(venvs, { table.insert(venvs, {
name = 'system', name = 'system',
path = '/usr/bin/python' path = '/usr/bin/python',
}) })
end end
if vim.loop.os_uname().sysname == 'Windows_NT' then if vim.loop.os_uname().sysname == 'Windows_NT' then
table.insert(venvs, { table.insert(venvs, {
name = 'system', name = 'system',
path = os.getenv('SCOOP') .. '/apps/python/current/python.exe' path = os.getenv('SCOOP') .. '/apps/python/current/python.exe',
}) })
end end
return venvs return venvs
@@ -110,7 +110,9 @@ end
M.pick_venv = function() M.pick_venv = function()
vim.ui.select(M.getPythonEnvs(), { vim.ui.select(M.getPythonEnvs(), {
prompt = 'Select python venv', prompt = 'Select python venv',
format_item = function(item) return string.format('%s (%s)', item.name, item.path) end, format_item = function(item)
return string.format('%s (%s)', item.name, item.path)
end,
}, function(choice) }, function(choice)
if not choice then if not choice then
return return

View File

@@ -1,4 +1,4 @@
column_width = 120 column_width = 160
line_endings = "Unix" line_endings = "Unix"
indent_type = "Spaces" indent_type = "Spaces"
indent_width = 2 indent_width = 2