Compare commits
3 Commits
29e65ee8b1
...
10ffa92ad6
| Author | SHA1 | Date | |
|---|---|---|---|
| 10ffa92ad6 | |||
| 990b883e87 | |||
| f59039751a |
|
|
@ -1,6 +1,19 @@
|
||||||
|
-- WARN: Here be dragons
|
||||||
|
-- This section of the config is rather long and complex please be very sure to
|
||||||
|
-- read it all before making any changes
|
||||||
|
|
||||||
local utilities = require("sherlock5512.utilities")
|
local utilities = require("sherlock5512.utilities")
|
||||||
local log = require("tjdevries.log")
|
local log = require("tjdevries.log")
|
||||||
local required = {'mason','mason-lspconfig','lspconfig','cmp_nvim_lsp','fidget','neodev','mason-null-ls','mason-nvim-dap','dap','dapui'}
|
local required = {'mason',
|
||||||
|
'mason-lspconfig',
|
||||||
|
'lspconfig',
|
||||||
|
'cmp_nvim_lsp',
|
||||||
|
'fidget',
|
||||||
|
'neodev',
|
||||||
|
'mason-null-ls',
|
||||||
|
'mason-nvim-dap',
|
||||||
|
'dap',
|
||||||
|
'dapui'}
|
||||||
local modules = utilities.require_modules(required)
|
local modules = utilities.require_modules(required)
|
||||||
|
|
||||||
if not modules then
|
if not modules then
|
||||||
|
|
@ -26,7 +39,8 @@ modules["mason-lspconfig"].setup_handlers {
|
||||||
["omnisharp"] = function ()
|
["omnisharp"] = function ()
|
||||||
modules["lspconfig"]["omnisharp"].setup {
|
modules["lspconfig"]["omnisharp"].setup {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = function (_,_)
|
on_attach = function (client,_)
|
||||||
|
client.server_capabilities.semanticTokensProvider = nil;
|
||||||
local gr = vim.api.nvim_create_augroup("CS-OnAttach",{})
|
local gr = vim.api.nvim_create_augroup("CS-OnAttach",{})
|
||||||
vim.api.nvim_create_autocmd({"BufWritePre"}, {
|
vim.api.nvim_create_autocmd({"BufWritePre"}, {
|
||||||
group = gr,
|
group = gr,
|
||||||
|
|
@ -162,20 +176,51 @@ if not ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Wrapping since some distros still don't ship nvim 0.8
|
-- do some safe config
|
||||||
|
|
||||||
|
local config = { --shared config
|
||||||
|
code_action = {
|
||||||
|
num_shortcut = true,
|
||||||
|
show_server_name = true,
|
||||||
|
extend_gitsigns = true,
|
||||||
|
},
|
||||||
|
lightbulb = {
|
||||||
|
enable = true,
|
||||||
|
enable_in_insert = false,
|
||||||
|
sign = true,
|
||||||
|
virtual_text = false,
|
||||||
|
},
|
||||||
|
hover = {
|
||||||
|
open_browser = '!$BROWSER'
|
||||||
|
}
|
||||||
|
}
|
||||||
if vim.fn.exists('+winbar') ~= 0 then
|
if vim.fn.exists('+winbar') ~= 0 then
|
||||||
lspsaga.setup({
|
local add = {
|
||||||
symbol_in_winbar = {
|
symbol_in_winbar = {
|
||||||
in_custom = false,
|
in_custom = false,
|
||||||
enable = true,
|
enable = true,
|
||||||
seperator = '>',
|
seperator = '>',
|
||||||
show_file = true,
|
show_file = true,
|
||||||
click_support = false
|
click_support = false
|
||||||
},
|
}
|
||||||
diagnostic_header = { " ", " ", " ", "ﴞ " },
|
}
|
||||||
})
|
config = vim.tbl_deep_extend('error', config,add)
|
||||||
else
|
|
||||||
lspsaga.setup({
|
|
||||||
diagnostic_header = { " ", " ", " ", "ﴞ " },
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if vim.fn.has('nvim-0.9.0') ~= 0 then
|
||||||
|
local add = { ui = {title = true} }
|
||||||
|
config = vim.tbl_deep_extend('error', config,add )
|
||||||
|
end
|
||||||
|
lspsaga.setup(config)
|
||||||
|
|
||||||
|
-- Configure keybinds for lspsaga
|
||||||
|
local map = vim.keymap.set
|
||||||
|
map('n','<leader>ld', '<cmd>Lspsaga hover_doc<CR>' ,{desc = '[lspsaga] hoverdoc'})
|
||||||
|
map('n','<leader>la', '<cmd>Lspsaga code_action<CR>', {desc = '[lspsaga] codeaction'})
|
||||||
|
map('n','<leader>lr', '<cmd>Lspsaga rename<CR>', {desc = '[lspsaga] rename'})
|
||||||
|
map('n','<leader>lo', '<cmd>Lspsaga outline<CR>', {desc = '[lspsaga] outline'})
|
||||||
|
|
||||||
|
|
||||||
|
local wk = require('which-key')
|
||||||
|
|
||||||
|
wk.register({ l = {name = "LSP" }},{ prefix = '<leader>'})
|
||||||
|
|
|
||||||
50
after/plugin/todo-comments.lua
Normal file
50
after/plugin/todo-comments.lua
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
local ok, todo_comments = pcall(require,"todo-comments")
|
||||||
|
|
||||||
|
if not ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
todo_comments.setup {
|
||||||
|
signs = true,
|
||||||
|
sign_priority = 8,
|
||||||
|
|
||||||
|
keywords= {
|
||||||
|
FIX = {
|
||||||
|
icon = "",
|
||||||
|
color = "error",
|
||||||
|
alt = {"FIXME", "BUG", "FIXIT", "ISSUE"}
|
||||||
|
},
|
||||||
|
TODO = { icon = "", color = "info"},
|
||||||
|
HACK = { icon = "", color = "warning"},
|
||||||
|
WARN = { icon = "", color = "warning", alt={"WARNING"}},
|
||||||
|
PERF = { icon = "", alt = {"OPTIM", "PERFORMANCE", "OPTIMISE"}},
|
||||||
|
NOTE = { icon = "", color = "hint", alt = {"INFO"}},
|
||||||
|
TEST = { icon = "", color = "test", alt = {"TESTING ", "PASSED", "FAILED"}}
|
||||||
|
},
|
||||||
|
gui_style = {
|
||||||
|
fg = "NONE",
|
||||||
|
bg = "NONE"
|
||||||
|
},
|
||||||
|
merge_keywords = true,
|
||||||
|
|
||||||
|
highlight = {
|
||||||
|
multiline = true,
|
||||||
|
|
||||||
|
before = "",
|
||||||
|
keyword = "wide",
|
||||||
|
after = "fg",
|
||||||
|
|
||||||
|
comments_only = true,
|
||||||
|
max_line_len = 125,
|
||||||
|
},
|
||||||
|
|
||||||
|
colors = {
|
||||||
|
error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
|
||||||
|
warning = { "DiagnosticWarn", "WarningMsg", "#FBBF24" },
|
||||||
|
info = { "DiagnosticInfo", "#2563EB" },
|
||||||
|
hint = { "DiagnosticHint", "#10B981" },
|
||||||
|
default = { "Identifier", "#7C3AED" },
|
||||||
|
test = { "Identifier", "#FF00FF" }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
64
after/plugin/trouble.lua
Normal file
64
after/plugin/trouble.lua
Normal file
|
|
@ -0,0 +1,64 @@
|
||||||
|
local ok, trouble = pcall(require,'trouble')
|
||||||
|
|
||||||
|
if not ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
trouble.setup({
|
||||||
|
mode = "document_diagnostics",
|
||||||
|
auto_open = true,
|
||||||
|
auto_close = true,
|
||||||
|
|
||||||
|
fold_open = "",
|
||||||
|
fold_close = "",
|
||||||
|
|
||||||
|
signs = {
|
||||||
|
error = "",
|
||||||
|
warning = "",
|
||||||
|
hint = "",
|
||||||
|
information = "",
|
||||||
|
other = "",
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
local map = vim.keymap.set
|
||||||
|
|
||||||
|
map('n',
|
||||||
|
'<leader>xx',
|
||||||
|
function()
|
||||||
|
trouble.toggle()
|
||||||
|
end,
|
||||||
|
{desc = "Toggle trouble"})
|
||||||
|
map('n',
|
||||||
|
'<leader>xw',
|
||||||
|
function()
|
||||||
|
trouble.toggle('workspace_diagnostics')
|
||||||
|
end,
|
||||||
|
{desc = "Toggle trouble (workspace)"})
|
||||||
|
map('n',
|
||||||
|
'<leader>xd',
|
||||||
|
function()
|
||||||
|
trouble.toggle('document_diagnostics')
|
||||||
|
end,
|
||||||
|
{desc = "Toggle trouble (document)"})
|
||||||
|
map('n',
|
||||||
|
'<leader>xq',
|
||||||
|
function()
|
||||||
|
trouble.toggle('quickfix')
|
||||||
|
end,
|
||||||
|
{desc = "Toggle trouble (quickfix)"})
|
||||||
|
map('n',
|
||||||
|
'<leader>xl',
|
||||||
|
function()
|
||||||
|
trouble.toggle('loclist')
|
||||||
|
end,
|
||||||
|
{desc = "Toggle trouble (loclist)"})
|
||||||
|
map('n',
|
||||||
|
'<leader>xt',
|
||||||
|
function()
|
||||||
|
trouble.toggle('todo')
|
||||||
|
end,
|
||||||
|
{desc = "Toggle trouble (todo)"})
|
||||||
|
|
||||||
|
local wk = require("which-key")
|
||||||
|
wk.register({ x = {name = "Trouble"}},{prefix = "<leader>"})
|
||||||
|
|
@ -28,8 +28,8 @@ return require('packer').startup(function(use)
|
||||||
|
|
||||||
-- Looks
|
-- Looks
|
||||||
use { 'ellisonleao/gruvbox.nvim' } -- Apparently has better tresitter support.
|
use { 'ellisonleao/gruvbox.nvim' } -- Apparently has better tresitter support.
|
||||||
use { 'nvim-lualine/lualine.nvim', -- Awesome status line
|
use { 'nvim-lualine/lualine.nvim', -- Awesome status line
|
||||||
requires = {{'nvim-tree/nvim-web-devicons'},-- With icons
|
requires = {{'nvim-tree/nvim-web-devicons'}, -- With icons
|
||||||
{'sherlock5512/lualine-spell-status'}} -- And spell status
|
{'sherlock5512/lualine-spell-status'}} -- And spell status
|
||||||
}
|
}
|
||||||
use {'akinsho/bufferline.nvim',
|
use {'akinsho/bufferline.nvim',
|
||||||
|
|
@ -85,6 +85,8 @@ return require('packer').startup(function(use)
|
||||||
use {'j-hui/fidget.nvim'} -- Show LSP status
|
use {'j-hui/fidget.nvim'} -- Show LSP status
|
||||||
use {'folke/trouble.nvim', -- Show diagnostics in a window
|
use {'folke/trouble.nvim', -- Show diagnostics in a window
|
||||||
requires = {'nvim-tree/nvim-web-devicons'}}
|
requires = {'nvim-tree/nvim-web-devicons'}}
|
||||||
|
use {'folke/todo-comments.nvim',
|
||||||
|
requires = {'nvim-lua/plenary.nvim'}}
|
||||||
|
|
||||||
-- DAP
|
-- DAP
|
||||||
use {'jay-babu/mason-nvim-dap.nvim',
|
use {'jay-babu/mason-nvim-dap.nvim',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user