Init
This commit is contained in:
1
home/nvim/auto-pairs.nix
Normal file
1
home/nvim/auto-pairs.nix
Normal file
@@ -0,0 +1 @@
|
||||
{ programs.nixvim.plugins.nvim-autopairs = { enable = true; }; }
|
||||
1
home/nvim/bufferline.nix
Normal file
1
home/nvim/bufferline.nix
Normal file
@@ -0,0 +1 @@
|
||||
{ programs.nixvim.plugins.bufferline = { enable = true; }; }
|
||||
112
home/nvim/cmp.nix
Normal file
112
home/nvim/cmp.nix
Normal file
@@ -0,0 +1,112 @@
|
||||
{
|
||||
programs.nixvim.plugins = {
|
||||
luasnip.enable = true;
|
||||
cmp-buffer = { enable = true; };
|
||||
cmp-emoji = { enable = true; };
|
||||
cmp-nvim-lsp = { enable = true; };
|
||||
cmp-path = { enable = true; };
|
||||
cmp_luasnip = { enable = true; };
|
||||
|
||||
cmp = {
|
||||
enable = true;
|
||||
settings = {
|
||||
snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end";
|
||||
sources = [
|
||||
{ name = "nvim_lsp"; }
|
||||
{ name = "luasnip"; }
|
||||
{ name = "buffer"; }
|
||||
{ name = "nvim_lua"; }
|
||||
{ name = "path"; }
|
||||
];
|
||||
|
||||
formatting = {
|
||||
fields = [ "abbr" "kind" "menu" ];
|
||||
format =
|
||||
# lua
|
||||
''
|
||||
function(_, item)
|
||||
local icons = {
|
||||
Namespace = "",
|
||||
Text = "",
|
||||
Method = "",
|
||||
Function = "",
|
||||
Constructor = "",
|
||||
Field = "",
|
||||
Variable = "",
|
||||
Class = "",
|
||||
Interface = "",
|
||||
Module = "",
|
||||
Property = "",
|
||||
Unit = "",
|
||||
Value = "",
|
||||
Enum = "",
|
||||
Keyword = "",
|
||||
Snippet = "",
|
||||
Color = "",
|
||||
File = "",
|
||||
Reference = "",
|
||||
Folder = "",
|
||||
EnumMember = "",
|
||||
Constant = "",
|
||||
Struct = "",
|
||||
Event = "",
|
||||
Operator = "",
|
||||
TypeParameter = "",
|
||||
Table = "",
|
||||
Object = "",
|
||||
Tag = "",
|
||||
Array = "[]",
|
||||
Boolean = "",
|
||||
Number = "",
|
||||
Null = "",
|
||||
String = "",
|
||||
Calendar = "",
|
||||
Watch = "",
|
||||
Package = "",
|
||||
Copilot = "",
|
||||
Codeium = "",
|
||||
TabNine = "",
|
||||
}
|
||||
|
||||
local icon = icons[item.kind] or ""
|
||||
item.kind = string.format("%s %s", icon, item.kind or "")
|
||||
return item
|
||||
end
|
||||
'';
|
||||
};
|
||||
|
||||
window = {
|
||||
completion = {
|
||||
winhighlight =
|
||||
"FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
|
||||
scrollbar = false;
|
||||
sidePadding = 0;
|
||||
border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ];
|
||||
};
|
||||
|
||||
documentation = {
|
||||
border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ];
|
||||
winhighlight =
|
||||
"FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
|
||||
};
|
||||
};
|
||||
|
||||
mapping = {
|
||||
"<C-n>" = "cmp.mapping.select_next_item()";
|
||||
"<C-p>" = "cmp.mapping.select_prev_item()";
|
||||
"<Down>" = "cmp.mapping.select_next_item()";
|
||||
"<Up>" = "cmp.mapping.select_prev_item()";
|
||||
"<C-j>" = "cmp.mapping.select_next_item()";
|
||||
"<C-k>" = "cmp.mapping.select_prev_item()";
|
||||
"<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({ behavior = cmp.ConfirmBehavior.Insert, select = true })";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
51
home/nvim/default.nix
Normal file
51
home/nvim/default.nix
Normal file
@@ -0,0 +1,51 @@
|
||||
{ pkgs, inputs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
inputs.nixvim.homeManagerModules.nixvim
|
||||
./auto-pairs.nix
|
||||
./options.nix
|
||||
./bufferline.nix
|
||||
./telescope.nix
|
||||
./nvim-tree.nix
|
||||
./lightline.nix
|
||||
./git.nix
|
||||
./cmp.nix
|
||||
./none-ls.nix
|
||||
./wilder.nix
|
||||
./lsp.nix
|
||||
./treesitter.nix
|
||||
./toggleterm.nix
|
||||
];
|
||||
|
||||
programs.nixvim = {
|
||||
|
||||
enable = true;
|
||||
|
||||
colorschemes.catppuccin.enable = true;
|
||||
|
||||
keymaps = [
|
||||
# Global Mappings
|
||||
# Default mode is "" which means normal-visual-op
|
||||
{
|
||||
# Toggle NvimTree
|
||||
key = "<leader>e";
|
||||
action = "<CMD>Neotree toggle<CR>";
|
||||
}
|
||||
{
|
||||
# Format file
|
||||
key = "<space>fm";
|
||||
action = "<CMD>lua vim.lsp.buf.format()<CR>";
|
||||
}
|
||||
|
||||
# Terminal Mappings
|
||||
{
|
||||
# Escape terminal mode using ESC
|
||||
mode = "t";
|
||||
key = "<esc>";
|
||||
action = "<C-\\><C-n>";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
}
|
||||
6
home/nvim/git.nix
Normal file
6
home/nvim/git.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
programs.nixvim.plugins.gitsigns = {
|
||||
enable = true;
|
||||
currentLineBlame = true;
|
||||
};
|
||||
}
|
||||
1
home/nvim/lightline.nix
Normal file
1
home/nvim/lightline.nix
Normal file
@@ -0,0 +1 @@
|
||||
{ programs.nixvim.plugins.lualine = { enable = true; }; }
|
||||
18
home/nvim/lsp.nix
Normal file
18
home/nvim/lsp.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
programs.nixvim.plugins.lsp = {
|
||||
enable = true;
|
||||
servers = {
|
||||
bashls.enable = true;
|
||||
clangd.enable = true;
|
||||
gopls.enable = true;
|
||||
nixd.enable = true;
|
||||
};
|
||||
keymaps.lspBuf = {
|
||||
"gd" = "definition";
|
||||
"gD" = "references";
|
||||
"gt" = "type_definition";
|
||||
"gi" = "implementation";
|
||||
"K" = "hover";
|
||||
};
|
||||
};
|
||||
}
|
||||
18
home/nvim/none-ls.nix
Normal file
18
home/nvim/none-ls.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
programs.nixvim.plugins.none-ls = {
|
||||
enable = true;
|
||||
sources = {
|
||||
diagnostics = {
|
||||
golangci_lint.enable = true;
|
||||
statix.enable = true;
|
||||
};
|
||||
formatting = {
|
||||
fantomas.enable = true;
|
||||
gofmt.enable = true;
|
||||
goimports.enable = true;
|
||||
nixfmt.enable = true;
|
||||
markdownlint.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
5
home/nvim/nvim-tree.nix
Normal file
5
home/nvim/nvim-tree.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
programs.nixvim.plugins.neo-tree = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
25
home/nvim/options.nix
Normal file
25
home/nvim/options.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
|
||||
programs.nixvim.globals.mapleader = " ";
|
||||
programs.nixvim.options = {
|
||||
updatetime = 100; # Faster completion
|
||||
|
||||
number = true;
|
||||
relativenumber = true;
|
||||
|
||||
autoindent = true;
|
||||
clipboard = "unnamedplus";
|
||||
expandtab = true;
|
||||
shiftwidth = 2;
|
||||
smartindent = true;
|
||||
tabstop = 2;
|
||||
|
||||
ignorecase = true;
|
||||
incsearch = true;
|
||||
smartcase = true;
|
||||
wildmode = "list:longest";
|
||||
|
||||
swapfile = false;
|
||||
undofile = true; # Build-in persistent undo
|
||||
};
|
||||
}
|
||||
13
home/nvim/telescope.nix
Normal file
13
home/nvim/telescope.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
programs.nixvim.plugins.telescope = {
|
||||
enable = true;
|
||||
keymaps = {
|
||||
"<leader>fg" = "live_grep";
|
||||
"<C-p>" = {
|
||||
action = "git_files";
|
||||
desc = "Telescope Git Files";
|
||||
};
|
||||
};
|
||||
extensions.fzf-native = { enable = true; };
|
||||
};
|
||||
}
|
||||
7
home/nvim/toggleterm.nix
Normal file
7
home/nvim/toggleterm.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
programs.nixvim.plugins.toggleterm = {
|
||||
enable = true;
|
||||
openMapping = "<C-t>";
|
||||
direction = "horizontal";
|
||||
};
|
||||
}
|
||||
11
home/nvim/treesitter.nix
Normal file
11
home/nvim/treesitter.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
programs.nixvim.plugins = {
|
||||
treesitter = {
|
||||
enable = true;
|
||||
nixGrammars = true;
|
||||
indent = true;
|
||||
};
|
||||
treesitter-context.enable = true;
|
||||
rainbow-delimiters.enable = true;
|
||||
};
|
||||
}
|
||||
6
home/nvim/wilder.nix
Normal file
6
home/nvim/wilder.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
programs.nixvim.plugins.wilder = {
|
||||
enable = true;
|
||||
modes = [ ":" "/" "?" ];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user