You can use expand('%:p:h:t')
to get the current file's directory. Add additional :h
modifiers to get parent directories. See :help filename-modifiers
.
substitute('foo', '^.', 'u&', '')
will upper-case the first letter.
To do the replacement in the buffer, a :substitute
, probably with a :help sub-replace-expression
will do.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…