update

Changed files
+88 -82
home
+45
home/nvim/dap.lua
···
+
-- TODO
+
-- stdout
+
-- args
+
+
local dap = require('dap')
+
dap.adapters.ocamlearlybird = {
+
type = 'executable',
+
command = 'ocamlearlybird',
+
args = { 'debug' }
+
}
+
+
dap.configurations.ocaml = {
+
{
+
name = 'OCaml',
+
type = 'ocamlearlybird',
+
request = 'launch',
+
program = function()
+
local path = vim.fn.input({
+
prompt = 'Path to executable: ',
+
default = vim.fn.getcwd() .. '/_build/default/bin/',
+
completion = 'file'
+
})
+
return (path and path ~= "") and path or dap.ABORT
+
end,
+
},
+
}
+
+
vim.keymap.set('n', '<leader>;c', function() require('dap').continue() end, { desc = 'DAP continue' })
+
vim.keymap.set('n', '<leader>;s', function() require('dap').step_over() end, { desc = 'DAP step over' })
+
vim.keymap.set('n', '<leader>;i', function() require('dap').step_into() end, { desc = 'DAP step into' })
+
vim.keymap.set('n', '<leader>;o', function() require('dap').step_out() end, { desc = 'DAP step out' })
+
vim.keymap.set('n', '<leader>;b', function() require('dap').toggle_breakpoint() end, { desc = 'DAP breakpoint' })
+
vim.keymap.set('n', '<leader>;m',
+
function() require('dap').set_breakpoint(nil, nil, vim.fn.input('Log point message: ')) end,
+
{ desc = 'DAP breakpoint message' })
+
vim.keymap.set('n', '<leader>;r', function() require('dap').repl.open() end, { desc = 'DAP repl' })
+
vim.keymap.set('n', '<leader>;l', function() require('dap').run_last() end, { desc = 'DAP run last' })
+
vim.keymap.set('n', '<leader>;f', function()
+
local widgets = require('dap.ui.widgets')
+
widgets.centered_float(widgets.frames)
+
end, { desc = 'DAP frames' })
+
vim.keymap.set('n', '<leader>;S', function()
+
local widgets = require('dap.ui.widgets')
+
widgets.centered_float(widgets.scopes)
+
end, { desc = 'DAP scopes' })
+43 -34
home/nvim/default.nix
···
clang-tools
typst-lsp
];
-
extraLuaConfig = builtins.readFile ./init.lua
-
+ (if cfg.nvim-lsps then builtins.readFile ./lsp.lua else "");
+
extraLuaConfig = builtins.readFile ./init.lua;
# undo transparent background
# + "colorscheme gruvbox";
plugins = with pkgs.vimPlugins;
[
{
-
plugin = nvim-lspconfig;
-
runtime = let
-
ml-style = ''
-
setlocal expandtab
-
setlocal shiftwidth=2
-
setlocal tabstop=2
-
setlocal softtabstop=2
-
'';
-
in {
+
plugin = null;
+
runtime = {
# format-flowed
"ftplugin/mail.vim".text = ''
setlocal tw=72
set formatoptions+=w
-
'';
-
"ftplugin/nix.vim".text = ml-style;
-
"ftplugin/ocaml.vim".text = ml-style;
-
"ftplugin/java.lua".text = ''
-
local project_name = vim.fn.fnamemodify(vim.fn.getcwd(), ':p:h:t')
-
local workspace_dir = '~/.cache/jdt/' .. project_name
-
require('jdtls').start_or_attach {
-
on_attach = On_attach,
-
capabilities = Capabilities,
-
cmd = { 'jdt-language-server', '-data', workspace_dir, },
-
root_dir = vim.fs.dirname(vim.fs.find({'gradlew', '.git', 'mvnw'}, { upward = true })[1]),
-
}
-
'';
-
"ftplugin/ledger.vim".text = ''
-
setlocal foldmethod=syntax
'';
};
}
···
plenary-nvim
pkgs.ripgrep
-
cmp-nvim-lsp
-
cmp-nvim-lsp-signature-help
+
{
+
plugin = nvim-cmp;
+
type = "lua";
+
config = builtins.readFile ./nvim-cmp.lua;
+
}
cmp-path
cmp-buffer
cmp-cmdline
···
})
'';
}
+
{
plugin = luasnip;
type = "lua";
config = builtins.readFile ./luasnip.lua;
-
}
-
{
-
plugin = nvim-cmp;
-
type = "lua";
-
config = builtins.readFile ./nvim-cmp.lua;
}
{
···
'';
}
] ++ lib.lists.optionals cfg.nvim-lsps [
+
{
+
plugin = nvim-lspconfig;
+
config = builtins.readFile ./lsp.lua;
+
runtime = let
+
ml-style = ''
+
setlocal expandtab
+
setlocal shiftwidth=2
+
setlocal tabstop=2
+
setlocal softtabstop=2
+
'';
+
in {
+
"ftplugin/nix.vim".text = ml-style;
+
"ftplugin/ocaml.vim".text = ml-style;
+
"ftplugin/java.lua".text = ''
+
local project_name = vim.fn.fnamemodify(vim.fn.getcwd(), ':p:h:t')
+
local workspace_dir = '~/.cache/jdt/' .. project_name
+
require('jdtls').start_or_attach {
+
on_attach = On_attach,
+
capabilities = Capabilities,
+
cmd = { 'jdt-language-server', '-data', workspace_dir, },
+
root_dir = vim.fs.dirname(vim.fs.find({'gradlew', '.git', 'mvnw'}, { upward = true })[1]),
+
}
+
'';
+
"ftplugin/ledger.vim".text = ''
+
setlocal foldmethod=syntax
+
'';
+
};
+
}
+
{
+
plugin = nvim-dap;
+
config = builtins.readFile ./dap.lua;
+
}
+
cmp-nvim-lsp
+
cmp-nvim-lsp-signature-help
ltex-ls-nvim
nvim-jdtls
-
nvim-dap
];
};
};
-48
home/nvim/lsp.lua
···
}
vim.cmd [[autocmd BufWritePre <buffer> lua vim.lsp.buf.format()]]
-
-
-- dap
-
-
-- TODO
-
-- stdout
-
-- args
-
-
local dap = require('dap')
-
dap.adapters.ocamlearlybird = {
-
type = 'executable',
-
command = 'ocamlearlybird',
-
args = { 'debug' }
-
}
-
-
dap.configurations.ocaml = {
-
{
-
name = 'OCaml',
-
type = 'ocamlearlybird',
-
request = 'launch',
-
program = function()
-
local path = vim.fn.input({
-
prompt = 'Path to executable: ',
-
default = vim.fn.getcwd() .. '/_build/default/bin/',
-
completion = 'file'
-
})
-
return (path and path ~= "") and path or dap.ABORT
-
end,
-
},
-
}
-
-
vim.keymap.set('n', '<leader>;c', function() require('dap').continue() end, { desc = 'DAP continue' })
-
vim.keymap.set('n', '<leader>;s', function() require('dap').step_over() end, { desc = 'DAP step over' })
-
vim.keymap.set('n', '<leader>;i', function() require('dap').step_into() end, { desc = 'DAP step into' })
-
vim.keymap.set('n', '<leader>;o', function() require('dap').step_out() end, { desc = 'DAP step out' })
-
vim.keymap.set('n', '<leader>;b', function() require('dap').toggle_breakpoint() end, { desc = 'DAP breakpoint' })
-
vim.keymap.set('n', '<leader>;m',
-
function() require('dap').set_breakpoint(nil, nil, vim.fn.input('Log point message: ')) end,
-
{ desc = 'DAP breakpoint message' })
-
vim.keymap.set('n', '<leader>;r', function() require('dap').repl.open() end, { desc = 'DAP repl' })
-
vim.keymap.set('n', '<leader>;l', function() require('dap').run_last() end, { desc = 'DAP run last' })
-
vim.keymap.set('n', '<leader>;f', function()
-
local widgets = require('dap.ui.widgets')
-
widgets.centered_float(widgets.frames)
-
end, { desc = 'DAP frames' })
-
vim.keymap.set('n', '<leader>;S', function()
-
local widgets = require('dap.ui.widgets')
-
widgets.centered_float(widgets.scopes)
-
end, { desc = 'DAP scopes' })