Giter Club home page Giter Club logo

center-screen's Introduction

Center Screen

Center the screen on the selected line, like zz in vim.

How to use

Activate first by doing one of the following:

  • Choosing Center Screen: Center Screen from the command palette
  • Right click on the line you want to center, and choose Center Screen from the context menu
  • Define a keyboard shortcut, for example:
'.editor':
    'ctrl-alt-z': 'center-screen:center-screen'

After that you can use these methods to center the selected line.

You can choose to keep the selected line centered when you move by using the Follow Cursor option in one of the following ways:

  • Enable Follow Cursor in the settings for this package
  • Choose Center Screen: Toggle Follow Cursor from the command palette center-screen screencast

Credits

center-screen's People

Contributors

mlitvk avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

mechkit

center-screen's Issues

Failed to activate the center-screen package

I simply run center screen from the command palette.

Atom Version: 0.194.0
System: Mac OS X 10.10.3
Thrown From: center-screen package, v0.2.1

Stack Trace

Failed to activate the center-screen package

At Cannot find module 'src/editor-view'

Error: Cannot find module 'src/editor-view'
  at Module._resolveFilename (module.js:328:15)
  at Function.Module._resolveFilename (/Applications/Atom.app/Contents/Resources/app.asar/src/module-cache.js:383:52)
  at Function.Module._load (module.js:270:25)
  at Module.require (module.js:357:17)
  at require (module.js:376:17)
  at new CenterScreen (/Users/exalted/.atom/packages/center-screen/lib/center-screen.coffee:47:18)
  at /Users/exalted/.atom/packages/center-screen/lib/main.coffee:12:13
  at WorkspaceView.module.exports.WorkspaceView.eachEditorView (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace-view.js:92:9)
  at Object.module.exports.activate (/Users/exalted/.atom/packages/center-screen/lib/main.coffee:10:24)
  at Package.module.exports.Package.activateNow (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:222:19)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/package.js:740:25
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:219:20)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
  at CommandPaletteView.module.exports.CommandPaletteView.confirmed (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/command-palette/lib/command-palette-view.js:120:32)
  at CommandPaletteView.module.exports.SelectListView.confirmSelection (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-space-pen-views/lib/select-list-view.js:338:21)
  at space-pen-div.atom.commands.add.core:confirm (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-space-pen-views/lib/select-list-view.js:109:19)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:238:29)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:519:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:354:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:178:20)

Commands

  2x -2:31.1.0 core:backspace (atom-text-editor.editor.mini)
  2x -2:30.4.0 core:confirm (atom-text-editor.editor.mini)
  2x -1:31.7.0 core:backspace (atom-text-editor.editor.mini)
     -0:23.7.0 pane:show-next-item (atom-text-editor.editor.mini)
     -0:22.3.0 command-palette:toggle (atom-text-editor.editor.cursor-block.cursor-line-fix.is-focused)
     -0:16.9.0 editor:consolidate-selections (atom-text-editor.editor.mini)
     -0:16.9.0 core:cancel (atom-text-editor.editor.mini)
     -0:08.2.0 editor:move-to-first-character-of-line (atom-text-editor.editor.cursor-block.cursor-line-fix.is-focused)
     -0:08.1.0 core:move-to-top (atom-text-editor.editor.cursor-block.cursor-line-fix.is-focused)
     -0:07.9.0 find-and-replace:show (atom-text-editor.editor.cursor-block.cursor-line-fix.is-focused)
     -0:07.0 core:confirm (atom-text-editor.editor.mini)
     -0:06.7.0 editor:consolidate-selections (atom-text-editor.editor.mini)
     -0:06.7.0 core:cancel (atom-text-editor.editor.mini)
     -0:05.8.0 command-palette:toggle (atom-text-editor.editor.cursor-block.cursor-line-fix.is-focused)
     -0:02.8.0 core:confirm (atom-text-editor.editor.mini)
     -0:02.8.0 center-screen:center-screen (atom-text-editor.editor.cursor-block.cursor-line-fix.is-focused)

Config

{
  "core": {
    "ignoredNames": [
      ".git",
      ".svn",
      ".DS_Store"
    ],
    "disabledPackages": [
      "markdown-format",
      "syntax-settings",
      "autocomplete",
      "deprecation-cop",
      "autocomplete-paths",
      "archive-view",
      "background-tips",
      "bookmarks",
      "image-view"
    ],
    "projectHome": "/Users/exalted/Development",
    "followSymlinks": true,
    "themes": [
      "one-light-ui",
      "one-dark-syntax"
    ]
  }
}

Installed Packages

# User
autocomplete-emojis, v2.2.0
autocomplete-html, v0.5.0
autocomplete-plus, v2.12.0
autocomplete-snippets, v1.2.0
block-cursor, v0.12.4
center-screen, v0.2.1
highlight-selected, v0.9.2
language-csharp, v0.5.0
linter, v0.12.1
linter-rubocop, v0.2.2

# Dev
No dev packages

Many deprecation warnings

With version 1.14.1, the package yields 4 deprecations:

This is now a view method. Call TextEditorElement::setScrollTop instead.
Report Issue
TextEditor.setScrollTop - /Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:3472:12
Object.toggle - /Users/drorata/.atom/packages/center-line/lib/center-line.coffee:49:14
atom-text-editor.atom.commands.add.center-line:toggle - /Users/drorata/.atom/packages/center-line/lib/center-line.coffee:11:26
CommandRegistry.handleCommandEvent - /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:259:29
<unknown> - /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:59
KeymapManager.dispatchCommandEvent - /Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:599:16
This is now a view method. Call TextEditorElement::getHeight instead.
Report Issue
TextEditor.getHeight - /Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:3384:12
Object.toggle - /Users/drorata/.atom/packages/center-line/lib/center-line.coffee:44:25
atom-text-editor.atom.commands.add.center-line:toggle - /Users/drorata/.atom/packages/center-line/lib/center-line.coffee:11:26
CommandRegistry.handleCommandEvent - /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:259:29
<unknown> - /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:59
KeymapManager.dispatchCommandEvent - /Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:599:16
This is now a view method. Call TextEditorElement::getHeight instead.
Report Issue
TextEditor.getHeight - /Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:3384:12
Object.toggle - /Users/drorata/.atom/packages/center-line/lib/center-line.coffee:46:36
atom-text-editor.atom.commands.add.center-line:toggle - /Users/drorata/.atom/packages/center-line/lib/center-line.coffee:11:26
CommandRegistry.handleCommandEvent - /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:259:29
<unknown> - /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:59
KeymapManager.dispatchCommandEvent - /Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:599:16
This is now a view method. Call TextEditorElement::getHeight instead.
Report Issue
TextEditor.getHeight - /Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:3384:12
Object.toggle - /Users/drorata/.atom/packages/center-line/lib/center-line.coffee:47:25
atom-text-editor.atom.commands.add.center-line:toggle - /Users/drorata/.atom/packages/center-line/lib/center-line.coffee:11:26
CommandRegistry.handleCommandEvent - /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:259:29
<unknown> - /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:59
KeymapManager.dispatchCommandEvent - /Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:599:16

Am I the only one trying out this package? :)

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.