Move neovim/nixvim configuration
This commit is contained in:
parent
32e28379e2
commit
6c1b494e82
56 changed files with 438 additions and 404 deletions
|
@ -14,7 +14,6 @@
|
|||
};
|
||||
|
||||
coding = {
|
||||
neovim.enable = true;
|
||||
phpactor.enable = true;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
};
|
||||
|
||||
coding = {
|
||||
neovim.enable = true;
|
||||
phpactor.enable = true;
|
||||
};
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
./gtk.nix
|
||||
./media/handbrake.nix
|
||||
./media/mpv.nix
|
||||
./neovim
|
||||
./node.nix
|
||||
./phpactor
|
||||
./ranger.nix
|
||||
|
|
|
@ -1,73 +0,0 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
# TODO: re-add DAP.
|
||||
# TODO: re-add snippets.
|
||||
# TODO: re-configure spell.
|
||||
|
||||
imports = [
|
||||
./keymaps.nix
|
||||
./options.nix
|
||||
./plugins/auto-save.nix
|
||||
./plugins/cmp.nix
|
||||
./plugins/conform.nix
|
||||
./plugins/fidget.nix
|
||||
./plugins/fugitive.nix
|
||||
./plugins/gitsigns.nix
|
||||
./plugins/harpoon.nix
|
||||
./plugins/lint.nix
|
||||
./plugins/lsp.nix
|
||||
./plugins/lualine.nix
|
||||
./plugins/luasnip.nix
|
||||
./plugins/mini.nix
|
||||
./plugins/oil.nix
|
||||
./plugins/phpactor.nix
|
||||
./plugins/refactoring.nix
|
||||
./plugins/telescope.nix
|
||||
./plugins/treesitter.nix
|
||||
./plugins/undotree.nix
|
||||
./plugins/vim-cool.nix
|
||||
./plugins/vim-dadbod.nix
|
||||
./plugins/vim-highlightedyank.nix
|
||||
./plugins/vim-test.nix
|
||||
./plugins/web-devicons.nix
|
||||
];
|
||||
|
||||
colorschemes.catppuccin = {
|
||||
enable = true;
|
||||
settings.flavour = "mocha";
|
||||
};
|
||||
|
||||
diagnostic.settings = {
|
||||
signs = true;
|
||||
underline = false;
|
||||
update_in_insert = false;
|
||||
virtual_text = {
|
||||
enable = true;
|
||||
spacing = 2;
|
||||
};
|
||||
};
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
nixfmt-rfc-style
|
||||
stylua
|
||||
];
|
||||
|
||||
filetype = {
|
||||
extension = {
|
||||
"neon.dist" = "yaml";
|
||||
inc = "php";
|
||||
install = "php";
|
||||
module = "php";
|
||||
neon = "yaml";
|
||||
pcss = "scss";
|
||||
theme = "php";
|
||||
};
|
||||
|
||||
filename = {
|
||||
"composer.lock" = "json";
|
||||
};
|
||||
};
|
||||
|
||||
globals.mapleader = " ";
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
{
|
||||
plugins.auto-save.enable = true;
|
||||
|
||||
plugins.auto-save.settings.condition = ''
|
||||
function(buf)
|
||||
local excluded_filetypes = {
|
||||
"harpoon",
|
||||
"oil",
|
||||
}
|
||||
|
||||
local excluded_filenames = {}
|
||||
|
||||
if vim.tbl_contains(excluded_filetypes, vim.fn.getbufvar(buf, "&filetype"))
|
||||
or vim.tbl_contains(excluded_filenames, vim.fn.expand("%:t"))
|
||||
then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
'';
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
plugins.conform-nvim.enable = true;
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
plugins.fidget.enable = true;
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
plugins.fugitive.enable = true;
|
||||
|
||||
keymaps = lib.mkIf config.plugins.fugitive.enable [
|
||||
{
|
||||
key = "<leader>gc";
|
||||
action = "<cmd>Git commit<CR><C-w>K";
|
||||
}
|
||||
|
||||
{
|
||||
# Open the ":Git" window in its own buffer, not a split.
|
||||
key = "<leader>gs";
|
||||
action = "<cmd>0Git<CR>";
|
||||
}
|
||||
];
|
||||
}
|
|
@ -1,48 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
plugins.gitsigns.enable = true;
|
||||
|
||||
keymaps = lib.mkIf config.plugins.gitsigns.enable [
|
||||
{
|
||||
action = "<cmd>Gitsigns prev_hunk<CR>";
|
||||
key = "[h";
|
||||
}
|
||||
|
||||
{
|
||||
action = "<cmd>Gitsigns next_hunk<CR>";
|
||||
key = "]h";
|
||||
}
|
||||
|
||||
{
|
||||
action = "<cmd>Gitsigns reset_hunk<CR>";
|
||||
key = "<leader>hr";
|
||||
}
|
||||
|
||||
{
|
||||
action = "<cmd>Gitsigns reset_buffer<CR>";
|
||||
key = "<leader>hR";
|
||||
}
|
||||
|
||||
{
|
||||
action = "<cmd>Gitsigns stage_hunk<CR>";
|
||||
key = "<leader>hs";
|
||||
mode = [
|
||||
"n"
|
||||
"v"
|
||||
];
|
||||
}
|
||||
|
||||
{
|
||||
action = "<cmd>Gitsigns stage_buffer<CR>";
|
||||
key = "<leader>hS";
|
||||
mode = "n";
|
||||
}
|
||||
|
||||
{
|
||||
action = "<cmd>Gitsigns undo_stage_hunk<CR>";
|
||||
key = "<leader>hu";
|
||||
mode = "x";
|
||||
}
|
||||
];
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
plugins.lint.enable = true;
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
{
|
||||
plugins.lsp.enable = true;
|
||||
|
||||
plugins.lsp.keymaps = {
|
||||
diagnostic = {
|
||||
"<leader>dl" = "setqflist";
|
||||
};
|
||||
|
||||
lspBuf = {
|
||||
"<leader>ca" = "code_action";
|
||||
"<leader>cr" = "rename";
|
||||
K = "hover";
|
||||
gD = "declaration";
|
||||
gT = "type_definition";
|
||||
gd = "definition";
|
||||
gr = "references";
|
||||
};
|
||||
};
|
||||
|
||||
plugins.lsp.servers.phpactor.enable = true;
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
plugins.luasnip.enable = true;
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
plugins.oil = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
delete_to_trash = true;
|
||||
|
||||
keymaps."-" = "actions.parent";
|
||||
|
||||
skip_confirm_for_simple_edits = true;
|
||||
view_options.show_hidden = true;
|
||||
};
|
||||
};
|
||||
|
||||
keymaps = lib.mkIf config.plugins.oil.enable [
|
||||
{
|
||||
action = "<cmd>Oil<CR>";
|
||||
key = "-";
|
||||
}
|
||||
];
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
extraPlugins = with pkgs.vimPlugins; [ phpactor ];
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
key = "<leader>pm";
|
||||
action = "<cmd>PhpactorContextMenu<CR>";
|
||||
}
|
||||
|
||||
{
|
||||
key = "<leader>pn";
|
||||
action = "<cmd>PhpactorClassNew<CR>";
|
||||
}
|
||||
];
|
||||
}
|
|
@ -1,48 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
plugins.refactoring = {
|
||||
enable = true;
|
||||
enableTelescope = true;
|
||||
};
|
||||
|
||||
keymaps = lib.mkIf config.plugins.refactoring.enable (
|
||||
[
|
||||
{
|
||||
key = "<leader>ri";
|
||||
action = "<cmd>Refactor inline_var<CR>";
|
||||
mode = "n";
|
||||
}
|
||||
|
||||
{
|
||||
key = "<leader>re";
|
||||
action = "<cmd>Refactor extract<CR>";
|
||||
mode = "x";
|
||||
}
|
||||
|
||||
{
|
||||
key = "<leader>ri";
|
||||
action = "<cmd>Refactor inline_var<CR>";
|
||||
mode = "x";
|
||||
}
|
||||
|
||||
{
|
||||
key = "<leader>rv";
|
||||
action = "<cmd>Refactor extract_var<CR>";
|
||||
mode = "x";
|
||||
}
|
||||
]
|
||||
++ lib.optionals (config.plugins.refactoring.enable && config.plugins.refactoring.enableTelescope) [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>rR";
|
||||
action.__raw = ''
|
||||
function()
|
||||
require('telescope').extensions.refactoring.refactors()
|
||||
end
|
||||
'';
|
||||
options.silent = true;
|
||||
}
|
||||
]
|
||||
);
|
||||
}
|
|
@ -1,48 +0,0 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
plugins = {
|
||||
treesitter = {
|
||||
enable = true;
|
||||
|
||||
grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
|
||||
bash
|
||||
comment
|
||||
css
|
||||
csv
|
||||
dockerfile
|
||||
gitattributes
|
||||
gitignore
|
||||
go
|
||||
html
|
||||
javascript
|
||||
json
|
||||
kdl
|
||||
lua
|
||||
luadoc
|
||||
make
|
||||
markdown
|
||||
markdown_inline
|
||||
nix
|
||||
php
|
||||
phpdoc
|
||||
query
|
||||
rst
|
||||
scss
|
||||
sql
|
||||
terraform
|
||||
twig
|
||||
typescript
|
||||
vim
|
||||
vimdoc
|
||||
vue
|
||||
xml
|
||||
yaml
|
||||
];
|
||||
|
||||
settings.highlight.enable = true;
|
||||
};
|
||||
|
||||
treesitter-textobjects.enable = true;
|
||||
};
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
plugins.undotree.enable = true;
|
||||
|
||||
keymaps = lib.mkIf config.plugins.undotree.enable [
|
||||
{
|
||||
action = "<cmd>UndotreeToggle<CR>";
|
||||
key = "<leader>u";
|
||||
}
|
||||
];
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
extraPlugins = with pkgs.vimPlugins; [ vim-cool ];
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
extraPlugins = with pkgs.vimPlugins; [ vim-highlightedyank ];
|
||||
|
||||
extraConfigVim = ''
|
||||
let g:highlightedyank_highlight_duration = 100
|
||||
'';
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
plugins.vim-test.enable = true;
|
||||
|
||||
keymaps = lib.mkIf config.plugins.vim-test.enable [
|
||||
{
|
||||
key = "<leader>tf";
|
||||
action = "<cmd>TestFile<CR>";
|
||||
}
|
||||
{
|
||||
key = "<leader>tl";
|
||||
action = "<cmd>TestLast<CR>";
|
||||
}
|
||||
{
|
||||
key = "<leader>tn";
|
||||
action = "<cmd>TestNearest<CR>";
|
||||
}
|
||||
];
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
plugins.web-devicons.enable = false;
|
||||
}
|
|
@ -11,9 +11,9 @@ let
|
|||
cfg = config.features.coding.neovim;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
inputs.nixvim.homeManagerModules.nixvim
|
||||
];
|
||||
# imports = [
|
||||
# inputs.nixvim.homeManagerModules.nixvim
|
||||
# ];
|
||||
|
||||
options.features.coding.neovim.enable = mkEnableOption "Enable neovim";
|
||||
|
||||
|
|
6
modules2/nixvim/aliases.nix
Normal file
6
modules2/nixvim/aliases.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
flake.modules.nixvim.custom = {
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
};
|
||||
}
|
6
modules2/nixvim/colorscheme.nix
Normal file
6
modules2/nixvim/colorscheme.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
flake.modules.nixvim.custom.colorschemes.catppuccin = {
|
||||
enable = true;
|
||||
settings.flavour = "mocha";
|
||||
};
|
||||
}
|
12
modules2/nixvim/diagnostics.nix
Normal file
12
modules2/nixvim/diagnostics.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
flake.modules.nixvim.custom.diagnostic.settings = {
|
||||
signs = true;
|
||||
underline = false;
|
||||
update_in_insert = false;
|
||||
|
||||
virtual_text = {
|
||||
enable = true;
|
||||
spacing = 2;
|
||||
};
|
||||
};
|
||||
}
|
10
modules2/nixvim/extra-packages.nix
Normal file
10
modules2/nixvim/extra-packages.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
flake.modules.nixvim.custom =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
extraPackages = with pkgs; [
|
||||
nixfmt-rfc-style
|
||||
stylua
|
||||
];
|
||||
};
|
||||
}
|
17
modules2/nixvim/filetypes.nix
Normal file
17
modules2/nixvim/filetypes.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
flake.modules.nixvim.custom.filetype = {
|
||||
extension = {
|
||||
"neon.dist" = "yaml";
|
||||
inc = "php";
|
||||
install = "php";
|
||||
module = "php";
|
||||
neon = "yaml";
|
||||
pcss = "scss";
|
||||
theme = "php";
|
||||
};
|
||||
|
||||
filename = {
|
||||
"composer.lock" = "json";
|
||||
};
|
||||
};
|
||||
}
|
13
modules2/nixvim/flake-outputs.nix
Normal file
13
modules2/nixvim/flake-outputs.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
perSystem =
|
||||
{ inputs', pkgs, ... }:
|
||||
{
|
||||
packages.nixvim = inputs'.nixvim.legacyPackages.makeNixvimWithModule {
|
||||
inherit pkgs;
|
||||
|
||||
module = config.flake.modules.nixvim.custom;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
keymaps = [
|
||||
flake.modules.nixvim.custom.keymaps = [
|
||||
{
|
||||
action = "<Esc>A,<Esc>";
|
||||
key = ",,";
|
6
modules2/nixvim/leader.nix
Normal file
6
modules2/nixvim/leader.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
flake.modules.nixvim.custom.globals = {
|
||||
mapleader = " ";
|
||||
maplocalleader = " ";
|
||||
};
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
plugins.lualine = {
|
||||
flake.modules.nixvim.custom.plugins.lualine = {
|
||||
enable = true;
|
||||
|
||||
settings.options = {
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
opts = {
|
||||
flake.modules.nixvim.custom.opts = {
|
||||
expandtab = true;
|
||||
exrc = true;
|
||||
foldlevel = 1;
|
24
modules2/nixvim/plugins/auto-save.nix
Normal file
24
modules2/nixvim/plugins/auto-save.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
flake.modules.nixvim.custom.plugins.auto-save = {
|
||||
enable = true;
|
||||
|
||||
settings.condition = ''
|
||||
function(buf)
|
||||
local excluded_filetypes = {
|
||||
"harpoon",
|
||||
"oil",
|
||||
}
|
||||
|
||||
local excluded_filenames = {}
|
||||
|
||||
if vim.tbl_contains(excluded_filetypes, vim.fn.getbufvar(buf, "&filetype"))
|
||||
or vim.tbl_contains(excluded_filenames, vim.fn.expand("%:t"))
|
||||
then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
plugins.cmp = {
|
||||
flake.modules.nixvim.custom.plugins.cmp = {
|
||||
enable = true;
|
||||
|
||||
autoEnableSources = true;
|
3
modules2/nixvim/plugins/conform.nix
Normal file
3
modules2/nixvim/plugins/conform.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
flake.modules.nixvim.custom.plugins.conform-nvim.enable = true;
|
||||
}
|
3
modules2/nixvim/plugins/fidget.nix
Normal file
3
modules2/nixvim/plugins/fidget.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
flake.modules.nixvim.custom.plugins.fidget.enable = true;
|
||||
}
|
18
modules2/nixvim/plugins/fugitive.nix
Normal file
18
modules2/nixvim/plugins/fugitive.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
flake.modules.nixvim.custom = {
|
||||
plugins.fugitive.enable = true;
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
key = "<leader>gc";
|
||||
action = "<cmd>Git commit<CR><C-w>K";
|
||||
}
|
||||
|
||||
{
|
||||
# Open the ":Git" window in its own buffer, not a split.
|
||||
key = "<leader>gs";
|
||||
action = "<cmd>0Git<CR>";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
48
modules2/nixvim/plugins/gitsigns.nix
Normal file
48
modules2/nixvim/plugins/gitsigns.nix
Normal file
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
flake.modules.nixvim.custom = {
|
||||
plugins.gitsigns.enable = true;
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
action = "<cmd>Gitsigns prev_hunk<CR>";
|
||||
key = "[h";
|
||||
}
|
||||
|
||||
{
|
||||
action = "<cmd>Gitsigns next_hunk<CR>";
|
||||
key = "]h";
|
||||
}
|
||||
|
||||
{
|
||||
action = "<cmd>Gitsigns reset_hunk<CR>";
|
||||
key = "<leader>hr";
|
||||
}
|
||||
|
||||
{
|
||||
action = "<cmd>Gitsigns reset_buffer<CR>";
|
||||
key = "<leader>hR";
|
||||
}
|
||||
|
||||
{
|
||||
action = "<cmd>Gitsigns stage_hunk<CR>";
|
||||
key = "<leader>hs";
|
||||
mode = [
|
||||
"n"
|
||||
"v"
|
||||
];
|
||||
}
|
||||
|
||||
{
|
||||
action = "<cmd>Gitsigns stage_buffer<CR>";
|
||||
key = "<leader>hS";
|
||||
mode = "n";
|
||||
}
|
||||
|
||||
{
|
||||
action = "<cmd>Gitsigns undo_stage_hunk<CR>";
|
||||
key = "<leader>hu";
|
||||
mode = "x";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
|
@ -1,5 +1,3 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
leaderBinding = key: command: {
|
||||
key = "<leader>${key}";
|
||||
|
@ -8,13 +6,13 @@ let
|
|||
};
|
||||
in
|
||||
{
|
||||
plugins.harpoon = {
|
||||
enable = true;
|
||||
enableTelescope = true;
|
||||
};
|
||||
flake.modules.nixvim.custom = {
|
||||
plugins.harpoon = {
|
||||
enable = true;
|
||||
enableTelescope = true;
|
||||
};
|
||||
|
||||
keymaps = lib.mkIf config.plugins.harpoon.enable (
|
||||
[
|
||||
keymaps = [
|
||||
{
|
||||
key = "<leader>a";
|
||||
action.__raw = "function() require'harpoon':list():add() end";
|
||||
|
@ -42,6 +40,6 @@ in
|
|||
8
|
||||
9
|
||||
]
|
||||
)
|
||||
);
|
||||
);
|
||||
};
|
||||
}
|
3
modules2/nixvim/plugins/lint.nix
Normal file
3
modules2/nixvim/plugins/lint.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
flake.modules.nixvim.custom.plugins.lint.enable = true;
|
||||
}
|
23
modules2/nixvim/plugins/lsp.nix
Normal file
23
modules2/nixvim/plugins/lsp.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
flake.modules.nixvim.custom.plugins.lsp = {
|
||||
enable = true;
|
||||
|
||||
keymaps = {
|
||||
diagnostic = {
|
||||
"<leader>dl" = "setqflist";
|
||||
};
|
||||
|
||||
lspBuf = {
|
||||
"<leader>ca" = "code_action";
|
||||
"<leader>cr" = "rename";
|
||||
K = "hover";
|
||||
gD = "declaration";
|
||||
gT = "type_definition";
|
||||
gd = "definition";
|
||||
gr = "references";
|
||||
};
|
||||
};
|
||||
|
||||
servers.phpactor.enable = true;
|
||||
};
|
||||
}
|
3
modules2/nixvim/plugins/luasnip.nix
Normal file
3
modules2/nixvim/plugins/luasnip.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
flake.modules.nixvim.custom.plugins.luasnip.enable = true;
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
plugins.mini = {
|
||||
flake.modules.nixvim.custom.plugins.mini = {
|
||||
enable = true;
|
||||
|
||||
modules = {
|
23
modules2/nixvim/plugins/oil.nix
Normal file
23
modules2/nixvim/plugins/oil.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
flake.modules.nixvim.custom = {
|
||||
plugins.oil = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
delete_to_trash = true;
|
||||
|
||||
keymaps."-" = "actions.parent";
|
||||
|
||||
skip_confirm_for_simple_edits = true;
|
||||
view_options.show_hidden = true;
|
||||
};
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
action = "<cmd>Oil<CR>";
|
||||
key = "-";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
19
modules2/nixvim/plugins/phpactor.nix
Normal file
19
modules2/nixvim/plugins/phpactor.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
flake.modules.nixvim.custom =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
extraPlugins = with pkgs.vimPlugins; [ phpactor ];
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
key = "<leader>pm";
|
||||
action = "<cmd>PhpactorContextMenu<CR>";
|
||||
}
|
||||
|
||||
{
|
||||
key = "<leader>pn";
|
||||
action = "<cmd>PhpactorClassNew<CR>";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
54
modules2/nixvim/plugins/refactoring.nix
Normal file
54
modules2/nixvim/plugins/refactoring.nix
Normal file
|
@ -0,0 +1,54 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
flake.modules.nixvim.custom = {
|
||||
plugins.refactoring = {
|
||||
enable = true;
|
||||
enableTelescope = true;
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
key = "<leader>ri";
|
||||
action = "<cmd>Refactor inline_var<CR>";
|
||||
mode = "n";
|
||||
}
|
||||
|
||||
{
|
||||
key = "<leader>re";
|
||||
action = "<cmd>Refactor extract<CR>";
|
||||
mode = "x";
|
||||
}
|
||||
|
||||
{
|
||||
key = "<leader>ri";
|
||||
action = "<cmd>Refactor inline_var<CR>";
|
||||
mode = "x";
|
||||
}
|
||||
|
||||
{
|
||||
key = "<leader>rv";
|
||||
action = "<cmd>Refactor extract_var<CR>";
|
||||
mode = "x";
|
||||
}
|
||||
];
|
||||
# ++
|
||||
# lib.optionals
|
||||
# (
|
||||
# config.flake.modules.nixvim.custom.plugins.refactoring.enable
|
||||
# && config.flake.modules.nixvim.custom.plugins.refactoring.enableTelescope
|
||||
# )
|
||||
# [
|
||||
# {
|
||||
# mode = "n";
|
||||
# key = "<leader>rR";
|
||||
# action.__raw = ''
|
||||
# function()
|
||||
# require('telescope').extensions.refactoring.refactors()
|
||||
# end
|
||||
# '';
|
||||
# options.silent = true;
|
||||
# }
|
||||
# ];
|
||||
};
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
plugins.telescope = {
|
||||
flake.modules.nixvim.custom.plugins.telescope = {
|
||||
enable = true;
|
||||
|
||||
extensions = {
|
50
modules2/nixvim/plugins/treesitter.nix
Normal file
50
modules2/nixvim/plugins/treesitter.nix
Normal file
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
flake.modules.nixvim.custom =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
plugins = {
|
||||
treesitter = {
|
||||
enable = true;
|
||||
|
||||
grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
|
||||
bash
|
||||
comment
|
||||
css
|
||||
csv
|
||||
dockerfile
|
||||
gitattributes
|
||||
gitignore
|
||||
go
|
||||
html
|
||||
javascript
|
||||
json
|
||||
kdl
|
||||
lua
|
||||
luadoc
|
||||
make
|
||||
markdown
|
||||
markdown_inline
|
||||
nix
|
||||
php
|
||||
phpdoc
|
||||
query
|
||||
rst
|
||||
scss
|
||||
sql
|
||||
terraform
|
||||
twig
|
||||
typescript
|
||||
vim
|
||||
vimdoc
|
||||
vue
|
||||
xml
|
||||
yaml
|
||||
];
|
||||
|
||||
settings.highlight.enable = true;
|
||||
};
|
||||
|
||||
treesitter-textobjects.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
12
modules2/nixvim/plugins/undotree.nix
Normal file
12
modules2/nixvim/plugins/undotree.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
flake.modules.nixvim.custom = {
|
||||
plugins.undotree.enable = true;
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
action = "<cmd>UndotreeToggle<CR>";
|
||||
key = "<leader>u";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
7
modules2/nixvim/plugins/vim-cool.nix
Normal file
7
modules2/nixvim/plugins/vim-cool.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
flake.modules.nixvim.custom =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
extraPlugins = [ pkgs.vimPlugins.vim-cool ];
|
||||
};
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
plugins = {
|
||||
flake.modules.nixvim.custom.plugins = {
|
||||
vim-dadbod.enable = true;
|
||||
vim-dadbod-completion.enable = true;
|
||||
vim-dadbod-ui.enable = true;
|
11
modules2/nixvim/plugins/vim-highlightedyank.nix
Normal file
11
modules2/nixvim/plugins/vim-highlightedyank.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
flake.modules.nixvim.custom =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
extraPlugins = [ pkgs.vimPlugins.vim-highlightedyank ];
|
||||
|
||||
extraConfigVim = ''
|
||||
let g:highlightedyank_highlight_duration = 100
|
||||
'';
|
||||
};
|
||||
}
|
20
modules2/nixvim/plugins/vim-test.nix
Normal file
20
modules2/nixvim/plugins/vim-test.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
flake.modules.nixvim.custom = {
|
||||
plugins.vim-test.enable = true;
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
key = "<leader>tf";
|
||||
action = "<cmd>TestFile<CR>";
|
||||
}
|
||||
{
|
||||
key = "<leader>tl";
|
||||
action = "<cmd>TestLast<CR>";
|
||||
}
|
||||
{
|
||||
key = "<leader>tn";
|
||||
action = "<cmd>TestNearest<CR>";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
3
modules2/nixvim/plugins/web-devicons.nix
Normal file
3
modules2/nixvim/plugins/web-devicons.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
flake.modules.nixvim.custom.plugins.web-devicons.enable = false;
|
||||
}
|
24
modules2/nixvim/use-in-home.nix
Normal file
24
modules2/nixvim/use-in-home.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{ config, inputs, lib, ... }:
|
||||
|
||||
{
|
||||
flake.modules.homeManager.base =
|
||||
hmArgs@{ pkgs, ... }:
|
||||
let
|
||||
# Ideally:
|
||||
# nixvim = self.packages.${pkgs.system}.nixvim;
|
||||
# but https://github.com/danth/stylix/pull/415#issuecomment-2832398958
|
||||
nixvim = inputs.nixvim.legacyPackages.${pkgs.system}.makeNixvimWithModule {
|
||||
inherit pkgs;
|
||||
|
||||
extraSpecialArgs.homeConfig = hmArgs.config;
|
||||
|
||||
module = config.flake.modules.nixvim.custom;
|
||||
};
|
||||
in
|
||||
{
|
||||
home = {
|
||||
packages = [ nixvim ];
|
||||
sessionVariables.EDITOR = lib.mkForce (lib.getExe nixvim);
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
{ self, ... }:
|
||||
{ config, ... }:
|
||||
|
||||
{
|
||||
perSystem =
|
||||
|
@ -10,7 +10,7 @@
|
|||
neovim = inputs'.nixvim.legacyPackages.makeNixvimWithModule {
|
||||
inherit pkgs;
|
||||
|
||||
module = import "${self}/modules/home-manager/neovim/config";
|
||||
module = config.flake.modules.nixvim.custom;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue