Skip to content

Instantly share code, notes, and snippets.

@PeterRincker
PeterRincker / cupcake.txt
Created December 20, 2014 01:08
Cupcake - Simple SQL query runner
*cupcake.txt* SQL query runner
Author: Peter Rincker *cupcake-author*
License: Same terms as Vim itself (see |license|)
This plugin is only available if 'compatible' is not set.
==============================================================================
*cupcake*
@PeterRincker
PeterRincker / quick-replace.vim
Last active April 18, 2022 20:20 — forked from orlp/gist:8c25ed4abb36372bc6fe
Quick Replacements - gn with an n afterwards
" Quick Replace
" Makes *``cgn like workflows faster by automatically moving to next match. Repeat with `.`
"
" Requires repeat.vim
"
" Example mappings:
" nmap cm <Plug>(quick-replace)
" xmap C <Plug>(quick-replace)
"
" mnemonic: cm for change matches
@PeterRincker
PeterRincker / css_fold.vim
Last active August 29, 2015 13:58
Fold multi-line CSS into one line CSS style. Use `>s` and `<s` to increase or decrease the width of the default selector field area. Save as ~/.vim/ftplugin/css_fold.vim
" Adapation form http://stackoverflow.com/a/1423394/438329
if exists('b:loaded_cssfold')
finish
endif
let b:loaded_cssfold = 1
let b:width = 25
nnoremap <silent> <buffer> >s :<c-u>let b:width+=v:count1<cr><c-l>
nnoremap <silent> <buffer> <s :<c-u>let b:width-=v:count1<cr><c-l>
if exists('b:loaded_phpthis') || &cp
finish
endif
let b:loaded_phpthis = 1
if !exists("b:undo_ftplugin")
let b:undo_ftplugin = ""
endif
function! s:synnames(...) abort
" Set b:formatprg to emulate a setlocal for formatprg
if exists('g:loaded_gq') || &cp || v:version < 700
finish
endif
let g:loaded_gq = 1
function! s:gq(type, ...)
let formatprg = &formatprg
let &formatprg = get(b:, 'formatprg', &formatprg)