Sublime Forum

Always on top

#1

A feature I need fairly often (when compiling/editing data and SQL files) and miss from Notepad++ is the option to keep the editor on top of other apps. If this could be considered for inclusion in Sublime it’d be really great!

Cheers,
Mick

0 Likes

#2

I’ve just set up a new PC so I know what it’s like. :astonished:
I’ll check out Actualtools - in the meantime I’ve discovered that I can do this with AutoHotKey:

;always on top for Sublime only - Win + s
#IfWinActive, ahk_class SKMainWindowClass
#s:: Winset, Alwaysontop, , A
return
#IfWinActive

Cheers,
Mick

0 Likes

#3

I searched a lot on google but don’t found how to set up sublime text 2 always on top after that i read your post but i have no idea how to apply that you share and put sublime always on top can you please do a how to guide …

0 Likes

#4

@Sariam

Here’s a couple of links that’ll get you started with Autohotkey (assuming you’re a Windows user):

howtogeek.com/56481/the-begi … ey-script/
lifehacker.com/316589/turn-any-a … d-shortcut

Once that’s all set up, just drop the code into your main .ahk file (there’s a ST syntax file for it from either Package Control or github.com/avi-aryan/AutoHotKey),run it and you’re good to go.

I use a slightly different script now, which I use across all my apps - if you want to limit the function of this new script to ST just add it between these lines:

#IfWinActive, ahk_class SKMainWindowClass

#IfWinActive

Otherwise here’s the script (which is triggered by Win + t):

#t::
ActiveHwnd := WinExist("A")
WinGetTitle, WindowTitle, ahk_id %ActiveHwnd%
WinGet, ExStyle, ExStyle, ahk_id %ActiveHwnd%
if (ExStyle & 0x8)
    OnTop=1
else
    OnTop=0
Winset, AlwaysOnTop, Toggle, ahk_id %ActiveHwnd%

StringReplace, WindowTitle, WindowTitle, %A_Space%- (Pinned)
if not OnTop
  WindowTitle:=WindowTitle . " - (Pinned)"

WinSetTitle, ahk_id %ActiveHwnd%,,%WindowTitle%
return

HTH

Cheers,
Mick

0 Likes

#5

thanks :smile:

0 Likes

#6

you could give DM2 a try, a nice window management enhancement tool

0 Likes