🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# IDE > one vim, use everythere, 强推! - [idea](https://www.imooc.com/learn/924) - [高效使用pycharm](https://pedrokroger.net/getting-started-pycharm-python-ide/) - https://laracasts.com/series/how-to-be-awesome-in-phpstorm - https://laravist.com/series/phpstorm-the-best-php-ide-you-ever-met 编辑器: vscode IDE: idea全家桶 其他: sublime/atom/[eclipse](http://blog.csdn.net/weasleyqi/article/details/7896576) 弃用, 已投入 vscode/idea全家桶 建议使用 IDE, 开箱即用, 而编辑器需要配置很多 ## phpstorm 界面配置: view|distraction-free-mode + setting|code-style|hard-wrap=500(如果发现代码没有最左显示) + add-leading-space-to-comment 设置忽略文件夹:setting -> editor -> file type -> 添加 `node_modules;` 单行注释: comment at first column 配置 psr: editor -> code style -> php -> set from phpstorm EAP(Early Access Program) 修改快捷键: 通过 名字搜索/快捷键 搜索; remove -> add 多个文件夹: setting->directories-> add content root spelling: setting->spelling-> application-level 快速找到当前文件的目录路径: project 试图里的 目标图标 配置对所有 phpstorm 生效: profile store in IDE/project; preference for current/new project preference for new project: 设置后, 就不用每次打开新项目都得设置一遍了 代码折叠(比如 php 的 use): code folding phpdoc: setting-inspections, 关闭 phdoc 提示, 为了写 doc 而写 doc -> 需要写 doc 的地方 setting - add package as lib: 允许编辑/定位 vendor 下的文件 文件不同步 - 文件右键 sync C-d:复制当前行 C-y:删除当前行(更通用的还是 C-x,导出通用) C-S-j: 合并行 C-A-l:reformat,在设置中配置了代码风格之后,就可以一键搞定代码风格了 A-鼠标左键:多点编辑 ct-g:select next occu A-insert: generate -> getter/setter 接口方法 A-6:查看 todo,项目周期特别长的时候添加 C-f12:查看文件结构,类似 sublime 里面的查看函数 A+enter: show intention action A + num: 切换不同界面(Esc) ideaVim: 无法使用->keymap->cmd-a-v; 如果还无法使用->keymap->exit insert mode aceJump live and code template|incude: Created: ${USER} ${DATE} ${TIME} touch bar + fn: keymap -> always use fn ### 基础概念 file: new open setting edit: cut copy(path reference) paste(history) find(replace everywhere) line(join duplicate) view: tool-window(alt-1~9 todo terminal) definition/document/paramter/context/error/source recent(file change) compare bar/editor mode/fullscreen navigate(相当于 sublime 中的 goto): everywhere/file/class/symbol/line back(file edit-location) next(error emmet type change method) hierarchy(path file type method call) code: generate(override implement) move(line statement) reformat analysis refactor: rename(property method) move copy run: run debug tool: template(sublime 中 snippet) database vcs: git(compare confilct) local window help action: C-S-a(vscode C-S-p) A-enter(show intention action) ## toolbox 管理 idea 全家桶的利器 使用 release 版而非 EAP 会导致 Alfred 无法切换程序 -> `brew cask install phpstorm` ## pycharm project interpreter -> local/ssh/docker ## datagrip > https://www.bilibili.com/video/av24483981 foreign key export/import: file/db 推荐理由: 强大的自动补全 data source: cmd+; 执行当前语句: cmd+enter explain raw: ctrl+enter 参数绑定: parameter `where id=:id` 关键词大小写: setting->code style->sql ## vim > Treat **vim** as a programming language, and use it everywhere. > 练习工具: vimtutor(vim自带) https://vim-adventures.com/ > vim-galore 从入门到精通 https://yq.aliyun.com/articles/625429 > vimrc: https://github.com/amix/vimrc 光标上次编辑点: C-O/I 删除引号内的内容: di' -> c/d/y/v i/a/t/f '/" 合并多行: 3J 3gJ 格式化代码/自动缩进: = 选中单词: v e 大小写: gu gU undo: u/U; redo: c-r replace: r R; change word: ce 匹配括号: % exec ext command: :! set option: :set xxx; :set noxxx help: :help xxx completion: :e -> c-d -> tab use systemClipboard: `set clipboard=unnamed' ``` vimtutor C-v # visio mod -> select -> edit :sp :vsp C-w # 窗口 :{range}left [margin] # 代码对齐 ``` # vscode > [vscode 中文文档](https://legacy.gitbook.com/book/jeasonstudio/vscode-cn-doc/details) > 极客时间 - 玩转VS Code ``` code --diff <file1> <file2> ``` 更轻便的开发编辑器选择, 免去很多包管理的烦恼 f8: error zen mode shell command reveal 自动打开文件所在位置: 取消全局配置, 设置keymap 双手不离键盘: 光标移动(单词/行/代码块/文档) 文本选择(多加一个 shift) 自定义快捷键 多光标(同时编辑多处 https://www.jb51.net/softjc/609020.html): A+鼠标 C-d 复选+A-S-i # shell > shell 快捷键: http://blog.chinaunix.net/uid-361890-id-342066.html 光标移动单词: esc-b/f 光标移动行: C-a/e 光标删除行: C-u/k 删除光标前单词: C-w