SublimeText: How to find the command for “Next Build Result” to map it to a different key?

大兔子大兔子 提交于 2020-01-05 03:05:09

问题


Background: I am working on an SML file on SublimeText3 with build system setup.

After a build, i can successfully jump to the first error using the F4 key. I want to add another key mapping for the same "Next Result" command eg:Cmd+N in Vintage mode.

  1. What should i add as in my keybindings file to achieve this?
  2. What documentation,file did you refer/look around to find the proper answer for question 1? What was your thought process in brief to figure it out ?

edit: changed the required keybinding from <leader>cn to Cmd+N to make things easier


回答1:


You can find the command being called on a default key-binding in the default key bingings file. This file is opened using the menu:

Preferences > Key Bindings - Default

Inside this file you must find the entry corresponding to the keys you are looking for, in this case f4 key is mapped to next_result command as you can see in the key binding:

{ "keys": ["f4"], "command": "next_result" }



回答2:


For future reference, you can type sublime.log_commands(True) into the Sublime console and then the command name of every action you do will get printed to the console. Once you get the command name you need, you can stop the command printing with sublime.log_commands(False)



来源:https://stackoverflow.com/questions/31444121/sublimetext-how-to-find-the-command-for-next-build-result-to-map-it-to-a-diff

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!