nvim: initial config
This commit is contained in:
5
modules/editors/nvim/config/bufferline.nix
Normal file
5
modules/editors/nvim/config/bufferline.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
plugins.bufferline = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
16
modules/editors/nvim/config/default.nix
Normal file
16
modules/editors/nvim/config/default.nix
Normal 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
|
||||
];
|
||||
};
|
||||
}
|
||||
8
modules/editors/nvim/config/highlight.nix
Normal file
8
modules/editors/nvim/config/highlight.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
highlight = {
|
||||
Comment.fg = "#ff00ff";
|
||||
Comment.bg = "#000000";
|
||||
Comment.underline = true;
|
||||
Comment.bold = true;
|
||||
};
|
||||
}
|
||||
8
modules/editors/nvim/config/keymaps.nix
Normal file
8
modules/editors/nvim/config/keymaps.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
keymaps = [
|
||||
{
|
||||
action = "<cmd>Telescope live_grep<CR>";
|
||||
key = "<leader>g";
|
||||
}
|
||||
];
|
||||
}
|
||||
14
modules/editors/nvim/config/options.nix
Normal file
14
modules/editors/nvim/config/options.nix
Normal 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
|
||||
};
|
||||
};
|
||||
}
|
||||
51
modules/editors/nvim/config/plugins.nix
Normal file
51
modules/editors/nvim/config/plugins.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user