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
| function! s:move_block(d) range | |
| let cnt = a:lastline - a:firstline | |
| if a:d ==# 'u' | |
| let sign = '-' | |
| let cnt = 2 | |
| else | |
| let sign = '+' | |
| let cnt += 1 | |
| endif |
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
| <?xml version="1.0"?> | |
| <root> | |
| <!-- Devices --> | |
| <devicevendordef> | |
| <vendorname>TopreCorporation</vendorname> | |
| <vendorid>0x853</vendorid> | |
| </devicevendordef> | |
| <deviceproductdef> | |
| <productname>Realforce87</productname> |
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
| " show/hide line number wisely: this needs Vim 7.3 or above | |
| function! s:toggle_line_number() | |
| let NU = 'nu' | |
| let RNU = 'rnu' | |
| if &nu || &rnu | |
| " to be off | |
| let b:prev = { 'nu': &nu, 'rnu': &rnu } | |
| let &nu = 0 | |
| let &rnu = 0 |
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
| " open the current editing file's location using file manager | |
| function! s:open_with_filer() | |
| let cmd = s:get_command() | |
| let path = s:convert_path(expand('%:p:h')) | |
| if cmd is# '' | |
| call g:echohl('Error', 'Your system is not supported.') | |
| return | |
| endif |
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
| #! ruby | |
| require "rubygems" | |
| require "yajl" | |
| exit 0 if ARGV.length == 0 | |
| begin | |
| lines = ARGF.read | |
| Yajl::Parser.new.parse(lines) | |
| exit 0 |
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
| " quickfix | |
| function! s:redir(cmd) | |
| redir => res | |
| execute a:cmd | |
| redir END | |
| return res | |
| endfunction | |
| function! s:toggle_qf_list() |
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
| #! ruby | |
| # coding: utf-8 | |
| require "rubygems" | |
| require "watir-webdriver" | |
| browser = Watir::Browser.new :firefox, :profile => "default" | |
| browser.goto "http://green.goo.ne.jp/" | |
| btn = browser.div(:id => "tree").div(:class => "btn").images[0] | |
| div = browser.div(:id => "tree").ul(:class => "clearfix").li(:class => "count").divs[2] |
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
| " JSON (Chef) | |
| autocmd BufRead,BufNewFile knife-edit-*.js,*.json setlocal filetype=javascript.json | |
| autocmd FileType *json* setlocal makeprg=python\ -mjson.tool\ 2>&1\ %\ >\ /dev/null | |
| \| setlocal errorformat=%m:\ line\ %l\ column\ %c\ %.%# |
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:chef = {} | |
| function! s:chef.convert_attr_notation() abort | |
| if !search('\>', 'bcnW') | |
| return | |
| endif | |
| let [bufnbr, lnum, col, offset] = getpos('.') | |
| let line = getline(lnum) |
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
| function weechat { | |
| if [ -x `which weechat-curses` ]; then | |
| if ! (ps aux | grep '[w]eechat-curses' 2>&1 > /dev/null); then | |
| tmux new-window -t ${WEECHAT_TMUX_WINNUM:-98} weechat-curses | |
| fi | |
| fi | |
| } |