2024-01-23 22:23:58 +01:00
|
|
|
local is, when = require 'config.compose' ()
|
2024-01-25 22:09:30 +01:00
|
|
|
local map = require 'config.helpers.keymap'
|
|
|
|
local n = map 'n'
|
2024-01-28 01:46:41 +01:00
|
|
|
local nv = map { 'n', 'v' }
|
2023-08-20 14:27:47 +02:00
|
|
|
|
2023-10-29 09:47:39 +01:00
|
|
|
|
2023-11-15 21:39:37 +01:00
|
|
|
---@type LazySpec
|
2023-08-20 14:27:47 +02:00
|
|
|
return {
|
2023-08-19 21:48:52 +02:00
|
|
|
|
2023-12-24 22:54:03 +01:00
|
|
|
-- Theme
|
2023-08-20 14:27:47 +02:00
|
|
|
{
|
2024-01-21 23:32:15 +01:00
|
|
|
'rebelot/kanagawa.nvim',
|
2024-01-22 23:14:16 +01:00
|
|
|
enabled = is 'standalone',
|
2023-08-20 14:27:47 +02:00
|
|
|
lazy = false,
|
2023-12-24 22:54:03 +01:00
|
|
|
priority = math.huge,
|
2023-11-07 23:21:58 +01:00
|
|
|
config = function()
|
2024-01-21 23:32:15 +01:00
|
|
|
vim.cmd 'colorscheme kanagawa'
|
2023-08-20 14:27:47 +02:00
|
|
|
end,
|
|
|
|
},
|
2023-07-22 13:52:10 +02:00
|
|
|
|
|
|
|
-- Status line
|
2023-08-20 14:27:47 +02:00
|
|
|
{
|
2024-01-21 23:32:15 +01:00
|
|
|
'nvim-lualine/lualine.nvim',
|
2024-01-22 23:14:16 +01:00
|
|
|
enabled = is 'standalone',
|
2023-08-20 14:27:47 +02:00
|
|
|
dependencies = {
|
2024-01-21 23:32:15 +01:00
|
|
|
'nvim-tree/nvim-web-devicons',
|
2023-08-20 14:27:47 +02:00
|
|
|
},
|
|
|
|
config = function()
|
2024-01-21 23:32:15 +01:00
|
|
|
local lualine = require 'lualine'
|
2024-01-22 23:14:16 +01:00
|
|
|
|
|
|
|
lualine.setup {
|
|
|
|
tabline = {
|
|
|
|
lualine_a = { 'buffers' },
|
|
|
|
}
|
|
|
|
}
|
2023-08-20 14:27:47 +02:00
|
|
|
end
|
|
|
|
},
|
2023-07-22 13:52:10 +02:00
|
|
|
|
2023-09-02 22:09:00 +02:00
|
|
|
-- Telescope
|
2023-07-22 15:40:45 +02:00
|
|
|
{
|
2024-01-21 23:32:15 +01:00
|
|
|
'nvim-telescope/telescope.nvim',
|
2024-01-22 23:14:16 +01:00
|
|
|
enabled = is 'standalone',
|
2024-01-21 23:32:15 +01:00
|
|
|
branch = '0.1.x',
|
2023-07-22 15:40:45 +02:00
|
|
|
dependencies = {
|
2024-01-21 23:32:15 +01:00
|
|
|
'nvim-lua/plenary.nvim',
|
2024-01-22 23:14:16 +01:00
|
|
|
when 'linux' { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }
|
2023-07-22 15:40:45 +02:00
|
|
|
},
|
2023-09-02 22:09:00 +02:00
|
|
|
config = function()
|
2024-01-21 23:32:15 +01:00
|
|
|
local telescope = require 'telescope'
|
|
|
|
local builtin = require 'telescope.builtin'
|
2023-11-07 23:21:58 +01:00
|
|
|
local ext = telescope.extensions
|
2023-11-15 21:39:37 +01:00
|
|
|
|
2024-01-22 23:14:16 +01:00
|
|
|
if is 'linux' then telescope.load_extension 'fzf' end
|
|
|
|
if is 'standalone' then telescope.load_extension 'notify' end
|
|
|
|
|
2023-11-15 21:39:37 +01:00
|
|
|
telescope.setup {
|
2023-09-02 22:09:00 +02:00
|
|
|
extensions = {
|
|
|
|
fzf = {
|
|
|
|
fuzzy = true,
|
|
|
|
override_generic_sorter = true,
|
|
|
|
override_file_sorter = true,
|
2024-01-21 23:32:15 +01:00
|
|
|
case_mode = 'smart_case',
|
2023-09-02 22:09:00 +02:00
|
|
|
}
|
|
|
|
}
|
2023-11-15 21:39:37 +01:00
|
|
|
}
|
|
|
|
|
2024-01-25 22:09:30 +01:00
|
|
|
n '<leader>ff' (builtin.find_files) 'Telescope: files'
|
|
|
|
n '<leader>fb' (builtin.buffers) 'Telescope: buffers'
|
|
|
|
n '<leader>fg' (builtin.live_grep) 'Telescope: grep'
|
|
|
|
n '<leader>fh' (builtin.help_tags) 'Telescope: docs'
|
2024-01-25 22:57:52 +01:00
|
|
|
n '<Leader>fk' (builtin.keymaps) 'Telescope: keymaps'
|
2024-01-22 23:14:16 +01:00
|
|
|
|
|
|
|
if is 'standalone' then
|
2024-01-25 22:09:30 +01:00
|
|
|
n '<leader>fn' (ext.notify.notify) 'Telescope: notifications'
|
2024-01-22 23:14:16 +01:00
|
|
|
end
|
2023-09-02 22:09:00 +02:00
|
|
|
end,
|
2023-07-22 15:40:45 +02:00
|
|
|
},
|
|
|
|
|
2023-07-10 22:33:59 +02:00
|
|
|
-- Treesitter
|
2023-07-10 15:18:34 +02:00
|
|
|
{
|
2024-01-21 23:32:15 +01:00
|
|
|
'nvim-treesitter/nvim-treesitter',
|
|
|
|
build = ':TSUpdate',
|
2024-02-26 22:56:21 +01:00
|
|
|
dependencies = {
|
|
|
|
'nvim-treesitter/nvim-treesitter-textobjects'
|
|
|
|
},
|
2023-07-11 22:41:32 +02:00
|
|
|
config = function()
|
2024-01-17 18:36:59 +01:00
|
|
|
local configs = require 'nvim-treesitter.configs'
|
2023-11-15 21:39:37 +01:00
|
|
|
|
2024-01-17 18:36:59 +01:00
|
|
|
configs.setup {
|
2023-11-15 21:39:37 +01:00
|
|
|
modules = {},
|
|
|
|
auto_install = false,
|
|
|
|
sync_install = false,
|
|
|
|
ignore_install = {},
|
2023-07-11 22:41:32 +02:00
|
|
|
ensure_installed = {
|
2023-12-24 22:54:03 +01:00
|
|
|
-- neovim
|
2024-02-19 22:54:33 +01:00
|
|
|
'vimdoc', 'lua', 'query',
|
2023-12-24 22:54:03 +01:00
|
|
|
-- data
|
2024-01-22 23:14:16 +01:00
|
|
|
'json', 'xml', 'yaml', 'toml',
|
2023-12-24 22:54:03 +01:00
|
|
|
-- markdown
|
2024-01-21 23:32:15 +01:00
|
|
|
'markdown', 'markdown_inline',
|
2023-12-24 22:54:03 +01:00
|
|
|
-- latex
|
2024-01-21 23:32:15 +01:00
|
|
|
'latex', 'bibtex',
|
2023-07-29 21:15:17 +02:00
|
|
|
-- git
|
2024-01-21 23:32:15 +01:00
|
|
|
'gitcommit', 'gitignore', 'diff',
|
2023-12-24 22:54:03 +01:00
|
|
|
-- misc
|
2024-01-21 23:32:15 +01:00
|
|
|
'comment', 'dockerfile', 'regex',
|
2023-07-11 22:41:32 +02:00
|
|
|
-- shell
|
2024-01-21 23:32:15 +01:00
|
|
|
'bash',
|
2023-07-11 22:41:32 +02:00
|
|
|
-- python
|
2024-01-21 23:32:15 +01:00
|
|
|
'python',
|
2024-02-19 22:54:33 +01:00
|
|
|
-- systems
|
|
|
|
'rust', 'c',
|
2023-07-11 22:41:32 +02:00
|
|
|
-- webdev
|
2024-01-21 23:32:15 +01:00
|
|
|
'html', 'css', 'scss', 'javascript', 'jsdoc', 'typescript', 'tsx', 'astro', 'svelte',
|
2023-07-11 22:41:32 +02:00
|
|
|
-- haskell
|
2024-01-22 23:14:16 +01:00
|
|
|
'haskell',
|
2023-07-22 13:52:10 +02:00
|
|
|
},
|
2023-12-24 22:54:03 +01:00
|
|
|
highlight = { enable = true },
|
|
|
|
indent = { enable = true },
|
2024-01-21 23:32:15 +01:00
|
|
|
incremental_selection = {
|
|
|
|
enable = true,
|
|
|
|
keymaps = {
|
|
|
|
init_selection = '<CR>',
|
|
|
|
scope_incremental = '<CR>',
|
|
|
|
node_incremental = '<TAB>',
|
|
|
|
node_decremental = '<S-TAB>',
|
|
|
|
},
|
|
|
|
},
|
2024-02-26 22:56:21 +01:00
|
|
|
textobjects = {
|
|
|
|
select = {
|
|
|
|
enable = true,
|
|
|
|
keymaps = {
|
|
|
|
['af'] = '@function.outer',
|
|
|
|
['if'] = '@function.inner',
|
|
|
|
['a?'] = '@conditional.outer',
|
|
|
|
['i?'] = '@conditional.inner',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
move = {
|
|
|
|
enable = true,
|
|
|
|
goto_next_start = {
|
|
|
|
[']f'] = '@function.outer',
|
|
|
|
},
|
|
|
|
goto_previous_start = {
|
|
|
|
['[f'] = '@function.outer',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-11-15 21:39:37 +01:00
|
|
|
}
|
2023-07-11 22:41:32 +02:00
|
|
|
end,
|
2023-07-10 15:18:34 +02:00
|
|
|
init = function()
|
2023-11-15 21:39:37 +01:00
|
|
|
local lang = vim.treesitter.language
|
|
|
|
|
2024-01-17 18:36:59 +01:00
|
|
|
lang.register('markdown', 'mdx')
|
|
|
|
lang.register('markdown', 'lhaskell')
|
2023-07-11 22:41:32 +02:00
|
|
|
end,
|
2023-07-10 15:18:34 +02:00
|
|
|
},
|
2023-07-22 13:52:10 +02:00
|
|
|
|
2024-01-25 22:09:30 +01:00
|
|
|
-- Git - file hunks
|
2024-01-21 23:32:15 +01:00
|
|
|
{
|
|
|
|
'lewis6991/gitsigns.nvim',
|
2024-01-22 23:14:16 +01:00
|
|
|
enabled = is 'standalone',
|
2024-01-25 22:09:30 +01:00
|
|
|
config = function()
|
|
|
|
local gs = require 'gitsigns'
|
|
|
|
|
|
|
|
gs.setup {
|
|
|
|
on_attach = function()
|
|
|
|
n '<Leader>hp' (gs.preview_hunk) 'Hunk: preview'
|
|
|
|
n '<Leader>hs' (gs.stage_hunk) 'Hunk: stage'
|
|
|
|
n '<Leader>hu' (gs.undo_stage_hunk) 'Hunk: unstage'
|
|
|
|
n '<Leader>hr' (gs.reset_hunk) 'Hunk: reset'
|
|
|
|
n '<leader>hS' (gs.stage_buffer) 'Hunk: buffer stage'
|
|
|
|
n '<leader>hR' (gs.reset_buffer) 'Hunk: buffer reset'
|
|
|
|
n '<leader>hd' (gs.toggle_deleted) 'Hunk: show deleted'
|
|
|
|
end
|
|
|
|
}
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
|
|
|
-- Git - project diff
|
|
|
|
{
|
|
|
|
'sindrets/diffview.nvim',
|
|
|
|
enabled = is 'standalone',
|
|
|
|
dependencies = {
|
|
|
|
'nvim-lua/plenary.nvim',
|
|
|
|
'nvim-tree/nvim-web-devicons',
|
|
|
|
},
|
|
|
|
config = function()
|
2024-01-26 00:27:12 +01:00
|
|
|
local lib = require 'diffview.lib'
|
|
|
|
|
|
|
|
local function toggle(name)
|
|
|
|
return function()
|
|
|
|
if not next(lib.views) then
|
|
|
|
vim.cmd(name)
|
|
|
|
else
|
|
|
|
vim.cmd 'DiffviewClose'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
n '<Leader>gd' (toggle 'DiffviewOpen') 'Git: Diff'
|
|
|
|
n '<Leader>gh' (toggle 'DiffviewFileHistory') 'Git: History'
|
2024-01-25 22:09:30 +01:00
|
|
|
end
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
2024-02-19 22:54:33 +01:00
|
|
|
dir = '~/Desktop/disasm.nvim',
|
|
|
|
ft = { 'c' },
|
2024-01-25 22:09:30 +01:00
|
|
|
config = function()
|
2024-02-19 22:54:33 +01:00
|
|
|
local disasm = require 'disasm'
|
2024-01-25 22:09:30 +01:00
|
|
|
|
2024-02-26 22:56:21 +01:00
|
|
|
n '<Leader>a' (disasm.disassemble) 'Disasm: Disassemble'
|
|
|
|
n '<Leader>Af' (disasm.disassemble_full) 'Disasm: Disassemble full'
|
|
|
|
n '<Leader>Ac' (disasm.reconfigure) 'Disasm: Configure'
|
|
|
|
n '<Leader>AC' (disasm.save_config) 'Disasm: Save config'
|
2024-01-25 22:09:30 +01:00
|
|
|
|
2024-02-19 22:54:33 +01:00
|
|
|
disasm.setup()
|
2024-01-25 22:09:30 +01:00
|
|
|
end
|
2024-01-21 23:32:15 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
-- Comments
|
|
|
|
{
|
|
|
|
'numToStr/Comment.nvim',
|
|
|
|
config = true,
|
|
|
|
},
|
|
|
|
|
2024-02-19 22:54:33 +01:00
|
|
|
{
|
|
|
|
'NvChad/nvim-colorizer.lua',
|
|
|
|
config = true,
|
|
|
|
},
|
|
|
|
|
2024-01-21 23:32:15 +01:00
|
|
|
-- Shortcut hints
|
|
|
|
{
|
|
|
|
'folke/which-key.nvim',
|
2024-01-22 23:14:16 +01:00
|
|
|
enabled = is 'standalone',
|
2024-01-21 23:32:15 +01:00
|
|
|
event = 'VeryLazy',
|
|
|
|
init = function()
|
|
|
|
vim.o.timeout = true
|
|
|
|
vim.o.timeoutlen = 300
|
|
|
|
end,
|
|
|
|
opts = {}
|
|
|
|
},
|
|
|
|
|
|
|
|
-- Notifications
|
|
|
|
{
|
|
|
|
'rcarriga/nvim-notify',
|
2024-01-22 23:14:16 +01:00
|
|
|
enabled = is 'standalone',
|
2024-01-21 23:32:15 +01:00
|
|
|
config = function()
|
|
|
|
vim.notify = require 'notify'
|
|
|
|
end
|
|
|
|
},
|
|
|
|
|
|
|
|
-- File tree
|
|
|
|
{
|
|
|
|
'nvim-neo-tree/neo-tree.nvim',
|
2024-01-22 23:14:16 +01:00
|
|
|
enabled = is 'standalone',
|
2024-01-21 23:32:15 +01:00
|
|
|
branch = 'v3.x',
|
|
|
|
dependencies = {
|
|
|
|
'nvim-lua/plenary.nvim',
|
|
|
|
'nvim-tree/nvim-web-devicons',
|
|
|
|
'MunifTanjim/nui.nvim',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2023-07-10 22:33:59 +02:00
|
|
|
-- Snippet engine
|
|
|
|
{
|
2024-01-21 23:32:15 +01:00
|
|
|
'L3MON4D3/LuaSnip',
|
|
|
|
version = '2.*',
|
2023-07-10 22:33:59 +02:00
|
|
|
},
|
2023-07-22 15:40:45 +02:00
|
|
|
|
2023-07-10 22:33:59 +02:00
|
|
|
-- Completion
|
2024-01-23 22:23:58 +01:00
|
|
|
{
|
2024-01-21 23:32:15 +01:00
|
|
|
'hrsh7th/nvim-cmp',
|
2023-07-10 22:33:59 +02:00
|
|
|
dependencies = {
|
2024-01-21 23:32:15 +01:00
|
|
|
'hrsh7th/cmp-cmdline',
|
|
|
|
'hrsh7th/cmp-buffer',
|
|
|
|
'hrsh7th/cmp-path',
|
|
|
|
'hrsh7th/cmp-nvim-lsp',
|
|
|
|
'saadparwaiz1/cmp_luasnip',
|
2023-07-10 22:33:59 +02:00
|
|
|
},
|
2024-01-23 22:23:58 +01:00
|
|
|
config = require 'config.plugins.nvim-cmp'
|
2023-07-10 13:46:48 +02:00
|
|
|
},
|
2023-07-22 15:40:45 +02:00
|
|
|
|
2024-01-22 23:14:16 +01:00
|
|
|
-- LS configs
|
|
|
|
{
|
|
|
|
'neovim/nvim-lspconfig',
|
|
|
|
enabled = is { 'standalone', 'linux' },
|
|
|
|
},
|
|
|
|
|
2023-07-22 15:40:45 +02:00
|
|
|
-- Debugger adapter support
|
2023-07-11 23:48:37 +02:00
|
|
|
{
|
2024-01-21 23:32:15 +01:00
|
|
|
'mfussenegger/nvim-dap',
|
2024-01-22 23:14:16 +01:00
|
|
|
enabled = is { 'standalone', 'linux' },
|
2024-01-28 01:46:41 +01:00
|
|
|
dependencies = {
|
|
|
|
'rcarriga/nvim-dap-ui',
|
|
|
|
},
|
2023-07-11 23:48:37 +02:00
|
|
|
config = function()
|
2024-01-21 23:32:15 +01:00
|
|
|
local dap = require 'dap'
|
2024-01-28 01:46:41 +01:00
|
|
|
local ui = require 'dapui'
|
2023-11-15 21:39:37 +01:00
|
|
|
|
2024-01-28 01:46:41 +01:00
|
|
|
n '<F5>' (dap.continue) 'Debugger: continue'
|
|
|
|
n '<F10>' (dap.step_over) 'Debugger: step over'
|
|
|
|
n '<F11>' (dap.step_into) 'Debugger: step into'
|
|
|
|
n '<F12>' (dap.step_out) 'Debugger: step out'
|
|
|
|
n '<leader>db' (dap.toggle_breakpoint) 'Debugger: toggle breakpoint'
|
2024-01-26 17:47:29 +01:00
|
|
|
|
2024-01-28 01:46:41 +01:00
|
|
|
n '<leader>du' (ui.toggle) 'Debugger: toggle UI'
|
|
|
|
nv '<leader>de' (ui.eval) 'Debugger: eval'
|
2023-07-22 15:40:45 +02:00
|
|
|
|
2024-01-28 13:15:04 +01:00
|
|
|
-- vim.api.nvim_set_hl(0, 'DapBreakpoint', { ctermbg = 0, fg = '#993939', bg = '#31353f' })
|
|
|
|
-- vim.api.nvim_set_hl(0, 'DapLogPoint', { ctermbg = 0, fg = '#61afef', bg = '#31353f' })
|
|
|
|
-- vim.api.nvim_set_hl(0, 'DapStopped', { ctermbg = 0, fg = '#98c379', bg = '#31353f' })
|
|
|
|
--
|
|
|
|
-- vim.fn.sign_define('DapBreakpoint', { text='', texthl='DapBreakpoint', linehl='DapBreakpoint', numhl='DapBreakpoint' })
|
|
|
|
-- vim.fn.sign_define('DapBreakpointCondition', { text='ﳁ', texthl='DapBreakpoint', linehl='DapBreakpoint', numhl='DapBreakpoint' })
|
|
|
|
-- vim.fn.sign_define('DapBreakpointRejected', { text='', texthl='DapBreakpoint', linehl='DapBreakpoint', numhl= 'DapBreakpoint' })
|
|
|
|
-- vim.fn.sign_define('DapLogPoint', { text='', texthl='DapLogPoint', linehl='DapLogPoint', numhl= 'DapLogPoint' })
|
|
|
|
-- vim.fn.sign_define('DapStopped', { text='', texthl='DapStopped', linehl='DapStopped', numhl= 'DapStopped' })
|
|
|
|
|
2024-01-28 01:46:41 +01:00
|
|
|
ui.setup()
|
|
|
|
dap.listeners.after.event_initialized["dapui_config"] = ui.open
|
|
|
|
dap.listeners.after.event_terminated["dapui_config"] = ui.close
|
|
|
|
dap.listeners.before.event_exited["dapui_config"] = ui.close
|
|
|
|
end,
|
2023-07-11 23:48:37 +02:00
|
|
|
},
|
2023-07-22 15:40:45 +02:00
|
|
|
|
2023-07-11 23:48:37 +02:00
|
|
|
-- Mason
|
|
|
|
{
|
2024-01-21 23:32:15 +01:00
|
|
|
'williamboman/mason.nvim',
|
2024-01-22 23:14:16 +01:00
|
|
|
enabled = is { 'standalone', 'linux' },
|
|
|
|
config = true,
|
2023-07-11 23:48:37 +02:00
|
|
|
},
|
2023-07-22 15:40:45 +02:00
|
|
|
|
2023-11-15 21:39:37 +01:00
|
|
|
-- Automatic LSP server setup for Mason
|
2023-07-11 23:48:37 +02:00
|
|
|
{
|
2024-01-21 23:32:15 +01:00
|
|
|
'williamboman/mason-lspconfig.nvim',
|
2024-01-22 23:14:16 +01:00
|
|
|
enabled = is { 'standalone', 'linux' },
|
2023-07-22 15:40:45 +02:00
|
|
|
dependencies = {
|
2024-01-21 23:32:15 +01:00
|
|
|
'williamboman/mason.nvim',
|
|
|
|
'neovim/nvim-lspconfig',
|
2023-07-22 15:40:45 +02:00
|
|
|
},
|
2023-07-11 23:48:37 +02:00
|
|
|
config = function()
|
2024-01-21 23:32:15 +01:00
|
|
|
local config = require 'mason-lspconfig'
|
|
|
|
local lsp = require 'lspconfig'
|
|
|
|
local cmp = require 'cmp_nvim_lsp'
|
2024-01-09 19:41:47 +01:00
|
|
|
|
|
|
|
local noop = function() end
|
2023-11-15 21:39:37 +01:00
|
|
|
|
|
|
|
config.setup {
|
2023-07-11 23:48:37 +02:00
|
|
|
automatic_installation = true,
|
2023-07-22 15:40:45 +02:00
|
|
|
-- NOTE
|
2024-01-09 19:41:47 +01:00
|
|
|
-- Haskell: Managed by GHCup
|
2023-07-11 23:48:37 +02:00
|
|
|
ensure_installed = {
|
2024-01-21 23:32:15 +01:00
|
|
|
'lua_ls', -- Lua
|
|
|
|
'rust_analyzer', -- Rust
|
2024-02-19 22:54:33 +01:00
|
|
|
'clangd', -- C
|
|
|
|
-- 'bashls', -- Bash
|
2024-01-21 23:32:15 +01:00
|
|
|
'html', -- HTML
|
|
|
|
'cssls', -- CSS / SCSS
|
|
|
|
'tsserver', -- TypeScript
|
2024-02-19 22:54:33 +01:00
|
|
|
-- 'astro', -- Astro
|
2024-01-21 23:32:15 +01:00
|
|
|
'svelte', -- Svelte
|
2024-02-19 22:54:33 +01:00
|
|
|
-- 'pyright', -- Python
|
|
|
|
-- 'rnix', -- Nix
|
|
|
|
-- 'purescriptls', -- Purescript
|
|
|
|
-- 'ltex', -- Literate - LaTeX, Markdown, etc.
|
2023-07-11 23:48:37 +02:00
|
|
|
},
|
2023-11-15 21:39:37 +01:00
|
|
|
}
|
2023-07-12 19:15:14 +02:00
|
|
|
|
2023-11-15 21:39:37 +01:00
|
|
|
config.setup_handlers {
|
2024-01-09 19:41:47 +01:00
|
|
|
function(name)
|
|
|
|
lsp[name].setup {
|
2023-07-12 19:15:14 +02:00
|
|
|
single_file_support = true,
|
2023-11-15 21:39:37 +01:00
|
|
|
capabilities = cmp.default_capabilities(),
|
2023-11-17 23:44:48 +01:00
|
|
|
}
|
2023-07-12 19:15:14 +02:00
|
|
|
end,
|
2024-01-09 19:41:47 +01:00
|
|
|
['rust_analyzer'] = noop,
|
2023-11-15 21:39:37 +01:00
|
|
|
}
|
2024-02-19 22:54:33 +01:00
|
|
|
|
|
|
|
local signs = {
|
|
|
|
Error = "",
|
|
|
|
Warn = "",
|
|
|
|
Hint = "",
|
|
|
|
Info = "",
|
|
|
|
}
|
|
|
|
|
|
|
|
for sign, text in pairs(signs) do
|
|
|
|
local name = 'DiagnosticSign' .. sign
|
|
|
|
vim.fn.sign_define(name, { text = text, texthl = name })
|
|
|
|
end
|
2023-07-11 23:48:37 +02:00
|
|
|
end,
|
|
|
|
},
|
2023-07-22 15:40:45 +02:00
|
|
|
|
|
|
|
-- Automatic debugger install
|
2023-07-11 23:48:37 +02:00
|
|
|
{
|
2024-01-21 23:32:15 +01:00
|
|
|
'jay-babu/mason-nvim-dap.nvim',
|
2024-01-22 23:14:16 +01:00
|
|
|
enabled = is { 'standalone', 'linux' },
|
2023-07-22 15:40:45 +02:00
|
|
|
dependencies = {
|
2024-01-21 23:32:15 +01:00
|
|
|
'mfussenegger/nvim-dap',
|
|
|
|
'williamboman/mason.nvim',
|
2023-07-22 15:40:45 +02:00
|
|
|
},
|
2023-07-11 23:48:37 +02:00
|
|
|
config = function()
|
2024-01-21 23:32:15 +01:00
|
|
|
local config = require 'mason-nvim-dap'
|
2023-11-15 21:39:37 +01:00
|
|
|
|
|
|
|
config.setup {
|
2023-07-11 23:48:37 +02:00
|
|
|
automatic_installation = true,
|
|
|
|
ensure_installed = {
|
2024-01-21 23:32:15 +01:00
|
|
|
'codelldb',
|
2024-01-28 01:46:41 +01:00
|
|
|
--'js-debug-adapter',
|
2023-07-11 23:48:37 +02:00
|
|
|
},
|
2023-11-15 21:39:37 +01:00
|
|
|
}
|
2023-07-11 23:48:37 +02:00
|
|
|
end,
|
|
|
|
},
|
2023-07-22 15:40:45 +02:00
|
|
|
|
2023-11-15 21:39:37 +01:00
|
|
|
-- Tools for Neovim
|
|
|
|
{
|
2024-01-21 23:32:15 +01:00
|
|
|
'folke/neodev.nvim',
|
2024-01-22 23:14:16 +01:00
|
|
|
enabled = is { 'standalone', 'linux' },
|
2024-01-21 23:32:15 +01:00
|
|
|
ft = 'lua',
|
2023-11-15 21:39:37 +01:00
|
|
|
dependencies = {
|
2024-01-21 23:32:15 +01:00
|
|
|
'neovim/nvim-lspconfig',
|
2023-11-15 21:39:37 +01:00
|
|
|
},
|
|
|
|
config = function()
|
2024-01-21 23:32:15 +01:00
|
|
|
local neodev = require 'neodev'
|
|
|
|
local lsp = require 'lspconfig'
|
2023-11-15 21:39:37 +01:00
|
|
|
|
|
|
|
neodev.setup()
|
|
|
|
lsp.lua_ls.setup {
|
|
|
|
settings = {
|
2024-01-21 23:32:15 +01:00
|
|
|
Lua = { completion = { callSnippet = 'Replace' } }
|
2023-11-15 21:39:37 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
},
|
|
|
|
|
2023-07-22 15:40:45 +02:00
|
|
|
-- Tools for Rust
|
2024-01-09 19:41:47 +01:00
|
|
|
{
|
2024-01-21 23:32:15 +01:00
|
|
|
'mrcjkb/rustaceanvim',
|
2024-01-22 23:14:16 +01:00
|
|
|
enabled = is { 'standalone', 'linux' },
|
2024-01-21 23:32:15 +01:00
|
|
|
version = '^3',
|
|
|
|
ft = { 'rust' },
|
2024-01-09 19:41:47 +01:00
|
|
|
init = function()
|
2024-01-23 22:23:58 +01:00
|
|
|
require 'config.plugins.rustaceanvim'
|
2024-01-09 19:41:47 +01:00
|
|
|
end
|
2023-07-10 14:30:11 +02:00
|
|
|
},
|
2023-07-22 15:40:45 +02:00
|
|
|
|
|
|
|
-- Tools for Haskell
|
2024-01-23 22:23:58 +01:00
|
|
|
{
|
2024-01-21 23:32:15 +01:00
|
|
|
'mrcjkb/haskell-tools.nvim',
|
2024-01-22 23:14:16 +01:00
|
|
|
enabled = is { 'standalone', 'linux' },
|
2024-01-21 23:32:15 +01:00
|
|
|
version = '^3',
|
|
|
|
ft = { 'haskell', 'lhaskell', 'cabal', 'cabalproject' },
|
2023-07-12 01:00:44 +02:00
|
|
|
dependencies = {
|
2024-01-21 23:32:15 +01:00
|
|
|
'nvim-lua/plenary.nvim',
|
|
|
|
'nvim-telescope/telescope.nvim',
|
2023-07-12 01:00:44 +02:00
|
|
|
},
|
2024-01-23 22:23:58 +01:00
|
|
|
init = require 'config.plugins.haskell-tools'
|
2023-07-12 01:00:44 +02:00
|
|
|
},
|
2023-07-22 15:40:45 +02:00
|
|
|
|
2024-01-28 01:46:41 +01:00
|
|
|
-- JS debugger
|
|
|
|
{
|
|
|
|
'mxsdev/nvim-dap-vscode-js',
|
|
|
|
dependencies = {
|
|
|
|
'microsoft/vscode-js-debug',
|
|
|
|
version = '1.x',
|
|
|
|
build = 'npm i && npm run compile vsDebugServerBundle && mv dist out',
|
|
|
|
},
|
|
|
|
config = function()
|
|
|
|
local dap = require 'dap'
|
|
|
|
--local utils = require 'dap.utils'
|
|
|
|
local dap_js = require 'dap-vscode-js'
|
|
|
|
--local mason = require 'mason-registry'
|
|
|
|
|
|
|
|
---@diagnostic disable-next-line: missing-fields
|
|
|
|
dap_js.setup {
|
|
|
|
-- debugger_path = mason.get_package('js-debug-adapter'):get_install_path(),
|
|
|
|
debugger_path = vim.fn.stdpath 'data' .. '/lazy/vscode-js-debug',
|
|
|
|
adapters = { 'pwa-node', 'pwa-chrome', 'pwa-msedge', 'node-terminal', 'pwa-extensionHost' },
|
|
|
|
}
|
|
|
|
|
|
|
|
local langs = { 'javascript', 'typescript', 'svelte', 'astro' }
|
|
|
|
for _, lang in ipairs(langs) do
|
|
|
|
dap.configurations[lang] = {
|
|
|
|
{
|
2024-01-28 13:15:04 +01:00
|
|
|
type = 'pwa-node',
|
2024-01-28 01:46:41 +01:00
|
|
|
request = 'attach',
|
2024-01-28 13:15:04 +01:00
|
|
|
name = 'Attach debugger to existing `node --inspect` process',
|
|
|
|
cwd = '${workspaceFolder}',
|
2024-01-28 01:46:41 +01:00
|
|
|
skipFiles = {
|
|
|
|
'${workspaceFolder}/node_modules/**/*.js',
|
|
|
|
'${workspaceFolder}/packages/**/node_modules/**/*.js',
|
|
|
|
'${workspaceFolder}/packages/**/**/node_modules/**/*.js',
|
|
|
|
'<node_internals>/**',
|
|
|
|
'node_modules/**',
|
|
|
|
},
|
2024-01-28 13:15:04 +01:00
|
|
|
sourceMaps = true,
|
|
|
|
resolveSourceMapLocations = {
|
|
|
|
'${workspaceFolder}/**',
|
|
|
|
'!**/node_modules/**',
|
|
|
|
},
|
2024-01-28 01:46:41 +01:00
|
|
|
},
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
},
|
2023-07-10 13:46:48 +02:00
|
|
|
}
|