Lisp support and so on

This commit is contained in:
Imbus 2024-12-02 08:13:10 +01:00
parent e145f9f06d
commit e9fe358191
4 changed files with 65 additions and 0 deletions

View file

@ -38,4 +38,16 @@ vim.api.nvim_create_user_command('CDToGitRoot', function()
end end
end, { desc = 'Change directory to the current Git repository root' }) end, { desc = 'Change directory to the current Git repository root' })
vim.api.nvim_create_user_command('WordCount', function()
local buf = vim.api.nvim_get_current_buf()
local lines = vim.api.nvim_buf_get_lines(buf, 0, -1, false)
local words = 0
for _, line in ipairs(lines) do
for _ in line:gmatch '%S+' do
words = words + 1
end
end
print('Word count: ' .. words)
end, { desc = 'Count words in current buffer' })
-- vim: ts=2 sts=2 sw=2 et -- vim: ts=2 sts=2 sw=2 et

26
lua/plugins/conjure.lua Normal file
View file

@ -0,0 +1,26 @@
return {
{
"Olical/conjure",
ft = { "clojure", "fennel", "python", "janet" }, -- etc
lazy = true,
init = function()
-- Set configuration options here
-- Uncomment this to get verbose logging to help diagnose internal Conjure issues
-- This is VERY helpful when reporting an issue with the project
-- vim.g["conjure#debug"] = true
end,
-- Optional cmp-conjure integration
dependencies = { "PaterJason/cmp-conjure" },
},
{
"PaterJason/cmp-conjure",
lazy = true,
config = function()
local cmp = require("cmp")
local config = cmp.get_config()
table.insert(config.sources, { name = "conjure" })
return cmp.setup(config)
end,
},
}

View file

@ -24,6 +24,7 @@ return { -- LSP Configuration & Plugins
-- Manual config for Nushell LSP -- Manual config for Nushell LSP
-- TODO: Remove once `mason-lspconfig` supports Nushell -- TODO: Remove once `mason-lspconfig` supports Nushell
require('lspconfig').nushell.setup {} require('lspconfig').nushell.setup {}
require('lspconfig').janet_lsp.setup {}
-- Brief aside: **What is LSP?** -- Brief aside: **What is LSP?**
-- --

View file

@ -0,0 +1,26 @@
return {
'scalameta/nvim-metals',
dependencies = {
'nvim-lua/plenary.nvim',
},
ft = { 'scala', 'sbt', 'java' },
opts = function()
local metals_config = require('metals').bare_config()
metals_config.on_attach = function(client, bufnr)
-- your on_attach function
vim.keymap.set('n', 'K', vim.lsp.buf.hover)
end
return metals_config
end,
config = function(self, metals_config)
local nvim_metals_group = vim.api.nvim_create_augroup('nvim-metals', { clear = true })
vim.api.nvim_create_autocmd('FileType', {
pattern = self.ft,
callback = function()
require('metals').initialize_or_attach(metals_config)
end,
group = nvim_metals_group,
})
end,
}