From 6780175e42bb2ec1fc2f3a4f62503b5768ac7f5d Mon Sep 17 00:00:00 2001 From: amtoine Date: Sat, 1 Apr 2023 12:26:15 +0200 Subject: [PATCH] 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. --- init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index bbfe511e..e8d69fe2 100644 --- a/init.lua +++ b/init.lua @@ -230,7 +230,7 @@ vim.o.completeopt = 'menuone,noselect' -- NOTE: You should make sure your terminal supports this vim.o.termguicolors = true -require('custom/options') +pcall(require, 'custom/options') -- [[ Basic Keymaps ]] @@ -242,7 +242,7 @@ vim.keymap.set({ 'n', 'v' }, '', '', { 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 }) -require('custom/keybindings') +pcall(require, 'custom/keybindings') -- [[ 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` -- vim: ts=2 sts=2 sw=2 et -require('custom/commands') +pcall(require, 'custom/commands')