> Atom中文手册 > Atom 保存与预览功能

保存与预览功能

用了 Atom 之后是不是发现,每次打开工作目录,保存退出后重新打开软件,目录一片空白。 sublime 和 DW 的快捷键预览 HTML 功能是不是很喜欢,而 Atom 没有。

记住上一次打开的目录

这个功能,截止目前最新的 0.198 版本还木有实现,这里我们用插件来实现这个功能;但是官方说,”记住上一次打开的目录”这个功能已经内置到下一个版本(集成插件),也就是正式版 1.0 插件的作者也声明了,看此段话:The Atom.io team is hopefully building a version of this into core for 1.0! Https://github.com/atom/atom/issues/1603

插件 open-last-project

插件简介: An Atom.io package that automatically repoens the last project and files you were working on.

安装完毕就实现了记忆功能了。不用过多设置,你第一次加载了工作目录后,正常退出打开还是自动加载改目录,且正在编辑的文件也同样保持编辑状态。

浏览器预览

对于前端开发来说,浏览器预览功能必须要有的有木有。不然每次都要自己手动拖拉文件到浏览器比较麻烦。

插件:RIB - run in browser

插件简介: Run in Browser will open the current pane in the default web browser

默认的用法,看下面

  • Command Palette: rib — 命令面板搜索 rip
  • Keymap: ctrl + alt + r — 默认快捷键(和我一些安装的插件有冲突,也用不惯这么多按键,我直接改 F12 调用了)
  • the current pane must be a .html or .htm file — 该插件目前支持在 html 和 htm 后缀名使用

个人 RIB 自定义按键修改–仅供参考

'atom-text-editor':
  'f12':'rib:run-in-browser'
  'ctrl-shift-space':'autocomplete:toggle'

温馨提示:插件的安装

  1. setting 内部搜索安装
  2. 上 Github 下载插件,放在 atom 目录下的 package,重开打开软件会自动识别
  3. 使用 apm 命令安装,例:apm install run-in-browser