| Assignment | |
|---|---|
Assign value to variable if variable is not already set, value is returned.Combine with a : no-op to discard/ignore return value. |
${variable="value"}: ${variable="value"} |
Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.
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
| inoremap <silent> = =<Esc>:call <SID>ealign()<CR>a | |
| function! s:ealign() | |
| let p = '^.*=\s.*$' | |
| if exists(':Tabularize') && getline('.') =~# '^.*=' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p) | |
| let column = strlen(substitute(getline('.')[0:col('.')],'[^=]','','g')) | |
| let position = strlen(matchstr(getline('.')[0:col('.')],'.*=\s*\zs.*')) | |
| Tabularize/=/l1 | |
| normal! 0 | |
| call search(repeat('[^=]*=',column).'\s\{-\}'.repeat('.',position),'ce',line('.')) | |
| 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
| inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a | |
| function! s:align() | |
| let p = '^\s*|\s.*\s|\s*$' | |
| if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p) | |
| let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g')) | |
| let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*')) | |
| Tabularize/|/l1 | |
| normal! 0 | |
| call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.')) |