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
nnoremap <Plug>ToggleQf :call <SID>ToggleQf()<cr> | |
function! s:ToggleQf() | |
for buffer in tabpagebuflist() | |
if bufname(buffer) == '' | |
" then it should be the quickfix window | |
cclose | |
return | |
endif | |
endfor |
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 this in plugin/diffsplit.vim. | |
" | |
" Executing :Diffsplit on a file, containing a git diff would open up a new | |
" tab, cd to a temporary directory, and distribute the changes into separate | |
" files, mirroring the repo layout. You can then use NERDTree or whatever you | |
" like to browse through the changes. | |
" | |
" Using it straight from the command-line is fairly simple and aliasable: | |
" | |
" git diff whatever | vim - -R +Diffsplit |
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
" Invoke the `lebab` tool on the current buffer (https://github.com/lebab/lebab) | |
" | |
" Usage: | |
" | |
" :Lebab <transform1> <transform2> [...] | |
" | |
" This will run all the transforms specified and replace the buffer with the | |
" results. The available transforms tab-complete. | |
" | |
command! -nargs=+ -complete=custom,s:LebabComplete |
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
extern crate solution; | |
use solution::*; | |
use std::io::{self, Write}; | |
fn main() { | |
let mut game = Game::new("aardvark", 10).unwrap(); | |
let stdin = io::stdin(); | |
println!("Let's play hangman!"); |
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 python3 | |
""" | |
Usage: | |
websearch-prompt 'http://en.wikipedia.org/wiki/{0}' | |
websearch-prompt 'http://youtube.com/results?search_query={0}' | |
""" | |
import sys |
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
set includeexpr=<SID>Includeexpr() | |
augroup jsx_autocommands | |
autocmd! | |
" Override gf if rails sets it after | |
autocmd User Rails cmap <buffer><expr> <Plug><cfile> <SID>Includeexpr() | |
augroup END | |
function! s:Includeexpr() |
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
extern crate image; | |
use std::io::File; | |
use image::GenericImage; | |
fn main() { | |
let path = Path::new("examples/test_image.png"); | |
let file = File::open(&path); | |
match image::load(file, image::ImageFormat::PNG) { |
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
" Define what color the private area will be | |
hi rubyPrivateArea ctermbg=darkgray | |
function! s:MarkPrivateArea() | |
" Clear out any previous matches | |
call clearmatches() | |
" Store the current view, in order to restore it later | |
let saved_view = winsaveview() |
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
class AroundEverything | |
class Nested | |
def example | |
some_chain.continued_on. | |
next_line.method do |one, two| | |
<<-EOF | |
Body of method | |
EOF | |
end |