diff --git a/nvim/.config/nvim/after/plugin/colours.lua b/nvim/.config/nvim/after/plugin/colours.lua index 07538d8..1a53409 100644 --- a/nvim/.config/nvim/after/plugin/colours.lua +++ b/nvim/.config/nvim/after/plugin/colours.lua @@ -1,3 +1,13 @@ -require("colorbuddy").colorscheme("gruvbuddy") +local colorbuddy_status_ok, colorbuddy = pcall(require, "colorbuddy") +if not colorbuddy_status_ok then + return +end -require'colorizer'.setup() +local colorizer_status_ok, colorizer = pcall(require, "colorizer") +if not colorizer_status_ok then + return +end + +colorbuddy.colorscheme("gruvbuddy") + +colorizer.setup() diff --git a/nvim/.config/nvim/after/plugin/comment.lua b/nvim/.config/nvim/after/plugin/comment.lua index 35bbc9b..829e55a 100644 --- a/nvim/.config/nvim/after/plugin/comment.lua +++ b/nvim/.config/nvim/after/plugin/comment.lua @@ -1,4 +1,9 @@ -require 'Comment'.setup { +local status_ok, comment = pcall(require, "Comment") +if not status_ok then + return +end + +comment.setup { padding = true, opleader = { diff --git a/nvim/.config/nvim/after/plugin/completion.lua b/nvim/.config/nvim/after/plugin/completion.lua index 537169c..b3e5d75 100644 --- a/nvim/.config/nvim/after/plugin/completion.lua +++ b/nvim/.config/nvim/after/plugin/completion.lua @@ -1,4 +1,14 @@ -local cmp = require "cmp" +local cmp_status_ok, cmp = pcall(require, "cmp") +if not cmp_status_ok then + return +end + +local snip_status_ok, luasnip = pcall(require, "luasnip") +if not snip_status_ok then + return +end + +require("luasnip/loaders/from_vscode").lazy_load() cmp.setup { snippet = { diff --git a/nvim/.config/nvim/after/plugin/gitsigns.lua b/nvim/.config/nvim/after/plugin/gitsigns.lua index faa948b..3cd84a2 100644 --- a/nvim/.config/nvim/after/plugin/gitsigns.lua +++ b/nvim/.config/nvim/after/plugin/gitsigns.lua @@ -1,4 +1,12 @@ -require "colorbuddy" +local colorbuddy_status_ok, colorbuddy = pcall(require, "colorbuddy") +if not colorbuddy_status_ok then + return +end + +local gitsigns_status_ok, gitsigns = pcall(require, "gitsigns") +if not gitsigns_status_ok then + return +end local c = require("colorbuddy.color").colors local Group = require("colorbuddy.group").Group @@ -7,7 +15,7 @@ Group.new("GitSignsAdd", c.green) Group.new("GitSignsChange", c.yellow) Group.new("GitSignsDelete", c.red) -require 'gitsigns'.setup { +gitsigns.setup { linehl = false, numhl = true, diff --git a/nvim/.config/nvim/after/plugin/indent-blankline.lua b/nvim/.config/nvim/after/plugin/indent-blankline.lua index 010c56a..d48f115 100644 --- a/nvim/.config/nvim/after/plugin/indent-blankline.lua +++ b/nvim/.config/nvim/after/plugin/indent-blankline.lua @@ -1,3 +1,8 @@ +local status_ok, indent_blankline = pcall(require, "indent_blankline") +if not status_ok then + return +end + vim.opt.list = true vim.opt.listchars = { eol = "↴", @@ -5,7 +10,7 @@ vim.opt.listchars = { vim.cmd [[highlight IndentBlanklineIndent1 guifg=#555555 gui=nocombine]] -require "indent_blankline".setup { +indent_blankline.setup { char_highlight_list = { "IndentBlanklineIndent1", }, diff --git a/nvim/.config/nvim/after/plugin/lspconfig.lua b/nvim/.config/nvim/after/plugin/lspconfig.lua index f588269..447108e 100644 --- a/nvim/.config/nvim/after/plugin/lspconfig.lua +++ b/nvim/.config/nvim/after/plugin/lspconfig.lua @@ -1,4 +1,7 @@ ---local has_lsp, lspconfig = pcall(require, "lspconfig") +local status_ok, lspconfig = pcall(require, "lspconfig") +if not status_ok then + return +end local function config(_config) return vim.tbl_deep_extend("force", { @@ -6,23 +9,23 @@ local function config(_config) }, _config or {}) end -require'lspconfig'.ansiblels.setup(config()) +lspconfig.ansiblels.setup(config()) -require'lspconfig'.bashls.setup(config()) +lspconfig.bashls.setup(config()) -require'lspconfig'.cssls.setup(config()) +lspconfig.cssls.setup(config()) -require'lspconfig'.html.setup(config()) +lspconfig.html.setup(config()) -require'lspconfig'.intelephense.setup(config({ +lspconfig.intelephense.setup(config({ filetypes = { "php", "test", "theme" } })) -require'lspconfig'.tsserver.setup(config()) +lspconfig.tsserver.setup(config()) -require'lspconfig'.vuels.setup(config()) +lspconfig.vuels.setup(config()) -require'lspconfig'.yamlls.setup(config()) +lspconfig.yamlls.setup(config()) vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( vim.lsp.diagnostic.on_publish_diagnostics, { diff --git a/nvim/.config/nvim/after/plugin/telescope.lua b/nvim/.config/nvim/after/plugin/telescope.lua index 6f5f447..a7c654f 100644 --- a/nvim/.config/nvim/after/plugin/telescope.lua +++ b/nvim/.config/nvim/after/plugin/telescope.lua @@ -1,3 +1,8 @@ +local status_ok, telescope = pcall(require, "telescope") +if not status_ok then + return +end + local previewers = require('telescope.previewers') local Job = require('plenary.job') @@ -21,15 +26,15 @@ local new_maker = function(filepath, bufnr, opts) }):sync() end -require "telescope".setup{ +telescope.setup{ defaults = { buffer_previewer_maker = new_maker, prompt_prefix = "$ " } } -require "telescope".load_extension("fzf") +telescope.load_extension("fzf") local map = vim.api.nvim_set_keymap local options = { diff --git a/nvim/.config/nvim/after/plugin/treesitter.lua b/nvim/.config/nvim/after/plugin/treesitter.lua index a905e48..d66bccb 100644 --- a/nvim/.config/nvim/after/plugin/treesitter.lua +++ b/nvim/.config/nvim/after/plugin/treesitter.lua @@ -1,4 +1,9 @@ -require "nvim-treesitter.configs".setup { +local status_ok, configs = pcall(require, "nvim-treesitter.configs") +if not status_ok then + return +end + +configs.setup { context_commenting = { enable = true }, diff --git a/nvim/.config/nvim/lua/opdavies/packer.lua b/nvim/.config/nvim/lua/opdavies/packer.lua index 05920bf..e04aabc 100644 --- a/nvim/.config/nvim/lua/opdavies/packer.lua +++ b/nvim/.config/nvim/lua/opdavies/packer.lua @@ -1,4 +1,7 @@ -local packer = require('packer') +local status_ok, packer = pcall(require, "packer") +if not status_ok then + return +end packer.init { display = {