fix: remove useless pcall
This commit is contained in:
@@ -10,7 +10,8 @@
|
||||
* [ewis6991/gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim)
|
||||
* [lewis6991/impatient.nvim](https://github.com/lewis6991/impatient.nvim)
|
||||
* [williamboman/nvim-lsp-installer](https://github.com/williamboman/nvim-lsp-installer)
|
||||
* [rcarriga/nvim-notify](https://github.com/rcarriga/nvim-notify)
|
||||
* [nvim-lualine/lualine.nvim](https://github.com/nvim-lualine/lualine.nvim)
|
||||
*
|
||||
* [kyazdani42/nvim-tree.lua](https://github.com/kyazdani42/nvim-tree.lua)
|
||||
* [nvim-telescope/telescope.nvim](https://github.com/nvim-telescope/telescope.nvim)
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
local present, autopairs = pcall(require, "nvim-autopairs")
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
local autopairs = require('nvim-autopairs')
|
||||
|
||||
autopairs.setup({
|
||||
fast_wrap = {},
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
local present, escape = pcall(require, 'better_escape')
|
||||
if not present then
|
||||
print "no escape"
|
||||
return
|
||||
end
|
||||
local escape = require('better_escape')
|
||||
|
||||
escape.setup({
|
||||
mapping = { 'jk' },
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
local present, bufferline = pcall(require, 'bufferline')
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
local bufferline = require('bufferline')
|
||||
|
||||
local opts = {
|
||||
noremap = true,
|
||||
|
||||
@@ -1,19 +1,8 @@
|
||||
local present_cmp, cmp = pcall(require, 'cmp')
|
||||
if not present_cmp then
|
||||
print 'no cmp'
|
||||
return
|
||||
end
|
||||
local cmp = require('cmp')
|
||||
|
||||
local present_lua, luasnip = pcall(require, 'luasnip')
|
||||
if not present_lua then
|
||||
print 'no luasnip'
|
||||
return
|
||||
end
|
||||
local luasnip = require('luasnip')
|
||||
|
||||
local present_auto_pair, cmp_autopairs = pcall(require, 'nvim-autopairs.completion.cmp')
|
||||
if not present_auto_pair then
|
||||
return
|
||||
end
|
||||
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
|
||||
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
local present, comment = pcall(require, 'Comment')
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
local comment = require('Comment')
|
||||
|
||||
comment.setup()
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
local present, gitsigns = pcall(require, "gitsigns")
|
||||
if not present then
|
||||
print "no gitsigns"
|
||||
return
|
||||
end
|
||||
local gitsigns = require('gitsigns')
|
||||
|
||||
gitsigns.setup()
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
local present, lsp_installer = pcall(require, 'nvim-lsp-installer')
|
||||
if not present then
|
||||
print 'no lsp installer'
|
||||
return
|
||||
end
|
||||
local lsp_installer = require('nvim-lsp-installer')
|
||||
|
||||
-- Use an on_attach function to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
local present, null_ls = pcall(require, 'null-ls')
|
||||
if not present then
|
||||
vim.notify('no null-ls')
|
||||
return
|
||||
end
|
||||
local null_ls = require('null-ls')
|
||||
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
local present, nvimtree = pcall(require, "nvim-tree")
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
local nvimtree = require("nvim-tree")
|
||||
|
||||
vim.g.nvim_tree_group_empty = 1
|
||||
|
||||
|
||||
@@ -26,6 +26,11 @@ return packer.startup(function(use)
|
||||
-- My plugins here
|
||||
use 'wbthomason/packer.nvim'
|
||||
use 'lewis6991/impatient.nvim'
|
||||
use { 'nvim-treesitter/nvim-treesitter',
|
||||
config = function()
|
||||
require('configs.plugins.treesitter')
|
||||
end
|
||||
}
|
||||
use {
|
||||
'windwp/nvim-autopairs', -- Can't lazyloaded because cmp-related
|
||||
config = function()
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
require('nvim-treesitter.configs').setup({
|
||||
ensure_installed = { 'c', 'cpp', 'go', 'java', 'json', 'lua', 'python' },
|
||||
highlight = {
|
||||
enable = true,
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user