Sublime Text 3 / LiveReload, Settings for Delay - delay

My apologies for asking this, but i did not figure out the solution by reading through the docs and/or the corresponding git-rep.
How can i enable a delay for LiveReload before it reloads the page?
Current Sublime-settings:
{
"enabled_plugins": [
"SimpleReloadPlugin",
"SimpleRefresh"
]
}

Go to preferences > package settings > LiveReload > Settings-Default
and paste this code:
{
"enabled_plugins": [
"SimpleReloadPluginDelay"
]
}
it will enable the 400ms delay plugin each time you start Sublime which refreshes the page after 400ms of saving page.
Or enable this manually. Press Ctrl+Shift+P and type Livereload. Select LiveReload: Enable/disable plugins and then select Enable reload with delay (400ms).

Must be "SimpleRefreshDelay"..
Been confused where to put the argument, but ended up just hard-coding it into SimpleReloadPluginDelay.py..

Related

Open up URL on local machine sublime

When opening a URL via view_in_browser command it opens
file:///Applications/MAMP/htdocs/file.php
instead I want it to open
http://localhost:8888/file.php
I was able to do it before, but it was set up 5 years ago and the computer is dead.
I don't want to do anything with project URLs or setup sidebar enhancement packages, I also tried creating a custom plugin as in
https://forum.sublimetext.com/t/how-to-view-in-browser/3225/7
Which overrides the open_browser command, but it doesn't work.
Is there not an arg I can specify in the key bindings to prepend a URL? Something like
{ "keys": [ "super+e" ],
"command": "view_in_browser"
"args": {"url": "http://localhost:8888/"}
}
May be there's an existing package that does this?
Seems so simple, but is so complicated to do.. I'm on sublime 3
Couldn't find any other method apart from sidebar enhancements route so did the following
Installed sidebar enhancements, details here:
https://www.hongkiat.com/blog/preview-in-localhost/
Opened the folder "htdocs" then right click folder > Project > Edit preview URLs
And pasted the following:
{
"/Applications/MAMP/htdocs/":{
"url_testing":"http://localhost:8888/"
}
}
/Applications/MAMP/htdocs/ : path to your files
http://localhost:8888/ : is path to local machine URL
Then go to Preference > Keybindings and in the right window paste
{ "keys": ["ctrl+l" ],
"command": "side_bar_open_in_browser" ,
"args":{"paths":[], "type":"testing", "browser":"Chrome"}
}
Now when you press control + l on the computer it will open up the URL with localhost prepended.
Hope this helps!
Personal observation: the granular control of sidebarenhacements is great and all, but this is overly complicated if you simply want to bind a key to open up chrome window with localhost prepended regardless of project, url type, file paths etc. Hope this is changed in the future.

How to remove code suggestion / help popup in sublime 3

I keep getting this annoying code help popup in sublime 3.
It seems to have only appeared recently. I'm not sure if it's part of sublime or some plugin.
Is there a way to disable this from showing?
EDIT:
Turns out this is to do with the package Naomi. Does anybody know if this is a configurable setting with this package?
you need to do following steps:
Go sublime Menu bar
select preferences
add this following code to user file and save it.
Blockquote
{
// Controls auto pairing of quotes, brackets etc
"auto_match_enabled": false,
// Enable visualization of the matching tag in HTML and XML
"match_tags": false,
}
I installed sublime, and disable completions popup by adding
"auto_complete": false
to the preferences.
You get to the preferences by: Menu Preferences -> Settings. There, you are supposed to edit the User Preferences file by adding custom prefs like the above snippet between the existing curly braces.

Sublime text 3 how to hide Definition on mouse over function?

I've tried to find a solution in other posts but no solution found.
I'm using Sublime text 3 and since I installed last update 3126, when I put my mouse over a function, in PHP ou Javascript, I get a list of all files using this function and it's useless for me and takes all place on my screen.
How can I hide this ?
I'm using those Packages :
alignment
compare side by side
Emmet
minifier
Sidebar
livereload
SFTP
Sublimelinter
colorpicker
I love this tool but I need a bit more help to configure my own options.
Thanks for help !
Also new in 3124 is Show Definition, which will show where a symbol is defined when hovering over it with the mouse. This makes use of the new on_hover API, and can be controlled via the show_definitions setting. — Sublime Text Blog
Show definitions on hovers can be disabled via the show_definitions setting.
User
Menu > Preferences > Settings (Preferences.sublime-settings - User)
{
"show_definitions": false
}
Per-Project
Menu > Project > Edit Project
{
"settings": {
"show_definitions": false
}
}
Similar to this SO question on inline build errors.

How could I hide the minimap bar on sublimetext 3

