dotwryn/setup/vim.setup.zsh

35 lines
848 B
Bash
Raw Normal View History

function SETUP__VIM() {
2021-09-17 01:12:55 +00:00
STATUS 'starting vim setup'
"$DOTWRYN_PATH/bin/vim/compile"
2021-09-15 07:48:37 +00:00
VIM__SOURCE_RC
"$DOTWRYN_PATH/bin/vim/install-plugins"
2021-09-17 01:12:55 +00:00
VIM__CREATE_PANE_DEFAULT_APP
STATUS 'finished vim setup'
2021-09-15 07:48:37 +00:00
}
#####################################################################
function VIM__SOURCE_RC() {
local LOCAL_VIMRC="$HOME/.vimrc";
local SOURCE_LINE="source $DOTWRYN_PATH/vim/rc.vim";
grep -q "^$SOURCE_LINE$" $LOCAL_VIMRC && {
STATUS 'already set up vimrc'
} || {
CHECK 'setting up vimrc'
echo $SOURCE_LINE >> $LOCAL_VIMRC \
&& OK || WARN
}
}
2021-09-17 01:12:55 +00:00
function VIM__CREATE_PANE_DEFAULT_APP() {
which vim | grep "$HOME/.local/bin/vim" && return 0
2021-09-15 07:48:37 +00:00
2021-09-17 01:12:55 +00:00
CHECK 'updating vim to open in panes by default'
{
echo '#!/bin/sh'
2022-04-20 18:59:45 +00:00
echo "exec $(which vim) -p "'"$@"'
2021-09-17 01:12:55 +00:00
} > "$HOME/.local/bin/vim" && OK || WARN
chmod +x "$HOME/.local/bin/vim"
2021-09-15 07:48:37 +00:00
}