From 413d61e9a17199d317958b1084d92bf4c46996d8 Mon Sep 17 00:00:00 2001 From: Mona Mayrhofer Date: Tue, 25 Apr 2023 13:59:58 +0200 Subject: [PATCH] debug outputs and tweaks --- modules/filetree/nvimtreelua.nix | 92 ++++++++++++++++---------------- modules/lsp/default.nix | 5 +- 2 files changed, 50 insertions(+), 47 deletions(-) diff --git a/modules/filetree/nvimtreelua.nix b/modules/filetree/nvimtreelua.nix index 26be10b..6948c85 100644 --- a/modules/filetree/nvimtreelua.nix +++ b/modules/filetree/nvimtreelua.nix @@ -134,58 +134,58 @@ in { config = let actions = with nvim.keymap; { - toggle = mkVimAction ":NvimTreeToggle"; refresh = mkVimAction ":NvimTreeRefresh"; findFile = mkVimAction ":NvimTreeFindFile"; + findFileToggle = mkVimAction ":NvimTreeFindFileToggle"; focus = mkVimAction ":NvimTreeFocus"; }; - in mkIf cfg.enable { - nvim-flake.keymapActions = {nvimTreeLua = actions;}; - vim.startPlugins = ["nvim-tree-lua"]; - - - vim.luaConfigRC.nvimtreelua = nvim.dag.entryAnywhere '' - require'nvim-tree'.setup({ - disable_netrw = ${boolToString cfg.disableNetRW}, - hijack_netrw = ${boolToString cfg.hijackNetRW}, - open_on_tab = ${boolToString cfg.openTreeOnNewTab}, - open_on_setup = ${boolToString cfg.openOnSetup}, - open_on_setup_file = ${boolToString cfg.openOnSetup}, - system_open = { - cmd = ${"'" + cfg.systemOpenCmd + "'"}, - }, - diagnostics = { - enable = ${boolToString cfg.lspDiagnostics}, - }, - view = { - width = ${toString cfg.treeWidth}, - side = ${"'" + cfg.treeSide + "'"}, - }, - renderer = { - indent_markers = { - enable = ${boolToString cfg.indentMarkers}, + in + mkIf cfg.enable { + nvim-flake.keymapActions = {nvimTreeLua = actions;}; + vim.startPlugins = ["nvim-tree-lua"]; + + vim.luaConfigRC.nvimtreelua = nvim.dag.entryAnywhere '' + require'nvim-tree'.setup({ + disable_netrw = ${boolToString cfg.disableNetRW}, + hijack_netrw = ${boolToString cfg.hijackNetRW}, + open_on_tab = ${boolToString cfg.openTreeOnNewTab}, + open_on_setup = ${boolToString cfg.openOnSetup}, + open_on_setup_file = ${boolToString cfg.openOnSetup}, + system_open = { + cmd = ${"'" + cfg.systemOpenCmd + "'"}, }, - add_trailing = ${boolToString cfg.trailingSlash}, - group_empty = ${boolToString cfg.groupEmptyFolders}, - }, - actions = { - open_file = { - quit_on_open = ${boolToString cfg.closeOnFileOpen}, - resize_window = ${boolToString cfg.resizeOnFileOpen}, + diagnostics = { + enable = ${boolToString cfg.lspDiagnostics}, }, - }, - git = { - enable = true, - ignore = ${boolToString cfg.hideIgnoredGitFiles}, - }, - filters = { - dotfiles = ${boolToString cfg.hideDotFiles}, - custom = { - ${builtins.concatStringsSep "\n" (builtins.map (s: "\"" + s + "\",") cfg.hideFiles)} + view = { + width = ${toString cfg.treeWidth}, + side = ${"'" + cfg.treeSide + "'"}, }, - }, - }) - ''; - }; + renderer = { + indent_markers = { + enable = ${boolToString cfg.indentMarkers}, + }, + add_trailing = ${boolToString cfg.trailingSlash}, + group_empty = ${boolToString cfg.groupEmptyFolders}, + }, + actions = { + open_file = { + quit_on_open = ${boolToString cfg.closeOnFileOpen}, + resize_window = ${boolToString cfg.resizeOnFileOpen}, + }, + }, + git = { + enable = true, + ignore = ${boolToString cfg.hideIgnoredGitFiles}, + }, + filters = { + dotfiles = ${boolToString cfg.hideDotFiles}, + custom = { + ${builtins.concatStringsSep "\n" (builtins.map (s: "\"" + s + "\",") cfg.hideFiles)} + }, + }, + }) + ''; + }; } diff --git a/modules/lsp/default.nix b/modules/lsp/default.nix index 04f86b3..7527dc4 100644 --- a/modules/lsp/default.nix +++ b/modules/lsp/default.nix @@ -42,6 +42,7 @@ in { removeWorkspaceFolder = mkSpecialAction "lua vim.lsp.buf.remove_workspace_folder()"; listWorkspaceFolder = mkSpecialAction "lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))"; + codeAction = mkSpecialAction "lua vim.lsp.buf.code_action()"; hover = mkSpecialAction "lua vim.lsp.buf.hover()"; signatureHelp = mkSpecialAction "lua vim.lsp.buf.signature_help()"; rename = mkSpecialAction "lua vim.lsp.buf.rename()"; @@ -77,6 +78,7 @@ in { #''; in mkIf cfg.enable { + nvim-flake.keymapActions = {lsp = actions;}; vim.startPlugins = optional usingNvimCmp "cmp-nvim-lsp"; vim.autocomplete.sources = {"nvim_lsp" = "[LSP]";}; @@ -85,7 +87,8 @@ in { vim.g.formatsave = ${boolToString cfg.formatOnSave}; local attach_keymaps = function(client, bufnr) - ${traceVal keymapString} + + ${traceSeq {inherit keymapString;} keymapString} end -- Enable formatting