Add lsp-trouble

This commit is contained in:
buffet 2022-08-16 19:14:35 +00:00
parent 6c7084ddd2
commit 2ca3a34489
3 changed files with 111 additions and 79 deletions

View file

@ -36,6 +36,22 @@
"type": "github" "type": "github"
} }
}, },
"lsp-trouble": {
"flake": false,
"locked": {
"lastModified": 1620090273,
"narHash": "sha256-Vrv9xWGANqruKwtWlb5jr/4i5bsM8mZiyG6FPENhi9w=",
"owner": "simrat39",
"repo": "lsp-trouble.nvim",
"rev": "315bda04bc48a6d28fc4417b69ec60458d354e7a",
"type": "github"
},
"original": {
"owner": "simrat39",
"repo": "lsp-trouble.nvim",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1660496378, "lastModified": 1660496378,
@ -56,6 +72,7 @@
"inputs": { "inputs": {
"home-manager": "home-manager", "home-manager": "home-manager",
"impermanence": "impermanence", "impermanence": "impermanence",
"lsp-trouble": "lsp-trouble",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
} }

View file

@ -1,11 +1,17 @@
{ {
inputs = { inputs = {
impermanence.url = "github:nix-community/impermanence";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05";
home-manager = { home-manager = {
url = "github:nix-community/home-manager/release-22.05"; url = "github:nix-community/home-manager/release-22.05";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
impermanence.url = "github:nix-community/impermanence";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05"; lsp-trouble = {
url = "github:simrat39/lsp-trouble.nvim";
flake = false;
};
}; };
outputs = {nixpkgs, ...} @ args: { outputs = {nixpkgs, ...} @ args: {

View file

@ -2,7 +2,7 @@
lib, lib,
pkgs, pkgs,
... ...
}: { } @ inputs: {
home-manager.users.buffet = { home-manager.users.buffet = {
home.sessionVariables = { home.sessionVariables = {
EDITOR = "nvim"; EDITOR = "nvim";
@ -13,89 +13,98 @@
# TODO: options # TODO: options
programs.neovim = { programs.neovim = {
enable = true; enable = true;
plugins = with pkgs.vimPlugins; [ plugins = let
# TODO: vimplugin lsp-trouble buildPlugin = name:
# TODO: vimplugin nvim-lspconfig pkgs.vimUtils.buildNeovimPluginFrom2Nix {
{plugin = editorconfig-nvim;} inherit name;
{plugin = fugitive;} src = inputs."${name}";
{plugin = nvim-autopairs;} };
{plugin = rust-vim;} buildPlugins = names: lib.attrsets.genAttrs names buildPlugin;
{plugin = tabular;} plugins = buildPlugins ["lsp-trouble"];
{plugin = vim-nix;} in
{plugin = vim-repeat;} with pkgs.vimPlugins;
{plugin = vimwiki;} with plugins; [
{plugin = editorconfig-nvim;}
{plugin = fugitive;}
{plugin = lsp-trouble;}
{plugin = nvim-autopairs;}
{plugin = rust-vim;}
{plugin = tabular;}
{plugin = vim-nix;}
{plugin = vim-repeat;}
{plugin = vimwiki;}
{ {
plugin = gitsigns-nvim; plugin = gitsigns-nvim;
config = "lua require 'gitsigns'.setup()"; config = "lua require 'gitsigns'.setup()";
} }
# TODO: replace with own bar # TODO: replace with own bar
{ {
plugin = lightline-vim; plugin = lightline-vim;
config = "let g:lightline = { 'colorscheme': 'solarized' }"; config = "let g:lightline = { 'colorscheme': 'solarized' }";
} }
{ {
plugin = lspsaga-nvim; plugin = lspsaga-nvim;
# TODO: lspsaga config # TODO: lspsaga config
} }
{ {
plugin = NeoSolarized; plugin = NeoSolarized;
config = '' config = ''
set background=light set background=light
colorscheme NeoSolarized colorscheme NeoSolarized
''; '';
} }
{ {
plugin = nvim-lspconfig; plugin = nvim-lspconfig;
# TODO: lspconfig config # TODO: lspconfig config
} }
{ {
plugin = telescope-nvim; plugin = telescope-nvim;
# TODO: telescope-nvim config # TODO: telescope-nvim config
} }
{ {
plugin = nvim-treesitter.withPlugins (plugins: plugin = nvim-treesitter.withPlugins (plugins:
with plugins; [ with plugins; [
tree-sitter-bash tree-sitter-bash
tree-sitter-bibtex tree-sitter-bibtex
tree-sitter-c tree-sitter-c
tree-sitter-cmake tree-sitter-cmake
tree-sitter-comment tree-sitter-comment
tree-sitter-cpp tree-sitter-cpp
tree-sitter-css tree-sitter-css
tree-sitter-devicetree tree-sitter-devicetree
tree-sitter-dockerfile tree-sitter-dockerfile
tree-sitter-fennel tree-sitter-fennel
tree-sitter-go tree-sitter-go
tree-sitter-javascript tree-sitter-javascript
tree-sitter-json tree-sitter-json
tree-sitter-latex tree-sitter-latex
tree-sitter-lua tree-sitter-lua
tree-sitter-make tree-sitter-make
tree-sitter-markdown tree-sitter-markdown
tree-sitter-nix tree-sitter-nix
tree-sitter-perl tree-sitter-perl
tree-sitter-python tree-sitter-python
tree-sitter-regex tree-sitter-regex
tree-sitter-rust tree-sitter-rust
tree-sitter-toml tree-sitter-toml
]); ]);
config = lib.concatStrings (lib.splitString "\n" '' config = lib.concatStrings (lib.splitString "\n" ''
lua require 'nvim-treesitter.configs'.setup { lua require 'nvim-treesitter.configs'.setup {
highlight = { highlight = {
enable = true, enable = true,
additional_vim_regex_highlighting = false, additional_vim_regex_highlighting = false,
}, },
} }
''); '');
} }
]; ];
}; };
}; };
} }