Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebStorm“奇技淫巧” #8

Open
YutHelloWorld opened this issue Aug 21, 2017 · 8 comments
Open

WebStorm“奇技淫巧” #8

YutHelloWorld opened this issue Aug 21, 2017 · 8 comments
Labels

Comments

@YutHelloWorld
Copy link
Owner

YutHelloWorld commented Aug 21, 2017

本文介绍一些日常使用WebStorm的设置和快捷键。欢迎补充,互惠你我。🙃

WebStorm

版本: WebStorm 2017.2
操作系统:Mac OS

懒人一键配置主题、插件、CodeStyle

直接克隆这个仓库导入使用:https://github.com/YutHelloWorld/WebStrom-Setting

常用设置

设置Terminal字体

  • Preferences > Editsor > Colors & Fonts > Console Font

禁止实时自动保存

  1. Preferences > Apearance & Behavior > System Settings
  2. 取消勾选 "Save files on frame deactivation"和"Save files automa

tically if application is idle for"

文件未保存时显示星星(*)标记

  1. Preferences > Editor > General > Editor Tabs
  2. 勾选 “Mark modified tabs with asterisk”

设置鼠标双击选中驼峰式命名的变量

  1. Preferences > Editor > General
  2. 取消勾选 Honor "CameHumps" words settings when selecting on double click
  3. Preferences > Editor > General > Smart Keys
  4. 勾选 Use "CameHumps" words

启用Eslint校验JS代码

首先确保安装了Nodejs, 并且工程中配置了Eslint相关文件:.eslintrc.eslinignore

  1. Preferences > Languages & Frameworks > Javascript > Code Quality Tools > Eslint
  2. 勾选Eable
  3. 输入Node和Eslint路径
  4. 选中Automatic search 并Apply
  5. Editor > Inspections
  6. 取消勾选Javascript下的所有子选项
  7. 勾选Javascript > Code quality tools > 第一个Eslint
  8. Apply

Code Style

Preferences > Code Style
分别设置各个类型文件的代码风格。

支持JSX语法

  1. Preferences > Languages & Frameworks > Javascript
  2. 选择React JSX

快捷键

这里快捷键选用的是Mac OS

格式化

command + shift + L

快速定位变量、函数、模块声明源

command + 鼠标左键

多行光标

option + 鼠标左键

收藏代码某一行

收藏快捷键:将光标移动到目标行,按快捷键 F3
跳转至收藏的行: command+F3

高级
给收藏处标序号:option + F3

跳转到某行

command + L

打开某个文件

command + shift + o

查找和替换

  • 查找:command + f
  • 替换:command + r

全局查找和替换

  • 查找:command + shift + f
  • 替换:command + shift + r

以上只是很小的一些设置技巧,欢迎补充😆

@Mrsususu
Copy link

做个小补充,在此版本(WebStorm 2017.2)下,如果操作系统为windows,引入这个settings.jar包后,需要对热键做一个修改。
**方式为:File -> Settings -> Keymap -> 将其从MAC OS修改为Default。**即可将热键修改为符合Windows操作习惯的ctrl+c,ctrl+v之类的了。

@YutHelloWorld
Copy link
Owner Author

设置JS Code Style 为JavaScript Standard Style

ws-st

@YutHelloWorld
Copy link
Owner Author

YutHelloWorld commented Aug 23, 2017

最快捷配置webstorm code style 方式

如果你配置了.eslintrc,你可以直接将配置的eslint规则应用到webstorm的Code Style中(点击下图中yes)。Code Style > Javascript 的Scheme会自动选中Project(当前工程)
ws-standard2

@Shangyunliang
Copy link

配置完了之后感觉有点卡, 尤其右边有那个放大镜效果. 问如何能关掉那个效果? 很赞的配置已经star

@BeliefRC
Copy link

BeliefRC commented Jun 8, 2018

请问下这个有什么用 没发现有任何改变

设置鼠标双击选中驼峰式命名的变量
Preferences > Editor > General
取消勾选 Honor "CameHumps" words settings when selecting on double click
Preferences > Editor > General > Smart Keys
勾选 Use "CameHumps" words

@YutHelloWorld
Copy link
Owner Author

比如你想选中getInfo, 如果设置了以上规则,就可以双击选中getInfo, 否则可能只选中get @BeliefRC

@BeliefRC
Copy link

BeliefRC commented Jun 8, 2018

@YutHelloWorld 明白了 感谢!

@crazyair
Copy link

请问 我们github切换到gitlab上了 地址变了 但是 查看log的时候 open on github 还是用的 github.com 打开

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants