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
" 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
class AroundEverything | |
class Nested | |
def example | |
some_chain.continued_on. | |
next_line.method do |one, two| | |
<<-EOF | |
Body of method | |
EOF | |
end |
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
module ActiveRecord | |
class Attribute # :nodoc: | |
class << self | |
def from_database(name, value, type) | |
FromDatabase.new(name, value, type) | |
end | |
def from_user(name, value, type) | |
FromUser.new(name, value, type) | |
end |
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
function! s:Stats(list) | |
let sum = 0 | |
for item in a:list | |
let sum += item | |
endfor | |
let mean = sum / len(a:list) | |
let sum_deviations = 0 | |
for item in a:list |
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
command! ConvertDict call s:ConvertDict() | |
function! s:ConvertDict() | |
" Save view for restoring later | |
let saved_view = winsaveview() | |
" If we're not in a dict, do nothing | |
if searchpair('{', '', '}', 'bcW', '', line('.')) <= 0 | |
return | |
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
" The filename used for the cfile | |
let s:cfile_filename = '' | |
" The last mtime of the filename | |
let s:cfile_mtime = -1 | |
" Define a command that can be called like: | |
" | |
" Cfile errors.txt | |
" | |
" Apart from loading the error file in the quickfix window, it also |
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
" This is a project-specific Vim file that boosts ember_tools' gf mapping to | |
" follow translation keys to their yaml files. | |
let g:ember_tools_custom_gf_callbacks = [ | |
\ 'EmberGfTranslations' | |
\ ] | |
function! EmberGfTranslations() | |
" only emblem files in this project | |
if &filetype != 'emblem' |