Files
dotfiles/note/tools.org
2018-11-13 23:29:33 +08:00

98 lines
2.5 KiB
Org Mode
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#+title: 各种开发工具配置
#+author: Zedhugh Chen
* Indium
=Indium= 是一个可以在 =Emacs= 里直接调试运行在 =Chrome= 中的 =JavaScript= 的软件。
感觉双屏用这个软件应该会很爽。安装使用步骤如下:
** 安装服务端
#+BEGIN_SRC shell
npm install -g indium
#+END_SRC
** 安装 =Emacs= 客服端
#+BEGIN_SRC emacs-lisp
;; 直接从melpa源里安装
(require-package 'indium)
;; 配置
(require 'indium)
(add-hook 'js-mode-hook 'indium-interaction-mode)
#+END_SRC
** =indium= 配置文件: =.indium.json=
#+BEGIN_SRC json
{
"configurations": [
{
"name": "Indium Demo",
"type": "chrome",
"host": "0.0.0.0",
"post": 9222,
"url": "http://0.0.0.0:3000"
}
]
}
#+END_SRC
配置项说明:
=name=: 随便起一个就好
=type=: =Chrome= 调试直接写 =chrome= 就行了,其他参考[[https://indium.readthedocs.io/en/latest/setup.html][Indium Setup]]
=host=: 本地调试地址
=port=: =Chrome= 的调试协议端口号,和项目无关,和 =Chrome= 的启动参数有关
=url=: 项目的首页地址,按项目设置
** 启动 =Chrome=
在命令行里启动 =Chrome= 的时候带上参数
#+BEGIN_SRC shell
chrome --remote-debugging-port=9222
#+END_SRC
=Gentoo= 里面,自己编译的 =Chromium= 中,有个配置文件 =/etc/chromium/default=
其中有 =CHROMIUM_FLAGS= 配置项,将其设置为上面启动参数的内容即可。即:
#+BEGIN_SRC conf
CHROMIUM_FLAGS="--remote-debugging-port=9222"
#+END_SRC
** 开始调试
在要调试的 =JavaScript= 文件中执行 =Emacs= 命令 =indium-connect= 即可开始调试
#+BEGIN_SRC emacs-lisp
(indium-connect)
#+END_SRC
用快捷键或 =Indium= 插件提供的命令加入断点,即可开始愉快的调试了。
更多用法参考[[https://indium.readthedocs.io/en/latest/index.html][Indium手册]]。
* Input method
有时候输入法在 =firefox= 中不工作,这是因为设置不对造成的,通过查询资料,最终
=[[https://wiki.archlinux.org/index.php/Smart_Common_Input_Method][archwiki]]= 中找到方法,将 =.xprofile= 文件中的
#+BEGIN_SRC bash
export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE="scim"
export QT_IM_MODULE="scim"
#+END_SRC
改成
#+BEGIN_SRC bash
export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE="xim"
export QT_IM_MODULE="scim"
#+END_SRC
即可解决该问题。