nvim: initial config

This commit is contained in:
2024-04-20 19:07:07 +02:00
parent a667691f49
commit 1f7f453fc3
9 changed files with 114 additions and 5 deletions

View File

@@ -0,0 +1,5 @@
{
plugins.bufferline = {
enable = true;
};
}

View File

@@ -0,0 +1,16 @@
{ nvim, ... }:
{
# Import all your configuration modules here
programs.nixvim = {
enable = true;
colorschemes.gruvbox.enable = true;
imports = [
./bufferline.nix
./plugins.nix
./options.nix
./keymaps.nix
./highlight.nix
];
};
}

View File

@@ -0,0 +1,8 @@
{
highlight = {
Comment.fg = "#ff00ff";
Comment.bg = "#000000";
Comment.underline = true;
Comment.bold = true;
};
}

View File

@@ -0,0 +1,8 @@
{
keymaps = [
{
action = "<cmd>Telescope live_grep<CR>";
key = "<leader>g";
}
];
}

View File

@@ -0,0 +1,14 @@
{
config = {
globals.mapleader = " ";
viAlias = true;
vimAlias = true;
opts = {
number = true; # Show line numbers
relativenumber = true; # Show relative line numbers
shiftwidth = 2; # Tab width should be 2
};
};
}

View File

@@ -0,0 +1,51 @@
{
plugins = {
lualine.enable = true;
cmp = {
enable = true;
autoEnableSources = true;
settings = {
sources = [
{name = "nvim_lsp";}
{name = "path";}
{name = "buffer";}
{name = "luasnip";}
];
mapping = {
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-Space>" = "cmp.mapping.complete()";
"<C-e>" = "cmp.mapping.close()";
"<CR>" = "cmp.mapping.confirm({ select = true })";
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
};
};
};
lsp = {
enable = true;
servers = {
tsserver.enable = true;
lua-ls = {
enable = true;
settings.telemetry.enable = false;
};
# rust-analyzer = {
# enable = true;
# installCargo = true;
# };
};
};
telescope.enable = true;
treesitter.enable = true;
luasnip.enable = true;
};
}