diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index 4ef0b56..7fff03f 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -1,4 +1,38 @@ ---print("init.lua loaded") +----------------------------------------------------------- +-- Installing plugin manager 'lazy.nvim' +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +-- Installing plugins +require('lazy').setup({ + -- fzf + { 'ibhagwan/fzf-lua', + -- optional icon + --requires = { 'kyazdan142/nvim-web/devicons' } -- not found + }, + -- lualine(statusline) + { + 'nvim-lualine/lualine.nvim', + dependencies = { 'kyazdani42/nvim-web-devicons', lazy = true } + }, + 'neovim/nvim-lspconfig', + { + 'hrsh7th/nvim-cmp', + dependencies = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip' }, + }, +}) + + ----------------------------------------------------------- -- basic configurations vim.o.number = true @@ -41,10 +75,6 @@ if vim.fn.has('win32') == 1 then end ------------------------------------------------------------ --- Plugins -require 'plugins' ---vim.cmd [[autocmd BufWritePost plugins.lua PackerCompile]] ----------------------------------------------------------- -- LSP config diff --git a/dotfiles/neovim/lua/plugins.lua b/dotfiles/neovim/lua/plugins.lua deleted file mode 100644 index ff5e390..0000000 --- a/dotfiles/neovim/lua/plugins.lua +++ /dev/null @@ -1,27 +0,0 @@ -vim.cmd [[packadd packer.nvim]] - -return require('packer').startup(function(use) - use 'wbthomason/packer.nvim' - - -- fzf - use { 'ibhagwan/fzf-lua', - -- optional icon - --requires = { 'kyazdan142/nvim-web/devicons' } -- not found - } - - -- lualine(statusline) - use { - 'nvim-lualine/lualine.nvim', - requires = { 'kyazdani42/nvim-web-devicons', opt = true } - } - - -- LSP - use 'neovim/nvim-lspconfig' - use "williamboman/mason.nvim" - use "williamboman/mason-lspconfig.nvim" - use "hrsh7th/nvim-cmp" - use "hrsh7th/cmp-nvim-lsp" - use "hrsh7th/vim-vsnip" - - -end)