This commit is contained in:
2026-08-03 15:10:03 +09:00
parent c3bb2f4d43
commit 3162bc0eba
43 changed files with 811 additions and 533 deletions
+8
View File
@@ -0,0 +1,8 @@
_: {
programs.nixvim.autoCmd = [
{
event = "TextYankPost";
callback.__raw = "function() vim.highlight.on_yank() end";
}
];
}
+6
View File
@@ -0,0 +1,6 @@
_: {
programs.nixvim.colorschemes.catppuccin = {
enable = true;
settings.transparent_background = true;
};
}
+11 -388
View File
@@ -1,8 +1,13 @@
{ pkgs, ... }: { pkgs, lib, ... }@args:
let lib.mkMerge [
keymaps = import ./keymaps.nix { }; (import ./autocmds.nix args)
in (import ./colorscheme.nix args)
{ (import ./keymaps.nix args)
(import ./language.nix args)
(import ./lsp.nix args)
(import ./options.nix args)
(import ./plugins args)
{
home.sessionVariables = { home.sessionVariables = {
EDITOR = "nvim"; EDITOR = "nvim";
VISUAL = "nvim"; VISUAL = "nvim";
@@ -39,388 +44,6 @@ in
nixd nixd
lazygit lazygit
]; ];
opts = {
number = true;
relativenumber = true;
signcolumn = "yes";
termguicolors = true;
mouse = "a";
clipboard = "unnamedplus";
updatetime = 200;
timeoutlen = 300;
undofile = true;
wrap = false;
scrolloff = 8;
ignorecase = true;
smartcase = true;
splitright = true;
splitbelow = true;
tabstop = 2;
shiftwidth = 2;
expandtab = true;
encoding = "utf-8";
fileencoding = "utf-8";
fileencodings = "utf-8,sjis,euc-jp,iso-2022-jp";
list = true;
listchars = "tab:»-,trail:-,extends:»,precedes:«,nbsp:%";
jumpoptions = "stack";
switchbuf = "useopen,uselast";
foldcolumn = "1";
foldlevel = 99;
foldlevelstart = 99;
foldenable = true;
}; };
globals = {
mapleader = " ";
maplocalleader = " ";
clipboard = "osc52";
};
env = {
LANG = "ja_JP.UTF-8";
LC_MESSAGES = "ja_JP.UTF-8";
};
autoCmd = [
{
event = "TextYankPost";
callback.__raw = "function() vim.highlight.on_yank() end";
} }
]; ]
colorschemes.catppuccin = {
enable = true;
settings.transparent_background = true;
};
diagnostic.settings = {
virtual_text = true;
float = {
border = "rounded";
source = true;
};
};
plugins = {
lsp = {
enable = true;
servers = {
vtsls = {
enable = true;
packageFallback = true;
rootMarkers = [
"pnpm-workspace.yaml"
"package.json"
"tsconfig.json"
"jsconfig.json"
".git"
];
extraOptions.settings.typescript.locale = "ja";
};
biome = {
enable = true;
packageFallback = true;
rootMarkers = [
"biome.json"
"biome.jsonc"
"package.json"
"pnpm-workspace.yaml"
".git"
];
};
tailwindcss.enable = true;
cssls.enable = true;
jsonls.enable = true;
yamlls.enable = true;
lua_ls.enable = true;
nixd.enable = true;
rust_analyzer = {
enable = true;
installCargo = true;
installRustc = true;
};
svelte.enable = true;
ty.enable = true;
ruff.enable = true;
astro.enable = true;
gopls.enable = true;
};
};
blink-cmp = {
enable = true;
setupLspCapabilities = true;
settings = {
keymap = {
preset = "enter";
"<C-Space>" = [ "show" ];
"<C-d>" = [ "scroll_documentation_up" ];
"<C-e>" = [ "hide" ];
"<C-f>" = [ "scroll_documentation_down" ];
"<Tab>" = [
"accept"
{
__raw = ''
function()
local ok, copilot = pcall(require, "copilot.suggestion")
if ok and copilot.is_visible() then
copilot.accept()
return true
end
end
'';
}
"fallback"
];
"<S-Tab>" = [
"select_prev"
"fallback"
];
"<C-n>" = [
"select_next"
"fallback"
];
"<C-p>" = [
"select_prev"
"fallback"
];
};
completion.list.selection = {
preselect = true;
auto_insert = false;
};
sources.default = [
"lsp"
"path"
"buffer"
];
};
};
nvim-autopairs.enable = true;
comment.enable = true;
"conform-nvim" = {
enable = true;
settings = {
formatters_by_ft = {
javascript.__raw = ''{ "biome", "prettierd", "prettier", stop_after_first = true }'';
javascriptreact.__raw = ''{ "biome", "prettierd", "prettier", stop_after_first = true }'';
typescript.__raw = ''{ "biome", "prettierd", "prettier", stop_after_first = true }'';
typescriptreact.__raw = ''{ "biome", "prettierd", "prettier", stop_after_first = true }'';
json.__raw = ''{ "biome", "prettierd", "prettier", stop_after_first = true }'';
yaml.__raw = ''{ "prettierd", "prettier", stop_after_first = true }'';
markdown.__raw = ''{ "prettierd", "prettier", stop_after_first = true }'';
lua = [ "stylua" ];
nix.__raw = ''{ "nix_fmt", "alejandra", stop_after_first = true }'';
sh = [ "shfmt" ];
};
formatters.nix_fmt.command = "nixfmt";
format_on_save.__raw = ''
function(_)
return { timeout_ms = 1000, lsp_format = "fallback" }
end
'';
};
};
copilot-lua = {
enable = true;
settings.suggestion = {
auto_trigger = true;
keymap.enabled = false;
};
};
lazygit.enable = true;
diffview.enable = true;
gitsigns = {
enable = true;
settings.signs = {
add.text = "+";
change.text = "~";
delete.text = "_";
topdelete.text = "‾";
changedelete.text = "~";
};
};
lsp-signature = {
enable = true;
settings = {
hint_enable = true;
hint_prefix = " ";
floating_window = true;
bind = true;
};
};
nvim-surround.enable = true;
treesitter = {
enable = true;
settings = {
highlight.enable = true;
indent.enable = true;
};
};
trouble.enable = true;
barbar = {
enable = true;
settings = {
animation = false;
auto_hide = 1;
tabpages = true;
clickable = true;
focus_on_close = "left";
icons = {
button = "󰅖";
separator = {
left = "▎";
right = "";
};
separator_at_end = false;
filetype.enabled = true;
};
sidebar_filetypes.neo-tree = true;
};
};
indent-blankline = {
enable = true;
settings = {
scope = {
enabled = true;
show_start = true;
show_end = true;
};
exclude.filetypes = [
"help"
"neo-tree"
"toggleterm"
"lazy"
];
};
};
colorizer = {
enable = true;
settings = {
filetypes = [
"*"
"!markdown"
];
user_commands = true;
options = {
parsers = {
css = true;
tailwind = {
enable = true;
lsp = true;
update_names = true;
};
};
display.mode = "background";
};
};
};
dropbar.enable = true;
nvim-lightbulb = {
enable = true;
settings.autocmd.enabled = true;
};
lualine = {
enable = true;
settings.sections.lualine_x = [
{
__raw = ''
function()
local ok, conform = pcall(require, "conform")
if not ok then return "" end
for _, formatter in ipairs(conform.list_formatters(0)) do
if formatter.available then return "󰛖 " .. formatter.name end
end
return ""
end
'';
}
"encoding"
"fileformat"
"filetype"
];
};
neo-tree = {
enable = true;
settings = {
close_if_last_window = true;
filesystem = {
follow_current_file = {
enabled = true;
leave_dirs_open = true;
};
filtered_items = {
visible = true;
hide_dotfiles = false;
hide_gitignored = true;
hide_ignored = false;
hide_hidden = false;
never_show = [
".DS_Store"
"thumbs.db"
];
};
};
};
};
toggleterm.enable = true;
"treesitter-context".enable = true;
web-devicons.enable = true;
which-key.enable = true;
};
extraPlugins = with pkgs.vimPlugins; [
flash-nvim
git-conflict-nvim
glance-nvim
snacks-nvim
nvim-spectre
todo-comments-nvim
nvim-ts-autotag
vim-wakatime
markview-nvim
nvim-scrollbar
nvim-ufo
promise-async
zen-mode-nvim
];
extraConfigLua = ''
vim.cmd.language("ja_JP.utf8")
vim.opt.helplang = { "ja", "en" }
require("flash").setup()
require("git-conflict").setup()
require("glance").setup()
require("spectre").setup()
require("todo-comments").setup()
require("nvim-ts-autotag").setup()
require("markview").setup({ initial_state = false })
require("scrollbar").setup()
require("zen-mode").setup()
require("ufo").setup({
provider_selector = function()
return { "treesitter", "indent" }
end,
})
require("snacks").setup({
picker = {
enabled = true,
actions = require("trouble.sources.snacks").actions,
win = { input = { keys = {
["<C-t>"] = { "trouble_open", mode = { "n", "i" } },
} } },
},
notifier = { enabled = true },
words = { enabled = true },
scroll = { enabled = true },
dim = { enabled = true },
})
'';
inherit keymaps;
};
}
+11 -2
View File
@@ -53,7 +53,14 @@ let
}; };
}; };
in in
[ {
programs.nixvim = {
opts = {
jumpoptions = "stack";
switchbuf = "useopen,uselast";
};
keymaps = [
# Search # Search
(mk "<Esc>" "<cmd>nohlsearch<CR>" "検索ハイライトを解除") (mk "<Esc>" "<cmd>nohlsearch<CR>" "検索ハイライトを解除")
@@ -187,4 +194,6 @@ in
(mkRaw "<leader>fj" "function() Snacks.picker.jumps() end" "ジャンプ履歴を探す") (mkRaw "<leader>fj" "function() Snacks.picker.jumps() end" "ジャンプ履歴を探す")
(mkRaw "<leader>fq" "function() Snacks.picker.qflist() end" "Quickfixを探す") (mkRaw "<leader>fq" "function() Snacks.picker.qflist() end" "Quickfixを探す")
(mkRaw "<leader>fl" "function() Snacks.picker.loclist() end" "Location Listを探す") (mkRaw "<leader>fl" "function() Snacks.picker.loclist() end" "Location Listを探す")
] ];
};
}
+13
View File
@@ -0,0 +1,13 @@
_: {
programs.nixvim = {
env = {
LANG = "ja_JP.UTF-8";
LC_MESSAGES = "ja_JP.UTF-8";
};
extraConfigLua = ''
vim.cmd.language("ja_JP.utf8")
vim.opt.helplang = { "ja", "en" }
'';
};
}
+65
View File
@@ -0,0 +1,65 @@
_: {
programs.nixvim = {
plugins.lsp = {
enable = true;
servers = {
# TypeScript / JavaScript
vtsls = {
enable = true;
packageFallback = true;
rootMarkers = [
"pnpm-workspace.yaml"
"package.json"
"tsconfig.json"
"jsconfig.json"
".git"
];
extraOptions.settings.typescript.locale = "ja";
};
# Biome for lint / format
biome = {
enable = true;
packageFallback = true;
rootMarkers = [
"biome.json"
"biome.jsonc"
"package.json"
"pnpm-workspace.yaml"
".git"
];
};
# Frontend / config languages
tailwindcss.enable = true;
cssls.enable = true;
jsonls.enable = true;
yamlls.enable = true;
lua_ls.enable = true;
nixd.enable = true;
# Other languages
rust_analyzer = {
enable = true;
installCargo = true;
installRustc = true;
};
svelte.enable = true;
ty.enable = true;
ruff.enable = true;
astro.enable = true;
gopls.enable = true;
};
};
# Diagnostic UI
diagnostic.settings = {
virtual_text = true;
float = {
border = "rounded";
source = true;
};
};
};
}
+50
View File
@@ -0,0 +1,50 @@
_: {
programs.nixvim = {
opts = {
# display
number = true;
relativenumber = true;
signcolumn = "yes";
termguicolors = true;
# action
mouse = "a";
clipboard = "unnamedplus";
updatetime = 200;
timeoutlen = 300;
undofile = true;
# display
wrap = false;
scrolloff = 8;
# search
ignorecase = true;
smartcase = true;
# window split
splitright = true;
splitbelow = true;
# indent
tabstop = 2;
shiftwidth = 2;
expandtab = true;
# file encoding
encoding = "utf-8";
fileencoding = "utf-8";
fileencodings = "utf-8,sjis,euc-jp,iso-2022-jp";
# invisible characters
list = true;
listchars = "tab:»-,trail:-,extends:»,precedes:«,nbsp:%";
};
globals = {
mapleader = " ";
maplocalleader = " ";
clipboard = "osc52";
};
};
}
@@ -0,0 +1,5 @@
{ lib, ... }@args:
lib.mkMerge [
(import ./editor args)
(import ./ui args)
]
@@ -0,0 +1,3 @@
_: {
programs.nixvim.plugins.nvim-autopairs.enable = true;
}
@@ -0,0 +1,56 @@
_: {
programs.nixvim.plugins.blink-cmp = {
enable = true;
setupLspCapabilities = true;
settings = {
keymap = {
preset = "enter";
"<C-Space>" = [ "show" ];
"<C-d>" = [ "scroll_documentation_up" ];
"<C-e>" = [ "hide" ];
"<C-f>" = [ "scroll_documentation_down" ];
"<Tab>" = [
"accept"
{
__raw = ''
function()
local ok, copilot = pcall(require, "copilot.suggestion")
if ok and copilot.is_visible() then
copilot.accept()
return true
end
end
'';
}
"fallback"
];
"<S-Tab>" = [
"select_prev"
"fallback"
];
"<C-n>" = [
"select_next"
"fallback"
];
"<C-p>" = [
"select_prev"
"fallback"
];
};
completion.list.selection = {
preselect = true;
auto_insert = false;
};
sources.default = [
"lsp"
"path"
"buffer"
];
};
};
}
@@ -0,0 +1,3 @@
_: {
programs.nixvim.plugins.comment.enable = true;
}
@@ -0,0 +1,27 @@
_: {
programs.nixvim.plugins."conform-nvim" = {
enable = true;
settings = {
formatters_by_ft = {
javascript.__raw = ''{ "biome", "prettierd", "prettier", stop_after_first = true }'';
javascriptreact.__raw = ''{ "biome", "prettierd", "prettier", stop_after_first = true }'';
typescript.__raw = ''{ "biome", "prettierd", "prettier", stop_after_first = true }'';
typescriptreact.__raw = ''{ "biome", "prettierd", "prettier", stop_after_first = true }'';
json.__raw = ''{ "biome", "prettierd", "prettier", stop_after_first = true }'';
yaml.__raw = ''{ "prettierd", "prettier", stop_after_first = true }'';
markdown.__raw = ''{ "prettierd", "prettier", stop_after_first = true }'';
lua = [ "stylua" ];
nix.__raw = ''{ "nix_fmt", "alejandra", stop_after_first = true }'';
sh = [ "shfmt" ];
};
formatters.nix_fmt = {
command = "nixfmt";
};
format_on_save.__raw = ''
function(_)
return { timeout_ms = 1000, lsp_format = "fallback" }
end
'';
};
};
}
@@ -0,0 +1,11 @@
_: {
programs.nixvim.plugins.copilot-lua = {
enable = true;
settings = {
suggestion = {
auto_trigger = true;
keymap.enabled = false;
};
};
};
}
@@ -0,0 +1,21 @@
{ lib, ... }@args:
lib.mkMerge [
(import ./autopairs.nix args)
(import ./blink-cmp.nix args)
(import ./comment.nix args)
(import ./conform.nix args)
(import ./copilot.nix args)
(import ./flash.nix args)
(import ./git-conflict.nix args)
(import ./git.nix args)
(import ./gitsigns.nix args)
(import ./glance.nix args)
(import ./lsp-signature.nix args)
(import ./snacks.nix args)
(import ./spectre.nix args)
(import ./surround.nix args)
(import ./todo-comments.nix args)
(import ./treesitter.nix args)
(import ./trouble.nix args)
(import ./wakatime.nix args)
]
@@ -0,0 +1,9 @@
{ pkgs, ... }:
{
programs.nixvim = {
extraPlugins = [ pkgs.vimPlugins.flash-nvim ];
extraConfigLua = ''
require("flash").setup()
'';
};
}
@@ -0,0 +1,9 @@
{ pkgs, ... }:
{
programs.nixvim = {
extraPlugins = [ pkgs.vimPlugins.git-conflict-nvim ];
extraConfigLua = ''
require("git-conflict").setup()
'';
};
}
@@ -0,0 +1,11 @@
{ pkgs, ... }:
{
programs.nixvim = {
extraPackages = [ pkgs.lazygit ];
plugins = {
lazygit.enable = true;
diffview.enable = true;
};
};
}
@@ -0,0 +1,25 @@
_: {
# git change view
programs.nixvim.plugins.gitsigns = {
enable = true;
settings = {
signs = {
add = {
text = "+";
};
change = {
text = "~";
};
delete = {
text = "_";
};
topdelete = {
text = "‾";
};
changedelete = {
text = "~";
};
};
};
};
}
@@ -0,0 +1,9 @@
{ pkgs, ... }:
{
programs.nixvim = {
extraPlugins = [ pkgs.vimPlugins.glance-nvim ];
extraConfigLua = ''
require("glance").setup()
'';
};
}
@@ -0,0 +1,11 @@
_: {
programs.nixvim.plugins.lsp-signature = {
enable = true;
settings = {
hint_enable = true;
hint_prefix = " ";
floating_window = true;
bind = true;
};
};
}
@@ -0,0 +1,32 @@
{ pkgs, ... }:
{
programs.nixvim = {
extraPlugins = [ pkgs.vimPlugins.snacks-nvim ];
extraConfigLua = ''
require("snacks").setup({
picker = {
enabled = true,
actions = require("trouble.sources.snacks").actions,
win = {
input = {
keys = {
["<C-t>"] = {
"trouble_open",
mode = { "n", "i" },
},
},
},
},
},
notifier = { enabled = true },
words = { enabled = true },
scroll = { enabled = true },
dim = { enabled = true },
})
'';
};
}
@@ -0,0 +1,10 @@
{ pkgs, ... }:
{
programs.nixvim = {
extraPackages = [ pkgs.ripgrep ];
extraPlugins = [ pkgs.vimPlugins.nvim-spectre ];
extraConfigLua = ''
require("spectre").setup()
'';
};
}
@@ -0,0 +1,3 @@
_: {
programs.nixvim.plugins.nvim-surround.enable = true;
}
@@ -0,0 +1,9 @@
{ pkgs, ... }:
{
programs.nixvim = {
extraPlugins = [ pkgs.vimPlugins.todo-comments-nvim ];
extraConfigLua = ''
require("todo-comments").setup()
'';
};
}
@@ -0,0 +1,17 @@
{ pkgs, ... }:
{
programs.nixvim = {
plugins.treesitter = {
enable = true;
settings = {
highlight.enable = true;
indent.enable = true;
};
};
extraPlugins = [ pkgs.vimPlugins.nvim-ts-autotag ];
extraConfigLua = ''
require("nvim-ts-autotag").setup()
'';
};
}
@@ -0,0 +1,3 @@
_: {
programs.nixvim.plugins.trouble.enable = true;
}
@@ -0,0 +1,4 @@
{ pkgs, ... }:
{
programs.nixvim.extraPlugins = [ pkgs.vimPlugins.vim-wakatime ];
}
@@ -0,0 +1,26 @@
_: {
programs.nixvim.plugins.barbar = {
enable = true;
settings = {
animation = false;
auto_hide = 1;
tabpages = true;
clickable = true;
focus_on_close = "left";
icons = {
button = "󰅖";
separator = {
left = "▎";
right = "";
};
separator_at_end = false;
filetype.enabled = true;
};
sidebar_filetypes = {
neo-tree = true;
};
};
};
}
@@ -0,0 +1,20 @@
_: {
programs.nixvim.plugins.indent-blankline = {
enable = true;
settings = {
scope = {
enabled = true;
show_start = true;
show_end = true;
};
exclude = {
filetypes = [
"help"
"neo-tree"
"toggleterm"
"lazy"
];
};
};
};
}
@@ -0,0 +1,26 @@
_: {
programs.nixvim.plugins.colorizer = {
enable = true;
settings = {
filetypes = [
"*"
"!markdown"
];
user_commands = true;
options = {
parsers = {
css = true;
tailwind = {
enable = true;
lsp = true;
update_names = true;
};
};
display.mode = "background";
};
};
};
}
@@ -0,0 +1,18 @@
{ lib, ... }@args:
lib.mkMerge [
(import ./barbar.nix args)
(import ./blankline.nix args)
(import ./colorizer.nix args)
(import ./dropbar.nix args)
(import ./lightbulb.nix args)
(import ./lualine.nix args)
(import ./markview.nix args)
(import ./neo-tree.nix args)
(import ./scrollbar.nix args)
(import ./toggleterm.nix args)
(import ./treesitter.nix args)
(import ./ufo.nix args)
(import ./web-devicons.nix args)
(import ./which-key.nix args)
(import ./zen-mode.nix args)
]
@@ -0,0 +1,3 @@
_: {
programs.nixvim.plugins.dropbar.enable = true;
}
@@ -0,0 +1,6 @@
_: {
programs.nixvim.plugins.nvim-lightbulb = {
enable = true;
settings.autocmd.enabled = true;
};
}
@@ -0,0 +1,25 @@
_: {
programs.nixvim.plugins.lualine = {
enable = true;
settings.sections.lualine_x = [
{
__raw = ''
function()
local ok, conform = pcall(require, "conform")
if not ok then return "" end
local formatters = conform.list_formatters(0)
for _, f in ipairs(formatters) do
if f.available then
return "󰛖 " .. f.name
end
end
return ""
end
'';
}
"encoding"
"fileformat"
"filetype"
];
};
}
@@ -0,0 +1,9 @@
{ pkgs, ... }:
{
programs.nixvim = {
extraPlugins = [ pkgs.vimPlugins.markview-nvim ];
extraConfigLua = ''
require("markview").setup({ initial_state = false })
'';
};
}
@@ -0,0 +1,37 @@
_: {
programs.nixvim = {
plugins.neo-tree = {
enable = true;
settings = {
close_if_last_window = true;
filesystem = {
follow_current_file = {
enabled = true;
leave_dirs_open = true;
};
filtered_items = {
visible = true;
hide_dotfiles = false;
hide_gitignored = true;
hide_ignored = false;
hide_hidden = false;
hide_by_name = [ ];
hide_by_pattern = [ ];
always_show = [ ];
always_show_by_pattern = [ ];
never_show = [
".DS_Store"
"thumbs.db"
];
never_show_by_pattern = [ ];
};
};
};
};
};
}
@@ -0,0 +1,9 @@
{ pkgs, ... }:
{
programs.nixvim = {
extraPlugins = [ pkgs.vimPlugins.nvim-scrollbar ];
extraConfigLua = ''
require("scrollbar").setup()
'';
};
}
@@ -0,0 +1,3 @@
_: {
programs.nixvim.plugins.toggleterm.enable = true;
}
@@ -0,0 +1,3 @@
_: {
programs.nixvim.plugins."treesitter-context".enable = true;
}
@@ -0,0 +1,24 @@
{ pkgs, ... }:
{
programs.nixvim = {
opts = {
foldcolumn = "1";
foldlevel = 99;
foldlevelstart = 99;
foldenable = true;
};
extraPlugins = [
pkgs.vimPlugins.nvim-ufo
pkgs.vimPlugins.promise-async
];
extraConfigLua = ''
require("ufo").setup({
provider_selector = function()
return { "treesitter", "indent" }
end,
})
'';
};
}
@@ -0,0 +1,4 @@
_: {
# icon set preview
programs.nixvim.plugins.web-devicons.enable = true;
}
@@ -0,0 +1,4 @@
_: {
# key map help
programs.nixvim.plugins.which-key.enable = true;
}
@@ -0,0 +1,9 @@
{ pkgs, ... }:
{
programs.nixvim = {
extraPlugins = [ pkgs.vimPlugins.zen-mode-nvim ];
extraConfigLua = ''
require("zen-mode").setup()
'';
};
}