mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-22 05:10:44 +00:00
Compare commits
4 commits
a00f0f8e6a
...
5fb8cb8785
Author | SHA1 | Date | |
---|---|---|---|
|
5fb8cb8785 | ||
|
8a827f92c9 | ||
|
c99afe12c3 | ||
|
73cc5edd31 |
4 changed files with 22 additions and 11 deletions
|
@ -54,5 +54,10 @@ in {
|
||||||
Nvf now uses $NVIM_APP_NAME so there is no longer the problem of
|
Nvf now uses $NVIM_APP_NAME so there is no longer the problem of
|
||||||
(accidental) leaking of user configuration.
|
(accidental) leaking of user configuration.
|
||||||
'')
|
'')
|
||||||
|
|
||||||
|
(mkRemovedOptionModule ["vim" "lsp" "trouble" "mappings" "toggle"] ''
|
||||||
|
With Trouble having so many different modes, and breaking changes
|
||||||
|
upstream, it no longer makes sense, nor works, to toggle only Trouble.
|
||||||
|
'')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,6 +58,9 @@ in {
|
||||||
-- buffer is a real file on the disk
|
-- buffer is a real file on the disk
|
||||||
local real_file = vim.fn.filereadable(data.file) == 1
|
local real_file = vim.fn.filereadable(data.file) == 1
|
||||||
|
|
||||||
|
-- buffer is a directory
|
||||||
|
local directory = vim.fn.isdirectory(data.file) == 1
|
||||||
|
|
||||||
-- buffer is a [No Name]
|
-- buffer is a [No Name]
|
||||||
local no_name = data.file == "" and vim.bo[data.buf].buftype == ""
|
local no_name = data.file == "" and vim.bo[data.buf].buftype == ""
|
||||||
|
|
||||||
|
@ -65,15 +68,19 @@ in {
|
||||||
local filetype = vim.bo[data.buf].ft
|
local filetype = vim.bo[data.buf].ft
|
||||||
|
|
||||||
-- only files please
|
-- only files please
|
||||||
if not real_file and not no_name then
|
if not real_file and not directory and not no_name then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- skip ignored filetypes
|
-- skip ignored filetypes
|
||||||
if vim.tbl_contains(IGNORED_FT, filetype) then
|
if vim.tbl_contains(IGNORED_FT, filetype) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- cd if buffer is a directory
|
||||||
|
if directory then
|
||||||
|
vim.cmd.cd(data.file)
|
||||||
|
end
|
||||||
-- open the tree but don't focus it
|
-- open the tree but don't focus it
|
||||||
require("nvim-tree.api").tree.toggle({ focus = false })
|
require("nvim-tree.api").tree.toggle({ focus = false })
|
||||||
end
|
end
|
||||||
|
|
|
@ -21,19 +21,18 @@ in {
|
||||||
|
|
||||||
cmd = "Trouble";
|
cmd = "Trouble";
|
||||||
keys = [
|
keys = [
|
||||||
(mkSetLznBinding "n" mappings.toggle "<cmd>TroubleToggle<CR>")
|
(mkSetLznBinding "n" mappings.workspaceDiagnostics "<cmd>Trouble toggle diagnostics<CR>")
|
||||||
(mkSetLznBinding "n" mappings.workspaceDiagnostics "<cmd>TroubleToggle workspace_diagnostics<CR>")
|
(mkSetLznBinding "n" mappings.documentDiagnostics "<cmd>Trouble toggle diagnostics filter.buf=0<CR>")
|
||||||
(mkSetLznBinding "n" mappings.documentDiagnostics "<cmd>TroubleToggle document_diagnostics<CR>")
|
(mkSetLznBinding "n" mappings.lspReferences "<cmd>Trouble toggle lsp_references<CR>")
|
||||||
(mkSetLznBinding "n" mappings.lspReferences "<cmd>TroubleToggle lsp_references<CR>")
|
(mkSetLznBinding "n" mappings.quickfix "<cmd>Trouble toggle quickfix<CR>")
|
||||||
(mkSetLznBinding "n" mappings.quickfix "<cmd>TroubleToggle quickfix<CR>")
|
(mkSetLznBinding "n" mappings.locList "<cmd>Trouble toggle loclist<CR>")
|
||||||
(mkSetLznBinding "n" mappings.locList "<cmd>TroubleToggle loclist<CR>")
|
(mkSetLznBinding "n" mappings.symbols "<cmd>Trouble toggle symbols<CR>")
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
binds.whichKey.register = pushDownDefault {
|
binds.whichKey.register = pushDownDefault {
|
||||||
"<leader>l" = "Trouble";
|
|
||||||
"<leader>x" = "+Trouble";
|
"<leader>x" = "+Trouble";
|
||||||
"<leader>lw" = "Workspace";
|
"<leader>lw" = "+Workspace";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,12 +10,12 @@ in {
|
||||||
setupOpts = mkPluginSetupOption "Trouble" {};
|
setupOpts = mkPluginSetupOption "Trouble" {};
|
||||||
|
|
||||||
mappings = {
|
mappings = {
|
||||||
toggle = mkMappingOption "Toggle trouble [trouble]" "<leader>xx";
|
|
||||||
workspaceDiagnostics = mkMappingOption "Workspace diagnostics [trouble]" "<leader>lwd";
|
workspaceDiagnostics = mkMappingOption "Workspace diagnostics [trouble]" "<leader>lwd";
|
||||||
documentDiagnostics = mkMappingOption "Document diagnostics [trouble]" "<leader>ld";
|
documentDiagnostics = mkMappingOption "Document diagnostics [trouble]" "<leader>ld";
|
||||||
lspReferences = mkMappingOption "LSP References [trouble]" "<leader>lr";
|
lspReferences = mkMappingOption "LSP References [trouble]" "<leader>lr";
|
||||||
quickfix = mkMappingOption "QuickFix [trouble]" "<leader>xq";
|
quickfix = mkMappingOption "QuickFix [trouble]" "<leader>xq";
|
||||||
locList = mkMappingOption "LOCList [trouble]" "<leader>xl";
|
locList = mkMappingOption "LOCList [trouble]" "<leader>xl";
|
||||||
|
symbols = mkMappingOption "Symbols [trouble]" "<leader>xs";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue