nvim: some nicer code
This commit is contained in:
parent
d65834fbc1
commit
23c1be3e16
2 changed files with 21 additions and 14 deletions
|
@ -1,4 +1,7 @@
|
||||||
local ensure_packer = function()
|
local packer_init = {}
|
||||||
|
|
||||||
|
packer_init.init = function(plugins)
|
||||||
|
local ensure_packer = function()
|
||||||
local install_path = vim.fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
|
local install_path = vim.fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
|
||||||
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
|
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
|
||||||
vim.fn.system {'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}
|
vim.fn.system {'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}
|
||||||
|
@ -6,12 +9,15 @@ local ensure_packer = function()
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
local packer_bootstrap = ensure_packer()
|
local packer_bootstrap = ensure_packer()
|
||||||
require('packer').startup(plugins)
|
require('packer').startup(plugins)
|
||||||
if packer_bootstrap then
|
if packer_bootstrap then
|
||||||
require('packer').sync()
|
require('packer').sync()
|
||||||
return true
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
return false
|
|
||||||
|
return packer_init
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
-- [[ plugins list ]]
|
-- [[ plugins list ]]
|
||||||
plugins = function(use)
|
local plugins = function(use)
|
||||||
use 'wbthomason/packer.nvim'
|
use 'wbthomason/packer.nvim'
|
||||||
|
|
||||||
use 'lifepillar/vim-gruvbox8'
|
use 'lifepillar/vim-gruvbox8'
|
||||||
use 'hoob3rt/lualine.nvim'
|
use 'hoob3rt/lualine.nvim'
|
||||||
|
use 'hashivim/vim-terraform'
|
||||||
use 'mhinz/vim-signify'
|
use 'mhinz/vim-signify'
|
||||||
use 'tpope/vim-fugitive'
|
use 'tpope/vim-fugitive'
|
||||||
use 'tpope/vim-rsi'
|
use 'tpope/vim-rsi'
|
||||||
|
@ -18,7 +19,7 @@ plugins = function(use)
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[ init packer if missing ]]
|
--[[ init packer if missing ]]
|
||||||
if require('packer_init') then return end
|
if require('packer_init').init(plugins) then return end
|
||||||
|
|
||||||
--[[ plugins config ]]
|
--[[ plugins config ]]
|
||||||
require('lualine').setup()
|
require('lualine').setup()
|
||||||
|
|
Loading…
Reference in a new issue