Sublime Forum

Printing

#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

#21

Here’s my solution, based on all of the posts I read. I couldn’t get any of the plugin methods to work, but ended up with something “simple” anyway. I’m using Windows and I only care about direct text printing, without any kind of formatting - I just want to print the straight text from ST to my default printer.

  1. I downloaded DOSPrinter.
  2. I created Print.sublime-build in my Packages\User directory:

{ "cmd": "C:\\Tools\\DOSPrinter.exe", "$file"] }
When I want to print, I just make sure I’m using “Print” as my Build System and hit Ctrl-B.

0 Likes

#22

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.

1 Like

#23

Because the editor you are using doesn’t have a print function.

I would make a guess that almost every person who has said “It’s probably one of the easiest things to implement” has never had to actually implement it, much less on a cross platform application that runs on 3 completely different platforms. Historically, some of the most popular editors relied on 3rd party tools or plugins to implement printing. Vim and Emacs both used to convert documents to postscript then try to send them to the printer using the local postscript driver through a third party program like lp. That mostly worked. I used to “print” my documents to pdf and then used adobe reader to print so that I could get pretty printing in the code documents I would turn in when I was working on my CS undergrad.

There are a lot of questions that you need to answer to get printing right. For some people, they don’t care if their printed documents are syntax hilighted. For others, that’s an absolutely critical feature of printing. How do you handle the case of wanting pretty printing, but the colors the user has chosen for the editor are not compatible with printing on white paper? The fact is, all these other editors you mention have a person on the team whose whole responsibility is to make printing work. That’s what that guy does, and that’s why they can provide that as a feature. ST is a one man shop.

I have rarely heard anyone who doesn’t want to use the plugins give any other reason other than “I shouldn’t have to do it that way.” One person said he couldn’t use the html plugin because he had html files associated with an html editor on his computer instead of a browser. That’s a legitimate beef.

0 Likes

#24

Pardon my analogy:

I effectively bought a Maserati for a text editor; however, when showing off my nice Maserati to my friends, I was mortified to find out that it doesn’t have any seats…I mean, why would anyone make a Maserati without any seats. Here I was, trying to convince my friends to buy a Maserati so they could experience how awesome they are, and when they find out they don’t have any seats they just roll their eyes at me because I spent so much money on a car that doesn’t have any seats. Who cares if I don’t really “need” to sit down when I am screaming down the road because the car looks real nice on the outside, and can do some amazing things on the road. But common folks…the thing does not have any seats!

I was shocked to find out that Sublime Text does not have a basic print feature. Honestly, after spending seventy dollars on a tricked out text editor with syntax highlighting and IDE features built in, I felt a tad bit betrayed that my car did not have any seats. I mean, who would build a car without seats? I don’t care how hard it is to add printing, for a seventy dollar text editor, it darn well should have basic printing. Not some crazy answer of, “it’s on the list, but not a high priority” for seven freaking years. No, for seventy dollars you should be able to spend a few weeks, months, or pay some computer science kid that is just coming out of college to put something together that would at least print basic text.

That said…I still use ST for my everyday text editor, my regular coding text pad, and for a laugh when the average user points at me and asks why I spent so much for a text editor that doesn’t print. It is a great piece of work…it just doesn’t have any seats!

1 Like

Print File?