got lsps up and running.
This commit is contained in:
		
							parent
							
								
									25b2b07a46
								
							
						
					
					
						commit
						cef27f07ce
					
				
					 6 changed files with 223 additions and 24 deletions
				
			
		| 
						 | 
				
			
			@ -5,7 +5,7 @@
 | 
			
		|||
}: {
 | 
			
		||||
  programs.nixvim = {
 | 
			
		||||
    plugins.luasnip.enable = true;
 | 
			
		||||
    plugins.friendly-snippets.enable=true;
 | 
			
		||||
    plugins.friendly-snippets.enable = true;
 | 
			
		||||
    plugins.cmp = {
 | 
			
		||||
      enable = true;
 | 
			
		||||
      autoEnableSources = true;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,6 +7,9 @@
 | 
			
		|||
    plugins.gitsigns = {
 | 
			
		||||
      enable = true;
 | 
			
		||||
    };
 | 
			
		||||
    plugins.which-key.registrations = {
 | 
			
		||||
      "<leader>g" = "+git";
 | 
			
		||||
    };
 | 
			
		||||
    keymaps = [
 | 
			
		||||
      {
 | 
			
		||||
        action = ":Gitsigns toggle_current_line_blame<CR>";
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,7 +7,9 @@
 | 
			
		|||
    globals = {
 | 
			
		||||
      mapleader = ";";
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    plugins.which-key.registrations = {
 | 
			
		||||
      "<leader>c" = "+check";
 | 
			
		||||
    };
 | 
			
		||||
    keymaps = [
 | 
			
		||||
      {
 | 
			
		||||
        action = ":setlocal spell!<CR>";
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,8 +4,191 @@
 | 
			
		|||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  programs.nixvim = {
 | 
			
		||||
    plugins.lsp={
 | 
			
		||||
      enable=true;
 | 
			
		||||
      servers={
 | 
			
		||||
        bashls.enable=true;
 | 
			
		||||
        clangd.enable=true;
 | 
			
		||||
        lua-ls.enable=true;
 | 
			
		||||
        nil_ls.enable=true;
 | 
			
		||||
        nushell.enable=true;
 | 
			
		||||
        pyright.enable=true;
 | 
			
		||||
        ruff-lsp.enable=true;
 | 
			
		||||
        rust-analyzer={
 | 
			
		||||
          enable=true;
 | 
			
		||||
          installCargo=true;
 | 
			
		||||
          installRustc=true;
 | 
			
		||||
        };
 | 
			
		||||
        texlab.enable=true;
 | 
			
		||||
        typst-lsp.enable=true;
 | 
			
		||||
        taplo.enable=true;
 | 
			
		||||
        yamlls.enable=true;
 | 
			
		||||
        marksman.enable=true;
 | 
			
		||||
        jsonls.enable=true;
 | 
			
		||||
        hls.enable=true;
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
    plugins.cmp.settings.sources=[
 | 
			
		||||
      {name="nvim_lsp";}
 | 
			
		||||
    ];
 | 
			
		||||
    plugins.which-key.registrations = {
 | 
			
		||||
      "<leader>l" = "+lsp";
 | 
			
		||||
    };
 | 
			
		||||
    keymaps = [
 | 
			
		||||
      {
 | 
			
		||||
        action = "vim.lsp.buf.declaration";
 | 
			
		||||
        key = "<leader>lc";
 | 
			
		||||
        lua = true;
 | 
			
		||||
        mode = "n";
 | 
			
		||||
        options = {
 | 
			
		||||
          silent = true;
 | 
			
		||||
          desc = "declaration";
 | 
			
		||||
        };
 | 
			
		||||
      }
 | 
			
		||||
      {
 | 
			
		||||
        action = "vim.lsp.buf.definition";
 | 
			
		||||
        key = "<leader>ld";
 | 
			
		||||
        lua = true;
 | 
			
		||||
        mode = "n";
 | 
			
		||||
        options = {
 | 
			
		||||
          silent = true;
 | 
			
		||||
          desc = "definition";
 | 
			
		||||
        };
 | 
			
		||||
      }
 | 
			
		||||
      {
 | 
			
		||||
        action = "vim.lsp.buf.hover";
 | 
			
		||||
        key = "<leader>lh";
 | 
			
		||||
        lua = true;
 | 
			
		||||
        mode = "n";
 | 
			
		||||
        options = {
 | 
			
		||||
          silent = true;
 | 
			
		||||
          desc = "hover";
 | 
			
		||||
        };
 | 
			
		||||
      }
 | 
			
		||||
      {
 | 
			
		||||
        action = "vim.lsp.buf.implementation";
 | 
			
		||||
        key = "<leader>li";
 | 
			
		||||
        lua = true;
 | 
			
		||||
        mode = "n";
 | 
			
		||||
        options = {
 | 
			
		||||
          silent = true;
 | 
			
		||||
          desc = "implementation";
 | 
			
		||||
        };
 | 
			
		||||
      }
 | 
			
		||||
      {
 | 
			
		||||
        action = "vim.lsp.buf.signature_help";
 | 
			
		||||
        key = "<leader>ls";
 | 
			
		||||
        lua = true;
 | 
			
		||||
        mode = "n";
 | 
			
		||||
        options = {
 | 
			
		||||
          silent = true;
 | 
			
		||||
          desc = "signature_help";
 | 
			
		||||
        };
 | 
			
		||||
      }
 | 
			
		||||
      {
 | 
			
		||||
        action = "vim.lsp.buf.add_workspace_folder";
 | 
			
		||||
        key = "<leader>lwa";
 | 
			
		||||
        lua = true;
 | 
			
		||||
        mode = "n";
 | 
			
		||||
        options = {
 | 
			
		||||
          silent = true;
 | 
			
		||||
          desc = "add folder";
 | 
			
		||||
        };
 | 
			
		||||
      }
 | 
			
		||||
      {
 | 
			
		||||
        action = "vim.lsp.buf.remove_workspace_folder";
 | 
			
		||||
        key = "<leader>lwr";
 | 
			
		||||
        lua = true;
 | 
			
		||||
        mode = "n";
 | 
			
		||||
        options = {
 | 
			
		||||
          silent = true;
 | 
			
		||||
          desc = "remove folder";
 | 
			
		||||
        };
 | 
			
		||||
      }
 | 
			
		||||
      {
 | 
			
		||||
        action = "vim.lsp.buf.list_workspace_folders";
 | 
			
		||||
        key = "<leader>lw";
 | 
			
		||||
        lua = true;
 | 
			
		||||
        mode = "n";
 | 
			
		||||
        options = {
 | 
			
		||||
          silent = true;
 | 
			
		||||
          desc = "workspace";
 | 
			
		||||
        };
 | 
			
		||||
      }
 | 
			
		||||
      {
 | 
			
		||||
        action = "vim.lsp.buf.rename";
 | 
			
		||||
        key = "<leader>lr";
 | 
			
		||||
        lua = true;
 | 
			
		||||
        mode = "n";
 | 
			
		||||
        options = {
 | 
			
		||||
          silent = true;
 | 
			
		||||
          desc = "rename";
 | 
			
		||||
        };
 | 
			
		||||
      }
 | 
			
		||||
      {
 | 
			
		||||
        action = "vim.lsp.buf.code_action";
 | 
			
		||||
        key = "<leader>la";
 | 
			
		||||
        lua = true;
 | 
			
		||||
        mode = "n";
 | 
			
		||||
        options = {
 | 
			
		||||
          silent = true;
 | 
			
		||||
          desc = "code action";
 | 
			
		||||
        };
 | 
			
		||||
      }
 | 
			
		||||
      {
 | 
			
		||||
        action = "vim.lsp.buf.references";
 | 
			
		||||
        key = "<leader>le";
 | 
			
		||||
        lua = true;
 | 
			
		||||
        mode = "n";
 | 
			
		||||
        options = {
 | 
			
		||||
          silent = true;
 | 
			
		||||
          desc = "list references";
 | 
			
		||||
        };
 | 
			
		||||
      }
 | 
			
		||||
      {
 | 
			
		||||
        action = "function() vim.lsp.buf.format{async=true} end";
 | 
			
		||||
        key = "<leader>lm";
 | 
			
		||||
        lua = true;
 | 
			
		||||
        mode = "n";
 | 
			
		||||
        options = {
 | 
			
		||||
          silent = true;
 | 
			
		||||
          desc = "format buffer";
 | 
			
		||||
        };
 | 
			
		||||
      }
 | 
			
		||||
      {
 | 
			
		||||
        action = "vim.diagnostic.open_float";
 | 
			
		||||
        key = "<leader>lo";
 | 
			
		||||
        lua = true;
 | 
			
		||||
        mode = "n";
 | 
			
		||||
        options = {
 | 
			
		||||
          silent = true;
 | 
			
		||||
          desc = "open float";
 | 
			
		||||
        };
 | 
			
		||||
      }
 | 
			
		||||
      {
 | 
			
		||||
        action = "vim.diagnostic.goto_next";
 | 
			
		||||
        key = "]d";
 | 
			
		||||
        lua = true;
 | 
			
		||||
        mode = "n";
 | 
			
		||||
        options = {
 | 
			
		||||
          silent = true;
 | 
			
		||||
          desc = "next diagnostic";
 | 
			
		||||
        };
 | 
			
		||||
      }
 | 
			
		||||
      {
 | 
			
		||||
        action = "vim.diagnostic.goto_prev";
 | 
			
		||||
        key = "[d";
 | 
			
		||||
        lua = true;
 | 
			
		||||
        mode = "n";
 | 
			
		||||
        options = {
 | 
			
		||||
          silent = true;
 | 
			
		||||
          desc = "prev diagnostic";
 | 
			
		||||
        };
 | 
			
		||||
      }
 | 
			
		||||
    ];
 | 
			
		||||
  };
 | 
			
		||||
  imports = [
 | 
			
		||||
    # ./outline.nix
 | 
			
		||||
    ./outline.nix
 | 
			
		||||
    ./rust-tools.nix
 | 
			
		||||
  ];
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										11
									
								
								nix/nvim/lsp/rust-tools.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								nix/nvim/lsp/rust-tools.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,11 @@
 | 
			
		|||
{
 | 
			
		||||
  configs,
 | 
			
		||||
  pkgs,
 | 
			
		||||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  programs.nixvim = {
 | 
			
		||||
    plugins.rust-tools = {
 | 
			
		||||
      enable = true;
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue