Sublime Forum

Printing

#1

Judging by the lack of entries when I search the forum for the keyword “print” I’m assuming the community has accepted the idea that printing will never be offered as a built-in feature with Sublime. Tragic.

And before everyone who don’t consider the need to print as being important, I get it. It’s not part of your work flow. However it is part of mine. Accept it and move on.

Please add the feature. I had planned to purchase a license since I appreciate the fact that the editor is lightweight and will run on all of my platforms (Windows, Mac OS X, Linux). But no printing is a total deal breaker for me. Using 3rd party libraries / plugins, etc is not an acceptable option. Bummer.

Let me know when you add this basic feature. Hell even a save to PDF option (formatted preferably) would almost be acceptable.

Your occasional printer

0 Likes

Please add print function
Sublime Text 4 - Coming Soon
#2

packagecontrol.io/packages/ExportHtml

0 Likes

#3

Also, the Simple Print Function package works quite well.

https://packagecontrol.io/packages/Simple%20Print%20Function

0 Likes

#4

Sublime Text is designed to be a fast, lightweight editor that can be customized to your needs via packages. You indicate that printing is very important to you, but acknowledge that it is not important to other people. It seems to me that Jon considers printing not to be core, but rather something that can be added on.

I personally don’t understand why you wouldn’t be willing to use a package for such a task. Do you really spend more than 5% of your time in Sublime Text printing?

Does it have to be native? What is wrong with using exported HTML to print?

I mostly just don’t understand why people get so worked up about this one feature request.

Anyway, good luck!

1 Like

#5

Probably because usually there is only a couple fo people that ask for this? :smiley:

search.php?st=0&sk=t&sd=d&keywords=printing&start=0

Lack of entries, indeed!

0 Likes

#6

I concur entirely with wbond on this. ExportHTML is a most flexible way to get printing support. It allows for easy use of CSS to restyle printed output; fonts, colours, wrapping etc… It also allows good pagination from your browser. The only downside I’ve seen is that in a couple of edge-cases, users’ machines are configured to open HTML mime in another program, which can be a little extra hassle - but this affects very few users who should be competent enough to figure out what to do.

The bottom line is that there are a raft of asks on the Sublime to-do pile. In my view, the priority list is Bugs -> Core -> API and Features. In the last case, features should be added which open up new pathways and flexibility for a raft of users and further enhance capabilities for plugin development. For example, a Macro recorder that records everything (not just TextCommands), and a full implementation of Code Folding. Grow the API to allow plugins to fully leverage the sidebar. The list is practically endless, as can be seen from the raft of upvoted FRs on userecho.

There have been many threads on this subject. A more useful discussion would be why solutions like ExportHTML are inappropriate, because people here might provide insights to help improve any workflow issues.

:smile:

1 Like

#7

[quote=“qgates”]
There have been many threads on this subject. A more useful discussion would be why solutions like ExportHTML are inappropriate, because people here might provide insights to help improve any workflow issues.[/quote]

I second this. I will be honest, I did not put ExportHTML together to specifically print, but on the rare occasions I ever do print from Sublime, it seems to have been more than sufficient. Hearing why it doesn’t work for people helps me improve it. I mainly code my plugins to fit my needs. If there is no communication about other’s needs, I can not accommodate them.

1 Like

#8

oh god…

0 Likes

#9

Since you asked, I have a request. Suppose you have some text selected. If “highlight_selections” is true, it exports the entire file, and highlights the selected bit. If “highlight_selections” is false, it only exports the selected text. What I would like is a setting in which it exports the entire file, and ignores the fact that some of the text happens to be selected, not highlighting it at all. I don’t like having to consciously make sure that there is no text selected before I go to print the file.

0 Likes

#10

I too would love to see a printing feature added to ST nativly, not as a plugin. I do not like the idea of exporting my source code to html and then printing the html as that is using something external to the editor to do an operation that to my mind belings inside the editor.

How would you like it if your PDF viewer could only output the PDF to html for the purpose of printing?I dont think that would go over too well with anyone! Exporting to html would be a nice way to publish source code on a site where syntax highlighting for the language is not available but it is not a viable substitute for a printing feature. For example, HTML does not understand page breaks. HTML does not understand wrapping of long lines, Et al.

Printing directly from sublime text is a feature that is sadly lacking. It is a feature that i miss greatly but not greatly enough to not purchase my license. I think the editor has enough features that it is worth getting even if i cannot print sources from it.

0 Likes

#11

[quote=“Doodpants”]Since you asked, I have a request. Suppose you have some text selected. If “highlight_selections” is true, it exports the entire file, and highlights the selected bit. If “highlight_selections” is false, it only exports the selected text. What I would like is a setting in which it exports the entire file, and ignores the fact that some of the text happens to be selected, not highlighting it at all. I don’t like having to consciously make sure that there is no text selected before I go to print the file.
[/quote]

