Using gf
, you can go to the file under the cursor.
Combined with set suffixesadd+=.md
, you can achieve your desired behavior. (suffixesadd
asks gf
and many other friends to try adding any of the suffixes in its list to the file while searching).
Note that you need to have 'path'
correctly set (it's default is helpful for C programmers; tpope's apathy plugin sets it for many other filetypes). For this specific case, you probably just need :set path+=.
.
:help gf
also mentions:
If you want to edit the file in a new window use
|CTRL-W_CTRL-F|.
If you do want to edit a new file, use: >
:e <cfile>
< To make gf always work like that: >
:map gf :e <cfile><CR>
< If the name is a hypertext link, that looks like
"type://machine/path", you need the |netrw| plugin.
For Unix the '~' character is expanded, like in
"~user/file". Environment variables are expanded too
|expand-env|.