Compare commits
12 Commits
add_overla
...
e3c064d3a9
| Author | SHA1 | Date | |
|---|---|---|---|
|
e3c064d3a9
|
|||
|
8754d5b79d
|
|||
|
ba6b926cc4
|
|||
|
201161972e
|
|||
|
2b10f5cb32
|
|||
|
c055bd2a2f
|
|||
|
f042e08ecd
|
|||
|
13bed01615
|
|||
|
3f9559992a
|
|||
|
9332c56c01
|
|||
|
a9bc0c8a7a
|
|||
|
5bba266c6e
|
6
flake.lock
generated
6
flake.lock
generated
@@ -2,11 +2,11 @@
|
|||||||
"nodes": {
|
"nodes": {
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1698266953,
|
"lastModified": 1718606988,
|
||||||
"narHash": "sha256-jf72t7pC8+8h8fUslUYbWTX5rKsRwOzRMX8jJsGqDXA=",
|
"narHash": "sha256-pmjP5ePc1jz+Okona3HxD7AYT0wbrCwm9bXAlj08nDM=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "75a52265bda7fd25e06e3a67dee3f0354e73243c",
|
"rev": "38d3352a65ac9d621b0cd3074d3bef27199ff78f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
46
flake.nix
46
flake.nix
@@ -12,31 +12,35 @@
|
|||||||
supportedSystems = ["x86_64-linux" "aarch64-linux"];
|
supportedSystems = ["x86_64-linux" "aarch64-linux"];
|
||||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||||
nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;});
|
nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;});
|
||||||
additionalDeps = pkgs: [
|
|
||||||
pkgs.alejandra
|
|
||||||
pkgs.ccls
|
|
||||||
pkgs.gopls
|
|
||||||
pkgs.luaformatter
|
|
||||||
pkgs.nixd
|
|
||||||
pkgs.pyright
|
|
||||||
pkgs.rust-analyzer
|
|
||||||
pkgs.sumneko-lua-language-server
|
|
||||||
pkgs.svls
|
|
||||||
pkgs.texlab
|
|
||||||
pkgs.tree-sitter
|
|
||||||
pkgs.verible
|
|
||||||
pkgs.zls
|
|
||||||
];
|
|
||||||
in {
|
in {
|
||||||
packages = forAllSystems (system: let
|
packages = forAllSystems (system: let
|
||||||
pkgs = nixpkgsFor.${system};
|
pkgs = nixpkgsFor.${system};
|
||||||
|
neovim = import ./nvim-lsp.nix {inherit pkgs;};
|
||||||
in {
|
in {
|
||||||
nvim = import ./nvim-lsp.nix {inherit pkgs;};
|
nvim = pkgs.symlinkJoin {
|
||||||
|
name = "nvim";
|
||||||
|
paths = with pkgs;
|
||||||
|
[
|
||||||
|
alejandra
|
||||||
|
ccls
|
||||||
|
gopls
|
||||||
|
luaformatter
|
||||||
|
nixd
|
||||||
|
pyright
|
||||||
|
rust-analyzer
|
||||||
|
sumneko-lua-language-server
|
||||||
|
svls
|
||||||
|
texlab
|
||||||
|
tree-sitter
|
||||||
|
verible
|
||||||
|
zls
|
||||||
|
]
|
||||||
|
++ [neovim];
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
devShells = forAllSystems (system: let
|
devShells = forAllSystems (system: let
|
||||||
pkgs = nixpkgsFor.${system};
|
pkgs = nixpkgsFor.${system};
|
||||||
vim = self.packages.${system};
|
|
||||||
in {
|
in {
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
@@ -44,7 +48,7 @@
|
|||||||
pkgs.ccls
|
pkgs.ccls
|
||||||
pkgs.gopls
|
pkgs.gopls
|
||||||
pkgs.luaformatter
|
pkgs.luaformatter
|
||||||
pkgs.nixd
|
pkgs.nixd
|
||||||
pkgs.pyright
|
pkgs.pyright
|
||||||
pkgs.rust-analyzer
|
pkgs.rust-analyzer
|
||||||
pkgs.sumneko-lua-language-server
|
pkgs.sumneko-lua-language-server
|
||||||
@@ -53,7 +57,7 @@
|
|||||||
pkgs.tree-sitter
|
pkgs.tree-sitter
|
||||||
pkgs.verible
|
pkgs.verible
|
||||||
pkgs.zls
|
pkgs.zls
|
||||||
vim
|
(import ./nvim-lsp.nix {inherit pkgs;})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@@ -62,11 +66,9 @@
|
|||||||
pkgs = nixpkgsFor.${system};
|
pkgs = nixpkgsFor.${system};
|
||||||
in {
|
in {
|
||||||
overlay = final: prev: {
|
overlay = final: prev: {
|
||||||
inherit (self.packages.${system}) nvim;
|
nvim = self.packages.${system}.nvim;
|
||||||
inherit additionalDeps;
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
defaultPackage = forAllSystems (system: self.packages.${system}.nvim);
|
defaultPackage = forAllSystems (system: self.packages.${system}.nvim);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
17
nvim-lsp.nix
17
nvim-lsp.nix
@@ -1,4 +1,4 @@
|
|||||||
{pkgs ? import <nixpkgs> {}}: let
|
{pkgs}: let
|
||||||
neovim = pkgs.neovim.override {
|
neovim = pkgs.neovim.override {
|
||||||
configure = {
|
configure = {
|
||||||
customRC = ''
|
customRC = ''
|
||||||
@@ -45,21 +45,6 @@
|
|||||||
vim-snippets
|
vim-snippets
|
||||||
zig-vim
|
zig-vim
|
||||||
];
|
];
|
||||||
nativeBuildInputs = [
|
|
||||||
pkgs.alejandra
|
|
||||||
pkgs.ccls
|
|
||||||
pkgs.gopls
|
|
||||||
pkgs.luaformatter
|
|
||||||
pkgs.nixd
|
|
||||||
pkgs.pyright
|
|
||||||
pkgs.rust-analyzer
|
|
||||||
pkgs.sumneko-lua-language-server
|
|
||||||
pkgs.svls
|
|
||||||
pkgs.texlab
|
|
||||||
pkgs.tree-sitter
|
|
||||||
pkgs.verible
|
|
||||||
pkgs.zls
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
16
vimrc.lua
16
vimrc.lua
@@ -32,11 +32,9 @@ require 'nvim-treesitter.configs'.setup {
|
|||||||
indent = { enable = false, disable = {} },
|
indent = { enable = false, disable = {} },
|
||||||
rainbow = {
|
rainbow = {
|
||||||
enable = true,
|
enable = true,
|
||||||
extended_mode = true, -- Highlight also non-parentheses delimiters, boolean or table: lang -> boolean
|
extended_mode = true,
|
||||||
max_file_lines = 1000, -- Do not enable for files with more than 1000 lines, int
|
max_file_lines = 1000,
|
||||||
colors = {
|
colors = { '#ff0000', '#0051a0' ,'#ffa500', '#ffff00', '#008000', '#8003f2' }
|
||||||
'#ff0000', '#ffa500', '#ffff00', '#008000', '#0051a0', '#8003f2'
|
|
||||||
} -- table of hex strings
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,18 +105,18 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.diagnostic.config({ virtual_text = false}) -- Turn off inline diagnostics
|
vim.diagnostic.config({ virtual_text = false }) -- Turn off inline diagnostics
|
||||||
|
|
||||||
-- Show all diagnostics on current line in floating window
|
-- Show all diagnostics on current line in floating window
|
||||||
vim.api.nvim_set_keymap( 'n', '<Leader>d', ':lua vim.diagnostic.open_float()<CR>', opts)
|
vim.api.nvim_set_keymap('n', '<Leader>d', ':lua vim.diagnostic.open_float()<CR>', opts)
|
||||||
|
|
||||||
-- Go to next diagnostic (if there are multiple on the same line, only shows
|
-- Go to next diagnostic (if there are multiple on the same line, only shows
|
||||||
-- one at a time in the floating window)
|
-- one at a time in the floating window)
|
||||||
vim.api.nvim_set_keymap( 'n', '<Leader>n', ':lua vim.diagnostic.goto_next()<CR>', opts)
|
vim.api.nvim_set_keymap('n', '<Leader>n', ':lua vim.diagnostic.goto_next()<CR>', opts)
|
||||||
|
|
||||||
-- Go to prev diagnostic (if there are multiple on the same line, only shows
|
-- Go to prev diagnostic (if there are multiple on the same line, only shows
|
||||||
-- one at a time in the floating window)
|
-- one at a time in the floating window)
|
||||||
vim.api.nvim_set_keymap( 'n', '<Leader>p', ':lua vim.diagnostic.goto_prev()<CR>', opts)
|
vim.api.nvim_set_keymap('n', '<Leader>p', ':lua vim.diagnostic.goto_prev()<CR>', opts)
|
||||||
|
|
||||||
-- Use a loop to conveniently call 'setup' on multiple servers and
|
-- Use a loop to conveniently call 'setup' on multiple servers and
|
||||||
-- map buffer local keybindings when the language server attaches
|
-- map buffer local keybindings when the language server attaches
|
||||||
|
|||||||
Reference in New Issue
Block a user