Last active
June 6, 2019 11:29
-
-
Save danielecook/b7206c32132af5d0c0a0d4ccf0e0fe7e to your computer and use it in GitHub Desktop.
Sublime text jump lines
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "keys": ["command+down"], "command": "plus_line", "args": {"lines": 10}}, | |
{ "keys": ["command+up"], "command": "minus_line", "args": {"lines": 10}}, | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime | |
import sublime_plugin | |
class PlusLineCommand(sublime_plugin.TextCommand): | |
def run(self, edit, lines = 10): | |
(row,col) = self.view.rowcol(self.view.sel()[0].begin()) | |
self.view.run_command("goto_line", {"line": row+1 + lines}) | |
class MinusLineCommand(sublime_plugin.TextCommand): | |
def run(self, edit, lines = 10): | |
(row,col) = self.view.rowcol(self.view.sel()[0].begin()) | |
self.view.run_command("goto_line", {"line": row+1 - lines}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment