Skip to content

Commit

Permalink
Isolate neovim plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
addisonbeck committed Nov 12, 2024
1 parent d6fd8eb commit 573b34d
Show file tree
Hide file tree
Showing 7 changed files with 319 additions and 302 deletions.
61 changes: 61 additions & 0 deletions system/with/user/with/program/neovim/auto-commands/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{...}: {
autoCommands = [
{
event = [
"FileType"
];
pattern = [
"qf"
"help"
"man"
"lspinfo"
];
callback = {
__raw = ''
function()
vim.cmd([[
set buflisted
wincmd o
]])
end
'';
};
}
{
event = [
"FileType"
];
pattern = [
"md"
"markdown"
"txt"
"gitcommit"
];
callback = {
__raw = ''
function()
vim.opt_local.wrap = true
vim.keymap.set({'n', 'v'}, 'j', 'gj', {buffer = true})
vim.keymap.set({'n', 'v'}, 'k', 'gk', {buffer = true})
end
'';
};
}
{
event = ["BufRead"];
# TODO: Fine a real syntax highlighting solution for haxe
pattern = ["*.hx"];
command = "set filetype=ts";
}
{
event = ["TextYankPost"];
pattern = ["*"];
command = ''lua vim.highlight.on_yank({higroup="ActiveYank", timeout=300})'';
}
{
event = ["User"];
pattern = ["TelescopePreviewerLoaded"];
command = ''lua vim.wo.wrap = true'';
}
];
}
2 changes: 1 addition & 1 deletion system/with/user/with/program/neovim/colors/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ ... }: {
{...}: {
options = {
background = "dark";
termguicolors = false;
Expand Down
24 changes: 13 additions & 11 deletions system/with/user/with/program/neovim/commands/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, ... }: let
{lib, ...}: let
mkVimKeymap = key: command: {
action.__raw = command.action.__raw;
key = command.vimKeymapBinding.key;
Expand Down Expand Up @@ -835,15 +835,17 @@
};
};
in {
keymaps =
[
# Custom keymaps can be added here if needed, but I stick to using
# `mkVimKeymaps` and the `commands` data structure it references.
] ++ mkVimKeymaps commands;
keymaps =
[
# Custom keymaps can be added here if needed, but I stick to using
# `mkVimKeymaps` and the `commands` data structure it references.
]
++ mkVimKeymaps commands;

userCommands =
{
# Custom commands can be added here if needed, but I stick to using
# `mkVimUserCommand` and the `commands` data structure it references.
} // mkVimUserCommands commands;
userCommands =
{
# Custom commands can be added here if needed, but I stick to using
# `mkVimUserCommand` and the `commands` data structure it references.
}
// mkVimUserCommands commands;
}
Loading

0 comments on commit 573b34d

Please sign in to comment.