New seq to setup vim according to sequencer git wiki
This commit is contained in:
62
seqs/vim.sh
Executable file
62
seqs/vim.sh
Executable file
@@ -0,0 +1,62 @@
|
||||
#!/bin/bash
|
||||
|
||||
toolName=vim
|
||||
indentDownUrl="https://www.vim.org/scripts/download_script.php?src_id=4371"
|
||||
|
||||
# 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"
|
||||
|
||||
step_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 -eq 0 ] && return -1
|
||||
#fi
|
||||
|
||||
## Apt cmdline option to suppress user interaction
|
||||
[ $QUIET -ne 0 ] && APTOPT="-y"
|
||||
|
||||
## Return of non zero value will abort the sequence
|
||||
return 0
|
||||
}
|
||||
|
||||
step_1_info() { echo "Install $toolName"; }
|
||||
step_1_alias() { ALIAS="install"; }
|
||||
step_1() {
|
||||
exe apt install vim $APTOPT
|
||||
}
|
||||
|
||||
step_2_info() { echo "Setup for sequencer development"; }
|
||||
step_2_alias() { ALIAS="setup"; }
|
||||
step_2() {
|
||||
echoseq " [I] Installing formating rules"
|
||||
addConf -s "$seqVimConfig" "$seqVimConfigLoc"
|
||||
|
||||
echoseq " [I] Installing indentation script $seqVimIndentLoc"
|
||||
[ ! -e "$seqVimIndentLoc" ] && \
|
||||
exep mkdir -p $(dirname "$seqVimIndentLoc") "&&" \
|
||||
cd $(dirname "$seqVimIndentLoc") "&&" \
|
||||
wget --content-disposition $indentDownUrl
|
||||
}
|
||||
seqVimIndentLoc="$HOME/.vim/indent/sh.vim"
|
||||
seqVimConfigLoc="$HOME/.vimrc"
|
||||
seqVimConfig="set t_TI= t_TE=
|
||||
filetype plugin indent on
|
||||
set expandtab
|
||||
set tabstop=2
|
||||
set softtabstop=2
|
||||
set shiftwidth=2
|
||||
syntax on"
|
||||
|
||||
VERSION_SEQREV=15
|
||||
. /usr/local/bin/sequencer.sh
|
Reference in New Issue
Block a user