开发者

Open file from complete path under cursor in Vim

开发者 https://www.devze.com 2022-12-31 02:54 出处:网络
If I have a file that contains a complete path for a file, is there a way to highlight the filename (using visual mode) and open the file (preferably in a split screen)?

If I have a file that contains a complete path for a file, is there a way to highlight the filename (using visual mode) and open the file (preferably in a split screen)?

Here is the behavior I would like: if the file name contains a / character, assume it is a full path (i.e. the current directory is root). Other开发者_开发百科wise, use the current folder (i.e. default behavior). Is this possible?


Put the cursor on the filename and type gf (in command mode). Or use CTRL+W | CTRL+F to open in another window. See also :help gf (no, it's not your girlfriend).


gf command opens file under cursor.

0

精彩评论

暂无评论...
验证码 换一张
取 消