I am trying to get the file current directory in a snippet for visual studio code.
VSCode has a variable: TM_DIRECTORY, which is the fullpath
TM_DIRECTORY
I wanted to add that in Windows the code above will print the entire directory.
You need to add a quadruple backslash vs the forward-slash:
${TM_DIRECTORY/^.+\\\\(.*)$/$1/}