Atom (https://atom.io/) is “a hackable text editor for the 21st Century” 你好啊
其实也不是的啊,你是谁,打死你哈哈
Why use a third party Source Code Editor
Using proxy inside Atom, such as Goagent: apm config set https-proxy=http://127.0.0.1:8087/
apm config set strict-ssl false
Change Atom’s token limit for syntax highlighting: apm install grammar-token-limit
Minimap: apm install minimap
View pdf in Atom: apm install pdf-view
Open file using external program: apm install open-unsupported-files
Text-clicking: apm install hyperclick
Terminal: apm install open-conemu-here
Font spec: apm install fonts
, then choose font in settings
Enhanced column selection: apm install column-select
Auto-encoding: apm install auto-encoding
, and in the package setting disallow windows 1252
, useful when deal with both Stata 14 and older versions
Run program using any Jupyter kernels inside Atom: apm install hydrogen
, need Jupyter installed
Run program from Atom: apm install script
Show file-icon associated with file extension: apm install file-icons
Linter package for Atom: apm install linter
apm install language-stata
, with autocomplete inside, if want more key words, just add words in the grammar fileStataMP-64.exe /Register
pip install git+https://github.com/jrfiedler/stata-kernel
python -m stata_kernel.install
In file /.atom/packages/script/lib/grammars.coffee, replace the Stata section as
Stata:
"Selection Based":
command: "D:\\Program File\\AutoitPlug\\Atom\\Stata14\\rundo.exe"
args: (context) ->
code = context.getCode()
tmpFile = GrammarUtils.Stata.createTempFileWithCode(code)
[tmpFile]
"File Based":
command: "D:\\Program File\\AutoitPlug\\Atom\\Stata14\\rundo.exe"
args: (context) -> [context.filepath]
In file /.atom/packages/script/lib/grammar-utils.js, add this:
Create a file named Stata.js
in /.atom/packages/script/lib/grammar-utils with content:
'use babel';
// Public: GrammarUtils.Stata - a module which assist the creation of Stata temporary files
export default {
// Public: Create a temporary file with the provided Stata code
//
// * `code` A {String} containing some Stata code
//
// Returns the {String} filepath of the new file
createTempFileWithCode(code) {
code1 = code + '\n'
return module.parent.exports.createTempFileWithCode(code1,'.do');
},
};
The AutoIt program and the associated ini file can be download from http://pan.baidu.com/s/1eSsMYkE, make sure change the path of Stata program and Title of Stata window in the ini file, and also the AutoIt program path in script’s grammars.coffee
apm install autocomplete-python
In file /.atom/packages/script/lib/grammars.coffee, replace the Python section as
Python:
"Selection Based":
command: "D:\\Program File\\AutoitPlug\\Atom\\IPython\\ipythonrun.exe"
args: (context) ->
dirname = GrammarUtils.Python.projectDir(context.filepath)
code = context.getCode()
tmpFile = GrammarUtils.Python.createTempFileWithCode(code)
[dirname, tmpFile]
"File Based":
command: "D:\\Program File\\AutoitPlug\\Atom\\IPython\\ipythonrun.exe"
args: (context) ->
dirname = GrammarUtils.Python.projectDir(context.filepath)
[dirname, context.filepath]
In file /.atom/packages/script/lib/grammar-utils.js, add this:
In /.atom/packages/script/lib/grammar-utils, create a file named Python.js with content:
'use babel';
import path from 'path';
// Public: GrammarUtils.Python - a module which assist the creation of Python temporary files
export default {
// Public: Create a temporary file with the provided Python code
//
// * `code` A {String} containing some Python code
//
// Returns the {String} filepath of the new file
createTempFileWithCode(code) {
code1 = '# -*- coding: utf-8 -*-\n' + code
return module.parent.exports.createTempFileWithCode(code1,'.py');
},
// Public: Get path of editorfile
//
// * `editorfile` {Object} containing current file
//
// Returns {String} containing the file path
projectDir(editorfile) {
return path.dirname(editorfile);
},
};
apm install linter-pep8
, should install pep8 within Python, pip install pep8
(note that there are various coding styles for Python)apm install language-fortran
, apm install language-openmp
apm install autocomplete-fortran
apm install linter-gfortran
apm install language-r
apm install autocomplete-r
install.packages(c('pbdZMQ', 'repr', 'devtools', 'stringr'))
devtools::install_github('IRkernel/IRdisplay')
devtools::install_github('IRkernel/IRkernel')
IRkernel::installspec()
apm install linter-lintr
, should install lintr within R, install.packages("lintr")
apm install language-latex
apm install latextools
, with various autocomplete inside, note that latextools is build on the clever latexmk command, you can also use makefile to compile latex codesSumatraPDF.exe -inverse-search "/"/AppData/Local/atom/bin/atom.cmd/" /"%f:%l/""
apm install sumatra-forwardsearch
, does not working nowapm install latex-friend
apm install linter-chktex
apm install language-pfm
, and disable the built-in language-gfm
,apm install markdown-writer
apm install markdown-preview-plus
, disable the built-in markdown-preview
Setting: enable math, use github.com style, enable pandoc parser, full path of pandoc.exe, markdown flavor choose markdown--mathjax --highlight-style=zenburn
apm install markdown-scroll-sync
apm install linter-markdown
Convert through CMD
or makefile, makefile is better in project, for example
pandocfilters
in python, and add %!TEX option = -shell-escape
to the root latex document