diff --git a/global_gitconfig b/global_gitconfig index 4a3ab1a..a46af62 100644 --- a/global_gitconfig +++ b/global_gitconfig @@ -31,3 +31,7 @@ [url "git@github.com:"] insteadOf = http://github.com/ insteadOf = https://github.com/ + +[diff "zip"] + textconv = unzip -c -a + diff --git a/matterhorn_config.ini b/matterhorn_config.ini index 54303a0..0c77264 100644 --- a/matterhorn_config.ini +++ b/matterhorn_config.ini @@ -137,7 +137,8 @@ activityNotifyCommand = $HOME/.scripts/matterhorn_notification.sh # The command to use to open URLs found in chat messages. # OS X: -urlOpenCommand = open +urlOpenCommand = $HOME/.scripts/matterhorn_open.sh + # Linux: # urlOpenCommand = xdg-open diff --git a/matterhorn_notification.sh b/matterhorn_notification.sh new file mode 100755 index 0000000..d2ea533 --- /dev/null +++ b/matterhorn_notification.sh @@ -0,0 +1,66 @@ +#!/usr/bin/env bash + +# Sample shell script for using notify-send with matterhorn This script +# works on Linux only. It depends on the 'notify-send' command. + +# Positional parameters passed to this script by Matterhorn: +mentioned="${1?}" +sender="${2?}" +message="${3?}" + +# Script options + +# notify_URGENCIES +# +# The first word is the urgency for items where you are not mentioned. +# The second word is the urgency for items where you are mentioned. +# Use "none" to not be notified; otherwise use "low", "normal", or +# "critical". +notify_URGENCIES="normal normal" + +# The desktop notification category +notify_CATEGORY="im.received" + +# Notification header +notify_HEAD="$sender" + +# Notification body +notify_BODY="$message" + +getUrgencyHelper() { + if [ "$mentioned" == "1" ] + then + echo "$1" + else + if [ "$mentioned" == "2" ] + then + echo "$2" + else + echo "Error: mentioned value '$mentioned' unexpected" > /dev/stderr + exit 1 + fi + fi +} + +getUrgency() { + # We are using arguments as a poor man's bash array for portability + # shellcheck disable=SC2086 + getUrgencyHelper $notify_URGENCIES +} + +urgency=$(getUrgency) + +printf -v NOW '%(%Y-%m-%d %H:%M:%S)T' -1 + +echo "$NOW: $@" >> ~/.matterhon_notifications + +if [[ "$message" == *":clockify:"* ]]; then + echo "$NOW: $@" >> ~/.matterhon_clockify + exit +fi + +if [ ! -z "$urgency" ] +then + test "$urgency" = "none" || + terminal-notifier -subtitle "$notify_HEAD:" -title "Matterhorn" -message "$notify_BODY" +fi diff --git a/matterhorn_open.sh b/matterhorn_open.sh new file mode 100755 index 0000000..16e81ec --- /dev/null +++ b/matterhorn_open.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# +echo "Command and arguments: $0 $@" >> ~/debug.log + +# Check if there is exactly one argument +if [ $# -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +url="$1" + +# Define domains to be ignored +ignore_domains=("tel.meet" "another.domain") + +# Define domains to be opened with Google Chrome +chrome_domains=("google" "figma") + +# Extract the domain from the URL +domain=$(echo $url | awk -F/ '{print $3}') + +# Check if the domain is in the ignore list +for ignore_domain in "${ignore_domains[@]}"; do + if [[ "$domain" == *"$ignore_domain"* ]]; then + exit + fi +done + +# Check if the domain is in the Chrome list +for chrome_domain in "${chrome_domains[@]}"; do + if [[ "$domain" == *"$chrome_domain"* ]]; then + /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --profile-directory="Profile 1" "$url" + exit + fi +done + +# If it's not in either list, execute the 'open' command +open "$url" \ No newline at end of file diff --git a/vim/.nvimrc b/vim/.nvimrc index ac8d3b6..b4cb029 100644 --- a/vim/.nvimrc +++ b/vim/.nvimrc @@ -1,5 +1,8 @@ " vim: set sw=4 ts=4 sts=4 et tw=78 foldmarker={,} foldlevel=0 foldmethod=marker spell: -language en_US + +if !exists("g:gui_vimr") + language en_US +endif let g:python2_host_prog = '/usr/local/bin/python' let g:python3_host_prog = '/usr/local/bin/python3' @@ -42,9 +45,9 @@ Plug 'junegunn/vim-easy-align' Plug 'airblade/vim-gitgutter' Plug 'onsails/Lspkind-nvim' -Plug 'glepnir/galaxyline.nvim', has('gui_vimr') ? { 'on': []} : {'branch': 'main'} -Plug 'kyazdani42/nvim-web-devicons', has('gui_vimr') ? { 'on': []} : {'branch': 'master'} " lua -Plug 'ryanoasis/vim-devicons', has('gui_vimr') ? { 'on': []} : {'branch': 'master'} " vimscript +Plug 'glepnir/galaxyline.nvim', {'branch': 'main'} +Plug 'kyazdani42/nvim-web-devicons', {'branch': 'master'} " lua +Plug 'ryanoasis/vim-devicons', {'branch': 'master'} " vimscript call plug#end() " } @@ -305,10 +308,9 @@ nmap ga (EasyAlign) " " " Load lua config -"lua require('lspkind') -"if !has("gui_vimr") - "lua require('statusline') -"endif +lua require('lspkind') + +lua require('statusline') set ic " allows search to be case insensitive until a upper case appear set smartcase " allows search to be case insensitive until a upper case appear @@ -432,3 +434,11 @@ augroup git_commit_config au FileType gitcommit let g:editorconfig = v:false augroup END " } +" +" Configure markdown { +augroup markdown_config + au! + " The important one is guifg + au FileType markdown hi SpellBad cterm=underline gui=underline guisp=#fb5e2a guifg=#E12222 +augroup END +" }