Skip to content

Commit

Permalink
debug outputs and tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
MonaMayrhofer committed Apr 25, 2023
1 parent bd8e1b8 commit 413d61e
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 47 deletions.
92 changes: 46 additions & 46 deletions modules/filetree/nvimtreelua.nix
Original file line number Diff line number Diff line change
Expand Up @@ -134,58 +134,58 @@ in {

config = let
actions = with nvim.keymap; {

toggle = mkVimAction ":NvimTreeToggle<CR>";
refresh = mkVimAction ":NvimTreeRefresh<CR>";
findFile = mkVimAction ":NvimTreeFindFile<CR>";
findFileToggle = mkVimAction ":NvimTreeFindFileToggle<CR>";
focus = mkVimAction ":NvimTreeFocus<CR>";
};
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)}
},
},
})
'';
};
}
5 changes: 4 additions & 1 deletion modules/lsp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ in {
removeWorkspaceFolder = mkSpecialAction "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>";
listWorkspaceFolder = mkSpecialAction "<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>";

codeAction = mkSpecialAction "<cmd>lua vim.lsp.buf.code_action()<CR>";
hover = mkSpecialAction "<cmd>lua vim.lsp.buf.hover()<CR>";
signatureHelp = mkSpecialAction "<cmd>lua vim.lsp.buf.signature_help()<CR>";
rename = mkSpecialAction "<cmd>lua vim.lsp.buf.rename()<CR>";
Expand Down Expand Up @@ -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]";};
Expand All @@ -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
Expand Down

0 comments on commit 413d61e

Please sign in to comment.