Code Monkey home page Code Monkey logo

zen's Introduction

Zen

Distraction free writing for Atom.

Toggle with cmd-ctrl-z on OS X or by adding shift to your platform's fullscreen command:

  • cmd-ctrl-shift-F on OSX
  • shift-F11 on Windows and Linux.

Settings:

  • Width
  • Tabs can all be hidden, or all except the active tab
  • Optional soft wrap
  • Keep the word count visible

Note that settings are not available until the package has been activated, due to a shortcoming in core. Also, if you change themes, you might need to reload Atom for the colors to be applied correctly to all packages including Zen.

Before:

After:

zen's People

Contributors

adiospace avatar arcsum avatar braver avatar chris123457 avatar colch avatar davidfig avatar defunkt avatar elebumm avatar erran avatar izuzak avatar jorgeartware avatar lucasmotta avatar ragekit avatar rm-code avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

zen's Issues

Soft wrap issues

Seems like with soft wrap enabled in Zen mode, text is being hidden at the edge of the 80 column width instead of wrapping.

screenshot 2014-03-15 21 21 44

Uncaught TypeError: Cannot read property 'getDefaultCharWidth' of undefined

[Enter steps to reproduce below:]

  1. Install Zen
  2. use default shortcut, cmd-ctrl-z to launch zen mode, crash happens

Atom Version: 0.165.0
System: Mac OS X 10.9.5
Thrown From: Zen package, v0.10.0

Stack Trace

Uncaught TypeError: Cannot read property 'getDefaultCharWidth' of undefined

At /Users/agargiulo/.atom/packages/Zen/lib/zen.coffee:24

TypeError: Cannot read property 'getDefaultCharWidth' of undefined
  at Object.module.exports.toggle (/Users/agargiulo/.atom/packages/Zen/lib/zen.coffee:24:23)
  at atom-workspace.<anonymous> (/Users/agargiulo/.atom/packages/Zen/lib/zen.coffee:13:50)
  at atom-workspace.handler (/Applications/Atom.app/Contents/Resources/app/src/space-pen-extensions.js:115:32)
  at atom-workspace.jQuery.event.dispatch (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4681:9)
  at atom-workspace.elemData.handle (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4359:46)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:243:29)
  at /Applications/Atom.app/Contents/Resources/app/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:549:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:391:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:167:20)

Commands

     -0:43.9 snippets:expand (input.hidden-input)
     -0:43.9 editor:indent (input.hidden-input)
     -0:43.7 snippets:next-tab-stop (input.hidden-input)
     -0:43.7 snippets:expand (input.hidden-input)
     -0:43.7 editor:indent (input.hidden-input)
     -0:43.6 snippets:next-tab-stop (input.hidden-input)
     -0:43.6 snippets:expand (input.hidden-input)
     -0:43.6 editor:indent (input.hidden-input)
  7x -0:43.4 core:backspace (input.hidden-input)
     -0:39.4 core:save (input.hidden-input)
     -0:37.5 core:move-down (input.hidden-input)
     -0:37.1 core:backspace (input.hidden-input)
     -0:36.3 core:save (input.hidden-input)
     -0:35.1 core:move-down (input.hidden-input)
     -0:34.7 core:backspace (input.hidden-input)
     -0:00.0 zen:toggle (div.settings-view.pane-item)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "jellybeans-syntax"
    ],
    "disabledPackages": [
      "vim-mode"
    ]
  }
}

Installed Packages

# User
jellybeans-syntax, v0.3.0
project-colorize, v0.1.0

# Dev
No dev packages

/cc @atom/core

New specs

The upcoming release is without specs. The package is simple enough to test quickly by hand, and it should be easy enough to prevent regressions without a testing framework. However, it would be nice to have a few automated checks:

  • are attributes being set
  • is the editor width updated

I've got the basic setup done, but am running into some issues.

I'm not going to put priority on adding specs, but if anyone feels up to it I'd be grateful.

// in package.json add
  "devDependencies": {
    "jasmine-jquery": "2.x.x"
  }
$ = require 'jquery'

describe "Zen", ->
  [activationPromise, editor, editorView] = []

  goZen = (callback) ->
    atom.commands.dispatch editorView, "zen:toggle"
    waitsForPromise -> activationPromise
    requestAnimationFrame -> runs(callback)

  beforeEach ->
    waitsForPromise ->
      atom.workspace.open()

    runs ->
      editor = atom.workspace.getActiveTextEditor()
      editorView = atom.views.getView(editor)
      activationPromise = atom.packages.activatePackage('Zen')

  describe "when going Zen", ->
    it "stores settings in attributes", ->
      goZen ->
        expect($('body')).toHaveAttr('data-zen', 'true')

