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:
parent
23176b30c0
commit
9049a3c071
@ -30,8 +30,7 @@ set incsearch
|
||||
set hlsearch
|
||||
" Disable error bells
|
||||
set noerrorbells
|
||||
" Enable mouse in all modes
|
||||
set mouse=a
|
||||
|
||||
" Don’t show the intro message when starting Vim
|
||||
set shortmess=atI
|
||||
" Show the filename in the window titlebar
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user