this repo has no description
1
fork

Configure Feed

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

Add functions to extract Elixir module name and Elixir functions

+26
+3
nvim/after/ftplugin/vim.vim
··· 1 + nnoremap <buffer> zS :echo 'hi<' . synIDattr(synID(line('.'),col('.'),1),'name') . '> trans<' 2 + \ . synIDattr(synID(line('.'),col('.'),0),'name') . '> lo<' 3 + \ . synIDattr(synIDtrans(synID(line('.'),col('.'),1)),'name') . '>'<CR>
+23
nvim/autoload/ft/elixir.vim
··· 1 + func! s:get_ident(str) abort 2 + return matchstr(a:str, 'def\(module\|macro\|p\)\?\s\+\zs\f\+\ze') 3 + endfunc 4 + 5 + func! ft#elixir#module_name() abort 6 + let l:view = winsaveview() 7 + let l:name = s:get_ident(getline(search('^\s*defmodule\s', 'bW'))) 8 + call winrestview(l:view) 9 + 10 + return l:name 11 + endfunc 12 + 13 + func! ft#elixir#full_ident() abort 14 + let l:line = getline('.') 15 + 16 + if l:line =~# '^\s*def\s\+\k' 17 + return ft#elixir#module_name().'.'.s:get_ident(l:line) 18 + elseif l:line =~# '^\s*defmodule\s\+\k\+' 19 + return s:get_ident(l:line) 20 + else 21 + echoerr 'No ident in current line' 22 + endif 23 + endfunc