Reformatted to alejandra style

This commit is contained in:
Fred Drake
2024-10-03 21:33:17 -04:00
parent ced6c4d36e
commit 53e75b11ce
11 changed files with 405 additions and 382 deletions
+3 -6
View File
@@ -70,8 +70,7 @@
{
type = "button";
val = " Find File ";
on_press.__raw =
"function() require('telescope.builtin').find_files() end";
on_press.__raw = "function() require('telescope.builtin').find_files() end";
opts = {
shortcut = "f";
keymap = [
@@ -97,8 +96,7 @@
{
type = "button";
val = " Recent Files ";
on_press.__raw =
"function() require('telescope.builtin').oldfiles() end";
on_press.__raw = "function() require('telescope.builtin').oldfiles() end";
opts = {
shortcut = "r";
keymap = [
@@ -124,8 +122,7 @@
{
type = "button";
val = " Find Text ";
on_press.__raw =
"function() require('telescope.builtin').live_grep() end";
on_press.__raw = "function() require('telescope.builtin').live_grep() end";
opts = {
shortcut = "g";
keymap = [
+8 -10
View File
@@ -1,4 +1,4 @@
{ pkgs, ... }: {
{pkgs, ...}: {
plugins = {
cmp-dap.enable = true;
dap = {
@@ -6,9 +6,9 @@
extensions = {
dap-ui = {
enable = true;
floating.mappings = { close = [ "<ESC>" "q" ]; };
floating.mappings = {close = ["<ESC>" "q"];};
};
dap-virtual-text = { enable = true; };
dap-virtual-text = {enable = true;};
};
signs = {
dapBreakpoint = {
@@ -31,8 +31,7 @@
{
mode = "n";
key = "<leader>dB";
action =
"\n <cmd>lua require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: '))<cr>\n ";
action = "\n <cmd>lua require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: '))<cr>\n ";
options = {
silent = true;
desc = "Breakpoint Condition";
@@ -192,7 +191,7 @@
};
}
{
mode = [ "n" "v" ];
mode = ["n" "v"];
key = "<leader>de";
action = "<cmd>lua require('dapui').eval()<cr>";
options = {
@@ -203,9 +202,8 @@
{
mode = "n";
key = "<leader>df";
action =
"<CMD>lua require('dap.ext.vscode').load_launchjs()<CR><CMD>Telescope dap configurations<CR>";
options = { desc = "Debug Configurations"; };
action = "<CMD>lua require('dap.ext.vscode').load_launchjs()<CR><CMD>Telescope dap configurations<CR>";
options = {desc = "Debug Configurations";};
}
];
@@ -216,5 +214,5 @@
require('dap').listeners.before.event_exited['dapui_config'] = require('dapui').close
'';
extraPlugins = [ (pkgs.vimPlugins.telescope-dap-nvim) ];
extraPlugins = [(pkgs.vimPlugins.telescope-dap-nvim)];
}
+1 -2
View File
@@ -7,8 +7,7 @@ let
# Create a list of import statements
imports = map (name: ./. + "/${name}") nixFiles;
in
{
in {
# Import all configuration modules automatically
imports = imports;
}
+12 -14
View File
@@ -5,11 +5,11 @@
keymaps = {
"<leader>/" = {
action = "live_grep";
options = { desc = "Live Grep"; };
options = {desc = "Live Grep";};
};
"<leader>," = {
action = "buffers";
options = { desc = "Switch Buffer"; };
options = {desc = "Switch Buffer";};
settings = {
sort_mru = true;
sort_lastused = true;
@@ -17,39 +17,39 @@
};
"<leader>ff" = {
action = "files";
options = { desc = "Find Files"; };
options = {desc = "Find Files";};
};
"<leader>fr" = {
action = "oldfiles";
options = { desc = "Recent Files"; };
options = {desc = "Recent Files";};
};
"<leader>gc" = {
action = "git_commits";
options = { desc = "Git Commits"; };
options = {desc = "Git Commits";};
};
"<leader>gs" = {
action = "git_status";
options = { desc = "Git Status"; };
options = {desc = "Git Status";};
};
"<leader>s\"" = {
action = "registers";
options = { desc = "Registers"; };
options = {desc = "Registers";};
};
"<leader>sd" = {
action = "diagnostics_document";
options = { desc = "Document Diagnostics"; };
options = {desc = "Document Diagnostics";};
};
"<leader>sD" = {
action = "diagnostics_workspace";
options = { desc = "Workspace Diagnostics"; };
options = {desc = "Workspace Diagnostics";};
};
"<leader>sh" = {
action = "help_tags";
options = { desc = "Help Pages"; };
options = {desc = "Help Pages";};
};
"<leader>sk" = {
action = "keymaps";
options = { desc = "Key Maps"; };
options = {desc = "Key Maps";};
};
};
};
@@ -59,11 +59,9 @@
keymaps = {
todoTelescope = {
key = "<leader>st";
keywords = [ "TODO" ];
keywords = ["TODO"];
};
};
};
};
}
+49 -53
View File
@@ -64,19 +64,19 @@
mode = "i";
key = "jk";
action = "<CMD>noh<CR><ESC>";
options = { desc = "Normal mode and clear highlight"; };
options = {desc = "Normal mode and clear highlight";};
}
{
mode = "i";
key = "<ESC>";
action = "<CMD>noh<CR><ESC>";
options = { desc = "Normal mode and clear highlight"; };
options = {desc = "Normal mode and clear highlight";};
}
{
mode = "n";
key = "<ESC>";
action = "<CMD>noh<CR><ESC>";
options = { desc = "Normal mode and clear highlight"; };
options = {desc = "Normal mode and clear highlight";};
}
# Add undo breakpoints
@@ -84,26 +84,26 @@
mode = "i";
key = ",";
action = ",<C-g>u";
options = { desc = "Undo breakpoint"; };
options = {desc = "Undo breakpoint";};
}
{
mode = "i";
key = ".";
action = ".<C-g>u";
options = { desc = "Undo breakpoint"; };
options = {desc = "Undo breakpoint";};
}
{
mode = "i";
key = ";";
action = ";<C-g>u";
options = { desc = "Undo breakpoint"; };
options = {desc = "Undo breakpoint";};
}
{
mode = "n";
key = "<leader>e";
action = "<CMD>Neotree toggle<CR>";
options = { desc = "Toggle tree view"; };
options = {desc = "Toggle tree view";};
}
# Database
@@ -111,49 +111,45 @@
mode = "n";
key = "<leader>Du";
action = "<CMD>DBUI<CR>";
options = { desc = "Show Database UI"; };
options = {desc = "Show Database UI";};
}
# 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"; };
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"; };
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"; };
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"; };
action = "<CMD>FzfLua lsp_typedefs jump_to_single_result=true ignore_current_line=true<CR>";
options = {desc = "Goto T[y]pe Definition";};
}
{
mode = "n";
key = "<leader>cd";
action = "<CMD>lua vim.diagnostic.open_float()<CR>";
options = { desc = "Popup Diagnostics"; };
options = {desc = "Popup Diagnostics";};
}
{
mode = "n";
key = "<leader>cD";
action = "<CMD>Trouble diagnostics toggle<CR>";
options = { desc = "List All Diagnostics"; };
options = {desc = "List All Diagnostics";};
}
# SOPS
@@ -161,13 +157,13 @@
mode = "n";
key = "<leader>od";
action = "<CMD>!sops -d -i %<CR><CR>";
options = { desc = "Decrypt SOPS File"; };
options = {desc = "Decrypt SOPS File";};
}
{
mode = "n";
key = "<leader>oe";
action = "<CMD>!sops -e -i %<CR><CR>";
options = { desc = "Encrypt SOPS File"; };
options = {desc = "Encrypt SOPS File";};
}
# Git
@@ -175,53 +171,53 @@
mode = "n";
key = "<leader>gg";
action = "<CMD>LazyGit<CR>";
options = { desc = "LazyGit"; };
options = {desc = "LazyGit";};
}
# Windows
{
key = "<C-h>";
action = "<CMD>wincmd h<CR>";
options = { desc = "Navigate Window Left"; };
options = {desc = "Navigate Window Left";};
}
{
key = "<C-j>";
action = "<CMD>wincmd j<CR>";
options = { desc = "Navigate Window Down"; };
options = {desc = "Navigate Window Down";};
}
{
key = "<C-k>";
action = "<CMD>wincmd k<CR>";
options = { desc = "Navigate Window Up"; };
options = {desc = "Navigate Window Up";};
}
{
key = "<C-l>";
action = "<CMD>wincmd l<CR>";
options = { desc = "Navigate Window Right"; };
options = {desc = "Navigate Window Right";};
}
{
mode = "n";
key = "<leader>w";
action = "<c-w>";
options = { desc = "Windows"; };
options = {desc = "Windows";};
}
{
mode = "n";
key = "<leader>-";
action = "<C-W>s";
options = { desc = "Split Window Below"; };
options = {desc = "Split Window Below";};
}
{
mode = "n";
key = "<leader>|";
action = "<C-W>v";
options = { desc = "Split Window Right"; };
options = {desc = "Split Window Right";};
}
{
mode = "n";
key = "<leader>wd";
action = "<C-W>c";
options = { desc = "Delete Window"; };
options = {desc = "Delete Window";};
}
# Tabs
@@ -229,43 +225,43 @@
mode = "n";
key = "<leader><tab>l";
action = "<CMD>tablast<CR>";
options = { desc = "Last Tab"; };
options = {desc = "Last Tab";};
}
{
mode = "n";
key = "<leader><tab>o";
action = "<CMD>tabonly<CR>";
options = { desc = "Close Other Tabs"; };
options = {desc = "Close Other Tabs";};
}
{
mode = "n";
key = "<leader><tab>f";
action = "<CMD>tabfirst<CR>";
options = { desc = "First Tab"; };
options = {desc = "First Tab";};
}
{
mode = "n";
key = "<leader><tab><tab>";
action = "<CMD>tabnew<CR>";
options = { desc = "New Tab"; };
options = {desc = "New Tab";};
}
{
mode = "n";
key = "<leader><tab>]";
action = "<CMD>tabnext<CR>";
options = { desc = "Next Tab"; };
options = {desc = "Next Tab";};
}
{
mode = "n";
key = "<leader><tab>d";
action = "<CMD>tabclose<CR>";
options = { desc = "Close Tab"; };
options = {desc = "Close Tab";};
}
{
mode = "n";
key = "<leader><tab>[";
action = "<CMD>tabprevious<CR>";
options = { desc = "Previous Tab"; };
options = {desc = "Previous Tab";};
}
# Buffer
@@ -273,55 +269,55 @@
mode = "n";
key = "<S-h>";
action = "<CMD>bprevious<CR>";
options = { desc = "Previous Buffer"; };
options = {desc = "Previous Buffer";};
}
{
mode = "n";
key = "<S-l>";
action = "<CMD>bnext<CR>";
options = { desc = "Next Buffer"; };
options = {desc = "Next Buffer";};
}
{
mode = "n";
key = "<leader>bb";
action = "<CMD>e #<CR>";
options = { desc = "Switch To Other Buffer"; };
options = {desc = "Switch To Other Buffer";};
}
{
mode = "n";
key = "<leader>bd";
action = "<CMD>bd<CR>";
options = { desc = "Delete Buffer and Window"; };
options = {desc = "Delete Buffer and Window";};
}
{
mode = "n";
key = "<leader>bp";
action = "<CMD>BufferLineTogglePin<CR>";
options = { desc = "Toggle Pin"; };
options = {desc = "Toggle Pin";};
}
{
mode = "n";
key = "<leader>bP";
action = "<CMD>BufferLineGroupClose ungrouped<CR>";
options = { desc = "Delete Non-Pinned Buffers"; };
options = {desc = "Delete Non-Pinned Buffers";};
}
{
mode = "n";
key = "<leader>bo";
action = "<CMD>BufferLineCloseOthers<CR>";
options = { desc = "Delete Other Buffers"; };
options = {desc = "Delete Other Buffers";};
}
{
mode = "n";
key = "<leader>br";
action = "<CMD>BufferLineCloseRight<CR>";
options = { desc = "Delete Buffers to the Right"; };
options = {desc = "Delete Buffers to the Right";};
}
{
mode = "n";
key = "<leader>bl";
action = "<CMD>BufferLineCloseLeft<CR>";
options = { desc = "Delete Buffers to the Left"; };
options = {desc = "Delete Buffers to the Left";};
}
# DAP Telescope Actions
@@ -329,25 +325,25 @@
mode = "n";
key = "<leader>d/c";
action = "<CMD>Telescope dap commands<CR>";
options = { desc = "Search Commands"; };
options = {desc = "Search Commands";};
}
{
mode = "n";
key = "<leader>d/b";
action = "<CMD>Telescope dap list_breakpoints<CR>";
options = { desc = "Search Breakpoints"; };
options = {desc = "Search Breakpoints";};
}
{
mode = "n";
key = "<leader>d/v";
action = "<CMD>Telescope dap variables<CR>";
options = { desc = "Search Variables"; };
options = {desc = "Search Variables";};
}
{
mode = "n";
key = "<leader>d/f";
action = "<CMD>Telescope dap frames<CR>";
options = { desc = "Search Frames"; };
options = {desc = "Search Frames";};
}
];
}
+21 -22
View File
@@ -1,8 +1,7 @@
let
selectOpts = "{behavior = cmp.SelectBehavior.Select}";
in
{ pkgs, ... }:
{
{pkgs, ...}: {
plugins = {
cmp = {
enable = true;
@@ -12,7 +11,7 @@ in
debounce = 150;
};
sources = [
{ name = "path"; }
{name = "path";}
{
name = "nvim_lsp";
keywordLength = 1;
@@ -21,7 +20,7 @@ in
name = "buffer";
keywordLength = 3;
}
{ name = "supermaven"; }
{name = "supermaven";}
];
snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end";
@@ -150,7 +149,8 @@ in
prettier.enable = true;
# rubyfmt is broken on darwin-based systems
rubyfmt.enable = (
pkgs.stdenv.hostPlatform.system != "x86_64-darwin"
pkgs.stdenv.hostPlatform.system
!= "x86_64-darwin"
&& pkgs.stdenv.hostPlatform.system != "aarch64-darwin"
);
sqlformat.enable = true;
@@ -173,21 +173,21 @@ in
notify_on_error = true;
formatters_by_ft = {
css = [ "prettier" ];
html = [ "prettier" ];
javascript = [ "prettier" ];
javascriptreact = [ "prettier" ];
json = [ "prettier" ];
just = [ "just" ];
lua = [ "stylua" ];
markdown = [ "prettier" ];
nix = [ "alejandra" ];
ruby = [ "rubyfmt" ];
terraform = [ "tofu_fmt" ];
tf = [ "tofu_fmt" ];
typescript = [ "prettier" ];
typescriptreact = [ "prettier" ];
yaml = [ "yamlfmt" ];
css = ["prettier"];
html = ["prettier"];
javascript = ["prettier"];
javascriptreact = ["prettier"];
json = ["prettier"];
just = ["just"];
lua = ["stylua"];
markdown = ["prettier"];
nix = ["alejandra"];
ruby = ["rubyfmt"];
terraform = ["tofu_fmt"];
tf = ["tofu_fmt"];
typescript = ["prettier"];
typescriptreact = ["prettier"];
yaml = ["yamlfmt"];
};
};
};
@@ -258,6 +258,5 @@ in
use_diagnostic_signs = true;
};
};
};
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
{ pkgs, ... }: {
{pkgs, ...}: {
extraPlugins = with pkgs; [
vimPlugins.supermaven-nvim # AI code completion
vimPlugins.vim-dadbod # DB client
+13 -11
View File
@@ -6,12 +6,14 @@
options = {
always_show_bufferline = false;
buffer_close_icon = "";
offsets = [{
offsets = [
{
filetype = "neo-tree";
text = "Neo-tree";
highlight = "Directory";
text_align = "left";
}];
}
];
diagnostics = "nvim_lsp";
};
};
@@ -27,14 +29,14 @@
};
signcolumn = true;
signs = {
add = { text = ""; };
change = { text = ""; };
changedelete = { text = "~"; };
delete = { text = "_"; };
topdelete = { text = ""; };
untracked = { text = ""; };
add = {text = "";};
change = {text = "";};
changedelete = {text = "~";};
delete = {text = "_";};
topdelete = {text = "";};
untracked = {text = "";};
};
watch_gitdir = { follow_files = true; };
watch_gitdir = {follow_files = true;};
};
};
@@ -50,10 +52,10 @@
mini = {
enable = true;
modules = {
surround = { };
surround = {};
indentscope = {
symbol = "";
options = { try_as_border = true; };
options = {try_as_border = true;};
};
};
};
+1 -1
View File
@@ -3,7 +3,7 @@
onedark = {
enable = true;
settings = {
colors = { yellow = "#d9a950"; };
colors = {yellow = "#d9a950";};
style = "dark";
transparent = true;
};
+3 -2
View File
@@ -1,5 +1,5 @@
let
status = [ "Alternate" "Current" "Inactive" "Visible" ];
status = ["Alternate" "Current" "Inactive" "Visible"];
part = [
"ADDED"
"CHANGED"
@@ -26,7 +26,8 @@ let
"FloatBorder"
];
# "Buffer" + status + part
buffer_status = builtins.foldl' (acc: elem: acc ++ elem) [ ]
buffer_status =
builtins.foldl' (acc: elem: acc ++ elem) []
(builtins.map (status: builtins.map (part: "Buffer" + status + part) part)
status);
in {
+49 -16
View File
@@ -6,18 +6,31 @@
flake-parts.url = "github:hercules-ci/flake-parts";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = { nixvim, flake-parts, rust-overlay, ... }@inputs:
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, ... }:
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};
baseNixvimModule = {
inherit pkgs;
module = { pkgs, ... }: {
module =
{ pkgs, ... }:
{
imports = [ ./config ];
extraPackages = with pkgs; [ sops ];
};
@@ -25,8 +38,13 @@
};
rustNixvimModule = {
inherit pkgs;
module = { pkgs, ... }: {
imports = [ ./config ./config/rust ];
module =
{ pkgs, ... }:
{
imports = [
./config
./config/rust
];
extraPackages = with pkgs; [
sops
rust-bin.stable.latest.default
@@ -36,24 +54,39 @@
};
csharpNixvimModule = {
inherit pkgs;
module = { pkgs, ... }: {
imports = [ ./config ./config/csharp ];
module =
{ pkgs, ... }:
{
imports = [
./config
./config/csharp
];
extraPackages = with pkgs; [ sops ];
};
extraSpecialArgs = { };
};
goNixvimModule = {
inherit pkgs;
module = { pkgs, ... }: {
imports = [ ./config ./config/golang ];
module =
{ pkgs, ... }:
{
imports = [
./config
./config/golang
];
extraPackages = with pkgs; [ sops ];
};
extraSpecialArgs = { };
};
pythonNixvimModule = {
inherit pkgs;
module = { pkgs, ... }: {
imports = [ ./config ./config/python ];
module =
{ pkgs, ... }:
{
imports = [
./config
./config/python
];
extraPackages = with pkgs; [ sops ];
};
extraSpecialArgs = { };
@@ -67,11 +100,11 @@
csharpNvim = nixvim'.makeNixvimWithModule csharpNixvimModule;
goNvim = nixvim'.makeNixvimWithModule goNixvimModule;
pythonNvim = nixvim'.makeNixvimWithModule pythonNixvimModule;
in {
in
{
checks = {
# Run `nix flake check .` to verify that your config is not broken
default =
nixvimLib.check.mkTestDerivationFromNixvimModule baseNixvimModule;
default = nixvimLib.check.mkTestDerivationFromNixvimModule baseNixvimModule;
};
packages = {
# Lets you run `nix run .` to start nixvim