Skip to content

Instantly share code, notes, and snippets.

inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a
function! s:align()
let p = '^\s*|\s.*\s|\s*$'
if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g'))
let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*'))
Tabularize/|/l1
normal! 0
call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
@tpope
tpope / 90-rodecaster-pro-ii.rules
Created July 6, 2022 20:53
RODECaster Pro II PulseAudio support
# /etc/udev/rules.d/90-rodecaster-pro-ii.rules
# RODECaster Pro II primary USB interface: 19f7:0030
# RODECaster Pro II secondary USB interface: 19f7:0026
# We're only concerned with the former.
# PulseAudio
ATTRS{idVendor}=="19f7", ATTRS{idProduct}=="0030", ENV{PULSE_PROFILE_SET}="rodecaster-pro-ii.conf"
# PipeWire
@tpope
tpope / .gitattributes
Created October 24, 2010 20:38
Fewer conflicts in your Rails apps
Gemfile.lock merge=bundlelock
db/schema.rb merge=railsschema
@tpope
tpope / css.vim
Created January 2, 2011 05:42
Nikolai's fix to nested closing curly brace indenting
" Vim indent file
" Language: CSS
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2010-12-22
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
@tpope
tpope / gtk.css
Last active May 9, 2022 23:42
Alt-X/C/V as cut/copy/paste in GTK apps
/* ~/.config/gtk-3.0/gtk.css */
@import url("file:///usr/share/themes/Emacs/gtk-3.0/gtk-keys.css");
@binding-set gtk-alt-clipboard {
bind "<alt>x" { "cut-clipboard" () };
bind "<alt>c" { "copy-clipboard" () };
bind "<alt>v" { "paste-clipboard" () };
}
@tpope
tpope / .netrc
Created December 10, 2012 00:46
Sample netrc
machine api.heroku.com
login my@email.com
password 01230123012301230123012301230123
machine api.github.com password something login somebody
machine ftp.server login abc password def account ghi macdef somemacro
cd somehwhere
continues until end of paragraph
@tpope
tpope / 20-chrome-suxxx.conf
Created October 19, 2019 22:41
Fix Chrome's chrome using mono-chrome emoji
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="pattern">
<test qual="any" name="family">
<string>Symbola</string>
</test>
<test qual="any" name="prgname" compare="contains">
<string>chrom</string>
</test>
if !has('gui_running')
for s:chr in map(range(char2nr('!'), char2nr('~')), 'nr2char(v:val)')
let s:key = get({'\': 'M-Bslash', '>': 'M-char-62', '[': '', ']': '', 'O': '', 'P': ''}, s:chr, 'M-' . s:chr)
if len(s:key)
exe escape("set <" . s:key . ">=\e" . s:chr, '\|"')
endif
endfor
exe "set <M-Space>=\e\\ "
exe "set <M-CR>=\e\r"
endif
@tpope
tpope / lists.md
Created January 1, 2019 21:11
Markdown list test
  1. one a. A i. one ii. two b. B
  2. two
@tpope
tpope / cloud2butt.vim
Created September 18, 2014 06:12
Cloud to Butt dot Vim
function! s:butt() abort
syn match cloud2butt "\<th\%(e cloud\>\)\@=" conceal cchar=m
syn match cloud2butt "\%(\<th\)\@<=e\%( cloud\>\)\@=" conceal cchar=y
syn match cloud2butt "\%(\<the \)\@<=c\%(loud\>\)\@=" conceal cchar=b
syn match cloud2butt "\%(\<the c\)\@<=l\%(oud\>\)\@=" conceal cchar=u
syn match cloud2butt "\%(\<the cl\)\@<=o\%(ud\>\)\@=" conceal cchar=t
syn match cloud2butt "\%(\<the clo\)\@<=ud\>" conceal cchar=t
endfunction