1
.github
@@ -1,3 +1,2 @@
|
||||
[docs]
|
||||
title = The Guide to Atom
|
||||
manifest = intro.md, features.md, configuring-and-extending.md, styling.md, packages/intro.md, packages/installing.md, packages/markdown-preview.md, packages/wrap-guide.md
|
||||
|
||||
1
.gitignore
vendored
@@ -9,3 +9,4 @@ build
|
||||
node_modules
|
||||
npm-debug.log
|
||||
/tags
|
||||
/cef/
|
||||
|
||||
3
.gitmodules
vendored
@@ -46,3 +46,6 @@
|
||||
[submodule "vendor/packages/python.tmbundle"]
|
||||
path = vendor/packages/python.tmbundle
|
||||
url = https://github.com/textmate/python.tmbundle
|
||||
[submodule "prebuilt-cef"]
|
||||
path = prebuilt-cef
|
||||
url = https://github.com/github/prebuilt-cef
|
||||
|
||||
91
README.md
@@ -2,9 +2,9 @@
|
||||
|
||||

|
||||
|
||||
## Building from source
|
||||
Check out our [documentation on the docs tab](https://github.com/github/atom/docs).
|
||||
|
||||
*Be forwarned: Atom is pre-alpha software!*
|
||||
## Building from source
|
||||
|
||||
Requirements
|
||||
|
||||
@@ -18,90 +18,3 @@ Requirements
|
||||
|
||||
2. cd ~/github/atom && `rake install`
|
||||
|
||||
Atom is installed! Type `atom [path]` from the commmand line or find it in `/Applications/Atom.app`
|
||||
|
||||
## Your ~/.atom Directory
|
||||
A basic ~/.atom directory is installed when you run `rake install`. Take a look at ~/.atom/user.coffee for more information.
|
||||
|
||||
## Basic Keyboard shortcuts
|
||||
Atom doesn't have much in the way of menus yet. Use these keyboard shortcuts to
|
||||
explore features.
|
||||
|
||||
`meta-o` : open file/directory
|
||||
|
||||
`meta-n` : new window
|
||||
|
||||
`meta-t` : open fuzzy file finder
|
||||
|
||||
`meta-:` : open command prompt
|
||||
|
||||
`meta-f` : open command prompt with /
|
||||
|
||||
`meta-g` : repeat the last search
|
||||
|
||||
`meta-r` : reload the current window
|
||||
|
||||
`meta-alt-ctrl-s` : run specs
|
||||
|
||||
`meta-alt-arrows` : split screen in direction of arrow
|
||||
|
||||
`meta-alt-w` : toggle word wrap
|
||||
|
||||
`meta-alt-f` : fold selected lines
|
||||
|
||||
`meta-l` : go to line
|
||||
|
||||
Most default OS X keybindings also work.
|
||||
|
||||
## TreeView Keyboard shortcuts
|
||||
With the treeview focused:
|
||||
|
||||
`a` : Add a new file or directory. Directories end with '/'.
|
||||
|
||||
`m` : Rename a file or directory
|
||||
|
||||
## Init Script
|
||||
|
||||
Atom will require `~/.atom/user.coffee` whenever a window is opened or reloaded if it is present in your
|
||||
home directory. This is a rudimentary jumping off point for your own customizations.
|
||||
|
||||
## Command Panel
|
||||
|
||||
A partial implementation of the [Sam command language](http://man.cat-v.org/plan_9/1/sam)
|
||||
|
||||
*Examples*
|
||||
|
||||
`,` selects entire file
|
||||
|
||||
`1,4` selects lines 1-4
|
||||
|
||||
`/pattern` selects the first match after the cursor/selection
|
||||
|
||||
`s/pattern/replacement` replace first text matching pattern in current selection
|
||||
|
||||
`s/pattern/replacement/g` replace all text matching pattern in current selection
|
||||
|
||||
`,s/pattern/replacement/g` replace all text matching pattern in file
|
||||
|
||||
`1,4s/pattern/replacement` replace all text matching pattern in lines 1-4
|
||||
|
||||
`x/pattern` selects all matches in the current selections
|
||||
|
||||
`,x/pattern` selects all matches in the file
|
||||
|
||||
`,x/pattern1/ x/pattern2` "structural regex" - selects all matches of pattern2 inside matches of pattern1
|
||||
|
||||
## Key Bindings
|
||||
|
||||
Atom has a CSS based key binding scheme. We will add a nicer loading mechanism, but for now you can bind
|
||||
keys by calling `window.keymap.bindKeys` with a CSS selector and a hash of key-pattern -> event mappings.
|
||||
|
||||
```coffeescript
|
||||
window.keymap.bindKeys '.editor'
|
||||
'ctrl-p': 'party-time'
|
||||
'ctrl-q': 'open-dialog-q'
|
||||
```
|
||||
|
||||
When a keypress matches a pattern on an element that matches the selector, it will be translated to the
|
||||
named event, which will bubble up the DOM from the site of the keypress. Extension code can listen for
|
||||
the named event and react to it.
|
||||
|
||||
70
Rakefile
@@ -5,7 +5,7 @@ BUILD_DIR = 'atom-build'
|
||||
require 'erb'
|
||||
|
||||
desc "Build Atom via `xcodebuild`"
|
||||
task :build => "create-project" do
|
||||
task :build => "create-xcode-project" do
|
||||
command = "xcodebuild -target Atom -configuration Release SYMROOT=#{BUILD_DIR}"
|
||||
output = `#{command}`
|
||||
if $?.exitstatus != 0
|
||||
@@ -15,11 +15,19 @@ task :build => "create-project" do
|
||||
end
|
||||
|
||||
desc "Create xcode project from gyp file"
|
||||
task "create-project" => "bootstrap" do
|
||||
task "create-xcode-project" => "update-cef" do
|
||||
`rm -rf atom.xcodeproj`
|
||||
`gyp --depth=. atom.gyp`
|
||||
end
|
||||
|
||||
desc "Update CEF to the latest version specified by the prebuilt-cef submodule"
|
||||
task "update-cef" => "bootstrap" do
|
||||
exit 1 unless system %{prebuilt-cef/script/download -f cef}
|
||||
Dir.glob('cef/*.gypi').each do |filename|
|
||||
`sed -i '' -e "s/'include\\//'cef\\/include\\//" -e "s/'libcef_dll\\//'cef\\/libcef_dll\\//" #{filename}`
|
||||
end
|
||||
end
|
||||
|
||||
task "bootstrap" do
|
||||
`script/bootstrap`
|
||||
end
|
||||
@@ -35,15 +43,8 @@ task :install => [:clean, :build] do
|
||||
`cp -r #{path} #{File.expand_path(dest)}`
|
||||
|
||||
# Install cli atom
|
||||
usr_bin_path = default_usr_bin_path = "/opt/github/bin"
|
||||
usr_bin_path = "/opt/github/bin"
|
||||
cli_path = "#{usr_bin_path}/atom"
|
||||
stable_cli_path = "#{usr_bin_path}/atom-stable"
|
||||
`echo "use 'atom --stable' in place of atom-stable." > #{stable_cli_path}`
|
||||
|
||||
if !File.exists?(usr_bin_path)
|
||||
$stderr.puts "ERROR: Failed to install atom cli tool at '#{usr_bin_path}'"
|
||||
exit 1
|
||||
end
|
||||
|
||||
template = ERB.new CLI_SCRIPT
|
||||
namespace = OpenStruct.new(:application_path => dest, :resource_path => ATOM_SRC_PATH)
|
||||
@@ -55,27 +56,12 @@ task :install => [:clean, :build] do
|
||||
Rake::Task["create-dot-atom"].invoke()
|
||||
Rake::Task["clone-default-bundles"].invoke()
|
||||
|
||||
puts "\033[32mType `atom` to start Atom! In Atom press `cmd-,` to edit your `.atom` directory\033[0m"
|
||||
puts "\033[32mType `atom` to start Atom! In Atom press `cmd-,` to edit your `~/.atom` directory\033[0m"
|
||||
end
|
||||
|
||||
desc "Creates .atom file if non exists"
|
||||
task "create-dot-atom" do
|
||||
# Migration: If there is still a bundle path, rename it to packages
|
||||
if File.exists?(DOT_ATOM_PATH) and File.exists?(File.join(DOT_ATOM_PATH, "bundles"))
|
||||
if File.exists?(File.join(DOT_ATOM_PATH, "packages"))
|
||||
`mv #{File.join(DOT_ATOM_PATH, "bundles", "*")} #{File.join(DOT_ATOM_PATH, "packages")}`
|
||||
$stderr.puts "WARNING: Bundles from ~/.atom/bundles were moved to ~/.atom/packages"
|
||||
else
|
||||
`mv #{File.join(DOT_ATOM_PATH, "bundles")} #{File.join(DOT_ATOM_PATH, "packages")}`
|
||||
$stderr.puts "WARNING: ~/.atom/bundles was moved to ~/.atom/packages"
|
||||
end
|
||||
end
|
||||
|
||||
# Migration: remove files that are no longer needed
|
||||
`rm -rf #{File.join(DOT_ATOM_PATH, 'default-config.coffee')}`
|
||||
|
||||
dot_atom_template_path = ATOM_SRC_PATH + "/.atom"
|
||||
replace_dot_atom = false
|
||||
dot_atom_template_path = ATOM_SRC_PATH + "/dot-atom"
|
||||
|
||||
if File.exists?(DOT_ATOM_PATH)
|
||||
user_config = "#{DOT_ATOM_PATH}/user.coffee"
|
||||
@@ -85,17 +71,11 @@ task "create-dot-atom" do
|
||||
`mv #{old_user_config} #{user_config}`
|
||||
puts "\033[32mRenamed #{old_user_config} to #{user_config}\033[0m"
|
||||
end
|
||||
|
||||
next
|
||||
else
|
||||
`mkdir "#{DOT_ATOM_PATH}"`
|
||||
`cp -r "#{dot_atom_template_path}/" "#{DOT_ATOM_PATH}"/`
|
||||
`cp -r "#{ATOM_SRC_PATH}/themes/" "#{DOT_ATOM_PATH}"/themes/`
|
||||
end
|
||||
|
||||
`rm -rf "#{DOT_ATOM_PATH}"`
|
||||
`mkdir "#{DOT_ATOM_PATH}"`
|
||||
|
||||
`cp "#{dot_atom_template_path}/user.coffee" "#{DOT_ATOM_PATH}"`
|
||||
`cp "#{dot_atom_template_path}/user.css" "#{DOT_ATOM_PATH}"`
|
||||
`cp -r "#{dot_atom_template_path}/packages" "#{DOT_ATOM_PATH}"`
|
||||
`cp -r "#{ATOM_SRC_PATH}/themes" "#{DOT_ATOM_PATH}"`
|
||||
end
|
||||
|
||||
desc "Clone default bundles into vendor/bundles directory"
|
||||
@@ -112,10 +92,12 @@ task :clean do
|
||||
`rm -rf /tmp/atom-compiled-scripts`
|
||||
end
|
||||
|
||||
desc "Run Atom"
|
||||
task :run, [:atom_arg] => :build do |name, args|
|
||||
desc "Run the specs"
|
||||
task :test => ["update-cef", "clone-default-bundles", "build"] do
|
||||
`pkill Atom`
|
||||
if path = application_path()
|
||||
cmd = "#{path}/Contents/MacOS/Atom #{args[:atom_arg]} 2> /dev/null"
|
||||
`rm -rf path`
|
||||
cmd = "#{path}/Contents/MacOS/Atom --test --resource-path=#{ATOM_SRC_PATH} 2> /dev/null"
|
||||
system(cmd)
|
||||
exit($?.exitstatus)
|
||||
else
|
||||
@@ -123,19 +105,13 @@ task :run, [:atom_arg] => :build do |name, args|
|
||||
end
|
||||
end
|
||||
|
||||
desc "Run the specs"
|
||||
task :test => ["clean", "clone-default-bundles"] do
|
||||
`pkill Atom`
|
||||
Rake::Task["run"].invoke("--test --resource-path=#{ATOM_SRC_PATH}")
|
||||
end
|
||||
|
||||
desc "Run the benchmarks"
|
||||
task :benchmark do
|
||||
Rake::Task["run"].invoke("--benchmark")
|
||||
end
|
||||
|
||||
task :nof do
|
||||
system %{find . -name *spec.coffee | grep -v #{BUILD_DIR} | xargs sed -E -i "" "s/f+(it|describe) +(['\\"])/\\1 \\2/g"}
|
||||
system %{find . -name *spec.coffee | grep --invert-match --regexp "#{BUILD_DIR}\\|##package-name##" | xargs sed -E -i "" "s/f+(it|describe) +(['\\"])/\\1 \\2/g"}
|
||||
end
|
||||
|
||||
task :tags do
|
||||
|
||||
8
atom.gyp
@@ -25,7 +25,7 @@
|
||||
'default_configuration': 'Debug',
|
||||
'configurations': {
|
||||
'Debug': {
|
||||
'defines': ['DEBUG=1', 'RESOURCE_PATH="$PROJECT_DIR"'],
|
||||
'defines': ['DEBUG=1'],
|
||||
'xcode_settings': { 'GCC_OPTIMIZATION_LEVEL' : '0' },
|
||||
},
|
||||
'Release': {
|
||||
@@ -132,8 +132,8 @@
|
||||
{
|
||||
'destination': '<(PRODUCT_DIR)/Atom.app/Contents/Frameworks/Chromium Embedded Framework.framework/Libraries/',
|
||||
'files': [
|
||||
'cef/frameworks/libcef.dylib',
|
||||
'cef/frameworks/ffmpegsumo.so',
|
||||
'cef/Release/libcef.dylib',
|
||||
'cef/Release/ffmpegsumo.so',
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -246,7 +246,7 @@
|
||||
],
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'cef/frameworks/libcef.dylib',
|
||||
'cef/Release/libcef.dylib',
|
||||
],
|
||||
}
|
||||
},
|
||||
|
||||
@@ -22,7 +22,7 @@ describe "editor.", ->
|
||||
editor.on 'editor:display-updated', done
|
||||
|
||||
runs ->
|
||||
projectPath = rootView.project.getPath()
|
||||
projectPath = project.getPath()
|
||||
$(window).off 'beforeunload'
|
||||
window.shutdown()
|
||||
atom.setRootViewStateForPath(projectPath, null)
|
||||
@@ -38,7 +38,7 @@ describe "editor.", ->
|
||||
|
||||
describe "opening-buffers.", ->
|
||||
benchmark "300-line-file.", ->
|
||||
buffer = rootView.project.bufferForPath('medium.coffee')
|
||||
buffer = project.bufferForPath('medium.coffee')
|
||||
|
||||
describe "empty-file.", ->
|
||||
benchmark "insert-delete", ->
|
||||
|
||||
|
Before Width: | Height: | Size: 752 B |
|
Before Width: | Height: | Size: 183 B |
|
Before Width: | Height: | Size: 523 B |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 123 B |
|
Before Width: | Height: | Size: 126 B |
|
Before Width: | Height: | Size: 239 B |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 341 B |
|
Before Width: | Height: | Size: 411 B |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 175 B |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 90 B |
|
Before Width: | Height: | Size: 209 B |
|
Before Width: | Height: | Size: 212 B |
|
Before Width: | Height: | Size: 125 B |
|
Before Width: | Height: | Size: 144 B |
|
Before Width: | Height: | Size: 174 B |
|
Before Width: | Height: | Size: 193 B |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 175 B |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 166 B |
|
Before Width: | Height: | Size: 128 B |
|
Before Width: | Height: | Size: 177 B |
|
Before Width: | Height: | Size: 146 B |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 819 B |
|
Before Width: | Height: | Size: 120 B |