vim - fix comments not intending correctly
This commit is contained in:
38
seqs/vim.sh
38
seqs/vim.sh
@@ -4,28 +4,11 @@ toolName=vim
|
|||||||
indentDownUrl="https://www.vim.org/scripts/download_script.php?src_id=27565"
|
indentDownUrl="https://www.vim.org/scripts/download_script.php?src_id=27565"
|
||||||
seqVimConfigLoc="$HOME/.vimrc"
|
seqVimConfigLoc="$HOME/.vimrc"
|
||||||
|
|
||||||
# Get script working directory
|
sq_aptOpt=
|
||||||
# (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"
|
|
||||||
|
|
||||||
seq_config() {
|
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
|
## Apt cmdline option to suppress user interaction
|
||||||
quiet && APTOPT="-y"
|
interactive || sq_aptOpt="-y"
|
||||||
|
|
||||||
## Return of non zero value will abort the sequence
|
## Return of non zero value will abort the sequence
|
||||||
return 0
|
return 0
|
||||||
@@ -34,7 +17,7 @@ seq_config() {
|
|||||||
step_1_info() { echo "Install $toolName"; }
|
step_1_info() { echo "Install $toolName"; }
|
||||||
step_1_alias() { echo "install"; }
|
step_1_alias() { echo "install"; }
|
||||||
step_1() {
|
step_1() {
|
||||||
exe apt install vim $APTOPT
|
exe apt install vim ${sq_aptOpt}
|
||||||
}
|
}
|
||||||
|
|
||||||
step_2_info() { echo "Installing indentation script $seqVimIndentLoc"; }
|
step_2_info() { echo "Installing indentation script $seqVimIndentLoc"; }
|
||||||
@@ -74,12 +57,19 @@ step_3() {
|
|||||||
step_10_info() { echo "Setup $HOME/.vimrc globaly to use spaces and indent 2"; }
|
step_10_info() { echo "Setup $HOME/.vimrc globaly to use spaces and indent 2"; }
|
||||||
step_10() {
|
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"
|
addConf -a "$seqVimConfig" "$seqVimConfigLoc"
|
||||||
}
|
}
|
||||||
seqVimConfig="set expandtab
|
seqVimConfig="set expandtab shiftwidth=2 softtabstop=2 tabstop=2
|
||||||
set tabstop=2
|
set noro
|
||||||
set softtabstop=2
|
set cindent cinkeys-=0#"
|
||||||
set shiftwidth=2"
|
|
||||||
|
|
||||||
|
# shellcheck disable=SC2034 # Appears unused
|
||||||
readonly sqr_minVersion=16
|
readonly sqr_minVersion=16
|
||||||
|
# shellcheck disable=SC1091 # Don't follow this source
|
||||||
. /usr/local/bin/sequencer.sh
|
. /usr/local/bin/sequencer.sh
|
||||||
|
Reference in New Issue
Block a user