diff --git a/seqs/vim.sh b/seqs/vim.sh index 1c32b4e..7293d97 100755 --- a/seqs/vim.sh +++ b/seqs/vim.sh @@ -4,28 +4,11 @@ toolName=vim indentDownUrl="https://www.vim.org/scripts/download_script.php?src_id=27565" seqVimConfigLoc="$HOME/.vimrc" -# Get script working directory -# (when called from a different directory) -WDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >>/dev/null 2>&1 && pwd)" -APTOPT= -CONFIG=0 -SCRIPT_FILE=$(basename -- $0) -SCRIPT_NAME=${SCRIPT_FILE%%.*} -CONFIG_FILE_NAME="${SCRIPT_NAME}.cfg" -CONFIG_FILE_TEMPLATE="$WDIR/${CONFIG_FILE_NAME}.example" +sq_aptOpt= seq_config() { - ## or to use sequencer api with global config file: - #initSeqConfig "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE" - #if [ $? -eq 0 ] ; then - # CONFIG=1 - #else - # # End if no configuration file exists - # dry || return -1 - #fi - ## Apt cmdline option to suppress user interaction - quiet && APTOPT="-y" + interactive || sq_aptOpt="-y" ## Return of non zero value will abort the sequence return 0 @@ -34,7 +17,7 @@ seq_config() { step_1_info() { echo "Install $toolName"; } step_1_alias() { echo "install"; } step_1() { - exe apt install vim $APTOPT + exe apt install vim ${sq_aptOpt} } step_2_info() { echo "Installing indentation script $seqVimIndentLoc"; } @@ -73,13 +56,20 @@ step_3() { step_10_info() { echo "Setup $HOME/.vimrc globaly to use spaces and indent 2"; } step_10() { - info "Installing formating rules" + info "Installing formating rules" + info -a " 'set expandtab shiftwidth=2 softtabstop=2 tabstop=2'" + info -a " Indent by 2 spaces" + info -a " 'set noro'" + info -a " Don't set files read only for vimdiff" + info -a " 'cindent cinkeys-=0#'" + info -a " Don't remove leading spaces for comments" addConf -a "$seqVimConfig" "$seqVimConfigLoc" } -seqVimConfig="set expandtab -set tabstop=2 -set softtabstop=2 -set shiftwidth=2" +seqVimConfig="set expandtab shiftwidth=2 softtabstop=2 tabstop=2 +set noro +set cindent cinkeys-=0#" +# shellcheck disable=SC2034 # Appears unused readonly sqr_minVersion=16 +# shellcheck disable=SC1091 # Don't follow this source . /usr/local/bin/sequencer.sh