2014/11/08 VimConf 2014
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 <silent> <Plug>(vimrc-show-current-syntax) | |
\ :<C-u>echo join(map(synstack(line('.'), col('.')), | |
\ 'synIDattr(v:val, "name") | |
\ ."(".synIDattr(synIDtrans(v:val), "name").")"'), ',')<CR> |
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
" == Naming convention. == {{{1 | |
" Command name | |
" - CamelCase | |
" Global function name | |
" - CamelCase | |
" Local function name | |
" - s:split_by_underbar | |
" Group name for autocmd | |
" - split-by-dash | |
" In vimrc, start with "vimrc" |
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
Collecting greenlet | |
1 location(s) to search for versions of greenlet: | |
* https://pypi.python.org/simple/greenlet/ | |
Getting page https://pypi.python.org/simple/greenlet/ | |
Starting new HTTPS connection (1): pypi.python.org | |
"GET /simple/greenlet/ HTTP/1.1" 200 24008 | |
Analyzing links from page https://pypi.python.org/simple/greenlet/ | |
Skipping link https://pypi.python.org/packages/00/6b/9d4b5faa314ac579fda43f874b69246f9d7d1635a39f02c5d5f8866f04e6/greenlet-0.4.5-cp27-none-win_amd64.whl#md5=e06ab7f742a642b7d5b490c90521d0fc (from https://pypi.python.org/simple/greenlet/); it is not compatible with this Python | |
Skipping link https://pypi.python.org/packages/00/73/63fa90c85f94c2deebe229d940da56148bababc8678d3109bd3ff67f1ace/greenlet-0.4.2.win-amd64-py2.7.exe#md5=ecf74a210b67842e4759a8d81ad5ca62 (from https://pypi.python.org/simple/greenlet/); unsupported archive format: .exe | |
Skipping link https://pypi.python.org/packages/00/8b/4ccae511e6a9d429ccbf701f1df16a3fe6afbbf75b338ab143754733d831/greenlet-0.4. |
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! X() abort | |
let x = 10 | |
let scope = l: | |
let F = { -> extend(scope, {'x': 200}) } | |
call F() | |
echo x | |
endfunction | |
call X() |
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 code in your .zshrc | |
if [[ "${VIM_TERMINAL_SHELL}" != "" ]]; then | |
command_not_found_handler() { | |
if [[ "${1}" != :* ]]; then | |
echo "command not found: ${1}" > /dev/stderr | |
return 127 | |
fi | |
echo -ne "\e_$*\e\\" > /dev/tty | |
while [[ ! -f "${VIM_TERMINAL_SHELL}" ]]; do |
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
syntax match csvHead /^/ nextgroup=csvOddColumn | |
syntax match csvOddColumn /[^,]*/ contained nextgroup=csvOddComma | |
syntax match csvOddComma /,/ contained nextgroup=csvEvenColumn | |
syntax match csvEvenColumn /[^,]*/ contained nextgroup=csvEvenComma | |
syntax match csvEvenComma /,/ contained nextgroup=csvOddColumn | |
highlight default link csvOddColumn Constant | |
highlight default link csvEvenColumn Statement |
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
let s:Object = {} | |
function! s:Object.x() abort | |
let dt = filter(self, '1') | |
endfunction | |
let s:Object['+'] = s:Object.x | |
function! s:new() abort | |
return copy(s:Object) | |
endfunction |
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
let dict = {} | |
function! dict.func1() abort | |
endfunction | |
let dict.func2 = dict.func1 | |
echo assert_true(dict.func1 == dict.func2) |
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
let obj = {} | |
function! obj.func() abort | |
endfunction | |
let funcname = matchstr(string(obj.func), 'function(''\zs.\{-}\ze'')') | |
echo assert_true(exists('*{' . funcname . '}')) | |
unlet obj | |
echo assert_false(exists('*{' . funcname . '}')) | |