move all plugin related code to plugins module
This commit is contained in:
parent
8ab3473583
commit
c41f6a096c
8 changed files with 67 additions and 54 deletions
1
init.lua
1
init.lua
|
@ -7,6 +7,5 @@ require('packer_setup')
|
|||
require('plugins')
|
||||
require('keymappings')
|
||||
require('lsp')
|
||||
require('config')
|
||||
require('filetypes')
|
||||
require('theme')
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
require('config.cmp')
|
||||
require('config.treesitter')
|
||||
require('config.telescope')
|
||||
require('config.oil')
|
|
@ -1,43 +0,0 @@
|
|||
return require('packer').startup(function()
|
||||
|
||||
-- Packer can manage itself as an optional plugin
|
||||
use {'wbthomason/packer.nvim', opt = true }
|
||||
|
||||
-- Fuzzy finder
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
requires = {{'nvim-lua/popup.nvim'}, {'nvim-lua/plenary.nvim'}}
|
||||
}
|
||||
|
||||
use 'nvim-treesitter/nvim-treesitter'
|
||||
|
||||
-- LSP and related
|
||||
use { 'neovim/nvim-lspconfig' }
|
||||
use { 'nvim-lua/completion-nvim' }
|
||||
use { 'weilbith/nvim-code-action-menu', cmd = 'CodeActionMenu' }
|
||||
|
||||
-- Lua development
|
||||
use { 'tjdevries/nlua.nvim' }
|
||||
|
||||
-- Vim dispatch
|
||||
use { 'tpope/vim-dispatch' }
|
||||
|
||||
-- Fugitive for Git
|
||||
use { 'tpope/vim-fugitive' }
|
||||
|
||||
-- Airline status bar
|
||||
use { 'vim-airline/vim-airline' }
|
||||
use { 'vim-airline/vim-airline-themes' }
|
||||
|
||||
use { 'cespare/vim-toml' }
|
||||
use { 'folke/trouble.nvim' }
|
||||
use { 'hrsh7th/nvim-cmp' }
|
||||
use { 'jacoborus/tender.vim' }
|
||||
use { 'RRethy/vim-illuminate' }
|
||||
use { 'rust-lang/rust.vim' }
|
||||
use { 'vim-scripts/DrawIt' }
|
||||
use { 'gleam-lang/gleam.vim' }
|
||||
use { 'nathom/filetype.nvim' }
|
||||
|
||||
use { 'stevearc/oil.nvim' }
|
||||
end)
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
local utils = require('utils')
|
||||
|
||||
vim.cmd [[set shortmess+=c]]
|
||||
utils.opt('o', 'completeopt', 'menuone,noselect')
|
||||
--vim.cmd [[set shortmess+=c]]
|
||||
--utils.opt('o', 'completeopt', 'menuone,noselect')
|
||||
|
||||
local cmp = require('cmp')
|
||||
|
||||
|
@ -18,15 +18,19 @@ cmp.setup({
|
|||
end,
|
||||
},
|
||||
window = {
|
||||
-- completion = cmp.config.window.bordered(),
|
||||
-- documentation = cmp.config.window.bordered(),
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
completion = {
|
||||
autocomplete = false,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-n>'] = cmp.mapping.complete(),
|
||||
['<C-x><C-o>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
57
lua/plugins/init.lua
Normal file
57
lua/plugins/init.lua
Normal file
|
@ -0,0 +1,57 @@
|
|||
require('packer').startup(function()
|
||||
|
||||
-- Packer can manage itself as an optional plugin
|
||||
use {'wbthomason/packer.nvim', opt = true }
|
||||
|
||||
-- Fuzzy finder
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
requires = {{'nvim-lua/popup.nvim'}, {'nvim-lua/plenary.nvim'}}
|
||||
}
|
||||
|
||||
-- Autocomplete and snippets
|
||||
use {
|
||||
'hrsh7th/nvim-cmp',
|
||||
requires = {
|
||||
{ 'hrsh7th/cmp-nvim-lsp' },
|
||||
{ 'hrsh7th/cmp-buffer' },
|
||||
{ 'hrsh7th/cmp-path' },
|
||||
{ 'hrsh7th/cmp-cmdline' },
|
||||
{ 'hrsh7th/vim-vsnip' },
|
||||
{ 'hrsh7th/vim-vsnip-integ' },
|
||||
}
|
||||
}
|
||||
|
||||
-- Statusbar, colors and syntax
|
||||
use { 'jacoborus/tender.vim' }
|
||||
use { 'nvim-treesitter/nvim-treesitter' }
|
||||
use { 'vim-airline/vim-airline' }
|
||||
use { 'vim-airline/vim-airline-themes' }
|
||||
|
||||
-- LSP and related
|
||||
use { 'neovim/nvim-lspconfig' }
|
||||
use { 'weilbith/nvim-code-action-menu', cmd = 'CodeActionMenu' }
|
||||
use { 'folke/trouble.nvim' } -- lsp diagnostics
|
||||
|
||||
-- Languages
|
||||
use { 'cespare/vim-toml' }
|
||||
use { 'gleam-lang/gleam.vim' }
|
||||
use { 'rust-lang/rust.vim' }
|
||||
use { 'tjdevries/nlua.nvim' }
|
||||
|
||||
-- Git
|
||||
use { 'tpope/vim-fugitive' }
|
||||
|
||||
-- Filesystem in a nvim buffer
|
||||
use { 'stevearc/oil.nvim' }
|
||||
|
||||
-- Misc
|
||||
use { 'RRethy/vim-illuminate' } -- highlight all words same as the one under cursor
|
||||
use { 'vim-scripts/DrawIt' } -- ascii diagrams
|
||||
use { 'nathom/filetype.nvim' }
|
||||
end)
|
||||
|
||||
require('plugins.cmp')
|
||||
require('plugins.treesitter')
|
||||
require('plugins.telescope')
|
||||
require('plugins.oil')
|
Reference in a new issue