Skip to content

Instantly share code, notes, and snippets.

@Phize
Phize / .vimrc
Created February 1, 2012 08:25
align comment(s) with Align Them All! plugin on Vim.
" return regexp pattern that matches a comment based on commentstring.
function! s:getCommentStringPattern()
let pattern = escape(&commentstring, '^$[].*\~ ')
let pattern = substitute(pattern, '%s', '.*', 'g')
return pattern
endfunction
" align comment(s) based on commentstring.
autocmd vimrc-autocmd BufEnter *
@Phize
Phize / .vimrc
Created January 15, 2012 11:15
Vim plugins which I used (a part of my .vimrc)
My Vim files have moved to https://github.com/Phize/vim
@Phize
Phize / 50-ref.vim
Created January 14, 2012 10:32
Vim statusline for ref.vim with vim-powerline.
autocmd BufFilePost \[ref-*:*\] call Pl#UpdateStatusline(1)
call Pl#Statusline(
\ Pl#Match('bufname("%")', '^\[ref-(.+):(.*)\]$'),
\
\ Pl#Segment(' %{"Ref"} ',
\ Pl#HiCurrent( Pl#FG(231), Pl#BG(240), Pl#Attr('bold')),
\ Pl#HiInsert( Pl#FG(231), Pl#BG( 31), Pl#Attr('bold')),
\ Pl#HiNonCurrent(Pl#FG(244), Pl#BG(234), Pl#Attr('bold'))
\ ),
@Phize
Phize / 50-unite.vim
Created January 14, 2012 07:48
Vim statusline for Unite.vim with vim-powerline.
call Pl#Statusline(
\ Pl#Match('bufname("%")', '^\*unite\* - .*\@\d+$'),
\
\ Pl#Segment(' %{"Unite"} ',
\ Pl#HiCurrent( Pl#FG(231), Pl#BG(240), Pl#Attr('bold')),
\ Pl#HiInsert( Pl#FG(231), Pl#BG( 31), Pl#Attr('bold')),
\ Pl#HiNonCurrent(Pl#FG(244), Pl#BG(234), Pl#Attr('bold'))
\ ),
\
\ Pl#Segment('%< %{substitute(bufname("%"), "\^\\v\\*unite\\* - \(\.\+\)\\@\\d\+\$", "\\u\\1", "")} list',
@Phize
Phize / keyword.rb
Created December 28, 2011 17:03 — forked from jugyo/keyword.rb
keyword plugin for Earthquake(Ruby based Twitter client)
# keyword plugin
# ====
#
# config example:
#
# Earthquake.config[:keyword] = {:pattern => /ruby|rails|earthquake/i}
#
Earthquake.init do
_ = config[:keyword] ||= {}
_[:notify] = true if _[:notify].nil?
@Phize
Phize / .vimrc
Created December 28, 2011 12:57
Vim: CSS tag list with Ctags (patched) + Tagbar plugin.
" Ctags (patch): http://designtomarkup.com/vim/taglist-ctags-css-patch
" Tagbar : https://github.com/majutsushi/tagbar
" Screenshot : http://twitpic.com/7zq4d7
"Tagbar
noremap <silent> <Leader>t :<C-u>TagbarToggle<CR>
let g:tagbar_type_css = {
\ 'ctagstype' : 'Css',
\ 'kinds' : [
@Phize
Phize / tree.diag
Created December 9, 2011 05:48
Directory / File tree with blockdiag.
diagram {
default_fontsize = 13; // default value is 11
default_linecolor = "#999"; // default value is black
node_width = 64; // default value is 128
node_height = 20; // default value is 40
span_width = 16; // default value is 64
span_height = 10; // default value is 40
// classes for node.
class folder [color = "#fc0", linecolor = "#c90"];
@Phize
Phize / csslint.vim
Created October 21, 2011 16:05
CSSLint (Rhino) compiler plugin.
if exists('current_compiler')
finish
endif
let current_compiler = 'csslint'
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
@Phize
Phize / rhinoed_jslint.vim
Created October 21, 2011 16:05
JSLint (Rhino) compiler plugin.
if exists('current_compiler')
finish
endif
let current_compiler = 'rhinoed_jslint'
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
@Phize
Phize / jshint.vim
Created October 21, 2011 16:04
JSHint (Rhino) compiler plugin.
if exists('current_compiler')
finish
endif
let current_compiler = 'jshint'
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo