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
require 'set' | |
class SnippetGenerator | |
def initialize | |
@done = Set.new | |
end | |
def snippet_from_trigger_and_expansion(trigger, expansion, options = {}) | |
return nil if @done.include?(trigger) |
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:plugin_setting_dirname = expand('~/.vim/plugin_settings') | |
function! s:edit_plugin_setting(plugin_name) | |
if !isdirectory(s:plugin_setting_dirname) | |
call mkdir(s:plugin_setting_dirname) | |
endif | |
execute 'edit' s:plugin_setting_dirname . '/' . a:plugin_name . '.vim' | |
endfunction | |
command! -nargs=1 |
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
augroup LightLine | |
autocmd! | |
autocmd WinEnter,BufWinEnter,FileType,ColorScheme * call s:filtered_lightline_call('update') | |
autocmd ColorScheme,SessionLoadPost * call s:filtered_lightline_call('highlight') | |
autocmd CursorMoved,BufUnload * call s:filtered_lightline_call('update_once') | |
augroup END |
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:filtered_lightline_call(funcname) | |
if bufname('%') == '__CS__' | |
return | |
endif | |
execute 'call lightline#' . a:funcname . '()' | |
endfunction |
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
augroup LightLine | |
autocmd! | |
augroup END |
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
augroup LightLine | |
autocmd! | |
autocmd WinEnter,BufWinEnter,FileType,ColorScheme * call lightline#update() | |
autocmd ColorScheme,SessionLoadPost * call lightline#highlight() | |
autocmd CursorMoved,BufUnload * call lightline#update_once() | |
augroup END |
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 g:switch_custom_definitions = | |
\ [ | |
\ { | |
\ '\vhttps://github.com/(.*)/(.*)': '\1/\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
let s:my_bundles = g:yaml_load('~/.vim/bundles.yml') | |
for bundle in s:my_bundles | |
for [bundle_source_name, bundle_options] in items(bundle) | |
execute 'NeoBundle "' . bundle_source_name . '", ' . string(bundle_options) | |
endfor | |
endfor |
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! g:yaml_load(filename) | |
ruby << EOF | |
require 'yaml' | |
obj = YAML.load_file(File.expand_path(VIM::evaluate('a:filename'))) | |
obj_hash = obj.inspect.gsub('=>', ':').gsub('nil', '{}') | |
VIM::command("let l:ret = #{obj_hash}") | |
EOF | |
return l:ret | |
endfunction |
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
--- | |
- user/repo: | |
option: value | |
option2: value2 | |
... |