nvim: Add lsp-format
This commit is contained in:
parent
cb2f901a41
commit
809e2418f8
5 changed files with 49 additions and 29 deletions
|
@ -1,7 +1,8 @@
|
|||
(let [mod {}
|
||||
cmd vim.cmd
|
||||
api vim.api
|
||||
keymap (require :nifoc.keymap)]
|
||||
keymap (require :nifoc.keymap)
|
||||
lsp-format (require :lsp-format)]
|
||||
(fn mod.setup []
|
||||
(vim.diagnostic.config {:underline true
|
||||
:virtual_text {:source false}
|
||||
|
@ -21,9 +22,6 @@
|
|||
(when (and client.resolved_capabilities.document_formatting
|
||||
(= vim.b.nifoc_fixer_enabled nil))
|
||||
(api.nvim_buf_set_var bufnr :nifoc_fixer_enabled 1)
|
||||
(api.nvim_create_autocmd :BufWritePre
|
||||
{:callback #(vim.lsp.buf.formatting_sync nil
|
||||
1000)
|
||||
:buffer bufnr})))
|
||||
(lsp-format.on_attach client bufnr)))
|
||||
|
||||
mod)
|
||||
|
|
18
flake.lock
18
flake.lock
|
@ -96,11 +96,11 @@
|
|||
},
|
||||
"locked": {
|
||||
"dir": "contrib",
|
||||
"lastModified": 1649120448,
|
||||
"narHash": "sha256-x9WDekkKfkclTlm1fHtc4x3RODJ/BK9tPhi/RwnATlU=",
|
||||
"lastModified": 1649217859,
|
||||
"narHash": "sha256-oNgBLLwSif+vuM9Sw2CAuI1OYv4aXOSOGtvhgt0jPpM=",
|
||||
"owner": "neovim",
|
||||
"repo": "neovim",
|
||||
"rev": "e135adcb8c4f32332ba87ea6681f41330b909e1c",
|
||||
"rev": "233014f92b5d4d5bf8a6f019241aafd1b05dd383",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -119,11 +119,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1649146867,
|
||||
"narHash": "sha256-S5SLLg5u0MTeogTmnB0QcXu10lkkl/erZ9oFGQwLFq8=",
|
||||
"lastModified": 1649233190,
|
||||
"narHash": "sha256-ix8vwMZb8ulPU2DyTWlgH9mmvarXUH/yTWoJ25NbPzo=",
|
||||
"owner": "nix-community",
|
||||
"repo": "neovim-nightly-overlay",
|
||||
"rev": "36e2791d468498789529c5bbd3d74948ed82f5c8",
|
||||
"rev": "ee895464be12a3e733b3de850c2e00ccb52fd38f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -186,11 +186,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1649118972,
|
||||
"narHash": "sha256-VCtGkNvjYd5uwy/tTprZGHSzWo8ZA9UcxHl28ImM2tM=",
|
||||
"lastModified": 1649205586,
|
||||
"narHash": "sha256-OsKblro6/j+Yasg0qNzduYXOQWgPWKqRjHVdSFH2p1M=",
|
||||
"owner": "arqv",
|
||||
"repo": "zig-overlay",
|
||||
"rev": "a7281505148bd2879e69f319145601c70dadc546",
|
||||
"rev": "054b19a87d5345f1bd367c643ef8a243a2a5b738",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -133,6 +133,15 @@ in
|
|||
|
||||
virtual-types-nvim
|
||||
|
||||
{
|
||||
plugin = lsp-format-nvim;
|
||||
config = ''
|
||||
(let [lsp-format (require :lsp-format)]
|
||||
(lsp-format.setup))
|
||||
'';
|
||||
type = "fennel";
|
||||
}
|
||||
|
||||
# cmp
|
||||
{
|
||||
plugin = nvim-cmp;
|
||||
|
|
|
@ -111,12 +111,12 @@
|
|||
};
|
||||
nvim-treesitter = pkgs.vimUtils.buildVimPluginFrom2Nix {
|
||||
pname = "nvim-treesitter";
|
||||
version = "1649143663";
|
||||
version = "1649228392";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "nvim-treesitter";
|
||||
repo = "nvim-treesitter";
|
||||
rev = "f083b7bbfe9480df00a45ab5a0978cb2586dddf2";
|
||||
sha256 = "SNGb25nlcR/zWnAv8Q+vLBMzaJpVPPdJ8txCkf+aD34=";
|
||||
rev = "99625b59b50f820adec52516b34bc6426f5ab614";
|
||||
sha256 = "8nDtP4x2aVdzW2jNiN9z2/ZI56+NA2l6IhdGmOnl+dA=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
meta.homepage = "https://github.com/nvim-treesitter/nvim-treesitter";
|
||||
|
@ -190,24 +190,24 @@
|
|||
};
|
||||
nvim-lspconfig = pkgs.vimUtils.buildVimPluginFrom2Nix {
|
||||
pname = "nvim-lspconfig";
|
||||
version = "1648480371";
|
||||
version = "1649188800";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "neovim";
|
||||
repo = "nvim-lspconfig";
|
||||
rev = "3d1baa811b351078e5711be1a1158e33b074be9e";
|
||||
sha256 = "If8vjLISzCC6qo7iorhgrX5fC6Q/p+a8qvUbrvaA4BA=";
|
||||
rev = "f183d35725264d6184146eebcef1ba8338ddbc83";
|
||||
sha256 = "nWjg/aw4UvTjeVtXRyBCVnN74ZRhYh//UM5qlmM9rhw=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
meta.homepage = "https://github.com/neovim/nvim-lspconfig";
|
||||
};
|
||||
null-ls-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix {
|
||||
pname = "null-ls.nvim";
|
||||
version = "1649122832";
|
||||
version = "1649223024";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "jose-elias-alvarez";
|
||||
repo = "null-ls.nvim";
|
||||
rev = "f3107c3b211d62f53d34cbf0ca100fc948bc42d4";
|
||||
sha256 = "QpQqE7RrxhWpcY2HTyyoD9BkbQObS/nwV8khkSErpR8=";
|
||||
rev = "8a401e19c0c2b2569e820b3cc0a3398100d7d6fb";
|
||||
sha256 = "zQmuIi1Yu3cXLFL5Zvl1Km7Do1aT21RbXieGIOEI3Sw=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
meta.homepage = "https://github.com/jose-elias-alvarez/null-ls.nvim";
|
||||
|
@ -224,14 +224,26 @@
|
|||
};
|
||||
meta.homepage = "https://github.com/jubnzv/virtual-types.nvim";
|
||||
};
|
||||
lsp-format-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix {
|
||||
pname = "lsp-format.nvim";
|
||||
version = "1646880894";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "lukas-reineke";
|
||||
repo = "lsp-format.nvim";
|
||||
rev = "84e117b99bb2bc0d0c8122e2b256046f046f8aff";
|
||||
sha256 = "rs3NTZwWdsmBGXnrgUeVxUiNjbN/ULxJHifPYJD9mT4=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
meta.homepage = "https://github.com/lukas-reineke/lsp-format.nvim";
|
||||
};
|
||||
nvim-cmp = pkgs.vimUtils.buildVimPluginFrom2Nix {
|
||||
pname = "nvim-cmp";
|
||||
version = "1648830769";
|
||||
version = "1649208788";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "hrsh7th";
|
||||
repo = "nvim-cmp";
|
||||
rev = "7dbe34e36d9de4912a5f3aa5279540445765814c";
|
||||
sha256 = "7qsLuko9Jeipqv30y2brTFjzFnZSXaMSHShgY08Nv2w=";
|
||||
rev = "27970d8a1c99cd6ddea2709beda52d8e9336228b";
|
||||
sha256 = "Yvw5GXNrxFl8YNILNyAirqbTWxxEjgVbkeU7L5WodbY=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
meta.homepage = "https://github.com/hrsh7th/nvim-cmp";
|
||||
|
@ -490,12 +502,12 @@
|
|||
};
|
||||
nvim-notify = pkgs.vimUtils.buildVimPluginFrom2Nix {
|
||||
pname = "nvim-notify";
|
||||
version = "1647766037";
|
||||
version = "1649231629";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "rcarriga";
|
||||
repo = "nvim-notify";
|
||||
rev = "da1030208347ad8937fdad1d4f8092b578e3ea2f";
|
||||
sha256 = "Csbe54tl808Fa8SRdJzzYIgEoYqKtuqPc8yCE0xl2Vc=";
|
||||
rev = "5cfbdb27af2bb9b3e27bd5c9176e78f34be87682";
|
||||
sha256 = "VAW0w0pLwvvHHopiGhhIlMSstKhZqnrzvUzQFcDIK5A=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
meta.homepage = "https://github.com/rcarriga/nvim-notify";
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
- src: neovim/nvim-lspconfig
|
||||
- src: jose-elias-alvarez/null-ls.nvim
|
||||
- src: jubnzv/virtual-types.nvim
|
||||
- src: lukas-reineke/lsp-format.nvim
|
||||
|
||||
# cmp
|
||||
- src: hrsh7th/nvim-cmp
|
||||
|
|
Loading…
Reference in a new issue