Enable system tray in tint2

This commit is contained in:
natemaia 2019-03-03 15:25:39 -08:00
parent 5ebbd10bc8
commit de93e7d7c9
9 changed files with 602 additions and 540 deletions

View File

@ -1,52 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
<!-- <edit mode="assign" name="hinting" > -->
<!-- <bool>true</bool> -->
<!-- </edit> -->
<!-- <edit mode="assign" name="hintstyle" > -->
<!-- <const>hintslight</const> -->
<!-- </edit> -->
<!-- <edit mode="assign" name="rgba" > -->
<!-- <const>rgb</const> -->
<!-- </edit> -->
<edit mode="assign" name="antialias" >
<bool>true</bool>
</edit>
<!-- <edit mode="assign" name="lcdfilter"> -->
<!-- <const>lcddefault</const> -->
<!-- </edit> -->
</match>
<match target="font">
<!-- <edit mode="assign" name="hinting" > -->
<!-- <bool>true</bool> -->
<!-- </edit> -->
<!-- <edit mode="assign" name="hintstyle" > -->
<!-- <const>hintslight</const> -->
<!-- </edit> -->
<!-- <edit mode="assign" name="rgba" > -->
<!-- <const>rgb</const> -->
<!-- </edit> -->
<edit mode="assign" name="antialias" >
<bool>true</bool>
</edit>
<!-- <edit mode="assign" name="lcdfilter"> -->
<!-- <const>lcddefault</const> -->
<!-- </edit> -->
</match>
<alias>
<family>serif</family>
<prefer>
<family>DejaVu Serif</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>DejaVu Sans</family>
</prefer>
</alias>
<alias>
<family>sans</family>
<prefer>
<family>DejaVu Sans</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>DejaVu Sans Mono</family>
</prefer>
</alias>
<alias>
<family>mono</family>
<prefer>
<family>DejaVu Sans Mono</family>
</prefer>
</alias>
<alias>
<family>serif</family>
<prefer>
<family>DejaVu Serif</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>DejaVu Sans</family>
</prefer>
</alias>
<alias>
<family>sans</family>
<prefer>
<family>DejaVu Sans</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>DejaVu Sans Mono</family>
</prefer>
</alias>
<alias>
<family>mono</family>
<prefer>
<family>DejaVu Sans Mono</family>
</prefer>
</alias>
</fontconfig>

View File

