Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #247 - New layer: writeroom #4262

Closed
wants to merge 1 commit into from
Closed

Fixes #247 - New layer: writeroom #4262

wants to merge 1 commit into from

Conversation

algernon
Copy link
Contributor

When activated, SPC a W will toggle writeroom-mode for distraction-free editing, a great way to edit large amounts of text.

(interactive)

(spacemacs/set-leader-keys "aW" #'writeroom-mode))
(spacemacs/set-leader-keys "aW" #'spacemacs/writeroom-mode))))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why you are defining a function on SPC a W that has for goal to defines another function on SPC a W :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I saw this somewhere else, and the reason was lazyness. This was a while ago, on master as opposed to develop, and I forgot where I saw it. This layer has been sitting in my config for a while, and I copy & pasted and updated it for develop now.

I'll give it a go without the redefinition thingy a bit later, and will update the PR accordingly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the witeroom package is defining witeroom-mode as ;;;autoload it should work out-of-the-box. In the other case, you can simply add :commands (witeroom-mode) and it should autoload the packages when called.

When activated, `SPC a W` will toggle writeroom-mode for
distraction-free editing, a great way to edit large amounts of text.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
@algernon
Copy link
Contributor Author

Updated the PR, removing the SPC a W redefinition hack, as writeroom-mode has working autoloads. Thanks @StreakyCobra!

@fintelkai
Copy link
Contributor

Yes, please. I have a private layer for this. Always happy to find my tools in the official distribution.

@myrjola
Copy link
Contributor

myrjola commented Feb 6, 2016

writeroom-mode is so nice! Thanks for sharing!

@StreakyCobra
Copy link
Contributor

I'm considering to try this for some days, and if it works well to do some lobbying on @syl20bnr to get this merged 😉

@vise890
Copy link
Contributor

vise890 commented Feb 6, 2016

The only problem I found with it is that it doesn't work as well with which-key or the helm buffers. Write room is awesome tho, I'd love to see it merged.

On 6 February 2016 15:47:04 GMT+00:00, Fabien Dubosson notifications@github.com wrote:

I'm considering to try this for some days, and if it works well to do
some lobbying on @syl20bnr to get this merged 😉


Reply to this email directly or view it on GitHub:
#4262 (comment)

Sent from my Android device with K-9 Mail. Please excuse my brevity.

@StreakyCobra
Copy link
Contributor

Indeed. This should probably be asked upstream, to know if there are some possibilities to apply this on helm buffers also. For which-key this should also be asked there probably, but maybe @justbur have some thought on this before going upstream?

@StreakyCobra
Copy link
Contributor

Some remarks:

  • It seems that SPC a W is already taken.
  • It may be nice to integrate the information about global-writeroom-mode and an example on how to activate it for markdown-mode by default.

@justbur
Copy link
Contributor

justbur commented Feb 6, 2016

For which-key this should also be asked there probably, but maybe @justbur have some thought on this before going upstream?

What's the problem exactly?

@StreakyCobra
Copy link
Contributor

@justbur When writeroom is enabled, which-key and helm still use the full width instead of the using the same width as the buffer.

I read a little bit more about it and it seems writeroom takes care of being buffer-local, so as which-key and helm use another buffer, there is probably no easy way of making writeroom to apply to them at the same time.

@vise890 I think you'll have to discuss this upstream if you want it, as it also happen on raw Emacs.

@vise890
Copy link
Contributor

vise890 commented Feb 6, 2016

@StreakyCobra I' think I can live with it. :)

To be honest I'm more concerned about obscure/unwanted layers taking all the good shortcuts (especially under SPC a). I think it's really starting to clash with the "mnemonic" principle of spacemacs.

EDIT: specify that SPC a is the most prominent example

@justbur
Copy link
Contributor

justbur commented Feb 6, 2016

I read a little bit more about it and it seems writeroom takes care of being buffer-local, so as which-key and helm use another buffer, there is probably no easy way of making writeroom to apply to them at the same time.

@StreakyCobra writeroom could adjust the frame parameters or use a hook to adjust which-key and probably helm. It's definitely possible.

@StreakyCobra
Copy link
Contributor

writeroom could adjust the frame parameters or use a hook to adjust which-key and probably helm. It's definitely possible.

So @vise890 it's up to you if you want to try asking it upstream :-)

@vise890
Copy link
Contributor

vise890 commented Feb 7, 2016

@StreakyCobra I'm ok with it, it's not a big deal. 😄

As I said, I'm more concerned about the keybinding.. SPC a w and SPC a W are both taken. Perhaps SPC t W?

@StreakyCobra
Copy link
Contributor

Yes writeroom-mode acts as a toggle, so SPC t W may be a choice. Let's wait for @syl20bnr opinion.

@algernon
Copy link
Contributor Author

algernon commented Feb 8, 2016

I am happy to update the PR to change the keybinding and add extra docs. I will change to SPC t W soonish.

@syl20bnr syl20bnr self-assigned this Feb 15, 2016
@syl20bnr syl20bnr changed the title New layer: writeroom FIxes #247 - New layer: writeroom Mar 5, 2016
@syl20bnr syl20bnr changed the title FIxes #247 - New layer: writeroom Fixes #247 - New layer: writeroom Mar 5, 2016
@d9k
Copy link

d9k commented Aug 5, 2016

Great, but conflicts with global-linum-mode (try switch it on and then activate writeroom-mode).

@d9k
Copy link

d9k commented Aug 5, 2016

Also I would like to have writeroom-mode global state (to apply it to all already openned files and newly openned then).

@d12frosted
Copy link
Collaborator

@syl20bnr ping 😸

@xerron
Copy link

xerron commented Oct 26, 2016

I like the features of this plugin Vim
https://github.com/junegunn/goyo.vim

@spott
Copy link

spott commented Dec 12, 2016

So, it looks like this layer modifies the fullscreen mode of Emacs. If you have native mode (for os X) in your .spacemacs file, starting writeroom mode will pull you out of native mode.

The experience is kind of annoying, but considering the layer is pretty much just "pull in the writeroom-mode" external mode, I'm not sure this can be fixed without rewriting writeroom.

@spott
Copy link

spott commented Dec 12, 2016

Ok, I think I figured out how to fix that. see this issue.

A method of figuring out the current fullscreen mode and mirroring that seems like a good idea.

@syl20bnr
Copy link
Owner

syl20bnr commented Jul 1, 2017

Thank you for the PR. As in our contribution guidelines [0] we generally don't add basic layers which consists of adding a package and a hook or key binding. For this reason I close this PR.

Thank you for your understanding.

[0] https://github.com/syl20bnr/spacemacs/blob/develop/CONTRIBUTING.org#contributing-a-layer

@syl20bnr syl20bnr closed this Jul 1, 2017
@algernon algernon deleted the f/writeroom branch July 1, 2017 18:22
@Compro-Prasad
Copy link
Contributor

@syl20bnr Then how would you solve #247 ? I think adding this to spacemacs base or core is beneficial as its a very nice thing to have from reading point of view. Adding it under a toggle would also be nice.

@Compro-Prasad
Copy link
Contributor

Sorry, its solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet