First version of the packer plugin setup calls
This commit is contained in:
parent
d1b14f05c1
commit
7e1182a11b
15
init.lua
15
init.lua
@ -5,20 +5,6 @@ local opt = vim.opt -- to set options
|
||||
local utils = require('utils')
|
||||
local packerUtil = require'packer.util'
|
||||
|
||||
-------------------- PACKER --------------------------------
|
||||
-- Auto install packer.nvim if not exists
|
||||
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
|
||||
vim.cmd 'packadd packer.nvim'
|
||||
end
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
require('packer').init({
|
||||
snapshot_path = packerUtil.join_paths(vim.fn.stdpath('config'), 'snapshots'),
|
||||
display = {
|
||||
open_fn = require('packer.util').float,
|
||||
}
|
||||
})
|
||||
-------------------- EXTERNAL ------------------------------
|
||||
require('my_plugins')
|
||||
require('my_keymappings')
|
||||
@ -26,7 +12,6 @@ require('my_options')
|
||||
require("my_autocommands")
|
||||
|
||||
-- plugins
|
||||
require('my_telescope')
|
||||
require('my_lspinstall')
|
||||
require('my_cmp')
|
||||
require('my_neogen')
|
||||
|
@ -1,3 +1,28 @@
|
||||
vim.cmd([[
|
||||
augroup packer_user_config
|
||||
autocmd!
|
||||
autocmd BufWritePost plugins.lua source <afile> | PackerCompile
|
||||
augroup end
|
||||
]])
|
||||
|
||||
local fn = vim.fn
|
||||
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
packer_bootstrap = fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--depth",
|
||||
"1",
|
||||
"https://github.com/wbthomason/packer.nvim",
|
||||
install_path,
|
||||
})
|
||||
end
|
||||
vim.api.nvim_command("packadd packer.nvim")
|
||||
|
||||
function get_setup(name)
|
||||
return string.format('require("setup/%s")', name)
|
||||
end
|
||||
|
||||
return require('packer').startup(function()
|
||||
|
||||
-- Packer can manage itself as an optional plugin
|
||||
@ -7,10 +32,15 @@ return require('packer').startup(function()
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
run = ':TSUpdate'
|
||||
}
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
requires = {{'nvim-lua/popup.nvim'}, {'nvim-lua/plenary.nvim'}, {'kyazdani42/nvim-web-devicons'}}
|
||||
}
|
||||
use({
|
||||
'nvim-telescope/telescope.nvim',
|
||||
requires = {
|
||||
{'nvim-lua/popup.nvim'},
|
||||
{'nvim-lua/plenary.nvim'},
|
||||
{'kyazdani42/nvim-web-devicons'}
|
||||
},
|
||||
config = get_setup("telescope"),
|
||||
})
|
||||
use {'sainnhe/gruvbox-material'}
|
||||
use {'ellisonleao/gruvbox.nvim'}
|
||||
use {'lukas-reineke/indent-blankline.nvim'}
|
||||
@ -24,10 +54,17 @@ return require('packer').startup(function()
|
||||
use {
|
||||
'hrsh7th/nvim-cmp',
|
||||
requires = {
|
||||
'hrsh7th/cmp-buffer', 'hrsh7th/cmp-nvim-lsp',
|
||||
'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip', 'hrsh7th/cmp-nvim-lua',
|
||||
'octaltree/cmp-look', 'hrsh7th/cmp-path', 'hrsh7th/cmp-calc',
|
||||
'f3fora/cmp-spell', 'hrsh7th/cmp-emoji', 'hrsh7th/cmp-cmdline'
|
||||
'hrsh7th/cmp-buffer',
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'L3MON4D3/LuaSnip',
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
'hrsh7th/cmp-nvim-lua',
|
||||
'octaltree/cmp-look',
|
||||
'hrsh7th/cmp-path',
|
||||
'hrsh7th/cmp-calc',
|
||||
'f3fora/cmp-spell',
|
||||
'hrsh7th/cmp-emoji',
|
||||
'hrsh7th/cmp-cmdline'
|
||||
}
|
||||
}
|
||||
use {'rafamadriz/friendly-snippets'}
|
||||
|
@ -1,50 +1,50 @@
|
||||
local actions = require('telescope.actions')
|
||||
|
||||
local mappingTab = {
|
||||
i = {
|
||||
['<cr>'] = actions.select_tab,
|
||||
['<C-b>'] = actions.select_default,
|
||||
}
|
||||
}
|
||||
|
||||
require('telescope').setup {
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
['<esc>'] = actions.close,
|
||||
['<cr>'] = actions.select_default + actions.center,
|
||||
['<C-l>'] = actions.send_selected_to_loclist,
|
||||
['<C-q>'] = actions.smart_send_to_qflist
|
||||
}
|
||||
}
|
||||
},
|
||||
pickers = {
|
||||
-- Your special builtin config goes in here
|
||||
buffers = {
|
||||
sort_lastused = true,
|
||||
theme = 'ivy',
|
||||
mappings = {
|
||||
i = {
|
||||
['<c-w>'] = actions.delete_buffer,
|
||||
['<cr>'] = actions.select_default,
|
||||
},
|
||||
n = {
|
||||
['<c-w>'] = actions.delete_buffer,
|
||||
}
|
||||
}
|
||||
},
|
||||
find_files = {
|
||||
theme = 'ivy',
|
||||
previewer = false,
|
||||
},
|
||||
oldfiles = {
|
||||
theme = 'ivy',
|
||||
},
|
||||
git_files = {
|
||||
theme = 'ivy',
|
||||
previewer = false,
|
||||
},
|
||||
lsp_dynamic_workspace_symbols = {
|
||||
},
|
||||
}
|
||||
}
|
||||
local actions = require('telescope.actions')
|
||||
|
||||
local mappingTab = {
|
||||
i = {
|
||||
['<cr>'] = actions.select_tab,
|
||||
['<C-b>'] = actions.select_default,
|
||||
}
|
||||
}
|
||||
|
||||
require('telescope').setup {
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
['<esc>'] = actions.close,
|
||||
['<cr>'] = actions.select_default + actions.center,
|
||||
['<C-l>'] = actions.send_selected_to_loclist,
|
||||
['<C-q>'] = actions.smart_send_to_qflist
|
||||
}
|
||||
}
|
||||
},
|
||||
pickers = {
|
||||
-- Your special builtin config goes in here
|
||||
buffers = {
|
||||
sort_lastused = true,
|
||||
theme = 'ivy',
|
||||
mappings = {
|
||||
i = {
|
||||
['<c-w>'] = actions.delete_buffer,
|
||||
['<cr>'] = actions.select_default,
|
||||
},
|
||||
n = {
|
||||
['<c-w>'] = actions.delete_buffer,
|
||||
}
|
||||
}
|
||||
},
|
||||
find_files = {
|
||||
theme = 'ivy',
|
||||
previewer = false,
|
||||
},
|
||||
oldfiles = {
|
||||
theme = 'ivy',
|
||||
},
|
||||
git_files = {
|
||||
theme = 'ivy',
|
||||
previewer = false,
|
||||
},
|
||||
lsp_dynamic_workspace_symbols = {
|
||||
},
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user