adapts neovim config
This commit is contained in:
parent
c69697bbd3
commit
7632c3686f
7 changed files with 554 additions and 579 deletions
|
|
@ -1,23 +0,0 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
flake.modules.nixos.clipboard =
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
wl-clipboard
|
||||
cliphist
|
||||
];
|
||||
|
||||
home-manager.sharedModules = [
|
||||
inputs.self.modules.homeManager.clipboard
|
||||
];
|
||||
};
|
||||
|
||||
flake.modules.homeManager.clipboard =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
# Watch clipboard and store history via cliphist
|
||||
services.cliphist.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,96 +1,96 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
programs.nixvim = {
|
||||
plugins.sleuth.enable = true;
|
||||
plugins.nvim-surround.enable = true;
|
||||
plugins.flash.enable = true;
|
||||
programs.nixvim = {
|
||||
plugins.sleuth.enable = true;
|
||||
plugins.nvim-surround.enable = true;
|
||||
plugins.flash.enable = true;
|
||||
|
||||
plugins.blink-pairs = {
|
||||
enable = true;
|
||||
};
|
||||
plugins.blink-pairs = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
# Workaround: Neovim 0.11.x does not implement the is? / is-not? treesitter
|
||||
# predicates, but newer grammar query files (tree-sitter-nix, tree-sitter-javascript)
|
||||
# use (#is-not? local) to scope highlights to non-local identifiers.
|
||||
# Register no-op handlers to suppress the error; remove once Neovim
|
||||
# ships with built-in support for these predicates.
|
||||
extraConfigLua = /* lua */ ''
|
||||
-- (#is?) always returns false (node never "is" something)
|
||||
vim.treesitter.query.add_predicate("is?", function()
|
||||
return false
|
||||
end, { force = true })
|
||||
-- (#is-not?) always returns true (node is always "not" something)
|
||||
vim.treesitter.query.add_predicate("is-not?", function()
|
||||
return true
|
||||
end, { force = true })
|
||||
'';
|
||||
# Workaround: Neovim 0.11.x does not implement the is? / is-not? treesitter
|
||||
# predicates, but newer grammar query files (tree-sitter-nix, tree-sitter-javascript)
|
||||
# use (#is-not? local) to scope highlights to non-local identifiers.
|
||||
# Register no-op handlers to suppress the error; remove once Neovim
|
||||
# ships with built-in support for these predicates.
|
||||
extraConfigLua = /* lua */ ''
|
||||
-- (#is?) always returns false (node never "is" something)
|
||||
vim.treesitter.query.add_predicate("is?", function()
|
||||
return false
|
||||
end, { force = true })
|
||||
-- (#is-not?) always returns true (node is always "not" something)
|
||||
vim.treesitter.query.add_predicate("is-not?", function()
|
||||
return true
|
||||
end, { force = true })
|
||||
'';
|
||||
|
||||
plugins.treesitter = {
|
||||
enable = true;
|
||||
highlight.enable = true;
|
||||
indent.enable = true;
|
||||
folding.enable = true;
|
||||
plugins.treesitter = {
|
||||
enable = true;
|
||||
highlight.enable = true;
|
||||
indent.enable = true;
|
||||
folding.enable = true;
|
||||
|
||||
grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
|
||||
angular
|
||||
bash
|
||||
css
|
||||
html
|
||||
javascript
|
||||
jsdoc
|
||||
json
|
||||
lua
|
||||
make
|
||||
markdown
|
||||
markdown_inline
|
||||
go
|
||||
gomod
|
||||
gotmpl
|
||||
python
|
||||
styled
|
||||
tsx
|
||||
typescript
|
||||
nix
|
||||
regex
|
||||
toml
|
||||
vim
|
||||
vimdoc
|
||||
xml
|
||||
yaml
|
||||
];
|
||||
};
|
||||
|
||||
plugins.substitute = {
|
||||
enable = true;
|
||||
luaConfig.post = /* lua */ ''
|
||||
local sub = require("substitute")
|
||||
vim.keymap.set("n", "s", sub.operator, { noremap = true })
|
||||
vim.keymap.set("n", "ss", sub.line, { noremap = true })
|
||||
vim.keymap.set("n", "S", sub.eol, { noremap = true })
|
||||
vim.keymap.set("x", "s", sub.visual, { noremap = true })
|
||||
'';
|
||||
};
|
||||
|
||||
extraPlugins = [
|
||||
pkgs.vimPlugins.vim-cool
|
||||
];
|
||||
|
||||
autoCmd = [
|
||||
{
|
||||
callback.__raw = "function() vim.highlight.on_yank() end";
|
||||
event = [
|
||||
"TextYankPost"
|
||||
];
|
||||
}
|
||||
{
|
||||
event = [ "FileType" ];
|
||||
pattern = "qf";
|
||||
callback.__raw = /* lua */ ''
|
||||
function()
|
||||
vim.keymap.set("n", "<CR>", "<CR>", { buffer = true })
|
||||
end
|
||||
'';
|
||||
}
|
||||
grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
|
||||
angular
|
||||
bash
|
||||
css
|
||||
html
|
||||
javascript
|
||||
jsdoc
|
||||
json
|
||||
lua
|
||||
make
|
||||
markdown
|
||||
markdown_inline
|
||||
go
|
||||
gomod
|
||||
gotmpl
|
||||
python
|
||||
styled
|
||||
tsx
|
||||
typescript
|
||||
nix
|
||||
regex
|
||||
toml
|
||||
vim
|
||||
vimdoc
|
||||
xml
|
||||
yaml
|
||||
];
|
||||
};
|
||||
|
||||
plugins.substitute = {
|
||||
enable = true;
|
||||
luaConfig.post = /* lua */ ''
|
||||
local sub = require("substitute")
|
||||
vim.keymap.set("n", "s", sub.operator, { noremap = true })
|
||||
vim.keymap.set("n", "ss", sub.line, { noremap = true })
|
||||
vim.keymap.set("n", "S", sub.eol, { noremap = true })
|
||||
vim.keymap.set("x", "s", sub.visual, { noremap = true })
|
||||
'';
|
||||
};
|
||||
|
||||
extraPlugins = [
|
||||
pkgs.vimPlugins.vim-cool
|
||||
];
|
||||
|
||||
autoCmd = [
|
||||
{
|
||||
callback.__raw = "function() vim.highlight.on_yank() end";
|
||||
event = [
|
||||
"TextYankPost"
|
||||
];
|
||||
}
|
||||
{
|
||||
event = [ "FileType" ];
|
||||
pattern = "qf";
|
||||
callback.__raw = /* lua */ ''
|
||||
function()
|
||||
vim.keymap.set("n", "<CR>", "<CR>", { buffer = true })
|
||||
end
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,55 +1,55 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
programs.nixvim.plugins.conform-nvim = {
|
||||
enable = true;
|
||||
settings = {
|
||||
formatters_by_ft = {
|
||||
typescriptreact = {
|
||||
__unkeyed-1 = "biome-check";
|
||||
__unkeyed-2 = "prettierd";
|
||||
stop_after_first = true;
|
||||
};
|
||||
astro = [ "prettierd" ];
|
||||
typescript = {
|
||||
__unkeyed-1 = "biome-check";
|
||||
__unkeyed-2 = "prettierd";
|
||||
stop_after_first = true;
|
||||
};
|
||||
javascript = {
|
||||
__unkeyed-1 = "biome-check";
|
||||
__unkeyed-2 = "prettierd";
|
||||
stop_after_first = true;
|
||||
};
|
||||
javascriptreact = {
|
||||
__unkeyed-1 = "biome-check";
|
||||
__unkeyed-2 = "prettierd";
|
||||
stop_after_first = true;
|
||||
};
|
||||
html = [ "prettierd" ];
|
||||
htmlangular = [ "prettierd" ];
|
||||
css = {
|
||||
__unkeyed-1 = "biome-check";
|
||||
__unkeyed-2 = "prettierd";
|
||||
stop_after_first = true;
|
||||
};
|
||||
yaml = [ "prettierd" ];
|
||||
markdown = [ "prettierd" ];
|
||||
json = {
|
||||
__unkeyed-1 = "biome-check";
|
||||
__unkeyed-2 = "prettierd";
|
||||
stop_after_first = true;
|
||||
};
|
||||
lua = [ "stylua" ];
|
||||
go = [ "goimports" ];
|
||||
gomod = [ "goimports" ];
|
||||
gowork = [ "goimports" ];
|
||||
gotmpl = [ "goimports" ];
|
||||
programs.nixvim.plugins.conform-nvim = {
|
||||
enable = true;
|
||||
settings = {
|
||||
formatters_by_ft = {
|
||||
typescriptreact = {
|
||||
__unkeyed-1 = "biome-check";
|
||||
__unkeyed-2 = "prettierd";
|
||||
stop_after_first = true;
|
||||
};
|
||||
format_on_save = {
|
||||
timeout_ms = 500;
|
||||
lsp_format = "fallback";
|
||||
astro = [ "prettierd" ];
|
||||
typescript = {
|
||||
__unkeyed-1 = "biome-check";
|
||||
__unkeyed-2 = "prettierd";
|
||||
stop_after_first = true;
|
||||
};
|
||||
javascript = {
|
||||
__unkeyed-1 = "biome-check";
|
||||
__unkeyed-2 = "prettierd";
|
||||
stop_after_first = true;
|
||||
};
|
||||
javascriptreact = {
|
||||
__unkeyed-1 = "biome-check";
|
||||
__unkeyed-2 = "prettierd";
|
||||
stop_after_first = true;
|
||||
};
|
||||
html = [ "prettierd" ];
|
||||
htmlangular = [ "prettierd" ];
|
||||
css = {
|
||||
__unkeyed-1 = "biome-check";
|
||||
__unkeyed-2 = "prettierd";
|
||||
stop_after_first = true;
|
||||
};
|
||||
yaml = [ "prettierd" ];
|
||||
markdown = [ "prettierd" ];
|
||||
json = {
|
||||
__unkeyed-1 = "biome-check";
|
||||
__unkeyed-2 = "prettierd";
|
||||
stop_after_first = true;
|
||||
};
|
||||
lua = [ "stylua" ];
|
||||
go = [ "goimports" ];
|
||||
gomod = [ "goimports" ];
|
||||
gowork = [ "goimports" ];
|
||||
gotmpl = [ "goimports" ];
|
||||
};
|
||||
format_on_save = {
|
||||
timeout_ms = 500;
|
||||
lsp_format = "fallback";
|
||||
};
|
||||
extraPackages = [ pkgs.stylua ];
|
||||
};
|
||||
extraPackages = [ pkgs.stylua ];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,31 +1,31 @@
|
|||
{ ... }:
|
||||
{
|
||||
programs.nixvim = {
|
||||
plugins.gitportal = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
key = "<leader>gll";
|
||||
action = "<cmd>GitPortal<cr>";
|
||||
options.desc = "Open line in Git provider";
|
||||
}
|
||||
{
|
||||
key = "<leader>gll";
|
||||
action = "<cmd>GitPortal<cr>";
|
||||
options.desc = "Open line in Git provider";
|
||||
}
|
||||
{
|
||||
key = "<leader>gly";
|
||||
action = "<cmd>GitPortal copy_link_to_clipboard<cr>";
|
||||
options.desc = "Copy link to line at Git provider";
|
||||
}
|
||||
{
|
||||
key = "<leader>glo";
|
||||
action = "<cmd>GitPortal open_link<cr>";
|
||||
options.desc = "Open link to line at Git provider";
|
||||
}
|
||||
];
|
||||
programs.nixvim = {
|
||||
plugins.gitportal = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
key = "<leader>gll";
|
||||
action = "<cmd>GitPortal<cr>";
|
||||
options.desc = "Open line in Git provider";
|
||||
}
|
||||
{
|
||||
key = "<leader>gll";
|
||||
action = "<cmd>GitPortal<cr>";
|
||||
options.desc = "Open line in Git provider";
|
||||
}
|
||||
{
|
||||
key = "<leader>gly";
|
||||
action = "<cmd>GitPortal copy_link_to_clipboard<cr>";
|
||||
options.desc = "Copy link to line at Git provider";
|
||||
}
|
||||
{
|
||||
key = "<leader>glo";
|
||||
action = "<cmd>GitPortal open_link<cr>";
|
||||
options.desc = "Open link to line at Git provider";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,200 +1,200 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
programs.nixvim = {
|
||||
plugins.lspconfig.enable = true;
|
||||
programs.nixvim = {
|
||||
plugins.lspconfig.enable = true;
|
||||
|
||||
lsp = {
|
||||
enable = true;
|
||||
lsp = {
|
||||
enable = true;
|
||||
|
||||
servers = {
|
||||
lua_ls = {
|
||||
enable = true;
|
||||
package = pkgs.lua-language-server;
|
||||
packageFallback = true;
|
||||
};
|
||||
nil_ls = {
|
||||
enable = true;
|
||||
package = pkgs.nil;
|
||||
packageFallback = true;
|
||||
};
|
||||
gopls = {
|
||||
enable = true;
|
||||
package = pkgs.gopls;
|
||||
packageFallback = true;
|
||||
};
|
||||
ts_ls = {
|
||||
enable = true;
|
||||
package = pkgs.typescript-language-server;
|
||||
packageFallback = true;
|
||||
};
|
||||
jsonls = {
|
||||
enable = true;
|
||||
package = pkgs.vscode-langservers-extracted;
|
||||
packageFallback = true;
|
||||
};
|
||||
cssls = {
|
||||
enable = true;
|
||||
package = pkgs.vscode-langservers-extracted;
|
||||
packageFallback = true;
|
||||
};
|
||||
html = {
|
||||
enable = true;
|
||||
package = pkgs.vscode-langservers-extracted;
|
||||
packageFallback = true;
|
||||
};
|
||||
astro = {
|
||||
enable = true;
|
||||
package = pkgs.astro-language-server;
|
||||
packageFallback = true;
|
||||
config.init_options.typescript.tsdk = "${pkgs.typescript}/lib/node_modules/typescript/lib";
|
||||
};
|
||||
eslint = {
|
||||
enable = true;
|
||||
package = pkgs.vscode-langservers-extracted;
|
||||
packageFallback = true;
|
||||
config = {
|
||||
root_markers = [
|
||||
".eslintrc"
|
||||
".eslintrc.js"
|
||||
".eslintrc.cjs"
|
||||
".eslintrc.yaml"
|
||||
".eslintrc.yml"
|
||||
".eslintrc.json"
|
||||
"eslint.config.js"
|
||||
"eslint.config.mjs"
|
||||
"eslint.config.cjs"
|
||||
"eslint.config.ts"
|
||||
"eslint.config.mts"
|
||||
"eslint.config.cts"
|
||||
"package.json"
|
||||
];
|
||||
settings = {
|
||||
validate = "on";
|
||||
useESLintClass = false;
|
||||
experimental = {
|
||||
useFlatConfig = true;
|
||||
servers = {
|
||||
lua_ls = {
|
||||
enable = true;
|
||||
package = pkgs.lua-language-server;
|
||||
packageFallback = true;
|
||||
};
|
||||
nil_ls = {
|
||||
enable = true;
|
||||
package = pkgs.nil;
|
||||
packageFallback = true;
|
||||
};
|
||||
gopls = {
|
||||
enable = true;
|
||||
package = pkgs.gopls;
|
||||
packageFallback = true;
|
||||
};
|
||||
ts_ls = {
|
||||
enable = true;
|
||||
package = pkgs.typescript-language-server;
|
||||
packageFallback = true;
|
||||
};
|
||||
jsonls = {
|
||||
enable = true;
|
||||
package = pkgs.vscode-langservers-extracted;
|
||||
packageFallback = true;
|
||||
};
|
||||
cssls = {
|
||||
enable = true;
|
||||
package = pkgs.vscode-langservers-extracted;
|
||||
packageFallback = true;
|
||||
};
|
||||
html = {
|
||||
enable = true;
|
||||
package = pkgs.vscode-langservers-extracted;
|
||||
packageFallback = true;
|
||||
};
|
||||
astro = {
|
||||
enable = true;
|
||||
package = pkgs.astro-language-server;
|
||||
packageFallback = true;
|
||||
config.init_options.typescript.tsdk = "${pkgs.typescript}/lib/node_modules/typescript/lib";
|
||||
};
|
||||
eslint = {
|
||||
enable = true;
|
||||
package = pkgs.vscode-langservers-extracted;
|
||||
packageFallback = true;
|
||||
config = {
|
||||
root_markers = [
|
||||
".eslintrc"
|
||||
".eslintrc.js"
|
||||
".eslintrc.cjs"
|
||||
".eslintrc.yaml"
|
||||
".eslintrc.yml"
|
||||
".eslintrc.json"
|
||||
"eslint.config.js"
|
||||
"eslint.config.mjs"
|
||||
"eslint.config.cjs"
|
||||
"eslint.config.ts"
|
||||
"eslint.config.mts"
|
||||
"eslint.config.cts"
|
||||
"package.json"
|
||||
];
|
||||
settings = {
|
||||
validate = "on";
|
||||
useESLintClass = false;
|
||||
experimental = {
|
||||
useFlatConfig = true;
|
||||
};
|
||||
codeActionOnSave = {
|
||||
enable = false;
|
||||
mode = "all";
|
||||
};
|
||||
format = true;
|
||||
quiet = false;
|
||||
onIgnoredFiles = "off";
|
||||
rulesCustomizations = { };
|
||||
run = "onType";
|
||||
problems = {
|
||||
shortenToSingleLine = false;
|
||||
};
|
||||
nodePath = "";
|
||||
workingDirectory = {
|
||||
mode = "location";
|
||||
};
|
||||
codeAction = {
|
||||
disableRuleComment = {
|
||||
enable = true;
|
||||
location = "separateLine";
|
||||
};
|
||||
codeActionOnSave = {
|
||||
enable = false;
|
||||
mode = "all";
|
||||
};
|
||||
format = true;
|
||||
quiet = false;
|
||||
onIgnoredFiles = "off";
|
||||
rulesCustomizations = { };
|
||||
run = "onType";
|
||||
problems = {
|
||||
shortenToSingleLine = false;
|
||||
};
|
||||
nodePath = "";
|
||||
workingDirectory = {
|
||||
mode = "location";
|
||||
};
|
||||
codeAction = {
|
||||
disableRuleComment = {
|
||||
enable = true;
|
||||
location = "separateLine";
|
||||
};
|
||||
showDocumentation = {
|
||||
enable = true;
|
||||
};
|
||||
showDocumentation = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
handlers = {
|
||||
"eslint/openDoc".__raw = /* lua */ ''
|
||||
function(_, result)
|
||||
if result then
|
||||
vim.ui.open(result.url)
|
||||
end
|
||||
return {}
|
||||
};
|
||||
handlers = {
|
||||
"eslint/openDoc".__raw = /* lua */ ''
|
||||
function(_, result)
|
||||
if result then
|
||||
vim.ui.open(result.url)
|
||||
end
|
||||
'';
|
||||
"eslint/confirmESLintExecution" = /* lua */ ''
|
||||
function(_, result)
|
||||
if not result then
|
||||
return
|
||||
end
|
||||
return 4 -- approved
|
||||
end
|
||||
'';
|
||||
"eslint/probeFailed" = /* lua */ ''
|
||||
function()
|
||||
vim.notify("[lspconfig] ESLint probe failed.", vim.log.levels.WARN)
|
||||
return {}
|
||||
end
|
||||
'';
|
||||
"eslint/noLibrary" = /* lua */ ''
|
||||
function()
|
||||
vim.notify("[lspconfig] Unable to find ESLint library.", vim.log.levels.WARN)
|
||||
return {}
|
||||
end
|
||||
'';
|
||||
};
|
||||
on_new_config.__raw = /* lua */ ''
|
||||
function(config, new_root_dir)
|
||||
-- This function is called when LSP attaches to a new buffer
|
||||
-- Set the working directory to the root where eslint config is found
|
||||
config.settings = config.settings or {}
|
||||
config.settings.workspaceFolder = {
|
||||
uri = new_root_dir,
|
||||
name = vim.fn.fnamemodify(new_root_dir, ":t"),
|
||||
}
|
||||
|
||||
-- Detect flat config
|
||||
local flat_config_files = {
|
||||
"eslint.config.js",
|
||||
"eslint.config.mjs",
|
||||
"eslint.config.cjs",
|
||||
"eslint.config.ts",
|
||||
"eslint.config.mts",
|
||||
"eslint.config.cts",
|
||||
}
|
||||
|
||||
for _, file in ipairs(flat_config_files) do
|
||||
local config_path = new_root_dir .. "/" .. file
|
||||
if vim.uv.fs_stat(config_path) then
|
||||
config.settings.experimental = config.settings.experimental or {}
|
||||
config.settings.experimental.useFlatConfig = true
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
-- Support Yarn PnP
|
||||
local pnp_cjs = new_root_dir .. "/.pnp.cjs"
|
||||
local pnp_js = new_root_dir .. "/.pnp.js"
|
||||
if vim.uv.fs_stat(pnp_cjs) or vim.uv.fs_stat(pnp_js) then
|
||||
config.cmd = vim.list_extend({ "yarn", "exec" }, config.cmd or {})
|
||||
return {}
|
||||
end
|
||||
'';
|
||||
"eslint/confirmESLintExecution" = /* lua */ ''
|
||||
function(_, result)
|
||||
if not result then
|
||||
return
|
||||
end
|
||||
return 4 -- approved
|
||||
end
|
||||
'';
|
||||
"eslint/probeFailed" = /* lua */ ''
|
||||
function()
|
||||
vim.notify("[lspconfig] ESLint probe failed.", vim.log.levels.WARN)
|
||||
return {}
|
||||
end
|
||||
'';
|
||||
"eslint/noLibrary" = /* lua */ ''
|
||||
function()
|
||||
vim.notify("[lspconfig] Unable to find ESLint library.", vim.log.levels.WARN)
|
||||
return {}
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
biome = {
|
||||
enable = true;
|
||||
package = null;
|
||||
packageFallback = false;
|
||||
on_new_config.__raw = /* lua */ ''
|
||||
function(config, new_root_dir)
|
||||
-- This function is called when LSP attaches to a new buffer
|
||||
-- Set the working directory to the root where eslint config is found
|
||||
config.settings = config.settings or {}
|
||||
config.settings.workspaceFolder = {
|
||||
uri = new_root_dir,
|
||||
name = vim.fn.fnamemodify(new_root_dir, ":t"),
|
||||
}
|
||||
|
||||
-- Detect flat config
|
||||
local flat_config_files = {
|
||||
"eslint.config.js",
|
||||
"eslint.config.mjs",
|
||||
"eslint.config.cjs",
|
||||
"eslint.config.ts",
|
||||
"eslint.config.mts",
|
||||
"eslint.config.cts",
|
||||
}
|
||||
|
||||
for _, file in ipairs(flat_config_files) do
|
||||
local config_path = new_root_dir .. "/" .. file
|
||||
if vim.uv.fs_stat(config_path) then
|
||||
config.settings.experimental = config.settings.experimental or {}
|
||||
config.settings.experimental.useFlatConfig = true
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
-- Support Yarn PnP
|
||||
local pnp_cjs = new_root_dir .. "/.pnp.cjs"
|
||||
local pnp_js = new_root_dir .. "/.pnp.js"
|
||||
if vim.uv.fs_stat(pnp_cjs) or vim.uv.fs_stat(pnp_js) then
|
||||
config.cmd = vim.list_extend({ "yarn", "exec" }, config.cmd or {})
|
||||
end
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
key = "<leader>ca";
|
||||
lspBufAction = "code_action";
|
||||
}
|
||||
{
|
||||
key = "<leader>e";
|
||||
action = "<cmd>lua vim.diagnostic.open_float()<cr>";
|
||||
}
|
||||
];
|
||||
biome = {
|
||||
enable = true;
|
||||
package = null;
|
||||
packageFallback = false;
|
||||
};
|
||||
};
|
||||
|
||||
# Define diagnostic appearance
|
||||
diagnostic.settings = {
|
||||
virtual_text = false;
|
||||
signs = true;
|
||||
underline = true;
|
||||
update_in_insert = false;
|
||||
severity_sort = false;
|
||||
};
|
||||
keymaps = [
|
||||
{
|
||||
key = "<leader>ca";
|
||||
lspBufAction = "code_action";
|
||||
}
|
||||
{
|
||||
key = "<leader>e";
|
||||
action = "<cmd>lua vim.diagnostic.open_float()<cr>";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# Define diagnostic appearance
|
||||
diagnostic.settings = {
|
||||
virtual_text = false;
|
||||
signs = true;
|
||||
underline = true;
|
||||
update_in_insert = false;
|
||||
severity_sort = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,50 +1,48 @@
|
|||
{ ... }:
|
||||
{
|
||||
programs.nixvim = {
|
||||
globals = {
|
||||
mapleader = " ";
|
||||
maplocalleader = " ";
|
||||
};
|
||||
|
||||
clipboard.register = "unnamedplus";
|
||||
|
||||
opts = {
|
||||
backup = false;
|
||||
cmdheight = 1;
|
||||
conceallevel = 0;
|
||||
fileencoding = "utf-8";
|
||||
hlsearch = true;
|
||||
ignorecase = true;
|
||||
mouse = "a";
|
||||
pumheight = 10;
|
||||
showmode = false;
|
||||
smartindent = true;
|
||||
breakindent = true;
|
||||
showtabline = 0;
|
||||
smartcase = true;
|
||||
splitbelow = true;
|
||||
splitright = true;
|
||||
swapfile = false;
|
||||
termguicolors = true;
|
||||
timeoutlen = 600;
|
||||
undofile = true;
|
||||
updatetime = 230;
|
||||
writebackup = false;
|
||||
expandtab = true;
|
||||
shiftwidth = 2;
|
||||
tabstop = 2;
|
||||
cursorline = true;
|
||||
number = true;
|
||||
relativenumber = true;
|
||||
numberwidth = 2;
|
||||
signcolumn = "yes";
|
||||
linebreak = true;
|
||||
breakat = " ^I!@*-+;:,./?";
|
||||
scrolloff = 4;
|
||||
sidescrolloff = 4;
|
||||
winbar = "";
|
||||
foldlevel = 99;
|
||||
foldlevelstart = 99;
|
||||
};
|
||||
programs.nixvim = {
|
||||
globals = {
|
||||
mapleader = " ";
|
||||
maplocalleader = " ";
|
||||
};
|
||||
|
||||
clipboard.register = "unnamedplus";
|
||||
|
||||
opts = {
|
||||
backup = false;
|
||||
cmdheight = 1;
|
||||
conceallevel = 0;
|
||||
fileencoding = "utf-8";
|
||||
hlsearch = true;
|
||||
ignorecase = true;
|
||||
mouse = "a";
|
||||
pumheight = 10;
|
||||
showmode = false;
|
||||
showtabline = 0;
|
||||
smartcase = true;
|
||||
splitbelow = true;
|
||||
splitright = true;
|
||||
swapfile = false;
|
||||
termguicolors = true;
|
||||
timeoutlen = 600;
|
||||
undofile = true;
|
||||
updatetime = 230;
|
||||
writebackup = false;
|
||||
expandtab = true;
|
||||
shiftwidth = 2;
|
||||
tabstop = 2;
|
||||
cursorline = true;
|
||||
number = true;
|
||||
relativenumber = true;
|
||||
numberwidth = 2;
|
||||
signcolumn = "yes";
|
||||
linebreak = true;
|
||||
breakat = " ^I!@*-+;:,./?";
|
||||
scrolloff = 4;
|
||||
sidescrolloff = 4;
|
||||
winbar = "";
|
||||
foldlevel = 99;
|
||||
foldlevelstart = 99;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,172 +1,172 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
programs.nixvim = {
|
||||
plugins.oil = {
|
||||
enable = true;
|
||||
settings = {
|
||||
keymaps = {
|
||||
"q" = "actions.close";
|
||||
};
|
||||
columns = [
|
||||
"icon"
|
||||
"permissions"
|
||||
"size"
|
||||
"mtime"
|
||||
];
|
||||
programs.nixvim = {
|
||||
plugins.oil = {
|
||||
enable = true;
|
||||
settings = {
|
||||
keymaps = {
|
||||
"q" = "actions.close";
|
||||
};
|
||||
columns = [
|
||||
"icon"
|
||||
"permissions"
|
||||
"size"
|
||||
"mtime"
|
||||
];
|
||||
};
|
||||
|
||||
extraPlugins = [ pkgs.vimPlugins.snacks-nvim ];
|
||||
extraConfigLua = /* lua */ ''
|
||||
local Snacks = require("snacks");
|
||||
local filter_lsp_definitions = function(item)
|
||||
if item.file:match("/react/ts5.0/") or item.file:match("react.d.ts") then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
Snacks.setup({
|
||||
bigfile = { enabled = true },
|
||||
bufdelete = { enabled = true },
|
||||
git = { enabled = true },
|
||||
indent = { enabled = true },
|
||||
input = { enabled = true },
|
||||
notifier = { enabled = true },
|
||||
picker = {
|
||||
enabled = true,
|
||||
prompt = "λ ",
|
||||
layout = { preset = "ivy" },
|
||||
},
|
||||
statuscolumn = { enabled = true },
|
||||
})
|
||||
'';
|
||||
|
||||
keymaps = [
|
||||
# Git
|
||||
{
|
||||
key = "<leader>gb";
|
||||
action.__raw = "function() Snacks.git.blame_line() end";
|
||||
options.desc = "Show git blame for current line";
|
||||
}
|
||||
# Picker
|
||||
{
|
||||
key = "<leader>.";
|
||||
action.__raw = "function() Snacks.picker.files({ hidden = true }) end";
|
||||
options.desc = "Files";
|
||||
}
|
||||
{
|
||||
key = "<leader><leader>";
|
||||
action.__raw = "function() Snacks.picker.git_files() end";
|
||||
options.desc = "Git files";
|
||||
}
|
||||
# Find
|
||||
{
|
||||
key = "<leader>fr";
|
||||
action.__raw = "function() Snacks.picker.recent() end";
|
||||
options.desc = "Recent";
|
||||
}
|
||||
{
|
||||
key = "<leader>fp";
|
||||
action.__raw = "function() Snacks.picker.projects() end";
|
||||
options.desc = "Projects";
|
||||
}
|
||||
{
|
||||
key = "<leader>bb";
|
||||
action.__raw = "function() Snacks.picker.buffers() end";
|
||||
options.desc = "List buffers";
|
||||
}
|
||||
{
|
||||
key = "<leader>bd";
|
||||
action.__raw = "function() Snacks.bufdelete() end";
|
||||
options.desc = "Delete buffer";
|
||||
}
|
||||
{
|
||||
key = "<leader>bD";
|
||||
action.__raw = "function() Snacks.bufdelete.all() end";
|
||||
options.desc = "Delete all buffers";
|
||||
}
|
||||
{
|
||||
key = "<leader>bo";
|
||||
action.__raw = "function() Snacks.bufdelete.other() end";
|
||||
options.desc = "Delete other buffers";
|
||||
}
|
||||
# Search
|
||||
{
|
||||
key = "<leader>ss";
|
||||
action.__raw = "function() Snacks.picker.grep() end";
|
||||
options.desc = "Grep";
|
||||
}
|
||||
{
|
||||
mode = [
|
||||
"n"
|
||||
"x"
|
||||
];
|
||||
key = "<leader>sw";
|
||||
action.__raw = "function() Snacks.picker.grep_word() end";
|
||||
options.desc = "Visual selection or word";
|
||||
}
|
||||
{
|
||||
key = "<leader>su";
|
||||
action.__raw = "function() Snacks.picker.undo() end";
|
||||
options.desc = "Undo History";
|
||||
}
|
||||
# Diagnostics
|
||||
{
|
||||
key = "<leader>td";
|
||||
action.__raw = "function() Snacks.picker.diagnostics_buffer() end";
|
||||
options.desc = "Buffer Diagnostics";
|
||||
}
|
||||
{
|
||||
key = "<leader>ta";
|
||||
action.__raw = "function() Snacks.picker.diagnostics() end";
|
||||
options.desc = "Diagnostics";
|
||||
}
|
||||
# LSP
|
||||
{
|
||||
key = "gd";
|
||||
action.__raw = "function() Snacks.picker.lsp_definitions({ filter = { filter = filter_lsp_definitions } }) end";
|
||||
options.desc = "Goto Definition";
|
||||
}
|
||||
{
|
||||
key = "gD";
|
||||
action.__raw = "function() Snacks.picker.lsp_declarations() end";
|
||||
options.desc = "Goto Declaration";
|
||||
}
|
||||
{
|
||||
key = "grr";
|
||||
action.__raw = "function() Snacks.picker.lsp_references() end";
|
||||
options = {
|
||||
desc = "References";
|
||||
nowait = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
key = "gI";
|
||||
action.__raw = "function() Snacks.picker.lsp_implementations() end";
|
||||
options.desc = "Goto Implementation";
|
||||
}
|
||||
{
|
||||
key = "gy";
|
||||
action.__raw = "function() Snacks.picker.lsp_type_definitions() end";
|
||||
options.desc = "Goto T[y]pe Definition";
|
||||
}
|
||||
# Notifications and highlights
|
||||
{
|
||||
key = "<leader>on";
|
||||
action.__raw = "function() Snacks.notifier.show_history() end";
|
||||
options.desc = "Open notification history";
|
||||
}
|
||||
{
|
||||
key = "<leader>oh";
|
||||
action.__raw = "function() Snacks.picker.highlights() end";
|
||||
options.desc = "List highlights";
|
||||
}
|
||||
{
|
||||
key = "<leader>n";
|
||||
action = "<cmd>Oil<cr>";
|
||||
options.desc = "Opens file explorer";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
extraPlugins = [ pkgs.vimPlugins.snacks-nvim ];
|
||||
extraConfigLua = /* lua */ ''
|
||||
local Snacks = require("snacks");
|
||||
local filter_lsp_definitions = function(item)
|
||||
if item.file:match("/react/ts5.0/") or item.file:match("react.d.ts") then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
Snacks.setup({
|
||||
bigfile = { enabled = true },
|
||||
bufdelete = { enabled = true },
|
||||
git = { enabled = true },
|
||||
indent = { enabled = true },
|
||||
input = { enabled = true },
|
||||
notifier = { enabled = true },
|
||||
picker = {
|
||||
enabled = true,
|
||||
prompt = "λ ",
|
||||
layout = { preset = "ivy" },
|
||||
},
|
||||
statuscolumn = { enabled = true },
|
||||
})
|
||||
'';
|
||||
|
||||
keymaps = [
|
||||
# Git
|
||||
{
|
||||
key = "<leader>gb";
|
||||
action.__raw = "function() Snacks.git.blame_line() end";
|
||||
options.desc = "Show git blame for current line";
|
||||
}
|
||||
# Picker
|
||||
{
|
||||
key = "<leader>.";
|
||||
action.__raw = "function() Snacks.picker.files({ hidden = true }) end";
|
||||
options.desc = "Files";
|
||||
}
|
||||
{
|
||||
key = "<leader><leader>";
|
||||
action.__raw = "function() Snacks.picker.git_files() end";
|
||||
options.desc = "Git files";
|
||||
}
|
||||
# Find
|
||||
{
|
||||
key = "<leader>fr";
|
||||
action.__raw = "function() Snacks.picker.recent() end";
|
||||
options.desc = "Recent";
|
||||
}
|
||||
{
|
||||
key = "<leader>fp";
|
||||
action.__raw = "function() Snacks.picker.projects() end";
|
||||
options.desc = "Projects";
|
||||
}
|
||||
{
|
||||
key = "<leader>bb";
|
||||
action.__raw = "function() Snacks.picker.buffers() end";
|
||||
options.desc = "List buffers";
|
||||
}
|
||||
{
|
||||
key = "<leader>bd";
|
||||
action.__raw = "function() Snacks.bufdelete() end";
|
||||
options.desc = "Delete buffer";
|
||||
}
|
||||
{
|
||||
key = "<leader>bD";
|
||||
action.__raw = "function() Snacks.bufdelete.all() end";
|
||||
options.desc = "Delete all buffers";
|
||||
}
|
||||
{
|
||||
key = "<leader>bo";
|
||||
action.__raw = "function() Snacks.bufdelete.other() end";
|
||||
options.desc = "Delete other buffers";
|
||||
}
|
||||
# Search
|
||||
{
|
||||
key = "<leader>ss";
|
||||
action.__raw = "function() Snacks.picker.grep() end";
|
||||
options.desc = "Grep";
|
||||
}
|
||||
{
|
||||
mode = [
|
||||
"n"
|
||||
"x"
|
||||
];
|
||||
key = "<leader>sw";
|
||||
action.__raw = "function() Snacks.picker.grep_word() end";
|
||||
options.desc = "Visual selection or word";
|
||||
}
|
||||
{
|
||||
key = "<leader>su";
|
||||
action.__raw = "function() Snacks.picker.undo() end";
|
||||
options.desc = "Undo History";
|
||||
}
|
||||
# Diagnostics
|
||||
{
|
||||
key = "<leader>td";
|
||||
action.__raw = "function() Snacks.picker.diagnostics_buffer() end";
|
||||
options.desc = "Buffer Diagnostics";
|
||||
}
|
||||
{
|
||||
key = "<leader>ta";
|
||||
action.__raw = "function() Snacks.picker.diagnostics() end";
|
||||
options.desc = "Diagnostics";
|
||||
}
|
||||
# LSP
|
||||
{
|
||||
key = "gd";
|
||||
action.__raw = "function() Snacks.picker.lsp_definitions({ filter = { filter = filter_lsp_definitions } }) end";
|
||||
options.desc = "Goto Definition";
|
||||
}
|
||||
{
|
||||
key = "gD";
|
||||
action.__raw = "function() Snacks.picker.lsp_declarations() end";
|
||||
options.desc = "Goto Declaration";
|
||||
}
|
||||
{
|
||||
key = "grr";
|
||||
action.__raw = "function() Snacks.picker.lsp_references() end";
|
||||
options = {
|
||||
desc = "References";
|
||||
nowait = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
key = "gI";
|
||||
action.__raw = "function() Snacks.picker.lsp_implementations() end";
|
||||
options.desc = "Goto Implementation";
|
||||
}
|
||||
{
|
||||
key = "gy";
|
||||
action.__raw = "function() Snacks.picker.lsp_type_definitions() end";
|
||||
options.desc = "Goto T[y]pe Definition";
|
||||
}
|
||||
# Notifications and highlights
|
||||
{
|
||||
key = "<leader>on";
|
||||
action.__raw = "function() Snacks.notifier.show_history() end";
|
||||
options.desc = "Open notification history";
|
||||
}
|
||||
{
|
||||
key = "<leader>oh";
|
||||
action.__raw = "function() Snacks.picker.highlights() end";
|
||||
options.desc = "List highlights";
|
||||
}
|
||||
{
|
||||
key = "<leader>n";
|
||||
action = "<cmd>Oil<cr>";
|
||||
options.desc = "Opens file explorer";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue