├── shuxuguan ├── default.custom.yaml ├── luna_pinyin_simp.custom.yaml └── squirrel.custom.yaml ├── sublimeconfig ├── mac配置 │ ├── Preferences.sublime-settings │ └── Default (OSX).sublime-keymap └── 前端开发 sublime text 常用插件和配置.md ├── README.md ├── LICENSE ├── Atom └── 前端开发 Atom 编辑器插件安装和配置.md ├── eslintrc.react.rules.js ├── vimconfig ├── vimrc └── vim │ └── vimrc.bundles └── eslintrc.common.js /shuxuguan/default.custom.yaml: -------------------------------------------------------------------------------- 1 | #patch: 2 | # "menu/page_size": 7 3 | patch: 4 | menu: 5 | page_size: 8 6 | 7 | 8 | -------------------------------------------------------------------------------- /shuxuguan/luna_pinyin_simp.custom.yaml: -------------------------------------------------------------------------------- 1 | patch: 2 | punctuator: 3 | half_shape: 4 | "/": "/" 5 | "[": "[" 6 | "]": "]" 7 | "<": "《" 8 | ">": "》" 9 | "\\": "\\" 10 | "%": "%" 11 | "*": "*" 12 | "$": "¥" 13 | full_shape: 14 | "/": "/" 15 | "[": "[" 16 | "]": "]" 17 | "<": "《" 18 | ">": "》" 19 | "\\": "\\" 20 | "%": "%" 21 | "*": "*" 22 | "$": "¥" 23 | -------------------------------------------------------------------------------- /sublimeconfig/mac配置/Preferences.sublime-settings: -------------------------------------------------------------------------------- 1 | { 2 | "auto_complete_selector": "source, text", 3 | "auto_match_enabled": true, 4 | "close_windows_when_empty": true, 5 | "color_scheme": "Packages/User/SublimeLinter/Next (SL).tmTheme", 6 | "fade_fold_buttons": false, 7 | "fold_buttons": true, 8 | "font_face": "Monaco", 9 | "font_size": 18, 10 | "highlight_line": true, 11 | "ignored_packages": 12 | [ 13 | "CSS", 14 | "Vintage" 15 | ], 16 | "match_brackets_angle": true, 17 | "open_files_in_new_window": false, 18 | "save_on_focus_lost": true, 19 | "show_encoding": true, 20 | "smart_indent": false, 21 | "spell_check": false, 22 | "tab_size": 4, 23 | "theme": "Soda Dark 3.sublime-theme", 24 | "translate_tabs_to_spaces": true, 25 | "trim_trailing_white_space_on_save": true, 26 | "word_wrap": true 27 | } 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MyToolsConfig 2 | 常用开发工具配置 3 | 4 | 5 | ### 1.shuxuguan(鼠须管输入法) 6 | 7 | 鼠须管输入法配置,Mac平台上高效的开源输入法。可以使用户自定义配置。**hack**的专属 8 | 必备输入神器。** 9 | 10 | #### 鼠须管输入法的特点: 11 | - 输入效率高,没有卡顿 12 | - 自定义词库,皮肤 13 | - 自定义程序默认输入方式(就是可以用户配置文件,当用户切换程序的时候,自动切换中 14 | 英文输入) 15 | - **重要的事情说3遍,输入效率高,流畅没有卡顿,输入效率高,流畅没有卡顿** 16 | 17 | ### 2.sublimeconfig 18 | 19 | sublime text3 前端开发神器,如果仅仅是一个编辑器还算不上是神器,主要是有很多第三 20 | 饭的插件让这个编辑器能够变成**IDE** ,所以是自己最近常用的编辑器之一。主要介绍自己 21 | 在前端开发中主要使用的一些插件和配置。 22 | 23 | ### 3.vimconfig 24 | 25 | **vim** 编辑器中的上古神器。最近正在慢慢的学习,越来越发现这个编辑器的强大。而且完全 26 | 不逊于 **sublime** 的扩展插件。 27 | 28 | 后续会整理自己使用 **VIM** 过程中的一些经验和技巧文章。 29 | 30 | ### 4.Atom 编辑器使用 31 | 32 | Atom 现在已经成为了我的主力编辑器,那么是为什么呢?所以这里也谈谈我对 Atom 的认识。 33 | 34 | **缺点:** 35 | 1. 启动速度略慢,但是对于我来说是可以接受的; 36 | 37 | 38 | **优点:** 39 | 1. 强大的,简单的自定义配置; 40 | 2. 对于中文不好的同学,pakages 社区提供了中文包; 41 | 3. 官方持久连续的更新方式(现在的 Version 是1.6.0),而且还提供 beta 版本; 42 | 4. 强大的扩展插件以及安装方式; 43 | 5. 可以一条命令更新所有插件(有更新时,状态栏也会有提示); 44 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 ZhiQiangHou 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /shuxuguan/squirrel.custom.yaml: -------------------------------------------------------------------------------- 1 | patch: 2 | show_notifications_when: appropriate # 状态通知,适当,也可设为全开(always)全关(never) 3 | style: 4 | color_scheme: apathy 5 | #定义中英文自动切换程序 6 | app_options/com.sublimetext.3: 7 | ascii_mode: true 8 | app_options/com.jetbrains.pycharm: 9 | ascii_mode: true 10 | app_options/com.jetbrains.WebStorm: 11 | ascii_mode: true 12 | app_options/com.kapeli.dashdoc: 13 | ascii_mode: true 14 | app_options/com.google.Chrome: 15 | ascii_mode: false 16 | #自动切换结束 17 | 18 | preset_color_schemes: 19 | apathy: 20 | horizontal: true # 水平排列 21 | inline_preedit: false #单行显示,false双行显示 22 | candidate_format: "%c\u2005%@\u2005" # 用 1/6 em 空格 U+2005 来控制编号 %c 和候选词 %@ 前后的空间。 23 | 24 | corner_radius: 5 #候选条圆角 25 | border_height: 0 26 | border_width: 0 27 | back_color: 0xFFFFFF #候选条背景色 28 | font_face: "PingFangSC-Regular,H-SiuNiu" #候选词字体 29 | font_point: 19 #候选字词大小 30 | text_color: 0x424242 #高亮选中词颜色 31 | label_font_face: "PingFangSC-Light" #候选词编号字体 32 | label_font_point: 12 #候选编号大小 33 | hilited_candidate_text_color: 0xEE6E00 #候选文字颜色 34 | hilited_candidate_back_color: 0xFFF0E4 #候选文字背景色 35 | comment_text_color: 0x999999 #拼音等提示文字颜色 36 | 37 | -------------------------------------------------------------------------------- /sublimeconfig/mac配置/Default (OSX).sublime-keymap: -------------------------------------------------------------------------------- 1 | [ 2 | // chrome 中打开 3 | { 4 | "keys": ["f2"], 5 | "command": "side_bar_files_open_with", 6 | "args": { 7 | "paths": [], 8 | "application": "/Applications/Google Chrome.app", 9 | "extensions": ".*" 10 | } 11 | }, 12 | // firefox中打开 13 | { 14 | "keys": ["f3"], 15 | "command": "side_bar_files_open_with", 16 | "args": { 17 | "paths": [], 18 | "application": "/Applications/FirefoxDeveloperEdition.app", 19 | "extensions": ".*" 20 | } 21 | }, 22 | //指定SublimeREPL的使用 23 | { 24 | "keys": ["f5"], 25 | "caption": "SublimeREPL: Python - RUN current file", 26 | "command": "run_existing_window_command", 27 | "args": { 28 | "id": "repl_python_run", 29 | "file": "config/Python/Main.sublime-menu" 30 | } 31 | }, 32 | //autoprefixer快捷键设置 33 | { "keys": ["command+alt+p"], "command": "autoprefixer" }, 34 | 35 | // //jsformat快捷键 36 | // { 37 | // "keys": ["command+alt+l"], "command": "js_format", 38 | // "context": [{"key": "selector", "operator": "equal", "operand": "source.js,source.json"}] 39 | // }, 40 | // // cssformat Convert to Expanded Format 41 | // { 42 | // "keys": ["command+alt+l"], 43 | // "command": "css_format", 44 | // "args": { 45 | // "action": "expand" 46 | // } 47 | // }, 48 | 49 | //html-css-jsprettify插件快捷键 50 | {"keys": ["command+alt+l"],"command": "htmlprettify"}, 51 | 52 | 53 | //svn快捷键 54 | { "keys": ["command+u"], "command": "svn_update" } 55 | ,{ "keys": ["command+t"], "command": "svn_commit" } 56 | ,{ "keys": ["alt+r"], "command": "svn_revert" } 57 | ,{ "keys": ["command+l"], "command": "svn_log" } 58 | ,{ "keys": ["alt+d"], "command": "svn_diff" } 59 | ,{ "keys": ["alt+ctrl+a"], "command": "alignment" } 60 | ] -------------------------------------------------------------------------------- /Atom/前端开发 Atom 编辑器插件安装和配置.md: -------------------------------------------------------------------------------- 1 | 2 | #前端开发 Atom 编辑器插件安装和配置 3 | 4 | ### 1.启动速度 5 | 启动速度是大家唯一吐槽 Atom 的地方吧。不过到现在的1.6.0版本的时候,我觉得已经比刚发布的时候好多了。 6 | 原生提供了命令来测试自己的启动消耗时间: 7 | 8 | 使用方式如下: 9 | `cmd+shift+p`打开命令面板,然后输入 `timecope:view` 10 | ![qq20160319-0](https://cloud.githubusercontent.com/assets/3990411/13898574/a0782996-ee10-11e5-9f1d-9fd25421d261.png) 11 | 12 | 命令就会出现下面的结果,可以查看启动时间和安装插件的加载时间: 13 | ![qq20160319-1 2x](https://cloud.githubusercontent.com/assets/3990411/13898576/a1cc7d10-ee10-11e5-8607-0429d3e21a59.png) 14 | 15 | 16 | 17 | 18 | 19 | ### 2.插件列表和使用方法: 20 | 使用 `apm list`可以查看自己安装的插件和 Atom 默认自己安装的插件。我这里注重介绍我自己安装的插件 21 | 22 | #### 1.自动补全 23 | **atom-ternjs**----JavaScript 自动补全插件还可以配置语言版本和脚本库 24 | 25 | **autocomplete-modules**----自动补全模块,提供下文的语义补全 26 | 27 | **autocomplete-paths**----路径补全,比如下找到某个图片的位置 28 | 29 | **autocomplete-python**----python 语法自动补全 30 | 31 | **autocomplete-sass**----sass 语法自动补全 32 | 33 | **javascript-snippets**----JavaScript 代码段 34 | 35 | **jquery-snippets**----jQuery 代码段 36 | 37 | #### 2.工具 38 | **Remote-FTP**----本地和远程代码同步工具(暂时在我电脑上不可用) 39 | 40 | **Sublime-Style-Column-Selection**----列选择工具(相当于 sublime 按住 alt 键拖动可以选中多列和多行的操作) 41 | 42 | **atom-beautify**----格式化语法的工具支持的语言很多 43 | 44 | **atom-minify**----压缩 css 和 js 文件的工具 45 | 46 | **autoprefixer**----自动给 css 文件中的属性添加厂商前缀 47 | 48 | **color-picker**----调色板,可以选中自己钟意的颜色,而且可以在面板中调整透明度 49 | 50 | **docblockr**----代码注释工具,提供代码注释的模板 51 | 52 | **emmet**----html 快速编写工具 53 | 54 | **expand-selection-to-quotes**----可以快捷键选中引号内的内容(节省了拖动鼠标的操作) 55 | 56 | **merge-conflicts**----顾明思议,合并冲突的工具 57 | 58 | **project-manager**---- 强大的,快速的打开项目的插件,非常的有用 59 | 60 | **run-in-browser**----将当前的 html 在浏览器中打开 61 | 62 | **sync-settings**----同步自己的配置和安装的插件到 gist 。非常有用 63 | 64 | 65 | 66 | #### 3.代码语法检查(这个对编写标准的代码非常有用) 67 | **linter**----语法检查引擎 68 | 69 | **jshint**----JavaScript 代码语法检测引擎 70 | 71 | **linter-pylint**----python 代码语法检测引擎 72 | 73 | #### 4.显示效果 74 | **react**----对 react 语法高亮支持,并且有补全效果 75 | 76 | **language-jade**----jade 语法高亮 77 | 78 | **file-icons**----在目录树 tree-view 的文件前面加上响对应的 logo 79 | 80 | **highlight-column**----高亮当前光标所在的列 81 | 82 | **highlight-selected**----在当前编辑的文件中高亮全部匹配的单词 83 | 84 | **minimap**----显示一个 mini 的预览代码的窗口 85 | 86 | **pigments**----对 css 文件中使用的颜色进行响应颜色的高亮 87 | 88 | #### 5.markdown 写作工具 89 | **markdown-scroll-sync**----编写 markdown 可以根据写到的部位,右边预览可以实时的滚动 90 | 91 | **markdown-table-formatter**----对 markdown 语法绘制的表格格式化 92 | -------------------------------------------------------------------------------- /eslintrc.react.rules.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | 3 | // react 文件Lint rules 4 | 'rules': { 5 | // "react/default-props-match-prop-types": "error", 6 | "react/display-name": "off", 7 | "react/forbid-component-props": "off", 8 | "react/forbid-elements": "off", 9 | "react/forbid-foreign-prop-types": "warn", 10 | "react/forbid-prop-types": "off", 11 | "react/jsx-boolean-value": "error", 12 | "react/jsx-closing-bracket-location": "error", 13 | "react/jsx-curly-spacing": "error", 14 | "react/jsx-equals-spacing": "error", 15 | "react/jsx-filename-extension": ["error", {"extensions": [".js", ".jsx", ".es"]}], 16 | "react/jsx-first-prop-new-line": "error", 17 | "react/jsx-handler-names": "off", 18 | "react/jsx-indent-props": ["error", 4], 19 | "react/jsx-indent": ["error", 2], 20 | "react/jsx-key": "error", 21 | "react/jsx-max-props-per-line": ["error", {"when": "multiline", "maximum": 1}], 22 | "react/jsx-no-bind": ["warn", {"ignoreRefs": true}], 23 | "react/jsx-no-comment-textnodes": "warn", 24 | "react/jsx-no-duplicate-props": "error", 25 | "react/jsx-no-literals": "off", 26 | "react/jsx-no-target-blank": "error", 27 | "react/jsx-no-undef": "error", 28 | "react/jsx-pascal-case": "error", 29 | "react/jsx-sort-props": "off", 30 | "react/jsx-tag-spacing": "error", 31 | "react/jsx-uses-react": "off", 32 | "react/jsx-uses-vars": "error", 33 | "react/jsx-wrap-multilines": "error", 34 | "react/no-array-index-key": "error", 35 | "react/no-children-prop": "error", 36 | "react/no-danger-with-children": "error", 37 | "react/no-danger": "warn", 38 | "react/no-deprecated": "error", 39 | "react/no-did-mount-set-state": "error", 40 | "react/no-did-update-set-state": "error", 41 | "react/no-direct-mutation-state": "error", 42 | "react/no-find-dom-node": "error", 43 | "react/no-is-mounted": "error", 44 | "react/no-multi-comp": ["error", {"ignoreStateless": true}], 45 | "react/no-render-return-value": "error", 46 | "react/no-set-state": "off", 47 | "react/no-string-refs": "error", 48 | "react/no-unescaped-entities": "error", 49 | "react/no-unknown-property": "error", 50 | "react/no-unused-prop-types": "warn", 51 | "react/no-will-update-set-state": "error", 52 | "react/prefer-es6-class": "error", 53 | "react/prefer-stateless-function": "error", 54 | "react/prop-types": "off", 55 | "react/react-in-jsx-scope": "off", 56 | "react/require-default-props": "error", 57 | "react/require-optimization": "off", 58 | "react/require-render-return": "error", 59 | "react/self-closing-comp": ["error", {"html": false}], 60 | "react/sort-prop-types": "off", 61 | "react/style-prop-object": "error", 62 | "react/void-dom-elements-no-children": "error", 63 | // 按照react的声明周期排列代码,以方便能够快速的定位代码和代码的执行顺序 64 | "react/sort-comp": [ 65 | 2, 66 | { 67 | "order": [ 68 | "static-properties", 69 | "static-methods", 70 | "lifecycle", 71 | "everything-else", 72 | "render" 73 | ], 74 | "groups": { 75 | "static-properties": [ 76 | "displayName", 77 | "propTypes", 78 | "contextTypes", 79 | "childContextTypes", 80 | "mixins", 81 | "statics" 82 | ], 83 | "lifecycle": [ 84 | "constructor", 85 | "getDefaultProps", 86 | "getInitialState", 87 | "state", 88 | "getChildContext", 89 | "componentWillMount", 90 | "componentDidMount", 91 | "componentWillReceiveProps", 92 | "shouldComponentUpdate", 93 | "componentWillUpdate", 94 | "componentDidUpdate", 95 | "componentWillUnmount" 96 | ] 97 | } 98 | } 99 | ] 100 | } 101 | }; 102 | -------------------------------------------------------------------------------- /sublimeconfig/前端开发 sublime text 常用插件和配置.md: -------------------------------------------------------------------------------- 1 | # 前端开发sublimeconfig 2 | 3 | ###mac配置 4 | 5 | 此文件目录中文件主要是关于`sublime`的插件配置,快捷键配置,主题和字体配置。 6 | 7 | ###插件列表 8 | 所有插件都可以使用Package Control安装,具体的安装方法可以自行谷歌安装,不在本文的介绍范围之内。也可以是使用git 手动安装。 9 | 10 | 11 | ###1.[autoprefixer](https://github.com/sindresorhus/sublime-autoprefixer) 12 | 该插件主要使编写css更加的方便和快捷,可以配置快捷键给标签属性添加浏览器厂商前缀。安装前需要确定电脑安装`node`。 13 | 14 | 配置快捷键如下: 15 | ``` 16 | //autoprefixer快捷键设置 17 | { "keys": ["command+alt+p"], "command": "autoprefixer" } 18 | ``` 19 | 具体配置和文档请参看[官方文档](https://github.com/sindresorhus/sublime-autoprefixer) 20 | 21 | 比如我在编写 CSS 的时候是不用关心哪些属性是需要添加厂商前缀的,当我需要保存测试的时候,只需要按下快捷键,该插件会自动给需要添加厂商前缀的属性添加前缀,如下: 22 | 23 | ```css 24 | { 25 | display: -webkit-box; 26 | display: -ms-flexbox; 27 | display: flex; 28 | display: -webkit-flex; 29 | -webkit-flex-flow: row; 30 | -ms-flex-flow: row; 31 | flex-flow: row; 32 | } 33 | ``` 34 | 35 | 当然该插件也可以加入到自己开发项目的自动化工具中去,比如:Gulp ,Grunt 36 | 37 | ###2.[babel](https://babeljs.io/) 38 | ES6终将是要取代 ES5 的但是在从 ES5 到 ES6 过度的过程中,各个浏览器厂商对 ES6 支持的也不是很好。 39 | 主要是将ES6的代码编译为ES5。至于为什么要这么做,不是本文的内容,可以自行谷歌了解。 40 | 41 | 42 | ###3.[Better Completion](https://github.com/Pleasurazy/Sublime-Better-Completion) 43 | javascript ,jQuery , Bootstrap 等js库的自动补全。该插件的特点就是可以自定义配置需要自动补全的库。 44 | 45 | 安装完以后它的配置文件可以配置自己需要补全的库 46 | 47 | ``` 48 | { 49 | // -------------------- 50 | // sublime-better-completions-Package (sbc package) 51 | // -------------------- 52 | // API files is contains the *keyword* such as `html`, `jquery`, `myglossary` with lowercase as filename `sbc-api-${filename}.sublime-settings` place in `/packages/User/` (your own) or `/packages/${this-package}/sublime-completions/` (package build-in). 53 | // After you enable, disable or added new your own completions, you might need restart your Sublime Text Editor. 54 | // 55 | // Your own setting file `sbc-setting.sublime-settings` need to place in `/packages/User/` and contains all your api setting property that you want to enable. 56 | // 57 | // -------------------- 58 | // APIs Setup 59 | // -------------------- 60 | // `true` means enable it. 61 | // `false` means disable it. 62 | "completion_active_list": { 63 | // build-in completions 64 | "css-properties": false, 65 | "gruntjs-plugins": false, 66 | "html": false, 67 | "lodash": false, 68 | "javascript": false, 69 | "jquery": false, 70 | "jquery-sq": false, // Single Quote 71 | "php": false, 72 | "phpci": false, 73 | "sql": false, 74 | "twitter-bootstrap": false, 75 | "twitter-bootstrap-less-variables": false, 76 | "twitter-bootstrap3": false, 77 | "twitter-bootstrap3-sass-variables": false, 78 | "underscorejs": false, 79 | "react": false, 80 | 81 | // Your own completions? 82 | // ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/sbc-api-my-angularjs.sublime-settings 83 | "my-angularjs": false, 84 | 85 | // ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/sbc-api-my-glossary.sublime-settings 86 | "my-glossary": false, 87 | 88 | // ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/sbc-api-my-html.sublime-settings 89 | "my-html": false, 90 | 91 | // ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/sbc-api-my-javascript.sublime-settings 92 | "my-javascript": false 93 | } 94 | } 95 | ``` 96 | 97 | 98 | ###4.[BracketHighlighter](https://github.com/facelessuser/BracketHighlighter) 99 | 括号高亮匹配插件。 100 | 借用一张官网的截图: 101 | ![这里写图片描述](http://img.blog.csdn.net/20160107111243820) 102 | 103 | ###5.[Color Highlighter](https://github.com/Monnoroch/ColorHighlighter) 104 | 该插件可以显示在CSS文件中说使用的颜色的色值。包括HTML中嵌套的css样式也可以显示。 105 | 如下图: 106 | ![这里写图片描述](http://img.blog.csdn.net/20160107111921207) 107 | 108 | 还可以调节显示的样式,比如当我鼠标放到颜色上的时候 109 | 110 | ![这里写图片描述](http://img.blog.csdn.net/20160107112235677) 111 | 112 | 具体的可以参考官网的说明。 113 | 114 | ###6.[css3](https://github.com/y0ssar1an/CSS3) 115 | 该插件可以对css3属性进行高亮和自动补全。 116 | 具体效果如下: 117 | 118 | ![这里写图片描述](http://img.blog.csdn.net/20160107112708630) 119 | 120 | 安装完以后的设置如下: 121 | >View → Syntax → Open all with current extension as... → CSS3 122 | 123 | 124 | ###7.[DocBlockr](https://github.com/spadgos/sublime-jsdocs) 125 | 这个插件可以非常智能对js文件添加注释,这个非常的方便。 126 | 参考一张官网的截图: 127 | 128 | ![截图](http://img.blog.csdn.net/20160107112942174) 129 | 130 | ###8.[Emmet](https://github.com/emmetio/emmet) 131 | 传说中快速的编写html代码的“神器”。具体的就不再介绍了。网上的教程一搜一大坨啊。 132 | 133 | 134 | ###9.[FileDiffs](https://github.com/colinta/SublimeFileDiffs) 135 | 文件差异对比插件。 136 | 137 | 138 | ###10.[html-css-jsprettify](https://github.com/victorporof/Sublime-HTMLPrettify) 139 | 之前格式化 js,css 文件使用的都是 JsFormat 和 CSSFormat。每次在不同的文件中都要去使用两个不同的插件。后来找到一个可以支持三种语言格式化的插件。 140 | 141 | 对Html,css,js文件进行格式化。 142 | 143 | ``` 144 | //html-css-jsprettify插件快捷键 145 | {"keys": ["command+alt+l"],"command": "htmlprettify"}, 146 | ``` 147 | 148 | ###11.[jade](https://github.com/davidrios/jade-tmbundle) 149 | 如果平时模板语言使用 jade 的话还是安装一个吧,这个可以让 Sublime 的显示更加的友好。jade相关插件,代码高亮 150 | 151 | 152 | ###12.[javascript next - ES6 syntax](https://github.com/Benvie/JavaScriptNext.tmLanguage) 153 | javascript ES6 语法高亮的支持。 154 | 155 | 156 | ###13.[jQuery](https://github.com/SublimeText/jQuery) 157 | 这个插件主要包括 jQuery 语法高亮,代码段。 158 | 159 | ###14.[Sass]()和[SCSS]() 160 | 这两个插件主要是平时使用 scss 或者是 sass 这些预编译语言有用,支持语法高亮。 161 | 162 | ###工具插件 163 | 164 | ####1.[SFTP]() 165 | 这个插件还是很有用的。当我们在跟后端联调的时候,通常都会有一台开发机,暂时存放我们的代码,这个时候如果我们要做一些修改。通常的步骤是: 166 | 1.上传 svn 2.登上开发机 svn up 一下。这个过程中很浪费时间 167 | 168 | 如果我们使用 SFTP 插件就可以保存的时候自动上传到服务器。配置方法: 169 | 1.在项目根目录建立 `sftp-config.json` 文件 170 | 2.配置该文件,详细配置如下图 171 | 172 | ![这里写图片描述](http://img.blog.csdn.net/20160107114810714) 173 | 174 | ####2.[SideBarEnhancements]()和[SideBarFolders]() 175 | Sublime 侧边栏增强插件。 176 | ![这里写图片描述](http://img.blog.csdn.net/20160107115019872) 177 | 178 | ####3.[SublimeCodeIntel]() 179 | 语法,函数跳转。但是我在使用的过程中觉得这个插件并不怎么好用。 180 | 181 | ####4.[Markdown Extended](https://github.com/jonschlinkert/sublime-markdown-extended) 182 | 这个插件主要使 Sublime 对 markdown 语法的高亮支持。效果如下图: 183 | 184 | ![这里写图片描述](http://img.blog.csdn.net/20160107114054544) 185 | 186 | ####5.[TrailingSpaces]() 187 | 去除代码末尾的空格键 188 | 189 | ###语法检查插件列表 190 | 191 | ####1.[SublimeLinter]() 192 | 安装完以后需要,另外安装需要检测语言的插件。 193 | 194 | ####2.[SublimeLinter-jshint]() 195 | 在安装完`SublimeLinter` 后安转该插件对 JavaScript 语言进行语法检测。 196 | 197 | ####3.[SublimeLinter-csslint]() 198 | 在安装完`SublimeLinter` 后安转该插件对 css 语言进行语法检测。 199 | 200 | ###主题插件 201 | 202 | ####1.[Theme-soda](http://buymeasoda.github.io/soda-theme/) 203 | 该插件主要能够使sublime 兼容mac的retina屏幕 204 | 205 | *需要在自己的配置文件内启动* 206 | ``` 207 | { 208 | "theme": "Soda Light 3.sublime-theme" 209 | } 210 | ``` 211 | ####2.[Monokai Extended](https://github.com/jonschlinkert/sublime-monokai-extended) 212 | 213 | 214 | ---------- 215 | **如果您觉得不错,请访问 github([点我](https://github.com/zhiqiang21/MyToolsConfig)) 地址给我一颗星。谢谢啦!** 216 | 217 | -------------------------------------------------------------------------------- /vimconfig/vimrc: -------------------------------------------------------------------------------- 1 | set nocompatible "不要vim模仿vi模式,建议设置,否则会有很多不兼容的问题 2 | 3 | "加载插件配置 4 | if filereadable(expand("~/.vim/vimrc.bundles")) 5 | source ~/.vim/vimrc.bundles 6 | endif 7 | 8 | filetype plugin indent on 9 | syntax enable 10 | syntax on "代码高亮 11 | colorscheme molokai "主题配置.vim/colors/目录下文件名字 12 | set clipboard=unnamed "复制时将内容添加到系统剪切板 13 | set pastetoggle= "粘贴模式快捷键 set paste 14 | set background=dark "主题背景为黑色 15 | set t_Co=256 16 | set history=200 "history: number of command-lines remembered 17 | set autoread "当文件修改以后自动读入文件 18 | set shortmess=atI " do not show initial page 19 | set nobackup "不生成备份文件 20 | set noswapfile "不生成交换文件 21 | set cursorcolumn "高亮当前列 22 | set cursorline "高亮当前行 23 | "set t_ti= t_te= "vim退出时在屏幕上仍显示vim内容 24 | set mouse-=a "禁用鼠标 25 | set selection=inclusive "set selection=exclusive 26 | set selectmode=mouse,key 27 | set title " change the terminal's title 28 | set novisualbell " don't beep 29 | set noerrorbells " don't beep 30 | set t_vb= 31 | set tm=500 32 | set nostartofline " keep cursor postion when switching between buffers 33 | 34 | set number " show line number 35 | set nowrap " disable wrap 36 | 37 | "set list 38 | "set listchars=tab:›\ ,trail:•,extends:❯,precedes:❮ 39 | 40 | set showmatch " show matched brackets 41 | set mat=2 " How many tenths of a second to blink when matching brackets 42 | 43 | set hlsearch " highlight the searching words 44 | set ignorecase " ingnore case when do searching 45 | 46 | set incsearch " 增量显示搜索结果 47 | set smartcase " ignore case if search pattern is all lowercase, case-sensitive otherwise 48 | 49 | set foldenable " code folding 50 | set foldmethod=indent " options: manual, indent, expr, syntax, diff, marker 51 | set foldlevel=99 52 | 53 | set smartindent " Do smart autoindenting when starting a new line 54 | set autoindent " always set autoindenting on 55 | 56 | set tabstop=4 " Number of spaces that a in the file counts for. 57 | set shiftwidth=4 " number of spaces to use for autoindenting 58 | set softtabstop=4 " Number of spaces that a counts for while performing editing operations 59 | set smarttab 60 | set expandtab " when typing , use instead 61 | set shiftround " use multiple of shiftwidth when indenting with '<' and '>' 62 | 63 | set hidden " A buffer becomes hidden when it is abandoned 64 | set wildmode=longest:full,full 65 | set ttyfast 66 | 67 | set relativenumber " show relative line number 68 | set ruler " show the current line number and column number 69 | set showcmd " show the current typing command 70 | set showmode " 显示当前编辑器的状态 71 | set scrolloff=7 " Set 7 lines to the cursor - when moving vertically using j/k 72 | 73 | " File encode:encode for varied filetype 74 | set encoding=utf-8 75 | set fileencodings=utf-8,ucs-bom,cp936,gb18030,big5,euc-jp,euc-kr,latin1 76 | set helplang=cn 77 | set termencoding=utf-8 78 | 79 | set ffs=unix,dos,mac " Use Unix as the standard file type 80 | set formatoptions+=m 81 | set formatoptions+=B " When joining lines, don't insert a space between two multi-byte characters. 82 | set completeopt=longest,menu " behaviour of insert mode completion 83 | set wildmenu " auto complete command 84 | set wildignore=**.o,*~,.swp,*.bak,*.pyc,*.class " Ignore compiled files 85 | 86 | set viminfo^=% " Remember info about open buffers on close 87 | set magic " For regular expressions turn magic on 88 | 89 | set backspace=eol,start,indent " Configure backspace so it acts as it should act 90 | set whichwrap+=<,>,h,l 91 | set pastetoggle= " when in insert mode, toggle between 'paste' and 'nopaste' 92 | 93 | "let &colorcolumn="80,".join(range(120,999),",") 94 | let &colorcolumn="80" 95 | 96 | autocmd InsertEnter * :set norelativenumber " 进入插入模式不显示相对行号 97 | autocmd InsertLeave * :set relativenumber " 离开插入模式显示相对行号 98 | autocmd BufWrite * :FixWhitespace "去掉行尾的空格 99 | 100 | "create undo file 101 | if has('persistent_undo') 102 | set undofile " So is persistent undo ... 103 | set undolevels=1000 " Maximum number of changes that can be undone 104 | set undoreload=10000 " Maximum number lines to save for undo on a buffer reload 105 | set undodir=~/.undodir/ 106 | endif 107 | 108 | 109 | if has('statusline') 110 | set laststatus=2 111 | set statusline=%<%f\ " Filename 112 | set statusline+=%w%h%m%r " Options 113 | set statusline+=%{fugitive#statusline()} " Git Hotness 114 | set statusline+=\ [%{&ff}/%Y] " Filetype 115 | set statusline+=\ [%{getcwd()}] " Current dir 116 | set statusline+=%=%-14.(%l,%c%V%)\ %p%% " Right aligned file nav info 117 | endif 118 | 119 | 120 | if has("autocmd") 121 | au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif 122 | endif 123 | au InsertLeave * set nopaste 124 | 125 | "close popup menu when leave insert mode 126 | autocmd InsertLeave * if pumvisible() == 0|pclose|endif 127 | inoremap pumvisible() ? "\" : "\" 128 | inoremap pumvisible() ? "\" : "\" 129 | inoremap pumvisible() ? "\\\" : "\" 130 | inoremap pumvisible() ? "\\\" : "\" 131 | 132 | autocmd FileType python set tabstop=4 shiftwidth=4 expandtab ai 133 | autocmd FileType javascript,json,css,scss,html set tabstop=4 shiftwidth=4 expandtab ai 134 | 135 | autocmd BufReadPre * if getfsize(expand("%")) > 10000000 | syntax off | endif 136 | 137 | " ---------------------------------------------------------------------------- 138 | " Key Mappings:Customized keys 139 | " ---------------------------------------------------------------------------- 140 | 141 | command! W w !sudo tee % > /dev/null 142 | 143 | "goto older/newer position in change list 144 | nnoremap ( g; 145 | nnoremap ) g, 146 | 147 | "replace currently selected text with default register without yanking it 148 | vnoremap p "_dP 149 | 150 | " use ctrl-c to copy to system clipboard 151 | vnoremap "*y 152 | 153 | " use to paste yanked content 154 | inoremap " 155 | 156 | "Treat long lines as break lines (useful when moving around in them) 157 | noremap j gj 158 | noremap k gk 159 | 160 | " better command line editing 161 | cnoremap 162 | cnoremap 163 | cnoremap 164 | cnoremap 165 | 166 | "禁用方向键 167 | map 168 | map 169 | map 170 | map 171 | 172 | "Smart way to move between windows 173 | noremap j 174 | noremap k 175 | noremap h 176 | noremap l 177 | 178 | " Go to home and end using capitalized directions 179 | noremap H 0 180 | noremap L $ 181 | noremap Y y$ 182 | 183 | " Remap VIM 0 to first non-blank character 184 | noremap 0 ^ 185 | 186 | " Speed up scrolling of the viewport slightly 187 | nnoremap 2 188 | nnoremap 2 189 | 190 | "no Highlight 191 | noremap / :nohls 192 | 193 | " I can type :help on my own, thanks. 194 | noremap " 195 | 196 | nnoremap ; : 197 | nnoremap ' :b 198 | 199 | "Keep search pattern at the center of the screen." 200 | nnoremap n nzz 201 | nnoremap N Nzz 202 | nnoremap * *zz 203 | nnoremap # #zz 204 | nnoremap g* g*zz 205 | 206 | "Use 'm/M' to move among buffers 207 | noremap m :bn 208 | noremap M :bp 209 | 210 | " remap U to for easier redo 211 | nnoremap U 212 | 213 | " select all 214 | noremap sa ggVG" 215 | 216 | nnoremap dp :diffput 217 | nnoremap dg :diffget 218 | 219 | " toggle between two buffers 220 | nnoremap t 221 | 222 | "" Vmap for maintain Visual Mode after shifting > and < 223 | vnoremap < >gv 225 | 226 | "" Move visual block 227 | vnoremap J :m '>+1gv=gv 228 | vnoremap K :m '<-2gv=gv 229 | 230 | if has('macunix') 231 | " pbcopy for OSX copy/paste 232 | vnoremap :!pbcopy 233 | vnoremap :w !pbcopy 234 | endif 235 | 236 | hi! link SignColumn LineNr 237 | hi! link ShowMarksHLl DiffAdd 238 | hi! link ShowMarksHLu DiffChange 239 | 240 | " for error highlight 241 | highlight clear SpellBad 242 | highlight SpellBad term=standout ctermfg=1 term=underline cterm=underline 243 | highlight clear SpellCap 244 | highlight SpellCap term=underline cterm=underline 245 | highlight clear SpellRare 246 | highlight SpellRare term=underline cterm=underline 247 | highlight clear SpellLocal 248 | highlight SpellLocal term=underline cterm=underline 249 | -------------------------------------------------------------------------------- /vimconfig/vim/vimrc.bundles: -------------------------------------------------------------------------------- 1 | " ---------------------------------------------------------------------------- 2 | " Vim-Plug:Plgin management and setting 3 | " ---------------------------------------------------------------------------- 4 | call plug#begin('~/.vim/bundle') 5 | 6 | let mapleader = ',' 7 | let g:mapleader = ',' 8 | 9 | if !exists('g:bigvim_minor_plugins') 10 | let g:bigvim_minor_plugins=['php', 'css',] 11 | endif 12 | 13 | " ---------------------------------------------------------------------------- 14 | " vim plugin bundle control, command model 15 | " :PlugInstall install 16 | " :PlugInstall! update 17 | " :PlugClean remove plugin not in list 18 | " ---------------------------------------------------------------------------- 19 | 20 | " display 21 | Plug 'Valloric/MatchTagAlways' 22 | Plug 'bling/vim-airline' 23 | Plug 'gorodinskiy/vim-coloresque' 24 | Plug 'airblade/vim-gitgutter' 25 | Plug 'inside/vim-search-pulse' 26 | 27 | " fast move 28 | Plug 'vim-scripts/matchit.zip' 29 | Plug 'Lokaltog/vim-easymotion' 30 | Plug 'unblevable/quick-scope' 31 | 32 | " fast edit 33 | Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' 34 | Plug 'godlygeek/tabular' 35 | Plug 'tpope/vim-repeat' 36 | Plug 'gcmt/wildfire.vim' 37 | Plug 'Raimondi/delimitMate' 38 | Plug 'alvan/vim-closetag' 39 | Plug 'mattn/emmet-vim' 40 | Plug 'terryma/vim-multiple-cursors' 41 | Plug 'tpope/vim-surround' 42 | Plug 'bronson/vim-trailing-whitespace' 43 | Plug 'scrooloose/nerdcommenter' 44 | Plug 'editorconfig/editorconfig-vim' 45 | Plug 'Chiel92/vim-autoformat', {'on': 'Autoformat'} 46 | 47 | " tools 48 | Plug 'Valloric/YouCompleteMe' 49 | Plug 'scrooloose/syntastic' 50 | Plug 'majutsushi/tagbar' 51 | Plug 'plasticboy/vim-markdown' 52 | Plug 'tpope/vim-obsession' | Plug 'dhruvasagar/vim-prosession' 53 | Plug 'szw/vim-maximizer' 54 | Plug 'thinca/vim-quickrun' 55 | Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'} 56 | Plug 'sjl/gundo.vim', {'on': 'GundoToggle'} 57 | Plug 'ruanyl/vim-fidget', {'do': 'npm install'} 58 | Plug 'MattesGroeger/vim-bookmarks' 59 | Plug 'ruanyl/vim-fixmyjs', {'on': 'Fixmyjs'} 60 | Plug 'moll/vim-bbye' 61 | Plug 'tpope/vim-fugitive' 62 | Plug 'vim-scripts/BufOnly.vim' 63 | Plug 'tmhedberg/SimpylFold' 64 | Plug 'asins/vimcdoc' "中文文档 65 | 66 | 67 | " theme 68 | Plug 'altercation/vim-colors-solarized' 69 | Plug 'tomasr/molokai' 70 | 71 | " search 72 | Plug 'ctrlpvim/ctrlp.vim' 73 | Plug 'tacahiroy/ctrlp-funky' 74 | Plug 'dyng/ctrlsf.vim', {'on': 'CtrlSFVwordExec'} 75 | Plug 'ggVGc/vim-fuzzysearch' 76 | Plug 'rking/ag.vim' 77 | 78 | " javascript 79 | Plug 'pangloss/vim-javascript', {'branch': 'develop'} 80 | Plug 'marijnh/tern_for_vim', {'do': 'npm install'} 81 | Plug 'othree/javascript-libraries-syntax.vim' 82 | Plug 'kchmck/vim-coffee-script' 83 | Plug 'heavenshell/vim-jsdoc', {'for': ['javascript', 'jsx']} 84 | Plug 'burnettk/vim-angular' 85 | Plug 'mxw/vim-jsx' 86 | 87 | " python 88 | Plug 'klen/python-mode' "python开发插件 89 | 90 | 91 | " CSS 92 | if count(g:bigvim_minor_plugins, 'css') 93 | Plug 'ruanyl/vim-caniuse', {'on': 'Caniuse', 'for': ['css', 'html']} 94 | Plug 'hail2u/vim-css3-syntax' 95 | endif 96 | 97 | "Load local plugins 98 | if filereadable(expand("~/.vim/vimrc.bundles.local")) 99 | source ~/.vim/vimrc.bundles.local 100 | endif 101 | call plug#end() 102 | 103 | " ---------------------------------------------------------------------------- 104 | " NERDTree 105 | " ---------------------------------------------------------------------------- 106 | nnoremap e :NERDTreeToggle 107 | let NERDTreeHighlightCursorline=1 108 | let NERDTreeQuitOnOpen=1 109 | " 当不带参数打开 Vim 时自动加载项目树 110 | "autocmd vimenter * NERDTree 111 | "autocmd StdinReadPre * let s:std_in=1 112 | "autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif 113 | "忽略显示的文件列表 114 | let NERDTreeIgnore=[ '\.pyc$', '\.pyo$', '\.obj$', '\.o$', '\.so$', '\.egg$', '^\.git$', '^\.svn$', '^\.hg$' ] 115 | "close vim if the only window left open is a NERDTree 116 | autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | end 117 | 118 | " ---------------------------------------------------------------------------- 119 | " tagbar 120 | " require ctags, jsctags 121 | " npm install -g git+https://github.com/ramitos/jsctags.git 122 | " ---------------------------------------------------------------------------- 123 | let g:tagbar_type_javascript = { 124 | \ 'ctagsbin' : 'jsctags' 125 | \ } 126 | nnoremap t :TagbarToggle 127 | let g:tagbar_autofocus = 1 128 | let g:tagbar_width = 50 129 | 130 | " ---------------------------------------------------------------------------- 131 | " ctrlp.vim 132 | " ---------------------------------------------------------------------------- 133 | nnoremap m :CtrlPMRU 134 | nnoremap b :CtrlPBuffer 135 | let g:ctrlp_custom_ignore = { 136 | \ 'dir': '\v[\/](node_modules|target|dist)|\.(git|hg|svn|rvm)$', 137 | \ 'file': '\v\.(exe|so|dll|zip|tar|tar.gz)$', 138 | \ } 139 | let g:ctrlp_follow_symlinks=1 140 | 141 | " ---------------------------------------------------------------------------- 142 | " ctrlp-funky 143 | " Mapping: fu 144 | " ---------------------------------------------------------------------------- 145 | let g:ctrlp_funky_matchtype = 'path' 146 | let g:ctrlp_funky_syntax_highlight = 1 147 | nnoremap fu :CtrlPFunky 148 | 149 | " ---------------------------------------------------------------------------- 150 | " ctrlsf.vim 151 | " ---------------------------------------------------------------------------- 152 | vmap s CtrlSFVwordExec 153 | 154 | " ---------------------------------------------------------------------------- 155 | " ag.vim 156 | " ---------------------------------------------------------------------------- 157 | nnoremap a :Ag! 158 | let g:ag_working_path_mode='r' 159 | 160 | " ---------------------------------------------------------------------------- 161 | " vim-fuzzysearch 162 | " ---------------------------------------------------------------------------- 163 | nnoremap / :FuzzySearch 164 | 165 | " ---------------------------------------------------------------------------- 166 | " vim-airline 167 | " ---------------------------------------------------------------------------- 168 | let g:airline_powerline_fonts = 1 169 | let g:airline#extensions#tabline#enabled = 1 170 | let g:airline#extensions#tabline#formatter = 'unique_tail' 171 | let g:airline#extensions#tabline#buffer_nr_show = 1 172 | 173 | " ---------------------------------------------------------------------------- 174 | " vim-trailing-whitespace 175 | " Mapping: 176 | " ---------------------------------------------------------------------------- 177 | map :FixWhitespace 178 | "au BufWrite * :FixWhitespace "保存时清楚行尾的空格" 179 | 180 | " ---------------------------------------------------------------------------- 181 | " vim-bookmarks 182 | " ---------------------------------------------------------------------------- 183 | let g:bookmark_no_default_key_mappings = 1 184 | nnoremap m :BookmarkToggle 185 | nnoremap i :BookmarkAnnotate 186 | nnoremap a :BookmarkShowAll 187 | nnoremap j :BookmarkNext 188 | nnoremap k :BookmarkPrev 189 | nnoremap c :BookmarkClear 190 | nnoremap x :BookmarkClearAll 191 | 192 | " ---------------------------------------------------------------------------- 193 | " vim-maximizer 194 | " ---------------------------------------------------------------------------- 195 | nnoremap :MaximizerToggle 196 | 197 | " ---------------------------------------------------------------------------- 198 | " vim-colors-solarized 199 | " ---------------------------------------------------------------------------- 200 | let g:solarized_termcolors=16 201 | let g:solarized_termtrans=1 202 | let g:solarized_contrast="high" 203 | let g:solarized_visibility="high" 204 | 205 | " ---------------------------------------------------------------------------- 206 | " vim-easymotion 207 | " ---------------------------------------------------------------------------- 208 | map (easymotion-s2) 209 | map / (easymotion-sn) 210 | omap / (easymotion-tn) 211 | let g:EasyMotion_smartcase = 1 212 | 213 | " ---------------------------------------------------------------------------- 214 | " wildfire.vim 215 | " Mapping: 216 | " ---------------------------------------------------------------------------- 217 | let g:wildfire_objects = { 218 | \ "*" : ["i'", 'i"', "i)", "i]", "i}", "ip"], 219 | \ "html,xml" : ["at"], 220 | \ } 221 | let g:wildfire_fuel_map = "" 222 | let g:wildfire_water_map = "" 223 | 224 | " ---------------------------------------------------------------------------- 225 | " YouCompleteMe 226 | " ---------------------------------------------------------------------------- 227 | let g:ycm_autoclose_preview_window_after_completion = 1 228 | "let g:ycm_complete_in_strings = 1 229 | let g:ycm_complete_in_comments = 1 230 | let g:ycm_key_list_select_completion = ['', '', ''] 231 | let g:ycm_key_list_previous_completion = ['', ''] 232 | let g:ycm_semantic_triggers = { 233 | \ 'c' : ['->', '.'], 234 | \ 'objc' : ['->', '.'], 235 | \ 'ocaml' : ['.', '#'], 236 | \ 'cpp,objcpp' : ['->', '.', '::'], 237 | \ 'perl' : ['->'], 238 | \ 'php' : ['->', '::', '(', 'use ', 'namespace ', '\'], 239 | \ 'cs,java,typescript,javascript,d,python,perl6,scala,vb,elixir,go' : ['.', 're!(?=[a-zA-Z]{3,4})'], 240 | \ 'html': ['<', '"', 'gl :YcmCompleter GoToDeclaration 253 | "跳转定义 254 | nnoremap gf :YcmCompleter GoToDefinition 255 | ""跳转定义和声明 256 | nnoremap gg :YcmCompleter GoToDefinitionElseDeclaration 257 | let g:ycm_error_symbol = '>>' 258 | let g:ycm_warning_symbol = '>*' 259 | 260 | autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS 261 | autocmd FileType html setlocal omnifunc=htmlcomplete#CompleteTags 262 | 263 | " ---------------------------------------------------------------------------- 264 | " ultisnips 265 | " ---------------------------------------------------------------------------- 266 | let g:UltiSnipsExpandTrigger="" 267 | let g:UltiSnipsJumpForwardTrigger="" 268 | let g:UltiSnipsJumpBackwardTrigger="" 269 | 270 | " ---------------------------------------------------------------------------- 271 | " delimitMate 272 | " ---------------------------------------------------------------------------- 273 | let delimitMate_matchpairs = "(:),[:],{:}" 274 | let delimitMate_expand_cr = 1 275 | 276 | " ---------------------------------------------------------------------------- 277 | " tabular 278 | " ---------------------------------------------------------------------------- 279 | nmap a= :Tabularize /= 280 | vmap a= :Tabularize /= 281 | nmap a: :Tabularize /: 282 | vmap a: :Tabularize /: 283 | nmap a" :Tabularize /" 284 | vmap a" :Tabularize /" 285 | 286 | " ---------------------------------------------------------------------------- 287 | " syntastic 288 | " ---------------------------------------------------------------------------- 289 | "au BufWrite * :Errors "保存文件时显示错误面板 290 | 291 | let g:syntastic_error_symbol='✗' 292 | let g:syntastic_warning_symbol='⚠' 293 | let g:syntastic_style_error_symbol='~' 294 | let g:syntastic_style_warning_symbol='⚠' 295 | let g:syntastic_check_on_open=1 296 | let g:syntastic_enable_highlighting = 0 297 | let g:syntastic_javascript_checkers = ['jshint'] 298 | 299 | " ---------------------------------------------------------------------------- 300 | " vim-markdown 301 | " ---------------------------------------------------------------------------- 302 | let g:vim_markdown_folding_disabled=1 303 | let g:vim_markdown_no_default_key_mappings=1 304 | let g:vim_markdown_frontmatter=1 305 | 306 | " ---------------------------------------------------------------------------- 307 | " vim-jsx 308 | " ---------------------------------------------------------------------------- 309 | let g:jsx_ext_required = 0 " Allow JSX in normal JS files" 310 | 311 | " ---------------------------------------------------------------------------- 312 | " vim-jsdoc 313 | " ---------------------------------------------------------------------------- 314 | let g:jsdoc_default_mapping = 0 315 | autocmd FileType javascript nnoremap d :JsDoc 316 | 317 | " ---------------------------------------------------------------------------- 318 | " tern_for_vim 319 | " ---------------------------------------------------------------------------- 320 | let tern_show_signature_in_pum = 1 321 | let tern_show_argument_hints = 'on_hold' 322 | autocmd FileType javascript nnoremap d :TernDef 323 | " 显示文档 324 | autocmd FileType javascript nnoremap tnd :TernDoc 325 | autocmd FileType javascript setlocal omnifunc=tern#Complete 326 | 327 | " ---------------------------------------------------------------------------- 328 | " padawan.vim 329 | " Generate Index: :call padawan#GenerateIndex() 330 | " Start Server: :call padawan#StartServer() 331 | " Stop Server: :call padawan#StopServer() 332 | " Restart Server: :call padawan#RestartServer() 333 | " cd ~/.vim/bundle/padawan.vim/padawan.php && composer install 334 | " ---------------------------------------------------------------------------- 335 | 336 | " ---------------------------------------------------------------------------- 337 | " gundo.vim 338 | " ---------------------------------------------------------------------------- 339 | nnoremap h :GundoToggle 340 | let g:gundo_auto_preview = 0 341 | 342 | " ---------------------------------------------------------------------------- 343 | " vim-autoformat 344 | "require: npm install -g js-beautify 345 | " ---------------------------------------------------------------------------- 346 | autocmd FileType javascript,json,html,css,scss,py noremap :Autoformat 347 | "au BufWrite * :Autoformat "保存的时候格式化当前文件" 348 | 349 | " ---------------------------------------------------------------------------- 350 | " vim-bbye 351 | " ---------------------------------------------------------------------------- 352 | nnoremap qq :Bdelete 353 | 354 | " ---------------------------------------------------------------------------- 355 | " BufOnly.vim 356 | " ---------------------------------------------------------------------------- 357 | nnoremap qo :BufOnly 358 | 359 | " ---------------------------------------------------------------------------- 360 | " vim-multiple-cursors 361 | " ---------------------------------------------------------------------------- 362 | let g:multi_cursor_next_key='' 363 | let g:multi_cursor_prev_key='' 364 | let g:multi_cursor_skip_key='' 365 | let g:multi_cursor_quit_key='' 366 | 367 | 368 | " ---------------------------------------------------------------------------- 369 | " simplefold 370 | " ---------------------------------------------------------------------------- 371 | let g:SimpylFold_docstring_preview=1 372 | 373 | 374 | 375 | " ---------------------------------------------------------------------------- 376 | " vim-surround 377 | " ---------------------------------------------------------------------------- 378 | " cs"' 修改双引号为单引号 379 | " ds" 删除双引号 380 | " cst" 修改环绕的字符串

jjjjj

:q 381 | " 382 | -------------------------------------------------------------------------------- /eslintrc.common.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | 'env': { 3 | 'browser': true, 4 | 'es6': true, 5 | 'node': true, 6 | 'jquery': true, 7 | 'commonjs': true 8 | }, 9 | // 'parser': 'babel-eslint', 10 | 'extends': [ 11 | 'eslint:recommended', 12 | // vue文件使用 eslint 13 | // 'plugin:vue/essential' 14 | ], 15 | 'parserOptions': { 16 | "parser": "babel-eslint", 17 | 'ecmaVersion': 6, 18 | 'sourceType': 'module', 19 | 'ecmaFeatures': { 20 | 'jsx': true 21 | } 22 | }, 23 | 'plugins': [ 24 | "babel", 25 | // 配置react 插件lint react 26 | // "react", 27 | // "vue" 28 | ], 29 | 'rules': { 30 | // 控制几个空格一个缩进 31 | 'indent': ['error', 4], 32 | 33 | // 双引号错误提示 34 | 'quotes': [ 35 | 'warn', 36 | 'single', 37 | { 'allowTemplateLiterals': true } 38 | ], 39 | 40 | // 空格和tab混用 41 | 'no-mixed-spaces-and-tabs': ['warn', 'smart-tabs'], 42 | 43 | // 空语句块 44 | 'no-empty': ['error', { 45 | 'allowEmptyCatch': true // 允许catch语句中空语句 46 | }], 47 | 48 | // 变量声明后出现空行 49 | "newline-after-var": ["warn", "always"], 50 | 51 | // 分号 52 | 'semi': ['warn', 'always'], 53 | 54 | // 分号前后是否有空格 55 | "semi-spacing": ["error", { "before": false, "after": true }], 56 | 57 | // 没有使用的变量 58 | 'no-unused-vars': ['error', { 59 | // 不需要检测的变量,支持正则 60 | "varsIgnorePattern": "React" 61 | }], 62 | 63 | // 禁止在代码中出现console 64 | 'no-console': ['error', { 65 | allow: ['warn', 'error', 'dir', 'log'] 66 | }], 67 | 'no-alert': ['warn'], 68 | 69 | // es6 模版字符串中不出现空格 70 | 'template-curly-spacing': ['error', 'never'], 71 | 72 | // 禁止花括号使用空格 73 | 'object-curly-spacing': ['error', 'never', { 'objectsInObjects': true }], 74 | 75 | // 在数组元素的开始盒末尾不使用空格 76 | 'array-bracket-spacing': ['error', 'never'], 77 | 78 | // 在开始注释的地方后出现一个空格 79 | 'spaced-comment': ['error', 'always', { 'exceptions': ['-', '+', '/'] }], 80 | 81 | // 构造函数中的super调用 82 | 'constructor-super': 'error', 83 | 84 | // 函数括号之前是否有空格 85 | 'space-before-function-paren': ['error', { 86 | 'anonymous': 'always', 87 | 'named': 'always', 88 | 'asyncArrow': 'always' 89 | }], 90 | 91 | // 禁止或强制圆括号内的空格 92 | 'space-in-parens': ['error', 'never'], 93 | 94 | // 要求中缀操作符周围有空格 95 | 'space-infix-ops': 'error', 96 | 97 | // 不允许出现debugger 98 | "no-debugger": "off", 99 | 100 | // 要求对象字面量属性都使用引号 101 | // "quote-props": ["error", "always"], 102 | 103 | // 将对像的属性分行显示 104 | "object-property-newline": ["error", { "allowAllPropertiesOnSameLine": false }], 105 | 106 | // 配置对象属性是否自动换行对象个数 >= 2是自动换行 107 | "object-curly-newline": ["error", { 108 | "ObjectExpression": { 109 | "multiline": true, 110 | "minProperties": 3 111 | }, 112 | "ObjectPattern": { "multiline": true }, 113 | "ImportDeclaration": "never", 114 | "ExportDeclaration": { 115 | "multiline": true, 116 | "minProperties": 3 117 | } 118 | }], 119 | 120 | //"array-bracket-newline": ["warn", { "multiline": true }], 121 | 122 | // 强制数组方括号中使用一致的空格 123 | "array-bracket-spacing": ["error", "never"], 124 | 125 | // 强制数组方法的回调函数中有 return 语句 126 | "array-callback-return": "error", 127 | 128 | // 要求箭头函数体使用大括号 129 | "arrow-body-style": "off", 130 | 131 | // 要求箭头函数的参数使用圆括号 132 | "arrow-parens": ["error", "as-needed"], 133 | 134 | // 箭头函数前后有空格 135 | "arrow-spacing": "error", 136 | 137 | // 强制把变量的使用限制在其定义的作用域范围内 138 | "block-scoped-var": "warn", 139 | 140 | // 强制在但行代码块使用一致的空格 141 | "block-spacing": ["error", "never"], 142 | 143 | // 强制在代码块中使用一致的大括号风格 不允许开括号和闭括号在同一行 144 | "brace-style": ["error", "1tbs", { "allowSingleLine": false }], 145 | 146 | // nodejs中的一些回掉函数应该强制使用return 147 | "callback-return": ["error", [ 148 | "done", 149 | "send.error", 150 | "send.success" 151 | ]], 152 | 153 | // 强制使用骆驼拼写法命名约定 154 | "camelcase": ["error", {properties: "never"}], 155 | 156 | // 强制或禁止一个注释的第一个字母大写 157 | "capitalized-comments": "off", 158 | "class-methods-use-this": "off", 159 | 160 | // 要求或禁止末尾逗号 161 | "comma-dangle": ["error", "never"], 162 | 163 | // 强制在逗号前后使用一致的空格 164 | "comma-spacing": ["error", { "before": false, "after": true }], 165 | 166 | // 强制使用一致的逗号风格 167 | "comma-style": ["error", "last"], 168 | 169 | // 此规则目的在于通过在项目中设置一个圈复杂度阈值来控制代码的复杂度 170 | //"complexity": ["warn", 10], 171 | 172 | // 强制在计算的属性的方括号中使用一致的空格 173 | "computed-property-spacing": ["error", "never"], 174 | 175 | //要求 return 语句要么总是指定返回的值,要么不指定 176 | //"consistent-return": ["error", { "treatUndefinedAsUnspecified": true }], 177 | 178 | // 当获取当前执行环境的上下文时,强制使用一致的命名 179 | "consistent-this": "off", 180 | 181 | // 要求在构造函数中有 super() 的调用 182 | "constructor-super": "error", 183 | 184 | // 强制所有控制语句使用一致的括号风格 185 | "curly": ["error", "multi-line"], 186 | 187 | // 要求 switch 语句中有 default 分支 188 | "default-case": "off", 189 | 190 | // 强制在点号之前和之后一致的换行 191 | "dot-location": ["error", "property"], 192 | 193 | // 强制尽可能地使用点号 194 | // "dot-notation": ["error", { "allowKeywords": false }], 195 | 196 | //要求或禁止文件末尾存在空行 197 | "eol-last": ["error", "always"], 198 | 199 | // 要求使用 === 和 !== 200 | // "eqeqeq": ["error", "always", { "null": "ignore" }], 201 | 202 | // enforce “for” loop update clause moving the counter in the right direction. 203 | "for-direction": "off", 204 | "func-call-spacing": ["error", "never"], 205 | "func-name-matching": "off", 206 | "func-style": "off", 207 | "generator-star-spacing": ["error", { "before": false, "after": true }], 208 | 209 | // require语句放在一个文件的首部 210 | // "global-require": "warn", 211 | "guard-for-in": "warn", 212 | "handle-callback-err": "off", 213 | "id-blacklist": "off", 214 | "id-length": "off", 215 | "id-match": "off", 216 | "indent-legacy": "off", 217 | "init-declarations": "warn", 218 | "jsx-quotes": ["error", "prefer-double"], 219 | 220 | // 对象的字面量和值之间有空格 221 | "key-spacing": ["error", {"beforeColon": false, "afterColon": true}], 222 | "keyword-spacing": "error", 223 | 224 | // 在关键字前后有空格 if function 225 | // "line-comment-position": "off", 226 | 227 | // 在函数内部使用一致的换行风格 函数的括号内的参数永远不换行 228 | "function-paren-newline": ["error", "never"], 229 | 230 | // 强制使用一致的换行符风格 231 | "linebreak-style": ["error", "unix"], 232 | 233 | // "lines-around-comment": "off", 234 | // "max-depth": ["warn", 3], 235 | // "max-len": ["error", 120, 4, {"ignoreUrls": true}], 236 | // "max-lines": ["warn", 800], 237 | // "max-nested-callbacks": "off", 238 | // "max-params": "off", 239 | // "max-statements": ["warn", 30, {"ignoreTopLevelFunctions": true}], 240 | // "max-statements-per-line": ["error", { "max": 1 }], 241 | // "multiline-ternary": "off", 242 | // "new-cap": "error", 243 | // "new-parens": "warn", 244 | "newline-per-chained-call": "off", 245 | // "no-alert": "warn", 246 | // "no-array-constructor": "off", 247 | // "no-await-in-loop": "off", 248 | // "no-bitwise": "off", 249 | // "no-buffer-constructor": "warn", 250 | // "no-caller": "error", 251 | // "no-case-declarations": "error", 252 | // "no-catch-shadow": "off", 253 | // "no-class-assign": "error", 254 | // "no-compare-neg-zero": "error", 255 | // "no-cond-assign": "error", 256 | // "no-confusing-arrow": ["error", {"allowParens": true}], 257 | // "no-console": "error", 258 | // "no-const-assign": "error", 259 | // "no-constant-condition": "error", 260 | // "no-continue": "off", 261 | // "no-control-regex": "error", 262 | // "no-delete-var": "error", 263 | // "no-div-regex": "off", 264 | // "no-dupe-args": "error", 265 | // "no-dupe-class-members": "error", 266 | // "no-dupe-keys": "error", 267 | // "no-duplicate-case": "error", 268 | // "no-duplicate-imports": "warn", 269 | // "no-else-return": "off", 270 | // "no-empty": "error", 271 | // "no-empty-character-class": "error", 272 | // "no-empty-function": "error", 273 | // "no-empty-pattern": "error", 274 | // "no-eq-null": "off", 275 | // "no-eval": "error", 276 | // "no-ex-assign": "error", 277 | // "no-extend-native": "error", 278 | // "no-extra-bind": "warn", 279 | // "no-extra-boolean-cast": "error", 280 | // "no-extra-label": "error", 281 | // "no-extra-parens": ["error", "functions"], 282 | // 禁止不必要的分号 比如使用多个分号 ;; 283 | "no-extra-semi": "error", 284 | // "no-fallthrough": "error", 285 | // "no-floating-decimal": "error", 286 | // "no-func-assign": "warn", 287 | // "no-global-assign": "error", 288 | // "no-implicit-coercion": "off", 289 | // "no-implicit-globals": "off", 290 | // "no-implied-eval": "error", 291 | // "no-inline-comments": "off", 292 | // "no-inner-declarations": "error", 293 | // "no-invalid-regexp": "error", 294 | // "no-invalid-this": "off", 295 | // "no-irregular-whitespace": "error", 296 | // "no-iterator": "off", 297 | // "no-label-var": "off", 298 | // "no-labels": "off", 299 | // "no-lone-blocks": "off", 300 | // "no-lonely-if": "error", 301 | // "no-loop-func": "warn", 302 | // "no-magic-numbers": "off", 303 | // "no-mixed-operators": "off", 304 | // "no-mixed-requires": "off", 305 | // "no-mixed-spaces-and-tabs": "error", 306 | // "no-multi-assign": "warn", 307 | // "no-multi-spaces": ["error", {"exceptions": {"Property": false}}], 308 | // "no-multi-str": "warn", 309 | "no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 0 }], 310 | // "no-negated-condition": "warn", 311 | // "no-negated-in-lhs": "error", 312 | // "no-nested-ternary": "off", 313 | // "no-new": "error", 314 | // "no-new-func": "error", 315 | // "no-new-object": "error", 316 | // "no-new-require": "error", 317 | // "no-new-symbol": "error", 318 | // "no-new-wrappers": "error", 319 | // "no-obj-calls": "error", 320 | // "no-octal": "error", 321 | // "no-octal-escape": "error", 322 | // "no-param-reassign": ["warn", {"props": true}], 323 | // "no-path-concat": "off", 324 | // "no-plusplus": "off", 325 | // "no-process-env": "off", 326 | // "no-process-exit": "off", 327 | // "no-proto": "error", 328 | // "no-prototype-builtins": "off", 329 | // "no-redeclare": "error", 330 | // "no-regex-spaces": "error", 331 | // "no-restricted-globals": "off", 332 | // "no-restricted-imports": "off", 333 | // "no-restricted-modules": "off", 334 | // "no-restricted-properties": "off", 335 | // "no-restricted-syntax": "off", 336 | 337 | // 禁止在返回语句中赋值,如果需要使用使用括号将表达式括起来 338 | "no-return-assign": ["error", "except-parens"], 339 | // "no-return-await": "error", 340 | // "no-script-url": "warn", 341 | // "no-self-assign": "error", 342 | // "no-self-compare": "error", 343 | // "no-sequences": "error", 344 | // "no-shadow": "off", 345 | // "no-shadow-restricted-names": "off", 346 | // "no-spaced-func": "error", 347 | // "no-sparse-arrays": "error", 348 | // "no-sync": "off", 349 | // "no-tabs": "warn", 350 | // "no-template-curly-in-string": "off", 351 | // "no-ternary": "off", 352 | // "no-this-before-super": "error", 353 | // "no-throw-literal": "warn", 354 | "no-trailing-spaces": "error", 355 | // "no-undef": "error", 356 | // "no-undef-init": "warn", 357 | // "no-undefined": "off", 358 | // "no-underscore-dangle": "warn", 359 | // "no-unexpected-multiline": "error", 360 | // "no-unmodified-loop-condition": "warn", 361 | // "no-unneeded-ternary": "error", 362 | // "no-unreachable": "error", 363 | // "no-unsafe-finally": "error", 364 | // "no-unsafe-negation": "error", 365 | // "no-unused-expressions": ["warn", {"allowShortCircuit": true}], 366 | // "no-unused-labels": "error", 367 | // "no-use-before-define": ["error", {"variables": false, "classes": false, "functions": true}], 368 | // "no-useless-call": "warn", 369 | // "no-useless-computed-key": "error", 370 | // "no-useless-concat": "warn", 371 | // "no-useless-constructor": "error", 372 | 373 | // 禁止不必要的转义 374 | "no-useless-escape": "error", 375 | 376 | // disallow renaming import, export, and destructured assignments to the same name 377 | "no-useless-rename": "error", 378 | 379 | // "no-useless-return": "error", 380 | 381 | // "no-var": "error", 382 | // "no-void": "error", 383 | // "no-warning-comments": "off", 384 | // "no-whitespace-before-property": "error", 385 | // "no-with": "error", 386 | // "nonblock-statement-body-position": "off", 387 | // "object-property-newline": "off", 388 | // "object-shorthand": ["off", "consistent-as-needed"], 389 | // "one-var": ["error", "never"], 390 | 391 | // 强制变量声明使用一致的的换行 392 | "one-var-declaration-per-line": ["error", "always"], 393 | // "operator-assignment": "off", 394 | 395 | // 强制操作符使用一致的换行符风格 比如 2+3+4 如果使用多行书写 + 号在行首 396 | "operator-linebreak": ["error", "before"], 397 | // "padded-blocks": "off", 398 | // "padding-line-between-statements": "off", 399 | // "prefer-arrow-callback": "warn", 400 | // "prefer-const": "error", 401 | // "prefer-destructuring": "off", 402 | // "prefer-numeric-literals": "error", 403 | // "prefer-promise-reject-errors": "warn", 404 | // "prefer-reflect": "off", 405 | // "prefer-rest-params": "error", 406 | // "prefer-spread": "warn", 407 | // "prefer-template": "off", 408 | // "quote-props": "off", 409 | // "radix": "error", 410 | // "require-await": "warn", 411 | // "require-jsdoc": "off", 412 | // "require-yield": "error", 413 | // "rest-spread-spacing": ["error", "never"], 414 | // "semi": ["error", "always"], 415 | // 强制使用分号的位置 只允许分号出现在句子的末尾 416 | "semi-style": ["error", "last"], 417 | // "sort-imports": "off", 418 | "sort-keys": "off", 419 | "sort-vars": "off", 420 | "space-before-blocks": ["error", "always"], 421 | "space-before-function-paren": ["error", { "anonymous": "always", "named": "never" }], 422 | "space-in-parens": ["error", "never"], 423 | "space-infix-ops": "error", 424 | "space-unary-ops": "warn", 425 | "spaced-comment": ["error", "always"], 426 | // "strict": "off", 427 | // "switch-colon-spacing": ["error", {"before": false, "after": true}], 428 | // "symbol-description": "warn", 429 | // "template-curly-spacing": ["error", "never"], 430 | // "template-tag-spacing": ["error", "never"], 431 | // "unicode-bom": "warn", 432 | // "use-isnan": "error", 433 | // "valid-jsdoc": "off", 434 | // "valid-typeof": "error", 435 | "vars-on-top": "off", 436 | // "wrap-iife": ["error", "any"], 437 | // "wrap-regex": "off", 438 | "yield-star-spacing": "off", 439 | // "yoda": "warn", 440 | 441 | // 禁止花括号内使用空格 442 | // "babel/object-curly-spacing": ['error', 'never', { 'objectsInObjects': true }], 443 | } 444 | }; 445 | --------------------------------------------------------------------------------