Wrong view

Whenever I toggle Zen, the screen turns like 33% width (or width of the sidebar) - Basically; When I toggle zen, the coding container replaces the sidebar, in a centered manner. :/ Pretty much ruins the purpose, as I get like 60% less coding space.

Allow width to be configured

Currently Zen Mode is hardcoded to a 70 character width, and seems to have an implicit assumption that users having lines longer than 70 characters will have soft wrapping enabled.

However, because of issues in Vim Mode, some of us are forced to use hard wraps. Wrap Lines makes this a bit more tolerable by allowing users to bulk wrap lines, but it is hardcoded to do so at 80 characters. This mismatch means that Wrap Lines and Zen Mode don't play well together. I've created an issue with Wrap Lines to allow for configurable wrap margins, but am doing the same here. Any reason Zen Mode couldn't allow the user to specify, for example, an 80 character viewing window vs. the current 70?

Left-aligned after opening a new file

  1. Open file
  2. Switch to zen mode
  3. Cmd-T to open another file

While the first file opens fine and ist centered horizontally on screen, the second file is aligned to the very left of your screen. (using atom 0.129.0)

Scroll bars in the status bar

When I toggle Zen mode off scroll bars appear in the status bar as in the attached image:

status_bar

I'm using Zen package version 0.12.0, Atom 0.192.0 on Windows 8.1.

Uncaught TypeError: Cannot read property 'setSoftWrapped' of undefined

[Enter steps to reproduce below:]

  1. Have a document open in Zen mode
  2. Edit->Preferences
  3. Hit [shift]+F11 in order to exit the settings editor
    (as it seems impossible to close it otherwise, there's no close "X" popping up in that constellation)

Atom Version: 1.0.0
System: LMDE 2
Thrown From: Zen package, v0.14.0

Stack Trace

Uncaught TypeError: Cannot read property 'setSoftWrapped' of undefined

At /home/uliska/.atom/packages/Zen/lib/zen.coffee:111

TypeError: Cannot read property 'setSoftWrapped' of undefined
  at Object.module.exports.toggle (/home/uliska/.atom/packages/Zen/lib/zen.coffee:111:15)
  at atom-workspace.<anonymous> (/home/uliska/.atom/packages/Zen/lib/zen.coffee:28:59)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app.asar/src/command-registry.js:241:29)
  at /usr/share/atom/resources/app.asar/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:520:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:355:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/usr/share/atom/resources/app.asar/src/window-event-handler.js:180:20)

Commands

  2x -4:43.7.0 core:backspace (atom-text-editor.editor.is-focused)
     -4:40.6.0 editor:newline (atom-text-editor.editor.is-focused)
 13x -4:29.4.0 core:backspace (atom-text-editor.editor.is-focused)
  2x -3:40.7.0 core:move-right (atom-text-editor.editor.is-focused)
     -3:21.1.0 core:select-down (atom-text-editor.editor.is-focused)
     -3:20.8.0 core:backspace (atom-text-editor.editor.is-focused)
  3x -3:20.2.0 core:move-up (atom-text-editor.editor.is-focused)
     -3:15.3.0 editor:select-to-end-of-word (atom-text-editor.editor.is-focused)
     -2:08.0 core:move-right (atom-text-editor.editor.is-focused)
 16x -2:07.7.0 core:select-down (atom-text-editor.editor.is-focused)
     -2:04.6.0 core:backspace (atom-text-editor.editor.is-focused)
     -1:46.5.0 core:move-right (atom-text-editor.editor.is-focused)
     -1:46.3.0 editor:newline (atom-text-editor.editor.is-focused)
     -1:45 core:move-left (atom-text-editor.editor.is-focused)
     -1:44.6.0 core:move-right (atom-text-editor.editor.is-focused)
     -0:03.7.0 zen:toggle (div.settings-view.pane-item)

Config

{
  "core": {},
  "Zen": {}
}

Installed Packages

# User
Zen, v0.14.0
language-latex, v0.6.1
latexer, v0.2.3
soft-wrap-indicator, v0.7.0
texlicious, v0.4.4
text-manipulation, v0.6.0

# Dev
No dev packages

Markdown formatting (feature suggestion)

