localdev: remove scala

unused surface area.
This commit is contained in:
Motiejus Jakštys 2023-12-12 13:03:20 +02:00 committed by Motiejus Jakštys
parent c0c14a6806
commit 1399f7c158
2 changed files with 0 additions and 144 deletions

View File

@ -22,10 +22,6 @@
zigpkgs."0.11.0"
sbt
scala_2_12
metals
coursier
]
else []
)
@ -83,14 +79,7 @@
if fullDesktop
then [
vim-go
zig-vim
vim-vsnip
cmp-nvim-lsp
nvim-cmp
nvim-metals
plenary-nvim
]
else []
);
@ -101,8 +90,6 @@
builtins.readFile
(pkgs.substituteAll {
src = ./dev.lua;
javaHome = pkgs.jdk.home;
inherit (pkgs) metals;
inherit (pkgs) gotools;
})
.outPath;

View File

@ -3,134 +3,3 @@ vim.api.nvim_exec([[
au FileType go let g:go_template_autocreate = 0
au FileType go let g:go_fmt_command = "@gotools@/bin/goimports"
]], false)
local api = vim.api
local cmd = vim.cmd
local map = vim.keymap.set
----------------------------------
-- OPTIONS -----------------------
----------------------------------
-- global
vim.opt_global.completeopt = { "menuone", "noinsert", "noselect" }
vim.opt_global.shortmess:remove("F")
-- LSP mappings
map("n", "gD", vim.lsp.buf.definition)
map("n", "K", vim.lsp.buf.hover)
map("n", "gi", vim.lsp.buf.implementation)
map("n", "gr", vim.lsp.buf.references)
map("n", "gds", vim.lsp.buf.document_symbol)
map("n", "gws", vim.lsp.buf.workspace_symbol)
map("n", "<leader>cl", vim.lsp.codelens.run)
map("n", "<leader>sh", vim.lsp.buf.signature_help)
map("n", "<leader>rn", vim.lsp.buf.rename)
map("n", "<leader>f", vim.lsp.buf.format)
map("n", "<leader>ca", vim.lsp.buf.code_action)
map("n", "<leader>ws", function()
require("metals").hover_worksheet()
end)
-- all workspace diagnostics
map("n", "<leader>aa", vim.diagnostic.setqflist)
-- all workspace errors
map("n", "<leader>ae", function()
vim.diagnostic.setqflist({ severity = "E" })
end)
-- all workspace warnings
map("n", "<leader>aw", function()
vim.diagnostic.setqflist({ severity = "W" })
end)
-- buffer diagnostics only
map("n", "<leader>d", vim.diagnostic.setloclist)
map("n", "[c", function()
vim.diagnostic.goto_prev({ wrap = false })
end)
map("n", "]c", function()
vim.diagnostic.goto_next({ wrap = false })
end)
-- Completion related settings. Disabling (motiejus 2023-10-23), because I
-- can't get C-n to work on "simple" files.
--
--local cmp = require("cmp")
--cmp.setup({
-- sources = {
-- { name = "nvim_lsp" },
-- { name = "vsnip" },
-- },
-- snippet = {
-- expand = function(args)
-- -- Comes from vsnip
-- vim.fn["vsnip#anonymous"](args.body)
-- end,
-- },
-- mapping = cmp.mapping.preset.insert({
-- -- None of this made sense to me when first looking into this since there
-- -- is no vim docs, but you can't have select = true here _unless_ you are
-- -- also using the snippet stuff. So keep in mind that if you remove
-- -- snippets you need to remove this select
-- ["<CR>"] = cmp.mapping.confirm({ select = true }),
-- -- I use tabs... some say you should stick to ins-completion but this is just here as an example
-- ["<Tab>"] = function(fallback)
-- if cmp.visible() then
-- cmp.select_next_item()
-- else
-- fallback()
-- end
-- end,
-- ["<S-Tab>"] = function(fallback)
-- if cmp.visible() then
-- cmp.select_prev_item()
-- else
-- fallback()
-- end
-- end,
-- }),
--})
----------------------------------
-- LSP Setup ---------------------
----------------------------------
local metals_config = require("metals").bare_config()
-- Example of settings
metals_config.settings = {
showImplicitArguments = true,
excludedPackages = { "akka.actor.typed.javadsl", "com.github.swagger.akka.javadsl" },
metalsBinaryPath = "@metals@/bin/metals",
javaHome = "@javaHome@",
}
-- *READ THIS*
-- I *highly* recommend setting statusBarProvider to true, however if you do,
-- you *have* to have a setting to display this in your statusline or else
-- you'll not see any messages from metals. There is more info in the help
-- docs about this
metals_config.init_options.statusBarProvider = "on"
-- Example if you are using cmp how to make sure the correct capabilities for snippets are set
-- TODO(motiejus) disabled with cmp 2023-10-23
--metals_config.capabilities = require("cmp_nvim_lsp").default_capabilities()
-- Autocmd that will actually be in charging of starting the whole thing
local nvim_metals_group = api.nvim_create_augroup("nvim-metals", { clear = true })
api.nvim_create_autocmd("FileType", {
-- NOTE: You may or may not want java included here. You will need it if you
-- want basic Java support but it may also conflict if you are using
-- something like nvim-jdtls which also works on a java filetype autocmd.
pattern = { "scala", "sbt", "java" },
callback = function()
require("metals").initialize_or_attach(metals_config)
end,
group = nvim_metals_group,
})