Compare commits
No commits in common. "cad28aae41ea58a0c3e42c77f27f6681f7ab7594" and "e528c11fab141187565619c422cee58693647ef0" have entirely different histories.
cad28aae41
...
e528c11fab
5 changed files with 144 additions and 142 deletions
1
home.nix
1
home.nix
|
|
@ -42,7 +42,6 @@ in
|
||||||
devenv
|
devenv
|
||||||
devbox
|
devbox
|
||||||
tldr
|
tldr
|
||||||
biome
|
|
||||||
];
|
];
|
||||||
|
|
||||||
fonts.fontconfig.enable = true;
|
fonts.fontconfig.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,6 @@ vim.opt.tabstop = 4
|
||||||
vim.opt.splitkeep = "screen"
|
vim.opt.splitkeep = "screen"
|
||||||
|
|
||||||
require "my.keymaps"
|
require "my.keymaps"
|
||||||
require "my.lsp"
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||||
group = vim.api.nvim_create_augroup("HighlightYank", {}),
|
group = vim.api.nvim_create_augroup("HighlightYank", {}),
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
"neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" },
|
"neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" },
|
||||||
"nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" },
|
"nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "3a274c38e53800cf1d72b79baeb6c73e03ef1db3" },
|
"nvim-lspconfig": { "branch": "master", "commit": "cc2f5f2fa28d240574808e78847978ed6ef20d2a" },
|
||||||
"nvim-treesitter": { "branch": "main", "commit": "de003000a287c501a6650a1ddd3be80ee34278d4" },
|
"nvim-treesitter": { "branch": "main", "commit": "de003000a287c501a6650a1ddd3be80ee34278d4" },
|
||||||
"nvim-treesitter-textobjects": { "branch": "main", "commit": "1b2d85d3de6114c4bcea89ffb2cd1ce9e3a19931" },
|
"nvim-treesitter-textobjects": { "branch": "main", "commit": "1b2d85d3de6114c4bcea89ffb2cd1ce9e3a19931" },
|
||||||
"nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" },
|
"nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" },
|
||||||
|
|
|
||||||
|
|
@ -1,71 +0,0 @@
|
||||||
vim.lsp.config.svelte = {}
|
|
||||||
vim.lsp.config.gopls = {}
|
|
||||||
vim.lsp.config.ts_ls = {}
|
|
||||||
|
|
||||||
vim.lsp.config.expert = {
|
|
||||||
cmd = { vim.fn.expand '$HOME/.local/bin/expert' },
|
|
||||||
root_markers = { 'mix.exs', '.git' },
|
|
||||||
filetypes = { 'elixir', 'eelixir', 'heex' },
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.lsp.config.lua_ls = {
|
|
||||||
settings = {
|
|
||||||
Lua = {
|
|
||||||
runtime = {
|
|
||||||
version = "LuaJIT",
|
|
||||||
},
|
|
||||||
diagnostics = {
|
|
||||||
globals = { "vim" },
|
|
||||||
},
|
|
||||||
workspace = {
|
|
||||||
checkThirdParty = false,
|
|
||||||
library = vim.api.nvim_get_runtime_file("", true),
|
|
||||||
},
|
|
||||||
telemetry = {
|
|
||||||
enable = false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.lsp.config.intelephense = {
|
|
||||||
init_options = { licenceKey = vim.fn.stdpath("config") .. "/intelephense-license" },
|
|
||||||
settings = {
|
|
||||||
intelephense = {
|
|
||||||
files = { maxSize = 1000000000 },
|
|
||||||
format = { enable = false },
|
|
||||||
stubs = require "intelephense_stubs",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.lsp.config.nixd = {
|
|
||||||
settings = {
|
|
||||||
formatting = {
|
|
||||||
command = { "nixfmt" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.lsp.enable { 'expert', 'lua_ls', 'svelte', 'intelephense', 'nixd', 'gopls', 'ts_ls' }
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("LspAttach", {
|
|
||||||
callback = function(args)
|
|
||||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
|
||||||
|
|
||||||
if not client then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if client.server_capabilities.documentHighlightProvider then
|
|
||||||
vim.api.nvim_create_autocmd({ "CursorHold" }, {
|
|
||||||
callback = vim.lsp.buf.document_highlight,
|
|
||||||
buffer = args.buf,
|
|
||||||
})
|
|
||||||
vim.api.nvim_create_autocmd({ "CursorMoved" }, {
|
|
||||||
callback = vim.lsp.buf.clear_references,
|
|
||||||
buffer = args.buf,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
@ -1,79 +1,154 @@
|
||||||
-- local function config()
|
local function config()
|
||||||
-- local lspconfig = require "lspconfig"
|
local lspconfig = require "lspconfig"
|
||||||
|
require "neodev".setup()
|
||||||
|
|
||||||
-- local capabilities = {}
|
local capabilities = {}
|
||||||
|
|
||||||
-- local has_cmp, cmp_lsp = pcall(require, "cmp_nvim_lsp")
|
local has_cmp, cmp_lsp = pcall(require, "cmp_nvim_lsp")
|
||||||
-- if has_cmp then
|
if has_cmp then
|
||||||
-- capabilities = cmp_lsp.default_capabilities()
|
capabilities = cmp_lsp.default_capabilities()
|
||||||
-- end
|
end
|
||||||
--
|
|
||||||
-- local eslint = {
|
|
||||||
-- lintCommand = [[eslint_d -f visualstudio --stdin --stdin-filename ${INPUT}]],
|
|
||||||
-- lintIgnoreExitCode = true,
|
|
||||||
-- lintStdin = true,
|
|
||||||
-- lintFormats = {
|
|
||||||
-- "%f(%l,%c): %tarning %m",
|
|
||||||
-- "%f(%l,%c): %rror %m",
|
|
||||||
-- },
|
|
||||||
-- lintSource = "eslint",
|
|
||||||
-- }
|
|
||||||
|
|
||||||
-- local shellcheck = {
|
local eslint = {
|
||||||
-- lintCommand = "shellcheck -f gcc -x",
|
lintCommand = [[eslint_d -f visualstudio --stdin --stdin-filename ${INPUT}]],
|
||||||
-- lintSource = "shellcheck",
|
lintIgnoreExitCode = true,
|
||||||
-- lintFormats = {
|
lintStdin = true,
|
||||||
-- "%f:%l:%c: %trror: %m",
|
lintFormats = {
|
||||||
-- "%f:%l:%c: %tarning: %m",
|
"%f(%l,%c): %tarning %m",
|
||||||
-- "%f:%l:%c: %tote: %m",
|
"%f(%l,%c): %rror %m",
|
||||||
-- },
|
},
|
||||||
-- }
|
lintSource = "eslint",
|
||||||
--
|
}
|
||||||
-- local servers = {
|
|
||||||
-- efm = {
|
local shellcheck = {
|
||||||
-- filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact", "sh" },
|
lintCommand = "shellcheck -f gcc -x",
|
||||||
-- init_options = { documentFormatting = true },
|
lintSource = "shellcheck",
|
||||||
-- settings = {
|
lintFormats = {
|
||||||
-- rootMarkers = { ".git/" },
|
"%f:%l:%c: %trror: %m",
|
||||||
-- languages = {
|
"%f:%l:%c: %tarning: %m",
|
||||||
-- typescript = { eslint },
|
"%f:%l:%c: %tote: %m",
|
||||||
-- typescriptreact = { eslint },
|
},
|
||||||
-- javascript = { eslint },
|
}
|
||||||
-- javascriptreact = { eslint },
|
|
||||||
-- sh = { shellcheck },
|
local servers = {
|
||||||
-- },
|
efm = {
|
||||||
-- },
|
filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact", "sh" },
|
||||||
-- },
|
init_options = { documentFormatting = true },
|
||||||
-- rust_analyzer = {
|
settings = {
|
||||||
-- assist = {
|
rootMarkers = { ".git/" },
|
||||||
-- importGranularity = "module",
|
languages = {
|
||||||
-- importPrefix = "self",
|
typescript = { eslint },
|
||||||
-- },
|
typescriptreact = { eslint },
|
||||||
-- cargo = {
|
javascript = { eslint },
|
||||||
-- buildScripts = {
|
javascriptreact = { eslint },
|
||||||
-- enable = true,
|
sh = { shellcheck },
|
||||||
-- },
|
},
|
||||||
-- },
|
},
|
||||||
-- procMacro = {
|
},
|
||||||
-- enable = true,
|
gopls = {},
|
||||||
-- },
|
nixd = {
|
||||||
-- },
|
settings = {
|
||||||
-- gleam = {},
|
formatting = {
|
||||||
-- denols = {
|
command = { "nixfmt" },
|
||||||
-- root_dir = lspconfig.util.root_pattern("deno.json", "deno.jsonc"),
|
},
|
||||||
-- },
|
},
|
||||||
-- zls = {},
|
},
|
||||||
-- bashls = {},
|
rust_analyzer = {
|
||||||
-- }
|
assist = {
|
||||||
-- end
|
importGranularity = "module",
|
||||||
|
importPrefix = "self",
|
||||||
|
},
|
||||||
|
cargo = {
|
||||||
|
buildScripts = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
procMacro = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
lua_ls = {
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
runtime = {
|
||||||
|
version = "LuaJIT",
|
||||||
|
},
|
||||||
|
diagnostics = {
|
||||||
|
globals = { "vim" },
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
checkThirdParty = false,
|
||||||
|
library = vim.api.nvim_get_runtime_file("", true),
|
||||||
|
},
|
||||||
|
telemetry = {
|
||||||
|
enable = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
lexical = {
|
||||||
|
cmd = { "lexical" },
|
||||||
|
},
|
||||||
|
gleam = {},
|
||||||
|
ts_ls = {
|
||||||
|
root_dir = function(filename, _)
|
||||||
|
local deno = lspconfig.util.root_pattern("deno.json", "deno.jsonc")(filename)
|
||||||
|
if deno then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
return lspconfig.util.root_pattern("package.json")(filename)
|
||||||
|
end,
|
||||||
|
single_file_support = false,
|
||||||
|
},
|
||||||
|
svelte = {},
|
||||||
|
denols = {
|
||||||
|
root_dir = lspconfig.util.root_pattern("deno.json", "deno.jsonc"),
|
||||||
|
},
|
||||||
|
intelephense = {
|
||||||
|
init_options = { licenceKey = vim.fn.stdpath("config") .. "/intelephense-license" },
|
||||||
|
settings = {
|
||||||
|
intelephense = {
|
||||||
|
files = { maxSize = 1000000000 },
|
||||||
|
format = { enable = false },
|
||||||
|
stubs = require "intelephense_stubs",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
zls = {},
|
||||||
|
bashls = {},
|
||||||
|
}
|
||||||
|
for lsp, settings in pairs(servers) do
|
||||||
|
lspconfig[lsp].setup(vim.tbl_extend("force", { capabilities = capabilities }, settings))
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
|
callback = function(args)
|
||||||
|
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||||
|
|
||||||
|
if not client then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if client.server_capabilities.documentHighlightProvider then
|
||||||
|
vim.api.nvim_create_autocmd({ "CursorHold" }, {
|
||||||
|
callback = vim.lsp.buf.document_highlight,
|
||||||
|
buffer = args.buf,
|
||||||
|
})
|
||||||
|
vim.api.nvim_create_autocmd({ "CursorMoved" }, {
|
||||||
|
callback = vim.lsp.buf.clear_references,
|
||||||
|
buffer = args.buf,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
dependencies = { "folke/neodev.nvim", },
|
dependencies = { "folke/neodev.nvim", },
|
||||||
config = function()
|
config = config,
|
||||||
require("neodev").setup()
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"j-hui/fidget.nvim",
|
"j-hui/fidget.nvim",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue