0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Sublime text エディターのカーソル位置を常に画面中央にするプラグイン

0
Last updated at Posted at 2022-01-25

http://ja.uwenku.com/question/p-monrfyld-hw.html
引用元。そのままのコードで使えます。先人に感謝。

日本語で小説とか書いていると、複数行にまたがると、画面外に文字が出て行ってむきーってなるので、どうにかできないか考えていた。

import sublime
import sublime_plugin 
class AlwaysCenterCommand(sublime_plugin.EventListener): 
    def on_modified(self, view): 
     sel = view.sel() 
     pt = sel[0].begin() if len(sel) == 1 else None 
     if pt != None: 
      view.show_at_center(pt) 

画面が変更されるたびに、カーソルがある位置を画面中央にする、というコードになる。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?