From 33d740bc0663b5272ddd968f779ea84d19cfb1d9 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Wed, 16 Mar 2022 23:51:18 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9C=8F=20Working=20on=20Vim=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vim/init.vim | 3 +++ vim/setup-vim-plug.vim | 21 +++++++++++++++++++++ vim/vimrc | 0 3 files changed, 24 insertions(+) create mode 100644 vim/init.vim create mode 100644 vim/setup-vim-plug.vim create mode 100644 vim/vimrc diff --git a/vim/init.vim b/vim/init.vim new file mode 100644 index 0000000..63cc3cd --- /dev/null +++ b/vim/init.vim @@ -0,0 +1,3 @@ +echom "Init" + +source ~/.config/vim/setup-vim-plug.vim diff --git a/vim/setup-vim-plug.vim b/vim/setup-vim-plug.vim new file mode 100644 index 0000000..1884265 --- /dev/null +++ b/vim/setup-vim-plug.vim @@ -0,0 +1,21 @@ + +" Get version of Vim running +if has('nvim') | let vim_type='nvim' | else | let vim_type='vim' | endif + +let vim_rc=$XDG_CONFIG_HOME.'/vim/vimrc' + +" Location of vim plug script +let vim_plug_location=$XDG_DATA_HOME."/".vim_type."/autoload/plug.vim" + +" If vim-plug not present, install it now +if !filereadable(expand(vim_plug_location)) + echom "Vim Plug not found, downloading to '" . vim_plug_location . "'" + execute '!curl -o ' . vim_plug_location . ' --create-dirs' . + \ ' https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' +endif + +" Run PlugInstall if there are missing plugins +autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)')) + \| PlugInstall --sync | exec 'source ' . vim_rc + \| endif + diff --git a/vim/vimrc b/vim/vimrc new file mode 100644 index 0000000..e69de29