vim: make sure not to blow up on nil opts
This commit is contained in:
parent
a15e582567
commit
36ceb2c15c
9 changed files with 11 additions and 11 deletions
|
@ -33,7 +33,7 @@ M.keys = {
|
||||||
{ 'g<c-x>', dial_cmd('dec_gvisual', 'gv'), expr = true, desc = ' Decrement', mode = 'v' },
|
{ 'g<c-x>', dial_cmd('dec_gvisual', 'gv'), expr = true, desc = ' Decrement', mode = 'v' },
|
||||||
}
|
}
|
||||||
|
|
||||||
M.config = function()
|
M.config = function( --[[plugin]] _, --[[opts]] _)
|
||||||
local augend = require('dial.augend')
|
local augend = require('dial.augend')
|
||||||
require('dial.config').augends:register_group {
|
require('dial.config').augends:register_group {
|
||||||
default = {
|
default = {
|
||||||
|
|
|
@ -27,7 +27,7 @@ M.keys = {
|
||||||
}
|
}
|
||||||
|
|
||||||
M.opts = function(--[[plugin]]_, opts)
|
M.opts = function(--[[plugin]]_, opts)
|
||||||
return vim.tbl_deep_extend('force', opts, {
|
return vim.tbl_deep_extend('force', opts or {}, {
|
||||||
mappings = nil, -- I'm defining my own mappings above.
|
mappings = nil, -- I'm defining my own mappings above.
|
||||||
callbacks = {
|
callbacks = {
|
||||||
['git.schauenburg.me'] = require('gitlinker.hosts').get_gitea_type_url,
|
['git.schauenburg.me'] = require('gitlinker.hosts').get_gitea_type_url,
|
||||||
|
|
|
@ -20,7 +20,7 @@ M.main = 'ibl'
|
||||||
|
|
||||||
M.opts = function(--[[plugin]]_, opts)
|
M.opts = function(--[[plugin]]_, opts)
|
||||||
local icons = require('fschauen.util.icons')
|
local icons = require('fschauen.util.icons')
|
||||||
return vim.tbl_deep_extend('force', opts, {
|
return vim.tbl_deep_extend('force', opts or {}, {
|
||||||
enabled = false,
|
enabled = false,
|
||||||
indent = {
|
indent = {
|
||||||
char = icons.ui.LineLeft,
|
char = icons.ui.LineLeft,
|
||||||
|
|
|
@ -10,7 +10,7 @@ M.keys = {
|
||||||
|
|
||||||
M.opts = function(--[[plugin]]_, opts)
|
M.opts = function(--[[plugin]]_, opts)
|
||||||
local icons = require('fschauen.util.icons')
|
local icons = require('fschauen.util.icons')
|
||||||
return vim.tbl_deep_extend('force', opts, {
|
return vim.tbl_deep_extend('force', opts or {}, {
|
||||||
disable_hint = true,
|
disable_hint = true,
|
||||||
signs = {
|
signs = {
|
||||||
section = { icons.ui.Folder, icons.ui.EmptyFolderOpen },
|
section = { icons.ui.Folder, icons.ui.EmptyFolderOpen },
|
||||||
|
|
|
@ -25,7 +25,7 @@ M.lazy = false
|
||||||
|
|
||||||
M.opts = function(--[[plugin]]_, opts)
|
M.opts = function(--[[plugin]]_, opts)
|
||||||
local icons = require('fschauen.util.icons')
|
local icons = require('fschauen.util.icons')
|
||||||
return vim.tbl_deep_extend('force', opts, {
|
return vim.tbl_deep_extend('force', opts or {}, {
|
||||||
icons = {
|
icons = {
|
||||||
ERROR = icons.diagnostics_bold.Error,
|
ERROR = icons.diagnostics_bold.Error,
|
||||||
WARN = icons.diagnostics_bold.Warn,
|
WARN = icons.diagnostics_bold.Warn,
|
||||||
|
|
|
@ -11,7 +11,7 @@ M.keys = {
|
||||||
|
|
||||||
M.opts = function(--[[plugin]]_, opts)
|
M.opts = function(--[[plugin]]_, opts)
|
||||||
local icons = require('fschauen.util.icons')
|
local icons = require('fschauen.util.icons')
|
||||||
return vim.tbl_deep_extend('force', opts, {
|
return vim.tbl_deep_extend('force', opts or {}, {
|
||||||
disable_netrw = true, -- replace netrw with nvim-tree
|
disable_netrw = true, -- replace netrw with nvim-tree
|
||||||
hijack_cursor = true, -- keep the cursor on begin of the filename
|
hijack_cursor = true, -- keep the cursor on begin of the filename
|
||||||
sync_root_with_cwd = true, -- watch for `DirChanged` and refresh the tree
|
sync_root_with_cwd = true, -- watch for `DirChanged` and refresh the tree
|
||||||
|
|
|
@ -126,7 +126,7 @@ M.opts = function(--[[plugin]]_, opts)
|
||||||
['<c-b>'] = trouble.smart_open_with_trouble,
|
['<c-b>'] = trouble.smart_open_with_trouble,
|
||||||
}
|
}
|
||||||
|
|
||||||
return vim.tbl_deep_extend('force', opts, {
|
return vim.tbl_deep_extend('force', opts or {}, {
|
||||||
defaults = {
|
defaults = {
|
||||||
mappings = { i = mappings, n = mappings },
|
mappings = { i = mappings, n = mappings },
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ M.keys = {
|
||||||
|
|
||||||
M.opts = function(--[[plugin]]_, opts)
|
M.opts = function(--[[plugin]]_, opts)
|
||||||
local icons = require('fschauen.util.icons')
|
local icons = require('fschauen.util.icons')
|
||||||
return vim.tbl_deep_extend('force', opts, {
|
return vim.tbl_deep_extend('force', opts or {}, {
|
||||||
keywords = {
|
keywords = {
|
||||||
TODO = { icon = icons.ui.Checkbox },
|
TODO = { icon = icons.ui.Checkbox },
|
||||||
FIX = { icon = icons.ui.Bug },
|
FIX = { icon = icons.ui.Bug },
|
||||||
|
|
|
@ -16,10 +16,10 @@ M.keys = {
|
||||||
{ '<leader>sc', toggle_colorcolumn, desc = toggle .. 'virtual colunn' },
|
{ '<leader>sc', toggle_colorcolumn, desc = toggle .. 'virtual colunn' },
|
||||||
}
|
}
|
||||||
|
|
||||||
M.config = function(--[[plugin]]_, --[[opts]]_)
|
M.opts = function(--[[plugin]]_, opts)
|
||||||
require('virt-column').setup {
|
return vim.tbl_deep_extend('force', opts or {}, {
|
||||||
char = require('fschauen.util.icons').ui.LineMiddle,
|
char = require('fschauen.util.icons').ui.LineMiddle,
|
||||||
}
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
Loading…
Add table
Reference in a new issue