adapts neovim config
This commit is contained in:
parent
c69697bbd3
commit
7632c3686f
7 changed files with 554 additions and 579 deletions
|
|
@ -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
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue