-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
neovim: better diag (trouble), quickfix and testing
- Loading branch information
Showing
10 changed files
with
98 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
-- https://github.com/sindrets/diffview.nvim | ||
require("diffview").setup { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
|
||
----------- | ||
-- Trouble | ||
-- https://github.com/folke/trouble.nvim | ||
local Trouble = require("trouble") | ||
Trouble.setup { | ||
} | ||
|
||
local function trouble_open() | ||
Trouble.open("diagnostics") | ||
end | ||
|
||
local function trouble_close() | ||
Trouble.close("diagnostics") | ||
end | ||
|
||
local function trouble_next() | ||
if Trouble.is_open("diagnostics") then | ||
Trouble.focus() | ||
Trouble.next() | ||
else | ||
vim.diagnostic.goto_next() | ||
end | ||
end | ||
|
||
local function trouble_prev() | ||
if Trouble.is_open("diagnostics") then | ||
Trouble.focus() | ||
Trouble.previous() | ||
else | ||
vim.diagnostic.goto_prev() | ||
end | ||
end | ||
|
||
-- See `:help vim.diagnostic.*` for documentation on any of the below functions | ||
vim.keymap.set('n', '<leader>ds', vim.diagnostic.open_float, { desc = "Diag: Open diagnostic float" }) | ||
vim.keymap.set('n', '<leader>dn', trouble_next, { desc = "Diag: Go to next diagnostic" }) | ||
vim.keymap.set('n', ']d', trouble_next, { desc = "Diag: Go to next diagnostic" }) | ||
vim.keymap.set('n', '<leader>dp', trouble_prev, { desc = "Diag: Go to previous diagnostic" }) | ||
vim.keymap.set('n', '[d', trouble_prev, { desc = "Diag: Go to previous diagnostic" }) | ||
vim.keymap.set('n', '<leader>dl', vim.diagnostic.setloclist, { desc = "Diag: Set location list" }) | ||
vim.keymap.set('n', '<leader>do', trouble_open, { desc = "Diag: Open trouble" }) | ||
vim.keymap.set('n', '<leader>dq', trouble_close, { desc = "Diag: Close trouble" }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters