this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Better Elixir function name extractor

+23 -7
+1 -1
nvim/after/ftplugin/elixir.vim
··· 3 3 4 4 command! -buffer ModuleName echo ft#elixir#module_name() 5 5 command! -buffer Function echo ft#elixir#full_ident() 6 - command! -buffer XrefCallers call asyncdo#run(1, 'mix', ['xref', 'callers', ft#elixir#full_ident()]) 6 + command! -buffer XrefCallers call asyncdo#run(1, 'mix', 'xref', 'callers', ft#elixir#full_ident()) 7 7 8 8 inoreabbrev <buffer> mdoc @moduledoc """ 9 9 inoreabbrev <buffer> pry require IEx; IEx.pry
+18 -3
nvim/autoload/ft/elixir.vim
··· 1 1 func! s:get_ident(str) abort 2 - return matchstr(a:str, 'def\(module\|macro\|p\)\?\s\+\zs\f\+\ze') 2 + return matchstr(a:str, 'def\%(module\|macro\|p\)\?\s\+\zs[A-Z][A-Za-z0-9._]*\ze') 3 3 endfunc 4 4 5 5 func! ft#elixir#module_name() abort 6 6 let l:view = winsaveview() 7 - let l:name = s:get_ident(getline(search('^\s*defmodule\s', 'bW'))) 7 + 8 + let l:name = '' 9 + let l:count = searchpair('\<do:\@!\>', '', '\<end\>', 'cbrmW', 'getline(".")!~#"^\\s*defmodule"') 8 10 call winrestview(l:view) 9 11 12 + for i in range(l:count) 13 + call searchpair('\<do:\@!\>', '', '\<end\>', 'bW', 'getline(".")!~#"^\\s*defmodule"') 14 + let l:name = s:get_ident(getline('.')).l:name 15 + 16 + if i < l:count - 1 17 + let l:name = '.'.l:name 18 + endif 19 + endfor 20 + 21 + call winrestview(l:view) 10 22 return l:name 11 23 endfunc 12 24 13 25 func! ft#elixir#full_ident() abort 26 + let l:view = winsaveview() 27 + call search('^\s*def', 'cbW') 14 28 let l:line = getline('.') 29 + call winrestview(l:view) 15 30 16 31 if l:line =~# '^\s*def\s\+\k' 17 32 return ft#elixir#module_name().'.'.s:get_ident(l:line) 18 33 elseif l:line =~# '^\s*defmodule\s\+\k\+' 19 - return s:get_ident(l:line) 34 + return ft#elixir#module_name() 20 35 else 21 36 echoerr 'No ident in current line' 22 37 endif
+2 -2
nvim/autoload/statusline.vim
··· 3 3 " displays a flag if there are unseen quickfix errors 4 4 function! statusline#quickfix() abort 5 5 let l:ret = '' 6 - let l:ret .= get(g:, 'quickfix_pending') ? '♻️' : '' 7 - let l:ret .= exists('g:asyncdo') || exists('w:asyncdo') ? '⚙' : '' 6 + let l:ret .= get(g:, 'quickfix_pending') ? '🏁' :' ' 7 + let l:ret .= exists('g:asyncdo') || exists('w:asyncdo') ? '🏃' : ' ' 8 8 9 9 return l:ret 10 10 endfunction
+2 -1
nvim/init.vim
··· 34 34 set wildignore+=*.o,*~,*/.git,*/tmp,*/node_modules,*/_build,*/deps,*/target 35 35 " }}} 36 36 " Display tabs and trailing spaces visually {{{ 37 - set list listchars=tab:→\ ,trail:·,nbsp:␣ 37 + set fillchars=vert:┃,fold:· 38 + set list listchars=tab:→\ ,trail:·,nbsp:␣,extends:↦,precedes:↤ 38 39 set conceallevel=2 39 40 " }}} 40 41 " Do not show current mode down the bottom {{{