aboutsummaryrefslogtreecommitdiff
path: root/config/nvim/lua
diff options
context:
space:
mode:
Diffstat (limited to 'config/nvim/lua')
-rw-r--r--config/nvim/lua/lsp.lua133
-rw-r--r--config/nvim/lua/plugins.lua15
-rw-r--r--config/nvim/lua/treesitter_config.lua4
3 files changed, 24 insertions, 128 deletions
diff --git a/config/nvim/lua/lsp.lua b/config/nvim/lua/lsp.lua
index 9838887..f5718c4 100644
--- a/config/nvim/lua/lsp.lua
+++ b/config/nvim/lua/lsp.lua
@@ -1,141 +1,18 @@
local util = require 'lspconfig.util'
--- JAVASCRIPT FAMILY -----------------------------------------------------------
-
-vim.lsp.config('ts_ls', {
- cmd = { 'typescript-language-server', '--stdio' },
- filetypes = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact' },
- root_markers = { 'package.json', 'tsconfig.json', 'jsconfig.json' }
-})
vim.lsp.enable('ts_ls')
-
-vim.lsp.config('eslint', {
- cmd = { 'vscode-eslint-language-server', '--stdio' },
- filetypes = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact' },
- root_markers = { '.eslintrc', '.eslintrc.js', '.eslintrc.json', 'package.json' }
-})
vim.lsp.enable('eslint')
-
-vim.lsp.config('svelte', {
- cmd = { 'svelteserver', '--stdio' },
- filetypes = { 'svelte' },
- root_markers = { 'package.json', 'svelte.config.js' }
-})
vim.lsp.enable('svelte')
-
--- PYTHON ----------------------------------------------------------------------
-
-vim.lsp.config('pyright', {
- cmd = { 'pyright-langserver', '--stdio' },
- filetypes = { 'python' },
- root_markers = { 'pyproject.toml', 'setup.py', 'requirements.txt' }
-})
vim.lsp.enable('pyright')
-
--- RUST ------------------------------------------------------------------------
-
-vim.lsp.config('rust_analyzer', {
- cmd = { 'rust-analyzer' },
- filetypes = { 'rust' },
- root_markers = { 'Cargo.toml', 'rust-project.json' },
- settings = {
- ['rust-analyzer'] = {
- imports = {
- granularity = {
- group = "module",
- },
- prefix = "self",
- },
- cargo = {
- buildScripts = {
- enable = true,
- },
- },
- procMacro = {
- enable = true
- },
- checkOnSave = {
- enable = true,
- command = "clippy"
- }
- },
- },
-})
vim.lsp.enable('rust_analyzer')
-
--- LUA -------------------------------------------------------------------------
-
-vim.lsp.config('lua_ls', {
- cmd = { 'lua-language-server' },
- filetypes = { 'lua' },
- root_markers = { '.luarc.json', '.luarc.jsonc', '.luacheckrc', 'stylua.toml', 'selene.toml' },
-})
vim.lsp.enable('lua_ls')
-
--- GLEAM------------------------------------------------------------------------
-
-vim.lsp.config('gleam', {
- cmd = { 'gleam', 'lsp' },
- filetypes = { 'gleam' },
- root_markers = { 'gleam.toml' },
-})
vim.lsp.enable('gleam')
-
--- SWIFT AND THE Cs ------------------------------------------------------------
-
-vim.lsp.config('sourcekit', {
- cmd = { 'sourcekit-lsp' },
- filetypes = { 'swift', 'objc', 'objcpp', 'c', 'cpp' },
- root_dir = function(bufnr, on_dir)
- local filename = vim.api.nvim_buf_get_name(bufnr)
- on_dir(
- util.root_pattern('buildServer.json', '.bsp')(filename)
- or util.root_pattern('*.xcodeproj', '*.xcworkspace')(filename)
- -- better to keep it at the end, because some modularized apps contain multiple Package.swift files
- or util.root_pattern('compile_commands.json', 'Package.swift')(filename)
- or vim.fs.dirname(vim.fs.find('.git', { path = filename, upward = true })[1])
- )
- end,
- get_language_id = function(_, ftype)
- local t = { objc = 'objective-c', objcpp = 'objective-cpp' }
- return t[ftype] or ftype
- end,
- capabilities = {
- workspace = {
- didChangeWatchedFiles = {
- dynamicRegistration = true,
- },
- },
- textDocument = {
- diagnostic = {
- dynamicRegistration = true,
- relatedDocumentSupport = true,
- },
- },
- },
-})
vim.lsp.enable('sourcekit')
-
--- RUBY ------------------------------------------------------------------------
-vim.lsp.config('ruby', {
- cmd = function(dispatchers, config)
- return vim.lsp.rpc.start(
- { 'mise x -- ruby-lsp' },
- dispatchers,
- config and config.root_dir and { cwd = config.cmd_cwd or config.root_dir }
- )
- end,
- filetypes = { 'ruby', 'eruby' },
- root_markers = { 'Gemfile', '.git' },
- init_options = {
- formatter = 'auto',
- },
- reuse_client = function(client, config)
- config.cmd_cwd = config.root_dir
- return client.config.cmd_cwd == config.cmd_cwd
- end,
-})
-vim.lsp.enable('ruby')
+vim.lsp.enable('ruby_lsp')
+vim.lsp.enable('hls')
+vim.lsp.enable('julials')
+vim.lsp.enable('r_language_server')
+vim.lsp.enable('leanls')
-- Enable inlay hints for Rust when LSP attaches
vim.api.nvim_create_autocmd('LspAttach', {
diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua
index 7958eab..2feda55 100644
--- a/config/nvim/lua/plugins.lua
+++ b/config/nvim/lua/plugins.lua
@@ -56,6 +56,21 @@ require('lazy').setup({
-- Syntaxes
'ARM9/snes-syntax-vim',
'https://git.sr.ht/~torresjrjr/gemini.vim',
+ {
+ 'Julian/lean.nvim',
+ event = { 'BufReadPre *.lean', 'BufNewFile *.lean' },
+
+ dependencies = {},
+
+ ---@type lean.Config
+ opts = {
+ mappings = true,
+ }
+ },
+ {
+ "R-nvim/R.nvim",
+ lazy = false
+ },
-- Debugging & Testing
{
diff --git a/config/nvim/lua/treesitter_config.lua b/config/nvim/lua/treesitter_config.lua
index 70f251f..15b9327 100644
--- a/config/nvim/lua/treesitter_config.lua
+++ b/config/nvim/lua/treesitter_config.lua
@@ -7,16 +7,20 @@ require('nvim-treesitter').install {
'gitcommit',
'gleam',
'graphql',
+ 'haskell',
'html',
'htmldjango',
'javascript',
'jsdoc',
'json',
+ 'julia',
'kotlin',
+ 'lean',
'lua',
'make',
'markdown',
'python',
+ 'r',
'ruby',
'rust',
'sql',