diff --git a/kitty/.config/kitty/kitty.conf b/kitty/.config/kitty/kitty.conf index 715df8b61..0ef9825a5 100644 --- a/kitty/.config/kitty/kitty.conf +++ b/kitty/.config/kitty/kitty.conf @@ -18,10 +18,10 @@ # You can get a list of full family names available on your computer by running # kitty list-fonts # The default values shown below rely on your OS to choose an appropriate monospace font family. -font_family Iosevka Term Medium -italic_font Iosevka Term Medium Italic -bold_font Iosevka Term Bold -bold_italic_font Iosevka Term Bold Italic +font_family Iosevka Nerd Font Medium +italic_font Iosevka Nerd Font Medium Italic +bold_font Iosevka Nerd Font Bold +bold_italic_font Iosevka Nerd Font Bold Italic # Font size (in pts) font_size 12.0 diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index ce4a936c7..1fa707388 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -187,15 +187,17 @@ setw -g window-status-current-style bg=default,fg=colour004 # show session name, window & pane number, date and time on left side of # status bar +set -g status-left-length 70 set -g status-left "#[fg=colour237]#{?client_prefix,#[fg=colour202],#[fg=colour245]}#S #[fg=colour237] " # show default node version, battery status, wifi name & date time status_prefix="#{?client_prefix,#[fg=colour202]#(echo $(tmux show-option -gqv prefix | tr \"[:lower:]\" \"[:upper:]\" | sed 's/C-/\^/')) #[fg=colour237]• ,}" status_node_version='#[fg=colour237]#[fg=#649C62]#(node -v) #[fg=colour237]• ' -status_battery='#(battery -t -p) #[fg=colour237]• ' -status_wifi="#[fg=colour237]#[fg=colour243]#(~/.dotfiles/tmux/scripts/tmux-wifi) #[fg=colour237]• " -status_date_time="#[fg=colour237]#[fg=colour243]%A, %d %b %Y %H:%M#[fg=colour237]" -status_github="#[fg=colour243]#(~/.dotfiles/tmux/scripts/tmux-github-status) #[fg=colour237]• " +status_battery='#(battery -t -p -i -c " ") #[fg=colour237]• ' +status_wifi="#[fg=colour237]#[fg=colour243]#(~/.dotfiles/tmux/scripts/tmux-wifi)" +# for some reason that extra space at the end prevents the date from overlaping & makes it play nice with Nerd Fonts +status_date_time="#[fg=colour237]#[fg=colour243]%A, %d %b %Y %H:%M#[fg=colour237] " +status_github="#(~/.dotfiles/tmux/scripts/tmux-github-status)" status_prayer_times="#[fg=colour243]#(~/.dotfiles/tmux/scripts/tmux-next-prayer) #[fg=colour237]• " set -g status-right-length 300 diff --git a/tmux/scripts/tmux-github-status b/tmux/scripts/tmux-github-status index 27ee067d7..670d62c59 100755 --- a/tmux/scripts/tmux-github-status +++ b/tmux/scripts/tmux-github-status @@ -1,17 +1,33 @@ #!/bin/bash GITHUB_STATUS=$(curl -sS https://status.github.com/api/status.json | jq -r '.status') -case $GITHUB_STATUS in - ma*) - SIGNAL="#[fg=red]⨉" - ;; - mi*) - SIGNAL="#[fg=yellow]~" - ;; - *) - SIGNAL="✓" - ;; -esac +if [ -n "$NERD_FONTS" ]; then + INDICATIOR=" #[fg=colour237]• " + case $GITHUB_STATUS in + ma*) + STATUS="#[fg=red]$INDICATIOR" + ;; + mi*) + STATUS="#[fg=yellow]$INDICATIOR" + ;; + *) + STATUS="" + ;; + esac +else + INDICATIOR=" #[fg=colour237]• " + case $GITHUB_STATUS in + ma*) + STATUS="#[fg=red]⨉$INDICATOR" + ;; + mi*) + STATUS="#[fg=yellow]~$INDICATIOR" + ;; + *) + STATUS="" + ;; + esac +fi -echo "$SIGNAL" +echo "$STATUS" diff --git a/tmux/scripts/tmux-wifi b/tmux/scripts/tmux-wifi index 65f4f32d4..a0a736a79 100755 --- a/tmux/scripts/tmux-wifi +++ b/tmux/scripts/tmux-wifi @@ -2,4 +2,12 @@ TMUX_WIFI=$(/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | awk -F': ' '/ SSID/{print $2}') -[[ -n $TMUX_WIFI ]] && echo "$TMUX_WIFI" || echo '#[fg=red]⨉#[fg=colour237]' +ON_ICON="" +OFF_ICON'⨉' +TAIL="#[fg=colour237] • " + +if [ -n "$NERD_FONTS" ]; then + [ -n "$TMUX_WIFI" ] && ON_ICON="直 " || echo '睊' +fi + +[ -n "$TMUX_WIFI" ] && echo "$ON_ICON$TMUX_WIFI$TAIL" || echo "#[fg=red]$OFF_ICON$TAIL" diff --git a/vim/.vim/after/plugin/ale.vim b/vim/.vim/after/plugin/ale.vim index 509f2fc03..b309907e6 100644 --- a/vim/.vim/after/plugin/ale.vim +++ b/vim/.vim/after/plugin/ale.vim @@ -7,9 +7,9 @@ endif let g:ale_fix_on_save = 1 let g:ale_set_loclist = 0 let g:ale_set_quickfix = 1 -let g:ale_sign_error = '⨉' +let g:ale_sign_error = functions#GetIcon('linter_error') let g:ale_sign_warning = g:ale_sign_error -let g:ale_sign_style_error = '●' +let g:ale_sign_style_error = functions#GetIcon('linter_style') let g:ale_sign_style_warning = g:ale_sign_error let g:ale_statusline_format = ['E•%d', 'W•%d', 'OK'] let g:ale_echo_msg_format = '[%linter%] %code% %s' diff --git a/vim/.vim/autoload/functions.vim b/vim/.vim/autoload/functions.vim index 55f02e001..b886e4403 100644 --- a/vim/.vim/autoload/functions.vim +++ b/vim/.vim/autoload/functions.vim @@ -220,3 +220,26 @@ function! functions#move_down() abort range call s:Move("'>+1", l:at_bottom) endfunction +function! functions#GetIcon(key) abort + let l:NERD_FONT_ICONS = { + \'vim': [' ', '%y'], + \'javascript': [' ', '%y'], + \'javascript.jsx': [' ', '%y'], + \'clojure': [' ', '%y'], + \'clojurescript': [' ', '%y'], + \'rust': [' ', '%y'], + \'ruby': [' ', '%y'], + \'python': [' ', '%y'], + \'markdown': [' ', '%y'], + \'paste': [' ', '⍴'], + \'spell': [' ', '✎'], + \'branch': [' ', ' '], + \'linter_error': [' ', '⨉'], + \'linter_style': [' ', '●'], + \'lock': [' ', ' '], + \} + + let l:icons = get(l:NERD_FONT_ICONS, a:key, []) + return has_key(l:NERD_FONT_ICONS, a:key) ? !empty($NERD_FONTS) ? l:icons[0] : l:icons[1] : a:key +endfunction + diff --git a/vim/.vim/autoload/statusline.vim b/vim/.vim/autoload/statusline.vim index 3ec30a9ec..06bb81327 100644 --- a/vim/.vim/autoload/statusline.vim +++ b/vim/.vim/autoload/statusline.vim @@ -11,8 +11,8 @@ function! statusline#LinterStatus() abort return '' endif - let l:error_symbol = '⨉' - let l:style_symbol = '●' + let l:error_symbol = functions#GetIcon('linter_error') + let l:style_symbol = functions#GetIcon('linter_style') let l:counts = ale#statusline#Count(bufnr('')) let l:ale_linter_status = '' @@ -68,18 +68,18 @@ function! statusline#gitInfo() abort let l:out = fugitive#head(10) if !empty(l:out) || !empty(expand('%')) - let l:out = ' ' . l:out + let l:out = functions#GetIcon('branch') . l:out endif return l:out endfunction function! statusline#readOnly() abort if !&modifiable && &readonly - return ' RO' + return functions#GetIcon('lock') . ' RO' elseif &modifiable && &readonly return 'RO' elseif !&modifiable && !&readonly - return '' + return functions#GetIcon('lock') else return '' endif @@ -114,7 +114,7 @@ endfunction " DEFINE MODE DICTIONARY let s:dictmode= { - \ 'n': ['N.', '4'], + \ 'n': ['', '4'], \ 'no': ['N-Operator Pending', '4'], \ 'v': ['V.', '6'], \ 'V': ['V·Line', '6'], diff --git a/vim/.vim/plugin/statusline.vim b/vim/.vim/plugin/statusline.vim index 53752df95..ed04580da 100644 --- a/vim/.vim/plugin/statusline.vim +++ b/vim/.vim/plugin/statusline.vim @@ -3,23 +3,17 @@ scriptencoding utf-8 "------------------------------------------------------------------------------ " STATUS LINE CUSTOMIZATION "------------------------------------------------------------------------------ + function! StatusLine(mode) abort let l:line='' - if &filetype ==# 'help' - let l:line.=' %#StatusLineNC# [Help] %f ' + if &filetype ==# 'help' || &filetype ==# 'man' + let l:line.=' %#StatusLineNC# ['. &filetype .'] %f ' let l:line.=statusline#showHighligh() return l:line endif if a:mode ==# 'active' - let l:line.=' %{statusline#getMode()} %*' - if &paste - let l:line.='%#ErrorMsg#%{" ⍴ "}%*' - endif - if &spell - let l:line='%#WarningMsg#%{" ✎ "}%*' - endif let l:line.='%6*%{statusline#gitInfo()}' let l:line.=statusline#GetHunks() let l:line.='%<' @@ -33,8 +27,15 @@ function! StatusLine(mode) abort let l:line.=statusline#showHighligh() + let l:line.='%{statusline#getMode()} %*' + if &paste + let l:line.='%#ErrorMsg#%{" '. functions#GetIcon('paste') .' "}%*' + endif + if &spell + let l:line.='%#WarningMsg#%{" '. functions#GetIcon('spell') .' "}%*' + endif let l:line.=statusline#LinterStatus() - let l:line.='%4* %y' + let l:line.='%4* '. functions#GetIcon(&filetype) if &fileformat !=# 'unix' let l:line.='%4* %{&ff}%*' endif diff --git a/zsh/.zshenv b/zsh/.zshenv index 4c76d8bfc..175cd7c37 100644 --- a/zsh/.zshenv +++ b/zsh/.zshenv @@ -4,6 +4,7 @@ export XDG_CONFIG_HOME="$HOME/.config" export DOTFILES=$HOME/.dotfiles export ZDOTDIR=${DOTFILES:-"$HOME/.dotfiles"}/zsh export GOPATH="${HOME}/.go" +export NERD_FONTS=true [[ -x /usr/local/bin/brew ]] && export HOMEBREW_ROOT=$(/usr/local/bin/brew --prefix) diff --git a/zsh/.zshrc b/zsh/.zshrc index f8592c8e8..6ed1a00e8 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -97,6 +97,7 @@ SYMBOLS=( # Arrays in zsh starts from 1 export PURE_PROMPT_SYMBOL="${SYMBOLS[$RANDOM % ${#SYMBOLS[@]} + 1]}" +export PURE_GIT_BRANCH=" " ############################################################## # Python