move all files to new nixfmt rfc

This commit is contained in:
Noah Masur
2024-04-20 09:42:06 -04:00
parent b23efc4d77
commit e43fc0f8db
159 changed files with 5309 additions and 4537 deletions

View File

@ -1,4 +1,5 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
# Plugin for aligning text programmatically

View File

@ -1,4 +1,5 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
# Shows buffers in a VSCode-style tab layout
@ -11,7 +12,7 @@
diagnostics = "nvim_lsp";
always_show_bufferline = false;
separator_style = "slant";
offsets = [{ filetype = "NvimTree"; }];
offsets = [ { filetype = "NvimTree"; } ];
};
};
lua = ''

View File

@ -1,4 +1,10 @@
{ pkgs, lib, config, ... }: {
{
pkgs,
lib,
config,
...
}:
{
# Sets Neovim colors based on Nix colorscheme
@ -18,5 +24,4 @@
}
'';
};
}

View File

@ -1,4 +1,5 @@
{ pkgs, dsl, ... }: {
{ pkgs, dsl, ... }:
{
plugins = [
pkgs.vimPlugins.cmp-nvim-lsp
@ -25,21 +26,15 @@
# Basic completion keybinds
mapping = {
"['<C-n>']" = dsl.rawLua
"require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Insert })";
"['<C-p>']" = dsl.rawLua
"require('cmp').mapping.select_prev_item({ behavior = require('cmp').SelectBehavior.Insert })";
"['<Down>']" = dsl.rawLua
"require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Select })";
"['<Up>']" = dsl.rawLua
"require('cmp').mapping.select_prev_item({ behavior = require('cmp').SelectBehavior.Select })";
"['<C-n>']" = dsl.rawLua "require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Insert })";
"['<C-p>']" = dsl.rawLua "require('cmp').mapping.select_prev_item({ behavior = require('cmp').SelectBehavior.Insert })";
"['<Down>']" = dsl.rawLua "require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Select })";
"['<Up>']" = dsl.rawLua "require('cmp').mapping.select_prev_item({ behavior = require('cmp').SelectBehavior.Select })";
"['<C-d>']" = dsl.rawLua "require('cmp').mapping.scroll_docs(-4)";
"['<C-f>']" = dsl.rawLua "require('cmp').mapping.scroll_docs(4)";
"['<C-e>']" = dsl.rawLua "require('cmp').mapping.abort()";
"['<CR>']" = dsl.rawLua
"require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Replace, select = true, })";
"['<C-r>']" = dsl.rawLua
"require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Replace, select = true, })";
"['<CR>']" = dsl.rawLua "require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Replace, select = true, })";
"['<C-r>']" = dsl.rawLua "require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Replace, select = true, })";
"['<Esc>']" = dsl.rawLua ''
function(_)
cmp.mapping({
@ -72,13 +67,19 @@
name = "rg"; # Grep for text from the current directory
keyword_length = 6;
max_item_count = 10;
option = { additional_arguments = "--ignore-case"; };
option = {
additional_arguments = "--ignore-case";
};
}
];
# Styling of the completion menu
formatting = {
fields = [ "kind" "abbr" "menu" ];
fields = [
"kind"
"abbr"
"menu"
];
format = dsl.rawLua ''
function(entry, vim_item)
local kind_icons = {
@ -125,7 +126,6 @@
native_menu = false; # Use cmp menu instead of Vim menu
ghost_text = true; # Show preview auto-completion
};
};
lua = ''
@ -145,5 +145,4 @@
}),
})
'';
}

View File

@ -1,4 +1,5 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
plugins = [ pkgs.vimPlugins.gitsigns-nvim ];
setup.gitsigns = { };
lua = builtins.readFile ./gitsigns.lua;

View File

