diff --git a/init.lua b/init.lua index d5af289..5fbade5 100644 --- a/init.lua +++ b/init.lua @@ -7,6 +7,5 @@ require('packer_setup') require('plugins') require('keymappings') require('lsp') -require('config') require('filetypes') require('theme') diff --git a/lua/config/init.lua b/lua/config/init.lua deleted file mode 100644 index b0d767b..0000000 --- a/lua/config/init.lua +++ /dev/null @@ -1,4 +0,0 @@ -require('config.cmp') -require('config.treesitter') -require('config.telescope') -require('config.oil') diff --git a/lua/plugins.lua b/lua/plugins.lua deleted file mode 100644 index e352c46..0000000 --- a/lua/plugins.lua +++ /dev/null @@ -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) diff --git a/lua/config/cmp.lua b/lua/plugins/cmp.lua similarity index 78% rename from lua/config/cmp.lua rename to lua/plugins/cmp.lua index a3f5ee6..8953f76 100644 --- a/lua/config/cmp.lua +++ b/lua/plugins/cmp.lua @@ -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({ [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.complete(), [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + [''] = 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' }, diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua new file mode 100644 index 0000000..3504985 --- /dev/null +++ b/lua/plugins/init.lua @@ -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') diff --git a/lua/config/oil.lua b/lua/plugins/oil.lua similarity index 100% rename from lua/config/oil.lua rename to lua/plugins/oil.lua diff --git a/lua/config/telescope.lua b/lua/plugins/telescope.lua similarity index 100% rename from lua/config/telescope.lua rename to lua/plugins/telescope.lua diff --git a/lua/config/treesitter.lua b/lua/plugins/treesitter.lua similarity index 100% rename from lua/config/treesitter.lua rename to lua/plugins/treesitter.lua