It takes too much space on the window,
I tried some option in the configuration
It seems not working, any idea ?
User setting
"draw_minimap_border": false,
"draw_minimap": false,
"hide_minimap": true,
"always_show_minimap_viewport": false
Click on View (check the mouse arrow/pointer in below image) on top menu bar or hit Alt + V and click Hide Minimap
I added a shortcut on Sublime Text 3.
Go to Preferences -> Key Bindings. In user key bindings I added:
[
{ "keys": ["ctrl+f2"], "command": "toggle_minimap" },
]
Obviously you can choose another key combination.
I don't believe there's a setting in Sublime Text 3 to hide the minimap by default.
This solution has worked perfectly for me, however:
Save the following Python code as minimap_setting.py in the User directory (in Preferences -> Browse Packages):
# -*- encoding: utf-8 -*-
import sublime
import sublime_plugin
class MinimapSetting(sublime_plugin.EventListener):
def on_activated(self, view):
show_minimap = view.settings().get('show_minimap')
if show_minimap:
view.window().set_minimap_visible(True)
elif show_minimap is not None:
view.window().set_minimap_visible(False)
Then, you just add "show_minimap": false in your settings and you're good to go.
Ctrl+Shift+p to open the command palette, then type in minimap.
It's very easy in Sublime text 3. To hide Minimap:
View > Hide Minimap
Check your default settings; Preferences -> Settings - Default. If a setting is not listed there, your version of sublime will not handle overriding it in Settings - User - Don't waste your time.
Check if the latest version of sublime has settings you can override - http://docs.sublimetext.info/en/latest/reference/settings.html
On the latest sublime for me, I can't hide tabs, the minimap or the status bar via user settings - just by manually disabling them in the menu dropdown.
Just use package and once for all.
Tools > Command Palette > Package Control: Install Package > Search Close​Minimap​On​Multi​View and install. It will close all minimap for all windows.
Now you can disable on View menu clicking on Hide Minimap.
On SublimeText 3, I can see F2 Keymap, easier, isn't it?

Sublime Text: File remains in tab even after deleted

When I delete a file that I don't need anymore, but then I have to close the tab manually. It is irritating.
Every time, I have to delete the file and then close the tab by confirming the discard changes.
Is there a way to delete the file in one shot.
Please Note: This happens in my MacBook laptop.
If you use the Side​Bar​Enhancements plugin, there is an option for that:
{
"close_affected_buffers_when_deleting_even_if_dirty": true
}
Make sure to add this to the correct settings file:
Preferences >> Package Settings >> Side Bar
I am not 100% clear on the details of your question. Apologies if this answer does not match what you are trying to ask.
Assuming you do not already have the file open this behaviour is a side effect of the choice to preview the file on click.
If this is the use case you are asking about then there is an answer.
If you look in Preferences -> Settings - Default and search for preview you should find this:
// Preview file contents when clicking on a file in the side bar. Double
// clicking or editing the preview will open the file and assign it a tab.
"preview_on_click": true,
This means clicking on the file to delete it causes it to be opened for preview and after deleting the file you also need to close the preview tab.
If you wish to change this behaviour open this file Preferences -> Settings - User and add this line:
"preview_on_click": false,
Then you should not open a preview and therefore will not need to close it after deleting the file.
If you already have the file you are deleting open for editing this will not cause the behaviour you are looking for.
There is an issue, so in order to don't make a link-only answer, I just paste here the main info :
Sublime Forum Question : Close tab after delete file?
Sublime Forum : https://www.sublimetext.com/forum/viewtopic.php?f=2&t=11686
Sublime Forum Answer :
You can do this with a plugin. I didn't really test this much, so you
may want to test on non critical stuff first. It does just close the
view, so worst case is that you lose some existing work. That being
said, I'm pretty sure it works fine.
import sublime_plugin
import os
class MyEvents(sublime_plugin.EventListener):
def on_activated(self, view):
if view.file_name():
if not os.path.exists(view.file_name()):
view.set_scratch(True)
view.window().run_command("close")
There's a plugin for this:
Plugin's Github Page
Seems like it should be a toggleable option.
This was annoying me so much, I created a plugin for it
https://gist.github.com/michaelkonecny/bb5a0d1cf43698c0ebe8673f92324ea3
Just download the close_deleted_files.py file and save it to
%AppData%\Roaming\Sublime Text 3\Packages\User (or similar path on Mac).
This is how the plugin works:
whenever a view is focused, it goes through the filenames of all the tabs in that window and closes those, whose files do not exist.
Extending #jwpfox answer
Below works for me:
Go to -> Top Menu -> Sublime -> Preferences -> Settings
Here Primary Preferences.sublime-settings file is not editable
when you click on settings, so two pages will open, now add the flag on the second page like below .. it will override the primary setting.
Alternatively, you can add the flag in below location file as well directly :
Packages/User/Preferences.sublime-settings
Add flag as
"preview_on_click": false,
The entire file looks like the below:
{
"ignored_packages":
[
"Vintage",
],
"preview_on_click": false,
}

Resources