Skip to content

Commit

Permalink
added vimrc
Browse files Browse the repository at this point in the history
  • Loading branch information
dineshsaini committed Apr 27, 2022
1 parent 3e7bcb4 commit 881a5da
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 1 deletion.
2 changes: 1 addition & 1 deletion annote.config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
6 changes: 6 additions & 0 deletions uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
35 changes: 35 additions & 0 deletions vimrc
Original file line number Diff line number Diff line change
@@ -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: <start>@<number|range>!<space><string>
" empty: <>
" space: < >
" integer: <[0-9]+>
" string: <.*>
" start: (<empty>|<##>)
" number: (<integer>|<integer.number>)
" range: (<number-number>|<number-*>)
"
highlight cmnts ctermfg=DarkGrey
match cmnts /^\s*\(##\)\?@[0-9.*-]*! .*/

" highlights for sub heading and back references
" subheading defination: #@<number> <string>
" integer: <[0-9]+>
" string: <.*>
" number: (<integer>|<integer.number>)
"
" numeral back reference defination: @{<number>}
" integer: <[0-9]+>
" number: (<integer>|<integer.number>)
"
" string back reference defination: @[<string>]
" string: <[^]]*>
"
highlight subheads ctermfg=DarkGreen
2match subheads /\(^\s*#@[0-9]\+[0-9.]*[0-9]\+ .*\|@{[0-9.]\+}\|@\[[^]]\+\]\)/

0 comments on commit 881a5da

Please sign in to comment.