ソースを参照

add more atom stuff

Kyle P Davis 10 年 前
コミット
536f5fc323
7 ファイル変更162 行追加0 行削除
  1. 18 0
      atom/config.cson
  2. 14 0
      atom/init.coffee
  3. 63 0
      atom/keymap.cson
  4. 18 0
      atom/snippets.cson
  5. 34 0
      atom/styles.less
  6. 14 0
      install.sh
  7. 1 0
      install_atom_plugins.sh

+ 18 - 0
atom/config.cson

@@ -0,0 +1,18 @@
+"*":
+  editor:
+    fontSize: 13
+    invisibles: {}
+    showIndentGuide: true
+    softTabs: false
+    tabLength: 4
+  "tree-view":
+    hideVcsIgnoredFiles: true
+    hideIngoredNames: true
+  linter:
+    showErrorInline: false
+    statusBar: "Show error if the cursor is in range"
+  core:
+    themes: [
+      "atom-dark-ui"
+      "atom-dark-syntax"
+    ]

+ 14 - 0
atom/init.coffee

@@ -0,0 +1,14 @@
+# Your init script
+#
+# Atom will evaluate this file each time a new window is opened. It is run
+# after packages are loaded/activated and after the previous editor state
+# has been restored.
+#
+# An example hack to log to the console when each text editor is saved.
+#
+# atom.workspace.observeTextEditors (editor) ->
+#   editor.onDidSave ->
+#     console.log "Saved! #{editor.getPath()}"
+
+process.env.PATH += ':' + process.env.HOME + '/homebrew/bin/'
+process.env.GOPATH = process.env.HOME + '/go'

+ 63 - 0
atom/keymap.cson

@@ -0,0 +1,63 @@
+# Your keymap
+#
+# Atom keymaps work similarly to style sheets. Just as style sheets use
+# selectors to apply styles to elements, Atom keymaps use selectors to associate
+# keystrokes with events in specific contexts.
+#
+# You can create a new keybinding in this file by typing "key" and then hitting
+# tab.
+#
+# Here's an example taken from Atom's built-in keymap:
+#
+# 'atom-text-editor':
+#   'enter': 'editor:newline'
+#
+# 'atom-workspace':
+#   'ctrl-shift-p': 'core:move-up'
+#   'ctrl-p': 'core:move-down'
+#
+# You can find more information about keymaps in these guides:
+# * https://atom.io/docs/latest/customizing-atom#customizing-key-bindings
+# * https://atom.io/docs/latest/advanced/keymaps
+#
+# This file uses CoffeeScript Object Notation (CSON).
+# If you are unfamiliar with CSON, you can read more about it here:
+# https://github.com/bevry/cson#what-is-cson
+
+'atom-workspace':
+  'cmd-u': 'tree-view:toggle'
+
+'atom-workspace atom-text-editor:not([mini])':
+  'cmd-shift-L': 'tree-view:reveal-active-file'
+
+'atom-text-editor':
+  'cmd-shift-B': 'beautify:beautify-editor'
+  'alt-up': 'editor:move-line-up'
+  'alt-down': 'editor:move-line-down'
+  # 'ctrl-alt-left': 'find-and-replace:select-previous' --- TODO: do this
+  'ctrl-alt-left': ''
+  'ctrl-alt-right': 'find-and-replace:select-next'
+  'cmd-l': 'go-to-line:toggle'
+  'cmd-d': 'editor:delete-line'
+  'cmd-shift-D': 'editor:duplicate-lines'
+  'cmd-alt-l': 'editor:fold-current-row'
+  'cmd-shift-alt-L': 'editor:unfold-current-row'
+
+# TODO: more things from ACE that I might care about
+# cmd-option-l toggle-fold
+# cmd-shift-l select-current-line and move-down
+
+# TODO: make :w, :wq, :x, etc. work *SEAMLESSLY*
+#'atom-text-editor.vim-mode:not(.insert-mode)':
+#  ':': 'command-palette:toggle'
+
+'atom-text-editor.vim-mode.visual-mode':
+  '=': 'beautify:beautify-editor'
+
+'atom-text-editor:not(mini) .autocomplete-plus.autocomplete-suggestion-list':
+  # 'tab': 'unset!'
+  'enter': 'autocomplete-plus:confirm'
+  # 'up': 'unset!'
+  # 'down': 'unset!'
+  'ctrl-p': 'autocomplete-plus:select-previous'
+  'ctrl-n': 'autocomplete-plus:select-next'

+ 18 - 0
atom/snippets.cson

@@ -0,0 +1,18 @@
+# Your snippets
+#
+# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
+# expand the prefix into a larger code block with templated values.
+#
+# You can create a new snippet in this file by typing "snip" and then hitting
+# tab.
+#
+# An example CoffeeScript snippet to expand log to console.log:
+#
+# '.source.coffee':
+#   'Console log':
+#     'prefix': 'log'
+#     'body': 'console.log $1'
+#
+# This file uses CoffeeScript Object Notation (CSON).
+# If you are unfamiliar with CSON, you can read more about it here:
+# https://github.com/bevry/cson#what-is-cson

+ 34 - 0
atom/styles.less

@@ -0,0 +1,34 @@
+/*
+ * Your Stylesheet
+ *
+ * This stylesheet is loaded when Atom starts up and is reloaded automatically
+ * when it is changed.
+ *
+ * If you are unfamiliar with LESS, you can read more about it here:
+ * http://www.lesscss.org
+ */
+
+.tree-view {
+
+}
+
+// style the background and foreground colors on the atom-text-editor-element
+// itself
+atom-text-editor {
+
+}
+
+// To style other content in the text editor's shadow DOM, use the ::shadow
+// expression
+atom-text-editor::shadow .cursor {
+
+}
+
+atom-ternjs-type {
+    background: rgba(42, 63, 75, 0.9);
+}
+
+.term2 .terminal {
+    font-family: Inconsolata, Monaco, Consolas, 'Courier New', Courier;
+    -webkit-font-smoothing: none;
+}

+ 14 - 0
install.sh

@@ -29,3 +29,17 @@ link "$CMD_DIR/.vimrc" "$HOME/.vimrc"
 link "$CMD_DIR/.jshintrc" "$HOME/.jshintrc"
 link "$CMD_DIR/.jscsrc" "$HOME/.jscsrc"
 link "$CMD_DIR/.node-inspectorrc" "$HOME/.node-inspectorrc"
+
+for F in "$CMD_DIR/atom/"*; do
+	FN=${F%%*/}
+	link "$CMD_DIR/atom/$FN" "$HOME/atom/$FN"
+done
+if ! [[ -d "$HOME/.atom/packages/" ]]; then
+	if which apm &>/dev/null; then
+		"$CMD_DIR/install_atom_plugins.sh"
+	else
+		echo "# WARN: Unable to find Atom's \"apm\" command."
+		echo "# WARN: 1. Get Atom from the website or automatically using \"gimme atom\""
+		echo "# WARN: 2. Install the atom plugins using \"$CMD_DIR/install_atom_plugins.sh\""
+	fi
+fi

+ 1 - 0
install_atom_plugins.sh

@@ -52,6 +52,7 @@ linter-javac
 linter-js-yaml
 linter-jscs
 linter-jshint
+linter-less
 linter-pep8
 linter-perl
 linter-pylint