Compare commits
5 commits
feature/La
...
develop
Author | SHA1 | Date | |
---|---|---|---|
Paul Stemmet | e0e3d72e8e | ||
Paul Stemmet | ac705ce937 | ||
Paul Stemmet | 38568df712 | ||
Paul Stemmet | afaf382e25 | ||
Paul Stemmet | 7724f3d086 |
|
@ -4,18 +4,22 @@ local M, S = {}, {}
|
||||||
|
|
||||||
---Toggle the line numbers and diagnostic gutter
|
---Toggle the line numbers and diagnostic gutter
|
||||||
function M.ToggleGutter()
|
function M.ToggleGutter()
|
||||||
local o = vim.opt
|
local o, diagnostic = vim.opt, vim.diagnostic
|
||||||
|
|
||||||
if o.number:get() then
|
if o.number:get() then
|
||||||
S.signcolumn = o.signcolumn:get()
|
S.signcolumn = o.signcolumn:get()
|
||||||
o.number = false
|
o.number = false
|
||||||
o.relativenumber = false
|
o.relativenumber = false
|
||||||
o.signcolumn = 'no'
|
o.signcolumn = 'no'
|
||||||
|
diagnostic.enable(false)
|
||||||
else
|
else
|
||||||
o.number = true
|
o.number = true
|
||||||
o.relativenumber = true
|
o.relativenumber = true
|
||||||
o.signcolumn = S.signcolumn or 'yes:1'
|
o.signcolumn = S.signcolumn or 'yes:1'
|
||||||
|
diagnostic.enable(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
vim.cmd 'IBLToggle'
|
||||||
end
|
end
|
||||||
|
|
||||||
---Open a float with your local config files
|
---Open a float with your local config files
|
||||||
|
|
|
@ -48,7 +48,9 @@ M.Python = core.preset('pyright', 'lazyvim.plugins.extras.lang.python', core.lsp
|
||||||
M.Rust = core.preset('rust-analyzer', 'lazyvim.plugins.extras.lang.rust', function(server, opts)
|
M.Rust = core.preset('rust-analyzer', 'lazyvim.plugins.extras.lang.rust', function(server, opts)
|
||||||
return {
|
return {
|
||||||
'mrcjkb/rustaceanvim',
|
'mrcjkb/rustaceanvim',
|
||||||
opts = { default_settings = core.make_server(server, opts.settings) }
|
opts = {
|
||||||
|
server = { default_settings = { [server] = opts.settings } }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
|
@ -144,8 +144,12 @@ return {
|
||||||
|
|
||||||
-- CSpell setup
|
-- CSpell setup
|
||||||
local cspell = require 'cspell'
|
local cspell = require 'cspell'
|
||||||
|
local cspell_config_json = function(_)
|
||||||
|
return vim.fn.stdpath('config') .. '/cspell.json'
|
||||||
|
end
|
||||||
local cspell_opts = {
|
local cspell_opts = {
|
||||||
config = {
|
config = {
|
||||||
|
find_json = cspell_config_json,
|
||||||
on_add_to_json = function(payload)
|
on_add_to_json = function(payload)
|
||||||
if vim.fn.executable('jq') == 0 then return end
|
if vim.fn.executable('jq') == 0 then return end
|
||||||
|
|
||||||
|
@ -172,6 +176,12 @@ return {
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- Ensure our config file exists, otherwise cspell complains
|
||||||
|
local uv = (vim.uv or vim.loop);
|
||||||
|
if not uv.fs_stat(cspell_config_json()) then
|
||||||
|
vim.fn.writefile({'{}'}, cspell_config_json())
|
||||||
|
end
|
||||||
|
|
||||||
opts.sources = vim.tbl_extend('force', opts.sources or {}, {
|
opts.sources = vim.tbl_extend('force', opts.sources or {}, {
|
||||||
cspell.diagnostics.with(cspell_opts),
|
cspell.diagnostics.with(cspell_opts),
|
||||||
cspell.code_actions.with(cspell_opts),
|
cspell.code_actions.with(cspell_opts),
|
||||||
|
|
Loading…
Reference in a new issue