From 881a5da0b4b693d77ba1d8b433f8097d28832af2 Mon Sep 17 00:00:00 2001 From: dineshsaini Date: Wed, 27 Apr 2022 16:41:57 +0530 Subject: [PATCH] added vimrc --- annote.config | 2 +- install.sh | 3 +++ uninstall.sh | 6 ++++++ vimrc | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 vimrc diff --git a/annote.config b/annote.config index 197a763..e33e791 100644 --- a/annote.config +++ b/annote.config @@ -22,7 +22,7 @@ default_tag=default #dbl_key_k2=/db/loc/2 # editor - editor=vim + editor=vim -u ~/.annote/vimrc gui_editor=gedit # output formatting diff --git a/install.sh b/install.sh index a8b3fe5..605a08a 100755 --- a/install.sh +++ b/install.sh @@ -11,6 +11,9 @@ mkdir -p $INSTALL_LOC cp ./annote.sh $INSTALL_LOC/$INSTALL_NAME chmod +x $INSTALL_LOC/$INSTALL_NAME +mkdir ~/.annote +cp ./vimrc ~/.annote/vimrc + bash $INSTALL_LOC/$INSTALL_NAME -C --import ./annote.config echo "Done installing, make sure '$INSTALL_LOC' is configured in your \$PATH variable." diff --git a/uninstall.sh b/uninstall.sh index 85164e7..b5084d1 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -7,6 +7,12 @@ if [ -n "$INSTALLED_BIN" ]; then rm -f "$INSTALLED_BIN" HOME_DIR="$(realpath ~)/.annote" CONF_FILE="$HOME_DIR/annote.config" + VIMRC_FILE="$HOME_DIR/vimrc" + + if [ -f "$VIMRC_FILE" ]; then + rm $VIMRC_FILE + fi + if [ -d "$HOME_DIR" ] && [ -f "$CONF_FILE" ]; then DB_DIR="$(cat "$CONF_FILE" | sed -e 's/^\s\+//' | grep "^db_loc" | cut -d= -f2- | sed -e 's/^\s\+//' -e 's/\s\+$//')" rm -f "$CONF_FILE" diff --git a/vimrc b/vimrc new file mode 100644 index 0000000..6d44f96 --- /dev/null +++ b/vimrc @@ -0,0 +1,35 @@ +" Use Vim defaults instead of 100% vi compatibility +" Avoid side-effects when nocompatible has already been set. +if &compatible + set nocompatible +endif + +" highlighting comments for annote notes +" comments defination: @! +" empty: <> +" space: < > +" integer: <[0-9]+> +" string: <.*> +" start: (|<##>) +" number: (|) +" range: (|) +" +highlight cmnts ctermfg=DarkGrey +match cmnts /^\s*\(##\)\?@[0-9.*-]*! .*/ + +" highlights for sub heading and back references +" subheading defination: #@ +" integer: <[0-9]+> +" string: <.*> +" number: (|) +" +" numeral back reference defination: @{} +" integer: <[0-9]+> +" number: (|) +" +" string back reference defination: @[] +" string: <[^]]*> +" +highlight subheads ctermfg=DarkGreen +2match subheads /\(^\s*#@[0-9]\+[0-9.]*[0-9]\+ .*\|@{[0-9.]\+}\|@\[[^]]\+\]\)/ +