I love the way Byword formats Markdown elements. If you haven't seen it before, it makes headlines bigger and bold, for example. For italics and boldface, it makes the text italics or boldface, and dims the asterisks or underscores. It dims the links. In short, it helps you focus on the substance, not the markup.

Here's a look at it: http://bywordapp.com/-/img/byword_mac_01.jpg

Ulysses does this, too (so did Editorially). It makes it much easier to write in Markdown, and I would love to see it come to Zen.

toggle fullscreen

Could you make Zen toggle the window of Atom fullscreen? This is the default behavior in Sublime.
This is the command: window:toggle-full-screen

toggle only goes to full screen

When pressing cmd-ctrl-z Full screen is engaged along with Zen. cmd-ctrl-shift-F does nothing.

These toggles previously worked prior to update.
just updated to version 0.11.0

White Background

When I enter zen, a white border appears around the text I'm editing, instead of the black/dark grey atom background that should appear and appears in sample images.

Word Count Option

Would help to include word count of the current document in the bottom center and enable via Settings. Or, setting to allow for status bar. Thanks

deal with multiple panes

A split editor is not dealt with by Zen. I think we should try and show only the current editor.

Add an option to keep the tabs visible?

It's easier to spot which file you are editing. And then you open the possibility to customize the tab for the zen mode only, like this:

On my case I've customised the stylesheet (.zen) to only show the active tab, full width and align on the center.
I can create a pull request if this sounds interesting.

Suggestion: Center current line vertically

While writing a document I had an idea and would like to suggest this as an addition to Zen (if you think it's in line with Zen's spirit):

How about a mode where the line with the cursor in is always centered vertically on the screen?
That means when the cursor goes to a new line (by navigating, entering a line break or by soft wrapping) it actually stays at the same vertical position while the surrounding text scrolls correspondingly. This could even work when there's less than one "page" of text, so one would actually start writing at the center of the screen.

I didn't try this out but I can imagine it would add to the idea of "distraction free writing".

No padding at top of document

When I activate Zen, the padding that used to appear at the top has not been present for a while now, and the top line of text sticks very close to the top of my screen:

screen shot 2015-05-27 at 12 26 33

Is there any way I can fix this? I tried disabling all the installed extensions as well as most of the default ones without luck.

Support for windows

Windows doesn't have a command button, I tried Ctrl+alt+Z doesn't do anything, i also tried Ctrl+windows+z created a special char.

Zen should fall back to ctrl+alt if running on windows..

Different background color

screenshot_2015-05-23_12-12-59

The outer color in the screenshot is rgb(21, 23, 24). The inner color is rgb(16, 17, 18). The latter color is also the one that's used as background color when not using Zen.

Using Atom 0.200.0 with Zen 0.14.0 and the Isotope UI theme and Seti syntax theme on Arch Linux.

~/.atom/packages/Zen/styles/zen.less uses @syntax-background-color.

screenshot_2015-05-23_12-18-13

~/.atom/packages/seti-syntax/styles/syntax-variables.less defines @syntax-background-color as: @syntax-background-color: @code-background;. It imports colors.less, which defines @code-background as: @code-background: rgb(21,23,24); // editor background.

The ~/.atom/packages/seti-syntax/styles/ directory however, has no ui-variables.less file.

Could this be causing a problem with Zen trying to import a background color from the syntax theme used? Is this even an issue with Zen at all, or rather with the Seti syntax theme?

Change font and font-size for Zen

It seems like it should be possible to change the font face and size for the editor in Zen using user styles but I can't seem to get it to work. Is this currently possible?

Add option to deactivate text wrapping

Just a small suggestion: When you increase the width of Zen (to avoid text wrapping), the text starts at the left side of the screen. I think it would be nice to have an option to manually add some padding so that the text starts a bit more to the right.

Few deprecated selectors needs to be changed!

keymaps/zen.cson

  • Use the atom-workspace tag instead of the workspace class.
  • Use the atom-text-editor tag instead of the editor class.

stylesheets/zen.less

  • Use the atom-text-editor tag instead of the editor class.

Specs passing?

I'm new to the whole Atom packages, so forgive me if this is totally BS.

I installed Zen package, and then ran "View" => "Developer" => "Run Atom Specs".

This produced:

Error: Cannot find module '../lib/zen-view'
  at Function.Module._resolveFilename (module.js:337:15)
  at Function.Module._load (module.js:279:25)
  at Module.require (module.js:363:17)
  at require (module.js:379:17)
  at Object.<anonymous> (/Users/miketheman/.atom/packages/Zen/spec/zen-view-spec.coffee:1:11)
  at Object.<anonymous> (/Users/miketheman/.atom/packages/Zen/spec/zen-view-spec.coffee:1:1)
  at Module._compile (module.js:455:26)
