Created
September 11, 2022 06:50
-
-
Save kawarimidoll/5d5663f23f8ebfaecbedb61e47884ef3 to your computer and use it in GitHub Desktop.
get function call or property under current cursor position that chained by dots
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
let col = getcurpos('.')[2] | |
let line = getline('.') | |
let pre = substitute(line[:col-1], '^.*[^0-9A-Za-z_.]', '', '') | |
let post = substitute(line[col:], '[^0-9A-Za-z_.].*$', '', '') | |
echo pre .. post |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment