Created
May 25, 2023 02:25
-
-
Save xebecnan/6f7e2615c05f080c85f4cf020ee00363 to your computer and use it in GitHub Desktop.
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
" Lua 跳转到函数定义 { | |
fun! GotoLuaFuncDifinition() | |
let w = expand("<cword>") | |
exec "Rg \\b" . l:w . "\\b" | |
exec "norm! gg" | |
let rr = search("| function\\>", 'c') | |
if !rr | |
exec "cclose" | |
echo "search FAILED for " . l:w | |
return | |
endif | |
echo "jumping to " . l:w | |
exec ".cc" | |
exec "cclose" | |
endfun | |
" } | |
au FileType lua nnoremap <buffer> <C-]> :call GotoLuaFuncDifinition()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment