aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Hovorka <[email protected]>2019-10-12 22:17:27 -0600
committerAdam Hovorka <[email protected]>2019-10-12 22:17:27 -0600
commitf0d8a2304e75c8c4c30afb18da5803e2ceddb122 (patch)
treeeb67abe060d42219417a1e4b0d8b7ef4b4bc88a2
parent7ebb6f05eecb2369dbc43e499cd4277f13e5c5c5 (diff)
Sync misc changes 20191012
-rw-r--r--base/vim/ftdetect/toml.vim2
-rw-r--r--base/vim/ftplugin/toml.vim21
-rw-r--r--base/vim/syntax/toml.vim72
-rw-r--r--base/vimrc25
-rw-r--r--base/zsh/aliases.zsh1
-rw-r--r--base/zsh/functions.zsh14
-rw-r--r--base/zsh/tipz.zsh11
7 files changed, 133 insertions, 13 deletions
diff --git a/base/vim/ftdetect/toml.vim b/base/vim/ftdetect/toml.vim
new file mode 100644
index 0000000..568dd82
--- /dev/null
+++ b/base/vim/ftdetect/toml.vim
@@ -0,0 +1,2 @@
+" Go dep and Rust use several TOML config files that are not named with .toml.
+autocmd BufNewFile,BufRead *.toml,Gopkg.lock,Cargo.lock,*/.cargo/config,*/.cargo/credentials,Pipfile setf toml
diff --git a/base/vim/ftplugin/toml.vim b/base/vim/ftplugin/toml.vim
new file mode 100644
index 0000000..9075e88
--- /dev/null
+++ b/base/vim/ftplugin/toml.vim
@@ -0,0 +1,21 @@
+" File: ftplugin/toml.vim
+" Author: Kevin Ballard <[email protected]>
+" Description: FileType Plugin for Toml
+" Last Change: Feb 12, 2019
+
+if exists('b:did_ftplugin')
+ finish
+endif
+let b:did_ftplugin = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+let b:undo_ftplugin = 'setlocal commentstring< comments<'
+
+setlocal commentstring=#\ %s
+setlocal comments=:#
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set et sw=4 ts=4:
diff --git a/base/vim/syntax/toml.vim b/base/vim/syntax/toml.vim
new file mode 100644
index 0000000..86f6b6f
--- /dev/null
+++ b/base/vim/syntax/toml.vim
@@ -0,0 +1,72 @@
+" Language: TOML
+" Maintainer: Caleb Spare <[email protected]>
+" URL: https://github.com/cespare/vim-toml
+" LICENSE: MIT
+
+if exists("b:current_syntax")
+ finish
+endif
+
+syn match tomlEscape /\\[btnfr"/\\]/ display contained
+syn match tomlEscape /\\u\x\{4}/ contained
+syn match tomlEscape /\\U\x\{8}/ contained
+hi def link tomlEscape SpecialChar
+
+syn match tomlLineEscape /\\$/ contained
+hi def link tomlLineEscape SpecialChar
+
+" Basic strings
+syn region tomlString oneline start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=tomlEscape
+" Multi-line basic strings
+syn region tomlString start=/"""/ end=/"""/ contains=tomlEscape,tomlLineEscape
+" Literal strings
+syn region tomlString oneline start=/'/ end=/'/
+" Multi-line literal strings
+syn region tomlString start=/'''/ end=/'''/
+hi def link tomlString String
+
+syn match tomlInteger /[+-]\=\<[1-9]\(_\=\d\)*\>/ display
+syn match tomlInteger /[+-]\=\<0\>/ display
+syn match tomlInteger /[+-]\=\<0x[[:xdigit:]]\(_\=[[:xdigit:]]\)*\>/ display
+syn match tomlInteger /[+-]\=\<0o[0-7]\(_\=[0-7]\)*\>/ display
+syn match tomlInteger /[+-]\=\<0b[01]\(_\=[01]\)*\>/ display
+syn match tomlInteger /[+-]\=\<\(inf\|nan\)\>/ display
+hi def link tomlInteger Number
+
+syn match tomlFloat /[+-]\=\<\d\(_\=\d\)*\.\d\+\>/ display
+syn match tomlFloat /[+-]\=\<\d\(_\=\d\)*\(\.\d\(_\=\d\)*\)\=[eE][+-]\=\d\(_\=\d\)*\>/ display
+hi def link tomlFloat Float
+
+syn match tomlBoolean /\<\%(true\|false\)\>/ display
+hi def link tomlBoolean Boolean
+
+" https://tools.ietf.org/html/rfc3339
+syn match tomlDate /\d\{4\}-\d\{2\}-\d\{2\}/ display
+syn match tomlDate /\d\{2\}:\d\{2\}:\d\{2\}\%(\.\d\+\)\?/ display
+syn match tomlDate /\d\{4\}-\d\{2\}-\d\{2\}[T ]\d\{2\}:\d\{2\}:\d\{2\}\%(\.\d\+\)\?\%(Z\|[+-]\d\{2\}:\d\{2\}\)\?/ display
+hi def link tomlDate Constant
+
+syn match tomlKey /\v(^|[{,])\s*\zs[[:alnum:]._-]+\ze\s*\=/ display
+hi def link tomlKey Identifier
+
+syn region tomlKeyDq oneline start=/\v(^|[{,])\s*\zs"/ end=/"\ze\s*=/ contains=tomlEscape
+hi def link tomlKeyDq Identifier
+
+syn region tomlKeySq oneline start=/\v(^|[{,])\s*\zs'/ end=/'\ze\s*=/
+hi def link tomlKeySq Identifier
+
+syn region tomlTable oneline start=/^\s*\[[^\[]/ end=/\]/ contains=tomlKey,tomlKeyDq,tomlKeySq
+hi def link tomlTable Title
+
+syn region tomlTableArray oneline start=/^\s*\[\[/ end=/\]\]/ contains=tomlKey,tomlKeyDq,tomlKeySq
+hi def link tomlTableArray Title
+
+syn keyword tomlTodo TODO FIXME XXX BUG contained
+hi def link tomlTodo Todo
+
+syn match tomlComment /#.*/ contains=@Spell,tomlTodo
+hi def link tomlComment Comment
+
+syn sync minlines=500
+
+let b:current_syntax = "toml"
diff --git a/base/vimrc b/base/vimrc
index f9cb456..ec55b97 100644
--- a/base/vimrc
+++ b/base/vimrc
@@ -99,18 +99,19 @@ set showcmd
set laststatus=2
set statusline=
"set statusline+=\ S%{strftime('%R',\ getftime(expand('%')))} " Time when last saved
-set statusline+=%1*\ %2*%<\ " Cut at start
-set statusline+=%3*%f " Path
-set statusline+=%{&modified?'\ +':''} " Modified
-set statusline+=%{&ro?'\ ':''} " Read only
-set statusline+=%{&paste?'\ P':''} " Paste mode
-"set statusline+=[%n%H%M%R%W]\ " flags and buf no
-set statusline+=\ %4*%=%3*\ " Section break
-set statusline+=%{&ff=='unix'?'':&ff\ } " Line ending
-set statusline+=%l\ %c\ %P\ " Line column percent
-set statusline+=%2*%1*%{StatusGitInfo()}\ " Git branch
-" ^Vue0b0
-
+set statusline+=%1*\ %2*%<\ " Cut at start
+set statusline+=%3*%f " Path
+set statusline+=%{&modified?'\ +':''} " Modified
+set statusline+=%{&ro?'\ ':''} " Read only
+set statusline+=%{&paste?'\ P':''} " Paste mode
+"set statusline+=[%n%H%M%R%W]\ " flags and buf no
+set statusline+=\ %4*%=%3*\ " Section break
+set statusline+=%{&ff=='unix'?'':toupper(&ff.'\ ')} " Line ending
+set statusline+=%l\ %c\ %P\ " Line column percent
+set statusline+=%2*%1*%{StatusGitInfo()}\ " Git branch
+"█ ^Vue0b0
+
+hi StatusLineNC ctermfg=020 ctermbg=019 cterm=NONE
hi User1 ctermfg=020 ctermbg=019
hi User2 ctermfg=019 ctermbg=018
hi User3 ctermfg=020 ctermbg=018
diff --git a/base/zsh/aliases.zsh b/base/zsh/aliases.zsh
index 7167d08..414cbbb 100644
--- a/base/zsh/aliases.zsh
+++ b/base/zsh/aliases.zsh
@@ -2,6 +2,7 @@
alias ls="ls --group-directories-first --color=auto"
alias less='less -R'
alias grep='grep --color=auto'
+alias gdb='gdb -q'
alias ..='cd ../'
alias sudoe="sudo -E"
diff --git a/base/zsh/functions.zsh b/base/zsh/functions.zsh
index 57f11d3..f1a54f5 100644
--- a/base/zsh/functions.zsh
+++ b/base/zsh/functions.zsh
@@ -17,7 +17,9 @@ function trash {
# 43 0 * * 3 find ~/.trash -mindepth 1 -mtime +90 -delete
wttr() {
- curl -q -H "Accept-Language: ${LANG%_*}" wttr.in/"${1:-Pleasant Grove}\?${2:-0q}"
+ curl -q -s --compressed -H "Accept-Language: ${LANG%_*}" \
+ "https://wttr.in/${1:-Pleasant Grove}?${2:-0q}"
+ # "format=%l%0A%c+%t+%w+%m"
}
hex() {
@@ -33,3 +35,13 @@ trc() {
ssh dhd.ahov.co ssh aristotle transmission-remote-cli
fi
}
+
+httpless() {
+ http --pretty=all --print=hb "$@" | less -R
+}
+
+colors() {
+ for i in `seq 0 21`; do
+ echo -ne "\e[48;5;${i}m ${i} "
+ done; echo -e "\e[0m"
+}
diff --git a/base/zsh/tipz.zsh b/base/zsh/tipz.zsh
index bb1e224..fdcc058 100644
--- a/base/zsh/tipz.zsh
+++ b/base/zsh/tipz.zsh
@@ -1,3 +1,12 @@
+_tipz_ignore_list=("run-help")
+
+function _tipz_contains() {
+ local e match="$1"
+ shift
+ for e; do [[ "$e" == "$match" ]] && return 0; done
+ return 1
+}
+
###
# Search the defined aliases for a match
###
@@ -18,6 +27,8 @@ function _tipz_find_match() {
alias=$bits[1]
command=$bits[2]
+ if _tipz_contains "$alias" "${_tipz_ignore_list[@]}"; then continue; fi
+
# Create a regex that finds an exact match for
# the current argument string
args="${(@)args[@]}"