mirror of
https://git.korhonen.cc/FunctionalHacker/dotfiles.git
synced 2024-11-18 21:27:42 +00:00
Refactor nvim packer configuration
This commit is contained in:
parent
9ef1115fa2
commit
8643dd3b6b
@ -1,16 +1,5 @@
|
|||||||
require 'pluginmanager'
|
require 'plugins/init'
|
||||||
require 'autocmd'
|
require 'autocmd'
|
||||||
require 'keybinds'
|
require 'keybinds'
|
||||||
require 'settings'
|
require 'settings'
|
||||||
require 'common'
|
require 'common'
|
||||||
|
|
||||||
-- Plugin configurations
|
|
||||||
require 'pluginconf.lualine'
|
|
||||||
require 'pluginconf.bufferline'
|
|
||||||
require 'pluginconf.lsp'
|
|
||||||
require 'pluginconf.completion'
|
|
||||||
require 'pluginconf.treesitter'
|
|
||||||
require 'pluginconf.indent-blankline'
|
|
||||||
require 'pluginconf.nvim-tree'
|
|
||||||
require 'pluginconf.colorscheme'
|
|
||||||
require 'pluginconf.telescope'
|
|
||||||
|
@ -1,20 +1,22 @@
|
|||||||
local fn = vim.fn
|
local fn = vim.fn
|
||||||
local cmd = vim.cmd
|
|
||||||
|
|
||||||
-- Install packer if it's not yet installed
|
-- Install packer if it's not yet installed
|
||||||
local install_path = fn.stdpath('data') .. '/site/pack/packer/opt/packer.nvim'
|
local install_path = fn.stdpath('data') .. '/site/pack/packer/opt/packer.nvim'
|
||||||
local packer_not_installed = fn.empty(fn.glob(install_path))
|
if fn.empty(fn.glob(install_path)) > 0 then
|
||||||
|
print('installing packer')
|
||||||
if packer_not_installed > 0 then
|
Packer_bootstrap = fn.system({
|
||||||
print('Packer is not installed, cloning it now...')
|
'git', 'clone', '--depth', '1',
|
||||||
cmd('silent !git clone https://github.com/wbthomason/packer.nvim ' ..
|
'https://github.com/wbthomason/packer.nvim', install_path
|
||||||
install_path)
|
})
|
||||||
|
vim.o.runtimepath = vim.fn.stdpath('data') .. '/site/pack/*/start/*,' ..
|
||||||
|
vim.o.runtimepath
|
||||||
|
print('installed packer')
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Configure packer
|
-- Configure packer
|
||||||
cmd 'packadd packer.nvim'
|
vim.cmd [[packadd packer.nvim]]
|
||||||
local use = require('packer').use
|
|
||||||
require('packer').startup(function()
|
require('packer').startup(function()
|
||||||
|
local use = require('packer').use
|
||||||
|
|
||||||
-- The plugin manager itself
|
-- The plugin manager itself
|
||||||
use {'wbthomason/packer.nvim', opt=true}
|
use {'wbthomason/packer.nvim', opt=true}
|
||||||
@ -120,7 +122,22 @@ require('packer').startup(function()
|
|||||||
-- Vim <3 Asciidoctor
|
-- Vim <3 Asciidoctor
|
||||||
use 'habamax/vim-asciidoctor'
|
use 'habamax/vim-asciidoctor'
|
||||||
|
|
||||||
|
-- Sync plugins if Packer was just
|
||||||
|
-- installed
|
||||||
|
if Packer_bootstrap then
|
||||||
|
print('syncing')
|
||||||
|
require('packer').sync()
|
||||||
|
print('synced')
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Install plugins if packer was not installed
|
-- Source configurations
|
||||||
if packer_not_installed > 0 then cmd 'PackerInstall' end
|
require 'plugins/lualine'
|
||||||
|
require 'plugins/bufferline'
|
||||||
|
require 'plugins/lsp'
|
||||||
|
require 'plugins/completion'
|
||||||
|
require 'plugins/treesitter'
|
||||||
|
require 'plugins/indent-blankline'
|
||||||
|
require 'plugins/nvim-tree'
|
||||||
|
require 'plugins/colorscheme'
|
||||||
|
require 'plugins/telescope'
|
@ -1,5 +1,6 @@
|
|||||||
local M = {}
|
local M = {}
|
||||||
local lspconfig = require('lspconfig');
|
local lspconfig = require('lspconfig');
|
||||||
|
--
|
||||||
|
|
||||||
M.lsp_map_keys = function(server, bufnr)
|
M.lsp_map_keys = function(server, bufnr)
|
||||||
local function map_key(...)
|
local function map_key(...)
|
Loading…
Reference in New Issue
Block a user