improve vim config + aliases behavior

* disable mouse option in vim (not working well with C/C on mac)
* improve function for getting article publication dates
This commit is contained in:
Morgan Wattiez 2019-08-04 22:44:51 +02:00
parent 23176b30c0
commit 9049a3c071
3 changed files with 9 additions and 3 deletions

View File

@ -30,8 +30,7 @@ set incsearch
set hlsearch
" Disable error bells
set noerrorbells
" Enable mouse in all modes
set mouse=a
" Dont show the intro message when starting Vim
set shortmess=atI
" Show the filename in the window titlebar

View File

@ -65,6 +65,7 @@ alias ls='lsd'
alias pip='pip3'
alias c='cat'
alias x='extract'
alias current_year='`echo date +"%Y"`'
# Show/hide hidden files in Finder
alias show="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"

View File

@ -78,5 +78,11 @@ function istherenewissues() {
echo "$LASTISSUE" > .newjiraissue
}
function greppagedate() {
curl -sSL "$*" | \grep datetime | \grep -Eo '[[:digit:]]{4}' | head -n1
year=$(curl -sSL "$*" | tr '<' '\r' | \egrep -i "date|datetime" -A 1 | \grep -Eo '\b[[:digit:]]{4}\b' | head -n1)
yearint=$(($year + 0))
currentyear=$(echo `date +"%Y"`)
if [[ $yearint -ge 1970 && $yearint -le $currentyear ]]
then
echo "$yearint"
fi
}