protect the calls to `require` with `pcall`

This is to make sure `nvim` can start even if the files are not
defined by the user.
This commit is contained in:
amtoine 2023-04-01 12:26:15 +02:00
parent cbe80a2bf4
commit 6780175e42
No known key found for this signature in database
GPG Key ID: 37AAE9B486CFF1AB
1 changed files with 3 additions and 3 deletions

View File

@ -230,7 +230,7 @@ vim.o.completeopt = 'menuone,noselect'
-- NOTE: You should make sure your terminal supports this -- NOTE: You should make sure your terminal supports this
vim.o.termguicolors = true vim.o.termguicolors = true
require('custom/options') pcall(require, 'custom/options')
-- [[ Basic Keymaps ]] -- [[ Basic Keymaps ]]
@ -242,7 +242,7 @@ vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
require('custom/keybindings') pcall(require, 'custom/keybindings')
-- [[ Highlight on yank ]] -- [[ Highlight on yank ]]
-- See `:help vim.highlight.on_yank()` -- See `:help vim.highlight.on_yank()`
@ -500,4 +500,4 @@ cmp.setup {
-- The line beneath this is called `modeline`. See `:help modeline` -- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et -- vim: ts=2 sts=2 sw=2 et
require('custom/commands') pcall(require, 'custom/commands')