How do I edit a header file with the same name as the corresponding C source file?
:e %:t:r.h You can use the following command to edit the file in a new split window: :sp %:t:r.h In the above commands, the percent sign expands to the name of the current file. The “:t” modifier extracts the tail (last component) of the filename. The “:r” modifier extracts the root of the filename. The .h is appended to the resulting name to get the header filename. Another approach is to use the following command: :sfind %:t:r.h This command will search for the header file in the directories specified in the ‘path’ option. For more information, read :help cmdline-special :help filename-modifiers :help :sfind :help ‘path’ 27.10.