@ -1,16 +1,15 @@
" ------------------- jinx ---------------------- "
" Written by Nathaniel Maia, December 2017 "
" ----------------------------------------------- "
" vim:fdm=marker
" ------------------- jinx ---------------------- "
" written by Nathaniel Maia, 2017 - 2019 "
" ----------------------------------------------- "
" ---------- Setup and Checks ----------- " {{{1
if exists('syntax_on')
if exists('syntax_on') " {{{2
highlight clear
syntax reset
endif
" Colors {{{1
" color definitions {{{2
" start with an empty color dictionary
let s:jinx = {}
@ -68,7 +67,7 @@ else " night
let s:jinx.commnt = ['#B9B9B9', 250, 7]
endif
function! <SID>HighLight(GRP, FG, BG, ATT) abort " {{{1
function! <SID>hlg(GRP, FG, BG, ATT) abort " {{{2
if a:FG !=# ''
let l:fg_col = get(s:jinx, a:FG)
let l:fg_true = l:fg_col[0]
@ -82,373 +81,374 @@ function! <SID>HighLight(GRP, FG, BG, ATT) abort " {{{1
if a:BG !=# ''
let l:bg_col = get(s:jinx, a:BG)
let l:bg_true = l:bg_col[0]
if $TERM =~? 'linux' || &t_Co < 256
if $TERM =~? 'linux' || &t_Co < 256
let l:bg_term = l:bg_col[2]
else
let l:bg_term = l:bg_col[1]
endif
exec 'highlight! '.a:GRP.' guibg='.l:bg_true.' ctermbg='.l:bg_term
endif
if a:ATT !=# '' && &t_Co >= 256
if a:ATT !=# ''
exec 'highlight! '.a:GRP.' gui='.a:ATT.' cterm='.a:ATT
endif
endfunction
" ---------- Highlight Groups ------------ " {{{1
" Editor {{{2
call <SID>HighLight('Title', 'commnt', 'bgr', 'bold')
call <SID>HighLight('Visual', '', 'select', '')
call <SID>HighLight('SignColumn', '', 'line', '')
call <SID>HighLight('CursorLine', '', 'line', '')
call <SID>HighLight('CursorColumn', '', 'line', '')
call <SID>HighLight('CursorLineNr', 'cyan', 'line', '')
call <SID>HighLight('LineNr', 'commnt', 'line', '')
call <SID>HighLight('ColorColumn', 'fgr', 'red', '')
call <SID>HighLight('Error', 'red', 'bgr', '')
call <SID>HighLight('ErrorMsg', 'red', 'bgr', '')
call <SID>HighLight('WarningMsg', 'red', 'bgr', '')
call <SID>HighLight('MatchParen', 'yellow', 'bgr', '')
call <SID>HighLight('ModeMsg', 'cyan', 'bgr', '')
call <SID>HighLight('MoreMsg', 'cyan', 'bgr', '')
call <SID>HighLight('Directory', 'blue', 'bgr', '')
call <SID>HighLight('Question', 'green', 'bgr', '')
call <SID>HighLight('NonText', 'commnt', 'bgr', '')
call <SID>HighLight('SpecialKey', 'commnt', 'bgr', '')
call <SID>HighLight('Folded', 'commnt', 'folded', '')
call <SID>HighLight('Search', 'bgr', 'blue', '')
call <SID>HighLight('HLNext', 'bgr', 'red', '')
call <SID>HighLight('Normal', 'fgr', 'bgr', '')
call <SID>HighLight('VertSplit', 'line', 'commnt', '')
call <SID>hlg('Title', 'commnt', 'bgr', 'bold')
call <SID>hlg('Visual', '', 'select', '')
call <SID>hlg('SignColumn', '', 'line', '')
call <SID>hlg('CursorLine', '', 'line', '')
call <SID>hlg('CursorColumn', '', 'line', '')
call <SID>hlg('CursorLineNr', 'cyan', 'line', '')
call <SID>hlg('LineNr', 'commnt', 'line', '')
call <SID>hlg('ColorColumn', 'fgr', 'red', '')
call <SID>hlg('Error', 'red', 'bgr', '')
call <SID>hlg('ErrorMsg', 'red', 'bgr', '')
call <SID>hlg('WarningMsg', 'red', 'bgr', '')
call <SID>hlg('MatchParen', 'yellow', 'bgr', '')
call <SID>hlg('ModeMsg', 'cyan', 'bgr', '')
call <SID>hlg('MoreMsg', 'cyan', 'bgr', '')
call <SID>hlg('Directory', 'blue', 'bgr', '')
call <SID>hlg('Question', 'green', 'bgr', '')
call <SID>hlg('NonText', 'commnt', 'bgr', '')
call <SID>hlg('SpecialKey', 'commnt', 'bgr', '')
call <SID>hlg('Folded', 'commnt', 'folded', '')
call <SID>hlg('Search', 'bgr', 'blue', '')
call <SID>hlg('HLNext', 'bgr', 'red', '')
call <SID>hlg('Normal', 'fgr', 'bgr', '')
call <SID>hlg('VertSplit', 'line', 'commnt', '')
" Tabline {{{2
call <SID>HighLight('TabLine', 'fgr', 'line', '')
call <SID>HighLight('TabLineFill', 'line', 'line', '')
call <SID>HighLight('TabLineSel', 'line', 'green', '')
call <SID>HighLight('WildMenu', 'bgr', 'fgr', '')
call <SID>HighLight('Pmenu', 'bgr', 'commnt', '')
call <SID>HighLight('PmenuSel', 'fgr', 'bgr', '')
call <SID>HighLight('PmenuSbar', 'commnt', 'line', '')
call <SID>HighLight('PmenuThumb', 'commnt', 'line', '')
call <SID>HighLight('StatusLine', 'line', 'fgr', '')
call <SID>HighLight('StatusLineNC', 'fgr', 'line', '')
call <SID>hlg('TabLine', 'fgr', 'line', '')
call <SID>hlg('TabLineFill', 'line', 'line', '')
call <SID>hlg('TabLineSel', 'line', 'green', '')
call <SID>hlg('WildMenu', 'bgr', 'fgr', '')
call <SID>hlg('Pmenu', 'bgr', 'commnt', '')
call <SID>hlg('PmenuSel', 'fgr', 'bgr', '')
call <SID>hlg('PmenuSbar', 'commnt', 'line', '')
call <SID>hlg('PmenuThumb', 'commnt', 'line', '')
call <SID>hlg('StatusLine', 'line', 'fgr', '')
call <SID>hlg('StatusLineNC', 'fgr', 'line', '')
" Spelling {{{2
call <SID>HighLight('SpellBad', '', '', 'underline')
call <SID>HighLight('SpellLocal', '', '', 'underline')
call <SID>HighLight('SpellRare', '', '', 'underline')
call <SID>hlg('SpellBad', '', '', 'underline')
call <SID>hlg('SpellLocal', '', '', 'underline')
call <SID>hlg('SpellRare', '', '', 'underline')
" ALE linter {{{2
call <SID>HighLight('ALEErrorSign', 'red', 'line', '')
call <SID>HighLight('ALEWarningSign', 'orange', 'line', '')
call <SID>HighLight('ALEError', 'red', '', 'underline')
call <SID>HighLight('ALEWarning', 'red', '', 'underline')
call <SID>HighLight('ALEStyleError', 'orange', '', 'underline')
call <SID>HighLight('ALEStyleWarning', 'orange', '', 'underline')
call <SID>hlg('ALEErrorSign', 'red', 'line', '')
call <SID>hlg('ALEWarningSign', 'orange', 'line', '')
call <SID>hlg('ALEError', 'red', '', 'underline')
call <SID>hlg('ALEWarning', 'red', '', 'underline')
call <SID>hlg('ALEStyleError', 'orange', '', 'underline')
call <SID>hlg('ALEStyleWarning', 'orange', '', 'underline')
" Generic {{{2
call <SID>HighLight('Comment', 'commnt', '', '')
call <SID>HighLight('Todo', 'red', '', '')
call <SID>HighLight('Exception', 'red', '', '')
call <SID>HighLight('Float', 'cyan', '', '')
call <SID>HighLight('Number', 'cyan', '', '')
call <SID>HighLight('Include', 'cyan', '', '')
call <SID>HighLight('Character', 'blue', '', '')
call <SID>HighLight('Operator', 'blue', '', '')
call <SID>HighLight('String', 'blue', '', '')
call <SID>HighLight('Label', 'green', '', '')
call <SID>HighLight('Repeat', 'purple', '', '')
call <SID>HighLight('Statement', 'green', '', '')
call <SID>HighLight('Conditional', 'green', '', '')
call <SID>HighLight('Boolean', 'green', '', '')
call <SID>HighLight('Keyword', 'green', '', '')
call <SID>HighLight('Macro', 'purple', '', '')
call <SID>HighLight('Define', 'purple', '', '')
call <SID>HighLight('Special', 'purple', '', '')
call <SID>HighLight('Tag', 'purple', '', '')
call <SID>HighLight('Type', 'purple', '', '')
call <SID>HighLight('TypeDef', 'purple', '', '')
call <SID>HighLight('Structure', 'purple', '', '')
call <SID>HighLight('StorageClass', 'purple', '', '')
call <SID>HighLight('PreProc', 'yellow', '', '')
call <SID>HighLight('Constant', 'yellow', '', '')
call <SID>HighLight('Identifier', 'yellow', '', '')
call <SID>HighLight('PreCondit', 'yellow', '', '')
call <SID>HighLight('Conceal', 'orange', '', '')
call <SID>HighLight('Function', 'orange', '', '')
call <SID>hlg('Comment', 'commnt', '', '')
call <SID>hlg('Todo', 'red', '', '')
call <SID>hlg('Exception', 'red', '', '')
call <SID>hlg('Float', 'cyan', '', '')
call <SID>hlg('Number', 'cyan', '', '')
call <SID>hlg('Include', 'cyan', '', '')
call <SID>hlg('Character', 'blue', '', '')
call <SID>hlg('Operator', 'blue', '', '')
call <SID>hlg('String', 'blue', '', '')
call <SID>hlg('Label', 'green', '', '')
call <SID>hlg('Repeat', 'purple', '', '')
call <SID>hlg('Statement', 'green', '', '')
call <SID>hlg('Conditional', 'green', '', '')
call <SID>hlg('Boolean', 'green', '', '')
call <SID>hlg('Keyword', 'green', '', '')
call <SID>hlg('Macro', 'purple', '', '')
call <SID>hlg('Define', 'purple', '', '')
call <SID>hlg('Special', 'purple', '', '')
call <SID>hlg('Tag', 'purple', '', '')
call <SID>hlg('Type', 'purple', '', '')
call <SID>hlg('TypeDef', 'purple', '', '')
call <SID>hlg('Structure', 'purple', '', '')
call <SID>hlg('StorageClass', 'purple', '', '')
call <SID>hlg('PreProc', 'yellow', '', '')
call <SID>hlg('Constant', 'yellow', '', '')
call <SID>hlg('Identifier', 'yellow', '', '')
call <SID>hlg('PreCondit', 'yellow', '', '')
call <SID>hlg('Conceal', 'orange', '', '')
call <SID>hlg('Function', 'orange', '', '')
" Vim {{{2
call <SID>HighLight('vimCommand', 'green', '', '')
call <SID>HighLight('vimVar', 'yellow', '', '')
call <SID>HighLight('vimGroup', 'yellow', '', '')
call <SID>HighLight('vimGroupName', 'yellow', '', '')
call <SID>HighLight('VimFunction', 'orange', '', '')
call <SID>HighLight('VimFunctionKey', 'orange', '', '')
call <SID>HighLight('vimMapModKey', 'purple', '', '')
call <SID>HighLight('vimBracket', 'purple', '', '')
call <SID>HighLight('vimOption', 'purple', '', '')
call <SID>HighLight('vimMapMod', 'purple', '', '')
call <SID>HighLight('vimNotation', 'purple', '', '')
call <SID>hlg('vimCommand', 'green', '', '')
call <SID>hlg('vimVar', 'yellow', '', '')
call <SID>hlg('vimGroup', 'yellow', '', '')
call <SID>hlg('vimGroupName', 'yellow', '', '')
call <SID>hlg('VimFunction', 'orange', '', '')
call <SID>hlg('VimFunctionKey', 'orange', '', '')
call <SID>hlg('vimMapModKey', 'purple', '', '')
call <SID>hlg('vimBracket', 'purple', '', '')
call <SID>hlg('vimOption', 'purple', '', '')
call <SID>hlg('vimMapMod', 'purple', '', '')
call <SID>hlg('vimNotation', 'purple', '', '')
" Shell {{{2
call <SID>HighLight('shSet', 'green', '', '')
call <SID>HighLight('shLoop', 'green', '', '')
call <SID>HighLight('shFor', 'yellow', '', '')
call <SID>HighLight('shTestOpr', 'blue', '', '')
call <SID>HighLight('shConstant', 'yellow', '', '')
call <SID>HighLight('shFunctionKey', 'orange', '', '')
call <SID>HighLight('shStatement', 'green', '', '')
call <SID>HighLight('shKeyword', 'purple', '', '')
call <SID>HighLight('zshStatement', 'green', '', '')
call <SID>HighLight('zshOption', 'purple', '', '')
call <SID>HighLight('zshParentheses', 'purple', '', '')
call <SID>HighLight('zshBrackets', 'purple', '', '')
call <SID>HighLight('zshRepeat', 'green', '', '')
call <SID>HighLight('zshRedir', 'fgr', '', '')
call <SID>HighLight('zshFunction', 'orange', '', '')
call <SID>HighLight('zshVariableDef', 'yellow', '', '')
call <SID>HighLight('zshVariable', 'yellow', '', '')
call <SID>HighLight('zshOperator', 'blue', '', '')
call <SID>HighLight('zshPreProc', 'commnt', '', '')
call <SID>hlg('shSet', 'green', '', '')
call <SID>hlg('shLoop', 'green', '', '')
call <SID>hlg('shFor', 'yellow', '', '')
call <SID>hlg('shTestOpr', 'blue', '', '')
call <SID>hlg('shConstant', 'yellow', '', '')
call <SID>hlg('shFunctionKey', 'orange', '', '')
call <SID>hlg('shStatement', 'green', '', '')
call <SID>hlg('shKeyword', 'purple', '', '')
call <SID>hlg('zshStatement', 'green', '', '')
call <SID>hlg('zshOption', 'purple', '', '')
call <SID>hlg('zshParentheses', 'purple', '', '')
call <SID>hlg('zshBrackets', 'purple', '', '')
call <SID>hlg('zshRepeat', 'green', '', '')
call <SID>hlg('zshRedir', 'fgr', '', '')
call <SID>hlg('zshFunction', 'orange', '', '')
call <SID>hlg('zshVariableDef', 'yellow', '', '')
call <SID>hlg('zshVariable', 'yellow', '', '')
call <SID>hlg('zshOperator', 'blue', '', '')
call <SID>hlg('zshPreProc', 'commnt', '', '')
" C {{{2
call <SID>HighLight('cConditional', 'green', '', '')
call <SID>HighLight('cRepeat', 'purple', '', '')
call <SID>HighLight('cStorageClass', 'purple', '', '')
call <SID>HighLight('cType', 'yellow', '', '')
call <SID>hlg('cConditional', 'green', '', '')
call <SID>hlg('cRepeat', 'purple', '', '')
call <SID>hlg('cStorageClass', 'purple', '', '')
call <SID>hlg('cType', 'yellow', '', '')
" PHP {{{2
call <SID>HighLight('phpMemberSelector', 'blue', '', '')
call <SID>HighLight('phpVarSelector', 'red', '', '')
call <SID>HighLight('phpConditional', 'green', '', '')
call <SID>HighLight('phpStatement', 'green', '', '')
call <SID>HighLight('phpKeyword', 'purple', '', '')
call <SID>HighLight('phpRepeat', 'purple', '', '')
call <SID>hlg('phpMemberSelector', 'blue', '', '')
call <SID>hlg('phpVarSelector', 'red', '', '')
call <SID>hlg('phpConditional', 'green', '', '')
call <SID>hlg('phpStatement', 'green', '', '')
call <SID>hlg('phpKeyword', 'purple', '', '')
call <SID>hlg('phpRepeat', 'purple', '', '')
" Ruby {{{2
call <SID>HighLight('rubyInclude', 'blue', '', '')
call <SID>HighLight('rubyAttribute', 'blue', '', '')
call <SID>HighLight('rubySymbol', 'green', '', '')
call <SID>HighLight('rubyStringDelimiter', 'green', '', '')
call <SID>HighLight('rubyRepeat', 'purple', '', '')
call <SID>HighLight('rubyControl', 'purple', '', '')
call <SID>HighLight('rubyConditional', 'purple', '', '')
call <SID>HighLight('rubyException', 'purple', '', '')
call <SID>HighLight('rubyCurlyBlock', 'orange', '', '')
call <SID>HighLight('rubyLocalVariableOrMethod', 'orange', '', '')
call <SID>HighLight('rubyInterpolationDelimiter', 'orange', '', '')
call <SID>HighLight('rubyAccess', 'yellow', '', '')
call <SID>HighLight('rubyConstant', 'yellow', '', '')
call <SID>hlg('rubyInclude', 'blue', '', '')
call <SID>hlg('rubyAttribute', 'blue', '', '')
call <SID>hlg('rubySymbol', 'green', '', '')
call <SID>hlg('rubyStringDelimiter', 'green', '', '')
call <SID>hlg('rubyRepeat', 'purple', '', '')
call <SID>hlg('rubyControl', 'purple', '', '')
call <SID>hlg('rubyConditional', 'purple', '', '')
call <SID>hlg('rubyException', 'purple', '', '')
call <SID>hlg('rubyCurlyBlock', 'orange', '', '')
call <SID>hlg('rubyLocalVariableOrMethod', 'orange', '', '')
call <SID>hlg('rubyInterpolationDelimiter', 'orange', '', '')
call <SID>hlg('rubyAccess', 'yellow', '', '')
call <SID>hlg('rubyConstant', 'yellow', '', '')
" Python {{{2
call <SID>HighLight('pythonRun', 'red', '', '')
call <SID>HighLight('pythonOperator', 'blue', '', '')
call <SID>HighLight('pythonClass', 'blue', '', '')
call <SID>HighLight('pythonClassParameters', 'purple', '', '')
call <SID>HighLight('pythonParam', 'purple', '', '')
call <SID>HighLight('pythonDecorator', 'blue', '', '')
call <SID>HighLight('pythonExClass', 'blue', '', '')
call <SID>HighLight('pythonException', 'blue', '', '')
call <SID>HighLight('pythonExceptions', 'blue', '', '')
call <SID>HighLight('pythonBrackets', 'blue', '', '')
call <SID>HighLight('pythonEscape', 'blue', '', '')
call <SID>HighLight('pythonImport', 'green', '', '')
call <SID>HighLight('pythonRepeat', 'green', '', '')
call <SID>HighLight('pythonCoding', 'green', '', '')
call <SID>HighLight('pythonInclude', 'green', '', '')
call <SID>HighLight('pythonPreCondit', 'green', '', '')
call <SID>HighLight('pythonStatement', 'green', '', '')
call <SID>HighLight('pythonConditional', 'green', '', '')
call <SID>HighLight('pythonDef', 'yellow', '', '')
call <SID>HighLight('pythonSelf', 'blue', '', '')
call <SID>HighLight('pythonBuiltinType', 'purple', '', '')
call <SID>HighLight('pythonBuiltin', 'purple', '', '')
call <SID>HighLight('pythonBuiltinObj', 'purple', '', '')
call <SID>HighLight('pythonBuiltinFunc', 'orange', '', '')
call <SID>HighLight('pythonDot', 'orange', '', '')
call <SID>HighLight('pythonLambda', 'orange', '', '')
call <SID>HighLight('pythonLambdaExpr', 'orange', '', '')
call <SID>HighLight('pythonFunction', 'orange', '', '')
call <SID>HighLight('pythonDottedName', 'orange', '', '')
call <SID>HighLight('pythonBuiltinObjs', 'orange', '', '')
call <SID>hlg('pythonRun', 'red', '', '')
call <SID>hlg('pythonOperator', 'blue', '', '')
call <SID>hlg('pythonClass', 'blue', '', '')
call <SID>hlg('pythonClassParameters', 'purple', '', '')
call <SID>hlg('pythonParam', 'purple', '', '')
call <SID>hlg('pythonDecorator', 'blue', '', '')
call <SID>hlg('pythonExClass', 'blue', '', '')
call <SID>hlg('pythonException', 'blue', '', '')
call <SID>hlg('pythonExceptions', 'blue', '', '')
call <SID>hlg('pythonBrackets', 'blue', '', '')
call <SID>hlg('pythonEscape', 'blue', '', '')
call <SID>hlg('pythonImport', 'green', '', '')
call <SID>hlg('pythonRepeat', 'green', '', '')
call <SID>hlg('pythonCoding', 'green', '', '')
call <SID>hlg('pythonInclude', 'green', '', '')
call <SID>hlg('pythonPreCondit', 'green', '', '')
call <SID>hlg('pythonStatement', 'green', '', '')
call <SID>hlg('pythonConditional', 'green', '', '')
call <SID>hlg('pythonDef', 'yellow', '', '')
call <SID>hlg('pythonSelf', 'blue', '', '')
call <SID>hlg('pythonBuiltinType', 'purple', '', '')
call <SID>hlg('pythonBuiltin', 'purple', '', '')
call <SID>hlg('pythonBuiltinObj', 'purple', '', '')
call <SID>hlg('pythonBuiltinFunc', 'orange', '', '')
call <SID>hlg('pythonDot', 'orange', '', '')
call <SID>hlg('pythonLambda', 'orange', '', '')
call <SID>hlg('pythonLambdaExpr', 'orange', '', '')
call <SID>hlg('pythonFunction', 'orange', '', '')
call <SID>hlg('pythonDottedName', 'orange', '', '')
call <SID>hlg('pythonBuiltinObjs', 'orange', '', '')
" LaTeX {{{2
call <SID>HighLight('texZone', 'red', '', 'none')
call <SID>HighLight('texStatement', 'blue', '', 'none')
call <SID>HighLight('texRefLabel', 'blue', '', 'none')
call <SID>HighLight('texRefZone', 'green', '', 'none')
call <SID>HighLight('texMath', 'orange', '', 'none')
call <SID>HighLight('texMathZoneX', 'orange', '', 'none')
call <SID>HighLight('texMathZoneA', 'orange', '', 'none')
call <SID>HighLight('texMathZoneB', 'orange', '', 'none')
call <SID>HighLight('texMathZoneC', 'orange', '', 'none')
call <SID>HighLight('texMathZoneD', 'orange', '', 'none')
call <SID>HighLight('texMathZoneE', 'orange', '', 'none')
call <SID>HighLight('texMathMatcher', 'orange', '', 'none')
call <SID>HighLight('texDelimiter', 'purple', '', 'none')
call <SID>HighLight('texComment', 'commnt', '', 'none')
call <SID>hlg('texZone', 'red', '', 'none')
call <SID>hlg('texStatement', 'blue', '', 'none')
call <SID>hlg('texRefLabel', 'blue', '', 'none')
call <SID>hlg('texRefZone', 'green', '', 'none')
call <SID>hlg('texMath', 'orange', '', 'none')
call <SID>hlg('texMathZoneX', 'orange', '', 'none')
call <SID>hlg('texMathZoneA', 'orange', '', 'none')
call <SID>hlg('texMathZoneB', 'orange', '', 'none')
call <SID>hlg('texMathZoneC', 'orange', '', 'none')
call <SID>hlg('texMathZoneD', 'orange', '', 'none')
call <SID>hlg('texMathZoneE', 'orange', '', 'none')
call <SID>hlg('texMathMatcher', 'orange', '', 'none')
call <SID>hlg('texDelimiter', 'purple', '', 'none')
call <SID>hlg('texComment', 'commnt', '', 'none')
" JavaScript {{{2
call <SID>HighLight('javaScriptNumber', 'cyan', '', '')
call <SID>HighLight('javascriptNull', 'red', '', '')
call <SID>HighLight('javascriptStatement', 'green', '', '')
call <SID>HighLight('javaScriptConditional', 'green', '', '')
call <SID>HighLight('javaScriptRepeat', 'purple', '', '')
call <SID>HighLight('javaScriptBraces', 'purple', '', '')
call <SID>HighLight('javascriptGlobal', 'yellow', '', '')
call <SID>HighLight('javaScriptFunction', 'orange', '', '')
call <SID>HighLight('javaScriptMember', 'orange', '', '')
call <SID>hlg('javaScriptNumber', 'cyan', '', '')
call <SID>hlg('javascriptNull', 'red', '', '')
call <SID>hlg('javascriptStatement', 'green', '', '')
call <SID>hlg('javaScriptConditional', 'green', '', '')
call <SID>hlg('javaScriptRepeat', 'purple', '', '')
call <SID>hlg('javaScriptBraces', 'purple', '', '')
call <SID>hlg('javascriptGlobal', 'yellow', '', '')
call <SID>hlg('javaScriptFunction', 'orange', '', '')
call <SID>hlg('javaScriptMember', 'orange', '', '')
" HTML {{{2
call <SID>HighLight('htmlTag', 'red', '', '')
call <SID>HighLight('htmlTagName', 'red', '', '')
call <SID>HighLight('htmlLink', 'blue', '', '')
call <SID>HighLight('htmlArg', 'green', '', '')
call <SID>HighLight('htmlScriptTag', 'purple', '', '')
call <SID>HighLight('htmlTitle', 'blue', '', '')
call <SID>HighLight('htmlH1', 'blue', '', '')
call <SID>HighLight('htmlH2', 'cyan', '', '')
call <SID>HighLight('htmlH3', 'cyan', '', '')
call <SID>HighLight('htmlH4', 'green', '', '')
call <SID>HighLight('htmlH5', 'green', '', '')
call <SID>hlg('htmlTag', 'red', '', '')
call <SID>hlg('htmlTagName', 'red', '', '')
call <SID>hlg('htmlLink', 'blue', '', '')
call <SID>hlg('htmlArg', 'green', '', '')
call <SID>hlg('htmlScriptTag', 'purple', '', '')
call <SID>hlg('htmlTitle', 'blue', '', '')
call <SID>hlg('htmlH1', 'blue', '', '')
call <SID>hlg('htmlH2', 'cyan', '', '')
call <SID>hlg('htmlH3', 'cyan', '', '')
call <SID>hlg('htmlH4', 'green', '', '')
call <SID>hlg('htmlH5', 'green', '', '')
" YAML {{{2
call <SID>HighLight('yamlKey', 'red', '', '')
call <SID>HighLight('yamlAnchor', 'red', '', '')
call <SID>HighLight('yamlAlias', 'blue', '', '')
call <SID>HighLight('yamlDocumentHeader', 'green', '', '')
call <SID>hlg('yamlKey', 'red', '', '')
call <SID>hlg('yamlAnchor', 'red', '', '')
call <SID>hlg('yamlAlias', 'blue', '', '')
call <SID>hlg('yamlDocumentHeader', 'green', '', '')
" Markdown {{{2
call <SID>HighLight('markdownHeadingRule', 'red', '', '')
call <SID>HighLight('markdownHeadingDelimiter', 'red', '', '')
call <SID>HighLight('markdownListMarker', 'blue', '', '')
call <SID>HighLight('markdownOrderedListMarker', 'blue', '', '')
call <SID>HighLight('markdownCode', 'purple', '', '')
call <SID>HighLight('markdownCodeBlock', 'purple', '', '')
call <SID>HighLight('markdownCodeDelimiter', 'purple', '', '')
call <SID>HighLight('markdownH1', 'blue', '', '')
call <SID>HighLight('markdownH2', 'blue', '', '')
call <SID>HighLight('markdownH3', 'cyan', '', '')
call <SID>HighLight('markdownH4', 'cyan', '', '')
call <SID>HighLight('markdownH5', 'green', '', '')
call <SID>hlg('markdownHeadingRule', 'red', '', '')
call <SID>hlg('markdownHeadingDelimiter', 'red', '', '')
call <SID>hlg('markdownListMarker', 'blue', '', '')
call <SID>hlg('markdownOrderedListMarker', 'blue', '', '')
call <SID>hlg('markdownCode', 'purple', '', '')
call <SID>hlg('markdownCodeBlock', 'purple', '', '')
call <SID>hlg('markdownCodeDelimiter', 'purple', '', '')
call <SID>hlg('markdownH1', 'blue', '', '')
call <SID>hlg('markdownH2', 'blue', '', '')
call <SID>hlg('markdownH3', 'cyan', '', '')
call <SID>hlg('markdownH4', 'cyan', '', '')
call <SID>hlg('markdownH5', 'green', '', '')
" ShowMarks {{{2
call <SID>HighLight('ShowMarksHLm', 'cyan', '', '')
call <SID>HighLight('ShowMarksHLl', 'orange', '', '')
call <SID>HighLight('ShowMarksHLo', 'purple', '', '')
call <SID>HighLight('ShowMarksHLu', 'yellow', '', '')
call <SID>hlg('ShowMarksHLm', 'cyan', '', '')
call <SID>hlg('ShowMarksHLl', 'orange', '', '')
call <SID>hlg('ShowMarksHLo', 'purple', '', '')
call <SID>hlg('ShowMarksHLu', 'yellow', '', '')
" Lua {{{2
call <SID>HighLight('luaRepeat', 'purple', '', '')
call <SID>HighLight('luaStatement', 'purple', '', '')
call <SID>HighLight('luaCond', 'green', '', '')
call <SID>HighLight('luaCondEnd', 'green', '', '')
call <SID>HighLight('luaCondStart', 'green', '', '')
call <SID>HighLight('luaCondElseif', 'green', '', '')
call <SID>hlg('luaRepeat', 'purple', '', '')
call <SID>hlg('luaStatement', 'purple', '', '')
call <SID>hlg('luaCond', 'green', '', '')
call <SID>hlg('luaCondEnd', 'green', '', '')
call <SID>hlg('luaCondStart', 'green', '', '')
call <SID>hlg('luaCondElseif', 'green', '', '')
" Go {{{2
call <SID>HighLight('goDeclType', 'blue', '', '')
call <SID>HighLight('goLabel', 'purple', '', '')
call <SID>HighLight('goRepeat', 'purple', '', '')
call <SID>HighLight('goBuiltins', 'purple', '', '')
call <SID>HighLight('goStatement', 'purple', '', '')
call <SID>HighLight('goDirective', 'purple', '', '')
call <SID>HighLight('goDeclaration', 'purple', '', '')
call <SID>HighLight('goConditional', 'purple', '', '')
call <SID>HighLight('goTodo', 'yellow', '', '')
call <SID>HighLight('goConstants', 'orange', '', '')
call <SID>hlg('goDeclType', 'blue', '', '')
call <SID>hlg('goLabel', 'purple', '', '')
call <SID>hlg('goRepeat', 'purple', '', '')
call <SID>hlg('goBuiltins', 'purple', '', '')
call <SID>hlg('goStatement', 'purple', '', '')
call <SID>hlg('goDirective', 'purple', '', '')
call <SID>hlg('goDeclaration', 'purple', '', '')
call <SID>hlg('goConditional', 'purple', '', '')
call <SID>hlg('goTodo', 'yellow', '', '')
call <SID>hlg('goConstants', 'orange', '', '')
" Clojure {{{2
call <SID>HighLight('clojureException', 'red', '', '')
call <SID>HighLight('clojureParen', 'cyan', '', '')
call <SID>HighLight('clojureCond', 'blue', '', '')
call <SID>HighLight('clojureFunc', 'blue', '', '')
call <SID>HighLight('clojureMeta', 'blue', '', '')
call <SID>HighLight('clojureMacro', 'blue', '', '')
call <SID>HighLight('clojureDeref', 'blue', '', '')
call <SID>HighLight('clojureQuote', 'blue', '', '')
call <SID>HighLight('clojureRepeat', 'blue', '', '')
call <SID>HighLight('clojureRepeat', 'blue', '', '')
call <SID>HighLight('clojureUnquote', 'blue', '', '')
call <SID>HighLight('clojureAnonArg', 'blue', '', '')
call <SID>HighLight('clojureDispatch', 'blue', '', '')
call <SID>HighLight('clojureString', 'green', '', '')
call <SID>HighLight('clojureRegexp', 'green', '', '')
call <SID>HighLight('clojureKeyword', 'green', '', '')
call <SID>HighLight('clojureDefine', 'purple', '', '')
call <SID>HighLight('clojureSpecial', 'purple', '', '')
call <SID>HighLight('clojureVariable', 'yellow', '', '')
call <SID>HighLight('clojureBoolean', 'orange', '', '')
call <SID>HighLight('clojureNumber', 'orange', '', '')
call <SID>HighLight('clojureConstant', 'orange', '', '')
call <SID>HighLight('clojureCharacter', 'orange', '', '')
call <SID>hlg('clojureException', 'red', '', '')
call <SID>hlg('clojureParen', 'cyan', '', '')
call <SID>hlg('clojureCond', 'blue', '', '')
call <SID>hlg('clojureFunc', 'blue', '', '')
call <SID>hlg('clojureMeta', 'blue', '', '')
call <SID>hlg('clojureMacro', 'blue', '', '')
call <SID>hlg('clojureDeref', 'blue', '', '')
call <SID>hlg('clojureQuote', 'blue', '', '')
call <SID>hlg('clojureRepeat', 'blue', '', '')
call <SID>hlg('clojureRepeat', 'blue', '', '')
call <SID>hlg('clojureUnquote', 'blue', '', '')
call <SID>hlg('clojureAnonArg', 'blue', '', '')
call <SID>hlg('clojureDispatch', 'blue', '', '')
call <SID>hlg('clojureString', 'green', '', '')
call <SID>hlg('clojureRegexp', 'green', '', '')
call <SID>hlg('clojureKeyword', 'green', '', '')
call <SID>hlg('clojureDefine', 'purple', '', '')
call <SID>hlg('clojureSpecial', 'purple', '', '')
call <SID>hlg('clojureVariable', 'yellow', '', '')
call <SID>hlg('clojureBoolean', 'orange', '', '')
call <SID>hlg('clojureNumber', 'orange', '', '')
call <SID>hlg('clojureConstant', 'orange', '', '')
call <SID>hlg('clojureCharacter', 'orange', '', '')
" Scala {{{2
call <SID>HighLight('scalaPackage', 'red', '', '')
call <SID>HighLight('scalaVar', 'cyan', '', '')
call <SID>HighLight('scalaDefName', 'blue', '', '')
call <SID>HighLight('scalaBackTick', 'blue', '', '')
call <SID>HighLight('scalaMethodCall', 'blue', '', '')
call <SID>HighLight('scalaXml', 'green', '', '')
call <SID>HighLight('scalaString', 'green', '', '')
call <SID>HighLight('scalaBackTick', 'green', '', '')
call <SID>HighLight('scalaEmptyString', 'green', '', '')
call <SID>HighLight('scalaStringEscape', 'green', '', '')
call <SID>HighLight('scalaMultiLineString', 'green', '', '')
call <SID>HighLight('scalaTypeSpecializer', 'yellow', '', '')
call <SID>HighLight('scalaDefSpecializer', 'yellow', '', '')
call <SID>HighLight('scalaType', 'yellow', '', '')
call <SID>HighLight('scalaCaseType', 'yellow', '', '')
call <SID>HighLight('scalaAnnotation', 'orange', '', '')
call <SID>HighLight('scalaSymbol', 'orange', '', '')
call <SID>HighLight('scalaUnicode', 'orange', '', '')
call <SID>HighLight('scalaBoolean', 'orange', '', '')
call <SID>HighLight('scalaNumber', 'orange', '', '')
call <SID>HighLight('scalaChar', 'orange', '', '')
call <SID>HighLight('scalaImport', 'purple', '', '')
call <SID>HighLight('scalaDef', 'purple', '', '')
call <SID>HighLight('scalaVal', 'purple', '', '')
call <SID>HighLight('scalaClass', 'purple', '', '')
call <SID>HighLight('scalaTrait', 'purple', '', '')
call <SID>HighLight('scalaObject', 'purple', '', '')
call <SID>HighLight('scalaKeywordModifier', 'purple', '', '')
call <SID>HighLight('scalaDocComment', 'commnt', '', '')
call <SID>HighLight('scalaComment', 'commnt', '', '')
call <SID>HighLight('scalaDocTags', 'commnt', '', '')
call <SID>HighLight('scalaLineComment', 'commnt', '', '')
call <SID>hlg('scalaPackage', 'red', '', '')
call <SID>hlg('scalaVar', 'cyan', '', '')
call <SID>hlg('scalaDefName', 'blue', '', '')
call <SID>hlg('scalaBackTick', 'blue', '', '')
call <SID>hlg('scalaMethodCall', 'blue', '', '')
call <SID>hlg('scalaXml', 'green', '', '')
call <SID>hlg('scalaString', 'green', '', '')
call <SID>hlg('scalaBackTick', 'green', '', '')
call <SID>hlg('scalaEmptyString', 'green', '', '')
call <SID>hlg('scalaStringEscape', 'green', '', '')
call <SID>hlg('scalaMultiLineString', 'green', '', '')
call <SID>hlg('scalaTypeSpecializer', 'yellow', '', '')
call <SID>hlg('scalaDefSpecializer', 'yellow', '', '')
call <SID>hlg('scalaType', 'yellow', '', '')
call <SID>hlg('scalaCaseType', 'yellow', '', '')
call <SID>hlg('scalaAnnotation', 'orange', '', '')
call <SID>hlg('scalaSymbol', 'orange', '', '')
call <SID>hlg('scalaUnicode', 'orange', '', '')
call <SID>hlg('scalaBoolean', 'orange', '', '')
call <SID>hlg('scalaNumber', 'orange', '', '')
call <SID>hlg('scalaChar', 'orange', '', '')
call <SID>hlg('scalaImport', 'purple', '', '')
call <SID>hlg('scalaDef', 'purple', '', '')
call <SID>hlg('scalaVal', 'purple', '', '')
call <SID>hlg('scalaClass', 'purple', '', '')
call <SID>hlg('scalaTrait', 'purple', '', '')
call <SID>hlg('scalaObject', 'purple', '', '')
call <SID>hlg('scalaKeywordModifier', 'purple', '', '')
call <SID>hlg('scalaDocComment', 'commnt', '', '')
call <SID>hlg('scalaComment', 'commnt', '', '')
call <SID>hlg('scalaDocTags', 'commnt', '', '')
call <SID>hlg('scalaLineComment', 'commnt', '', '')
" Diff {{{2
call <SID>HighLight('DiffDelete', 'red', '', '')
call <SID>HighLight('DiffChange', 'blue', '', '')
call <SID>HighLight('DiffAdd', 'green', '', '')
call <SID>HighLight('DiffText', 'line', 'blue', '')
call <SID>hlg('DiffDelete', 'red', '', '')
call <SID>hlg('DiffChange', 'blue', '', '')
call <SID>hlg('DiffAdd', 'green', '', '')
call <SID>hlg('DiffText', 'line', 'blue', '')
" Cleanup {{{2
" Remove the highlight function as it's no longer needed.
" Will cause problems reloading the theme if not deleted.
delfunction <SID>HighLight
delfunction <SID>hlg
let g:colors_name = 'jinx'
" vim:fdm=marker

View File

@ -5,94 +5,103 @@ scriptencoding utf8
" Arch defaults
runtime! archlinux.vim
" leader key
let g:mapleader = "\<Space>"
" system clipboard (requires +clipboard)
set clipboard^=unnamed,unnamedplus
" additional settings
syntax enable
set number " enable line numbers
set backup " create backup files in runtimepath/backup/
set undofile " persistent undo files in runtimepath/undo/
set modeline " enable vim modelines
set hlsearch " highlight search items
set incsearch " searches are performed as you type
set number " enable line numbers
set confirm " ask confirmation like save before quit.
set wildmenu " Tab completion menu when using command mode
set expandtab " Tab key inserts spaces not tabs
set softtabstop=4 " spaces to enter for each tab
set tabstop=4 " tab is equivalent to how many spaces
set softtabstop=4 " tab is equivalent to how many spaces
set shiftwidth=4 " amount of spaces for indentation
set shortmess+=aAcIws " Hide or shorten certain messages
set shortmess+=aAcws " hide or shorten certain messages
set wildmenu " tab completion menu when using command mode
set wildignore+=*~,*.pyc,*/.git/*,*.so,*.swp,*.o,*.zip,*.zwc,*.png,*.jpg
set ttimeout
set ttimeoutlen=10
set timeoutlen=600
set updatecount=80
set linebreak breakindent
set list listchars=tab:>>,trail:~
set mouse=niv " use the terminal mouse in command mode (:)
if has('mouse_sgr')
" sgr mouse is better but not every term supports it
set ttymouse=sgr
endif
let g:netrw_altv = 1
let g:netrw_liststyle = 3
let g:netrw_browse_split = 3
" ------ leader mapping ------
let g:mapleader = "\<Space>"
" ------ enable additional features ------
" enable mouse
set mouse=a
if has('mouse_sgr')
" sgr mouse is better but not every term supports it
set ttymouse=sgr
endif
" syntax highlighting
syntax enable
set linebreak breakindent
set list listchars=tab:>>,trail:~
" midnight, night, or day
let g:jinx_theme = 'midnight'
try
colorscheme jinx
catch
colorscheme slate
endtry
if $TERM !=? 'linux'
set termguicolors
" true colors in terminals (neovim doesn't need this)
if !has('nvim') && !($TERM =~? 'xterm' || &term =~? 'xterm')
let $TERM = 'xterm-256color'
let &term = 'xterm-256color'
endif
if has('multi_byte') && $TERM !=? 'linux'
set listchars=tab:»»,trail:•
set fillchars=vert:┃ showbreak=
endif
set termguicolors
" true colors in terminals (neovim doesn't need this)
if !has('nvim') && !($TERM =~? 'xterm' || &term =~? 'xterm')
let $TERM = 'xterm-256color'
let &term = 'xterm-256color'
endif
if has('multi_byte') && $TERM !=? 'linux'
" ▏│ ┆ ┃ »»
set list listchars=tab:▏\ ,extends:,precedes:
set fillchars=vert:┃ showbreak=
endif
endif
" set the colorscheme variant.. midnight, night, or day
let g:jinx_theme = 'midnight'
try
colorscheme jinx
catch
colorscheme evening
endtry
" change cursor shape for different editing modes, neovim does this by default
if !has('nvim')
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\e[5 q\<Esc>\\"
let &t_SR = "\<Esc>Ptmux;\<Esc>\e[4 q\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\e[2 q\<Esc>\\"
else
let &t_SI = "\e[6 q"
let &t_SR = "\e[4 q"
let &t_EI = "\e[2 q"
endif
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\e[5 q\<Esc>\\"
let &t_SR = "\<Esc>Ptmux;\<Esc>\e[4 q\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\e[2 q\<Esc>\\"
elseif $TERM ==# 'linux'
let &t_SI = "\e[?0c"
let &t_EI = "\e[?8c"
else
let &t_SI = "\e[6 q"
let &t_SR = "\e[4 q"
let &t_EI = "\e[2 q"
endif
endif
" ------ commands ------
command! D Explore
command! R call <SID>ranger()
command! Q call <SID>quitbuffer()
command! -nargs=1 B :call <SID>bufferselect("<args>")
command! W execute 'silent w !sudo tee % >/dev/null' | edit!
command! -bang -complete=buffer -nargs=? Bclose call Bclose(<bang>, <args>)
command! -complete=buffer -nargs=? Bselect call Bselect(<args>)
command! W exec 'silent w !sudo tee % >/dev/null'|edit!
" ------ basic maps ------
" visually select the whole file
vnoremap aa VGo1G
" yank the entire file
nnoremap gyy gg"+yG''
vnoremap gyy <Esc>gg"+yG''
" open ranger as a file chooser using the function below
nnoremap <leader>r :call <SID>ranger()<CR>
" match string to switch buffer
nnoremap <Leader>b :let b:buf = input('Match: ')<Bar>call <SID>bufferselect(b:buf)<CR>
nnoremap <Leader>b :Bselect<CR>
nnoremap <Leader>q :Bclose<CR>:silent tabclose<CR>gT
" change windows with ctrl+(hjkl)
nnoremap <C-J> <C-W><C-J>
@ -106,6 +115,7 @@ nnoremap Y y$
nnoremap n nzzzv
nnoremap N Nzzzv
nnoremap <Tab> ==1j
vnoremap <Tab> ==
" re-visual text after changing indent
vnoremap > >gv
@ -121,6 +131,9 @@ nmap <buffer><silent><expr>k v:count ? 'k' : 'gk'
" open a terminal in $PWD
nnoremap <silent> <Leader>tt :terminal<CR>
" toggle folding
nnoremap <leader>za :set foldenable!<CR>
" tab control
nnoremap <silent> <M-j> :tabmove -1<CR>
nnoremap <silent> <M-k> :tabmove +1<CR>
@ -139,30 +152,44 @@ nnoremap <silent> <Leader>- :tabedit <C-R>=expand("%:p:h")<CR><CR>
nnoremap _ <C-W>s<C-W><Down>
nnoremap <Bar> <C-W>v<C-W><Right>
" fix syntax highlighting issues
nnoremap U :syntax sync fromstart<CR>:redraw!<CR>
" ------ autocmd ------
" Reload changes if file changed outside of vim requires autoread
" when quitting a file save the cursor position and reload if file changed
augroup load_changed_file
autocmd!
autocmd FocusGained,BufEnter * if mode() !=? 'c' | checktime | endif
autocmd FileChangedShellPost * echo "Changes loaded from source file"
autocmd!
autocmd BufReadPost * call setpos(".", getpos("'\""))
autocmd FocusGained,BufEnter * if mode() !=? 'c' | checktime | endif
autocmd FileChangedShellPost * echo "Changes loaded from source file"
augroup END
" when quitting a file, save the cursor position
augroup save_cursor_position
autocmd!
autocmd BufReadPost * call setpos(".", getpos("'\""))
augroup END
" make the built-in terminal behave a bit better
if has('nvim')
augroup open_terminal
autocmd!
autocmd TermOpen * setlocal nonumber norelativenumber modifiable | startinsert
autocmd TermClose * buffer #
augroup END
elseif has('terminal')
augroup open_terminal
autocmd!
autocmd TerminalOpen * setlocal nonumber norelativenumber
augroup END
endif
" when not running in a console or a terminal that doesn't support 256 colors
" enable cursorline in the currently active window and disable it in inactive ones
if $DISPLAY !=? '' && &t_Co == 256
augroup cursorline
autocmd!
autocmd VimEnter,WinEnter,BufWinEnter * setlocal cursorline
autocmd WinLeave * setlocal nocursorline
augroup END
" when not running in a linux console toggle some things when in insert mode
if $TERM !=# 'linux'
augroup active_cursorline
autocmd!
autocmd InsertEnter * setlocal cursorline listchars-=trail:•
autocmd InsertLeave * setlocal nocursorline listchars+=trail:•
augroup END
else
" otherwise disable cursorline
set nocursorline
endif
" ------ adv maps ------
@ -170,138 +197,178 @@ endif
" strip trailing whitespace, ss (strip space)
nnoremap <silent> <Leader>ss
\ :let b:_p = getpos(".") <Bar>
\ let b:_s = (@/ != '') ? @/ : '' <Bar>
\ %s/\s\+$//e <Bar>
\ let @/ = b:_s <Bar>
\ nohlsearch <Bar>
\ unlet b:_s <Bar>
\ call setpos('.', b:_p) <Bar>
\ unlet b:_p <CR>
\ :let b:_p = getpos(".") <Bar>
\ let b:_s = (@/ != '') ? @/ : '' <Bar>
\ %s/\s\+$//e <Bar>
\ let @/ = b:_s <Bar>
\ nohlsearch <Bar>
\ unlet b:_s <Bar>
\ call setpos('.', b:_p) <Bar>
\ unlet b:_p <CR>
" global replace
vnoremap <Leader>sw "hy
\ :let b:sub = input('global replacement: ') <Bar>
\ if b:sub !=? '' <Bar>
\ let b:rep = substitute(getreg('h'), '/', '\\/', 'g') <Bar>
\ execute '%s/'.b:rep."/".b:sub.'/g' <Bar>
\ unlet b:sub b:rep <Bar>
\ endif <CR>
\ :let b:sub = input('global replacement: ') <Bar>
\ if b:sub !=? '' <Bar>
\ let b:rep = substitute(getreg('h'), '/', '\\/', 'g') <Bar>
\ execute '%s/'.b:rep."/".b:sub.'/g' <Bar>
\ unlet b:sub b:rep <Bar>
\ endif <CR>
nnoremap <Leader>sw
\ :let b:sub = input('global replacement: ') <Bar>
\ if b:sub !=? '' <Bar>
\ execute "%s/<C-r><C-w>/".b:sub.'/g' <Bar>
\ unlet b:sub <Bar>
\ endif <CR>
\ :let b:sub = input('global replacement: ') <Bar>
\ if b:sub !=? '' <Bar>
\ execute "%s/<C-r><C-w>/".b:sub.'/g' <Bar>
\ unlet b:sub <Bar>
\ endif <CR>
" prompt before each replace
vnoremap <Leader>cw "hy
\ :let b:sub = input('interactive replacement: ') <Bar>
\ if b:sub !=? '' <Bar>
\ let b:rep = substitute(getreg('h'), '/', '\\/', 'g') <Bar>
\ execute '%s/'.b:rep.'/'.b:sub.'/gc' <Bar>
\ unlet b:sub b:rep <Bar>
\ endif <CR>
\ :let b:sub = input('interactive replacement: ') <Bar>
\ if b:sub !=? '' <Bar>
\ let b:rep = substitute(getreg('h'), '/', '\\/', 'g') <Bar>
\ execute '%s/'.b:rep.'/'.b:sub.'/gc' <Bar>
\ unlet b:sub b:rep <Bar>
\ endif <CR>
nnoremap <Leader>cw
\ :let b:sub = input('interactive replacement: ') <Bar>
\ if b:sub !=? '' <Bar>
\ execute "%s/<C-r><C-w>/".b:sub.'/gc' <Bar>
\ unlet b:sub <Bar>
\ endif <CR>
\ :let b:sub = input('interactive replacement: ') <Bar>
\ if b:sub !=? '' <Bar>
\ execute "%s/<C-r><C-w>/".b:sub.'/gc' <Bar>
\ unlet b:sub <Bar>
\ endif <CR>
" highlight long lines, ll (long lines)
let w:longlines = matchadd('ColorColumn', '\%'.&textwidth.'v', &textwidth)
nnoremap <silent> <Leader>ll
\ :if exists('w:longlines') <Bar>
\ silent! call matchdelete(w:longlines) <Bar>
\ echo 'Long line highlighting disabled'
\ <Bar> unlet w:longlines <Bar>
\ elseif &textwidth > 0 <Bar>
\ let w:longlines = matchadd('ColorColumn', '\%'.&textwidth.'v', &textwidth) <Bar>
\ echo 'Long line highlighting enabled'
\ <Bar> else <Bar>
\ let w:longlines = matchadd('ColorColumn', '\%80v', 81) <Bar>
\ echo 'Long line highlighting enabled'
\ <Bar> endif <CR>
\ :if exists('w:longlines') <Bar>
\ silent! call matchdelete(w:longlines) <Bar>
\ echo 'Long line highlighting disabled'
\ <Bar> unlet w:longlines <Bar>
\ elseif &textwidth > 0 <Bar>
\ let w:longlines = matchadd('ColorColumn', '\%'.&textwidth.'v', &textwidth) <Bar>
\ echo 'Long line highlighting enabled'
\ <Bar> else <Bar>
\ let w:longlines = matchadd('ColorColumn', '\%80v', 81) <Bar>
\ echo 'Long line highlighting enabled'
\ <Bar> endif <CR>
" local keyword jump
nnoremap <Leader>fw
\ [I:let b:jump = input('Go To: ') <Bar>
\ if b:jump !=? '' <Bar>
\ execute "normal! ".b:jump."[\t" <Bar>
\ unlet b:jump <Bar>
\ endif <CR>
\ [I:let b:jump = input('Go To: ') <Bar>
\ if b:jump !=? '' <Bar>
\ execute "normal! ".b:jump."[\t" <Bar>
\ unlet b:jump <Bar>
\ endif <CR>
" quit the current buffer and switch to the next
" without this vim will leave you on an empty buffer after quiting the current
function! <SID>quitbuffer() abort
let l:bf = bufnr('%')
let l:pb = bufnr('#')
if buflisted(l:pb)
buffer #
else
bnext
endif
if bufnr('%') == l:bf
new
endif
if buflisted(l:bf)
execute('bdelete! ' . l:bf)
endif
function! Bclose(bang, buffer) abort
if empty(a:buffer)
let l:target = bufnr('%')
elseif a:buffer =~? '^\d\+$'
let l:target = bufnr(str2nr(a:buffer))
else
let l:target = bufnr(a:buffer)
endif
if l:target < 0
call WarningMsg('No matching buffer for '.a:buffer)
return
endif
if empty(a:bang) && getbufvar(l:target, '&modified')
call WarningMsg('No write since last change for buffer '.l:target.' (use :Bclose!)')
return
endif
" Numbers of windows that view target buffer which we will delete.
let l:num_wins = filter(range(1, winnr('$')), 'winbufnr(v:val) == l:target')
if empty(a:bang) && len(l:num_wins) > 1
call WarningMsg('Buffer is open in multiple windows (use :Bclose!)')
return
endif
let l:cur_win = winnr()
for w in l:num_wins
execute w.'wincmd w'
let prevbuf = bufnr('#')
if prevbuf > 0 && buflisted(prevbuf) && prevbuf != w
buffer #
else
bprevious
endif
if l:target == bufnr('%')
" Numbers of listed buffers which are not the target to be deleted.
let blisted = filter(range(1, bufnr('$')), 'buflisted(v:val) && v:val != l:target')
" Listed, not target, and not displayed.
let bhidden = filter(copy(blisted), 'bufwinnr(v:val) < 0')
" Take the first buffer, if any (could be more intelligent).
let bjump = (bhidden + blisted + [-1])[0]
if bjump > 0
execute 'buffer '.bjump
else
execute 'enew'.a:bang
endif
endif
endfor
execute 'bdelete'.a:bang.' '.l:target
execute l:cur_win.'wincmd w'
endfunction
" switch active buffer based on pattern matching
" if more than one match is found then list the matches to choose from
function! <SID>bufferselect(pattern) abort
let l:bufcount = bufnr('$')
let l:currbufnr = 1
let l:nummatches = 0
let l:matchingbufnr = 0
" walk the buffer count
while l:currbufnr <= l:bufcount
if (bufexists(l:currbufnr))
let l:currbufname = bufname(l:currbufnr)
if (match(l:currbufname, a:pattern) > -1)
echo l:currbufnr.': '.bufname(l:currbufnr)
let l:nummatches += 1
let l:matchingbufnr = l:currbufnr
endif
endif
let l:currbufnr += 1
endwhile
function! Bselect(...) abort
let l:pattern = a:0 >= 1 ? a:1 : ''
if l:pattern ==? ''
let l:pattern = input('String match: ')
redraw!
endif
if l:pattern !=# ''
let l:bufcount = bufnr('$')
let l:currbufnr = 1
let l:nummatches = 0
let l:matchingbufnr = 0
" only one match
if (l:nummatches == 1)
execute ':buffer '.l:matchingbufnr
elseif (l:nummatches > 1)
" more than one match
let l:desiredbufnr = input('Enter buffer number: ')
if (strlen(l:desiredbufnr) != 0)
execute ':buffer '.l:desiredbufnr
endif
else
echoerr 'No matching buffers'
endif
while l:currbufnr <= l:bufcount
if bufexists(l:currbufnr)
let l:currbufname = bufname(l:currbufnr)
if (match(l:currbufname, l:pattern) > -1)
echo l:currbufnr . ': ' . l:currbufname
let l:nummatches += 1
let l:matchingbufnr = l:currbufnr
endif
endif
let l:currbufnr += 1
endwhile
if (l:nummatches == 1)
execute ':buffer '.l:matchingbufnr
elseif (l:nummatches > 1)
let l:desiredbufnr = input('Enter buffer number: ')
if (strlen(l:desiredbufnr) != 0)
execute ':buffer ' . l:desiredbufnr
endif
else
call WarningMsg('No matching buffers')
endif
endif
endfunction
" open ranger as a file chooser
function! <SID>ranger()
let l:temp = tempname()
execute 'silent !xterm -e ranger --choosefiles='.shellescape(l:temp).' $PWD'
if !filereadable(temp)
redraw!
return
endif
let l:names = readfile(l:temp)
if empty(l:names)
redraw!
return
endif
execute 'edit '.fnameescape(l:names[0])
for l:name in l:names[1:]
execute 'argadd '.fnameescape(l:name)
endfor
redraw!
let l:temp = tempname()
execute 'silent !xterm -e ranger --choosefiles='.shellescape(l:temp).' $PWD'
if !filereadable(temp)
redraw!
return
endif
let l:names = readfile(l:temp)
if empty(l:names)
redraw!
return
endif
execute 'edit '.fnameescape(l:names[0])
for l:name in l:names[1:]
execute 'argadd '.fnameescape(l:name)
endfor
redraw!
endfunction

View File

@ -10,6 +10,9 @@ export XDG_CONFIG_HOME="$HOME/.config"
[ -d /usr/sbin ] && PATH="$PATH:/usr/sbin"
[ -d "$HOME/bin" ] && PATH="$HOME/bin:$PATH"
# compton
al-compositor --start &
# restore the background
nitrogen --restore &

View File

@ -1,11 +1,11 @@
#!/usr/bin/env bash
NAME="${0##*/}"
VER="0.6"
VER="0.7"
usage()
{
cat <<- EOF
cat <<EOF
USAGE: $NAME [OPTIONS]
@ -53,20 +53,20 @@ else
rofi -modi window -show window -hide-scrollbar -padding 50 -line-padding 4
;;
-q|--qalculate)
hash qalc &>/dev/null || { echo "Requires 'libqalculate' installed"; exit 1; }
hash qalc >/dev/null 2>&1 || { echo "Requires 'libqalculate' installed"; exit 1; }
rofi -modi "calc:qalc +u8 -nocurrencies" -padding 50 -show "calc:qalc +u8 -nocurrencies" -line-padding 4 -hide-scrollbar
;;
-c|--clipboard)
hash greenclip &>/dev/null || { echo "Requires 'greenclip' installed"; exit 1; }
hash greenclip >/dev/null 2>&1 || { echo "Requires 'greenclip' installed"; exit 1; }
rofi -modi "clipboard:greenclip print" -padding 50 -line-padding 4 -show "clipboard:greenclip print" -hide-scrollbar
;;
-b|--browser)
hash surfraw &>/dev/null || { echo "Requires 'surfraw' installed"; exit 1; }
hash surfraw >/dev/null 2>&1 || { echo "Requires 'surfraw' installed"; exit 1; }
surfraw -browser="$BROWSER" "$(sr -elvi | awk -F'-' '{print $1}' | sed '/:/d' | awk '{$1=$1};1' |
rofi -hide-scrollbar -kb-row-select 'Tab' -kb-row-tab 'Control+space' -dmenu -mesg 'Tab for Autocomplete' -i -p 'Web Search')"
;;
-l|--logout)
if grep -q 'exec startx' $HOME/.*profile; then
if grep -q 'startx' $HOME/.*profile; then
ANS="$(rofi -sep "|" -dmenu -i -p 'System' -width 20 -hide-scrollbar -line-padding 4 -padding 20 -lines 3 <<< " Lock| Reboot| Shutdown")"
else
ANS="$(rofi -sep "|" -dmenu -i -p 'System' -width 20 -hide-scrollbar -line-padding 4 -padding 20 -lines 4 <<< " Lock| Logout| Reboot| Shutdown")"

View File

@ -6,9 +6,6 @@ xsetroot -cursor_name left_ptr
# key bindings
sxhkd &
# launch compton
al-compositor --start &
# panel
al-polybar-session &

View File

@ -63,7 +63,6 @@ exec_always --no-startup-id xrdb -load ~/.Xresources
# run once
exec --no-startup-id xfsettingsd
exec --no-startup-id al-compositor --start
# needed for super to launch rofi through ksuperkey, see ~/.xprofile
bindsym Mod1+F1 exec --no-startup-id rofi_run -r

View File

@ -1,6 +1,3 @@
# compton
al-compositor --start &
# required for xfce settings to work
xfsettingsd &

View File

@ -70,7 +70,7 @@ border_color_pressed = #222222 90
#-------------------------------------
# Panel
panel_items = PLTC
panel_items = PLTSC
panel_size = 100% 30
panel_margin = 0 0
panel_padding = 0 0 0
@ -165,7 +165,6 @@ startup_notifications = 1
launcher_tooltip = 1
launcher_item_app = /usr/share/applications/exo-file-manager.desktop
launcher_item_app = /usr/share/applications/exo-terminal-emulator.desktop
launcher_item_app = /usr/share/applications/geany.desktop
launcher_item_app = /usr/share/applications/exo-web-browser.desktop
#-------------------------------------