Sublime Forum

Sublime for straight prose?

#1

I really want to love Sublime. The minimap and panes would be ridiculously useful for writing long works of fiction, and the app looks and feels fantastic, but I just can’t get text to display in some acceptable manner. I know its really meant as a coding tool, not a writing one, but its just so close to being top option for that purpose, and its so configurable and extensible, I know there’s got to be some way to get it done.

Unfortunately, I’m not a coder. I’ve got just enough gumption to get the options that are obviously present in Sublime altered to suit my taste (no line numbers, removed the status and scroll bars, etc.) but I can’t figure out any way to make text appear as it would normally in any other text editor with Tab indenting just the first line of a paragraph rather than simply shifting every line over until you either push it further with another Tab or Shift+Tab to get it back. I would even settle for not using Tab if I could get the carriage return to add a line space between it and the next paragraph. Whatever it takes to be able to very clearly and legibly discern between one paragraph and the next. If I could be shown how to get this reliably, I would very likely buy a license on the spot.

I’m also interested in getting the Word Count package to run via a key binding, though I can’t figure out how. I know I have to have the Statusbar showing to see the results of the Work Count package, so I’ve figured out how to build a custom key binding to toggle it on for that purpose (so I’m not completely useless here), but even so, I could use some help with the Word Count and it would be fantastic if there were a method of running it so that the results were displayed in some method that didn’t require having a normally useless (to me) bit of chrome taking up space. I wouldn’t mind leaving the status bar up if it could give me a real time word count and certainly if there were plug ins that allowed for setting word count “bookmarks” or possibly timers.

What do you geniuses think? Should I go crawling back to WriteMonkey and q10, my dreams plagued by MiniMaps and multiple panes, or can we get some of this stuff working.

Thanks,
Kensai

0 Likes

#2

@Kensai

Try the following:

[size=150]Step 1:[/size]
Click on Preferences -> Default key bindings

[size=150]**Step 2: **[/size]
The file “Default.sublime-keymap” will open, and look for the line (for me, it’s on line 42):

<binding key="enter" command="insertAndDecodeCharacters \n" />

[size=150]Step 3:[/size]
Replace that line of code with:

<binding key="enter" command="insertCharacters \t\n" />

[size=150]**Step 4: **[/size]
Enjoy a Sublime Text editing experience that doesn’t autodetect tabbing and indents new paragraphs when you hit “enter”. :smiley:

As for the word count, I’ll try to figure something out and and post about it soon.

0 Likes

#3

As promised, here is a real time word count solution.

I just tweaked the WordCount plugin that ships with Sublime to display the word count in the status bar when you modify the document.

Just save the code below as livewordcount.py in Sublime’s Packages/User directory. “Preferences -> Browse Packages” will take you to the Packages directory. Open the “User” folder, drop in the file, start up Sublime, and start typing:

http://clip2net.com/clip/m0/1251224863-clip-5kb.png?nocache=1

Here’s the code (save as livewordcount.py):

[code]import sublime, sublimeplugin, re

class liveWordCount(sublimeplugin.Plugin):
def onModified(self, view):
sels = view.sel()
content = view.substr(sublime.Region(0, view.size()))
sublime.statusMessage(“Words: %s” % self.count(content))

def count(self, content):
	"""counts by counting all the start-of-word characters"""

	# regex to find word characters
	wrdRx = re.compile("\w")
	matchingWrd = False
	words = 0;
	for ch in content:
		# test if this char is a word char
		isWrd = wrdRx.match(ch) != None
		
		if isWrd and not matchingWrd:
			# we're moving into a word from not-a-word
			words = words + 1
			matchingWrd = True
		if not isWrd:
			# go back to not matching words
			matchingWrd = False
	return words[/code]
0 Likes

#4

I use sublime text for writing fiction, blog posts, and other pieces of prose. I tend to write everything in the markup language Markdown, which is basically plain text, paragraphs separated by blank lines, with a little formatting for bold, italic, lists, etc. See more here: http://daringfireball.net/projects/markdown/ If you go with Markdown, there’s a nice program called Pandoc which will convert Markdown files into RTF, HTML, and other formats. This lets you get a version of your manuscript which can be formatted up for submission.

I use a slightly modified version of the Markdown package that comes with sublime; there’s a download link at the bottom of this post; http://www.stevecooper.org/2008/01/28/sublime-text-editor-review/

To get a keybinding for work count, add this to your User/Default.sublime-keymap

Then you can use ctrl+W, ctrl+C to do the count.

0 Likes

#5

With regards to the indenting, I just added an option to inhibit the indenting of wrapped lines. This will be in the next beta, which should be out sometime in the next two weeks.

0 Likes

#6

Very nice. I’m looking forward to it.

And thanks, all, for the advice.

Kensai

0 Likes

#7

The new beta is working great. The indent function works just fine.

The problem I’m seeing now that I’ve been able to get in and start working is that when selecting text, it starts doing some weird thing where it seems to be taking the selected text and overwriting it further down in the file, as I’m selecting. It goes away when I click away, but its weird enough that I can’t really select what I need to.

Any idea what that is and if there’s any way to disable it? I thought it might be the line swapping thing (whatever that is) that was mentioned in the post about the beta, but other than finding a couple of key bindings that only seem to activate a swap rather than change a setting.

Thanks,
Kensai

0 Likes

#8

Modern writing – articles, blogs, online novels – improve upon paper-based writing/reading thanks to interactivity like hyperlinks and tooltips. For Sublime Text to accommodate modern writing, it needs to support text hyperlinks along with standard word-processing features, like automatic capitalization after periods and grammar check. I would love to see a programming tool include these basics of content writing to blend the two disciplines. Sometimes the programmers are the content creators. Why must we use separate tools to edit text in multiple ways? I need to allow my creative prose to flow, insert hyperlinks, special Latin characters, look up definitions and synonyms as needed, and then edit the HTML to add DOM IDs and classes and otherwise mark it up.

Perhaps content can be written in prose editor, converted to a markup language, and modified in code editor. I suppose this is what Dreamweaver and others do via their code/preview toggle. Thoughts?

0 Likes

#9

FYI i just hacked up a build system for Markdown that opens an HTML preview in a new browser window. MacOS only for now.

https://forum.sublimetext.com/t/markdown-preview/2804/1

0 Likes

#10

Hi all,

I’m absolutely no coder and I’m also using Sublime Text only for prose. I bought registration-key a few days ago after a 4 week testing period. And I must say, I love writing with sublime, cause it feels great and it’s so easy to switch between different documents (different scenes of a story) in fullscreenmode and the minimap is just wonderful, cause it reacts spontaneously and it’s as if you got the text directly in your hands. I had spent an hour making around with settings, experimented with wrap, ruler and minimap size and other things, but I had no real problem to get it perfect for my writing demands. Everything looks and works great on my screen. But I have to say, I use only Sublime 1.4, cause I could’nt find out how to get version 2 working for my demands, I don’t really understand how the setting of Sublime 2 works. But never mind, as 1.4 is really really the best thing I can imagine for writing my texts; to make it even more perfect, I additionally installed word count and of course automaticbackup.

… it’s just great!

Thanks a lot for this editor!

Greetings to all and keep on keepin on,

micro

PS: My english is not very good, sorry.

1 Like