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:screen = [ | |
\" ", | |
\" # # # # # # # ", | |
\" # # # # # # # # ### # # # ", | |
\" # # # # # # # # # ##### # # ", | |
\" # # ### # # # # # |
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
" Utility function"{{{ | |
fun! Echo(e) | |
echo a:e | |
endfun | |
fun! Header(num) | |
echo "\n" . a:num . "\n" | |
endfun | |
command! -nargs=* H :call Header(<f-args>)"}}} | |
function! Curry(...)"{{{ |
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:ns = expand('<sfile>:p:r:gs?[\\/]?#?:s?^.*#autoload#??:s?$?#?') | |
function {s:ns}func() | |
echo "func()" | |
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
" Automatic `:!chmod +x %`. | |
command! -bar DisableAutoChmod let b:disable_auto_chmod = 1 | |
autocmd BufWritePost * call s:auto_chmod() | |
function! s:auto_chmod() | |
if !exists('b:disable_auto_chmod') | |
\ && getfperm(expand('%'))[2] !=# 'x' | |
\ && getline(1) =~# '^#!' | |
!chmod +x % | |
endif | |
endfunction |