diff --git a/.config/fish/config.fish b/.config/fish/config.fish index 586f154..9c801fb 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -2,7 +2,7 @@ set EDITOR vim # Virtualenv support with virtualfish -eval (python -m virtualfish compat_aliases) +eval (python3 -m virtualfish compat_aliases) # Theme options for bobthefish set -g theme_nerd_fonts yes @@ -18,6 +18,10 @@ set -x VIRTUAL_ENV_DISABLE_PROMPT 1 set -U grcplugin_ls --color # PATH +## If the 'user base' binary directory exists, add it to PATH +if test -x ~/.local/bin + set PATH $PATH ~/.local/bin +end if test -x ~/.dot/dotfiles/bin set PATH $PATH ~/.dot/dotfiles/bin end @@ -62,6 +66,7 @@ alias gd "git diff" alias gst "git status" alias ga "git add -A" alias gl "git log" +alias gls "git shortlog --summary" alias gt 'git tag|less' #alias gad 'git log --pretty='"'"'%at'"'"' | while read d; do date -d "@$d"; done | awk '"'"'{print $1}'"'"' | sort | uniq -c' @@ -83,7 +88,7 @@ function grepl end ## Various -alias tmux 'tmux -2' +#alias tmux 'tmux -2' alias tmux_reload "tmux source-file ~/.tmux.conf" alias tmux_takeover "tmux detach -a" diff --git a/.tmux.conf b/.tmux.conf index b1b9d50..880c575 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -3,6 +3,8 @@ set -g bell-action any # Default termtype. If the rcfile sets $TERM, that overrides this value. set -g default-terminal tmux-256color-italic +#set -g terminal-overrides ',tmux-256color-italic:Tc' +set -ga terminal-overrides ',*256col*:Tc' # Keep your finger on ctrl, or don't bind-key ^D detach-client @@ -123,3 +125,6 @@ bind - \ # Local config if-shell "[ -f ~/.tmux.conf.user ]" 'source ~/.tmux.conf.user' + +# reload config with leader-r +bind r source-file ~/.tmux.conf \; display-message "Config reloaded..." diff --git a/.vim/spell/nl.utf-8.add b/.vim/spell/nl.utf-8.add index bf63481..5fe6fda 100644 --- a/.vim/spell/nl.utf-8.add +++ b/.vim/spell/nl.utf-8.add @@ -71,3 +71,26 @@ varkenshaassaté sajoerboontjes zonneluifel stellingkast +Hoenderloo +Garmin +Termux +varkenssaté +e-reader +tomatenplant +macarons +bijgekletst +bijgekletst +scoutingterrein +geskipt +runderstoofpot +runderlende +gravelpad +eh +dagteller +proscuitto +zostraks +fusilli +knieschotten +speciaalbiertje +roomyoghurt +badolie diff --git a/.vim/spell/nl.utf-8.add.spl b/.vim/spell/nl.utf-8.add.spl index 887ed30..02afe4f 100644 Binary files a/.vim/spell/nl.utf-8.add.spl and b/.vim/spell/nl.utf-8.add.spl differ diff --git a/.vim/syntax/todo.vim b/.vim/syntax/todo.vim index d911365..001016b 100644 --- a/.vim/syntax/todo.vim +++ b/.vim/syntax/todo.vim @@ -53,10 +53,10 @@ highlight link todoOperator Operator " Task statuses -syntax match note "\v^n .*$" -syntax match note "\v n .*$" -syntax match note "\v .*$" -highlight note ctermfg=Grey guifg=#eeeeee +syntax match todoNote "\v^n .*$" nextgroup=todoNote +syntax match todoNote "\v n .*$" nextgroup=todoNote +syntax match todoNote "\v .*$" nextgroup=todoNote +highlight todoNote ctermfg=Grey guifg=#eeeeee syntax match todoStatusDone "\v^v " nextgroup=todoItem skipwhite syntax match todoStatusDone "\v v " nextgroup=todoItem skipwhite @@ -75,13 +75,13 @@ syntax match todoStatusTest "\v t " nextgroup=todoItem skipwhite highlight todoStatusTest ctermfg=darkcyan guifg=#6666ff syntax match todoStatusTodo "\v^- " nextgroup=todoItem skipwhite -syntax match todoStatusTodo "\v - " nextgroup=todoItem skipwhite +syntax match todoStatusTodo "\v .*- " nextgroup=todoItem skipwhite highlight todoStatusTodo ctermfg=red guifg=#ff0000 -syntax match todoStatusImportant "\v^\> .*$" -syntax match todoStatusImportant "\v \> .*$" -syntax match todoStatusImportant "\v^! .*$" -syntax match todoStatusImportant "\v ! .*$" +syntax match todoStatusImportant "\v^\> .*$" nextgroup=todoItem skipwhite +syntax match todoStatusImportant "\v \> .*$" nextgroup=todoItem skipwhite +syntax match todoStatusImportant "\v^! .*$" nextgroup=todoItem skipwhite +syntax match todoStatusImportant "\v ! .*$" nextgroup=todoItem skipwhite "highlight todoStatusImportant ctermfg=131 guifg=#af5f5f highlight todoStatusImportant ctermfg=167 guifg=#d75f5f @@ -93,14 +93,16 @@ highlight todoStatusQuestion ctermfg=darkcyan guifg=#6666ff "syntax match brack /[\[\]]/ | hi brack ctermfg=DarkMagenta syntax match timeslot "\v\[.*-.*\] " nextgroup=todoItem skipwhite -highlight timeslot ctermfg=Magenta +highlight timeslot ctermfg=Magenta guifg=#d700af " A todoItem has a subject (e.g., a word that's followed by a ':') -syn match todoItem '\i\+:' contained -hi todoItem ctermfg=Blue +syn match todoItem '[a-zA-Z0-9\-_]\+:' contained +hi todoItem ctermfg=Blue guifg=#87d7ff highlight link todoStatusDone PreProc highlight link todoStatusDoing PreProc +highlight link todoStatusCancelled PreProc +highlight link todoStatusTest PreProc highlight link todoStatusTodo PreProc highlight link todoStatusImportant PreProc highlight link todoStatusQuestion PreProc diff --git a/.vimrc b/.vimrc index 444e3d3..9788991 100644 --- a/.vimrc +++ b/.vimrc @@ -11,7 +11,8 @@ set encoding=utf-8 " change the key from \ to , let mapleader="," -" Vundle manages the plugins + +" == Vundle manages the plugins ================================================ " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() @@ -19,7 +20,7 @@ call vundle#begin() " let Vundle manage Vundle, required Plugin 'VundleVim/Vundle.vim' -" == UI ====== +" == Window chrome ============================================================= " Display tags of the current file ordered by scope " You need ctags: `sudo apt-get install exuberant-ctags` or @@ -41,6 +42,7 @@ Plugin 'bling/vim-bufferline' " Version control notes in the line number bar Plugin 'mhinz/vim-signify' + " Git wrapper Plugin 'tpope/vim-fugitive' " fugitive git bindings @@ -61,11 +63,23 @@ nnoremap go :Git checkout nnoremap gps :Dispatch! git push nnoremap gpl :Dispatch! git pull + +" Better matching of code pairs +"Plugin 'andymass/vim-matchup' +" Deferred highlighting improves cursor movement performance +"let g:matchup_matchparen_deferred = 1 + + " Think of sensible.vim as one step above 'nocompatible' mode: a universal " set of defaults that (hopefully) everyone can agree on. Plugin 'tpope/vim-sensible' " Nice colour scheme -Plugin 'jnurmine/Zenburn.git' +"Plugin 'jnurmine/Zenburn' +Plugin 'fenetikm/falcon' +"Plugin 'phanviet/vim-monokai-pro' +"Plugin 'dracula/vim' +"Plugin 'sonph/onehalf' +"Plugin 'jacoborus/tender.vim' " Quick file system tree, mapped to Ctrl+n for quick toggle Plugin 'scrooloose/nerdtree' map :NERDTreeToggle @@ -74,6 +88,17 @@ let NERDTreeIgnore = ['\.pyc$', 'tags'] autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif +if has('patch-8.0-1364') + " Easily change position of windows + " Requires vim 8.0.1364 or neovim (exact version uncertain). + "gh: soft move left + "gj: soft move down + "gk: soft move up + "gl: soft move right + Plugin 'andymass/vim-tradewinds' +endif + + " Rooter changes the working directory to the project root when you open a " file or directory. Useful when using fzf for example. Plugin 'airblade/vim-rooter' @@ -155,8 +180,15 @@ Plugin 'ryanoasis/vim-devicons' " Set guifont when using gvim: "set guifont=Droid\ Sans\ Mono\ for\ Powerline\ Plus\ Nerd\ File\ Types\ 11 +" +" undotree.vim : Display your undo history in a graph. +Plugin 'mbbill/undotree' +nnoremap u :UndotreeToggle +let g:undotree_SetFocusWhenToggle=1 " if undotree is opened, it is likely one + " wants to interact with it. -" == Content convenience ====== + +" == Content convenience ======================================================= " transparent editing of gpg encrypted files. The filename must have a .gpg, " .pgp or .asc suffix. @@ -243,42 +275,10 @@ let g:ycm_server_python_interpreter = '/usr/bin/python3' "let g:ycm_server_log_level = 'debug' endif + " Improved Django handling Plugin 'tweekmonster/django-plus.vim' -" Code checker. For python, install flake8 or pylint, preferably in the -" virtualenv. For Django support, install pylint-django -"Disabled, using ALE instead (see below); the settings here are not needed -"Plugin 'vim-syntastic/syntastic' -set statusline+=%#warningmsg# -set statusline+=%{SyntasticStatuslineFlag()} -set statusline+=%* - -let g:syntastic_always_populate_loc_list = 1 -let g:syntastic_auto_loc_list = 1 -let g:syntastic_check_on_open = 0 -let g:syntastic_check_on_wq = 0 - -let g:syntastic_error_symbol = '✗' -let g:syntastic_warning_symbol = '⚠' - -"let g:syntastic_python_checkers = ['pylint'] -"let g:syntastic_python_checkers = ['pylint', 'flake8', 'pyflakes'] - -" No silly 80-char line limit. Sorry pep-8. Also, Django support. Disable 'invalid name', 'missing docstring' -"let g:syntastic_python_pylint_post_args="--max-line-length=120 --load-plugins pylint_django -d C0103,C0111" -let g:syntastic_python_pylint_post_args="--max-line-length=120 -d C0103,C0111" - -" Use the virtualenv's Python interpreter -"if $VIRTUAL_ENV != '' -" let g:syntastic_python_python_exec = '$VIRTUAL_ENV/bin/python' -"endif - -"let g:syntastic_python_checkers=['pylint'] -"let g:syntastic_python_python_exec = 'python' -"let g:syntastic_python_pylint_exe = 'python -m pylint' -"let g:syntastic_python_pylint_exe = 'python $(which pylint)' - " Code checker. For python, install flake8 or pylint, preferably in the " virtualenv. For Django support, install pylint-django @@ -320,6 +320,8 @@ if v:version >= 704 endif +" == Writing prose ============================================================= + " Distraction-free writing, start with V (\V or ,V in this config) Plugin 'junegunn/goyo.vim' let g:goyo_width = 120 @@ -344,12 +346,6 @@ let g:pencil#wrapModeDefault = 'soft' " default is 'hard' nmap V :Goyo :Limelight!! :TogglePencil -" undotree.vim : Display your undo history in a graph. -Plugin 'mbbill/undotree' -nnoremap u :UndotreeToggle -let g:undotree_SetFocusWhenToggle=1 " if undotree is opened, it is likely one - " wants to interact with it. - " The NERD Commenter: A plugin that allows for easy commenting of code for " many filetypes. Plugin 'scrooloose/nerdcommenter' @@ -389,9 +385,12 @@ set statusline+=%{gutentags#statusline()} let g:gutentags_ctags_exclude = ["*.min.*", "build", ".bundle", ".git", "log", "node_modules", "tmp", "vendor", "*.vim/bundle/*"] "let g:gutentags_trace = 1 + " All of your Plugins must be added before the following line call vundle#end() " required filetype plugin indent on " required +" == End of plugins ============================================================ + "filetype plugin on @@ -441,14 +440,26 @@ set cryptmethod=blowfish2 " Ensure 256 colour support if the terminal supports it if &term == "xterm" || &term == "xterm-256color" || &term == "screen-bce" || &term == "screen-256color" || &term == "screen" || &term == "tmux-256color-italic" - set t_Co=256 - colorscheme zenburn + "colorscheme zenburn + colorscheme falcon + "colorscheme monokai_pro + "colorscheme dracula + "colorscheme onehalfdark + "colorscheme tender " create a bar for airline set laststatus=2 let g:airline_powerline_fonts = 1 endif +" This is what sets vim to use 24-bit colors. It will also work for any version of neovim +" newer than 0.1.4. +if exists('+termguicolors') + let &t_8f = "\[38;2;%lu;%lu;%lum" + let &t_8b = "\[48;2;%lu;%lu;%lum" + set termguicolors +endif + " Toggle paste and autoindent mode (enable paste so no indention weirdness " happens when pasting into the current file) set pastetoggle= diff --git a/bin/font_update b/bin/font_update index 8bbedb1..6282507 100755 --- a/bin/font_update +++ b/bin/font_update @@ -135,15 +135,12 @@ else while read -r FONT; do install_font "$SOURCE_DIR/$FONT" "$DEST_DIR/$FONT" done <<< "$FONTS_VARIOUS" - # Just to be sure, clear your font cache and restart Firefox if [ ! -e "${HOME}/.config/fontconfig" ]; then mkdir -p "${HOME}/.config/fontconfig" fi if [ ! -e "${HOME}/.config/fontconfig/fonts.conf" ]; then ln -s "${SOURCE_DIR}/fonts.conf" "${HOME}/.config/fontconfig/" fi - fc-cache -f -v - echo 'You might want to restart your browser' # Delete obsolete fonts while read -r FONT; do if [ -L "$DEST_DIR/$FONT" ]; then @@ -151,6 +148,9 @@ else rm "$DEST_DIR/$FONT" fi done <<< "$FONTS_DELETE" + # Just to be sure, clear and refresh your font cache and restart Firefox + fc-cache -f -v + echo 'You might want to restart your browser' else echo "$SOURCE_DIR not found, aborting" fi diff --git a/bin/testing/color-24bit.sh b/bin/testing/color-24bit.sh new file mode 100755 index 0000000..f407258 --- /dev/null +++ b/bin/testing/color-24bit.sh @@ -0,0 +1,100 @@ +#!/bin/bash +# This file was originally taken from iterm2 https://github.com/gnachman/iTerm2/blob/master/tests/24-bit-color.sh +# +# This file echoes a bunch of 24-bit color codes +# to the terminal to demonstrate its functionality. +# The foreground escape sequence is ^[38;2;;;m +# The background escape sequence is ^[48;2;;;m +# range from 0 to 255 inclusive. +# The escape sequence ^[0m returns output to default + +setBackgroundColor() +{ + #printf '\x1bPtmux;\x1b\x1b[48;2;%s;%s;%sm' $1 $2 $3 + printf '\x1b[48;2;%s;%s;%sm' $1 $2 $3 +} + +resetOutput() +{ + echo -en "\x1b[0m\n" +} + +# Gives a color $1/255 % along HSV +# Who knows what happens when $1 is outside 0-255 +# Echoes "$red $green $blue" where +# $red $green and $blue are integers +# ranging between 0 and 255 inclusive +rainbowColor() +{ + let h=$1/43 + let f=$1-43*$h + let t=$f*255/43 + let q=255-t + + if [ $h -eq 0 ] + then + echo "255 $t 0" + elif [ $h -eq 1 ] + then + echo "$q 255 0" + elif [ $h -eq 2 ] + then + echo "0 255 $t" + elif [ $h -eq 3 ] + then + echo "0 $q 255" + elif [ $h -eq 4 ] + then + echo "$t 0 255" + elif [ $h -eq 5 ] + then + echo "255 0 $q" + else + # execution should never reach here + echo "0 0 0" + fi +} + +for i in `seq 0 127`; do + setBackgroundColor $i 0 0 + echo -en " " +done +resetOutput +for i in `seq 255 -1 128`; do + setBackgroundColor $i 0 0 + echo -en " " +done +resetOutput + +for i in `seq 0 127`; do + setBackgroundColor 0 $i 0 + echo -n " " +done +resetOutput +for i in `seq 255 -1 128`; do + setBackgroundColor 0 $i 0 + echo -n " " +done +resetOutput + +for i in `seq 0 127`; do + setBackgroundColor 0 0 $i + echo -n " " +done +resetOutput +for i in `seq 255 -1 128`; do + setBackgroundColor 0 0 $i + echo -n " " +done +resetOutput + +for i in `seq 0 127`; do + setBackgroundColor `rainbowColor $i` + echo -n " " +done +resetOutput +for i in `seq 255 -1 128`; do + setBackgroundColor `rainbowColor $i` + echo -n " " +done +resetOutput diff --git a/bin/testing/color-spaces.pl b/bin/testing/color-spaces.pl new file mode 100755 index 0000000..8774c04 --- /dev/null +++ b/bin/testing/color-spaces.pl @@ -0,0 +1,67 @@ +#!/usr/bin/perl +# Author: Todd Larason +# $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.1 1999/07/11 08:49:54 dawes Exp $ + +print "256 color mode\n\n"; + +# display back ground colors + +for ($fgbg = 38; $fgbg <= 48; $fgbg +=10) { + +# first the system ones: +print "System colors:\n"; +for ($color = 0; $color < 8; $color++) { + print "\x1b[${fgbg};5;${color}m::"; +} +print "\x1b[0m\n"; +for ($color = 8; $color < 16; $color++) { + print "\x1b[${fgbg};5;${color}m::"; +} +print "\x1b[0m\n\n"; + +# now the color cube +print "Color cube, 6x6x6:\n"; +for ($green = 0; $green < 6; $green++) { + for ($red = 0; $red < 6; $red++) { + for ($blue = 0; $blue < 6; $blue++) { + $color = 16 + ($red * 36) + ($green * 6) + $blue; + print "\x1b[${fgbg};5;${color}m::"; + } + print "\x1b[0m "; + } + print "\n"; +} + +# now the grayscale ramp +print "Grayscale ramp:\n"; +for ($color = 232; $color < 256; $color++) { + print "\x1b[${fgbg};5;${color}m::"; +} +print "\x1b[0m\n\n"; + +} + +print "Examples for the 3-byte color mode\n\n"; + +for ($fgbg = 38; $fgbg <= 48; $fgbg +=10) { + +# now the color cube +print "Color cube\n"; +for ($green = 0; $green < 256; $green+=51) { + for ($red = 0; $red < 256; $red+=51) { + for ($blue = 0; $blue < 256; $blue+=51) { + print "\x1b[${fgbg};2;${red};${green};${blue}m::"; + } + print "\x1b[0m "; + } + print "\n"; +} + +# now the grayscale ramp +print "Grayscale ramp:\n"; +for ($gray = 8; $gray < 256; $gray+=10) { + print "\x1b[${fgbg};2;${gray};${gray};${gray}m::"; +} +print "\x1b[0m\n\n"; + +} diff --git a/bin/testing/color-zigzag.sh b/bin/testing/color-zigzag.sh new file mode 100755 index 0000000..be0700d --- /dev/null +++ b/bin/testing/color-zigzag.sh @@ -0,0 +1,14 @@ +#!/bin/bash +awk 'BEGIN{ + s="/\\/\\/\\/\\/\\"; s=s s s s s s s s s s s s s s s s s s s s s s s; + for (colnum = 0; colnum<256; colnum++) { + r = 255-(colnum*255/255); + g = (colnum*510/255); + b = (colnum*255/255); + if (g>255) g = 510-g; + printf "\033[48;2;%d;%d;%dm", r,g,b; + printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b; + printf "%s\033[0m", substr(s,colnum+1,1); + } + printf "\n"; +}'