nvim
This commit is contained in:
parent
8f51e9198d
commit
70167a557e
4 changed files with 22 additions and 38 deletions
18
flake.lock
18
flake.lock
|
@ -43,11 +43,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1715077503,
|
"lastModified": 1715930644,
|
||||||
"narHash": "sha256-AfHQshzLQfUqk/efMtdebHaQHqVntCMjhymQzVFLes0=",
|
"narHash": "sha256-W9pyM3/vePxrffHtzlJI6lDS3seANQ+Nqp+i58O46LI=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "6e277d9566de9976f47228dd8c580b97488734d4",
|
"rev": "e3ad5108f54177e6520535768ddbf1e6af54b59d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -63,11 +63,11 @@
|
||||||
"systems": "systems_2"
|
"systems": "systems_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714757169,
|
"lastModified": 1716258470,
|
||||||
"narHash": "sha256-bLCxY5hFpnDzXnxwqSkc0GfOvb9PX+dsHCE99T6dDEM=",
|
"narHash": "sha256-66C/T8xSpKE1W/FFpW43Gw5GfiSiM+vttTbM3SkJlBQ=",
|
||||||
"owner": "lexical-lsp",
|
"owner": "lexical-lsp",
|
||||||
"repo": "lexical",
|
"repo": "lexical",
|
||||||
"rev": "0234cbcb5a886ac74247bf326d1b9af6fae353cc",
|
"rev": "64ab159ff035346e66e4b7b26f52afb1120fc6a9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -109,11 +109,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1715037484,
|
"lastModified": 1716190602,
|
||||||
"narHash": "sha256-OUt8xQFmBU96Hmm4T9tOWTu4oCswCzoVl+pxSq/kiFc=",
|
"narHash": "sha256-xYRimrR0duWvokWQEvB87bSsICeCvvX9DxpUOzCfsDE=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "ad7efee13e0d216bf29992311536fce1d3eefbef",
|
"rev": "5a5ac83292c7842072318f57d68a48474f8bd34d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
2
home.nix
2
home.nix
|
@ -78,6 +78,8 @@
|
||||||
pkgs.gopls # Go lsp
|
pkgs.gopls # Go lsp
|
||||||
pkgs.lexical # Elixir lsp
|
pkgs.lexical # Elixir lsp
|
||||||
pkgs.nodePackages.intelephense # PHP lsp
|
pkgs.nodePackages.intelephense # PHP lsp
|
||||||
|
pkgs.nodePackages.typescript-language-server
|
||||||
|
pkgs.prettierd
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,6 @@
|
||||||
local lspconfig = require "lspconfig"
|
local lspconfig = require "lspconfig"
|
||||||
require "neodev".setup()
|
require "neodev".setup()
|
||||||
|
|
||||||
local root_dir
|
|
||||||
for dir in vim.fs.parents(vim.api.nvim_buf_get_name(0)) do
|
|
||||||
if vim.fn.isdirectory(dir .. "/.git") == 1 then
|
|
||||||
root_dir = dir
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "single" })
|
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "single" })
|
||||||
|
|
||||||
local capabilities = {}
|
local capabilities = {}
|
||||||
|
@ -20,7 +12,12 @@ end
|
||||||
|
|
||||||
local has_lsp_format, lsp_format = pcall(require, "lsp-format")
|
local has_lsp_format, lsp_format = pcall(require, "lsp-format")
|
||||||
if has_lsp_format then
|
if has_lsp_format then
|
||||||
lsp_format.setup()
|
lsp_format.setup {
|
||||||
|
typescript = { exclude = { "tsserver" } },
|
||||||
|
javascript = { exclude = { "tsserver" } },
|
||||||
|
typescriptreact = { exclude = { "tsserver" } },
|
||||||
|
javascriptreact = { exclude = { "tsserver" } },
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
local on_attach = function(client, bufnr)
|
local on_attach = function(client, bufnr)
|
||||||
|
@ -59,21 +56,12 @@ local on_attach = function(client, bufnr)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function prettier_command()
|
|
||||||
if not root_dir then
|
|
||||||
return "prettier"
|
|
||||||
end
|
|
||||||
|
|
||||||
if vim.fs.basename(root_dir .. "node_modules/prettier") then
|
|
||||||
return "npx prettier"
|
|
||||||
else
|
|
||||||
return "prettier"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local prettier = {
|
local prettier = {
|
||||||
formatCommand = prettier_command() .. [[ --stdin-filepath ${INPUT} ${--tab-width:tab_width}]],
|
formatCommand = 'prettierd "${INPUT}"',
|
||||||
formatStdin = true,
|
formatStdin = true,
|
||||||
|
-- env = {
|
||||||
|
-- string.format('PRETTIERD_DEFAULT_CONFIG=%s', vim.fn.expand('~/.config/nvim/utils/linter-config/.prettierrc.json')),
|
||||||
|
-- },
|
||||||
}
|
}
|
||||||
|
|
||||||
local eslint = {
|
local eslint = {
|
||||||
|
@ -160,12 +148,7 @@ local servers = {
|
||||||
cmd = { "lexical" },
|
cmd = { "lexical" },
|
||||||
},
|
},
|
||||||
gleam = {},
|
gleam = {},
|
||||||
tsserver = {
|
tsserver = {},
|
||||||
settings = {
|
|
||||||
documentFormatting = false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
-- psalm = {},
|
|
||||||
intelephense = {
|
intelephense = {
|
||||||
settings = {
|
settings = {
|
||||||
intelephense = {
|
intelephense = {
|
||||||
|
|
|
@ -41,7 +41,6 @@ return {
|
||||||
version = '*',
|
version = '*',
|
||||||
config = function()
|
config = function()
|
||||||
require "mini.statusline".setup()
|
require "mini.statusline".setup()
|
||||||
require "mini.comment".setup()
|
|
||||||
require "mini.bufremove".setup()
|
require "mini.bufremove".setup()
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue