✏ Working on Vim config

This commit is contained in:
Alicia Sykes 2022-03-16 23:51:18 +00:00
parent 993cf244d6
commit 33d740bc06
3 changed files with 24 additions and 0 deletions

3
vim/init.vim Normal file
View File

@ -0,0 +1,3 @@
echom "Init"
source ~/.config/vim/setup-vim-plug.vim

21
vim/setup-vim-plug.vim Normal file
View File

@ -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

0
vim/vimrc Normal file
View File