@ -1,4 +1,10 @@
{ pkgs, dsl, lib, ... }: {
{
pkgs,
dsl,
lib,
...
}:
{
plugins = [
pkgs.vimPlugins.vim-surround # Keybinds for surround characters
pkgs.vimPlugins.vim-eunuch # File manipulation commands
@ -13,7 +19,11 @@
# Initialize some plugins
setup.Comment = { };
setup.colorizer = { user_default_options = { names = false; }; };
setup.colorizer = {
user_default_options = {
names = false;
};
};
setup.glow = { };
setup.which-key = { };
setup.kitty-scrollback = { };
@ -54,12 +64,15 @@
vim.o.backup = true; # Easier to recover and more secure
vim.bo.swapfile = false; # Instead of swaps, create backups
vim.bo.undofile = true; # Keeps undos after quit
vim.o.backupdir =
dsl.rawLua ''vim.fn.expand("~/.local/state/nvim/backup//")'';
vim.o.backupdir = dsl.rawLua ''vim.fn.expand("~/.local/state/nvim/backup//")'';
vim.o.undodir = dsl.rawLua ''vim.fn.expand("~/.local/state/nvim/undo//")'';
# Required for nvim-cmp completion
vim.opt.completeopt = [ "menu" "menuone" "noselect" ];
vim.opt.completeopt = [
"menu"
"menuone"
"noselect"
];
lua = lib.mkBefore ''
vim.loader.enable()

View File

@ -1,4 +1,5 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
plugins = [ pkgs.vimPlugins.lualine-nvim ];
setup.lualine = {
options = {

View File

@ -1,8 +1,9 @@
{ pkgs, lib, ... }: {
{ pkgs, lib, ... }:
{
plugins = [
(pkgs.vimPlugins.nvim-treesitter.withPlugins (_plugins:
with pkgs.tree-sitter-grammars; [
(pkgs.vimPlugins.nvim-treesitter.withPlugins (
_plugins: with pkgs.tree-sitter-grammars; [
tree-sitter-bash
tree-sitter-c
tree-sitter-fish
@ -19,7 +20,8 @@
tree-sitter-toml
tree-sitter-vimdoc
tree-sitter-yaml
]))
]
))
pkgs.vimPlugins.vim-matchup # Better % jumping in languages
pkgs.vimPlugins.playground # Tree-sitter experimenting
pkgs.vimPlugins.nginx-vim
@ -34,9 +36,15 @@
];
setup."nvim-treesitter.configs" = {
highlight = { enable = true; };
indent = { enable = true; };
matchup = { enable = true; }; # Uses vim-matchup
highlight = {
enable = true;
};
indent = {
enable = true;
};
matchup = {
enable = true;
}; # Uses vim-matchup
textobjects = {
select = {
@ -70,5 +78,4 @@
-- Use HCL parser with .tf files
vim.treesitter.language.register('hcl', 'terraform')
'';
}

View File

@ -1,4 +1,5 @@
{ pkgs, dsl, ... }: {
{ pkgs, dsl, ... }:
{
# Telescope is a fuzzy finder that can work with different sub-plugins
@ -20,9 +21,15 @@
};
};
pickers = {
find_files = { theme = "ivy"; };
oldfiles = { theme = "ivy"; };
buffers = { theme = "dropdown"; };
find_files = {
theme = "ivy";
};
oldfiles = {
theme = "ivy";
};
buffers = {
theme = "dropdown";
};
};
extensions = {
fzy_native = { };
@ -33,5 +40,4 @@
setup.project_nvim = { };
lua = builtins.readFile ./telescope.lua;
}

View File

@ -1,4 +1,10 @@
{ pkgs, dsl, config, ... }: {
{
pkgs,
dsl,
config,
...
}:
{
# Toggleterm provides a floating terminal inside the editor for quick access
@ -15,5 +21,4 @@
${if config.github then (builtins.readFile ./github.lua) else ""}
${if config.kubernetes then (builtins.readFile ./kubernetes.lua) else ""}
'';
}

View File

@ -1,8 +1,12 @@
{ pkgs, dsl, ... }: {
{ pkgs, dsl, ... }:
{
# This plugin creates a side drawer for navigating the current project
plugins = [ pkgs.vimPlugins.nvim-tree-lua pkgs.vimPlugins.nvim-web-devicons ];
plugins = [
pkgs.vimPlugins.nvim-tree-lua
pkgs.vimPlugins.nvim-web-devicons
];
# Disable netrw eagerly
# https://github.com/kyazdani42/nvim-tree.lua/commit/fb8735e96cecf004fbefb086ce85371d003c5129
@ -16,12 +20,14 @@
hijack_netrw = true; # Works as the file manager
sync_root_with_cwd = true; # Change project whenever currend dir changes
respect_buf_cwd = true; # Change to exact location of focused buffer
update_focused_file = { # Change project based on the focused buffer
update_focused_file = {
# Change project based on the focused buffer
enable = true;
update_root = true;
ignore_list = { };
};
diagnostics = { # Enable LSP and linter integration
diagnostics = {
# Enable LSP and linter integration
enable = true;
icons = {
hint = "";
@ -30,7 +36,8 @@
error = "";
};
};
renderer = { # Show files with changes vs. current commit
renderer = {
# Show files with changes vs. current commit
icons = {
glyphs = {
git = {
@ -61,7 +68,8 @@
vim.keymap.set('n', 'v', api.node.open.vertical, opts('Open: Vertical Split'))
end
'';
view = { # Set look and feel
view = {
# Set look and feel
width = 30;
side = "left";
number = false;
@ -73,5 +81,4 @@
lua = ''
vim.keymap.set("n", "<Leader>e", ":NvimTreeFindFileToggle<CR>", { silent = true })
'';
}