...

So I went over to this line and replaced lib/zen-view to lib/zen - after which running the specs again produces failures:

Zen
when the zen:toggle event is triggered
it attaches and then detaches the view
ReferenceError: WorkspaceView is not defined
ReferenceError: WorkspaceView is not defined
at zen-spec.coffee:12:26
TypeError: Cannot call method 'find' of undefined
TypeError: Cannot call method 'find' of undefined
at zen-spec.coffee:17:33
ZenView
it has one valid test
Expected 'life' to be 'easy'.
at zen-view-spec.coffee:6:20

So I'm not entirely certain "where" to start poking around looking to fix this.

In general, my Atom hangs and crashes frequently, which is why I'm wondering if it's in packages-world or core (there's no way to debug atom itself yet, is there?).

Anyways, thanks for listening!

Show word count when tree view is shown?

Would it be possible to show the word count at the bottom right-hand corner even when the tree view is enabled? Currently, enabling tree view hides the word count.

Line number

I go zen mode but i'm seeing line number anyways, i have read here that unchecking Shadow DOM it's solved, but that doesn't work. I have 0.16.2 versión.

Shows Fullscreen With No Text

I use a secondary monitor with my MacBook lid closed. This is on Atom 194. It happens both with ctrl-command-z and ctrl-command-shift-f.

screenshot 2015-04-22 15 55 11

Trigger Zen mode on Atom start up

Looks like this repo doesn't have a public Wiki, so I am posting it here. If you want to load Zen mode automatically every time you start Atom, here is a snippet for the init.coffee:

# Load Zen mode on startup
atom.workspaceView.eachEditorView (editorView) ->
    atom.workspaceView.trigger 'zen:toggle';

I am waiting for eachEditorView to avoid skewed UI with grey background. There should be a more elegant way of doing this, I guess.

Zen not working?

Hi,
great plugin - thanks for developing it. It seems to be struggling to work on Atom 0.198.0. Toggling between modes only activates full screen and that is it.

Error after update to 0.8.0

Uncaught TypeError: Cannot read property 'editor' of undefined /Users/mattgraham/.atom/packages/Zen/lib/zen.coffee:23

Uncaught TypeError: Cannot read property 'isSoftWrapped' of undefined /Users/mattgraham/.atom/packages/Zen/lib/zen.coffee:26

Wrap Guide doesn't play well with Zen

When "Preferred Line Length" is set to a non-zero value and Wrap Guide is enabled (not sure if it's on by default), the line guide and flow don't play well together, as seen below.

screen shot 2014-06-14 at 6 03 06 pm

Some potential solutions:

  • Hide the wrap guide when in Zen mode entirely
  • Set the width of zen mode based off of the width specified by wrap guide

Disable line numbers for only zen?

Hi,

Recently something has changed with either Zen or Atom; initially when I installed both, by default line numbers were visible for the normal editor and hidden/disabled when in distraction free (zen) mode.

In config.cson I've tried the following, but it has no effect...

  'editor':
    'showLineNumbers': true
  'Zen':
    'width': 100
    'showLineNumbers': false

I can manually toggle line numbers, i.e. if they are hidden in the normal editor they are hidden in zen, but I would like not to have to change this setting each time I change views.

Is there perhaps a way to hide the line numbers in styles?

Thx!

ATOM: 0.169.0
Zen: 0.10.0

Handle .pdf file changes

When writing LaTeX documents, it is preferable to have the .pdf update whenever the .tex is compiled. Updating the .pdf being displayed simply clears the pdf view. Switching tabs triggers an attempt to reload the .pdf–however, the result is garbled. I'm hoping there's an easy fix here since this plug-in provides a much needed component for LaTeX users.

Cheers,
Per

Suggestions

Thanks for Zen. Like it really much. Here are some rough thoughts:

  • Is it possible to change the font size while using Zen or even change the font entirely? I'm using PragmataPro 13pt when coding but changing to another bigger size font such as Nitti 16pt suits the focus mode better.
  • If I'm using spacegray theme. It will show a highlight on the current line of text. Which look quite ugly in my opinion. Wouldn't be nice to disable the highlight effect and change the alpha value on the other text which is not the current line?
  • Is it possible to make Zen mode as default to some extension such as .md?

Cheers. Thanks for your contribution again.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.