From ebfd1726867bdddb10330447694cdbd89b887d59 Mon Sep 17 00:00:00 2001 From: j3s Date: Fri, 12 Mar 2021 13:48:57 -0600 Subject: [PATCH] note autorefresh, shortcut for morning --- .vimrc | 35 +++-------------------------------- bin/n | 2 +- 2 files changed, 4 insertions(+), 33 deletions(-) diff --git a/.vimrc b/.vimrc index 73bc6e0..0f2e8cb 100644 --- a/.vimrc +++ b/.vimrc @@ -1,32 +1,3 @@ -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Maintainer: -" Amir Salihefendic — @amix3k -" -" Awesome_version: -" Get this config, nice color schemes and lots of plugins! -" -" Install the awesome version from: -" -" https://github.com/amix/vimrc -" -" Sections: -" -> General -" -> VIM user interface -" -> Colors and Fonts -" -> Files and backups -" -> Text, tab and indent related -" -> Visual mode related -" -> Moving around, tabs and buffers -" -> Status line -" -> Editing mappings -" -> vimgrep searching and cope displaying -" -> Spell checking -" -> Misc -" -> Helper functions -" -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - - """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => General """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -48,6 +19,9 @@ let mapleader = "," " Fast saving nmap w :w! +" for adding morning notes to notes.md +nmap m Go:put =strftime(\"%Y-%m-%d\")o---------------- + " :W sudo saves the file " (useful for handling the permission-denied error) command! W execute 'w !sudo tee % > /dev/null' edit! @@ -316,9 +290,6 @@ map s? z= """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Misc """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Remove the Windows ^M - when the encodings gets messed up -noremap m mmHmt:%s///ge'tzt'm - " Quickly open a buffer for scribble map q :e ~/buffer diff --git a/bin/n b/bin/n index eb9843c..db7110a 100755 --- a/bin/n +++ b/bin/n @@ -4,5 +4,5 @@ mkdir /tmp/notelock 2> /dev/null || exit 1 notefile="$HOME/Sync/notes.md" -vim "+normal G" "$notefile" +vim "+normal G" '+:set autoread' '+ au CursorHold,CursorHoldI * checktime' "$notefile" rmdir /tmp/notelock -- 2.51.2