nvim updates
This commit is contained in:
parent
d54752bb2d
commit
6255373ab2
3 changed files with 92 additions and 127 deletions
|
@ -1,6 +1,16 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
with lib;
|
||||
let cfg = config.programs.v.nvim;
|
||||
let
|
||||
cfg = config.programs.v.nvim;
|
||||
cmp-vimtex = pkgs.vimUtils.buildVimPlugin {
|
||||
name = "cmp-vimtex";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "micangl";
|
||||
repo = "cmp-vimtex";
|
||||
rev = "2b5089a79b29418e6afcdc7804d2b9f2f002946b";
|
||||
hash = "sha256-IcXjCNXfiV8WMP4S41uy3C9OsKUi3zJnvg5MJVu3Khw=";
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.programs.v.nvim = { enable = mkEnableOption "nvim"; };
|
||||
config = mkIf cfg.enable {
|
||||
|
@ -8,11 +18,14 @@ in {
|
|||
enable = true;
|
||||
package = pkgs.neovim-unwrapped;
|
||||
vimAlias = true;
|
||||
luaLoader.enable = true;
|
||||
|
||||
globals.mapleader = " ";
|
||||
|
||||
options.number = true;
|
||||
|
||||
clipboard = { providers.wl-copy.enable = true; };
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
|
@ -32,6 +45,16 @@ in {
|
|||
action = "require('Comment.api').toggle.linewise.current";
|
||||
lua = true;
|
||||
}
|
||||
{
|
||||
mode = "x";
|
||||
key = "<C-_>";
|
||||
action = ''
|
||||
function()
|
||||
require('Comment.api').toggle.linewise(vim.fn.visualmode())
|
||||
end
|
||||
'';
|
||||
lua = true;
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "g=";
|
||||
|
@ -40,32 +63,31 @@ in {
|
|||
}
|
||||
];
|
||||
|
||||
# keymaps = [
|
||||
# {
|
||||
# key = "<leader>ff";
|
||||
# mode = "n";
|
||||
# lua = true;
|
||||
# action = "require('telescope.builtin').find_files()";
|
||||
# }
|
||||
# {
|
||||
# key = "<leader>fg";
|
||||
# mode = "n";
|
||||
# lua = true;
|
||||
# action = "require('Comment.api').toggle.linewise.current()<cr>";
|
||||
# }
|
||||
# {
|
||||
# key = "g=";
|
||||
# mode = "n";
|
||||
# lua = true;
|
||||
# action = "vim.lsp.buf.format{async=true}<cr>";
|
||||
# }
|
||||
# ];
|
||||
extraPlugins = with pkgs.vimPlugins; [
|
||||
FixCursorHold-nvim
|
||||
cmp-vimtex
|
||||
luasnip
|
||||
plenary-nvim
|
||||
neotest
|
||||
neotest-plenary
|
||||
neotest-rust
|
||||
];
|
||||
|
||||
extraPlugins = with pkgs.vimPlugins; [ catppuccin-nvim luasnip ];
|
||||
colorschemes.catppuccin = {
|
||||
enable = true;
|
||||
flavour = "frappe";
|
||||
};
|
||||
|
||||
colorscheme = "catppuccin-frappe";
|
||||
|
||||
extraConfigLua = "";
|
||||
extraConfigLua = ''
|
||||
require("neotest").setup({
|
||||
adapters = {
|
||||
require("neotest-plenary"),
|
||||
require("neotest-rust") {
|
||||
args = { "--no-capture" },
|
||||
}
|
||||
},
|
||||
})
|
||||
'';
|
||||
|
||||
plugins = {
|
||||
bufferline.enable = true;
|
||||
|
@ -86,7 +108,7 @@ in {
|
|||
treesitter = {
|
||||
enable = true;
|
||||
nixGrammars = true;
|
||||
# ensureInstalled = [ ];
|
||||
disabledLanguages = [ "latex" ];
|
||||
};
|
||||
surround.enable = true;
|
||||
fugitive.enable = true;
|
||||
|
@ -105,7 +127,10 @@ in {
|
|||
enable = true;
|
||||
servers = {
|
||||
nil_ls.enable = true;
|
||||
rust-analyzer.enable = true;
|
||||
rust-analyzer = {
|
||||
installCargo = false;
|
||||
installRustc = false;
|
||||
};
|
||||
pyright.enable = true;
|
||||
elixirls.enable = true;
|
||||
clangd.enable = true;
|
||||
|
@ -114,12 +139,18 @@ in {
|
|||
};
|
||||
trouble.enable = true;
|
||||
lspkind.enable = true;
|
||||
|
||||
vimtex.enable = true;
|
||||
|
||||
nvim-cmp = {
|
||||
enable = true;
|
||||
autoEnableSources = true;
|
||||
sources = [
|
||||
{ name = "nvim_lsp"; }
|
||||
{ name = "cmp-latex-symbols"; }
|
||||
{
|
||||
name = "vimtex";
|
||||
}
|
||||
# { name = "cmp-latex-symbols"; }
|
||||
{
|
||||
name = "luasnip";
|
||||
option = { show_autosnippets = true; };
|
||||
|
|
|
@ -5,7 +5,7 @@ in {
|
|||
options.programs.v.rust = { enable = mkEnableOption "rust"; };
|
||||
config = mkIf cfg.enable {
|
||||
home = {
|
||||
packages = with pkgs; [ rustup ];
|
||||
packages = with pkgs; [ rustup cargo-nextest cargo-msrv ];
|
||||
|
||||
file = {
|
||||
".cargo/config.toml".text = ''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue