nixvim: improve keymaps, completion, and formatter config

- Add LSP code actions, diagnostic navigation, window navigation keymaps
- Move telescope keymaps to explicit mkRaw form for reliability
- Change buffer nav from <leader>bh/bl to [b/]b
- Fix conform double-setup by moving config to native nixvim settings
- Fix <leader>cf to use conform instead of vim.lsp.buf.format
- Fix <leader>ca to pass diagnostic context to code_action
- Add nvim-lightbulb for code action indicator
- Configure copilot Tab conflict: blink-cmp Tab=accept, C-n/p for cycling
- Add completion.list.selection preselect for immediate Tab acceptance
- Add TypeScript Japanese locale for LSP diagnostics

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
2026-03-11 16:01:17 +09:00
co-authored by Claude Sonnet 4.6
parent 69c5f456e5
commit dfc1461951
9 changed files with 84 additions and 66 deletions
@@ -12,8 +12,29 @@
"<C-e>" = ["hide"];
"<C-f>" = ["scroll_documentation_down"];
"<Tab>" = ["select_next" "fallback"];
"<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 = [
+22 -1
View File
@@ -1,3 +1,24 @@
{...}: {
programs.nixvim.plugins."conform-nvim".enable = true;
programs.nixvim.plugins."conform-nvim" = {
enable = true;
settings = {
formatters_by_ft = {
javascript.__raw = ''{ "prettierd", "prettier", stop_after_first = true }'';
javascriptreact.__raw = ''{ "prettierd", "prettier", stop_after_first = true }'';
typescript.__raw = ''{ "prettierd", "prettier", stop_after_first = true }'';
typescriptreact.__raw = ''{ "prettierd", "prettier", stop_after_first = true }'';
json.__raw = ''{ "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 = ["alejandra"];
sh = ["shfmt"];
};
format_on_save.__raw = ''
function(_)
return { timeout_ms = 1000, lsp_format = "fallback" }
end
'';
};
};
}
@@ -1,5 +1,11 @@
{...}: {
programs.nixvim.plugins.copilot-lua = {
enable = true;
settings = {
suggestion = {
auto_trigger = true;
keymap.enabled = false;
};
};
};
}
@@ -1,43 +1,6 @@
{...}: {
programs.nixvim = {
plugins.telescope = {
enable = true;
extensions = {
fzf-native.enable = true;
};
keymaps = {
"<leader>ff" = {
action = "find_files";
options = {
desc = "ファイルを探す";
silent = true;
};
};
"<leader>fg" = {
action = "live_grep";
options = {
desc = "文字列を全文検索";
silent = true;
};
};
"<leader>fb" = {
action = "buffers";
options = {
desc = "開いているバッファを探す";
silent = true;
};
};
"<leader>fh" = {
action = "help_tags";
options = {
desc = "ヘルプ項目を探す";
silent = true;
};
};
};
};
programs.nixvim.plugins.telescope = {
enable = true;
extensions.fzf-native.enable = true;
};
}
@@ -8,5 +8,6 @@
./toggleterm.nix
./treesitter.nix
./barbar.nix
./lightbulb.nix
];
}
@@ -0,0 +1,6 @@
{...}: {
programs.nixvim.plugins.nvim-lightbulb = {
enable = true;
settings.autocmd.enabled = true;
};
}