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:
		
							parent
							
								
									cbe80a2bf4
								
							
						
					
					
						commit
						6780175e42
					
				
							
								
								
									
										6
									
								
								init.lua
								
								
								
								
							
							
						
						
									
										6
									
								
								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' }, '<Space>', '<Nop>', { 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')
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue