"Edit with external editor" option

User avatar
kewms
Posts: 6057
Joined: Fri Feb 02, 2007 5:22 pm
Platform: Mac

Fri Mar 13, 2020 4:43 pm Post

john1013 wrote:@brookter No, I'm not Vim/Emacs zealot. Actually, I use Sublime Text and Word a lot. What I'm talking about is the option to edit the text using the familiar app. For some person it would be Sublime Text, for another person it would be Vim, and somebody will prefer Word. I tried to make it clear in my previous post.


I'm sure you can understand why accommodating people who don't want to use Scrivener is not a particularly high Scrivener development priority.

Katherine
Scrivener Support Team

jo
john1013
Posts: 47
Joined: Sun May 22, 2016 8:09 am
Platform: Windows

Fri Mar 13, 2020 5:36 pm Post

> Exactly. This is precisely why this function doesn't already exist.

As I said, Joplin somehow do it.

> I'm sure you can understand why accommodating people who don't want to use Scrivener is not a particularly high Scrivener development priority.

Scrivener has very weak capacities to _edit_ the text. What I propose is to eliminate this disadvantage by creating a bridge to the app that can do this job better.

If you can add the good text _editing_ capacities to Scrivener itself, it will be even better. But it will be harder to accomplish.

User avatar
kewms
Posts: 6057
Joined: Fri Feb 02, 2007 5:22 pm
Platform: Mac

Fri Mar 13, 2020 6:03 pm Post

I'm not familiar with Joplin, but a quick look at their website suggests some important differences.

* Joplin notes are in Markdown format, which eliminates the whole RTF/plain text conversion issue that Scrivener faces.

* Joplin notes are independent entities. There doesn't seem to be anything like Scrivener's understanding that all documents are part of a "project," and that maintaining relationships between them matters. This, in turn, drives a lot of Scrivener's metadata.

Katherine
Scrivener Support Team

User avatar
krastev
Posts: 510
Joined: Fri Feb 05, 2016 5:21 am
Platform: Windows
Contact:

Fri Mar 13, 2020 6:16 pm Post

...not convenient to _write_ the text...

...very weak capacities to _edit_ the text...


What is this even mean? :mrgreen:

Regular expressions?

I think you're trying to use Scrivener as a tool for something that it isn't intended for.
Maybe you can try Joplin? :mrgreen:
Krastev
Windows 10 Home 64-bit
Scrivener for Windows Version 1.9.16.0
Testing Scrivener Beta for Windows

br
brookter
Posts: 2081
Joined: Wed Mar 18, 2009 12:22 pm
Platform: Mac

Fri Mar 13, 2020 6:39 pm Post

john1013 wrote:
Scrivener has very weak capacities to _edit_ the text.


This sort of silly hyperbole does your argument no good whatsoever, you know.

jo
john1013
Posts: 47
Joined: Sun May 22, 2016 8:09 am
Platform: Windows

Fri Mar 13, 2020 6:50 pm Post

> This sort of silly hyperbole does your argument no good whatsoever, you know.

I just said the truth. *Technical* _writing_ is Scrivener is hell. You cannot even properly indent a block of code. "Properly" == with spaces or tabs.

As a tool to organize the text, it is great.

br
brookter
Posts: 2081
Joined: Wed Mar 18, 2009 12:22 pm
Platform: Mac

Fri Mar 13, 2020 8:07 pm Post

