nvim: adapt config for neovim 0.6.0
This commit is contained in:
parent
1cc8d84e41
commit
f71b6d1c94
|
@ -7,8 +7,6 @@ local opts = {noremap = true, silent = true}
|
||||||
-- Globally defined mappings --
|
-- Globally defined mappings --
|
||||||
-------------------------------
|
-------------------------------
|
||||||
local normal_mappings = {
|
local normal_mappings = {
|
||||||
-- Better Y
|
|
||||||
Y = {'y$', 'Yank to eol'},
|
|
||||||
-- Easier start and end of line
|
-- Easier start and end of line
|
||||||
H = {'^', 'Start of the line'},
|
H = {'^', 'Start of the line'},
|
||||||
L = {'$', 'End of the line'},
|
L = {'$', 'End of the line'},
|
||||||
|
|
|
@ -43,6 +43,7 @@ function M.cmp()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
formatting = {
|
formatting = {
|
||||||
|
-- fields = {'kind', 'abbr', 'menu'},
|
||||||
format = function(entry, vim_item)
|
format = function(entry, vim_item)
|
||||||
local lspkind_icons = {
|
local lspkind_icons = {
|
||||||
Text = '',
|
Text = '',
|
||||||
|
|
|
@ -17,7 +17,7 @@ function M.signature()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.saga()
|
function M.saga()
|
||||||
require('lspsaga').init_lsp_saga {
|
require('lspsaga').setup {
|
||||||
debug = false,
|
debug = false,
|
||||||
use_saga_diagnostic_sign = true,
|
use_saga_diagnostic_sign = true,
|
||||||
-- diagnostic sign
|
-- diagnostic sign
|
||||||
|
@ -56,7 +56,8 @@ function M.saga()
|
||||||
definition_preview_icon = ' ',
|
definition_preview_icon = ' ',
|
||||||
border_style = 'single',
|
border_style = 'single',
|
||||||
rename_prompt_prefix = '',
|
rename_prompt_prefix = '',
|
||||||
server_filetype_map = {}
|
server_filetype_map = {},
|
||||||
|
diagnostic_prefix_format = '%d. '
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -122,10 +123,10 @@ function M.todo_comments()
|
||||||
exclude = {'org'} -- list of file types to exclude highlighting
|
exclude = {'org'} -- list of file types to exclude highlighting
|
||||||
},
|
},
|
||||||
colors = {
|
colors = {
|
||||||
error = {'LspDiagnosticsDefaultError', 'TSDanger', '#bf616a', '#e06c75'},
|
error = {'DiagnosticError', 'TSDanger', '#bf616a', '#e06c75'},
|
||||||
warning = {'LspDiagnosticsDefaultWarning', 'TSWarning', '#ebcb8b', '#e5c07b'},
|
warning = {'DiagnosticWarn', 'TSWarning', '#ebcb8b', '#e5c07b'},
|
||||||
info = {'LspDiagnosticsDefaultInformation', 'TSNote', '#81a1c1', '#61afef'},
|
info = {'DiagnosticInfo', 'TSNote', '#81a1c1', '#61afef'},
|
||||||
hint = {'LspDiagnosticsDefaultHint', '#88c0d0', '#56b6c2'},
|
hint = {'DiagnosticHint', '#88c0d0', '#56b6c2'},
|
||||||
default = {'Normal', '#d8dee9', '#abb2bf'}
|
default = {'Normal', '#d8dee9', '#abb2bf'}
|
||||||
},
|
},
|
||||||
search = {
|
search = {
|
||||||
|
|
|
@ -4,8 +4,46 @@ local util = require('modules.lsp.util')
|
||||||
local on_attach = util.common_on_attach
|
local on_attach = util.common_on_attach
|
||||||
local capabilities = util.common_capabilities()
|
local capabilities = util.common_capabilities()
|
||||||
|
|
||||||
util.setup_handlers()
|
local border = {
|
||||||
|
{'┌', 'FloatBorder'},
|
||||||
|
{'─', 'FloatBorder'},
|
||||||
|
{'┐', 'FloatBorder'},
|
||||||
|
{'│', 'FloatBorder'},
|
||||||
|
{'┘', 'FloatBorder'},
|
||||||
|
{'─', 'FloatBorder'},
|
||||||
|
{'└', 'FloatBorder'},
|
||||||
|
{'│', 'FloatBorder'}
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, {
|
||||||
|
border = border,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.signature_help, {
|
||||||
|
border = border,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.diagnostic.config({
|
||||||
|
virtual_text = {
|
||||||
|
prefix = '■',
|
||||||
|
-- source = 'always'
|
||||||
|
},
|
||||||
|
signs = {
|
||||||
|
active = true,
|
||||||
|
values = {
|
||||||
|
{name = 'DiagnosticsSignError', text = ''},
|
||||||
|
{name = 'DiagnosticsSignWarning', text = ''},
|
||||||
|
{name = 'DiagnosticsSignInformation', text = ''},
|
||||||
|
{name = 'DiagnosticsSignHint', text = ''}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
update_in_insert = false,
|
||||||
|
severity_sort = true
|
||||||
|
})
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
-- Servers' configurations --
|
||||||
|
-----------------------------
|
||||||
lspconf.clangd.setup {
|
lspconf.clangd.setup {
|
||||||
filetypes = {'c', 'cpp'},
|
filetypes = {'c', 'cpp'},
|
||||||
init_options = {
|
init_options = {
|
||||||
|
|
|
@ -12,7 +12,6 @@ M['neovim/nvim-lspconfig'] = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'tami5/lspsaga.nvim',
|
'tami5/lspsaga.nvim',
|
||||||
branch = 'nvim51',
|
|
||||||
config = conf.saga,
|
config = conf.saga,
|
||||||
opt = true
|
opt = true
|
||||||
},
|
},
|
||||||
|
|
|
@ -151,46 +151,6 @@ function M.common_capabilities()
|
||||||
return capabilities
|
return capabilities
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.setup_handlers()
|
|
||||||
local border = {
|
|
||||||
{'┌', 'FloatBorder'},
|
|
||||||
{'─', 'FloatBorder'},
|
|
||||||
{'┐', 'FloatBorder'},
|
|
||||||
{'│', 'FloatBorder'},
|
|
||||||
{'┘', 'FloatBorder'},
|
|
||||||
{'─', 'FloatBorder'},
|
|
||||||
{'└', 'FloatBorder'},
|
|
||||||
{'│', 'FloatBorder'}
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
|
|
||||||
underline = false,
|
|
||||||
virtual_text = {
|
|
||||||
prefix = '■',
|
|
||||||
source = 'always'
|
|
||||||
},
|
|
||||||
signs = {
|
|
||||||
active = true,
|
|
||||||
values = {
|
|
||||||
{name = 'LspDiagnosticsSignError', text = ''},
|
|
||||||
{name = 'LspDiagnosticsSignWarning', text = ''},
|
|
||||||
{name = 'LspDiagnosticsSignInformation', text = ''},
|
|
||||||
{name = 'LspDiagnosticsSignHint', text = ''}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
update_in_insert = false,
|
|
||||||
severity_sort = true
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, {
|
|
||||||
border = border,
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.signature_help, {
|
|
||||||
border = border,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
function M.lua_lib_path()
|
function M.lua_lib_path()
|
||||||
local lib_path = {}
|
local lib_path = {}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
local M = {}
|
local M = {}
|
||||||
local colors = require('themes.' .. vim.g.colors_name .. '.colors')
|
local colors = require('themes.' .. vim.g.colors_name .. '.colors')
|
||||||
local vi_mode_utils = require('feline.providers.vi_mode')
|
local vi_mode_utils = require('feline.providers.vi_mode')
|
||||||
local lightbulb_present, lightbulb = pcall(require, 'nvim-lightbulb')
|
|
||||||
-- local gps_present, gps = pcall(require, 'nvim-gps')
|
|
||||||
|
|
||||||
local function file_osinfo()
|
local function file_osinfo()
|
||||||
local os = vim.bo.fileformat:upper()
|
local os = vim.bo.fileformat:upper()
|
||||||
|
@ -24,6 +22,50 @@ local function buffer_not_empty()
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function is_lsp_attached()
|
||||||
|
return next(vim.lsp.buf_get_clients(0)) ~= nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local function lsp_active_clients()
|
||||||
|
local clients = {}
|
||||||
|
|
||||||
|
-- Typical lsp clients
|
||||||
|
for _, client in pairs(vim.lsp.buf_get_clients(0)) do
|
||||||
|
if client.name ~= 'null-ls' then
|
||||||
|
table.insert(clients, client.name)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- null-ls sources
|
||||||
|
local null_ls_methods = require('null-ls.methods')
|
||||||
|
local active_sources = require('null-ls.info').get_active_sources()
|
||||||
|
|
||||||
|
local linter_method = null_ls_methods.internal['DIAGNOSTICS']
|
||||||
|
local active_linters = active_sources[linter_method] or {}
|
||||||
|
vim.list_extend(clients, active_linters)
|
||||||
|
|
||||||
|
local formatter_method = null_ls_methods.internal['FORMATTING']
|
||||||
|
local active_formatters = active_sources[formatter_method] or {}
|
||||||
|
vim.list_extend(clients, active_formatters)
|
||||||
|
|
||||||
|
return table.concat(clients, ', ')
|
||||||
|
end
|
||||||
|
|
||||||
|
local function lsp_diagnostic_count(bufnr)
|
||||||
|
bufnr = bufnr or 0
|
||||||
|
local diagnostics = vim.diagnostic.get(bufnr)
|
||||||
|
local count = {0, 0, 0, 0}
|
||||||
|
|
||||||
|
for _, diagnostic in ipairs(diagnostics) do
|
||||||
|
count[diagnostic.severity] = count[diagnostic.severity] + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
return count[vim.diagnostic.severity.ERROR],
|
||||||
|
count[vim.diagnostic.severity.WARN],
|
||||||
|
count[vim.diagnostic.severity.INFO],
|
||||||
|
count[vim.diagnostic.severity.HINT]
|
||||||
|
end
|
||||||
|
|
||||||
-- Default colors for statusline --
|
-- Default colors for statusline --
|
||||||
M['normal_colors'] = {bg = colors.grey1, fg = colors.fg}
|
M['normal_colors'] = {bg = colors.grey1, fg = colors.fg}
|
||||||
M['vi_mode_colors'] = {
|
M['vi_mode_colors'] = {
|
||||||
|
@ -75,7 +117,7 @@ M['fileinfo'] = {
|
||||||
opts = {
|
opts = {
|
||||||
file_modified_icon = ' ',
|
file_modified_icon = ' ',
|
||||||
file_readonly_icon = ' ',
|
file_readonly_icon = ' ',
|
||||||
type = 'base-only' -- relative, unique, full-path, short-path, relative-short, unique-short
|
type = 'base-only'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
enabled = buffer_not_empty,
|
enabled = buffer_not_empty,
|
||||||
|
@ -97,9 +139,10 @@ M['percent'] = {
|
||||||
|
|
||||||
-- M['gps'] = {
|
-- M['gps'] = {
|
||||||
-- provider = function()
|
-- provider = function()
|
||||||
-- return gps.get_location()
|
-- return require('nvim-gps').get_location()
|
||||||
-- end,
|
-- end,
|
||||||
-- enabled = function()
|
-- enabled = function()
|
||||||
|
-- local gps_present, gps = pcall(require, 'nvim-gps')
|
||||||
-- if gps_present then
|
-- if gps_present then
|
||||||
-- return gps.is_available()
|
-- return gps.is_available()
|
||||||
-- else
|
-- else
|
||||||
|
@ -111,70 +154,62 @@ M['percent'] = {
|
||||||
|
|
||||||
M['codeact'] = {
|
M['codeact'] = {
|
||||||
provider = function()
|
provider = function()
|
||||||
return lightbulb.get_status_text()
|
return require('nvim-lightbulb').get_status_text()
|
||||||
end,
|
end,
|
||||||
enabled = function()
|
enabled = function()
|
||||||
|
local lightbulb_present, _ = pcall(require, 'nvim-lightbulb')
|
||||||
return lightbulb_present
|
return lightbulb_present
|
||||||
end,
|
end,
|
||||||
hl = {fg = colors.green, style = 'bold'}
|
hl = {fg = colors.green, style = 'bold'}
|
||||||
}
|
}
|
||||||
|
|
||||||
M['diagerr'] = {
|
M['diagerr'] = {
|
||||||
provider = 'diagnostic_errors',
|
provider = function()
|
||||||
|
local error, _, _, _ = lsp_diagnostic_count(0)
|
||||||
|
return error ~= 0 and tostring(error) or ''
|
||||||
|
end,
|
||||||
icon = ' ',
|
icon = ' ',
|
||||||
|
enabled = is_lsp_attached,
|
||||||
hl = {fg = colors.red},
|
hl = {fg = colors.red},
|
||||||
left_sep = ' '
|
left_sep = ' '
|
||||||
}
|
}
|
||||||
|
|
||||||
M['diagwarn'] = {
|
M['diagwarn'] = {
|
||||||
provider = 'diagnostic_warnings',
|
provider = function()
|
||||||
|
local _, warn, _, _ = lsp_diagnostic_count(0)
|
||||||
|
return warn ~= 0 and tostring(warn) or ''
|
||||||
|
end,
|
||||||
icon = ' ',
|
icon = ' ',
|
||||||
|
enabled = is_lsp_attached,
|
||||||
hl = {fg = colors.yellow},
|
hl = {fg = colors.yellow},
|
||||||
left_sep = ' '
|
left_sep = ' '
|
||||||
}
|
}
|
||||||
|
|
||||||
M['diaghint'] = {
|
M['diaghint'] = {
|
||||||
provider = 'diagnostic_hints',
|
provider = function()
|
||||||
|
local _, _, _, hint = lsp_diagnostic_count(0)
|
||||||
|
return hint ~= 0 and tostring(hint) or ''
|
||||||
|
end,
|
||||||
icon = ' ',
|
icon = ' ',
|
||||||
|
enabled = is_lsp_attached,
|
||||||
hl = {fg = colors.cyan},
|
hl = {fg = colors.cyan},
|
||||||
left_sep = ' '
|
left_sep = ' '
|
||||||
}
|
}
|
||||||
|
|
||||||
M['diaginfo'] = {
|
M['diaginfo'] = {
|
||||||
provider = 'diagnostic_info',
|
provider = function()
|
||||||
|
local _, _, info, _ = lsp_diagnostic_count(0)
|
||||||
|
return info ~= 0 and tostring(info) or ''
|
||||||
|
end,
|
||||||
icon = ' ',
|
icon = ' ',
|
||||||
|
enabled = is_lsp_attached,
|
||||||
hl = {fg = colors.blue},
|
hl = {fg = colors.blue},
|
||||||
left_sep = ' '
|
left_sep = ' '
|
||||||
}
|
}
|
||||||
|
|
||||||
M['lspclient'] = {
|
M['lspclient'] = {
|
||||||
provider = function()
|
provider = lsp_active_clients,
|
||||||
local clients = {}
|
enabled = is_lsp_attached,
|
||||||
|
|
||||||
-- Typical lsp clients
|
|
||||||
for _, client in pairs(vim.lsp.buf_get_clients(0)) do
|
|
||||||
if client.name ~= 'null-ls' then
|
|
||||||
table.insert(clients, client.name)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- null-ls sources
|
|
||||||
local null_ls_methods = require('null-ls.methods')
|
|
||||||
local active_sources = require('null-ls.info').get_active_sources()
|
|
||||||
|
|
||||||
local linter_method = null_ls_methods.internal['DIAGNOSTICS']
|
|
||||||
local active_linters = active_sources[linter_method] or {}
|
|
||||||
vim.list_extend(clients, active_linters)
|
|
||||||
|
|
||||||
local formatter_method = null_ls_methods.internal['FORMATTING']
|
|
||||||
local active_formatters = active_sources[formatter_method] or {}
|
|
||||||
vim.list_extend(clients, active_formatters)
|
|
||||||
|
|
||||||
return table.concat(clients, ', ')
|
|
||||||
end,
|
|
||||||
enabled = function()
|
|
||||||
return next(vim.lsp.buf_get_clients(0)) ~= nil
|
|
||||||
end,
|
|
||||||
icon = ' LSP:',
|
icon = ' LSP:',
|
||||||
hl = {fg = colors.purple, style = 'bold'},
|
hl = {fg = colors.purple, style = 'bold'},
|
||||||
left_sep = ' '
|
left_sep = ' '
|
||||||
|
|
|
@ -163,16 +163,7 @@ function M.bufferline()
|
||||||
max_name_length = 16,
|
max_name_length = 16,
|
||||||
max_prefix_length = 13,
|
max_prefix_length = 13,
|
||||||
tab_size = 16,
|
tab_size = 16,
|
||||||
diagnostics = false, -- 'nvim_lsp'
|
diagnostics = false,
|
||||||
-- diagnostics_update_in_insert = false,
|
|
||||||
-- diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
|
||||||
-- local s = ''
|
|
||||||
-- for e, n in pairs(diagnostics_dict) do
|
|
||||||
-- local sym = e == 'error' and 'x ' or (e == 'warning' and '! ' or (e == 'info' and 'i ' or '? '))
|
|
||||||
-- s = s .. n .. sym
|
|
||||||
-- end
|
|
||||||
-- return s
|
|
||||||
-- end,
|
|
||||||
show_close_icon = false,
|
show_close_icon = false,
|
||||||
show_buffer_icons = true,
|
show_buffer_icons = true,
|
||||||
show_tab_indicators = true,
|
show_tab_indicators = true,
|
||||||
|
@ -187,14 +178,7 @@ function M.bufferline()
|
||||||
},
|
},
|
||||||
highlights = {
|
highlights = {
|
||||||
fill = {guibg = {attribute = 'bg', highlight = 'TabLineFill'}},
|
fill = {guibg = {attribute = 'bg', highlight = 'TabLineFill'}},
|
||||||
indicator_selected = {guifg = {attribute = 'fg', highlight = 'TabLineSel'}},
|
indicator_selected = {guifg = {attribute = 'fg', highlight = 'TabLineSel'}}
|
||||||
-- diagnostic_selected = {guifg = {attribute = 'fg', highlight = 'LspDiagnosticsSignHint', gui = 'bold,italic'}},
|
|
||||||
-- info_diagnostic_selected = {guifg = {attribute = 'fg', highlight = 'LspDiagnosticsSignInformation', gui = 'bold,italic'}},
|
|
||||||
-- info_selected = {guifg = {attribute = 'fg', highlight = 'LspDiagnosticsDefaultInformation', gui = 'bold,italic'}},
|
|
||||||
-- warning_diagnostic_selected = {guifg = {attribute = 'fg', highlight = 'LspDiagnosticsSignWarning', gui = 'bold,italic'}},
|
|
||||||
-- warning_selected = {guifg = {attribute = 'fg', highlight = 'LspDiagnosticsDefaultWarning', gui = 'bold,italic'}},
|
|
||||||
-- error_diagnostic_selected = {guifg = {attribute = 'fg', highlight = 'LspDiagnosticsSignError', gui = 'bold,italic'}},
|
|
||||||
-- error_selected = {guifg = {attribute = 'fg', highlight = 'LspDiagnosticsDefaultError', gui = 'bold,italic'}}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
@ -268,11 +252,18 @@ function M.nvimtree()
|
||||||
filters = {
|
filters = {
|
||||||
dotfiles = false
|
dotfiles = false
|
||||||
},
|
},
|
||||||
|
git = {
|
||||||
|
enable = true,
|
||||||
|
ignore = false,
|
||||||
|
timeout = 500
|
||||||
|
},
|
||||||
view = {
|
view = {
|
||||||
width = 35,
|
width = 35,
|
||||||
hide_root_folder = false,
|
hide_root_folder = false,
|
||||||
side = 'left',
|
side = 'left',
|
||||||
auto_resize = false
|
auto_resize = false,
|
||||||
|
number = false,
|
||||||
|
relativenumber = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -276,29 +276,30 @@ end
|
||||||
|
|
||||||
-- LSP groups
|
-- LSP groups
|
||||||
function M.highlight_lsp()
|
function M.highlight_lsp()
|
||||||
hi('LspDiagnosticsDefaultError', c.red, '', '', '')
|
hi('DiagnosticError', c.red, '', '', '')
|
||||||
hi('LspDiagnosticsSignError', c.red, '', '', '')
|
hi('DiagnosticWarn', c.yellow, '', '', '')
|
||||||
hi('LspDiagnosticsFloatingError', c.red, '', '', '')
|
hi('DiagnosticInfo', c.blue, '', '', '')
|
||||||
hi('LspDiagnosticsVirtualTextError', c.red, '', 'italic', '')
|
hi('DiagnosticHint', c.cyan, '', '', '')
|
||||||
hi('LspDiagnosticsUnderlineError', '', '', 'undercurl', c.red)
|
|
||||||
|
|
||||||
hi('LspDiagnosticsDefaultWarning', c.yellow, '', '', '')
|
hi('DiagnisticUnderlineError', '', '', 'underline', c.red)
|
||||||
hi('LspDiagnosticsSignWarning', c.yellow, '', '', '')
|
hi('DiagnosticUnderlineWarn', '', '', 'underline', c.yellow)
|
||||||
hi('LspDiagnosticsFloatingWarning', c.yellow, '', '', '')
|
hi('DiagnosticUnderlineInfo', '', '', 'underline', c.blue)
|
||||||
hi('LspDiagnosticsVirtualTextWarning', c.yellow, '', 'italic', '')
|
hi('DiagnosticUnderlineHint', '', '', 'underline', c.cyan)
|
||||||
hi('LspDiagnosticsUnderlineWarning', '', '', 'undercurl', c.yellow)
|
|
||||||
|
|
||||||
hi('LspDiagnosticsDefaultInformation', c.blue, '', '', '')
|
hi('DiagnosticVirtualTextError', c.red, '', 'italic', '')
|
||||||
hi('LspDiagnosticsSignInformation', c.blue, '', '', '')
|
hi('DiagnosticVirtualTextWarn', c.yellow, '', 'italic', '')
|
||||||
hi('LspDiagnosticsFloatingInformation', c.blue, '', '', '')
|
hi('DiagnosticVirualTextInfo', c.blue, '', 'italic', '')
|
||||||
hi('LspDiagnosticsVirtualTextInformation', c.blue, '', 'italic', '')
|
hi('DiagnosticVirtualTextHint', c.cyan, '', 'italic', '')
|
||||||
hi('LspDiagnosticsUnderlineInformation', '', '', 'undercurl', c.blue)
|
|
||||||
|
|
||||||
hi('LspDiagnosticsDefaultHint', c.cyan, '', '', '')
|
cmd('hi! link DiagnosticFloatingError DiagnosticError')
|
||||||
hi('LspDiagnosticsSignHint', c.cyan, '', '', '')
|
cmd('hi! link DiagnosticFloatingWarn DiagnosticWarn')
|
||||||
hi('LspDiagnosticsFloatingHint', c.cyan, '', '', '')
|
cmd('hi! link DiagnosticFloatingInfo DiagnosticInfo')
|
||||||
hi('LspDiagnosticsVirtualTextHint', c.cyan, '', 'italic', '')
|
cmd('hi! link DiagnosticFloatingHint DiagnosticHint')
|
||||||
hi('LspDiagnosticsUnderlineHint', '', '', 'undercurl', c.cyan)
|
|
||||||
|
cmd('hi! link DiagnosticSignError DiagnosticError')
|
||||||
|
cmd('hi! link DiagnosticSignWarn DiagnosticWarn')
|
||||||
|
cmd('hi! link DiagnosticSignInfo DiagnosticInfo')
|
||||||
|
cmd('hi! link DiagnosticSignHint DiagnosticHint')
|
||||||
|
|
||||||
hi('LspReferenceText', c.fg, c.grey_bright, '', '')
|
hi('LspReferenceText', c.fg, c.grey_bright, '', '')
|
||||||
hi('LspReferenceRead', c.fg, c.grey_bright, '', '')
|
hi('LspReferenceRead', c.fg, c.grey_bright, '', '')
|
||||||
|
@ -312,7 +313,7 @@ function M.highlight_plugins()
|
||||||
hi('CmpItemAbbr', c.fg, '', '', '')
|
hi('CmpItemAbbr', c.fg, '', '', '')
|
||||||
hi('CmpItemAbbrMatch', c.yellow, '', '', '')
|
hi('CmpItemAbbrMatch', c.yellow, '', '', '')
|
||||||
hi('CmpItemAbbrMatchFuzzy', c.yellow, '', '', '')
|
hi('CmpItemAbbrMatchFuzzy', c.yellow, '', '', '')
|
||||||
hi('CmpItemKind', c.green, '', '', '')
|
hi('CmpItemKindDefault', c.green, '', '', '')
|
||||||
hi('CmpItemMenu', c.blue, '', '', '')
|
hi('CmpItemMenu', c.blue, '', '', '')
|
||||||
|
|
||||||
-- LuaSnip
|
-- LuaSnip
|
||||||
|
@ -447,17 +448,15 @@ function M.highlight_plugins()
|
||||||
hi('ProviderTruncateLine', c.black, '', '', '')
|
hi('ProviderTruncateLine', c.black, '', '', '')
|
||||||
hi('SagaShadow', '', c.black, '', '')
|
hi('SagaShadow', '', c.black, '', '')
|
||||||
hi('DiagnosticTruncateLine', c.blue, '', 'bold', '')
|
hi('DiagnosticTruncateLine', c.blue, '', 'bold', '')
|
||||||
cmd('hi! link DiagnosticError LspDiagnosticsDefaultError')
|
cmd('hi! link DiagnosticWarning DiagnosticWarn')
|
||||||
cmd('hi! link DiagnosticWarning LspDiagnosticsDefaultWarning')
|
cmd('hi! link DiagnosticInformation DiagnosticInfo')
|
||||||
cmd('hi! link DiagnosticInformation LspDiagnosticsDefaultInformation')
|
|
||||||
cmd('hi! link DiagnosticHint LspDiagnosticsDefaultHint')
|
|
||||||
hi('LspSagaDiagnosticBorder', c.fg, '', '', '')
|
hi('LspSagaDiagnosticBorder', c.fg, '', '', '')
|
||||||
hi('LspSagaDiagnosticHeader', c.blue, '', 'bold', '')
|
hi('LspSagaDiagnosticHeader', c.blue, '', 'bold', '')
|
||||||
hi('LspSagaDiagnosticTruncateLine', c.fg, '', '', '')
|
hi('LspSagaDiagnosticTruncateLine', c.fg, '', '', '')
|
||||||
cmd('hi! link LspSagaDiagnosticFloatingError LspDiagnosticsDefaultError')
|
cmd('hi! link LspSagaDiagnosticFloatingError DiagnosticError')
|
||||||
cmd('hi! link LspSagaDiagnosticFloatingWarn LspDiagnosticsDefaultWarning')
|
cmd('hi! link LspSagaDiagnosticFloatingWarn DiagnosticWarn')
|
||||||
cmd('hi! link LspSagaDiagnosticFloatingInfor LspDiagnosticsDefaultInformation')
|
cmd('hi! link LspSagaDiagnosticFloatingInfor DiagnosticInfo')
|
||||||
cmd('hi! link LspSagaDiagnosticFloatingHint LspDiagnosticsDefaultHint')
|
cmd('hi! link LspSagaDiagnosticFloatingHint DiagnosticHint')
|
||||||
hi('LspSagaShTruncateLine', c.black, '', '', '')
|
hi('LspSagaShTruncateLine', c.black, '', '', '')
|
||||||
hi('LspSagaDocTruncateLine', c.black, '', '', '')
|
hi('LspSagaDocTruncateLine', c.black, '', '', '')
|
||||||
hi('LspSagaCodeActionTitle', c.orange, '', 'bold', '')
|
hi('LspSagaCodeActionTitle', c.orange, '', 'bold', '')
|
||||||
|
@ -471,7 +470,6 @@ function M.highlight_plugins()
|
||||||
hi('LspSagaCodeActionBorder', c.teal, '', '', '')
|
hi('LspSagaCodeActionBorder', c.teal, '', '', '')
|
||||||
hi('LspSagaAutoPreview', c.yellow, '', '', '')
|
hi('LspSagaAutoPreview', c.yellow, '', '', '')
|
||||||
hi('LspSagaDefPreviewBorder', c.teal, '', '', '')
|
hi('LspSagaDefPreviewBorder', c.teal, '', '', '')
|
||||||
-- hi('LspSagaLightBulb', c.green, '', '', '')
|
|
||||||
|
|
||||||
-- Telescope
|
-- Telescope
|
||||||
hi('TelescopePromptBorder', c.cyan, '', 'bold', '')
|
hi('TelescopePromptBorder', c.cyan, '', 'bold', '')
|
||||||
|
|
|
@ -1,36 +1,37 @@
|
||||||
local opt = vim.opt
|
local g, opt = vim.g, vim.opt
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
function M.disable_default_plugins()
|
function M.disable_default_plugins()
|
||||||
vim.g.loaded_gzip = 1
|
g.loaded_gzip = 1
|
||||||
vim.g.loaded_tar = 1
|
g.loaded_tar = 1
|
||||||
vim.g.loaded_tarPlugin = 1
|
g.loaded_tarPlugin = 1
|
||||||
vim.g.loaded_zip = 1
|
g.loaded_zip = 1
|
||||||
vim.g.loaded_zipPlugin = 1
|
g.loaded_zipPlugin = 1
|
||||||
vim.g.loaded_getscript = 1
|
g.loaded_getscript = 1
|
||||||
vim.g.loaded_getscriptPlugin = 1
|
g.loaded_getscriptPlugin = 1
|
||||||
vim.g.loaded_vimball = 1
|
g.loaded_vimball = 1
|
||||||
vim.g.loaded_vimballPlugin = 1
|
g.loaded_vimballPlugin = 1
|
||||||
vim.g.loaded_matchit = 1
|
g.loaded_matchit = 1
|
||||||
vim.g.loaded_matchparen = 1
|
g.loaded_matchparen = 1
|
||||||
vim.g.loaded_2html_plugin = 1
|
g.loaded_2html_plugin = 1
|
||||||
vim.g.loaded_logiPat = 1
|
g.loaded_logiPat = 1
|
||||||
vim.g.loaded_rrhelper = 1
|
g.loaded_rrhelper = 1
|
||||||
vim.g.loaded_netrw = 1
|
g.loaded_netrw = 1
|
||||||
vim.g.loaded_netrwPlugin = 1
|
g.loaded_netrwPlugin = 1
|
||||||
vim.g.loaded_netrwSettings = 1
|
g.loaded_netrwSettings = 1
|
||||||
vim.g.loaded_netrwFileHandlers = 1
|
g.loaded_netrwFileHandlers = 1
|
||||||
vim.g.did_load_filetypes = 1 -- use filetype.nvim instead
|
g.did_load_filetypes = 1 -- use filetype.nvim instead
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.load_options()
|
function M.load_options()
|
||||||
-- This is the same as `:colorscheme nord/onedark`
|
-- Set colorscheme
|
||||||
vim.g.colors_name = '{{ theme }}'
|
vim.api.nvim_command('colorscheme {{ theme }}')
|
||||||
-- Leader key
|
|
||||||
vim.g.mapleader = ' '
|
-- Leader keys
|
||||||
vim.g.maplocalleader = ','
|
g.mapleader = ' '
|
||||||
|
g.maplocalleader = ','
|
||||||
-- Python path
|
-- Python path
|
||||||
vim.g.python3_host_prog = '/usr/bin/python3'
|
g.python3_host_prog = '/usr/bin/python3'
|
||||||
|
|
||||||
-- General settings
|
-- General settings
|
||||||
opt.termguicolors = true
|
opt.termguicolors = true
|
||||||
|
@ -59,10 +60,12 @@ function M.load_options()
|
||||||
-- opt.ruler = true
|
-- opt.ruler = true
|
||||||
-- opt.display = 'lastline'
|
-- opt.display = 'lastline'
|
||||||
-- opt.colorcolumn = '80'
|
-- opt.colorcolumn = '80'
|
||||||
-- opt.cursorline = true
|
-- opt.cursorcolumn = true
|
||||||
|
opt.cursorline = true
|
||||||
|
opt.cursorlineopt = 'number'
|
||||||
-- opt.backspace = 'indent,eol,start'
|
-- opt.backspace = 'indent,eol,start'
|
||||||
opt.showcmd = false
|
opt.showcmd = false
|
||||||
opt.inccommand = 'nosplit'
|
-- opt.inccommand = 'nosplit'
|
||||||
-- opt.cmdheight = 2
|
-- opt.cmdheight = 2
|
||||||
-- opt.cmdwinheight = 6
|
-- opt.cmdwinheight = 6
|
||||||
opt.showtabline = 2
|
opt.showtabline = 2
|
||||||
|
@ -93,7 +96,7 @@ function M.load_options()
|
||||||
|
|
||||||
-- Searching
|
-- Searching
|
||||||
-- opt.incsearch = true
|
-- opt.incsearch = true
|
||||||
opt.hlsearch = false
|
opt.hlsearch = true
|
||||||
-- opt.wrapscan = true
|
-- opt.wrapscan = true
|
||||||
|
|
||||||
-- Update time
|
-- Update time
|
||||||
|
@ -142,7 +145,6 @@ function M.load_options()
|
||||||
opt.smartindent = true
|
opt.smartindent = true
|
||||||
-- opt.autoindent = true
|
-- opt.autoindent = true
|
||||||
opt.shiftround = true
|
opt.shiftround = true
|
||||||
opt.breakindent = true
|
|
||||||
|
|
||||||
-- Trailings, line break
|
-- Trailings, line break
|
||||||
opt.list = true
|
opt.list = true
|
||||||
|
@ -150,6 +152,7 @@ function M.load_options()
|
||||||
opt.showbreak = '↳ '
|
opt.showbreak = '↳ '
|
||||||
-- opt.linebreak = true
|
-- opt.linebreak = true
|
||||||
-- opt.breakat = [[\ \ ;:,!?]]
|
-- opt.breakat = [[\ \ ;:,!?]]
|
||||||
|
opt.breakindent = true
|
||||||
-- opt.breakindentopt = 'shift:4,min:20'
|
-- opt.breakindentopt = 'shift:4,min:20'
|
||||||
|
|
||||||
-- Undo file path
|
-- Undo file path
|
||||||
|
|
Loading…
Reference in a new issue