From c036f22cdf99f5baad92222005be6487aea0d007 Mon Sep 17 00:00:00 2001 From: snow flurry Date: Sat, 6 Aug 2022 19:28:59 -0700 Subject: [PATCH] nvim: Use lua instead of VimScript This includes switching from vim-plug to packer.nvim, and cleaning up some packages I never use. --- base/.config/nvim/ginit.vim | 13 ------ base/.config/nvim/init.lua | 59 +++++++++++++++++++++++++ base/.config/nvim/init.vim | 88 ------------------------------------- 3 files changed, 59 insertions(+), 101 deletions(-) delete mode 100644 base/.config/nvim/ginit.vim create mode 100644 base/.config/nvim/init.lua delete mode 100644 base/.config/nvim/init.vim diff --git a/base/.config/nvim/ginit.vim b/base/.config/nvim/ginit.vim deleted file mode 100644 index 4af70a3..0000000 --- a/base/.config/nvim/ginit.vim +++ /dev/null @@ -1,13 +0,0 @@ -set mouse=a - -if exists(':Guifont') - Guifont Terminus [xos4]:h9 -endif - -if exists(':GuiTabline') - GuiTabline 0 -endif - -if exists(':GuiPopupmenu') - GuiPopupmenu 0 -endif diff --git a/base/.config/nvim/init.lua b/base/.config/nvim/init.lua new file mode 100644 index 0000000..615384e --- /dev/null +++ b/base/.config/nvim/init.lua @@ -0,0 +1,59 @@ +local fn = vim.fn +local packer_bootstrap = false +local install_path = fn.stdpath('data') .. "/site/pack/packer/opt/packer.nvim" + +if fn.empty(fn.glob(install_path)) > 0 then + vim.api.nvim_echo({ {"Installing packer.nvim", "Type" } }, true, {}) + packer_bootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) +end + +vim.cmd([[ packadd packer.nvim ]]) +vim.api.nvim_create_autocmd("BufWritePost", { + pattern = "init.lua", + command = "source | PackerCompile", +}) + + +require('packer').startup(function(use) + use { "wbthomason/packer.nvim", opt = true } + use { "nvim-lua/plenary.nvim" } + use { + "lewis6991/gitsigns.nvim", + config = function() + require('gitsigns').setup() + end + } + use { "catppuccin/nvim", as = "catppuccin", + config = function() + vim.g.catppuccin_flavour = "frappe" + require("catppuccin").setup({ + + transparent_background = true, + integrations = { + gitsigns = true + } + }) + + vim.cmd([[ colorscheme catppuccin ]]) + end + } + + + if packer_bootstrap then + require('packer').sync() + end +end) + +vim.o.sw = 4 +vim.o.ts = 4 +vim.o.sts = 4 +vim.o.expandtab = true +vim.o.compatible = false + +vim.cmd([[ + syntax on + autocmd FileType make set noexpandtab shiftwidth=8 tabstop=8 softtabstop=0 + set bs=indent + set number +]]) + diff --git a/base/.config/nvim/init.vim b/base/.config/nvim/init.vim deleted file mode 100644 index 3fb9e49..0000000 --- a/base/.config/nvim/init.vim +++ /dev/null @@ -1,88 +0,0 @@ -call plug#begin('~/.vim/plug') - -Plug 'equalsraf/neovim-gui-shim' -Plug 'neovim/nvim-lspconfig' -Plug 'Pocco81/Catppuccino.nvim' -Plug 'vim-scripts/bash-support.vim' -Plug 'romgrk/barbar.nvim' -Plug 'kyazdani42/nvim-tree.lua' -Plug 'nvim-lua/plenary.nvim' -Plug 'lewis6991/gitsigns.nvim' - -call plug#end() - - -lua << EOF -require'lspconfig'.rls.setup{} -EOF - -lua << EOF -local catppuccino = require('catppuccino') - -catppuccino.setup( - { - colorscheme = "catppuccino", - transparency = true, - integrations = { - treesitter = true, - native_lsp = { - enabled = true, - underlines = { - errors = "underline", - hints = "underline", - warnings = "underline", - information = "underline" - } - }, - gitsigns = true, - nvimtree = { - enabled = true, - show_root = false - }, - barbar = true - } - } -) - -catppuccino.load() -EOF - -" Barbar -let bufferline = get(g:, 'bufferline', {}) -let bufferline.icons = v:false -let bufferline.animation = v:false -let bufferline.auto_hide = v:true - -" nvim-tree -let g:nvim_tree_follow = 1 -let g:nvim_tree_auto_open = 1 -let g:nvim_tree_auto_close = 1 -let g:nvim_tree_show_icons = { - \ 'git': 0, - \ 'folders': 0, - \ 'files': 0, - \ 'folder_arrows': 0, - \ } - -nnoremap :BufferGoto 1 -nnoremap :BufferGoto 2 -nnoremap :BufferGoto 3 -nnoremap :BufferGoto 4 -nnoremap :BufferGoto 5 -nnoremap :BufferGoto 6 -nnoremap :BufferGoto 7 -nnoremap :BufferGoto 8 -nnoremap :BufferGoto 9 -nnoremap :BufferPrevious -nnoremap :BufferNext -nnoremap :BufferPin -nnoremap :BufferClose - -set nocompatible - -set sw=4 ts=4 sts=4 et -syntax on -autocmd FileType make set noexpandtab shiftwidth=8 tabstop=8 softtabstop=0 -set bs=indent,eol,start -set ruler -