This file contains 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
" Add line to remote vimrc file | |
" :[range]Y - send [range] lines to remote-pbcopy via netcat. | |
command! -range Y silent <line1>,<line2>w !nc localhost 5556 |
This file contains 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
" Use // in certain commands like :edit, :split, :read, etc. to insert the current buffer's directory | |
" :e// -> :e foo/bar/ | |
" | |
" Compatible commands: | |
" :edit/:split/:vsplit | |
" :find/:sfind | |
" :buffer/:sbuffer | |
" :read | |
" :diffpslit/:diffpatch | |
" :vimgrep/:grep |
This file contains 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
" :Cfilter[!] /{pat}/ | |
" :Cfilter[!] {pat} | |
" Filter the quickfix looking for pattern, `{pat}`. The pattern can match the filename or text. | |
" Providing `!` will invert the match (just like `grep -v`). | |
" Note: :cfilter command abbreviation is provided for convenience | |
" | |
" :Lfilter[!] /{pat}/ | |
" :Lfilter[!] {pat} | |
" Same as :Cfilter but use the location list. | |
" Note: :lfilter command abbreviation is provided for convenience |
This file contains 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
" :[range]SortGroup[!] [n|f|o|b|x] /{pattern}/ | |
" e.g. :SortGroup /^header/ | |
" e.g. :SortGroup n /^header/ | |
" See :h :sort for details | |
function! s:sort_by_header(bang, pat) range | |
let pat = a:pat | |
let opts = "" | |
if pat =~ '^\s*[nfxbo]\s' | |
let opts = matchstr(pat, '^\s*\zs[nfxbo]') |
This file contains 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
"Prismo.vim | |
" version of vim-prismo I took a crack at reimplimenting | |
" https://github.com/guywald1/vim-prismo | |
" | |
" Options: | |
" 'commentstring' - See :h 'commentstring'. Can use b:commentstring to override | |
" g:prismo_dash - padding character defaults to dash | |
" g:prismo_toupper - transform the title to uppercase (default to 1) | |
" b:prismo_width - width of header default to 'textwidth' or 80 if 'textwidth' is 0 | |
" |
This file contains 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
" put in ~/.vim/ftplugin/php_man.vim | |
" Will map K to show signature on commandline. | |
" Will also attempt to show signature while typing. | |
" | |
" Set g:php_quick_man_color = 0 to disable color | |
" Set g:php_quick_man_insert_mode = 0 to disable insert mode signature | |
if exists('b:ftplugin_php_man') | |
finish | |
endif |
This file contains 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
" Put inside ~/after/plugin/matchit.vim | |
if exists('g:loaded_after_matchit') || !has('syntax') || &cp || v:version < 700 | |
finish | |
endif | |
let g:loaded_after_matchit = 1 | |
function! s:synnames(...) abort | |
if a:0 | |
let [line, col] = [a:1, a:2] | |
else |
This file contains 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
" FancySmancyComment(text, fill_char, width) | |
" Create comment string with centered text | |
" All arguments are optional | |
function! FancySmancyComment(...) | |
let text = get(a:000, 0, '') | |
let fill = get(a:000, 1, '-')[0] | |
let width = get(a:000, 2, 80) - len(printf(&commentstring, '')) - len(text) | |
let left = width / 2 | |
let right = width - left | |
put=printf(&commentstring, repeat(fill, left) . text . repeat(fill, right)) |
This file contains 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
" Inspired by Tim Pope's commentary.vim | |
" | |
" Uses b:commentstring or 'commentstring' as the comment pattern | |
" example: | |
" let &commentstring = '/*%s*/' | |
nnoremap gcc :<c-u>.,.+<c-r>=v:count<cr>call <SID>toggleComment()<cr> | |
nnoremap gc :<c-u>set opfunc=<SID>commentOp<cr>g@ | |
xnoremap gc :call <SID>toggleComment()<cr> |
This file contains 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 python | |
# put this file at ~/.vim/compiler.py | |
from __future__ import print_function | |
from sys import argv, exit | |
if len(argv) != 2: | |
exit(1) |