Please create an issue at the repo as I will forget about the issue if it isn’t tracked there. I imagine it would be an optional feature, but completely doable.

0 Likes

#12

People are going to continue to request a built-in Print function until one of two things happens:

  1. Sublime Text finally gets a built-in Print function
  2. Sublime Text stops attracting new users, who are then surprised to find that there is no built-in Print function.
0 Likes

#13

[quote=“facelessuser”]
Please create an issue at the repo as I will forget about the issue if it isn’t tracked there. I imagine it would be an optional feature, but completely doable.[/quote]

Done. Incidentally, I found a workaround that gives me the behavior I desire. I set highlight_selections to false, and set valid_selection_size to a ridiculously high value. :smile:

0 Likes

#14

I don’t need to print, but my professor does! It is so easy to implement, why are you being so dogmatic against it?

0 Likes

#15

Absatively posillutely!! Printing is a must. Why should I have to go to another program to print? Every other editor I have used has a print function. It is probably one of the easiest things to implement.

0 Likes

#16

@previous two posts

I don’t think anyone is being ‘dogmatic’ about it, least of all Jon. AFAIK he’s never outright said that printing won’t be included in Sublime. From his perspective I guess that inbuilt printing is a minority request, that printing is easily achieved and that there’s a raft of other things that are just higher on the priority pile.

In trying to understand his reasoning, my guess is that the payoff for implementing a multiplatform print facility just isn’t there in the author’s view, at least for now. It has to be written to work across all platform print systems and, done properly, should have a bunch of ‘expected’ features like pagination, optional colouring, font selection etc. etc… It’s not difficult programming, but such things can be surprisingly time consuming.

At the risk of tediously repeating myself, the workaround of using ExportHTML is actually beneficial over an in-built print function in many situations, at least for me. Browsers have all this built in across platforms, and since the code ends up rendered in markup it can be easily styled using CSS and rendered to the printed page exactly to taste. Inbuilt print facilties rarely sport such flexibility. User CSS can be created to unify print style for teams or companies. In the end, printing is just a couple of extra mouse clicks / keystrokes which could be further simplified with a plugin.

The above won’t quell those who’d love a built in print function but I’m sure the author is well aware of its lack. I doubt he’ll shift his priorities on this, since occasional complaints have been dripping in for the last x years. The fact is that the majority seem more than happy with the ExportHTML approach and those who have a specific need for advanced inbuilt printing should probably look elsewhere. I’d love someone hear a specific reason as to why ExportHTML is unsuitable beyond the (rather dogmatic) ‘it just should be built in’ argument.

0 Likes

#17

Can I ask why you are all printing your code?

It’s clearly a feature that many are asking but, but I can’t figure out why someone would want to print their code.

0 Likes

#18

@wesbos I’m not particularly concerned about printing myself, (i.e., I don’t mind copying out somewhere else to print) but I figured I’d add that on top of the tens of thousands of lines of code I’ve written in ST over the past few years, I’ve also written essays, tweets, blog posts, documentation/guides, poems, letters, reminders, flotsam (links, phone numbers, emails…), etc. I also use it at least a few times a week to quickly manipulate/scrub/transform data/text/logs.

In short, because ST is good, lightweight, familiar and almost always open on the desktop of every system I use regularly, it ends up being the default capture location for much of what I do beyond code.

Inevitably, I’ll find myself wanting to hit print on something in ST several times a year. Pragmatically I’ve little interest in seeing more useful features languish for something like this, but I’ll still be happy if it turns up some day.

1 Like

#19

Ditto to abathur. Perhaps you are not aware that a lot of people do not have computers or just plain hate them. Therefore, for my clients, I need to print out instructions, directions and a myriad of other things for them. I don’t use a text editor just for coding. I might use it to make a quick fix to some code or to edit data files. I don’t see text editors for just coding (it’s not an IDE) - I and many others us it for a variety of other reasons.

0 Likes

#20

I’m not printing my code. I used Sublime Text as my single text editor. It also lets me code, but I don’t only use it for that. If I open it to quickly write down a grocery list, instructions for something I need to do, or any other .txt document I have saved with similar content, I want to be able to print that out and take it with me. Like every other text editor in existence. Sublime Text shouldn’t be a coding only utility when everything else about it makes it an excellent text editor - aside from this. Up until now, I’ve had to copy / paste between ST and Word.

I’m taking a look at some alternatives now. But if ST is meant to not be a text editor in any way, it should advertise itself as only a programming tool. Alternatively, if the authors want it to be used as a text editor also, they need to include this basic feature that’s part of every text editor.

I bought ST, as a text editor+, because I had stupidly assumed it would have the ability to print. I was completely shocked when I discovered it didn’t.

1 Like