Of course you can indent code -- just use the paragraph indent options (you may have to assign a shortcut in Options-- it's years since I used V1 so I can't remember what they are. In Version 3, Ctl-alt-left and right will indent and outdent by the tabs you've set up in the ruler.

Now if you're saying that it's hell to write in Scrivener because it doesn't do language-aware automatic code indentation, then we're back to the hyperbole, aren't we?

If you want to say "Scrivener is not a state of the art code writing tool", then I don't think anyone would disagree. How many people do you think want to use it that way, who don't know how to use either external sync or automated copy and paste?


BTW, you really should try the Beta -- it has several improvements which may help you.

jo
john1013
Posts: 47
Joined: Sun May 22, 2016 8:09 am
Platform: Windows

Fri Mar 13, 2020 8:26 pm Post

brookter wrote:Of course you can indent code -- just use the paragraph indent options (you may have to assign a shortcut in Options-- it's years since I used V1 so I can't remember what they are. In Version 3, Ctl-alt-left and right will indent and outdent by the tabs you've set up in the ruler.


"Properly" == with spaces or tabs.

Indentation created using paragraph indents can't be copied into text editor and will be lost if you sync the project with external folder as plain text.

I'm not even sure there is an option to convert it to spaces during compilation to plain text.

User avatar
lunk
Posts: 3978
Joined: Wed Aug 21, 2013 4:24 pm
Platform: Mac + iOS
Location: Sweden 64° N

Fri Mar 13, 2020 8:43 pm Post

john1013 wrote:*Technical* _writing_ is Scrivener is hell. You cannot even properly indent a block of code. "Properly" == with spaces or tabs.

Could that possibly be because it is primarily a tool for writing novels and other such long-form writing?
I am a user, writing non-fiction and science, using:
* Mac Scrivener 3 on a Macbook 12”, MacBook Pro 13”, and iMac 27”, all running Mojave.
* iOS Scrivener 1 on an iPhone 11 Pro, iPad Air 9.7”, and iPad Pro 12.9”, all running the latest iOS

br
brookter
Posts: 2081
Joined: Wed Mar 18, 2009 12:22 pm
Platform: Mac

Fri Mar 13, 2020 8:52 pm Post

So you have to use an external text editor because you can't do code indents, but you can't use an external code editor to cope with the code indents Scrivener can do? This is getting very confusing...

So use tabs instead (and automatic language aware indenting is only clever tabbing or spacing after all), then if you want to swap tabs for spaces or vice versa use the substitutions pane in compile. You can change tabs to spaces there, and in V3 at least, you can also do regex substitutions in the same dialogue (as well as in the editor/project replace functions).

But enough: you are of course free to use it whichever way you wish.

jo
john1013
Posts: 47
Joined: Sun May 22, 2016 8:09 am
Platform: Windows

Fri Mar 13, 2020 9:12 pm Post

lunk wrote:Could that possibly be because it is primarily a tool for writing novels and other such long-form writing?


Yeah, probably. I'm not trying to be a hater. This is a good app, but it has its own weak sides. What I'm trying to accomplish is to point out on these weak sides in hope they will be fixed.

jo
john1013
Posts: 47
Joined: Sun May 22, 2016 8:09 am
Platform: Windows

Fri Mar 13, 2020 9:19 pm Post

brookter wrote:So you have to use an external text editor because you can't do code indents, but you can't use an external code editor to cope with the code indents Scrivener can do? This is getting very confusing... .


You have 2 options to indent the code:

1. spaces or tabs
2. paragraph indentation.

The latter option is a part of formatting. It's not any different from e.g. red text. When you copy such things into plain text editor, they are lost.

User avatar
lunk
Posts: 3978
Joined: Wed Aug 21, 2013 4:24 pm
Platform: Mac + iOS
Location: Sweden 64° N

Fri Mar 13, 2020 9:23 pm Post

Weak sides? :D
I am a user, writing non-fiction and science, using:
* Mac Scrivener 3 on a Macbook 12”, MacBook Pro 13”, and iMac 27”, all running Mojave.
* iOS Scrivener 1 on an iPhone 11 Pro, iPad Air 9.7”, and iPad Pro 12.9”, all running the latest iOS

br
brookter
Posts: 2081
Joined: Wed Mar 18, 2009 12:22 pm
Platform: Mac

Fri Mar 13, 2020 9:39 pm Post

john1013 wrote:
brookter wrote:So you have to use an external text editor because you can't do code indents, but you can't use an external code editor to cope with the code indents Scrivener can do? This is getting very confusing... .


You have 2 options to indent the code:

1. spaces or tabs
2. paragraph indentation.

The latter option is a part of formatting. It's not any different from e.g. red text. When you copy such things into plain text editor, they are lost.


I know. If you read your posts again, you will see the contradictory positions you are adopting.

But you'll have to reconcile them without me. You've had the position explained to you, with possible workarounds. I don't see any point in going over the same ground time and time again. Good luck with finding a process that suits you.

User avatar
AmberV
Posts: 24190
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Ourense, Galiza
Contact:

Sat Mar 14, 2020 2:25 pm Post

john1013: Actually, I use Sublime Text and Word a lot. What I’m talking about is the option to edit the text using the familiar app.


Since you use Sublime Edit, and your primary complaint with the folder sync feature is that it requires frequently going to the file system, you should know that is not necessary! Sublime Edit is, like many modern coding editors (including Vim, even vanilla, but can be enhanced further by plug-ins) also a capable project level tool. It’s also very easy to get started with it:

  1. Instead of opening one single file, try opening the entire sync folder at the root level.
  2. If nothing special happened, you may have the sidebar disabled on start, use the View ▸ Side Bar ▸ Show Side Bar menu command.

    Thus far this would suffice for simple editing sessions. You have accelerated access to sidebar files via the universal “Goto Anything”, can do cross-file searching and replacing with Find ▸ Find in Files, etc. Stuff like that is going to be a lot more efficient than going back to Scrivener, searching there, locating the chunk of text you want to edit and then using a command to open a separate window in your editor.
  3. But you can go a little further by making this a saved project, by using Projects ▸ Save Project As..., and now you have a simple thing you can double-click on, as well as define special settings to (like maybe a more prose-oriented theme than coding).

This is after all a barebones IDE. It is designed to make working with a network of interrelated files as easy as possible. If you’re Alt-Tabbing out to Windows File Explorer to open .txt files in Sublime, you can do much better.

There are other tools that work excellently with sync folders. Even other complex software that offers similar tools can be coupled together with Scrivener’s folder system. Ulysses for example (a Mac-only writing tool), has an external folder feature, and plays nicely with Scrivener. I’m also using a tool called nvUltra which is basically a tool that makes editing a folder full of files as easy as a streamlined notepad tool (anyone that used Notational Velocity or nvAlt knows what that is about). It’s an excellent “front end” to an external sync folder, particularly if you use Markdown to write.

You don’t need to be afraid that some of the texts will disappear. (Generally, syncing is a dangerous thing.)


It should be enabled by default, but make sure the option to take snapshots is enabled. There is no reason to turn that off in my opinion, as it records a complete record of all syncs in both directions. If you accidentally edit the same resources in two places, you can resolve the conflict with the backup copy created by snapshots.

I’m not even sure there is an option to convert it to spaces during compilation to plain text.


That is something the aforementioned beta can do. It can optionally convert paragraph and indent formatting to literal whitespace, based on simple 10-pitch math. It is capable enough to even generate a screenplay, which is very strict in terms of spacing.

lunk wrote:The external editor would then need to save the manipulated document back into the correct place in the project folder (or package, as it is on a Mac) and possibly also make changes to the scrivx file or project meta data. But the external editor doesn’t know that the document belong to a Scrivener project. And Scrivener wouldn’t know that you decided to quit the external editor.


What most people mean when they refer to external file editing is an inside-out approach, where the host software creates a temp file somewhere and then requests that file be opened by X software (or the system default), and the proceeds to aggressively poll that temp file for changes to the disk, updating the internal store as it does.

The other method of handling this problem is of course the watch folder, or the sync folder as we call it. With this model the software either actively polls or is commanded to sync with an entire group of files via some “inbox” or public storage area that extends internal storage into the file system.

We feel this is the best approach for Scrivener, because Scrivener is less about “documents” and more about outlines. It encourages an approach where individual items in the binder are short and to the point, meaning one might have to use “Open in External Editor” fifteen times to actually open an entire chapter—and then you’ve got fifteen aggressive I/O monitors slowing the system down.

Another complication has been pointed out already, and that is that Scrivener has a variety of features that no other editor on the market has. Most of those features are accomplished via the plumbing that is provided by using a rich text editing system—which means any kind of syncing that drops to plain-text destroys those special features (never mind italics).

The external folder sync feature does its best to avoid that kind of destruction, by operating at a paragraph level of granularity, and providing additional conversion and processing routines to round-trip stuff other editors can’t do. I’m not sure if an actively polled external temp file system could provide the same level of protection without demanding even more resources from the machine.

To conclude: this has been requested before, and this probably won’t be the last time it is requested—our answer remains the same: there is a feature for this already. It’s not that we do not see the merits in this capability, and all of your arguments for it, and where Scrivener has weaknesses, are sound (I don’t get why there is such a backlash against that here). It’s just that our approach isn’t quite what you had in mind, and so your best bet is to find ways to make that feature work well for you.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles