From de93e7d7c957bf469744af5f129807c46a44807d Mon Sep 17 00:00:00 2001 From: natemaia Date: Sun, 3 Mar 2019 15:25:39 -0800 Subject: [PATCH] Enable system tray in tint2 --- base/.config/fontconfig/fonts.conf | 94 ++-- base/.vim/colors/jinx.vim | 588 ++++++++++++------------- base/.vimrc | 435 ++++++++++-------- base/.xprofile | 3 + base/bin/rofi_run | 12 +- bspwm-home/.config/bspwm/bspwmrc | 3 - i3-gaps-home/.config/i3/config | 1 - openbox-home/.config/openbox/autostart | 3 - openbox-home/.config/tint2/tint2rc | 3 +- 9 files changed, 602 insertions(+), 540 deletions(-) diff --git a/base/.config/fontconfig/fonts.conf b/base/.config/fontconfig/fonts.conf index 221ec2e3..cb3c3150 100644 --- a/base/.config/fontconfig/fonts.conf +++ b/base/.config/fontconfig/fonts.conf @@ -1,52 +1,52 @@ - - - - - - - - - - - - true - - - - - + + + + + + + + + + + + true + + + + + - - serif - - DejaVu Serif - - - - sans-serif - - DejaVu Sans - - - - sans - - DejaVu Sans - - - - monospace - - DejaVu Sans Mono - - - - mono - - DejaVu Sans Mono - - + + serif + + DejaVu Serif + + + + sans-serif + + DejaVu Sans + + + + sans + + DejaVu Sans + + + + monospace + + DejaVu Sans Mono + + + + mono + + DejaVu Sans Mono + + diff --git a/base/.vim/colors/jinx.vim b/base/.vim/colors/jinx.vim index 4a63519c..683ba330 100644 --- a/base/.vim/colors/jinx.vim +++ b/base/.vim/colors/jinx.vim @@ -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! HighLight(GRP, FG, BG, ATT) abort " {{{1 +function! 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! 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 HighLight('Title', 'commnt', 'bgr', 'bold') -call HighLight('Visual', '', 'select', '') -call HighLight('SignColumn', '', 'line', '') -call HighLight('CursorLine', '', 'line', '') -call HighLight('CursorColumn', '', 'line', '') -call HighLight('CursorLineNr', 'cyan', 'line', '') -call HighLight('LineNr', 'commnt', 'line', '') -call HighLight('ColorColumn', 'fgr', 'red', '') -call HighLight('Error', 'red', 'bgr', '') -call HighLight('ErrorMsg', 'red', 'bgr', '') -call HighLight('WarningMsg', 'red', 'bgr', '') -call HighLight('MatchParen', 'yellow', 'bgr', '') -call HighLight('ModeMsg', 'cyan', 'bgr', '') -call HighLight('MoreMsg', 'cyan', 'bgr', '') -call HighLight('Directory', 'blue', 'bgr', '') -call HighLight('Question', 'green', 'bgr', '') -call HighLight('NonText', 'commnt', 'bgr', '') -call HighLight('SpecialKey', 'commnt', 'bgr', '') -call HighLight('Folded', 'commnt', 'folded', '') -call HighLight('Search', 'bgr', 'blue', '') -call HighLight('HLNext', 'bgr', 'red', '') -call HighLight('Normal', 'fgr', 'bgr', '') -call HighLight('VertSplit', 'line', 'commnt', '') +call hlg('Title', 'commnt', 'bgr', 'bold') +call hlg('Visual', '', 'select', '') +call hlg('SignColumn', '', 'line', '') +call hlg('CursorLine', '', 'line', '') +call hlg('CursorColumn', '', 'line', '') +call hlg('CursorLineNr', 'cyan', 'line', '') +call hlg('LineNr', 'commnt', 'line', '') +call hlg('ColorColumn', 'fgr', 'red', '') +call hlg('Error', 'red', 'bgr', '') +call hlg('ErrorMsg', 'red', 'bgr', '') +call hlg('WarningMsg', 'red', 'bgr', '') +call hlg('MatchParen', 'yellow', 'bgr', '') +call hlg('ModeMsg', 'cyan', 'bgr', '') +call hlg('MoreMsg', 'cyan', 'bgr', '') +call hlg('Directory', 'blue', 'bgr', '') +call hlg('Question', 'green', 'bgr', '') +call hlg('NonText', 'commnt', 'bgr', '') +call hlg('SpecialKey', 'commnt', 'bgr', '') +call hlg('Folded', 'commnt', 'folded', '') +call hlg('Search', 'bgr', 'blue', '') +call hlg('HLNext', 'bgr', 'red', '') +call hlg('Normal', 'fgr', 'bgr', '') +call hlg('VertSplit', 'line', 'commnt', '') " Tabline {{{2 -call HighLight('TabLine', 'fgr', 'line', '') -call HighLight('TabLineFill', 'line', 'line', '') -call HighLight('TabLineSel', 'line', 'green', '') -call HighLight('WildMenu', 'bgr', 'fgr', '') -call HighLight('Pmenu', 'bgr', 'commnt', '') -call HighLight('PmenuSel', 'fgr', 'bgr', '') -call HighLight('PmenuSbar', 'commnt', 'line', '') -call HighLight('PmenuThumb', 'commnt', 'line', '') -call HighLight('StatusLine', 'line', 'fgr', '') -call HighLight('StatusLineNC', 'fgr', 'line', '') +call hlg('TabLine', 'fgr', 'line', '') +call hlg('TabLineFill', 'line', 'line', '') +call hlg('TabLineSel', 'line', 'green', '') +call hlg('WildMenu', 'bgr', 'fgr', '') +call hlg('Pmenu', 'bgr', 'commnt', '') +call hlg('PmenuSel', 'fgr', 'bgr', '') +call hlg('PmenuSbar', 'commnt', 'line', '') +call hlg('PmenuThumb', 'commnt', 'line', '') +call hlg('StatusLine', 'line', 'fgr', '') +call hlg('StatusLineNC', 'fgr', 'line', '') " Spelling {{{2 -call HighLight('SpellBad', '', '', 'underline') -call HighLight('SpellLocal', '', '', 'underline') -call HighLight('SpellRare', '', '', 'underline') +call hlg('SpellBad', '', '', 'underline') +call hlg('SpellLocal', '', '', 'underline') +call hlg('SpellRare', '', '', 'underline') " ALE linter {{{2 -call HighLight('ALEErrorSign', 'red', 'line', '') -call HighLight('ALEWarningSign', 'orange', 'line', '') -call HighLight('ALEError', 'red', '', 'underline') -call HighLight('ALEWarning', 'red', '', 'underline') -call HighLight('ALEStyleError', 'orange', '', 'underline') -call HighLight('ALEStyleWarning', 'orange', '', 'underline') +call hlg('ALEErrorSign', 'red', 'line', '') +call hlg('ALEWarningSign', 'orange', 'line', '') +call hlg('ALEError', 'red', '', 'underline') +call hlg('ALEWarning', 'red', '', 'underline') +call hlg('ALEStyleError', 'orange', '', 'underline') +call hlg('ALEStyleWarning', 'orange', '', 'underline') " Generic {{{2 -call HighLight('Comment', 'commnt', '', '') -call HighLight('Todo', 'red', '', '') -call HighLight('Exception', 'red', '', '') -call HighLight('Float', 'cyan', '', '') -call HighLight('Number', 'cyan', '', '') -call HighLight('Include', 'cyan', '', '') -call HighLight('Character', 'blue', '', '') -call HighLight('Operator', 'blue', '', '') -call HighLight('String', 'blue', '', '') -call HighLight('Label', 'green', '', '') -call HighLight('Repeat', 'purple', '', '') -call HighLight('Statement', 'green', '', '') -call HighLight('Conditional', 'green', '', '') -call HighLight('Boolean', 'green', '', '') -call HighLight('Keyword', 'green', '', '') -call HighLight('Macro', 'purple', '', '') -call HighLight('Define', 'purple', '', '') -call HighLight('Special', 'purple', '', '') -call HighLight('Tag', 'purple', '', '') -call HighLight('Type', 'purple', '', '') -call HighLight('TypeDef', 'purple', '', '') -call HighLight('Structure', 'purple', '', '') -call HighLight('StorageClass', 'purple', '', '') -call HighLight('PreProc', 'yellow', '', '') -call HighLight('Constant', 'yellow', '', '') -call HighLight('Identifier', 'yellow', '', '') -call HighLight('PreCondit', 'yellow', '', '') -call HighLight('Conceal', 'orange', '', '') -call HighLight('Function', 'orange', '', '') +call hlg('Comment', 'commnt', '', '') +call hlg('Todo', 'red', '', '') +call hlg('Exception', 'red', '', '') +call hlg('Float', 'cyan', '', '') +call hlg('Number', 'cyan', '', '') +call hlg('Include', 'cyan', '', '') +call hlg('Character', 'blue', '', '') +call hlg('Operator', 'blue', '', '') +call hlg('String', 'blue', '', '') +call hlg('Label', 'green', '', '') +call hlg('Repeat', 'purple', '', '') +call hlg('Statement', 'green', '', '') +call hlg('Conditional', 'green', '', '') +call hlg('Boolean', 'green', '', '') +call hlg('Keyword', 'green', '', '') +call hlg('Macro', 'purple', '', '') +call hlg('Define', 'purple', '', '') +call hlg('Special', 'purple', '', '') +call hlg('Tag', 'purple', '', '') +call hlg('Type', 'purple', '', '') +call hlg('TypeDef', 'purple', '', '') +call hlg('Structure', 'purple', '', '') +call hlg('StorageClass', 'purple', '', '') +call hlg('PreProc', 'yellow', '', '') +call hlg('Constant', 'yellow', '', '') +call hlg('Identifier', 'yellow', '', '') +call hlg('PreCondit', 'yellow', '', '') +call hlg('Conceal', 'orange', '', '') +call hlg('Function', 'orange', '', '') " Vim {{{2 -call HighLight('vimCommand', 'green', '', '') -call HighLight('vimVar', 'yellow', '', '') -call HighLight('vimGroup', 'yellow', '', '') -call HighLight('vimGroupName', 'yellow', '', '') -call HighLight('VimFunction', 'orange', '', '') -call HighLight('VimFunctionKey', 'orange', '', '') -call HighLight('vimMapModKey', 'purple', '', '') -call HighLight('vimBracket', 'purple', '', '') -call HighLight('vimOption', 'purple', '', '') -call HighLight('vimMapMod', 'purple', '', '') -call HighLight('vimNotation', 'purple', '', '') +call hlg('vimCommand', 'green', '', '') +call hlg('vimVar', 'yellow', '', '') +call hlg('vimGroup', 'yellow', '', '') +call hlg('vimGroupName', 'yellow', '', '') +call hlg('VimFunction', 'orange', '', '') +call hlg('VimFunctionKey', 'orange', '', '') +call hlg('vimMapModKey', 'purple', '', '') +call hlg('vimBracket', 'purple', '', '') +call hlg('vimOption', 'purple', '', '') +call hlg('vimMapMod', 'purple', '', '') +call hlg('vimNotation', 'purple', '', '') " Shell {{{2 -call HighLight('shSet', 'green', '', '') -call HighLight('shLoop', 'green', '', '') -call HighLight('shFor', 'yellow', '', '') -call HighLight('shTestOpr', 'blue', '', '') -call HighLight('shConstant', 'yellow', '', '') -call HighLight('shFunctionKey', 'orange', '', '') -call HighLight('shStatement', 'green', '', '') -call HighLight('shKeyword', 'purple', '', '') -call HighLight('zshStatement', 'green', '', '') -call HighLight('zshOption', 'purple', '', '') -call HighLight('zshParentheses', 'purple', '', '') -call HighLight('zshBrackets', 'purple', '', '') -call HighLight('zshRepeat', 'green', '', '') -call HighLight('zshRedir', 'fgr', '', '') -call HighLight('zshFunction', 'orange', '', '') -call HighLight('zshVariableDef', 'yellow', '', '') -call HighLight('zshVariable', 'yellow', '', '') -call HighLight('zshOperator', 'blue', '', '') -call HighLight('zshPreProc', 'commnt', '', '') +call hlg('shSet', 'green', '', '') +call hlg('shLoop', 'green', '', '') +call hlg('shFor', 'yellow', '', '') +call hlg('shTestOpr', 'blue', '', '') +call hlg('shConstant', 'yellow', '', '') +call hlg('shFunctionKey', 'orange', '', '') +call hlg('shStatement', 'green', '', '') +call hlg('shKeyword', 'purple', '', '') +call hlg('zshStatement', 'green', '', '') +call hlg('zshOption', 'purple', '', '') +call hlg('zshParentheses', 'purple', '', '') +call hlg('zshBrackets', 'purple', '', '') +call hlg('zshRepeat', 'green', '', '') +call hlg('zshRedir', 'fgr', '', '') +call hlg('zshFunction', 'orange', '', '') +call hlg('zshVariableDef', 'yellow', '', '') +call hlg('zshVariable', 'yellow', '', '') +call hlg('zshOperator', 'blue', '', '') +call hlg('zshPreProc', 'commnt', '', '') " C {{{2 -call HighLight('cConditional', 'green', '', '') -call HighLight('cRepeat', 'purple', '', '') -call HighLight('cStorageClass', 'purple', '', '') -call HighLight('cType', 'yellow', '', '') +call hlg('cConditional', 'green', '', '') +call hlg('cRepeat', 'purple', '', '') +call hlg('cStorageClass', 'purple', '', '') +call hlg('cType', 'yellow', '', '') " PHP {{{2 -call HighLight('phpMemberSelector', 'blue', '', '') -call HighLight('phpVarSelector', 'red', '', '') -call HighLight('phpConditional', 'green', '', '') -call HighLight('phpStatement', 'green', '', '') -call HighLight('phpKeyword', 'purple', '', '') -call HighLight('phpRepeat', 'purple', '', '') +call hlg('phpMemberSelector', 'blue', '', '') +call hlg('phpVarSelector', 'red', '', '') +call hlg('phpConditional', 'green', '', '') +call hlg('phpStatement', 'green', '', '') +call hlg('phpKeyword', 'purple', '', '') +call hlg('phpRepeat', 'purple', '', '') " Ruby {{{2 -call HighLight('rubyInclude', 'blue', '', '') -call HighLight('rubyAttribute', 'blue', '', '') -call HighLight('rubySymbol', 'green', '', '') -call HighLight('rubyStringDelimiter', 'green', '', '') -call HighLight('rubyRepeat', 'purple', '', '') -call HighLight('rubyControl', 'purple', '', '') -call HighLight('rubyConditional', 'purple', '', '') -call HighLight('rubyException', 'purple', '', '') -call HighLight('rubyCurlyBlock', 'orange', '', '') -call HighLight('rubyLocalVariableOrMethod', 'orange', '', '') -call HighLight('rubyInterpolationDelimiter', 'orange', '', '') -call HighLight('rubyAccess', 'yellow', '', '') -call HighLight('rubyConstant', 'yellow', '', '') +call hlg('rubyInclude', 'blue', '', '') +call hlg('rubyAttribute', 'blue', '', '') +call hlg('rubySymbol', 'green', '', '') +call hlg('rubyStringDelimiter', 'green', '', '') +call hlg('rubyRepeat', 'purple', '', '') +call hlg('rubyControl', 'purple', '', '') +call hlg('rubyConditional', 'purple', '', '') +call hlg('rubyException', 'purple', '', '') +call hlg('rubyCurlyBlock', 'orange', '', '') +call hlg('rubyLocalVariableOrMethod', 'orange', '', '') +call hlg('rubyInterpolationDelimiter', 'orange', '', '') +call hlg('rubyAccess', 'yellow', '', '') +call hlg('rubyConstant', 'yellow', '', '') " Python {{{2 -call HighLight('pythonRun', 'red', '', '') -call HighLight('pythonOperator', 'blue', '', '') -call HighLight('pythonClass', 'blue', '', '') -call HighLight('pythonClassParameters', 'purple', '', '') -call HighLight('pythonParam', 'purple', '', '') -call HighLight('pythonDecorator', 'blue', '', '') -call HighLight('pythonExClass', 'blue', '', '') -call HighLight('pythonException', 'blue', '', '') -call HighLight('pythonExceptions', 'blue', '', '') -call HighLight('pythonBrackets', 'blue', '', '') -call HighLight('pythonEscape', 'blue', '', '') -call HighLight('pythonImport', 'green', '', '') -call HighLight('pythonRepeat', 'green', '', '') -call HighLight('pythonCoding', 'green', '', '') -call HighLight('pythonInclude', 'green', '', '') -call HighLight('pythonPreCondit', 'green', '', '') -call HighLight('pythonStatement', 'green', '', '') -call HighLight('pythonConditional', 'green', '', '') -call HighLight('pythonDef', 'yellow', '', '') -call HighLight('pythonSelf', 'blue', '', '') -call HighLight('pythonBuiltinType', 'purple', '', '') -call HighLight('pythonBuiltin', 'purple', '', '') -call HighLight('pythonBuiltinObj', 'purple', '', '') -call HighLight('pythonBuiltinFunc', 'orange', '', '') -call HighLight('pythonDot', 'orange', '', '') -call HighLight('pythonLambda', 'orange', '', '') -call HighLight('pythonLambdaExpr', 'orange', '', '') -call HighLight('pythonFunction', 'orange', '', '') -call HighLight('pythonDottedName', 'orange', '', '') -call HighLight('pythonBuiltinObjs', 'orange', '', '') +call hlg('pythonRun', 'red', '', '') +call hlg('pythonOperator', 'blue', '', '') +call hlg('pythonClass', 'blue', '', '') +call hlg('pythonClassParameters', 'purple', '', '') +call hlg('pythonParam', 'purple', '', '') +call hlg('pythonDecorator', 'blue', '', '') +call hlg('pythonExClass', 'blue', '', '') +call hlg('pythonException', 'blue', '', '') +call hlg('pythonExceptions', 'blue', '', '') +call hlg('pythonBrackets', 'blue', '', '') +call hlg('pythonEscape', 'blue', '', '') +call hlg('pythonImport', 'green', '', '') +call hlg('pythonRepeat', 'green', '', '') +call hlg('pythonCoding', 'green', '', '') +call hlg('pythonInclude', 'green', '', '') +call hlg('pythonPreCondit', 'green', '', '') +call hlg('pythonStatement', 'green', '', '') +call hlg('pythonConditional', 'green', '', '') +call hlg('pythonDef', 'yellow', '', '') +call hlg('pythonSelf', 'blue', '', '') +call hlg('pythonBuiltinType', 'purple', '', '') +call hlg('pythonBuiltin', 'purple', '', '') +call hlg('pythonBuiltinObj', 'purple', '', '') +call hlg('pythonBuiltinFunc', 'orange', '', '') +call hlg('pythonDot', 'orange', '', '') +call hlg('pythonLambda', 'orange', '', '') +call hlg('pythonLambdaExpr', 'orange', '', '') +call hlg('pythonFunction', 'orange', '', '') +call hlg('pythonDottedName', 'orange', '', '') +call hlg('pythonBuiltinObjs', 'orange', '', '') " LaTeX {{{2 -call HighLight('texZone', 'red', '', 'none') -call HighLight('texStatement', 'blue', '', 'none') -call HighLight('texRefLabel', 'blue', '', 'none') -call HighLight('texRefZone', 'green', '', 'none') -call HighLight('texMath', 'orange', '', 'none') -call HighLight('texMathZoneX', 'orange', '', 'none') -call HighLight('texMathZoneA', 'orange', '', 'none') -call HighLight('texMathZoneB', 'orange', '', 'none') -call HighLight('texMathZoneC', 'orange', '', 'none') -call HighLight('texMathZoneD', 'orange', '', 'none') -call HighLight('texMathZoneE', 'orange', '', 'none') -call HighLight('texMathMatcher', 'orange', '', 'none') -call HighLight('texDelimiter', 'purple', '', 'none') -call HighLight('texComment', 'commnt', '', 'none') +call hlg('texZone', 'red', '', 'none') +call hlg('texStatement', 'blue', '', 'none') +call hlg('texRefLabel', 'blue', '', 'none') +call hlg('texRefZone', 'green', '', 'none') +call hlg('texMath', 'orange', '', 'none') +call hlg('texMathZoneX', 'orange', '', 'none') +call hlg('texMathZoneA', 'orange', '', 'none') +call hlg('texMathZoneB', 'orange', '', 'none') +call hlg('texMathZoneC', 'orange', '', 'none') +call hlg('texMathZoneD', 'orange', '', 'none') +call hlg('texMathZoneE', 'orange', '', 'none') +call hlg('texMathMatcher', 'orange', '', 'none') +call hlg('texDelimiter', 'purple', '', 'none') +call hlg('texComment', 'commnt', '', 'none') " JavaScript {{{2 -call HighLight('javaScriptNumber', 'cyan', '', '') -call HighLight('javascriptNull', 'red', '', '') -call HighLight('javascriptStatement', 'green', '', '') -call HighLight('javaScriptConditional', 'green', '', '') -call HighLight('javaScriptRepeat', 'purple', '', '') -call HighLight('javaScriptBraces', 'purple', '', '') -call HighLight('javascriptGlobal', 'yellow', '', '') -call HighLight('javaScriptFunction', 'orange', '', '') -call HighLight('javaScriptMember', 'orange', '', '') +call hlg('javaScriptNumber', 'cyan', '', '') +call hlg('javascriptNull', 'red', '', '') +call hlg('javascriptStatement', 'green', '', '') +call hlg('javaScriptConditional', 'green', '', '') +call hlg('javaScriptRepeat', 'purple', '', '') +call hlg('javaScriptBraces', 'purple', '', '') +call hlg('javascriptGlobal', 'yellow', '', '') +call hlg('javaScriptFunction', 'orange', '', '') +call hlg('javaScriptMember', 'orange', '', '') " HTML {{{2 -call HighLight('htmlTag', 'red', '', '') -call HighLight('htmlTagName', 'red', '', '') -call HighLight('htmlLink', 'blue', '', '') -call HighLight('htmlArg', 'green', '', '') -call HighLight('htmlScriptTag', 'purple', '', '') -call HighLight('htmlTitle', 'blue', '', '') -call HighLight('htmlH1', 'blue', '', '') -call HighLight('htmlH2', 'cyan', '', '') -call HighLight('htmlH3', 'cyan', '', '') -call HighLight('htmlH4', 'green', '', '') -call HighLight('htmlH5', 'green', '', '') +call hlg('htmlTag', 'red', '', '') +call hlg('htmlTagName', 'red', '', '') +call hlg('htmlLink', 'blue', '', '') +call hlg('htmlArg', 'green', '', '') +call hlg('htmlScriptTag', 'purple', '', '') +call hlg('htmlTitle', 'blue', '', '') +call hlg('htmlH1', 'blue', '', '') +call hlg('htmlH2', 'cyan', '', '') +call hlg('htmlH3', 'cyan', '', '') +call hlg('htmlH4', 'green', '', '') +call hlg('htmlH5', 'green', '', '') " YAML {{{2 -call HighLight('yamlKey', 'red', '', '') -call HighLight('yamlAnchor', 'red', '', '') -call HighLight('yamlAlias', 'blue', '', '') -call HighLight('yamlDocumentHeader', 'green', '', '') +call hlg('yamlKey', 'red', '', '') +call hlg('yamlAnchor', 'red', '', '') +call hlg('yamlAlias', 'blue', '', '') +call hlg('yamlDocumentHeader', 'green', '', '') " Markdown {{{2 -call HighLight('markdownHeadingRule', 'red', '', '') -call HighLight('markdownHeadingDelimiter', 'red', '', '') -call HighLight('markdownListMarker', 'blue', '', '') -call HighLight('markdownOrderedListMarker', 'blue', '', '') -call HighLight('markdownCode', 'purple', '', '') -call HighLight('markdownCodeBlock', 'purple', '', '') -call HighLight('markdownCodeDelimiter', 'purple', '', '') -call HighLight('markdownH1', 'blue', '', '') -call HighLight('markdownH2', 'blue', '', '') -call HighLight('markdownH3', 'cyan', '', '') -call HighLight('markdownH4', 'cyan', '', '') -call HighLight('markdownH5', 'green', '', '') +call hlg('markdownHeadingRule', 'red', '', '') +call hlg('markdownHeadingDelimiter', 'red', '', '') +call hlg('markdownListMarker', 'blue', '', '') +call hlg('markdownOrderedListMarker', 'blue', '', '') +call hlg('markdownCode', 'purple', '', '') +call hlg('markdownCodeBlock', 'purple', '', '') +call hlg('markdownCodeDelimiter', 'purple', '', '') +call hlg('markdownH1', 'blue', '', '') +call hlg('markdownH2', 'blue', '', '') +call hlg('markdownH3', 'cyan', '', '') +call hlg('markdownH4', 'cyan', '', '') +call hlg('markdownH5', 'green', '', '') " ShowMarks {{{2 -call HighLight('ShowMarksHLm', 'cyan', '', '') -call HighLight('ShowMarksHLl', 'orange', '', '') -call HighLight('ShowMarksHLo', 'purple', '', '') -call HighLight('ShowMarksHLu', 'yellow', '', '') +call hlg('ShowMarksHLm', 'cyan', '', '') +call hlg('ShowMarksHLl', 'orange', '', '') +call hlg('ShowMarksHLo', 'purple', '', '') +call hlg('ShowMarksHLu', 'yellow', '', '') " Lua {{{2 -call HighLight('luaRepeat', 'purple', '', '') -call HighLight('luaStatement', 'purple', '', '') -call HighLight('luaCond', 'green', '', '') -call HighLight('luaCondEnd', 'green', '', '') -call HighLight('luaCondStart', 'green', '', '') -call HighLight('luaCondElseif', 'green', '', '') +call hlg('luaRepeat', 'purple', '', '') +call hlg('luaStatement', 'purple', '', '') +call hlg('luaCond', 'green', '', '') +call hlg('luaCondEnd', 'green', '', '') +call hlg('luaCondStart', 'green', '', '') +call hlg('luaCondElseif', 'green', '', '') " Go {{{2 -call HighLight('goDeclType', 'blue', '', '') -call HighLight('goLabel', 'purple', '', '') -call HighLight('goRepeat', 'purple', '', '') -call HighLight('goBuiltins', 'purple', '', '') -call HighLight('goStatement', 'purple', '', '') -call HighLight('goDirective', 'purple', '', '') -call HighLight('goDeclaration', 'purple', '', '') -call HighLight('goConditional', 'purple', '', '') -call HighLight('goTodo', 'yellow', '', '') -call HighLight('goConstants', 'orange', '', '') +call hlg('goDeclType', 'blue', '', '') +call hlg('goLabel', 'purple', '', '') +call hlg('goRepeat', 'purple', '', '') +call hlg('goBuiltins', 'purple', '', '') +call hlg('goStatement', 'purple', '', '') +call hlg('goDirective', 'purple', '', '') +call hlg('goDeclaration', 'purple', '', '') +call hlg('goConditional', 'purple', '', '') +call hlg('goTodo', 'yellow', '', '') +call hlg('goConstants', 'orange', '', '') " Clojure {{{2 -call HighLight('clojureException', 'red', '', '') -call HighLight('clojureParen', 'cyan', '', '') -call HighLight('clojureCond', 'blue', '', '') -call HighLight('clojureFunc', 'blue', '', '') -call HighLight('clojureMeta', 'blue', '', '') -call HighLight('clojureMacro', 'blue', '', '') -call HighLight('clojureDeref', 'blue', '', '') -call HighLight('clojureQuote', 'blue', '', '') -call HighLight('clojureRepeat', 'blue', '', '') -call HighLight('clojureRepeat', 'blue', '', '') -call HighLight('clojureUnquote', 'blue', '', '') -call HighLight('clojureAnonArg', 'blue', '', '') -call HighLight('clojureDispatch', 'blue', '', '') -call HighLight('clojureString', 'green', '', '') -call HighLight('clojureRegexp', 'green', '', '') -call HighLight('clojureKeyword', 'green', '', '') -call HighLight('clojureDefine', 'purple', '', '') -call HighLight('clojureSpecial', 'purple', '', '') -call HighLight('clojureVariable', 'yellow', '', '') -call HighLight('clojureBoolean', 'orange', '', '') -call HighLight('clojureNumber', 'orange', '', '') -call HighLight('clojureConstant', 'orange', '', '') -call HighLight('clojureCharacter', 'orange', '', '') +call hlg('clojureException', 'red', '', '') +call hlg('clojureParen', 'cyan', '', '') +call hlg('clojureCond', 'blue', '', '') +call hlg('clojureFunc', 'blue', '', '') +call hlg('clojureMeta', 'blue', '', '') +call hlg('clojureMacro', 'blue', '', '') +call hlg('clojureDeref', 'blue', '', '') +call hlg('clojureQuote', 'blue', '', '') +call hlg('clojureRepeat', 'blue', '', '') +call hlg('clojureRepeat', 'blue', '', '') +call hlg('clojureUnquote', 'blue', '', '') +call hlg('clojureAnonArg', 'blue', '', '') +call hlg('clojureDispatch', 'blue', '', '') +call hlg('clojureString', 'green', '', '') +call hlg('clojureRegexp', 'green', '', '') +call hlg('clojureKeyword', 'green', '', '') +call hlg('clojureDefine', 'purple', '', '') +call hlg('clojureSpecial', 'purple', '', '') +call hlg('clojureVariable', 'yellow', '', '') +call hlg('clojureBoolean', 'orange', '', '') +call hlg('clojureNumber', 'orange', '', '') +call hlg('clojureConstant', 'orange', '', '') +call hlg('clojureCharacter', 'orange', '', '') " Scala {{{2 -call HighLight('scalaPackage', 'red', '', '') -call HighLight('scalaVar', 'cyan', '', '') -call HighLight('scalaDefName', 'blue', '', '') -call HighLight('scalaBackTick', 'blue', '', '') -call HighLight('scalaMethodCall', 'blue', '', '') -call HighLight('scalaXml', 'green', '', '') -call HighLight('scalaString', 'green', '', '') -call HighLight('scalaBackTick', 'green', '', '') -call HighLight('scalaEmptyString', 'green', '', '') -call HighLight('scalaStringEscape', 'green', '', '') -call HighLight('scalaMultiLineString', 'green', '', '') -call HighLight('scalaTypeSpecializer', 'yellow', '', '') -call HighLight('scalaDefSpecializer', 'yellow', '', '') -call HighLight('scalaType', 'yellow', '', '') -call HighLight('scalaCaseType', 'yellow', '', '') -call HighLight('scalaAnnotation', 'orange', '', '') -call HighLight('scalaSymbol', 'orange', '', '') -call HighLight('scalaUnicode', 'orange', '', '') -call HighLight('scalaBoolean', 'orange', '', '') -call HighLight('scalaNumber', 'orange', '', '') -call HighLight('scalaChar', 'orange', '', '') -call HighLight('scalaImport', 'purple', '', '') -call HighLight('scalaDef', 'purple', '', '') -call HighLight('scalaVal', 'purple', '', '') -call HighLight('scalaClass', 'purple', '', '') -call HighLight('scalaTrait', 'purple', '', '') -call HighLight('scalaObject', 'purple', '', '') -call HighLight('scalaKeywordModifier', 'purple', '', '') -call HighLight('scalaDocComment', 'commnt', '', '') -call HighLight('scalaComment', 'commnt', '', '') -call HighLight('scalaDocTags', 'commnt', '', '') -call HighLight('scalaLineComment', 'commnt', '', '') +call hlg('scalaPackage', 'red', '', '') +call hlg('scalaVar', 'cyan', '', '') +call hlg('scalaDefName', 'blue', '', '') +call hlg('scalaBackTick', 'blue', '', '') +call hlg('scalaMethodCall', 'blue', '', '') +call hlg('scalaXml', 'green', '', '') +call hlg('scalaString', 'green', '', '') +call hlg('scalaBackTick', 'green', '', '') +call hlg('scalaEmptyString', 'green', '', '') +call hlg('scalaStringEscape', 'green', '', '') +call hlg('scalaMultiLineString', 'green', '', '') +call hlg('scalaTypeSpecializer', 'yellow', '', '') +call hlg('scalaDefSpecializer', 'yellow', '', '') +call hlg('scalaType', 'yellow', '', '') +call hlg('scalaCaseType', 'yellow', '', '') +call hlg('scalaAnnotation', 'orange', '', '') +call hlg('scalaSymbol', 'orange', '', '') +call hlg('scalaUnicode', 'orange', '', '') +call hlg('scalaBoolean', 'orange', '', '') +call hlg('scalaNumber', 'orange', '', '') +call hlg('scalaChar', 'orange', '', '') +call hlg('scalaImport', 'purple', '', '') +call hlg('scalaDef', 'purple', '', '') +call hlg('scalaVal', 'purple', '', '') +call hlg('scalaClass', 'purple', '', '') +call hlg('scalaTrait', 'purple', '', '') +call hlg('scalaObject', 'purple', '', '') +call hlg('scalaKeywordModifier', 'purple', '', '') +call hlg('scalaDocComment', 'commnt', '', '') +call hlg('scalaComment', 'commnt', '', '') +call hlg('scalaDocTags', 'commnt', '', '') +call hlg('scalaLineComment', 'commnt', '', '') " Diff {{{2 -call HighLight('DiffDelete', 'red', '', '') -call HighLight('DiffChange', 'blue', '', '') -call HighLight('DiffAdd', 'green', '', '') -call HighLight('DiffText', 'line', 'blue', '') +call hlg('DiffDelete', 'red', '', '') +call hlg('DiffChange', 'blue', '', '') +call hlg('DiffAdd', 'green', '', '') +call 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 HighLight +delfunction hlg let g:colors_name = 'jinx' + +" vim:fdm=marker diff --git a/base/.vimrc b/base/.vimrc index aa205449..ac801afd 100644 --- a/base/.vimrc +++ b/base/.vimrc @@ -5,94 +5,103 @@ scriptencoding utf8 " Arch defaults runtime! archlinux.vim +" leader key +let g:mapleader = "\" + " 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 = "\" - -" ------ 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 = "\Ptmux;\\e[5 q\\\" - let &t_SR = "\Ptmux;\\e[4 q\\\" - let &t_EI = "\Ptmux;\\e[2 q\\\" - 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 = "\Ptmux;\\e[5 q\\\" + let &t_SR = "\Ptmux;\\e[4 q\\\" + let &t_EI = "\Ptmux;\\e[2 q\\\" + 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 ranger() -command! Q call quitbuffer() -command! -nargs=1 B :call bufferselect("") -command! W execute 'silent w !sudo tee % >/dev/null' | edit! +command! -bang -complete=buffer -nargs=? Bclose call Bclose(, ) +command! -complete=buffer -nargs=? Bselect call Bselect() +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 gg"+yG'' + " open ranger as a file chooser using the function below nnoremap r :call ranger() -" match string to switch buffer -nnoremap b :let b:buf = input('Match: ')call bufferselect(b:buf) +nnoremap b :Bselect +nnoremap q :Bclose:silent tabclosegT " change windows with ctrl+(hjkl) nnoremap @@ -106,6 +115,7 @@ nnoremap Y y$ nnoremap n nzzzv nnoremap N Nzzzv nnoremap ==1j +vnoremap == " re-visual text after changing indent vnoremap > >gv @@ -121,6 +131,9 @@ nmap k v:count ? 'k' : 'gk' " open a terminal in $PWD nnoremap tt :terminal +" toggle folding +nnoremap za :set foldenable! + " tab control nnoremap :tabmove -1 nnoremap :tabmove +1 @@ -139,30 +152,44 @@ nnoremap - :tabedit =expand("%:p:h") nnoremap _ s nnoremap v +" fix syntax highlighting issues +nnoremap U :syntax sync fromstart:redraw! + " ------ 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 ss - \ :let b:_p = getpos(".") - \ let b:_s = (@/ != '') ? @/ : '' - \ %s/\s\+$//e - \ let @/ = b:_s - \ nohlsearch - \ unlet b:_s - \ call setpos('.', b:_p) - \ unlet b:_p + \ :let b:_p = getpos(".") + \ let b:_s = (@/ != '') ? @/ : '' + \ %s/\s\+$//e + \ let @/ = b:_s + \ nohlsearch + \ unlet b:_s + \ call setpos('.', b:_p) + \ unlet b:_p " global replace vnoremap sw "hy - \ :let b:sub = input('global replacement: ') - \ if b:sub !=? '' - \ let b:rep = substitute(getreg('h'), '/', '\\/', 'g') - \ execute '%s/'.b:rep."/".b:sub.'/g' - \ unlet b:sub b:rep - \ endif + \ :let b:sub = input('global replacement: ') + \ if b:sub !=? '' + \ let b:rep = substitute(getreg('h'), '/', '\\/', 'g') + \ execute '%s/'.b:rep."/".b:sub.'/g' + \ unlet b:sub b:rep + \ endif nnoremap sw - \ :let b:sub = input('global replacement: ') - \ if b:sub !=? '' - \ execute "%s//".b:sub.'/g' - \ unlet b:sub - \ endif + \ :let b:sub = input('global replacement: ') + \ if b:sub !=? '' + \ execute "%s//".b:sub.'/g' + \ unlet b:sub + \ endif " prompt before each replace vnoremap cw "hy - \ :let b:sub = input('interactive replacement: ') - \ if b:sub !=? '' - \ let b:rep = substitute(getreg('h'), '/', '\\/', 'g') - \ execute '%s/'.b:rep.'/'.b:sub.'/gc' - \ unlet b:sub b:rep - \ endif + \ :let b:sub = input('interactive replacement: ') + \ if b:sub !=? '' + \ let b:rep = substitute(getreg('h'), '/', '\\/', 'g') + \ execute '%s/'.b:rep.'/'.b:sub.'/gc' + \ unlet b:sub b:rep + \ endif nnoremap cw - \ :let b:sub = input('interactive replacement: ') - \ if b:sub !=? '' - \ execute "%s//".b:sub.'/gc' - \ unlet b:sub - \ endif + \ :let b:sub = input('interactive replacement: ') + \ if b:sub !=? '' + \ execute "%s//".b:sub.'/gc' + \ unlet b:sub + \ endif " highlight long lines, ll (long lines) let w:longlines = matchadd('ColorColumn', '\%'.&textwidth.'v', &textwidth) nnoremap ll - \ :if exists('w:longlines') - \ silent! call matchdelete(w:longlines) - \ echo 'Long line highlighting disabled' - \ unlet w:longlines - \ elseif &textwidth > 0 - \ let w:longlines = matchadd('ColorColumn', '\%'.&textwidth.'v', &textwidth) - \ echo 'Long line highlighting enabled' - \ else - \ let w:longlines = matchadd('ColorColumn', '\%80v', 81) - \ echo 'Long line highlighting enabled' - \ endif + \ :if exists('w:longlines') + \ silent! call matchdelete(w:longlines) + \ echo 'Long line highlighting disabled' + \ unlet w:longlines + \ elseif &textwidth > 0 + \ let w:longlines = matchadd('ColorColumn', '\%'.&textwidth.'v', &textwidth) + \ echo 'Long line highlighting enabled' + \ else + \ let w:longlines = matchadd('ColorColumn', '\%80v', 81) + \ echo 'Long line highlighting enabled' + \ endif " local keyword jump nnoremap fw - \ [I:let b:jump = input('Go To: ') - \ if b:jump !=? '' - \ execute "normal! ".b:jump."[\t" - \ unlet b:jump - \ endif + \ [I:let b:jump = input('Go To: ') + \ if b:jump !=? '' + \ execute "normal! ".b:jump."[\t" + \ unlet b:jump + \ endif -" quit the current buffer and switch to the next -" without this vim will leave you on an empty buffer after quiting the current -function! 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! 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! 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 diff --git a/base/.xprofile b/base/.xprofile index 257f1265..fd9ac985 100644 --- a/base/.xprofile +++ b/base/.xprofile @@ -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 & diff --git a/base/bin/rofi_run b/base/bin/rofi_run index 4942390f..8b6cd69b 100755 --- a/base/bin/rofi_run +++ b/base/bin/rofi_run @@ -1,11 +1,11 @@ #!/usr/bin/env bash NAME="${0##*/}" -VER="0.6" +VER="0.7" usage() { - cat <<- EOF + cat </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")" diff --git a/bspwm-home/.config/bspwm/bspwmrc b/bspwm-home/.config/bspwm/bspwmrc index 5d6105bf..ec24833b 100755 --- a/bspwm-home/.config/bspwm/bspwmrc +++ b/bspwm-home/.config/bspwm/bspwmrc @@ -6,9 +6,6 @@ xsetroot -cursor_name left_ptr # key bindings sxhkd & -# launch compton -al-compositor --start & - # panel al-polybar-session & diff --git a/i3-gaps-home/.config/i3/config b/i3-gaps-home/.config/i3/config index 4b72720d..3ea40200 100644 --- a/i3-gaps-home/.config/i3/config +++ b/i3-gaps-home/.config/i3/config @@ -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 diff --git a/openbox-home/.config/openbox/autostart b/openbox-home/.config/openbox/autostart index da5a23d7..2b862cec 100644 --- a/openbox-home/.config/openbox/autostart +++ b/openbox-home/.config/openbox/autostart @@ -1,6 +1,3 @@ -# compton -al-compositor --start & - # required for xfce settings to work xfsettingsd & diff --git a/openbox-home/.config/tint2/tint2rc b/openbox-home/.config/tint2/tint2rc index be7c586a..f5420b8b 100644 --- a/openbox-home/.config/tint2/tint2rc +++ b/openbox-home/.config/tint2/tint2rc @@ -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 #-------------------------------------