In a VIM script file, you have access to <sfile> as demonstrated in this question and answers.. A few examples given in this answer can be seen here:
" Absolute path of script file: let s:path = expand('<sfile>:p') " Absolute path of script file with symbolic links resolved: let s:path = resolve(expand('<sfile>:p')) " Folder in which script resides: (not safe for symlinks) let s:path = expand('<sfile>:p:h')
TMUX supports the ability to source additional with source-file (another StackOverflow question and answer regarding how to split files up). Say for example in my ~/.tmux.conf I have a line like below
source-file ~/some-workspace-dir/my-tmux.conf`
I'd like to be able to refer to files relative to my-tmux.conf inside of my-tmux.conf.
If I add a run-shell "pwd", it just points out the home directory at ~/.tmux.confrather than~/some-workspace-dir, the directory containing my-tmux.conf`.
My overall question is how do you get the current path of a file being sourced by TMUX source-file (preferably without parsing that file)?