使用命令行在行号处打开sublime文本文件

时间:2018-02-15 10:13:00

标签: sublimetext3 sublimetext

我正在尝试使用sublime text 3打开一个文件,我想用光标打开一个具体的行号。

我一直在检查subl --help,但我找不到具体线路的选项。所以我只是用: subl filename

有没有选择呢?

1 个答案:

答案 0 :(得分:6)

您可以使用:line在指定行打开:

subl file.txt:345

在我的sublime-text 3版本中,subl --help确实给了我指示(最后一行):

subl --help
Sublime Text build 3143

Usage: sublime_text [arguments] [files]         edit the given files
   or: sublime_text [arguments] [directories]   open the given directories

Arguments:
  --project <project>: Load the given project
  --command <command>: Run the given command
  -n or --new-window:  Open a new window
  -a or --add:         Add folders to the current window
  -w or --wait:        Wait for the files to be closed before returning
  -b or --background:  Don't activate the application
  -h or --help:        Show help (this message) and exit
  -v or --version:     Show version and exit

Filenames may be given a :line or :line:column suffix to open at a specific location.