原子编辑器中的分割屏幕

有没有一种方法(插件或其他东西)使用分割屏幕在原子编辑器?

我看了菜单,但没有相关选项。

88002 次浏览

I found this at Split Windows - issue #64:

It seems like Atom already has support for splitting windows (cmd-k + arrow key)

Using the command palette

Open the command palette with cmd + shift + p (OSX) or ctrl + shift + p (Linux/Windows) and type "split". You'll see options for Up, Down, Left, and Right split.

Using keyboard shortcuts

Split the current tab in a direction with the following shortcuts

  • Up       cmd / ctrl + k then
  • Down  cmd / ctrl + k then
  • Left     cmd / ctrl + k then
  • Right   cmd / ctrl + k then

You can close an active split pane with cmd / ctrl + k then cmd / ctrl + w.

Move between panes

If you want to move between open panes (with the keyboard) you have to modify your keymap file. Go to Atom -> Open Your Keymap and include this:

'body':
'cmd-alt left': 'window:focus-pane-on-left'
'cmd-alt right': 'window:focus-pane-on-right'
'cmd-alt up': 'window:focus-pane-above'
'cmd-alt down': 'window:focus-pane-below'
'cmd-alt-2': 'pane:split-right'
'cmd-alt-3': 'pane:split-down'

This is my personal setup. I was used to Sublime's default cmd + alt + arrow. Change the left side commands to your personal preference.

Note

You need to press cmd-alt once, release, and then press the arrow button. Otherwise it won't work.

I have created a beginners cheat sheet for Atom that lists some introductory notes and keyboard shortcut commands etc. Its on github @ https://github.com/pd-gmit/atom-cheatsheet/blob/master/atom_cheatsheet.md

You could always just right click anywhere on the file and the split options are available in the context menu.

Right click anywhere on an open file, select "split left"

enter image description here

If it duplicates a file, "x" it out.


Result:

enter image description here