mirror of
https://github.com/fred-drake/neovim.git
synced 2026-06-05 14:59:28 -05:00
Initial commit
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
.aider*
|
||||
result
|
||||
.envrc
|
||||
@@ -0,0 +1,27 @@
|
||||
# My Personal Neovim Setup
|
||||
|
||||
My Nix-based Neovim configuration. For when you have an unhealthy obsession for declarativity and configurability.
|
||||
|
||||

|
||||
|
||||
## Usage
|
||||
|
||||
Option 1: Clone and run
|
||||
|
||||
```bash
|
||||
git clone https://github.com/fred-drake/neovim.git
|
||||
nix run .#
|
||||
```
|
||||
|
||||
Option 2: Run directly
|
||||
|
||||
```bash
|
||||
nix run github:fred-drake/neovim#.
|
||||
```
|
||||
|
||||
## Things To Do
|
||||
|
||||
TODO: Add supermaven autocompletion.
|
||||
TODO: Implement DAP for debugging
|
||||
TODO: Change fzf to only allow git-level root if applicable
|
||||
TODO: Break up LSP, CMP and Tree-Sitter for lanuages like rust, go, etc.
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
plugins = {
|
||||
cmp-dap.enable = true;
|
||||
dap = {
|
||||
enable = true;
|
||||
extensions = {
|
||||
dap-go.enable = true;
|
||||
dap-python.enable = true;
|
||||
dap-ui.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
{
|
||||
plugins = {
|
||||
alpha = {
|
||||
enable = true;
|
||||
layout = [
|
||||
{
|
||||
type = "padding";
|
||||
val = 2;
|
||||
}
|
||||
{
|
||||
type = "text";
|
||||
val = [
|
||||
" _ _______ _______ _________ _______ "
|
||||
"( ( /|( ____ \\( ___ )|\\ /|\\__ __/( )"
|
||||
"| \\ ( || ( \\/| ( ) || ) ( | ) ( | () () |"
|
||||
"| \\ | || (__ | | | || | | | | | | || || |"
|
||||
"| (\\ \\) || __) | | | |( ( ) ) | | | |(_)| |"
|
||||
"| | \\ || ( | | | | \\ \\_/ / | | | | | |"
|
||||
"| ) \\ || (____/\\| (___) | \\ / ___) (___| ) ( |"
|
||||
"|/ )_)(_______/(_______) \\_/ \\_______/|/ \\|"
|
||||
" "
|
||||
];
|
||||
opts = {
|
||||
position = "center";
|
||||
hl = "Type";
|
||||
};
|
||||
}
|
||||
{
|
||||
type = "padding";
|
||||
val = 2;
|
||||
}
|
||||
{
|
||||
type = "group";
|
||||
val = [
|
||||
{
|
||||
type = "button";
|
||||
val = " New File ";
|
||||
on_press.__raw = "function() vim.cmd[[ene]] end";
|
||||
opts = {
|
||||
shortcut = "n";
|
||||
keymap = [
|
||||
"n"
|
||||
"n"
|
||||
"<cmd>ene<CR>"
|
||||
{
|
||||
noremap = true;
|
||||
silent = true;
|
||||
nowait = true;
|
||||
}
|
||||
];
|
||||
position = "center";
|
||||
width = 50;
|
||||
align_shortcut = "right";
|
||||
hl_shortcut = "Keyword";
|
||||
};
|
||||
}
|
||||
{
|
||||
type = "button";
|
||||
val = " Find File ";
|
||||
on_press.__raw =
|
||||
"function() require('telescope.builtin').find_files() end";
|
||||
opts = {
|
||||
shortcut = "f";
|
||||
keymap = [
|
||||
"n"
|
||||
"f"
|
||||
"<cmd>lua require('telescope.builtin').find_files()<CR>"
|
||||
{
|
||||
noremap = true;
|
||||
silent = true;
|
||||
nowait = true;
|
||||
}
|
||||
];
|
||||
position = "center";
|
||||
width = 50;
|
||||
align_shortcut = "right";
|
||||
hl_shortcut = "Keyword";
|
||||
};
|
||||
}
|
||||
{
|
||||
type = "button";
|
||||
val = " Recent Files ";
|
||||
on_press.__raw =
|
||||
"function() require('telescope.builtin').oldfiles() end";
|
||||
opts = {
|
||||
shortcut = "r";
|
||||
keymap = [
|
||||
"n"
|
||||
"r"
|
||||
"<cmd>lua require('telescope.builtin').oldfiles()<CR>"
|
||||
{
|
||||
noremap = true;
|
||||
silent = true;
|
||||
nowait = true;
|
||||
}
|
||||
];
|
||||
position = "center";
|
||||
width = 50;
|
||||
align_shortcut = "right";
|
||||
hl_shortcut = "Keyword";
|
||||
};
|
||||
}
|
||||
{
|
||||
type = "button";
|
||||
val = " Find Text ";
|
||||
on_press.__raw =
|
||||
"function() require('telescope.builtin').live_grep() end";
|
||||
opts = {
|
||||
shortcut = "g";
|
||||
keymap = [
|
||||
"n"
|
||||
"g"
|
||||
"<cmd>lua require('telescope.builtin').live_grep()<CR>"
|
||||
{
|
||||
noremap = true;
|
||||
silent = true;
|
||||
nowait = true;
|
||||
}
|
||||
];
|
||||
position = "center";
|
||||
width = 50;
|
||||
align_shortcut = "right";
|
||||
hl_shortcut = "Keyword";
|
||||
};
|
||||
}
|
||||
{
|
||||
type = "button";
|
||||
val = " Quit Neovim ";
|
||||
on_press.__raw = "function() vim.cmd[[qa]] end";
|
||||
opts = {
|
||||
shortcut = "q";
|
||||
keymap = [
|
||||
"n"
|
||||
"q"
|
||||
"<cmd>qa<CR>"
|
||||
{
|
||||
noremap = true;
|
||||
silent = true;
|
||||
nowait = true;
|
||||
}
|
||||
];
|
||||
position = "center";
|
||||
width = 50;
|
||||
align_shortcut = "right";
|
||||
hl_shortcut = "Keyword";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
type = "padding";
|
||||
val = 2;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
let
|
||||
# Read all files in the current directory
|
||||
files = builtins.readDir ./.;
|
||||
|
||||
# Filter out default.nix and non-.nix files
|
||||
nixFiles = builtins.filter (name: name != "default.nix" && builtins.match ".*\\.nix" name != null) (builtins.attrNames files);
|
||||
|
||||
# Create a list of import statements
|
||||
imports = map (name: ./. + "/${name}") nixFiles;
|
||||
in
|
||||
{
|
||||
# Import all configuration modules automatically
|
||||
imports = imports;
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
plugins = {
|
||||
fzf-lua = {
|
||||
enable = true;
|
||||
keymaps = {
|
||||
"<leader>/" = {
|
||||
action = "live_grep";
|
||||
options = { desc = "Live Grep"; };
|
||||
};
|
||||
"<leader>," = {
|
||||
action = "buffers";
|
||||
options = { desc = "Switch Buffer"; };
|
||||
settings = {
|
||||
sort_mru = true;
|
||||
sort_lastused = true;
|
||||
};
|
||||
};
|
||||
"<leader>ff" = {
|
||||
action = "files";
|
||||
options = { desc = "Find Files"; };
|
||||
};
|
||||
"<leader>fr" = {
|
||||
action = "oldfiles";
|
||||
options = { desc = "Recent Files"; };
|
||||
};
|
||||
"<leader>gc" = {
|
||||
action = "git_commits";
|
||||
options = { desc = "Git Commits"; };
|
||||
};
|
||||
"<leader>gs" = {
|
||||
action = "git_status";
|
||||
options = { desc = "Git Status"; };
|
||||
};
|
||||
"<leader>s\"" = {
|
||||
action = "registers";
|
||||
options = { desc = "Registers"; };
|
||||
};
|
||||
"<leader>sd" = {
|
||||
action = "diagnostics_document";
|
||||
options = { desc = "Document Diagnostics"; };
|
||||
};
|
||||
"<leader>sD" = {
|
||||
action = "diagnostics_workspace";
|
||||
options = { desc = "Workspace Diagnostics"; };
|
||||
};
|
||||
"<leader>sh" = {
|
||||
action = "help_tags";
|
||||
options = { desc = "Help Pages"; };
|
||||
};
|
||||
"<leader>sk" = {
|
||||
action = "keymaps";
|
||||
options = { desc = "Key Maps"; };
|
||||
};
|
||||
};
|
||||
};
|
||||
telescope.enable = true;
|
||||
todo-comments = {
|
||||
enable = true;
|
||||
keymaps = {
|
||||
todoTelescope = {
|
||||
key = "<leader>st";
|
||||
keywords = [ "TODO" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
+287
@@ -0,0 +1,287 @@
|
||||
{
|
||||
globals.mapleader = " ";
|
||||
|
||||
plugins.which-key = {
|
||||
enable = true;
|
||||
settings = {
|
||||
spec = [
|
||||
{
|
||||
__unkeyed-1 = "<leader>g";
|
||||
group = "Git";
|
||||
}
|
||||
{
|
||||
__unkeyed-1 = "<leader><tab>";
|
||||
group = "Tabs";
|
||||
}
|
||||
{
|
||||
__unkeyed-1 = "<leader>f";
|
||||
group = "File / Find";
|
||||
}
|
||||
{
|
||||
__unkeyed-1 = "<leader>q";
|
||||
group = "Quit / Session";
|
||||
}
|
||||
{
|
||||
__unkeyed-1 = "<leader>s";
|
||||
group = "Search";
|
||||
}
|
||||
{
|
||||
__unkeyed-1 = "<leader>b";
|
||||
group = "Buffer";
|
||||
}
|
||||
{
|
||||
__unkeyed-1 = "<leader>o";
|
||||
group = "SOPS";
|
||||
icon = "";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
# Normal mode
|
||||
{
|
||||
mode = "i";
|
||||
key = "jk";
|
||||
action = "<CMD>noh<CR><ESC>";
|
||||
options = { desc = "Normal mode and clear highlight"; };
|
||||
}
|
||||
{
|
||||
mode = "i";
|
||||
key = "<ESC>";
|
||||
action = "<CMD>noh<CR><ESC>";
|
||||
options = { desc = "Normal mode and clear highlight"; };
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<ESC>";
|
||||
action = "<CMD>noh<CR><ESC>";
|
||||
options = { desc = "Normal mode and clear highlight"; };
|
||||
}
|
||||
|
||||
# Add undo breakpoints
|
||||
{
|
||||
mode = "i";
|
||||
key = ",";
|
||||
action = ",<C-g>u";
|
||||
options = { desc = "Undo breakpoint"; };
|
||||
}
|
||||
{
|
||||
mode = "i";
|
||||
key = ".";
|
||||
action = ".<C-g>u";
|
||||
options = { desc = "Undo breakpoint"; };
|
||||
}
|
||||
{
|
||||
mode = "i";
|
||||
key = ";";
|
||||
action = ";<C-g>u";
|
||||
options = { desc = "Undo breakpoint"; };
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>e";
|
||||
action = "<CMD>Neotree toggle<CR>";
|
||||
options = { desc = "Toggle tree view"; };
|
||||
}
|
||||
|
||||
# LSP Actions
|
||||
{
|
||||
mode = "n";
|
||||
key = "gd";
|
||||
action =
|
||||
"<CMD>FzfLua lsp_definitions jump_to_single_result=true ignore_current_line=true<CR>";
|
||||
options = { desc = "Goto Definition"; };
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "gr";
|
||||
action =
|
||||
"<CMD>FzfLua lsp_references jump_to_single_result=true ignore_current_line=true<CR>";
|
||||
options = { desc = "References"; };
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "gI";
|
||||
action =
|
||||
"<CMD>FzfLua lsp_implementations jump_to_single_result=true ignore_current_line=true<CR>";
|
||||
options = { desc = "Goto Implementation"; };
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "gy";
|
||||
action =
|
||||
"<CMD>FzfLua lsp_typedefs jump_to_single_result=true ignore_current_line=true<CR>";
|
||||
options = { desc = "Goto T[y]pe Definition"; };
|
||||
}
|
||||
|
||||
# SOPS
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>od";
|
||||
action = "<CMD>!sops -d -i %<CR><CR>";
|
||||
options = { desc = "Decrypt SOPS File"; };
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>oe";
|
||||
action = "<CMD>!sops -e -i %<CR><CR>";
|
||||
options = { desc = "Encrypt SOPS File"; };
|
||||
}
|
||||
|
||||
# Git
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>gg";
|
||||
action = "<CMD>LazyGit<CR>";
|
||||
options = { desc = "LazyGit"; };
|
||||
}
|
||||
|
||||
# Windows
|
||||
{
|
||||
key = "<C-h>";
|
||||
action = "<CMD>wincmd h<CR>";
|
||||
options = { desc = "Navigate Window Left"; };
|
||||
}
|
||||
{
|
||||
key = "<C-j>";
|
||||
action = "<CMD>wincmd j<CR>";
|
||||
options = { desc = "Navigate Window Down"; };
|
||||
}
|
||||
{
|
||||
key = "<C-k>";
|
||||
action = "<CMD>wincmd k<CR>";
|
||||
options = { desc = "Navigate Window Up"; };
|
||||
}
|
||||
{
|
||||
key = "<C-l>";
|
||||
action = "<CMD>wincmd l<CR>";
|
||||
options = { desc = "Navigate Window Right"; };
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>w";
|
||||
action = "<c-w>";
|
||||
options = { desc = "Windows"; };
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>-";
|
||||
action = "<C-W>s";
|
||||
options = { desc = "Split Window Below"; };
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>|";
|
||||
action = "<C-W>v";
|
||||
options = { desc = "Split Window Right"; };
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>wd";
|
||||
action = "<C-W>c";
|
||||
options = { desc = "Delete Window"; };
|
||||
}
|
||||
|
||||
# Tabs
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader><tab>l";
|
||||
action = "<CMD>tablast<CR>";
|
||||
options = { desc = "Last Tab"; };
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader><tab>o";
|
||||
action = "<CMD>tabonly<CR>";
|
||||
options = { desc = "Close Other Tabs"; };
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader><tab>f";
|
||||
action = "<CMD>tabfirst<CR>";
|
||||
options = { desc = "First Tab"; };
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader><tab><tab>";
|
||||
action = "<CMD>tabnew<CR>";
|
||||
options = { desc = "New Tab"; };
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader><tab>]";
|
||||
action = "<CMD>tabnext<CR>";
|
||||
options = { desc = "Next Tab"; };
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader><tab>d";
|
||||
action = "<CMD>tabclose<CR>";
|
||||
options = { desc = "Close Tab"; };
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader><tab>[";
|
||||
action = "<CMD>tabprevious<CR>";
|
||||
options = { desc = "Previous Tab"; };
|
||||
}
|
||||
|
||||
# Buffer
|
||||
{
|
||||
mode = "n";
|
||||
key = "<S-h>";
|
||||
action = "<CMD>bprevious<CR>";
|
||||
options = { desc = "Previous Buffer"; };
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<S-l>";
|
||||
action = "<CMD>bnext<CR>";
|
||||
options = { desc = "Next Buffer"; };
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bb";
|
||||
action = "<CMD>e #<CR>";
|
||||
options = { desc = "Switch To Other Buffer"; };
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bd";
|
||||
action = "<CMD>bd<CR>";
|
||||
options = { desc = "Delete Buffer and Window"; };
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bp";
|
||||
action = "<CMD>BufferLineTogglePin<CR>";
|
||||
options = { desc = "Toggle Pin"; };
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bP";
|
||||
action = "<CMD>BufferLineGroupClose ungrouped<CR>";
|
||||
options = { desc = "Delete Non-Pinned Buffers"; };
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bo";
|
||||
action = "<CMD>BufferLineCloseOthers<CR>";
|
||||
options = { desc = "Delete Other Buffers"; };
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>br";
|
||||
action = "<CMD>BufferLineCloseRight<CR>";
|
||||
options = { desc = "Delete Buffers to the Right"; };
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bl";
|
||||
action = "<CMD>BufferLineCloseLeft<CR>";
|
||||
options = { desc = "Delete Buffers to the Left"; };
|
||||
}
|
||||
];
|
||||
}
|
||||
+252
@@ -0,0 +1,252 @@
|
||||
let selectOpts = "{behavior = cmp.SelectBehavior.Select}";
|
||||
in { pkgs, ... }: {
|
||||
plugins = {
|
||||
cmp = {
|
||||
enable = true;
|
||||
settings = {
|
||||
autoEnableSources = true;
|
||||
performance = { debounce = 150; };
|
||||
sources = [
|
||||
{ name = "path"; }
|
||||
{
|
||||
name = "nvim_lsp";
|
||||
keywordLength = 1;
|
||||
}
|
||||
{
|
||||
name = "buffer";
|
||||
keywordLength = 3;
|
||||
}
|
||||
];
|
||||
|
||||
snippet.expand =
|
||||
"function(args) require('luasnip').lsp_expand(args.body) end";
|
||||
formatting = {
|
||||
fields = [ "menu" "abbr" "kind" ];
|
||||
format = ''
|
||||
function(entry, item)
|
||||
local menu_icon = {
|
||||
nvim_lsp = '[LSP]',
|
||||
luasnip = '[SNIP]',
|
||||
buffer = '[BUF]',
|
||||
path = '[PATH]',
|
||||
}
|
||||
|
||||
item.menu = menu_icon[entry.source.name]
|
||||
return item
|
||||
end
|
||||
'';
|
||||
};
|
||||
|
||||
mapping = {
|
||||
"<Up>" = "cmp.mapping.select_prev_item(${selectOpts})";
|
||||
"<Down>" = "cmp.mapping.select_next_item(${selectOpts})";
|
||||
|
||||
"<C-p>" = "cmp.mapping.select_prev_item(${selectOpts})";
|
||||
"<C-n>" = "cmp.mapping.select_next_item(${selectOpts})";
|
||||
|
||||
"<C-u>" = "cmp.mapping.scroll_docs(-4)";
|
||||
"<C-d>" = "cmp.mapping.scroll_docs(4)";
|
||||
|
||||
"<C-e>" = "cmp.mapping.abort()";
|
||||
"<C-y>" = "cmp.mapping.confirm({select = true})";
|
||||
"<CR>" = "cmp.mapping.confirm({select = false})";
|
||||
|
||||
"<C-f>" = ''
|
||||
cmp.mapping(
|
||||
function(fallback)
|
||||
if luasnip.jumpable(1) then
|
||||
luasnip.jump(1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
{ "i", "s" }
|
||||
)
|
||||
'';
|
||||
|
||||
"<C-b>" = ''
|
||||
cmp.mapping(
|
||||
function(fallback)
|
||||
if luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
{ "i", "s" }
|
||||
)
|
||||
'';
|
||||
|
||||
"<Tab>" = ''
|
||||
cmp.mapping(
|
||||
function(fallback)
|
||||
local col = vim.fn.col('.') - 1
|
||||
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item(select_opts)
|
||||
elseif col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then
|
||||
fallback()
|
||||
else
|
||||
cmp.complete()
|
||||
end
|
||||
end,
|
||||
{ "i", "s" }
|
||||
)
|
||||
'';
|
||||
|
||||
"<S-Tab>" = ''
|
||||
cmp.mapping(
|
||||
function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item(select_opts)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
{ "i", "s" }
|
||||
)
|
||||
'';
|
||||
};
|
||||
window = {
|
||||
completion = {
|
||||
border = "rounded";
|
||||
winhighlight =
|
||||
"Normal:Normal,FloatBorder:Normal,CursorLine:Visual,Search:None";
|
||||
zindex = 1001;
|
||||
scrolloff = 0;
|
||||
colOffset = 0;
|
||||
sidePadding = 1;
|
||||
scrollbar = true;
|
||||
};
|
||||
documentation = {
|
||||
border = "rounded";
|
||||
winhighlight =
|
||||
"Normal:Normal,FloatBorder:Normal,CursorLine:Visual,Search:None";
|
||||
zindex = 1001;
|
||||
maxHeight = 20;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
cmp-nvim-lsp.enable = true;
|
||||
cmp-buffer.enable = true;
|
||||
cmp-path.enable = true;
|
||||
cmp-treesitter.enable = true;
|
||||
dap.enable = true;
|
||||
none-ls = {
|
||||
enable = true;
|
||||
sources.formatting = {
|
||||
black.enable = true;
|
||||
csharpier.enable = true;
|
||||
hclfmt.enable = true;
|
||||
just.enable = true;
|
||||
nixfmt.enable = true;
|
||||
opentofu_fmt.enable = true;
|
||||
prettier.enable = true;
|
||||
# rubyfmt is broken on darwin-based systems
|
||||
rubyfmt.enable = (pkgs.stdenv.hostPlatform.system != "x86_64-darwin"
|
||||
&& pkgs.stdenv.hostPlatform.system != "aarch64-darwin");
|
||||
sqlformat.enable = true;
|
||||
stylua.enable = true;
|
||||
yamlfmt.enable = true;
|
||||
};
|
||||
sources.diagnostics = {
|
||||
trivy.enable = true;
|
||||
yamllint.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
conform-nvim = {
|
||||
enable = true;
|
||||
settings = {
|
||||
format_on_save = {
|
||||
lsp_fallback = "fallback";
|
||||
timeout_ms = 500;
|
||||
};
|
||||
notify_on_error = true;
|
||||
|
||||
formatters_by_ft = {
|
||||
css = [ "prettier" ];
|
||||
html = [ "prettier" ];
|
||||
javascript = [ "prettier" ];
|
||||
javascriptreact = [ "prettier" ];
|
||||
lua = [ "stylua" ];
|
||||
markdown = [ "prettier" ];
|
||||
nix = [ "nixfmt" ];
|
||||
python = [ "black" ];
|
||||
ruby = [ "rubyfmt" ];
|
||||
rust = [ "rustfmt" ];
|
||||
terraform = [ "tofu_fmt" ];
|
||||
tf = [ "tofu_fmt" ];
|
||||
typescript = [ "prettier" ];
|
||||
typescriptreact = [ "prettier" ];
|
||||
yaml = [ "yamlfmt" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = true;
|
||||
inlayHints = true;
|
||||
keymaps = {
|
||||
diagnostic = {
|
||||
"<leader>E" = "open_float";
|
||||
"[" = "goto_prev";
|
||||
"]" = "goto_next";
|
||||
"<leader>do" = "setloclist";
|
||||
};
|
||||
lspBuf = {
|
||||
"K" = "hover";
|
||||
"gD" = "declaration";
|
||||
"gd" = "definition";
|
||||
"gr" = "references";
|
||||
"gI" = "implementation";
|
||||
"gy" = "type_definition";
|
||||
"<leader>rn" = "rename";
|
||||
"<leader>ca" = "code_action";
|
||||
"<leader>wl" = "list_workspace_folders";
|
||||
"<leader>wr" = "remove_workspace_folder";
|
||||
"<leader>wa" = "add_workspace_folder";
|
||||
};
|
||||
};
|
||||
preConfig = ''
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
severity_sort = true,
|
||||
float = {
|
||||
border = 'rounded',
|
||||
source = 'always',
|
||||
},
|
||||
})
|
||||
|
||||
vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(
|
||||
vim.lsp.handlers.hover,
|
||||
{border = 'rounded'}
|
||||
)
|
||||
|
||||
vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(
|
||||
vim.lsp.handlers.signature_help,
|
||||
{border = 'rounded'}
|
||||
)
|
||||
'';
|
||||
postConfig = ''
|
||||
local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
|
||||
for type, icon in pairs(signs) do
|
||||
local hl = "DiagnosticSign" .. type
|
||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
|
||||
end
|
||||
'';
|
||||
servers = {
|
||||
nil-ls.enable = true;
|
||||
nixd.enable = true;
|
||||
omnisharp.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
rustaceanvim = {
|
||||
enable = true;
|
||||
settings = { tools.enable_clippy = true; };
|
||||
};
|
||||
# rust-tools.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
config = {
|
||||
opts = {
|
||||
updatetime = 100; # faster completion
|
||||
number = true;
|
||||
relativenumber = true;
|
||||
|
||||
autoindent = true;
|
||||
autowrite = true;
|
||||
confirm = true;
|
||||
clipboard = "unnamedplus";
|
||||
cursorline = true;
|
||||
list = true;
|
||||
expandtab = true;
|
||||
shiftround = true;
|
||||
shiftwidth = 2;
|
||||
# showmode = false;
|
||||
signcolumn = "yes";
|
||||
smartcase = true;
|
||||
smartindent = true;
|
||||
tabstop = 2;
|
||||
|
||||
ignorecase = true;
|
||||
incsearch = true;
|
||||
completeopt = "menu,menuone,noselect";
|
||||
wildmode = "longest:full,full";
|
||||
|
||||
swapfile = false;
|
||||
undofile = true; # Build-in persistent undo
|
||||
undolevels = 10000;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
{
|
||||
plugins = {
|
||||
bufferline = {
|
||||
enable = true;
|
||||
settings = {
|
||||
options = {
|
||||
always_show_bufferline = false;
|
||||
buffer_close_icon = "";
|
||||
offsets = [{
|
||||
filetype = "neo-tree";
|
||||
text = "Neo-tree";
|
||||
highlight = "Directory";
|
||||
text_align = "left";
|
||||
}];
|
||||
diagnostics = "nvim_lsp";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
gitsigns = {
|
||||
enable = true;
|
||||
settings = {
|
||||
current_line_blame = true;
|
||||
current_line_blame_opts = {
|
||||
virt_text = true;
|
||||
virt_text_pos = "eol";
|
||||
};
|
||||
signcolumn = true;
|
||||
signs = {
|
||||
add = { text = "│"; };
|
||||
change = { text = "│"; };
|
||||
changedelete = { text = "~"; };
|
||||
delete = { text = "_"; };
|
||||
topdelete = { text = "‾"; };
|
||||
untracked = { text = "┆"; };
|
||||
};
|
||||
watch_gitdir = { follow_files = true; };
|
||||
};
|
||||
};
|
||||
|
||||
illuminate.enable = true;
|
||||
lazygit.enable = true;
|
||||
nvim-lightbulb.enable = true;
|
||||
lualine = {
|
||||
enable = true;
|
||||
settings.options.globalstatus = true;
|
||||
};
|
||||
luasnip.enable = true;
|
||||
|
||||
mini = {
|
||||
enable = true;
|
||||
modules = {
|
||||
surround = { };
|
||||
indentscope = {
|
||||
symbol = "│";
|
||||
options = { try_as_border = true; };
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
neo-tree = {
|
||||
enable = true;
|
||||
extraOptions = {
|
||||
filesystem = {
|
||||
follow_current_file.enabled = true;
|
||||
filtered_items = {
|
||||
hide_dotfiles = false;
|
||||
hide_gitignored = false;
|
||||
hide_hidden = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
noice.enable = true;
|
||||
notify.enable = true;
|
||||
nvim-autopairs.enable = true;
|
||||
nvim-colorizer.enable = true;
|
||||
render-markdown.enable = true;
|
||||
todo-comments.enable = true;
|
||||
|
||||
treesitter = {
|
||||
enable = true;
|
||||
|
||||
folding = true;
|
||||
settings.indent.enable = true;
|
||||
};
|
||||
|
||||
vim-surround.enable = true;
|
||||
web-devicons.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
colorschemes = {
|
||||
gruvbox.enable = true;
|
||||
};
|
||||
}
|
||||
Generated
+362
@@ -0,0 +1,362 @@
|
||||
{
|
||||
"nodes": {
|
||||
"devshell": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722113426,
|
||||
"narHash": "sha256-Yo/3loq572A8Su6aY5GP56knpuKYRvM2a1meP9oJZCw=",
|
||||
"owner": "numtide",
|
||||
"repo": "devshell",
|
||||
"rev": "67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "devshell",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat": {
|
||||
"locked": {
|
||||
"lastModified": 1696426674,
|
||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||
"revCount": 57,
|
||||
"type": "tarball",
|
||||
"url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
|
||||
}
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1726153070,
|
||||
"narHash": "sha256-HO4zgY0ekfwO5bX0QH/3kJ/h4KvUDFZg8YpkNwIbg1U=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "bcef6817a8b2aa20a5a6dbb19b43e63c5bf8619a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts_2": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1726153070,
|
||||
"narHash": "sha256-HO4zgY0ekfwO5bX0QH/3kJ/h4KvUDFZg8YpkNwIbg1U=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "bcef6817a8b2aa20a5a6dbb19b43e63c5bf8619a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1726560853,
|
||||
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"git-hooks": {
|
||||
"inputs": {
|
||||
"flake-compat": [
|
||||
"nixvim",
|
||||
"flake-compat"
|
||||
],
|
||||
"gitignore": "gitignore",
|
||||
"nixpkgs": [
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
],
|
||||
"nixpkgs-stable": [
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1727514110,
|
||||
"narHash": "sha256-0YRcOxJG12VGDFH8iS8pJ0aYQQUAgo/r3ZAL+cSh9nk=",
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"rev": "85f7a7177c678de68224af3402ab8ee1bcee25c8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gitignore": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixvim",
|
||||
"git-hooks",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1709087332,
|
||||
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1727383923,
|
||||
"narHash": "sha256-4/vacp3CwdGoPf8U4e/N8OsGYtO09WTcQK5FqYfJbKs=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "ffe2d07e771580a005e675108212597e5b367d2d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-darwin": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1727507295,
|
||||
"narHash": "sha256-I/FrX1peu4URoj5T5odfuKR2rm4GjYJJpCGF9c0/lDA=",
|
||||
"owner": "lnl7",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "f2e1c4aa29fc211947c3a7113cba1dd707433b70",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "lnl7",
|
||||
"repo": "nix-darwin",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1727348695,
|
||||
"narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "1925c603f17fc89f4c8f6bf6f631a802ad85d784",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"lastModified": 1725233747,
|
||||
"narHash": "sha256-Ss8QWLXdr2JCBPcYChJhz4xJm+h/xjl4G0c0XlP6a74=",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1727348695,
|
||||
"narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "1925c603f17fc89f4c8f6bf6f631a802ad85d784",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1718428119,
|
||||
"narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixvim": {
|
||||
"inputs": {
|
||||
"devshell": "devshell",
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-parts": "flake-parts_2",
|
||||
"git-hooks": "git-hooks",
|
||||
"home-manager": "home-manager",
|
||||
"nix-darwin": "nix-darwin",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"nuschtosSearch": "nuschtosSearch",
|
||||
"treefmt-nix": "treefmt-nix"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1727519958,
|
||||
"narHash": "sha256-racmCXmFrR8r9/IuByadyX6H8TTZZhIo2MguKgIrcmo=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixvim",
|
||||
"rev": "13564727c59831ff36a9d091024fa79aeca86839",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "nixvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nuschtosSearch": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": [
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1727452028,
|
||||
"narHash": "sha256-ehl/A4HQFRyqj1Fk7cl+dgSf/2Fb1jLwWJtZaMU6RfU=",
|
||||
"owner": "NuschtOS",
|
||||
"repo": "search",
|
||||
"rev": "9f7426e532ef8dfc839c4a3fcc567b13a20a70d3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NuschtOS",
|
||||
"repo": "search",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixvim": "nixvim",
|
||||
"rust-overlay": "rust-overlay"
|
||||
}
|
||||
},
|
||||
"rust-overlay": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1727577080,
|
||||
"narHash": "sha256-2LPT76Acp6ebt7fCt90eq/M8T2+X09s/yTVgfVFrtno=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "73a833855442ce8cee710cf4d8d054fea1c81196",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"treefmt-nix": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1727431250,
|
||||
"narHash": "sha256-uGRlRT47ecicF9iLD1G3g43jn2e+b5KaMptb59LHnvM=",
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"rev": "879b29ae9a0378904fbbefe0dadaed43c8905754",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
{
|
||||
description = "A nixvim configuration";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
nixvim.url = "github:nix-community/nixvim";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
rust-overlay.url = "github:oxalica/rust-overlay";
|
||||
};
|
||||
|
||||
outputs = { nixvim, flake-parts, rust-overlay, ... }@inputs:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
systems =
|
||||
[ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
||||
|
||||
perSystem = { system, ... }:
|
||||
let
|
||||
overlays = [ (import rust-overlay) ];
|
||||
nixvimLib = nixvim.lib.${system};
|
||||
nixvim' = nixvim.legacyPackages.${system};
|
||||
nixvimModule = {
|
||||
inherit pkgs;
|
||||
module = { pkgs, ... }: {
|
||||
imports = [ ./config ];
|
||||
extraPackages = with pkgs; [
|
||||
sops
|
||||
rust-bin.stable.latest.default
|
||||
];
|
||||
};
|
||||
# You can use `extraSpecialArgs` to pass additional arguments to your module files
|
||||
extraSpecialArgs = {
|
||||
# inherit (inputs) foo;
|
||||
};
|
||||
};
|
||||
pkgs = import inputs.nixpkgs {
|
||||
inherit system overlays;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
nvim = nixvim'.makeNixvimWithModule nixvimModule;
|
||||
in {
|
||||
checks = {
|
||||
# Run `nix flake check .` to verify that your config is not broken
|
||||
default =
|
||||
nixvimLib.check.mkTestDerivationFromNixvimModule nixvimModule;
|
||||
};
|
||||
|
||||
packages = {
|
||||
# Lets you run `nix run .` to start nixvim
|
||||
default = nvim;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 639 KiB |
Reference in New Issue
Block a user