feat: migrating neovim
This commit is contained in:
parent
86266f8205
commit
8d5e0e6566
47 changed files with 1964 additions and 222 deletions
|
|
@ -27,6 +27,8 @@
|
|||
../modules/ssh.nix
|
||||
../modules/gh-dash.nix
|
||||
../modules/ags.nix
|
||||
../modules/neovim
|
||||
../modules/yazi.nix
|
||||
];
|
||||
|
||||
nixpkgs = {
|
||||
|
|
@ -39,9 +41,7 @@
|
|||
|
||||
# You can also add overlays exported from other flakes:
|
||||
# neovim-nightly-overlay.overlays.default
|
||||
(final: prev: {
|
||||
neovim = inputs.neovim-config.packages."x86_64-linux".default;
|
||||
})
|
||||
(final: prev: {neovim = inputs.neovim-config.packages."x86_64-linux".default;})
|
||||
|
||||
# Or define it inline, for example:
|
||||
# (final: prev: {
|
||||
|
|
@ -65,8 +65,8 @@
|
|||
};
|
||||
|
||||
stylix = {
|
||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/tokyo-night-terminal-storm.yaml";
|
||||
image = ./wallpaper.jpg;
|
||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-macchiato.yaml";
|
||||
image = ../../wallpapers/nix-black-4k.png;
|
||||
autoEnable = true;
|
||||
enable = true;
|
||||
|
||||
|
|
@ -103,9 +103,7 @@
|
|||
|
||||
# Add stuff for your user as you see fit:
|
||||
# programs.neovim.enable = true;
|
||||
home.packages = with pkgs; [
|
||||
openvpn
|
||||
];
|
||||
home.packages = with pkgs; [openvpn];
|
||||
|
||||
# Enable home-manager and git
|
||||
programs.home-manager.enable = true;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@
|
|||
../modules/devenv.nix
|
||||
../modules/gh-dash.nix
|
||||
../modules/ssh.nix
|
||||
../modules/neovim/default.nix
|
||||
../modules/yazi.nix
|
||||
];
|
||||
|
||||
nixpkgs = {
|
||||
|
|
@ -37,9 +39,9 @@
|
|||
|
||||
# You can also add overlays exported from other flakes:
|
||||
# neovim-nightly-overlay.overlays.default
|
||||
(final: prev: {
|
||||
neovim = inputs.neovim-config.packages."x86_64-linux".default;
|
||||
})
|
||||
# (final: prev: {
|
||||
# neovim = inputs.neovim-config.packages."x86_64-linux".default;
|
||||
# })
|
||||
|
||||
# Or define it inline, for example:
|
||||
# (final: prev: {
|
||||
|
|
@ -63,10 +65,12 @@
|
|||
};
|
||||
|
||||
stylix = {
|
||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/tokyo-night-terminal-storm.yaml";
|
||||
image = ./wallpaper.jpg;
|
||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-macchiato.yaml";
|
||||
image = ../../wallpapers/nix-black-4k.png;
|
||||
# polarity = "dark";
|
||||
autoEnable = true;
|
||||
enable = true;
|
||||
targets.nixvim.enable = false;
|
||||
|
||||
opacity.terminal = 1.0;
|
||||
fonts.sizes.terminal = 20;
|
||||
|
|
@ -101,9 +105,7 @@
|
|||
|
||||
# Add stuff for your user as you see fit:
|
||||
# programs.neovim.enable = true;
|
||||
home.packages = with pkgs; [
|
||||
openvpn
|
||||
];
|
||||
home.packages = with pkgs; [openvpn];
|
||||
|
||||
# Enable home-manager and git
|
||||
programs.home-manager.enable = true;
|
||||
|
|
|
|||
BIN
home-manager/machines/wallpaper2.png
Normal file
BIN
home-manager/machines/wallpaper2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.4 MiB |
|
|
@ -10,6 +10,7 @@
|
|||
gtksourceview
|
||||
webkitgtk
|
||||
accountsservice
|
||||
libdbusmenu-gtk3
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
# A fast, GPU-accelerated terminal emulator.
|
||||
{...}: {
|
||||
{pkgs, ...}: {
|
||||
programs.alacritty = {
|
||||
enable = true;
|
||||
settings = {
|
||||
env = {TERM = "xterm-256color";};
|
||||
env = {
|
||||
TERM = "xterm-256color";
|
||||
};
|
||||
};
|
||||
};
|
||||
home.packages = with pkgs; [ueberzugpp];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
home.packages = with pkgs;
|
||||
[
|
||||
# Editors
|
||||
neovim # Improved version of vim, often used with overlays.
|
||||
# neovim # Improved version of vim, often used with overlays.
|
||||
vim # Highly configurable text editor popular for efficiency and extensibility.
|
||||
|
||||
# Builtin Replacements
|
||||
|
|
@ -53,6 +53,9 @@
|
|||
tree # Displays directory structure in a tree-like format.
|
||||
unzip # Command-line tool for extracting files from ZIP archives.
|
||||
yt-dlp # Fork of youtube-dl, facilitating video downloads from various sites.
|
||||
age
|
||||
portal
|
||||
atac
|
||||
|
||||
# TUI Apps
|
||||
#ncdu_2
|
||||
|
|
@ -77,6 +80,7 @@
|
|||
entr # Event notifier for automation and development, executing commands whenever files change in the specified directory.
|
||||
git-cliff # Tool for visualizing project commit history and generating release notes.
|
||||
grex # Tool generating regular expressions from user-provided test cases.
|
||||
sshs
|
||||
|
||||
# Nix Tools
|
||||
alejandra # Nix code formatter.
|
||||
|
|
|
|||
26
home-manager/modules/neovim/default.nix
Normal file
26
home-manager/modules/neovim/default.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# A cat clone with syntax highlighting and Git integration.
|
||||
{inputs, ...}: {
|
||||
imports = [
|
||||
inputs.nixvim.homeManagerModules.nixvim
|
||||
./options.nix
|
||||
./plugins
|
||||
];
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
luaLoader.enable = true;
|
||||
|
||||
performance = {
|
||||
combinePlugins = {
|
||||
enable = true;
|
||||
standalonePlugins = [
|
||||
"hmts.nvim"
|
||||
"nvim-treesitter"
|
||||
];
|
||||
};
|
||||
byteCompileLua.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
64
home-manager/modules/neovim/options.nix
Normal file
64
home-manager/modules/neovim/options.nix
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
{
|
||||
programs.nixvim = {
|
||||
globals = {
|
||||
mapleader = " ";
|
||||
# Disable useless providers
|
||||
loaded_ruby_provider = 0; # Ruby
|
||||
loaded_perl_provider = 0; # Perl
|
||||
loaded_python_provider = 0; # Python 2
|
||||
};
|
||||
|
||||
clipboard = {
|
||||
# Use system clipboard
|
||||
register = "unnamedplus";
|
||||
|
||||
providers.wl-copy.enable = true;
|
||||
};
|
||||
|
||||
opts = {
|
||||
updatetime = 100; # Faster completion
|
||||
|
||||
# Line numbers
|
||||
relativenumber = true; # Relative line numbers
|
||||
number = true; # Display the absolute line number of the current line
|
||||
hidden = true; # Keep closed buffer open in the background
|
||||
mouse = "a"; # Enable mouse control
|
||||
mousemodel = "extend"; # Mouse right-click extends the current selection
|
||||
splitbelow = true; # A new window is put below the current one
|
||||
splitright = true; # A new window is put right of the current one
|
||||
|
||||
swapfile = false; # Disable the swap file
|
||||
modeline = true; # Tags such as 'vim:ft=sh'
|
||||
modelines = 100; # Sets the type of modelines
|
||||
undofile = true; # Automatically save and restore undo history
|
||||
incsearch = true; # Incremental search: show match for partly typed search command
|
||||
inccommand = "split"; # Search and replace: preview changes in quickfix list
|
||||
ignorecase = true; # When the search query is lower-case, match both lower and upper-case
|
||||
# patterns
|
||||
smartcase = true; # Override the 'ignorecase' option if the search pattern contains upper
|
||||
# case characters
|
||||
scrolloff = 8; # Number of screen lines to show around the cursor
|
||||
cursorline = false; # Highlight the screen line of the cursor
|
||||
cursorcolumn = false; # Highlight the screen column of the cursor
|
||||
signcolumn = "yes"; # Whether to show the signcolumn
|
||||
colorcolumn = ""; # Columns to highlight
|
||||
laststatus = 3; # When to use a status line for the last window
|
||||
fileencoding = "utf-8"; # File-content encoding for the current buffer
|
||||
termguicolors = true; # Enables 24-bit RGB color in the |TUI|
|
||||
spell = false; # Highlight spelling mistakes (local to window)
|
||||
wrap = false; # Prevent text from wrapping
|
||||
|
||||
# Tab options
|
||||
tabstop = 4; # Number of spaces a <Tab> in the text stands for (local to buffer)
|
||||
shiftwidth = 4; # Number of spaces used for each step of (auto)indent (local to buffer)
|
||||
expandtab = true; # Expand <Tab> to spaces in Insert mode (local to buffer)
|
||||
autoindent = true; # Do clever autoindenting
|
||||
|
||||
textwidth = 0; # Maximum width of text that is being inserted. A longer line will be
|
||||
# broken after white space to get this width.
|
||||
|
||||
# Folding
|
||||
foldlevel = 99; # Folds with a level higher than this number will be closed
|
||||
};
|
||||
};
|
||||
}
|
||||
7
home-manager/modules/neovim/plugins/autopairs.nix
Normal file
7
home-manager/modules/neovim/plugins/autopairs.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins.nvim-autopairs = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
231
home-manager/modules/neovim/plugins/bufferline.nix
Normal file
231
home-manager/modules/neovim/plugins/bufferline.nix
Normal file
|
|
@ -0,0 +1,231 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins.bufferline = let
|
||||
mouse = {
|
||||
right =
|
||||
# lua
|
||||
"'vertical sbuffer %d'";
|
||||
close =
|
||||
# lua
|
||||
''
|
||||
function(bufnum)
|
||||
require("mini.bufremove").delete(bufnum)
|
||||
end
|
||||
'';
|
||||
};
|
||||
in {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
options = {
|
||||
mode = "buffers";
|
||||
always_show_bufferline = true;
|
||||
buffer_close_icon = "";
|
||||
close_command.__raw = mouse.close;
|
||||
close_icon = "";
|
||||
diagnostics = "nvim_lsp";
|
||||
diagnostics_indicator =
|
||||
# lua
|
||||
''
|
||||
function(count, level, diagnostics_dict, context)
|
||||
local s = ""
|
||||
for e, n in pairs(diagnostics_dict) do
|
||||
local sym = e == "error" and " "
|
||||
or (e == "warning" and " " or "" )
|
||||
if(sym ~= "") then
|
||||
s = s .. " " .. n .. sym
|
||||
end
|
||||
end
|
||||
return s
|
||||
end
|
||||
'';
|
||||
# Will make sure all names in bufferline are unique
|
||||
enforce_regular_tabs = false;
|
||||
|
||||
groups = {
|
||||
options = {
|
||||
toggle_hidden_on_enter = true;
|
||||
};
|
||||
|
||||
items = [
|
||||
{
|
||||
name = "Tests";
|
||||
highlight = {
|
||||
underline = true;
|
||||
fg = "#a6da95";
|
||||
sp = "#494d64";
|
||||
};
|
||||
priority = 2;
|
||||
# icon = "";
|
||||
matcher.__raw =
|
||||
# lua
|
||||
''
|
||||
function(buf)
|
||||
return buf.name:match('%test') or buf.name:match('%.spec')
|
||||
end
|
||||
'';
|
||||
}
|
||||
{
|
||||
name = "Docs";
|
||||
highlight = {
|
||||
undercurl = true;
|
||||
fg = "#ffffff";
|
||||
sp = "#494d64";
|
||||
};
|
||||
auto_close = false;
|
||||
matcher.__raw =
|
||||
# lua
|
||||
''
|
||||
function(buf)
|
||||
return buf.name:match('%.md') or buf.name:match('%.txt')
|
||||
end
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
indicator = {
|
||||
style = "icon";
|
||||
icon = "▎";
|
||||
};
|
||||
|
||||
left_trunc_marker = "";
|
||||
max_name_length = 18;
|
||||
max_prefix_length = 15;
|
||||
modified_icon = "●";
|
||||
|
||||
numbers.__raw =
|
||||
# lua
|
||||
''
|
||||
function(opts)
|
||||
return string.format('%s·%s', opts.raise(opts.id), opts.lower(opts.ordinal))
|
||||
end
|
||||
'';
|
||||
|
||||
persist_buffer_sort = true;
|
||||
right_mouse_command.__raw = mouse.right;
|
||||
right_trunc_marker = "";
|
||||
separator_style = "slant";
|
||||
show_buffer_close_icons = true;
|
||||
show_buffer_icons = true;
|
||||
show_close_icon = true;
|
||||
show_tab_indicators = true;
|
||||
sort_by = "extension";
|
||||
tab_size = 18;
|
||||
|
||||
offsets = [
|
||||
{
|
||||
filetype = "neo-tree";
|
||||
text = "File Explorer";
|
||||
text_align = "center";
|
||||
highlight = "Directory";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# NOTE: fixes colorscheme with transparent_background
|
||||
# and better contrast selected tabs
|
||||
highlights = let
|
||||
commonBgColor = "#363a4f";
|
||||
commonFgColor = "#1e2030";
|
||||
|
||||
commonSelectedAttrs = {
|
||||
bg = commonBgColor;
|
||||
};
|
||||
|
||||
# Define a set with common selected attributes
|
||||
selectedAttrsSet = builtins.listToAttrs (
|
||||
map
|
||||
(name: {
|
||||
inherit name;
|
||||
value = commonSelectedAttrs;
|
||||
})
|
||||
[
|
||||
# "separator_selected" # Handled uniquely
|
||||
"buffer_selected"
|
||||
"tab_selected"
|
||||
"numbers_selected"
|
||||
"close_button_selected"
|
||||
"duplicate_selected"
|
||||
"modified_selected"
|
||||
"info_selected"
|
||||
"warning_selected"
|
||||
"error_selected"
|
||||
"hint_selected"
|
||||
"diagnostic_selected"
|
||||
"info_diagnostic_selected"
|
||||
"warning_diagnostic_selected"
|
||||
"error_diagnostic_selected"
|
||||
"hint_diagnostic_selected"
|
||||
]
|
||||
);
|
||||
in
|
||||
# Merge the common selected attributes with the unique attributes
|
||||
selectedAttrsSet
|
||||
// {
|
||||
fill = {
|
||||
bg = commonFgColor;
|
||||
};
|
||||
separator = {
|
||||
fg = commonFgColor;
|
||||
};
|
||||
separator_visible = {
|
||||
fg = commonFgColor;
|
||||
};
|
||||
separator_selected = {
|
||||
bg = commonBgColor;
|
||||
fg = commonFgColor;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bP";
|
||||
action = ":BufferLineTogglePin<cr>";
|
||||
options = {
|
||||
desc = "Pin buffer toggle";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bp";
|
||||
action = ":BufferLinePick<cr>";
|
||||
options = {
|
||||
desc = "Pick Buffer";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bsd";
|
||||
action = ":BufferLineSortByDirectory<cr>";
|
||||
options = {
|
||||
desc = "Sort By Directory";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bse";
|
||||
action = ":BufferLineSortByExtension<cr>";
|
||||
options = {
|
||||
desc = "Sort By Extension";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bsr";
|
||||
action = ":BufferLineSortByRelativeDirectory<cr>";
|
||||
options = {
|
||||
desc = "Sort By Relative Directory";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
65
home-manager/modules/neovim/plugins/catppuccin.nix
Normal file
65
home-manager/modules/neovim/plugins/catppuccin.nix
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
_: {
|
||||
programs.nixvim = {
|
||||
colorschemes.catppuccin = {
|
||||
enable = true;
|
||||
settings = {
|
||||
dim_inactive = {
|
||||
enabled = false;
|
||||
percentage = 0.25;
|
||||
};
|
||||
|
||||
flavour = "macchiato";
|
||||
|
||||
integrations = {
|
||||
aerial = true;
|
||||
cmp = true;
|
||||
dap = {
|
||||
enabled = true;
|
||||
enable_ui = true;
|
||||
};
|
||||
gitsigns = true;
|
||||
headlines = true;
|
||||
markdown = true;
|
||||
mason = true;
|
||||
mini.enabled = true;
|
||||
|
||||
native_lsp = {
|
||||
enabled = true;
|
||||
virtual_text = {
|
||||
errors = ["italic"];
|
||||
hints = ["italic"];
|
||||
warnings = ["italic"];
|
||||
information = ["italic"];
|
||||
};
|
||||
underlines = {
|
||||
errors = ["underline"];
|
||||
hints = ["underline"];
|
||||
warnings = ["underline"];
|
||||
information = ["underline"];
|
||||
};
|
||||
inlay_hints = {
|
||||
background = false;
|
||||
};
|
||||
};
|
||||
|
||||
neogit = true;
|
||||
neotree = false;
|
||||
noice = true;
|
||||
notify = true;
|
||||
rainbow_delimiters = true;
|
||||
sandwich = true;
|
||||
semantic_tokens = true;
|
||||
symbols_outline = true;
|
||||
telescope = {
|
||||
enabled = true;
|
||||
# style = "nvchad";
|
||||
};
|
||||
treesitter = true;
|
||||
which_key = true;
|
||||
};
|
||||
|
||||
transparent_background = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
7
home-manager/modules/neovim/plugins/comment.nix
Normal file
7
home-manager/modules/neovim/plugins/comment.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins.comment = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
231
home-manager/modules/neovim/plugins/conform.nix
Normal file
231
home-manager/modules/neovim/plugins/conform.nix
Normal file
|
|
@ -0,0 +1,231 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
programs.nixvim = {
|
||||
extraConfigLuaPre =
|
||||
# lua
|
||||
''
|
||||
local slow_format_filetypes = {}
|
||||
|
||||
vim.api.nvim_create_user_command("FormatDisable", function(args)
|
||||
if args.bang then
|
||||
-- FormatDisable! will disable formatting just for this buffer
|
||||
vim.b.disable_autoformat = true
|
||||
else
|
||||
vim.g.disable_autoformat = true
|
||||
end
|
||||
end, {
|
||||
desc = "Disable autoformat-on-save",
|
||||
bang = true,
|
||||
})
|
||||
vim.api.nvim_create_user_command("FormatEnable", function()
|
||||
vim.b.disable_autoformat = false
|
||||
vim.g.disable_autoformat = false
|
||||
end, {
|
||||
desc = "Re-enable autoformat-on-save",
|
||||
})
|
||||
vim.api.nvim_create_user_command("FormatToggle", function(args)
|
||||
if args.bang then
|
||||
-- Toggle formatting for current buffer
|
||||
vim.b.disable_autoformat = not vim.b.disable_autoformat
|
||||
else
|
||||
-- Toggle formatting globally
|
||||
vim.g.disable_autoformat = not vim.g.disable_autoformat
|
||||
end
|
||||
end, {
|
||||
desc = "Toggle autoformat-on-save",
|
||||
bang = true,
|
||||
})
|
||||
'';
|
||||
|
||||
plugins = {
|
||||
conform-nvim = {
|
||||
enable = true;
|
||||
|
||||
formatOnSave =
|
||||
# lua
|
||||
''
|
||||
function(bufnr)
|
||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||
return
|
||||
end
|
||||
|
||||
if slow_format_filetypes[vim.bo[bufnr].filetype] then
|
||||
return
|
||||
end
|
||||
|
||||
local function on_format(err)
|
||||
if err and err:match("timeout$") then
|
||||
slow_format_filetypes[vim.bo[bufnr].filetype] = true
|
||||
end
|
||||
end
|
||||
|
||||
return { timeout_ms = 200, lsp_fallback = true }, on_format
|
||||
end
|
||||
'';
|
||||
|
||||
formatAfterSave =
|
||||
# lua
|
||||
''
|
||||
function(bufnr)
|
||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||
return
|
||||
end
|
||||
|
||||
if not slow_format_filetypes[vim.bo[bufnr].filetype] then
|
||||
return
|
||||
end
|
||||
|
||||
return { lsp_fallback = true }
|
||||
end
|
||||
'';
|
||||
|
||||
# NOTE:
|
||||
# Conform will run multiple formatters sequentially
|
||||
# [ "1" "2" "3"]
|
||||
# Use a sub-list to run only the first available formatter
|
||||
# [ ["1"] ["2"] ["3"] ]
|
||||
# Use the "*" filetype to run formatters on all filetypes.
|
||||
# Use the "_" filetype to run formatters on filetypes that don't
|
||||
# have other formatters configured.
|
||||
formattersByFt = {
|
||||
bash = [
|
||||
"shellcheck"
|
||||
"shellharden"
|
||||
"shfmt"
|
||||
];
|
||||
bicep = ["bicep"];
|
||||
c = ["clang_format"];
|
||||
cmake = ["cmake-format"];
|
||||
cpp = ["clang_format"];
|
||||
cs = ["csharpier"];
|
||||
css = ["stylelint"];
|
||||
fish = ["fish_indent"];
|
||||
fsharp = ["fantomas"];
|
||||
haskell = ["ormolu"];
|
||||
javascript = [
|
||||
[
|
||||
"prettierd"
|
||||
"prettier"
|
||||
]
|
||||
];
|
||||
json = ["jq"];
|
||||
lua = ["stylua"];
|
||||
markdown = ["deno_fmt"];
|
||||
nix = ["nixfmt"];
|
||||
python = [
|
||||
"isort"
|
||||
"black"
|
||||
];
|
||||
rust = ["rustfmt"];
|
||||
sh = [
|
||||
"shellcheck"
|
||||
"shellharden"
|
||||
"shfmt"
|
||||
];
|
||||
sql = ["sqlfluff"];
|
||||
swift = ["swift_format"];
|
||||
terraform = ["terraform_fmt"];
|
||||
toml = ["taplo"];
|
||||
typescript = [
|
||||
[
|
||||
"prettierd"
|
||||
"prettier"
|
||||
]
|
||||
];
|
||||
xml = [
|
||||
"xmlformat"
|
||||
"xmllint"
|
||||
];
|
||||
yaml = ["yamlfmt"];
|
||||
zig = ["zigfmt"];
|
||||
"_" = [
|
||||
"squeeze_blanks"
|
||||
"trim_whitespace"
|
||||
"trim_newlines"
|
||||
];
|
||||
};
|
||||
|
||||
formatters = {
|
||||
black = {
|
||||
command = lib.getExe pkgs.black;
|
||||
};
|
||||
bicep = {
|
||||
command = lib.getExe pkgs.bicep;
|
||||
};
|
||||
cmake-format = {
|
||||
command = lib.getExe pkgs.cmake-format;
|
||||
};
|
||||
csharpier = {
|
||||
command = lib.getExe pkgs.csharpier;
|
||||
};
|
||||
deno_fmt = {
|
||||
command = lib.getExe pkgs.deno;
|
||||
};
|
||||
isort = {
|
||||
command = lib.getExe pkgs.isort;
|
||||
};
|
||||
fantomas = {
|
||||
command = lib.getExe pkgs.fantomas;
|
||||
};
|
||||
ormolu = {
|
||||
command = lib.getExe pkgs.ormolu;
|
||||
};
|
||||
jq = {
|
||||
command = lib.getExe pkgs.jq;
|
||||
};
|
||||
nixfmt = {
|
||||
command = lib.getExe pkgs.nixfmt-rfc-style;
|
||||
};
|
||||
prettierd = {
|
||||
command = lib.getExe pkgs.prettierd;
|
||||
};
|
||||
rustfmt = {
|
||||
command = lib.getExe pkgs.rustfmt;
|
||||
};
|
||||
shellcheck = {
|
||||
command = lib.getExe pkgs.shellcheck;
|
||||
};
|
||||
shfmt = {
|
||||
command = lib.getExe pkgs.shfmt;
|
||||
};
|
||||
shellharden = {
|
||||
command = lib.getExe pkgs.shellharden;
|
||||
};
|
||||
sqlfluff = {
|
||||
command = lib.getExe pkgs.sqlfluff;
|
||||
};
|
||||
squeeze_blanks = {
|
||||
comamnd = lib.getExe' pkgs.coreutils "cat";
|
||||
};
|
||||
stylelint = {
|
||||
command = lib.getExe pkgs.stylelint;
|
||||
};
|
||||
stylua = {
|
||||
command = lib.getExe pkgs.stylua;
|
||||
};
|
||||
swift_format = {
|
||||
command = lib.getExe pkgs.swift-format;
|
||||
};
|
||||
taplo = {
|
||||
command = lib.getExe pkgs.taplo;
|
||||
};
|
||||
terraform_fmt = {
|
||||
command = lib.getExe pkgs.terraform;
|
||||
};
|
||||
xmlformat = {
|
||||
command = lib.getExe pkgs.xmlformat;
|
||||
};
|
||||
yamlfmt = {
|
||||
command = lib.getExe pkgs.yamlfmt;
|
||||
};
|
||||
zigfmt = {
|
||||
command = lib.getExe pkgs.zig;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
33
home-manager/modules/neovim/plugins/default.nix
Normal file
33
home-manager/modules/neovim/plugins/default.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
_: {
|
||||
imports = [
|
||||
# ./none-ls.nix
|
||||
./autopairs.nix
|
||||
./bufferline.nix
|
||||
./catppuccin.nix
|
||||
./comment.nix
|
||||
./conform.nix
|
||||
./diffview.nix
|
||||
./flash.nix
|
||||
./git-conflict.nix
|
||||
./gitsigns.nix
|
||||
./harpoon.nix
|
||||
./illuminate.nix
|
||||
./lightbulb.nix
|
||||
./lualine.nix
|
||||
./lsp.nix
|
||||
./mini-bufremove.nix
|
||||
./navic.nix
|
||||
./nix.nix
|
||||
./noice.nix
|
||||
./notify.nix
|
||||
./precognition.nix
|
||||
./spectre.nix
|
||||
./telescope.nix
|
||||
./todo-comments.nix
|
||||
./toggleterm.nix
|
||||
./treesitter.nix
|
||||
./trouble.nix
|
||||
./which-key.nix
|
||||
./yazi.nix
|
||||
];
|
||||
}
|
||||
32
home-manager/modules/neovim/plugins/diffview.nix
Normal file
32
home-manager/modules/neovim/plugins/diffview.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins = {
|
||||
diffview = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>gd";
|
||||
action.__raw =
|
||||
# lua
|
||||
''
|
||||
function()
|
||||
vim.g.diffview_enabled = not vim.g.diffview_enabled
|
||||
if vim.g.diffview_enabled then
|
||||
vim.cmd('DiffviewClose')
|
||||
else
|
||||
vim.cmd('DiffviewOpen')
|
||||
end
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
desc = "Git Diff toggle";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
93
home-manager/modules/neovim/plugins/flash.nix
Normal file
93
home-manager/modules/neovim/plugins/flash.nix
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins.flash = {
|
||||
enable = true;
|
||||
settings = {
|
||||
labels = "rsthnaio";
|
||||
};
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = [
|
||||
"n"
|
||||
"x"
|
||||
"o"
|
||||
];
|
||||
key = "s";
|
||||
action.__raw = ''
|
||||
function()
|
||||
require("flash").jump()
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Flash";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = [
|
||||
"n"
|
||||
"x"
|
||||
"o"
|
||||
];
|
||||
key = "S";
|
||||
action.__raw = ''
|
||||
function()
|
||||
require("flash").treesitter()
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Flash Treesitter";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "o";
|
||||
key = "r";
|
||||
action.__raw = ''
|
||||
function()
|
||||
require("flash").remote()
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Flash Remote";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = [
|
||||
"o"
|
||||
"x"
|
||||
];
|
||||
key = "R";
|
||||
action.__raw = ''
|
||||
function()
|
||||
require("flash").treesitter_search()
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Treesitter Search";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "c";
|
||||
key = "<c-s>";
|
||||
action.__raw = ''
|
||||
function()
|
||||
require("flash").toggle()
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Toggle Flash Search";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
20
home-manager/modules/neovim/plugins/git-conflict.nix
Normal file
20
home-manager/modules/neovim/plugins/git-conflict.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
_: {
|
||||
programs.nixvim = {
|
||||
plugins = {
|
||||
git-conflict = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
default_mappings = {
|
||||
ours = "co";
|
||||
theirs = "ct";
|
||||
none = "c0";
|
||||
both = "cb";
|
||||
next = "]x";
|
||||
prev = "[x";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
118
home-manager/modules/neovim/plugins/gitsigns.nix
Normal file
118
home-manager/modules/neovim/plugins/gitsigns.nix
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins.gitsigns = {
|
||||
enable = true;
|
||||
settings = {
|
||||
signs = {
|
||||
add.text = "▎";
|
||||
change.text = "▎";
|
||||
delete.text = "";
|
||||
topdelete.text = "";
|
||||
changedelete.text = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>gs";
|
||||
action = "<cmd>Gitsigns stage_hunk<CR>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Stage Hunk";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>gr";
|
||||
action = "<cmd>Gitsigns reset_hunk<CR>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Reset Hunk";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "v";
|
||||
key = "<leader>gs";
|
||||
action = "<cmd>lua function() Gitsigns stage_hunk {vim.fn.line('.'), vim.fn.line('v')} end<CR>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Stage Hunk";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "v";
|
||||
key = "<leader>gr";
|
||||
action = "function() gs.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Reset Hunk";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>gS";
|
||||
action = "<cmd>Gitsigns stage_buffer<CR>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Stage Buffer";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>gu";
|
||||
action = "<cmd>Gitsigns undo_stage_hunk<CR>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Undo Stage Hunk";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>gR";
|
||||
action = "<cmd> Gitsigns reset_buffer<CR>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Reset Buffer";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>gp";
|
||||
action = "<cmd> Gitsigns preview_hunk<CR>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Preview Hunk";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>gb";
|
||||
action = "<cmd> Gitsigns toggle_current_line_blame<CR>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Blame";
|
||||
};
|
||||
}
|
||||
|
||||
# {
|
||||
# mode = "n";
|
||||
# key = "<leader>gd";
|
||||
# action = "<cmd> Gitsigns diffthis<CR>";
|
||||
# options = {
|
||||
# silent = true;
|
||||
# desc = "Diff";
|
||||
# };
|
||||
# }
|
||||
];
|
||||
};
|
||||
}
|
||||
59
home-manager/modules/neovim/plugins/harpoon.nix
Normal file
59
home-manager/modules/neovim/plugins/harpoon.nix
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins = {
|
||||
harpoon.enable = true;
|
||||
which-key.settings.spec = [
|
||||
{
|
||||
__unkeyed = "<leader>m";
|
||||
mode = "n";
|
||||
group = " Marks";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>mm";
|
||||
action = ":lua require('harpoon.ui').toggle_quick_menu()<CR>";
|
||||
# lua = true;
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Mark Menu";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>ma";
|
||||
action = ":lua require('harpoon.mark').add_file()<CR>";
|
||||
# lua = true;
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Mark File";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>mn";
|
||||
action = ":lua require('harpoon.ui').nav_next()<CR>";
|
||||
# lua = true;
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Next Mark";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>mp";
|
||||
action = ":lua require('harpoon.ui').nav_prev()<CR>";
|
||||
# lua = true;
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Prev Mark";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
17
home-manager/modules/neovim/plugins/illuminate.nix
Normal file
17
home-manager/modules/neovim/plugins/illuminate.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins = {
|
||||
illuminate = {
|
||||
enable = true;
|
||||
|
||||
filetypesDenylist = [
|
||||
"dirvish"
|
||||
"fugitive"
|
||||
"neo-tree"
|
||||
"TelescopePrompt"
|
||||
];
|
||||
largeFileCutoff = 3000;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
7
home-manager/modules/neovim/plugins/lightbulb.nix
Normal file
7
home-manager/modules/neovim/plugins/lightbulb.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins.nvim-lightbulb = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
123
home-manager/modules/neovim/plugins/lsp.nix
Normal file
123
home-manager/modules/neovim/plugins/lsp.nix
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
programs.nixvim = {
|
||||
extraConfigLuaPre =
|
||||
# lua
|
||||
''
|
||||
vim.fn.sign_define("DiagnosticSignError", { text = " ", texthl = "DiagnosticError", linehl = "", numhl = "" })
|
||||
vim.fn.sign_define("DiagnosticSignWarn", { text = " ", texthl = "DiagnosticWarn", linehl = "", numhl = "" })
|
||||
vim.fn.sign_define("DiagnosticSignHint", { text = " ", texthl = "DiagnosticHint", linehl = "", numhl = "" })
|
||||
vim.fn.sign_define("DiagnosticSignInfo", { text = " ", texthl = "DiagnosticInfo", linehl = "", numhl = "" })
|
||||
'';
|
||||
plugins = {
|
||||
lspkind.enable = true;
|
||||
lsp-lines.enable = true;
|
||||
lsp-format.enable = false; # conform-nvim does this
|
||||
lsp = {
|
||||
enable = true;
|
||||
keymaps = {
|
||||
silent = true;
|
||||
diagnostic = {
|
||||
# Navigate in diagnostics
|
||||
"<leader>lp" = "goto_prev";
|
||||
"<leader>ln" = "goto_next";
|
||||
};
|
||||
|
||||
extra = [
|
||||
{
|
||||
action.__raw =
|
||||
# lua
|
||||
''
|
||||
function()
|
||||
vim.lsp.buf.format({
|
||||
async = true,
|
||||
range = {
|
||||
["start"] = vim.api.nvim_buf_get_mark(0, "<"),
|
||||
["end"] = vim.api.nvim_buf_get_mark(0, ">"),
|
||||
}
|
||||
})
|
||||
end
|
||||
'';
|
||||
mode = "v";
|
||||
key = "<leader>lf";
|
||||
options = {
|
||||
desc = "Format selection";
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
lspBuf = {
|
||||
"<leader>la" = "code_action";
|
||||
"<leader>ld" = "definition";
|
||||
"<leader>lf" = "format";
|
||||
"<leader>lD" = "references";
|
||||
"<leader>lt" = "type_definition";
|
||||
"<leader>li" = "implementation";
|
||||
"<leader>lh" = "hover";
|
||||
"<leader>lr" = "rename";
|
||||
};
|
||||
};
|
||||
servers = {
|
||||
nil-ls = {
|
||||
enable = true;
|
||||
filetypes = ["nix"];
|
||||
settings = {
|
||||
formatting = {
|
||||
command = ["${lib.getExe pkgs.nixfmt-rfc-style}"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
which-key.settings.spec = [
|
||||
{
|
||||
__unkeyed = "<leader>l";
|
||||
group = " LSP";
|
||||
}
|
||||
{
|
||||
__unkeyed = "<leader>la";
|
||||
desc = "Code Action";
|
||||
}
|
||||
{
|
||||
__unkeyed = "<leader>ld";
|
||||
desc = "Definition";
|
||||
}
|
||||
{
|
||||
__unkeyed = "<leader>lD";
|
||||
desc = "References";
|
||||
}
|
||||
{
|
||||
__unkeyed = "<leader>lf";
|
||||
desc = "Format";
|
||||
}
|
||||
{
|
||||
__unkeyed = "<leader>lp";
|
||||
desc = "Prev";
|
||||
}
|
||||
{
|
||||
__unkeyed = "<leader>ln";
|
||||
desc = "Next";
|
||||
}
|
||||
{
|
||||
__unkeyed = "<leader>lt";
|
||||
desc = "Type Definition";
|
||||
}
|
||||
{
|
||||
__unkeyed = "<leader>li";
|
||||
desc = "Implementation";
|
||||
}
|
||||
{
|
||||
__unkeyed = "<leader>lh";
|
||||
desc = "Hover";
|
||||
}
|
||||
{
|
||||
__unkeyed = "<leader>lr";
|
||||
desc = "Rename";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
7
home-manager/modules/neovim/plugins/lualine.nix
Normal file
7
home-manager/modules/neovim/plugins/lualine.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins.lualine = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
64
home-manager/modules/neovim/plugins/mini-bufremove.nix
Normal file
64
home-manager/modules/neovim/plugins/mini-bufremove.nix
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins = {
|
||||
mini = {
|
||||
enable = true;
|
||||
|
||||
modules = {
|
||||
bufremove = {};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>c";
|
||||
action.__raw =
|
||||
# lua
|
||||
''require("mini.bufremove").delete'';
|
||||
options = {
|
||||
desc = "Close buffer";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-w>";
|
||||
action.__raw =
|
||||
# lua
|
||||
''require("mini.bufremove").delete'';
|
||||
options = {
|
||||
desc = "Close buffer";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bc";
|
||||
action.__raw =
|
||||
# lua
|
||||
''
|
||||
function ()
|
||||
local current = vim.api.nvim_get_current_buf()
|
||||
|
||||
local get_listed_bufs = function()
|
||||
return vim.tbl_filter(function(bufnr)
|
||||
return vim.api.nvim_buf_get_option(bufnr, "buflisted")
|
||||
end, vim.api.nvim_list_bufs())
|
||||
end
|
||||
|
||||
for _, bufnr in ipairs(get_listed_bufs()) do
|
||||
if bufnr ~= current
|
||||
then require("mini.bufremove").delete(bufnr)
|
||||
end
|
||||
end
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
desc = "Close all buffers but current";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
8
home-manager/modules/neovim/plugins/navic.nix
Normal file
8
home-manager/modules/neovim/plugins/navic.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins.navic = {
|
||||
enable = true;
|
||||
lsp.autoAttach = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
7
home-manager/modules/neovim/plugins/nix.nix
Normal file
7
home-manager/modules/neovim/plugins/nix.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins.nix = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
7
home-manager/modules/neovim/plugins/noice.nix
Normal file
7
home-manager/modules/neovim/plugins/noice.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins.noice = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
32
home-manager/modules/neovim/plugins/none-ls.nix
Normal file
32
home-manager/modules/neovim/plugins/none-ls.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins.none-ls = {
|
||||
enable = true;
|
||||
settings = {
|
||||
cmd = ["bash -c nvim"];
|
||||
|
||||
debug = true;
|
||||
};
|
||||
sources = {
|
||||
code_actions = {
|
||||
statix.enable = true;
|
||||
};
|
||||
diagnostics = {
|
||||
statix.enable = true;
|
||||
deadnix.enable = true;
|
||||
};
|
||||
formatting = {
|
||||
alejandra.enable = true;
|
||||
stylua.enable = true;
|
||||
shfmt.enable = true;
|
||||
nixpkgs_fmt.enable = true;
|
||||
# prettier = {
|
||||
# enable = true;
|
||||
# disableTsServerFormatter = true;
|
||||
# };
|
||||
# black.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
7
home-manager/modules/neovim/plugins/notify.nix
Normal file
7
home-manager/modules/neovim/plugins/notify.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins.notify = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
26
home-manager/modules/neovim/plugins/precognition.nix
Normal file
26
home-manager/modules/neovim/plugins/precognition.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{pkgs, ...}: {
|
||||
programs.nixvim = {
|
||||
extraPlugins = [pkgs.vimPlugins.precognition-nvim];
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>uP";
|
||||
action.__raw = ''
|
||||
function()
|
||||
if require("precognition").toggle() then
|
||||
vim.notify("precognition on")
|
||||
else
|
||||
vim.notify("precognition off")
|
||||
end
|
||||
end
|
||||
'';
|
||||
|
||||
options = {
|
||||
desc = "Precognition Toggle";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
21
home-manager/modules/neovim/plugins/spectre.nix
Normal file
21
home-manager/modules/neovim/plugins/spectre.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins = {
|
||||
spectre = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>rs";
|
||||
action = ":Spectre<CR>";
|
||||
options = {
|
||||
desc = "Spectre toggle";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
240
home-manager/modules/neovim/plugins/telescope.nix
Normal file
240
home-manager/modules/neovim/plugins/telescope.nix
Normal file
|
|
@ -0,0 +1,240 @@
|
|||
{pkgs, ...}: {
|
||||
programs.nixvim = {
|
||||
extraPackages = with pkgs; [ripgrep];
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>fc";
|
||||
action.__raw =
|
||||
# lua
|
||||
''
|
||||
function()
|
||||
require("telescope.builtin").find_files {
|
||||
prompt_title = "Config Files",
|
||||
cwd = vim.fn.stdpath "config",
|
||||
follow = true,
|
||||
}
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
desc = "Find config files";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>fF";
|
||||
action.__raw =
|
||||
# lua
|
||||
''
|
||||
function()
|
||||
require("telescope.builtin").find_files({ hidden = true, no_ignore = true})
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
desc = "Find all files";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>fT";
|
||||
action.__raw =
|
||||
# lua
|
||||
''
|
||||
function()
|
||||
require("telescope.builtin").colorscheme({ enable_preview = true })
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
desc = "Find theme";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>fW";
|
||||
action.__raw =
|
||||
# lua
|
||||
''
|
||||
function()
|
||||
require("telescope.builtin").live_grep {
|
||||
additional_args = function(args) return vim.list_extend(args, { "--hidden", "--no-ignore" }) end,
|
||||
}
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
desc = "Find words in all files";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>f?";
|
||||
action.__raw =
|
||||
# lua
|
||||
''
|
||||
function()
|
||||
require("telescope.builtin").live_grep { grep_open_files=true }
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
desc = "Find words in all open buffers";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>fe";
|
||||
action = ":Telescope file_browser<CR>";
|
||||
options = {
|
||||
desc = "File Explorer";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
# {
|
||||
# mode = "n";
|
||||
# key = "<leader>fO";
|
||||
# action = ":Telescope frecency<CR>";
|
||||
# options = {
|
||||
# desc = "Find Frequent Files";
|
||||
# silent = true;
|
||||
# };
|
||||
# }
|
||||
];
|
||||
|
||||
plugins.telescope = {
|
||||
enable = true;
|
||||
|
||||
extensions = {
|
||||
file-browser = {
|
||||
enable = true;
|
||||
settings = {
|
||||
hidden = true;
|
||||
};
|
||||
};
|
||||
|
||||
# FIX: annoying frecency validation on startup about removed files
|
||||
# frecency = {
|
||||
# enable = true;
|
||||
# };
|
||||
|
||||
ui-select = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
keymaps = {
|
||||
"<leader>f'" = {
|
||||
action = "marks";
|
||||
options.desc = "View marks";
|
||||
};
|
||||
"<leader>f/" = {
|
||||
action = "current_buffer_fuzzy_find";
|
||||
options.desc = "Fuzzy find in current buffer";
|
||||
};
|
||||
"<leader>f<CR>" = {
|
||||
action = "resume";
|
||||
options.desc = "Resume action";
|
||||
};
|
||||
"<leader>fa" = {
|
||||
action = "autocommands";
|
||||
options.desc = "View autocommands";
|
||||
};
|
||||
"<leader>fC" = {
|
||||
action = "commands";
|
||||
options.desc = "View commands";
|
||||
};
|
||||
"<leader>fb" = {
|
||||
action = "buffers";
|
||||
options.desc = "View buffers";
|
||||
};
|
||||
"<leader>fc" = {
|
||||
action = "grep_string";
|
||||
options.desc = "Grep string";
|
||||
};
|
||||
"<leader>fd" = {
|
||||
action = "diagnostics";
|
||||
options.desc = "View diagnostics";
|
||||
};
|
||||
"<leader>ff" = {
|
||||
action = "find_files";
|
||||
options.desc = "Find files";
|
||||
};
|
||||
"<leader>fh" = {
|
||||
action = "help_tags";
|
||||
options.desc = "View help tags";
|
||||
};
|
||||
"<leader>fk" = {
|
||||
action = "keymaps";
|
||||
options.desc = "View keymaps";
|
||||
};
|
||||
"<leader>fm" = {
|
||||
action = "man_pages";
|
||||
options.desc = "View man pages";
|
||||
};
|
||||
"<leader>fo" = {
|
||||
action = "oldfiles";
|
||||
options.desc = "View old files";
|
||||
};
|
||||
"<leader>fr" = {
|
||||
action = "registers";
|
||||
options.desc = "View registers";
|
||||
};
|
||||
"<leader>fs" = {
|
||||
action = "lsp_document_symbols";
|
||||
options.desc = "Search symbols";
|
||||
};
|
||||
"<leader>fq" = {
|
||||
action = "quickfix";
|
||||
options.desc = "Search quickfix";
|
||||
};
|
||||
"<leader>fw" = {
|
||||
action = "live_grep";
|
||||
options.desc = "Live grep";
|
||||
};
|
||||
"<leader>gC" = {
|
||||
action = "git_bcommits";
|
||||
options.desc = "View git bcommits";
|
||||
};
|
||||
"<leader>gB" = {
|
||||
action = "git_branches";
|
||||
options.desc = "View git branches";
|
||||
};
|
||||
"<leader>gc" = {
|
||||
action = "git_commits";
|
||||
options.desc = "View git commits";
|
||||
};
|
||||
"<leader>gs" = {
|
||||
action = "git_status";
|
||||
options.desc = "View git status";
|
||||
};
|
||||
"<leader>gS" = {
|
||||
action = "git_stash";
|
||||
options.desc = "View git stashes";
|
||||
};
|
||||
};
|
||||
|
||||
settings = {
|
||||
defaults = {
|
||||
file_ignore_patterns = [
|
||||
"^.git/"
|
||||
"^.mypy_cache/"
|
||||
"^__pycache__/"
|
||||
"^output/"
|
||||
"^data/"
|
||||
"%.ipynb"
|
||||
];
|
||||
set_env.COLORTERM = "truecolor";
|
||||
};
|
||||
|
||||
pickers = {
|
||||
colorscheme = {
|
||||
enable_preview = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
7
home-manager/modules/neovim/plugins/todo-comments.nix
Normal file
7
home-manager/modules/neovim/plugins/todo-comments.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins.todo-comments = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
57
home-manager/modules/neovim/plugins/toggleterm.nix
Normal file
57
home-manager/modules/neovim/plugins/toggleterm.nix
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins.toggleterm = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
direction = "float";
|
||||
};
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>tt";
|
||||
action = ":ToggleTerm<CR>";
|
||||
options = {
|
||||
desc = "Open Terminal";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>tg";
|
||||
action.__raw =
|
||||
# lua
|
||||
''
|
||||
function()
|
||||
local toggleterm = require('toggleterm.terminal')
|
||||
|
||||
toggleterm.Terminal:new({cmd = 'lazygit',hidden = true}):toggle()
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
desc = "Open Lazygit";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>gg";
|
||||
action.__raw =
|
||||
# lua
|
||||
''
|
||||
function()
|
||||
local toggleterm = require('toggleterm.terminal')
|
||||
|
||||
toggleterm.Terminal:new({cmd = 'lazygit',hidden = true}):toggle()
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
desc = "Open Lazygit";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
24
home-manager/modules/neovim/plugins/treesitter.nix
Normal file
24
home-manager/modules/neovim/plugins/treesitter.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins = {
|
||||
treesitter = {
|
||||
enable = true;
|
||||
nixvimInjections = true;
|
||||
|
||||
settings = {
|
||||
indent.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
treesitter-context = {
|
||||
enable = false;
|
||||
};
|
||||
|
||||
treesitter-refactor = {
|
||||
enable = true;
|
||||
highlightDefinitions.enable = true;
|
||||
};
|
||||
hmts.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
108
home-manager/modules/neovim/plugins/trouble.nix
Normal file
108
home-manager/modules/neovim/plugins/trouble.nix
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins = {
|
||||
trouble = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
modes = {
|
||||
preview_split = {
|
||||
mode = "diagnostics";
|
||||
preview = {
|
||||
type = "split";
|
||||
relative = "win";
|
||||
position = "right";
|
||||
size = 0.5;
|
||||
};
|
||||
};
|
||||
|
||||
preview_float = {
|
||||
mode = "diagnostics";
|
||||
preview = {
|
||||
type = "float";
|
||||
relative = "editor";
|
||||
border = "rounded";
|
||||
title = "Preview";
|
||||
title_pos = "center";
|
||||
position = [
|
||||
0
|
||||
(-2)
|
||||
];
|
||||
size = {
|
||||
width = 0.3;
|
||||
height = 0.3;
|
||||
};
|
||||
zindex = 200;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
which-key.settings.spec = [
|
||||
{
|
||||
__unkeyed = "<leader>x";
|
||||
mode = "n";
|
||||
group = " Trouble";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>xx";
|
||||
action = "<cmd>Trouble preview_split toggle<cr>";
|
||||
options = {
|
||||
desc = "Diagnostics toggle";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>xX";
|
||||
action = "<cmd>Trouble preview_split toggle filter.buf=0<cr>";
|
||||
options = {
|
||||
desc = "Buffer Diagnostics toggle";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>us";
|
||||
action = "<cmd>Trouble symbols toggle focus=false<cr>";
|
||||
options = {
|
||||
desc = "Symbols toggle";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>xl";
|
||||
action = "<cmd>Trouble lsp toggle focus=false win.position=right<cr>";
|
||||
options = {
|
||||
desc = "LSP Definitions / references / ... toggle";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>xL";
|
||||
action = "<cmd>Trouble loclist toggle<cr>";
|
||||
options = {
|
||||
desc = "Location List toggle";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>xQ";
|
||||
action = "<cmd>Trouble qflist toggle<cr>";
|
||||
options = {
|
||||
desc = "Quickfix List toggle";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
17
home-manager/modules/neovim/plugins/which-key.nix
Normal file
17
home-manager/modules/neovim/plugins/which-key.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins.which-key = {
|
||||
enable = true;
|
||||
settings = {
|
||||
spec = [
|
||||
# "<leader>m" = " Marks";
|
||||
# "<leader>t" = " Trouble";
|
||||
# "<leader>w" = " Window";
|
||||
# "<leader>d" = " Dap";
|
||||
# "<leader>n" = " Neorg";
|
||||
# "<leader>l" = " Lsp";
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
21
home-manager/modules/neovim/plugins/yazi.nix
Normal file
21
home-manager/modules/neovim/plugins/yazi.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins.yazi.enable = true;
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>e";
|
||||
action.__raw = ''
|
||||
function()
|
||||
require('yazi').yazi()
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
desc = "Yazi toggle";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
56
home-manager/modules/yazi.nix
Normal file
56
home-manager/modules/yazi.nix
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
{pkgs, ...}: let
|
||||
plugins-repo = pkgs.fetchFromGitHub {
|
||||
owner = "yazi-rs";
|
||||
repo = "plugins";
|
||||
rev = "a3ee7173bff700214bc2d993ef605c3c41d800c9";
|
||||
hash = "sha256-m2A/vIgGMzFzhaOgFL21cZua8h2XaYu7Jb6yuZQKiTw=";
|
||||
};
|
||||
in {
|
||||
programs.yazi = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
shellWrapperName = "y";
|
||||
|
||||
settings = {
|
||||
manager = {
|
||||
show_hidden = true;
|
||||
};
|
||||
preview = {
|
||||
max_width = 1000;
|
||||
max_height = 1000;
|
||||
};
|
||||
};
|
||||
|
||||
plugins = {
|
||||
chmod = "${plugins-repo}/chmod.yazi";
|
||||
full-border = "${plugins-repo}/full-border.yazi";
|
||||
max-preview = "${plugins-repo}/max-preview.yazi";
|
||||
starship = pkgs.fetchFromGitHub {
|
||||
owner = "Rolv-Apneseth";
|
||||
repo = "starship.yazi";
|
||||
rev = "dc9989c2bdd3d04e615d3bbb5f3bf99ed6ce1a35";
|
||||
sha256 = "sha256-AwBqOKWtz5BzY7Sye1JljWI2t+JQGGQfOT6oQN7YTOg=";
|
||||
};
|
||||
};
|
||||
|
||||
initLua = ''
|
||||
require("full-border"):setup()
|
||||
require("starship"):setup()
|
||||
'';
|
||||
|
||||
keymap = {
|
||||
manager.prepend_keymap = [
|
||||
{
|
||||
on = "T";
|
||||
run = "plugin --sync max-preview";
|
||||
desc = "Maximize or restore the preview pane";
|
||||
}
|
||||
{
|
||||
on = ["c" "m"];
|
||||
run = "plugin chmod";
|
||||
desc = "Chmod on selected files";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue