This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " Introducing Vimpeg - A PEG Parser Generator for Vim | |
| " Barry Arthur, 01 Oct 2011 | |
| " Evaluate a series of inline integer addition & subtraction operations | |
| let p = vimpeg#parser({'skip_white': 1}) | |
| call p.e('\d\+', {'id': 'integer'}) | |
| let addsub = | |
| \ p.and( | |
| \ [ 'integer', | |
| \ p.maybe_many( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let s:orig_statusline = &statusline | |
| function! HTMLCurrentDivId() | |
| let m = searchpos('<\s*div.\{-}id\s*=\s*"\([^"]*\)"', 'bnWp') | |
| if m[2] == 2 | |
| return matchlist(getline(m[0]), 'id\s*=\s*"\([^"]*\)"')[1] | |
| else | |
| return '' | |
| endif | |
| endfunction |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " Edit file under cursor (not matching :help 'isfname) (:help gf) | |
| " (:help cWORD) | |
| function! EditFileWORD() | |
| let file = expand('<cWORD>') | |
| if findfile(file, &path) != '' | |
| let file .= "\<cr>" | |
| endif | |
| return ":edit " . file | |
| endfunction |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # color_plane - hsl(ish) map of Xresources colours | |
| # Barry Arthur | |
| require 'color' | |
| @opt_print_values = nil | |
| def swatch(color) | |
| print "\x1b[48;5;#{color}m " | |
| print @opt_print_values ? sprintf("%3s", color) : " " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " Clean-up of Swicher's Highlighter() | |
| " Barry Arthur 2012-09-15 | |
| function! Highlighter() | |
| let word_cursor = escape(expand('<cword>'), ".*[]\\") | |
| redir => output | |
| silent! execute '%s/\<'.word_cursor.'\>//gen' | |
| redir END | |
| if output != "" | |
| if str2nr(split(output)[0]) > 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # gfy: command-line tag search tool. | |
| # Barry Arthur 20121005 | |
| # expects tags file in current directory | |
| [ -z "$1" ] && echo "usage: gfy tag" && exit 1 | |
| grep -i "$1" tags | awk -F "\t" '{printf("vim %s -c\"%s\n", $2, $3);}' | sed -e 's/;"$/"/' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " Quiet Make | |
| "~~~~~~~~~~~~ | |
| function! QuietMake() | |
| write | |
| lcd %:p:h | |
| silent! make | |
| lcd - | |
| copen | |
| if empty(len(filter(getqflist(), 'v:val["valid"]'))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " dietabsdie.vim - Reopen new tabs as buffers | |
| " Barry Arthur, 4 June 2010 | |
| function! DieTabsDie() | |
| let tabbufname=expand('%') | |
| tabclose | |
| exe ":b " . expand(tabbufname) | |
| endfunction | |
| autocmd TabEnter * call DieTabsDie() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Bisectly Architecture Overview | |
| ------------------------------ | |
| Components | |
| ~~~~~~~~~~ | |
| * bin/bisectly | |
| * lib/bisectly/bsfl.rb | |
| * lib/bisectly/clients/vim.rb | |
| * lib/bisectly/thumpers/file_thumper.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " Edit file under cursor (not matching :help 'isfname) (:help gf) | |
| " Deliberately left off terminating <cr> if filename can't be found | |
| " to allow user to modify before execution. | |
| " (:help cWORD) | |
| function! EditFileWORD() | |
| let file = expand('<cWORD>') | |
| if findfile(file, &path) != '' | |
| let file .= "\<cr>" | |
| endif | |
| return ":edit " . file |