chore!: update inputs and fix issues

This commit is contained in:
Moritz Böhme 2024-01-16 12:45:33 +01:00
parent c17fe56071
commit f79dec2ebf
No known key found for this signature in database
GPG key ID: 970C6E89EB0547A9
6 changed files with 225 additions and 241 deletions

View file

@ -102,7 +102,7 @@ local on_attach_def = function(client, bufnr)
}
local timeout = vim.tbl_contains(slow_lsp_servers, client.name, {}) and 500 or 0
vim.defer_fn(function()
vim.lsp.inlay_hint(bufnr, true)
vim.lsp.inlay_hint.enable(bufnr, true)
end, timeout)
end
end

View file

@ -1,66 +1,72 @@
{ lib, pkgs, ... }:
{ pkgs, config, ... }:
with builtins;
{
config.home-manager.users.moritz.programs.neovim.lazy.plugins = with pkgs.vimPlugins; [
{
plugin = nvim-treesitter;
event = [ "BufReadPost" "BufNewFile" ];
opts = {
sync_install = false;
auto_install = false;
highlight = {
enable = true;
(
let
parserDir = pkgs.symlinkJoin {
name = "tresitter-grammars-all";
paths = pkgs.vimPlugins.nvim-treesitter.withAllGrammars.dependencies;
};
textobjects =
{
select =
{
enable = true;
in
{
plugin = nvim-treesitter;
event = [ "BufReadPost" "BufNewFile" ];
opts = {
sync_install = false;
auto_install = false;
highlight = {
enable = true;
};
textobjects =
{
select =
{
enable = true;
# Automatically jump forward to textobj, similar to targets.vim
lookahead = false;
# Automatically jump forward to textobj, similar to targets.vim
lookahead = false;
keymaps = {
# You can use the capture groups defined in textobjects.scm
"af" = {
query = "@function.outer";
desc = "Select outer part of a function region";
};
"if" = {
query = "@function.inner";
desc = "Select inner part of a function region";
};
"ac" = {
query = "@class.outer";
desc = "Select outer part of a class region";
};
"ic" = {
query = "@class.inner";
desc = "Select inner part of a class region";
keymaps = {
# You can use the capture groups defined in textobjects.scm
"af" = {
query = "@function.outer";
desc = "Select outer part of a function region";
};
"if" = {
query = "@function.inner";
desc = "Select inner part of a function region";
};
"ac" = {
query = "@class.outer";
desc = "Select outer part of a class region";
};
"ic" = {
query = "@class.inner";
desc = "Select inner part of a class region";
};
};
};
};
};
};
conf =
let
parserDir = pkgs.symlinkJoin
{
name = "tresitter-grammars-all";
paths = lib.attrValues (lib.filterAttrs (_: builtins.isAttrs) nvim-treesitter-parsers);
};
in
''
vim.opt.runtimepath:append("${parserDir}")
local final_opts = vim.tbl_deep_extend("keep", opts, { parser_install_dir = "${parserDir}" })
require('nvim-treesitter.configs').setup(final_opts)
};
conf =
''
local final_opts = vim.tbl_deep_extend("keep", opts, { parser_install_dir = "${parserDir}" })
require('nvim-treesitter.configs').setup(final_opts)
'';
init = ''
local runtimepath = vim.opt.runtimepath:get()
table.insert(runtimepath, 4, "${parserDir}")
vim.opt.runtimepath = runtimepath
'';
dependencies = [
{ plugin = nvim-treesitter-textobjects; }
{ plugin = nvim-ts-context-commentstring; opts = { }; }
];
}
priority = 100;
dependencies = [
{ plugin = nvim-treesitter-textobjects; }
{ plugin = nvim-ts-context-commentstring; opts = { }; }
];
}
)
{
plugin = nvim-treesitter-textsubjects;
event = [ "BufReadPost" "BufNewFile" ];