From a6cc571f68802268965f89dfc7807e6a012ad777 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Mon, 3 Apr 2023 00:11:15 -0400 Subject: [PATCH] Organized and split init.lua into multiple files --- dot_config/nvim/init.lua | 72 ++++++++------------------------- dot_config/nvim/lua/options.lua | 29 +++++++++++++ dot_config/nvim/lua/plugins.lua | 37 +++++++++++++++++ 3 files changed, 83 insertions(+), 55 deletions(-) create mode 100644 dot_config/nvim/lua/options.lua create mode 100644 dot_config/nvim/lua/plugins.lua diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua index b3aca8f..ff1a55b 100644 --- a/dot_config/nvim/init.lua +++ b/dot_config/nvim/init.lua @@ -1,62 +1,24 @@ +require("plugins") +require("options") + vim.g.mapleader = " " vim.keymap.set({ "n", "v" }, "y", '"+y', { noremap = true, silent = true }) -vim.opt.encoding = 'utf-8' -vim.opt.fileencoding = 'utf-8' -vim.opt.mouse = 'a' -vim.opt.hidden = true -vim.opt.ruler = true -vim.opt.cmdheight = 2 -vim.opt.splitbelow = true -vim.opt.splitright = true -vim.opt.conceallevel = 0 -vim.opt.tabstop = 2 -vim.opt.shiftwidth = 2 -vim.opt.smarttab = true -vim.opt.expandtab = true -vim.opt.smartindent = true -vim.opt.autoindent = true -vim.opt.ignorecase = true -vim.opt.smartcase = true -vim.opt.laststatus = 0 -vim.opt.number = false -vim.opt.wrap = true -vim.opt.breakindent = true -vim.opt.cursorline = false -vim.opt.background = 'dark' -vim.opt.showtabline = 2 -vim.opt.updatetime = 300 -vim.opt.timeoutlen = 500 -vim.opt.autochdir = true -vim.opt.swapfile = true +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", + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) -vim.cmd [[ - syntax enable - set dir=~/.cache/nvim -]] +require("lazy").setup("plugins") -local Plug = vim.fn['plug#'] -vim.call('plug#begin', '~/.local/share/nvim/plugged') - -Plug 'vim-airline/vim-airline' -Plug 'sheerun/vim-polyglot' -Plug 'jiangmiao/auto-pairs' -Plug('sainnhe/everforest', { - ['do'] = function() - vim.opt.termguicolors = true - vim.cmd('colorscheme everforest') - vim.g.airline_theme = 'everforest' - vim.g.everforest_background = 'soft' - vim.g.everforest_better_performance = 1 - end -}) - -vim.call('plug#end') - -vim.opt.termguicolors = true -vim.cmd('colorscheme everforest') -vim.g.airline_theme = 'everforest' -vim.g.everforest_background = 'soft' -vim.g.everforest_better_performance = 1 +vim.cmd("colorscheme everforest") diff --git a/dot_config/nvim/lua/options.lua b/dot_config/nvim/lua/options.lua new file mode 100644 index 0000000..f92436e --- /dev/null +++ b/dot_config/nvim/lua/options.lua @@ -0,0 +1,29 @@ +vim.o.encoding = "utf-8" +vim.o.fileencoding = "utf-8" +vim.o.mouse = "a" +vim.o.hidden = true +vim.o.ruler = true +vim.o.cmdheight = 2 +vim.o.splitbelow = true +vim.o.splitright = true +vim.o.conceallevel = 0 +vim.o.tabstop = 2 +vim.o.shiftwidth = 2 +vim.o.smarttab = true +vim.o.expandtab = true +vim.o.smartindent = true +vim.o.autoindent = true +vim.o.ignorecase = true +vim.o.smartcase = true +vim.o.laststatus = 0 +vim.o.number = false +vim.o.wrap = true +vim.o.breakindent = true +vim.o.cursorline = false +vim.o.background = "dark" +vim.o.showtabline = 2 +vim.o.updatetime = 300 +vim.o.timeoutlen = 500 +vim.o.autochdir = true +vim.o.swapfile = true + diff --git a/dot_config/nvim/lua/plugins.lua b/dot_config/nvim/lua/plugins.lua new file mode 100644 index 0000000..40197bf --- /dev/null +++ b/dot_config/nvim/lua/plugins.lua @@ -0,0 +1,37 @@ +return { + { + "folke/which-key.nvim", + config = true, + }, + { + "windwp/nvim-autopairs", + config = true, + lazy = true, + event = { "BufReadPost", "BufNewFile" } + }, + { + "nvim-treesitter/nvim-treesitter", + lazy = true, + build = ":TSUpdate", + event = { "BufReadPost", "BufNewFile" }, + }, + { + "nvim-lualine/lualine.nvim", + config = true, + dependencies = { 'nvim-tree/nvim-web-devicons' } + }, + { + "neanias/everforest-nvim", + version = false, + priority = 1000, + config = function() + require("everforest").setup({ + background = "soft", + transparent_background_level = 0, + italics = false, + disable_italic_comments = false, + }) + end, + }, +} +