├── .agignore ├── .bash_profile ├── .ctags ├── .emacs-profile ├── .emacs-profiles.el ├── .eslintrc ├── .flake8rc ├── .gdlintrc ├── .gitconfig ├── .gitignore ├── .gitmodules ├── .ideavimrc ├── .jsbeautifyrc ├── .jshintrc ├── .latexmkrc ├── .luacheckrc ├── .netrwhist ├── .npmrc ├── .pentadactylrc ├── .pylintrc ├── .ruby-version ├── .tern-project ├── .tmux-mac ├── .tmux.conf ├── .vrapperrc ├── .xvimrc ├── .ycm_extra_conf.py ├── .zshenv ├── .zshrc ├── Global Macro Group Macros.kmlibrary ├── README.md ├── UltiSnips ├── all.snippets ├── cpp.snippets ├── lua.snippets ├── mkd.snippets ├── python.snippets ├── tex.snippets ├── vim.snippets └── vimwiki.snippets ├── _vimrc ├── _vsvimrc ├── autoload ├── .DS_Store └── gocomplete.vim ├── bin ├── cc_args.py └── tmux-session ├── bundles.vim ├── colors ├── .DS_Store ├── ego.vim ├── railscasts.vim ├── wombat.vim └── wombat256.vim ├── ec ├── emacs ├── emacs.sh ├── ftplugin └── go.vim ├── get-pip.py ├── install.sh ├── karabiner.json ├── rc.py ├── rock-mac.sh ├── rock.sh ├── study.vim ├── tslint.json ├── ubuntu.sh ├── uninstall.sh └── vimrc /.agignore: -------------------------------------------------------------------------------- 1 | elpa 2 | node_modules/ 3 | bower_components/ 4 | TAGS 5 | *.min.js 6 | bin/ -------------------------------------------------------------------------------- /.bash_profile: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export USE_CCACHE=1 3 | export PATH=$COCOS_CONSOLE_ROOT:$PATH 4 | export ANDROID_NDK=/Users/lionqu/workspace/android-ndk-r21d/ 5 | export NDK_ROOT=/Users/lionqu/workspace/android-ndk-r21d/ 6 | # export JAVA_HOME=/Library/Java/JavaVirtualMachines/ibm-semeru-open-11.jdk/Contents/Home/ 7 | export ANDROID_NDK_ROOT=/Users/lionqu/workspace/android-ndk-r21d/ 8 | export PATH=$NDK_ROOT:$PATH 9 | export ANDROID_SDK_ROOT=/Users/lionqu/Library/Android/sdk 10 | export PATH=$ANDROID_SDK_ROOT/sdk/platform-tools:$PATH 11 | export PATH=$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH 12 | 13 | 14 | export PATH=/Library/TeX/texbin:/usr/local/bin:$PATH 15 | # for color 16 | export CLICOLOR=1 17 | 18 | alias g='git' 19 | export PATH=/usr/local/bin/:/usr/local/Cellar/git/2.30.1/libexec/git-core:$PATH 20 | export PERL5LIB=/usr/local/lib/perl5/site_perl/5.28.2/darwin-thread-multi-2level 21 | alias grep="grep" 22 | . "$HOME/.cargo/env" 23 | source /opt/homebrew/opt/asdf/libexec/asdf.sh 24 | -------------------------------------------------------------------------------- /.ctags: -------------------------------------------------------------------------------- 1 | --exclude=*.hg* 2 | --exclude=*.cvs* 3 | --exclude=*.svn* 4 | --exclude=*.git* 5 | --exclude=*compiled* 6 | --exclude=*public_html* 7 | --exclude=*.idea* 8 | --exclude=*bower_components* 9 | --exclude=*images* 10 | --exclude=*.DS_Store* 11 | --exclude=*log* 12 | --exclude=*.min.js 13 | --exclude=*.min.css 14 | --exclude=*.pack.js 15 | --exclude=*.log 16 | --exclude=*bin* 17 | --exclude=*vender* 18 | --exclude=*.sql 19 | --exclude=*.html 20 | --exclude=*.sass 21 | --exclude=*.ftl 22 | --exclude=tags 23 | --exclude=TAGS 24 | --exclude=GTAGS 25 | --exclude=GPATH 26 | --exclude=*node_modules* 27 | --exclude=GRTAGS 28 | --exclude=*doc* 29 | --exclude=*tmp* 30 | --exclude=.#* 31 | --tag-relative=yes 32 | --recurse=yes 33 | 34 | --langdef=js 35 | --langmap=js:.js 36 | --langmap=js:+.jsx 37 | 38 | --regex-js=/[ \t.]([A-Z][A-Z0-9._$]+)[ \t]*[=:][ \t]*([0-9"'\[\{]|null)/\1/n,constant/ 39 | 40 | --regex-js=/\.([A-Za-z0-9._$]+)[ \t]*=[ \t]*\{/\1/o,object/ 41 | --regex-js=/['"]*([A-Za-z0-9_$]+)['"]*[ \t]*:[ \t]*\{/\1/o,object/ 42 | --regex-js=/([A-Za-z0-9._$]+)\[["']([A-Za-z0-9_$]+)["']\][ \t]*=[ \t]*\{/\1\.\2/o,object/ 43 | 44 | --regex-js=/([A-Za-z0-9._$]+)[ \t]*=[ \t]*\(function\(\)/\1/c,class/ 45 | --regex-js=/class[ \t]+([A-Za-z0-9._$]+)[ \t]*/\1/c,class/ 46 | --regex-js=/([A-Za-z$][A-Za-z0-9_$()]+)[ \t]*=[ \t]*[Rr]eact.createClass[ \t]*\(/\1/c,class/ 47 | --regex-js=/([A-Z][A-Za-z0-9_$]+)[ \t]*=[ \t]*[A-Za-z0-9_$]*[ \t]*[{(]/\1/c,class/ 48 | --regex-js=/([A-Z][A-Za-z0-9_$]+)[ \t]*:[ \t]*[A-Za-z0-9_$]*[ \t]*[{(]/\1/c,class/ 49 | --regex-js=/^[ \t]*cc\.(.+)[ \t]*=[ \t]*cc\.([a-zA-Z]+)\.extend/\1/c,class/ 50 | --regex-js=/^[ \t]*cc\.(\w+)[ \t]*=[ \t]*cc\./\1/c,class/ 51 | 52 | --regex-js=/([A-Za-z$][A-Za-z0-9_$]+)[ \t]*=[ \t]*function[ \t]*\(/\1/f,function/ 53 | 54 | --regex-js=/(function)*[ \t]*([A-Za-z$_][A-Za-z0-9_$]+)[ \t]*\([^)]*\)[ \t]*\{/\2/f,function/ 55 | --regex-js=/['"]*([A-Za-z$][A-Za-z0-9_$]+)['"]*:[ \t]*function[ \t]*\(/\1/m,method/ 56 | --regex-js=/([A-Za-z0-9_$]+)\[["']([A-Za-z0-9_$]+)["']\][ \t]*=[ \t]*function[ \t]*\(/\2/m,method/ 57 | 58 | --langdef=css 59 | --langmap=css:.css 60 | --regex-css=/^[ \t]*\.([A-Za-z0-9_-]+)/.\1/c,class,classes/ 61 | --regex-css=/^[ \t]*#([A-Za-z0-9_-]+)/#\1/i,id,ids/ 62 | --regex-css=/^[ \t]*(([A-Za-z0-9_-]+[ \t\n,]+)+)\{/\1/t,tag,tags/ 63 | --regex-css=/^[ \t]*@media\s+([A-Za-z0-9_-]+)/\1/m,media,medias/ -------------------------------------------------------------------------------- /.emacs-profile: -------------------------------------------------------------------------------- 1 | doom 2 | -------------------------------------------------------------------------------- /.emacs-profiles.el: -------------------------------------------------------------------------------- 1 | ("doom" . ((user-emacs-directory . "~/.emacs.d.doom") 2 | (env . (("DOOMDIR" . "~/.doom.d"))))) 3 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "eslint:recommended", 3 | "rules": { 4 | "comma-dangle": 0, 5 | "no-console": 0, 6 | "no-constant-condition": 0, 7 | "semi": 1 8 | }, 9 | "parserOptions": { 10 | "ecmaVersion": 6, 11 | "ecmaFeatures": { 12 | "jsx": true 13 | } 14 | }, 15 | "env": { 16 | "browser": true, 17 | "node": true, 18 | "es6": true, 19 | "mocha": true 20 | }, 21 | "plugins": [ 22 | ], 23 | "globals": { 24 | "tap": false, 25 | "unused": false, 26 | "Editor": false, 27 | "Helper": false, 28 | "Vue": false, 29 | "Polymer": false, 30 | "expect": false, 31 | "sinon": false, 32 | "assert": false, 33 | "_Scene": false, 34 | "cc": false, 35 | "CC_EDITOR": false, 36 | "CC_TEST": false 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /.flake8rc: -------------------------------------------------------------------------------- 1 | [flake8] 2 | ignore = W191,E302,E265,E241,F403,E401,E901,F401,E251 3 | max-line-length = 110 4 | -------------------------------------------------------------------------------- /.gdlintrc: -------------------------------------------------------------------------------- 1 | class-definitions-order: 2 | - tools 3 | - classnames 4 | - extends 5 | - docstrings 6 | - signals 7 | - enums 8 | - consts 9 | - exports 10 | - pubvars 11 | - prvvars 12 | - onreadypubvars 13 | - onreadyprvvars 14 | - staticvars 15 | - others 16 | class-load-variable-name: (([A-Z][a-z0-9]*)+|_?[a-z][a-z0-9]*(_[a-z0-9]+)*) 17 | class-name: ([A-Z][a-z0-9]*)+ 18 | class-variable-name: _?[a-z][a-z0-9]*(_[a-z0-9]+)* 19 | comparison-with-itself: null 20 | constant-name: _?[A-Z][A-Z0-9]*(_[A-Z0-9]+)* 21 | disable: [] 22 | duplicated-load: null 23 | enum-element-name: '[A-Z][A-Z0-9]*(_[A-Z0-9]+)*' 24 | enum-name: ([A-Z][a-z0-9]*)+ 25 | excluded_directories: !!set 26 | .git: null 27 | expression-not-assigned: null 28 | function-argument-name: _?[a-z][a-z0-9]*(_[a-z0-9]+)* 29 | function-arguments-number: 10 30 | function-name: (_on_([A-Z][a-z0-9]*)+(_[a-z0-9]+)*|_?[a-z][a-z0-9]*(_[a-z0-9]+)*) 31 | function-preload-variable-name: ([A-Z][a-z0-9]*)+ 32 | function-variable-name: '[a-z][a-z0-9]*(_[a-z0-9]+)*' 33 | load-constant-name: (([A-Z][a-z0-9]*)+|_?[A-Z][A-Z0-9]*(_[A-Z0-9]+)*) 34 | loop-variable-name: _?[a-z][a-z0-9]*(_[a-z0-9]+)* 35 | max-file-lines: 1000 36 | max-line-length: 200 37 | max-public-methods: 20 38 | max-returns: 6 39 | mixed-tabs-and-spaces: null 40 | no-elif-return: null 41 | no-else-return: null 42 | private-method-call: null 43 | signal-name: '[a-z][a-z0-9]*(_[a-z0-9]+)*' 44 | sub-class-name: _?([A-Z][a-z0-9]*)+ 45 | tab-characters: 1 46 | trailing-whitespace: null 47 | unnecessary-pass: null 48 | unused-argument: null 49 | -------------------------------------------------------------------------------- /.gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | name = zilongshanren 3 | email = guanghui8827@126.com 4 | [include] 5 | path = ~/.gitconfig.local 6 | [mergetool] 7 | keepBackup = false 8 | [alias] 9 | # Show the diff between the latest commit and the current state 10 | d = !"git diff" 11 | # `git di $number` shows the diff between the state `$number` revisions ago and the current state 12 | di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d" 13 | g = git 14 | cm = commit 15 | cl = clone 16 | br = branch 17 | st = status 18 | co = checkout 19 | hide = update-index --assume-unchanged 20 | unhide = update-index --no-assume-unchanged 21 | unhide-all = "!git ls-files -v | grep \"^[a-z]\" | awk '{print $2,$NF;}' | xargs git unhide" 22 | hidden = !git ls-files -v | grep \"^[a-z]\" 23 | ignored = !git status -s --ignored | grep \"^!!\" 24 | sm = submodule 25 | ci = commit -a -v 26 | unst = reset HEAD 27 | throw = reset --hard HEAD 28 | throwh = reset --hard HEAD^ 29 | clr = clean -fdx -f 30 | last = log -1 31 | glog = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit 32 | slog = log --pretty=oneline 33 | accept-ours = "!f() { git checkout --ours -- \"${@:-.}\"; git add -u \"${@:-.}\"; }; f" 34 | accept-theirs = "!f() { git checkout --theirs -- \"${@:-.}\"; git add -u \"${@:-.}\"; }; f" 35 | tagcommit = !sh -c 'git rev-list $0 | head -n 1' 36 | [color] 37 | ui = true 38 | [core] 39 | editor = vim 40 | autocrlf = input 41 | excludesfile = /Users/lionqu/.gitignore_global 42 | quotepath = false 43 | longpaths = true 44 | trustctime = false 45 | attributesfile = ~/.attributes_global 46 | [difftool "sourcetree"] 47 | cmd = opendiff \"$LOCAL\" \"$REMOTE\" 48 | path = 49 | [mergetool "sourcetree"] 50 | cmd = /Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\" 51 | trustExitCode = true 52 | [push] 53 | default = matching 54 | [branch] 55 | autosetuprebase = always 56 | [pack] 57 | windowMemory = 100m 58 | packSizeLimit = 100m 59 | threads = 1 60 | SizeLimit = 100m 61 | [filter "lfs"] 62 | clean = git-lfs clean -- %f 63 | smudge = git-lfs smudge -- %f 64 | process = git-lfs filter-process 65 | required = true 66 | [http] 67 | postBuffer = 655360000 68 | [diff "text"] 69 | textconv = cat 70 | [lfs] 71 | concurrenttransfers = 32 72 | [rebase] 73 | backend = apply 74 | #[http "https://git.code.oa.com"] 75 | ## proxy = http://127.0.0.1:12639 76 | #[http "http://git.code.oa.com"] 77 | # proxy = http://127.0.0.1:12639 78 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | */.DS_Store 3 | view/ 4 | *.swp 5 | .netrwhist 6 | .ycm_extra_conf.pyc 7 | bundle/* 8 | !bundle/vundle 9 | /.gitconfig.local -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "bundle/vundle"] 2 | path = bundle/vundle 3 | url = https://github.com/gmarik/Vundle.vim.git 4 | [submodule "antigen"] 5 | path = antigen 6 | url = https://github.com/zsh-users/antigen.git 7 | -------------------------------------------------------------------------------- /.ideavimrc: -------------------------------------------------------------------------------- 1 | " selected IntelliSpace modules 2 | source ~/.intellimacs/spacemacs.vim 3 | source ~/.intellimacs/extra.vim 4 | source ~/.intellimacs/major.vim 5 | source ~/.intellimacs/hybrid.vim 6 | 7 | vnoremap < >gv 9 | nnoremap n nzz 10 | nnoremap N Nzz 11 | nnoremap * *zz 12 | nnoremap # #zz 13 | nnoremap g* g*zz 14 | nnoremap g# g#zz 15 | 16 | " My own vim commands 17 | nnoremap Y y$ 18 | 19 | " Add/edit actions 20 | nnoremap gl :action Vcs.Show.Log 21 | vnoremap gl :action Vcs.Show.Log 22 | nnoremap sj :action FileStructurePopup 23 | vnoremap sj :action FileStructurePopup 24 | nnoremap gr :action Refactorings.QuickListPopupAction 25 | nnoremap v :action EditorSelectWord 26 | vnoremap v :action EditorSelectWord 27 | vnoremap V :action EditorUnSelectWord 28 | 29 | 30 | " Insert line below 31 | nnoremap ] ok 32 | vnoremap ] ok 33 | 34 | " Insert line above 35 | nnoremap [ Oj 36 | vnoremap [ Oj 37 | 38 | nnoremap l :action GoToLine 39 | vnoremap l :action GoToLine 40 | 41 | inoremap pA 42 | 43 | nnoremap = :action ReformatCode 44 | nnoremap == :action AutoIndentLines 45 | vnoremap = :action AutoIndentLines 46 | 47 | nnoremap ,/ :action CommentByLineComment 48 | vnoremap ,/ :action CommentByLineComment 49 | " Redo 50 | nnoremap U 51 | 52 | 53 | nnoremap fo :action ShowFilePath 54 | 55 | nnoremap :action Find -------------------------------------------------------------------------------- /.jsbeautifyrc: -------------------------------------------------------------------------------- 1 | { 2 | "indent_size": 4, 3 | "indent_char": " ", 4 | "eol": "\n", 5 | "indent_level": 0, 6 | "indent_with_tabs": false, 7 | "preserve_newlines": true, 8 | "max_preserve_newlines": 10, 9 | "jslint_happy": false, 10 | "space_after_anon_function": false, 11 | "brace_style": "collapse", 12 | "keep_array_indentation": false, 13 | "keep_function_indentation": false, 14 | "space_before_conditional": true, 15 | "break_chained_methods": false, 16 | "eval_code": false, 17 | "unescape_strings": false, 18 | "wrap_line_length": 0, 19 | "wrap_attributes": "auto", 20 | "wrap_attributes_indent_size": 4, 21 | "end_with_newline": false 22 | } -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | //.jshintrc 2 | { 3 | // JSHint Meteor Configuration File 4 | // Match the Meteor Style Guide 5 | // 6 | // By @raix with contributions from @aldeed and @awatson1978 7 | // Source https://github.com/raix/Meteor-jshintrc 8 | // 9 | // See http://jshint.com/docs/ for more details 10 | 11 | "maxerr" : 50, // {int} Maximum error before stopping 12 | 13 | // Enforcing 14 | "bitwise" : false, // true: Prohibit bitwise operators (&, |, ^, etc.) 15 | "camelcase" : false, // true: Identifiers must be in camelCase 16 | "curly" : false, // true: Require {} for every new block or scope 17 | "eqeqeq" : true, // true: Require triple equals (===) for comparison 18 | "forin" : false, // true: Require filtering for..in loops with obj.hasOwnProperty() 19 | "immed" : true, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());` 20 | "indent" : 2, // {int} Number of spaces to use for indentation 21 | "latedef" : true, // true: Require variables/functions to be defined before being used 22 | "newcap" : false, // true: Require capitalization of all constructor functions e.g. `new F()` 23 | "noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee` 24 | "noempty" : true, // true: Prohibit use of empty blocks 25 | "nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment) 26 | "plusplus" : false, // true: Prohibit use of `++` & `--` 27 | "quotmark" : false, // Quotation mark consistency: 28 | // false : do nothing (default) 29 | // true : ensure whatever is used is consistent 30 | // "single" : require single quotes 31 | // "double" : require double quotes 32 | "undef" : true, // true: Require all non-global variables to be declared (prevents global leaks) 33 | "unused" : true, // true: Require all defined variables be used 34 | "strict" : false, // true: Requires all functions run in ES5 Strict Mode 35 | "trailing" : true, // true: Prohibit trailing whitespaces 36 | "maxparams" : 4, // {int} Max number of formal params allowed per function 37 | "maxdepth" : 4, // {int} Max depth of nested blocks (within functions) 38 | "maxstatements" : 15, // {int} Max number statements per function 39 | "maxcomplexity" : 8, // {int} Max cyclomatic complexity per function 40 | "maxlen" : 160, // {int} Max number of characters per line 41 | 42 | // Relaxing 43 | "asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons) 44 | "boss" : false, // true: Tolerate assignments where comparisons would be expected 45 | "debug" : false, // true: Allow debugger statements e.g. browser breakpoints. 46 | "eqnull" : false, // true: Tolerate use of `== null` 47 | "es5" : false, // true: Allow ES5 syntax (ex: getters and setters) 48 | "esnext" : true, // true: Allow ES.next (ES6) syntax (ex: `const`) 49 | "moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features) 50 | // (ex: `for each`, multiple try/catch, function expression…) 51 | "evil" : false, // true: Tolerate use of `eval` and `new Function()` 52 | "expr" : false, // true: Tolerate `ExpressionStatement` as Programs 53 | "funcscope" : false, // true: Tolerate defining variables inside control statements" 54 | "globalstrict" : false, // true: Allow global "use strict" (also enables 'strict') 55 | "iterator" : false, // true: Tolerate using the `__iterator__` property 56 | "lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block 57 | "laxbreak" : false, // true: Tolerate possibly unsafe line breakings 58 | "laxcomma" : false, // true: Tolerate comma-first style coding 59 | "loopfunc" : true, // true: Tolerate functions being defined in loops 60 | "multistr" : false, // true: Tolerate multi-line strings 61 | "proto" : false, // true: Tolerate using the `__proto__` property 62 | "scripturl" : false, // true: Tolerate script-targeted URLs 63 | "smarttabs" : false, // true: Tolerate mixed tabs/spaces when used for alignment 64 | "shadow" : true, // true: Allows re-define variables later in code e.g. `var x=1; x=2;` 65 | "sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation 66 | "supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;` 67 | "validthis" : false, // true: Tolerate using this in a non-constructor function 68 | 69 | // Environments 70 | "browser" : true, // Web Browser (window, document, etc) 71 | "couch" : false, // CouchDB 72 | "devel" : true, // Development/debugging (alert, confirm, etc) 73 | "dojo" : false, // Dojo Toolkit 74 | "jquery" : false, // jQuery 75 | "mootools" : false, // MooTools 76 | "node" : true, // Node.js 77 | "nonstandard" : false, // Widely adopted globals (escape, unescape, etc) 78 | "prototypejs" : false, // Prototype and Scriptaculous 79 | "rhino" : false, // Rhino 80 | "worker" : false, // Web Workers 81 | "wsh" : false, // Windows Scripting Host 82 | "yui" : false, // Yahoo User Interface 83 | //"meteor" : false, // Meteor.js 84 | 85 | // Legacy 86 | "nomen" : false, // true: Prohibit dangling `_` in variables 87 | "onevar" : false, // true: Allow only one `var` statement per function 88 | "passfail" : false, // true: Stop on first error 89 | "white" : false, // true: Check against strict whitespace and indentation rules 90 | 91 | // Custom globals, from http://docs.meteor.com, in the order they appear there 92 | "globals" : { 93 | "Meteor": false, 94 | "DDP": false, 95 | "Mongo": false, //Meteor.Collection renamed to Mongo.Collection 96 | "Session": false, 97 | "Accounts": false, 98 | "Template": false, 99 | "Blaze": false, //UI is being renamed Blaze 100 | "UI": false, 101 | "Match": false, 102 | "check": false, 103 | "Tracker": false, //Deps renamed to Tracker 104 | "Deps": false, 105 | "ReactiveVar": false, 106 | "EJSON": false, 107 | "HTTP": false, 108 | "Email": false, 109 | "Assets": false, 110 | "Handlebars": false, // https://github.com/meteor/meteor/wiki/Handlebars 111 | "Package": false, 112 | "App": false, //mobile-config.js 113 | 114 | // Meteor internals 115 | "DDPServer": false, 116 | "global": false, 117 | "Log": false, 118 | "MongoInternals": false, 119 | "process": false, 120 | "WebApp": false, 121 | "WebAppInternals": false, 122 | 123 | // globals useful when creating Meteor packages 124 | "Npm": false, 125 | "Tinytest": false, 126 | 127 | // common Meteor packages 128 | "Random": false, 129 | "_": false, // Underscore.js 130 | "$": false, // jQuery 131 | "Router": false, 132 | "cc": false 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /.latexmkrc: -------------------------------------------------------------------------------- 1 | $pdflatex = 'xelatex %O %S' 2 | -------------------------------------------------------------------------------- /.luacheckrc: -------------------------------------------------------------------------------- 1 | ignore = {"113", "111", "212"} 2 | -------------------------------------------------------------------------------- /.netrwhist: -------------------------------------------------------------------------------- 1 | let g:netrw_dirhistmax =10 2 | let g:netrw_dirhistcnt =3 3 | let g:netrw_dirhist_3='/Users/lionqu/emacs-china.org' 4 | let g:netrw_dirhist_2='/Users/lionqu/.doom.d.bak' 5 | let g:netrw_dirhist_1='/Users/lionqu/Github/donate' 6 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://registry.npmmirror.com 2 | -------------------------------------------------------------------------------- /.pentadactylrc: -------------------------------------------------------------------------------- 1 | " Use home row letters for hints instead of numbers 2 | "http://nakkaya.com/2014/01/26/pentadactyl-configuration/ 3 | 4 | set hintkeys=asdflkj 5 | hi -a Hint font-size: 9pt !important; 6 | 7 | " disable smooth scroll 8 | set scrollsteps=1 9 | set scrolltime=0 10 | 11 | " editor 12 | set editor="/Applications/Emacs.app/Contents/MacOS/bin/emacsclient" 13 | 14 | set guioptions=bCrs 15 | au Fullscreen .* :set guioptions+=s 16 | " faster scrolling 17 | " map -b j 8j 18 | " map -b k 8k 19 | " map -b h 8h 20 | " map -b l 8l 21 | 22 | set hlfind 23 | 24 | set findcase=smart 25 | 26 | set incfind 27 | 28 | map -b zi ZI 29 | map -b zo ZO 30 | 31 | command read-later -description "Execute emacsclient" -javascript < cog :set guioptions+=mBT 40 | map -builtin coG :set guioptions-=mBT 41 | map -builtin cob :toolbartoggle Bookmarks Toolbar 42 | map -builtin coT :set showtabline=always 43 | map -builtin cot :set showtabline=never 44 | 45 | " I tend to tap the 'd' key on my keyboard on accident 46 | nmap -builtin d 47 | 48 | " Never wanted to go back when I hit delete, now it won't 49 | nmap -builtin -------------------------------------------------------------------------------- /.pylintrc: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | 3 | # Specify a configuration file. 4 | #rcfile= 5 | 6 | # Python code to execute, usually for sys.path manipulation such as 7 | # pygtk.require(). 8 | #init-hook= 9 | 10 | # Profiled execution. 11 | profile=no 12 | 13 | # Add files or directories to the blacklist. They should be base names, not 14 | # paths. 15 | ignore=CVS 16 | 17 | # Pickle collected data for later comparisons. 18 | persistent=yes 19 | 20 | # List of plugins (as comma separated values of python modules names) to load, 21 | # usually to register additional checkers. 22 | load-plugins= 23 | 24 | 25 | [MESSAGES CONTROL] 26 | 27 | # Enable the message, report, category or checker with the given id(s). You can 28 | # either give multiple identifier separated by comma (,) or put this option 29 | # multiple time. See also the "--disable" option for examples. 30 | #enable= 31 | 32 | # Disable the message, report, category or checker with the given id(s). You 33 | # can either give multiple identifiers separated by comma (,) or put this 34 | # option multiple times (only on the command line, not in the configuration 35 | # file where it should appear only once).You can also use "--disable=all" to 36 | # disable everything first and then reenable specific checks. For example, if 37 | # you want to run only the similarities checker, you can use "--disable=all 38 | # --enable=similarities". If you want to run only the classes checker, but have 39 | # no Warning level messages displayed, use"--disable=all --enable=classes 40 | # --disable=W" 41 | disable= C0326, W0621, C0111, C0103, W0702, W0703, C0321, W0511, W0102, R0913, 42 | R0914, R0915, R0912, R0902, R0903, C0303, C0302, C0325, W0401, W0603, 43 | C0301, W1401 44 | 45 | 46 | [REPORTS] 47 | 48 | # Set the output format. Available formats are text, parseable, colorized, msvs 49 | # (visual studio) and html. You can also give a reporter class, eg 50 | # mypackage.mymodule.MyReporterClass. 51 | output-format=text 52 | 53 | # Put messages in a separate file for each module / package specified on the 54 | # command line instead of printing them on stdout. Reports (if any) will be 55 | # written in a file name "pylint_global.[txt|html]". 56 | files-output=no 57 | 58 | # Tells whether to display a full report or only the messages 59 | reports=yes 60 | 61 | # Python expression which should return a note less than 10 (10 is the highest 62 | # note). You have access to the variables errors warning, statement which 63 | # respectively contain the number of errors / warnings messages and the total 64 | # number of statements analyzed. This is used by the global evaluation report 65 | # (RP0004). 66 | evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) 67 | 68 | # Add a comment according to your evaluation note. This is used by the global 69 | # evaluation report (RP0004). 70 | comment=no 71 | 72 | # Template used to display messages. This is a python new-style format string 73 | # used to format the message information. See doc for all details 74 | #msg-template= 75 | 76 | 77 | [FORMAT] 78 | 79 | # Maximum number of characters on a single line. 80 | max-line-length=80 81 | 82 | # Regexp for a line that is allowed to be longer than the limit. 83 | ignore-long-lines=^\s*(# )??$ 84 | 85 | # Allow the body of an if to be on the same line as the test if there is no 86 | # else. 87 | single-line-if-stmt=no 88 | 89 | # List of optional constructs for which whitespace checking is disabled 90 | no-space-check=trailing-comma,dict-separator 91 | 92 | # Maximum number of lines in a module 93 | max-module-lines=1000 94 | 95 | # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 96 | # tab). 97 | indent-string=' ' 98 | 99 | 100 | [BASIC] 101 | 102 | # Required attributes for module, separated by a comma 103 | required-attributes= 104 | 105 | # List of builtins function names that should not be used, separated by a comma 106 | bad-functions=map,filter,apply,input 107 | 108 | # Regular expression which should only match correct module names 109 | module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ 110 | 111 | # Regular expression which should only match correct module level names 112 | const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ 113 | 114 | # Regular expression which should only match correct class names 115 | class-rgx=[A-Z_][a-zA-Z0-9]+$ 116 | 117 | # Regular expression which should only match correct function names 118 | function-rgx=[a-z_][a-z0-9_]{2,30}$ 119 | 120 | # Regular expression which should only match correct method names 121 | method-rgx=[a-z_][a-z0-9_]{2,30}$ 122 | 123 | # Regular expression which should only match correct instance attribute names 124 | attr-rgx=[a-z_][a-z0-9_]{2,30}$ 125 | 126 | # Regular expression which should only match correct argument names 127 | argument-rgx=[a-z_][a-z0-9_]{2,30}$ 128 | 129 | # Regular expression which should only match correct variable names 130 | variable-rgx=[a-z_][a-z0-9_]{2,30}$ 131 | 132 | # Regular expression which should only match correct attribute names in class 133 | # bodies 134 | class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ 135 | 136 | # Regular expression which should only match correct list comprehension / 137 | # generator expression variable names 138 | inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ 139 | 140 | # Good variable names which should always be accepted, separated by a comma 141 | good-names=i,j,k,ex,Run,_ 142 | 143 | # Bad variable names which should always be refused, separated by a comma 144 | bad-names=foo,bar,baz,toto,tutu,tata 145 | 146 | # Regular expression which should only match function or class names that do 147 | # not require a docstring. 148 | no-docstring-rgx=__.*__ 149 | 150 | # Minimum line length for functions/classes that require docstrings, shorter 151 | # ones are exempt. 152 | docstring-min-length=-1 153 | 154 | 155 | [SIMILARITIES] 156 | 157 | # Minimum lines number of a similarity. 158 | min-similarity-lines=4 159 | 160 | # Ignore comments when computing similarities. 161 | ignore-comments=yes 162 | 163 | # Ignore docstrings when computing similarities. 164 | ignore-docstrings=yes 165 | 166 | # Ignore imports when computing similarities. 167 | ignore-imports=no 168 | 169 | 170 | [TYPECHECK] 171 | 172 | # Tells whether missing members accessed in mixin class should be ignored. A 173 | # mixin class is detected if its name ends with "mixin" (case insensitive). 174 | ignore-mixin-members=yes 175 | 176 | # List of classes names for which member attributes should not be checked 177 | # (useful for classes with attributes dynamically set). 178 | ignored-classes=SQLObject 179 | 180 | # When zope mode is activated, add a predefined set of Zope acquired attributes 181 | # to generated-members. 182 | zope=no 183 | 184 | # List of members which are set dynamically and missed by pylint inference 185 | # system, and so shouldn't trigger E0201 when accessed. Python regular 186 | # expressions are accepted. 187 | generated-members=REQUEST,acl_users,aq_parent 188 | 189 | 190 | [MISCELLANEOUS] 191 | 192 | # List of note tags to take in consideration, separated by a comma. 193 | notes=FIXME,XXX,TODO 194 | 195 | 196 | [VARIABLES] 197 | 198 | # Tells whether we should check for unused import in __init__ files. 199 | init-import=no 200 | 201 | # A regular expression matching the beginning of the name of dummy variables 202 | # (i.e. not used). 203 | dummy-variables-rgx=_$|dummy 204 | 205 | # List of additional names supposed to be defined in builtins. Remember that 206 | # you should avoid to define new builtins when possible. 207 | additional-builtins= 208 | 209 | 210 | [DESIGN] 211 | 212 | # Maximum number of arguments for function / method 213 | max-args=5 214 | 215 | # Argument names that match this expression will be ignored. Default to name 216 | # with leading underscore 217 | ignored-argument-names=_.* 218 | 219 | # Maximum number of locals for function / method body 220 | max-locals=15 221 | 222 | # Maximum number of return / yield for function / method body 223 | max-returns=6 224 | 225 | # Maximum number of branch for function / method body 226 | max-branches=12 227 | 228 | # Maximum number of statements in function / method body 229 | max-statements=50 230 | 231 | # Maximum number of parents for a class (see R0901). 232 | max-parents=7 233 | 234 | # Maximum number of attributes for a class (see R0902). 235 | max-attributes=7 236 | 237 | # Minimum number of public methods for a class (see R0903). 238 | min-public-methods=2 239 | 240 | # Maximum number of public methods for a class (see R0904). 241 | max-public-methods=20 242 | 243 | 244 | [IMPORTS] 245 | 246 | # Deprecated modules which should not be used, separated by a comma 247 | deprecated-modules=regsub,TERMIOS,Bastion,rexec 248 | 249 | # Create a graph of every (i.e. internal and external) dependencies in the 250 | # given file (report RP0402 must not be disabled) 251 | import-graph= 252 | 253 | # Create a graph of external dependencies in the given file (report RP0402 must 254 | # not be disabled) 255 | ext-import-graph= 256 | 257 | # Create a graph of internal dependencies in the given file (report RP0402 must 258 | # not be disabled) 259 | int-import-graph= 260 | 261 | 262 | [CLASSES] 263 | 264 | # List of interface methods to ignore, separated by a comma. This is used for 265 | # instance to not check methods defines in Zope's Interface base class. 266 | ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by 267 | 268 | # List of method names used to declare (i.e. assign) instance attributes. 269 | defining-attr-methods=__init__,__new__,setUp 270 | 271 | # List of valid names for the first argument in a class method. 272 | valid-classmethod-first-arg=cls 273 | 274 | # List of valid names for the first argument in a metaclass class method. 275 | valid-metaclass-classmethod-first-arg=mcs 276 | 277 | 278 | [EXCEPTIONS] 279 | 280 | # Exceptions that will emit a warning when being caught. Defaults to 281 | # "Exception" 282 | overgeneral-exceptions=Exception 283 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | ruby-2.7.1 2 | -------------------------------------------------------------------------------- /.tern-project: -------------------------------------------------------------------------------- 1 | { 2 | "libs": [ 3 | "browser", 4 | "jquery" 5 | ], 6 | "loadEagerly": [ 7 | "editor-framework/core/*.js", 8 | "editor-framework/share/*.js", 9 | "editor-framework/page/**/*.js", 10 | "engine-framework/src/**/*.js", 11 | "asset-db/**/*.js" 12 | ], 13 | "plugins": { 14 | "requirejs": { 15 | "baseURL": "./", 16 | "paths": {} 17 | }, 18 | "node" : {} 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /.tmux-mac: -------------------------------------------------------------------------------- 1 | set-option -g default-command "reattach-to-user-namespace -l zsh" 2 | -------------------------------------------------------------------------------- /.tmux.conf: -------------------------------------------------------------------------------- 1 | # List of plugins 2 | set -g @plugin 'tmux-plugins/tpm' 3 | set -g @plugin 'tmux-plugins/tmux-sensible' 4 | 5 | set -g @plugin 'tmux-plugins/tmux-resurrect' 6 | set -g @plugin 'tmux-plugins/tmux-continuum' 7 | 8 | # tmux-resurrect 9 | set -g @resurrect-save-bash-history 'on' 10 | set -g @resurrect-capture-pane-contents 'on' 11 | set -g @resurrect-strategy-vim 'session' 12 | 13 | # tmux-continuum 14 | set -g status-right 'Continuum status: #{continuum_status}' 15 | set -g @continuum-restore 'on' # 启用自动恢复 16 | set -g @continuum-save-interval '480' 17 | # set -g @continuum-boot 'on' 18 | # set -g @continuum-boot-options 'iterm,fullscreen' 19 | 20 | set-option -g default-terminal screen-256color 21 | setw -g mode-key vi 22 | bind q confirm kill-window 23 | 24 | #-- bindkeys --# 25 | unbind '"' 26 | bind - splitw -v -c '#{pane_current_path}' 27 | unbind % 28 | bind | splitw -h -c '#{pane_current_path}' 29 | 30 | # 输出日志到桌面 31 | bind P pipe-pane -o "cat >>~/Desktop/#W.log" \; display "Toggled logging to ~/Desktop/#W.log" 32 | 33 | # force a reload of the config file 34 | unbind r 35 | bind r source-file ~/.tmux.conf 36 | 37 | #move around panes in vim(only in tmux 1.6) 38 | bind j select-pane -D 39 | bind k select-pane -U 40 | bind l select-pane -R 41 | bind h select-pane -L 42 | 43 | bind -r ^k resizep -U 10 # 绑定Ctrl+k为往↑调整面板边缘10个单元格 44 | bind -r ^j resizep -D 10 # 绑定Ctrl+j为往↓调整面板边缘10个单元格 45 | bind -r ^h resizep -L 10 # 绑定Ctrl+h为往←调整面板边缘10个单元格 46 | bind -r ^l resizep -R 10 # 绑定Ctrl+l为往→调整面板边缘10个单元格 47 | 48 | if-shell "uname | grep -q Darwin" "source-file ~/.tmux-mac" 49 | 50 | bind b split-window "tmux lsw | percol --initial-index $(tmux lsw | awk '/active.$/ {print NR-1}') | cut -d':' -f 1 | tr -d '\n' | xargs -0 tmux select-window -t" 51 | 52 | set -s escape-time 0 53 | 54 | set-option -g mouse on 55 | 56 | # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) 57 | run '~/.tmux/plugins/tpm/tpm' -------------------------------------------------------------------------------- /.vrapperrc: -------------------------------------------------------------------------------- 1 | set autoindent 2 | set ignorecase 3 | set smartcase 4 | nnoremap n nzz 5 | nnoremap N Nzz 6 | nnoremap * *zz 7 | inoremap I 8 | inoremap A 9 | inoremap 10 | inoremap 11 | " inoremap lxi 12 | inoremap 13 | inoremap 14 | set incsearch 15 | set hlsearch 16 | -------------------------------------------------------------------------------- /.xvimrc: -------------------------------------------------------------------------------- 1 | set relativenumber 2 | "Jump between .h/.cpp 3 | nnoremap ,f :xccmd jumpToNextCounterpart 4 | inoremap ,f :xccmd jumpToNextCounterpart 5 | 6 | "Open quick search : CMD+Shift+o 7 | map ,p :xccmd openQuickly 8 | inoremap 9 | inoremap 10 | inoremap 11 | inoremp 12 | 13 | inoremap $ 14 | 15 | "fold 16 | map ,zf :xccmd fold 17 | map ,zu :xccmd unfold 18 | 19 | "search 20 | set ignorecase 21 | 22 | 23 | " window movement 24 | nnoremap j 25 | nnoremap h 26 | nnoremap k 27 | nnoremap l 28 | 29 | " windows split 30 | nnoremap ,n n 31 | nnoremap ,q q 32 | nnoremap ,s s 33 | nnoremap ,v v 34 | 35 | " issue command 36 | map ,fi :xccmd jumpToPreviousIssue 37 | map ,bi :xccmd jumpToNextIssue 38 | 39 | " tab navigation 40 | map , :xccmd selectNextTab 41 | -------------------------------------------------------------------------------- /.ycm_extra_conf.py: -------------------------------------------------------------------------------- 1 | # Generated by YCM Generator at 2015-10-15 14:23:18.300137 2 | 3 | # This file is NOT licensed under the GPLv3, which is the license for the rest 4 | # of YouCompleteMe. 5 | # 6 | # Here's the license text for this file: 7 | # 8 | # This is free and unencumbered software released into the public domain. 9 | # 10 | # Anyone is free to copy, modify, publish, use, compile, sell, or 11 | # distribute this software, either in source code form or as a compiled 12 | # binary, for any purpose, commercial or non-commercial, and by any 13 | # means. 14 | # 15 | # In jurisdictions that recognize copyright laws, the author or authors 16 | # of this software dedicate any and all copyright interest in the 17 | # software to the public domain. We make this dedication for the benefit 18 | # of the public at large and to the detriment of our heirs and 19 | # successors. We intend this dedication to be an overt act of 20 | # relinquishment in perpetuity of all present and future rights to this 21 | # software under copyright law. 22 | # 23 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 26 | # IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 27 | # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 28 | # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 29 | # OTHER DEALINGS IN THE SOFTWARE. 30 | # 31 | # For more information, please refer to 32 | 33 | import os 34 | import ycm_core 35 | 36 | flags = [ 37 | '-x', 38 | 'c++', 39 | '-DCC_ENABLE_BOX2D_INTEGRATION=0', 40 | '-DCC_ENABLE_BULLET_INTEGRATION=1', 41 | '-DCC_ENABLE_CHIPMUNK_INTEGRATION=1', 42 | '-DCC_TARGET_OS_MAC', 43 | '-DCC_USE_NAVMESH=1', 44 | '-DCC_USE_PHYSICS=1', 45 | '-DCC_USE_WEBP=1', 46 | '-DCOCOS2D_DEBUG=1', 47 | '-DCP_USE_CGPOINTS=0', 48 | '-DUSE_FILE32API', 49 | '-D_DARWIN_C_SOURCE', 50 | '-D_POSIX_C_SOURCE=200809L', 51 | '-I/System/Library/Frameworks', 52 | '-I/Users/guanghui/cocos2d-x', 53 | '-I/Users/guanghui/cocos2d-x/coco-DCC_ENABLE_BOX2D_INTEGRATION=0', 54 | '-I/Users/guanghui/cocos2d-x/cocos', 55 | '-I/Users/guanghui/cocos2d-x/cocos/../../extensions', 56 | '-I/Users/guanghui/cocos2d-x/cocos/../external/ConvertUTF', 57 | '-I/Users/guanghui/cocos2d-x/cocos/../external/clipper', 58 | '-I/Users/guanghui/cocos2d-x/cocos/../external/edtaa3func', 59 | '-I/Users/guanghui/cocos2d-x/cocos/../external/poly2tri', 60 | '-I/Users/guanghui/cocos2d-x/cocos/../external/poly2tri/common', 61 | '-I/Users/guanghui/cocos2d-x/cocos/../external/poly2tri/sweep', 62 | '-I/Users/guanghui/cocos2d-x/cocos/../external/xxtea', 63 | '-I/Users/guanghui/cocos2d-x/cocos/2d', 64 | '-I/Users/guanghui/cocos2d-x/cocos/3d', 65 | '-I/Users/guanghui/cocos2d-x/cocos/audio/incl', 66 | '-I/Users/guanghui/cocos2d-x/cocos/audio/incl-DCC_ENABLE_BOX2D_INTEGRATION=0', 67 | '-I/Users/guanghui/cocos2d-x/cocos/audio/inclUsers/guanghui/cocos2d-x/extensions/Particle3D/PU/CCPUVelocityMatchingAffectorTranslator.cpp', 68 | '-I/Users/guanghui/cocos2d-x/cocos/audio/inclocos2d-x/extensions/Particle3D/PU/CCPUForceFieldAffector.cpp', 69 | '-I/Users/guanghui/cocos2d-x/cocos/audio/incls/platform/desktop/CCGLViewImpl-desktop.cpp', 70 | '-I/Users/guanghui/cocos2d-x/cocos/audio/include', 71 | '-I/Users/guanghui/cocos2d-x/cocos/base', 72 | '-I/Users/guanghui/cocos2d-x/cocos/editor-support', 73 | '-I/Users/guanghui/cocos2d-x/cocos/editor-support/cocosbuilder', 74 | '-I/Users/guanghui/cocos2d-x/cocos/editor-support/cocostudio', 75 | '-I/Users/guanghui/cocos2d-x/cocos/editor-support/cocostudio/ActionTimeline', 76 | '-I/Users/guanghui/cocos2d-x/cocos/editor-support/spine', 77 | '-I/Users/guanghui/cocos2d-x/cocos/navmesh', 78 | '-I/Users/guanghui/cocos2d-x/cocos/physics3d', 79 | '-I/Users/guanghui/cocos2d-x/cocos/platform', 80 | '-I/Users/guanghui/cocos2d-x/cocos/platform/desktop', 81 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/../../-DCC_ENABLE_BOX2D_INTEGRATION=0', 82 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/../../../-DCC_ENABLE_BOX2D_INTEGRATION=0', 83 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/../../../../external', 84 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/../../../cocos', 85 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/../../../cocos/2d', 86 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/../../../cocos/3d', 87 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/../../../cocos/audio/include', 88 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/../../../cocos/base', 89 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/../../../cocos/editor-support', 90 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/../../../cocos/editor-support/cocosbuilder', 91 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/../../../cocos/editor-support/cocostudio', 92 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/../../../cocos/editor-support/spine', 93 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/../../../cocos/navmesh', 94 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/../../../cocos/network', 95 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/../../../cocos/physics3d', 96 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/../../../cocos/platform', 97 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/../../../cocos/storage', 98 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/../../../cocos/ui', 99 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/../../../extensions', 100 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/../../../external', 101 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/../../../external/chipmunk/include/chipmunk', 102 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/../../../external/spidermonkey/include/mac', 103 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/../../external/spidermonkey/include/mac', 104 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/auto', 105 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/manual', 106 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/manual/cocostudio', 107 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/manual/navmesh', 108 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/js-bindings/manual/spine', 109 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/lua-bindings/auto', 110 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/lua-bindings/manual', 111 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/lua-bindings/manual/cocos2d', 112 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/lua-bindings/manual/cocostudio', 113 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/lua-bindings/manual/extension', 114 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/lua-bindings/manual/navmesh', 115 | '-I/Users/guanghui/cocos2d-x/cocos/scripting/lua-bindings/manual/ui', 116 | '-I/Users/guanghui/cocos2d-x/cocos/ui', 117 | '-I/Users/guanghui/cocos2d-x/deprecated', 118 | '-I/Users/guanghui/cocos2d-x/extensions', 119 | '-I/Users/guanghui/cocos2d-x/external', 120 | '-I/Users/guanghui/cocos2d-x/external/bullet', 121 | '-I/Users/guanghui/cocos2d-x/external/bullet/..', 122 | '-I/Users/guanghui/cocos2d-x/external/chipmunk/include/chipmunk', 123 | '-I/Users/guanghui/cocos2d-x/external/curl/include/mac', 124 | '-I/Users/guanghui/cocos2d-x/external/flatbuffers', 125 | '-I/Users/guanghui/cocos2d-x/external/freetype2/include/mac/freetype2', 126 | '-I/Users/guanghui/cocos2d-x/external/glfw3/include/mac', 127 | '-I/Users/guanghui/cocos2d-x/external/jpeg/include/mac', 128 | '-I/Users/guanghui/cocos2d-x/external/lua', 129 | '-I/Users/guanghui/cocos2d-x/external/lua/lua', 130 | '-I/Users/guanghui/cocos2d-x/external/lua/tolua', 131 | '-I/Users/guanghui/cocos2d-x/external/png/include/mac', 132 | '-I/Users/guanghui/cocos2d-x/external/recast', 133 | '-I/Users/guanghui/cocos2d-x/external/recast/..', 134 | '-I/Users/guanghui/cocos2d-x/external/tiff/include/mac', 135 | '-I/Users/guanghui/cocos2d-x/external/tinyxml2', 136 | '-I/Users/guanghui/cocos2d-x/external/unzip', 137 | '-I/Users/guanghui/cocos2d-x/external/webp/include/mac', 138 | '-I/Users/guanghui/cocos2d-x/external/websockets/include/mac', 139 | '-I/Users/guanghui/cocos2d-x/external/xxhash', 140 | '-I/Users/guanghui/cocos2d-x/external/xxtea', 141 | '-I/Users/guanghui/cocos2d-x/external/zlib/include', 142 | '-I/Users/guanghui/cocos2d-x/tests/cpp-tests/Classes', 143 | '-I/Users/guanghui/cocos2d-x/tests/js-tests/project/../../../cocos/audio/include', 144 | '-I/Users/guanghui/cocos2d-x/tests/js-tests/project/../../../cocos/base', 145 | '-I/Users/guanghui/cocos2d-x/tests/js-tests/project/../../../cocos/editor-support', 146 | '-I/Users/guanghui/cocos2d-x/tests/js-tests/project/../../../cocos/scripting/js-bindings/auto', 147 | '-I/Users/guanghui/cocos2d-x/tests/js-tests/project/../../../cocos/scripting/js-bindings/manual', 148 | '-I/Users/guanghui/cocos2d-x/tests/js-tests/project/../../../external/chipmunk/include/chipmunk', 149 | '-I/Users/guanghui/cocos2d-x/tests/js-tests/project/../../../external/spidermonkey/include/mac', 150 | '-I/Users/guanghui/cocos2d-x/tests/js-tests/project/Classes', 151 | '-I/Users/guanghui/cocos2d-x/tests/lua-empty-test/project/../../../cocos/scripting/lua-bindings/manual', 152 | '-I/Users/guanghui/cocos2d-x/tests/lua-empty-test/project/../../../external/lua/lua', 153 | '-I/Users/guanghui/cocos2d-x/tests/lua-empty-test/project/../../../external/lua/tolua', 154 | '-I/Users/guanghui/cocos2d-x/tests/lua-empty-test/project/Classes', 155 | '-I/Users/guanghui/cocos2d-x/tests/lua-tests/project/../../../cocos/scripting/lua-bindings/auto', 156 | '-I/Users/guanghui/cocos2d-x/tests/lua-tests/project/../../../cocos/scripting/lua-bindings/manual', 157 | '-I/Users/guanghui/cocos2d-x/tests/lua-tests/project/../../../external/lua-DCC_ENABLE_BOX2D_INTEGRATION=0', 158 | '-I/Users/guanghui/cocos2d-x/tests/lua-tests/project/../../../external/lua/lua', 159 | '-I/Users/guanghui/cocos2d-x/tests/lua-tests/project/../../../external/lua/tolua', 160 | '-I/Users/guanghui/cocos2d-x/tests/lua-tests/project/Classes', 161 | '-Wall', 162 | '-Wextra', 163 | '-Wno-deprecated-declarations', 164 | '-Wno-reorder', 165 | '-std=c++11', 166 | ] 167 | 168 | 169 | # Set this to the absolute path to the folder (NOT the file!) containing the 170 | # compile_commands.json file to use that instead of 'flags'. See here for 171 | # more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html 172 | # 173 | # You can get CMake to generate this file for you by adding: 174 | # set( CMAKE_EXPORT_COMPILE_COMMANDS 1 ) 175 | # to your CMakeLists.txt file. 176 | # 177 | # Most projects will NOT need to set this to anything; you can just change the 178 | # 'flags' list of compilation flags. Notice that YCM itself uses that approach. 179 | compilation_database_folder = '' 180 | 181 | if os.path.exists( compilation_database_folder ): 182 | database = ycm_core.CompilationDatabase( compilation_database_folder ) 183 | else: 184 | database = None 185 | 186 | SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ] 187 | 188 | def DirectoryOfThisScript(): 189 | return os.path.dirname( os.path.abspath( __file__ ) ) 190 | 191 | 192 | def MakeRelativePathsInFlagsAbsolute( flags, working_directory ): 193 | if not working_directory: 194 | return list( flags ) 195 | new_flags = [] 196 | make_next_absolute = False 197 | path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ] 198 | for flag in flags: 199 | new_flag = flag 200 | 201 | if make_next_absolute: 202 | make_next_absolute = False 203 | if not flag.startswith( '/' ): 204 | new_flag = os.path.join( working_directory, flag ) 205 | 206 | for path_flag in path_flags: 207 | if flag == path_flag: 208 | make_next_absolute = True 209 | break 210 | 211 | if flag.startswith( path_flag ): 212 | path = flag[ len( path_flag ): ] 213 | new_flag = path_flag + os.path.join( working_directory, path ) 214 | break 215 | 216 | if new_flag: 217 | new_flags.append( new_flag ) 218 | return new_flags 219 | 220 | 221 | def IsHeaderFile( filename ): 222 | extension = os.path.splitext( filename )[ 1 ] 223 | return extension in [ '.h', '.hxx', '.hpp', '.hh' ] 224 | 225 | 226 | def GetCompilationInfoForFile( filename ): 227 | # The compilation_commands.json file generated by CMake does not have entries 228 | # for header files. So we do our best by asking the db for flags for a 229 | # corresponding source file, if any. If one exists, the flags for that file 230 | # should be good enough. 231 | if IsHeaderFile( filename ): 232 | basename = os.path.splitext( filename )[ 0 ] 233 | for extension in SOURCE_EXTENSIONS: 234 | replacement_file = basename + extension 235 | if os.path.exists( replacement_file ): 236 | compilation_info = database.GetCompilationInfoForFile( 237 | replacement_file ) 238 | if compilation_info.compiler_flags_: 239 | return compilation_info 240 | return None 241 | return database.GetCompilationInfoForFile( filename ) 242 | 243 | 244 | def FlagsForFile( filename, **kwargs ): 245 | if database: 246 | # Bear in mind that compilation_info.compiler_flags_ does NOT return a 247 | # python list, but a "list-like" StringVec object 248 | compilation_info = GetCompilationInfoForFile( filename ) 249 | if not compilation_info: 250 | return None 251 | 252 | final_flags = MakeRelativePathsInFlagsAbsolute( 253 | compilation_info.compiler_flags_, 254 | compilation_info.compiler_working_dir_ ) 255 | 256 | else: 257 | relative_to = DirectoryOfThisScript() 258 | final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to ) 259 | 260 | return { 261 | 'flags': final_flags, 262 | 'do_cache': True 263 | } 264 | 265 | -------------------------------------------------------------------------------- /.zshenv: -------------------------------------------------------------------------------- 1 | # Path to your oh-my-zsh configuration. 2 | export LANG='en_US.UTF-8' 3 | export LC_ALL="en_US.UTF-8" 4 | 5 | export PATH="/usr/local/sbin":$PATH 6 | export PATH="${HOME}/.pyenv/shims:$HOME/.emacs.d/bin:$PATH" 7 | export PATH="$HOME/Library/Python/2.7/bin:$PATH" 8 | export PATH="/Applications/Emacs.app/Contents/MacOS/bin/:$PATH:/opt/homebrew/bin:/Users/lionqu/Library/Python/3.8/bin:~/.cargo/bin" 9 | 10 | export PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:${PATH}" 11 | export PATH="/Users/lionqu/.nvm/versions/node/v20.9.0/bin/":$PATH 12 | export PATH="/Users/lionqu/.asdf/shims/":$PATH 13 | export MANPATH="/opt/homebrew/opt/coreutils/libexec/gnuman:${MANPATH}" 14 | -------------------------------------------------------------------------------- /.zshrc: -------------------------------------------------------------------------------- 1 | # Path to your oh-my-zsh configuration. 2 | export LANG='en_US.UTF-8' 3 | export LC_ALL="en_US.UTF-8" 4 | 5 | #https://joshldavis.com/2014/07/26/oh-my-zsh-is-a-disease-antigen-is-the-vaccine/ 6 | # 7 | # OS Detection 8 | # 9 | 10 | UNAME=`uname` 11 | 12 | eval "$(/opt/homebrew/bin/brew shellenv)" 13 | # Fallback info 14 | CURRENT_OS='Linux' 15 | DISTRO='' 16 | 17 | if [[ $UNAME == 'Darwin' ]]; then 18 | CURRENT_OS='OS X' 19 | else 20 | # Must be Linux, determine distro 21 | if [[ -f /etc/redhat-release ]]; then 22 | # CentOS or Redhat? 23 | if grep -q "CentOS" /etc/redhat-release; then 24 | DISTRO='CentOS' 25 | else 26 | DISTRO='RHEL' 27 | fi 28 | fi 29 | fi 30 | 31 | source ~/.vim/antigen/antigen.zsh 32 | # call antigen update on your terminal and it will update the oh-my-zsh repository 33 | # antigen bundle robbyrussell/oh-my-zsh lib/ 34 | antigen use oh-my-zsh 35 | 36 | # Bundles from the default repo (robbyrussell's oh-my-zsh). 37 | antigen bundle git 38 | #antigen bundle osx 39 | antigen bundle ruby 40 | antigen bundle pip 41 | antigen bundle lein 42 | antigen bundle command-not-found 43 | antigen bundle gulp 44 | antigen bundle node 45 | #antigen bundle npm 46 | antigen bundle nvm 47 | antigen bundle bower 48 | 49 | # Syntax highlighting bundle. 50 | # don't enable this theme, it doesn't work well with ansi-term in emacs 51 | # antigen bundle zsh-users/zsh-syntax-highlighting 52 | 53 | # Load the theme. 54 | antigen theme robbyrussell 55 | # THEME=candy 56 | # antigen list | grep $THEME; if [ $? -ne 0 ]; then antigen theme $THEME; fi 57 | 58 | 59 | # Tell antigen that you're done. 60 | antigen apply 61 | 62 | # chruby 63 | # source /usr/local/opt/chruby/share/chruby/chruby.sh 64 | # source /usr/local/opt/chruby/share/chruby/auto.sh 65 | 66 | # zsh 67 | alias vim="stty stop '' -ixoff ; vim" 68 | # `Frozing' tty, so after any command terminal settings will be restored 69 | ttyctl -f 70 | 71 | # bash 72 | # No ttyctl, so we need to save and then restore terminal settings 73 | # vim() 74 | # { 75 | # local STTYOPTS="$(stty --save)" 76 | # stty stop '' -ixoff 77 | # command vim "$@" 78 | # stty "$STTYOPTS" 79 | # } 80 | 81 | alias rake="noglob rake" 82 | 83 | # [[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && . ~/.autojump/etc/profile.d/autojump.sh 84 | 85 | alias e='emacsclient -t' 86 | alias ec='emacsclient -c' 87 | 88 | alias tmuxd="tmux attach -d" 89 | alias gp="gulp" 90 | 91 | 92 | 93 | eval "$(fasd --init auto)" 94 | 95 | alias a='fasd -a' # any 96 | alias s='fasd -si' # show / search / select 97 | alias d='fasd -d' # directory 98 | alias f='fasd -f' # file 99 | alias sd='fasd -sid' # interactive directory selection 100 | alias sf='fasd -sif' # interactive file selection 101 | alias z='fasd_cd -d' # cd, same functionality as j in autojump 102 | alias zz='fasd_cd -d -i' # cd with interactive selection 103 | 104 | 105 | alias v='f -e vim' # quick opening files with vim 106 | alias m='f -e mplayer' # quick opening files with mplayer 107 | alias o='a -e open' # quick opening files with xdg-open 108 | alias e='f -e emacsclient -t' # quick opening files with xdg-open 109 | 110 | 111 | # added by travis gem 112 | [ -f /Users/guanghui/.travis/travis.sh ] && source /Users/guanghui/.travis/travis.sh 113 | 114 | export PATH="/usr/local/sbin":$PATH 115 | export PATH="${HOME}/.pyenv/shims:$HOME/.emacs.d/bin:$PATH" 116 | export PATH="$HOME/Library/Python/2.7/bin:$PATH" 117 | export PATH="/Applications/Emacs.app/Contents/MacOS/bin/:$PATH:/opt/homebrew/bin:/Users/lionqu/Library/Python/3.8/bin" 118 | 119 | 120 | export NVM_DIR=~/.nvm 121 | source $(brew --prefix nvm)/nvm.sh 122 | nvm use 20.9.0 123 | 124 | 125 | 126 | function ppgrep() { 127 | 128 | if [[ $1 == "" ]]; then 129 | PERCOL=percol 130 | else 131 | PERCOL="percol --query $1" 132 | fi 133 | ps aux | eval $PERCOL | awk '{ print $2 }' 134 | } 135 | 136 | function ppkill() { 137 | if [[ $1 =~ "^-" ]]; then 138 | QUERY="" # options only 139 | else 140 | QUERY=$1 # with a query 141 | [[ $# > 0 ]] && shift 142 | fi 143 | ppgrep $QUERY | xargs kill $* 144 | } 145 | 146 | function exists { which $1 &> /dev/null } 147 | 148 | if exists percol; then 149 | echo "bind percol key" 150 | function percol_select_history() { 151 | local tac 152 | exists gtac && tac="gtac" || { exists tac && tac="tac" || { tac="tail -r" } } 153 | BUFFER=$(fc -l -n 1 | eval $tac | percol --query "$LBUFFER") 154 | CURSOR=$#BUFFER # move cursor 155 | zle -R -c # refresh 156 | } 157 | 158 | zle -N percol_select_history 159 | bindkey '^R' percol_select_history 160 | fi 161 | source $HOME/.cargo/env 162 | #export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7891 163 | #export https_proxy=http://web-proxy.oa.com:8080 http_proxy=http://web-proxy.oa.com:8080 164 | source /opt/homebrew/opt/asdf/libexec/asdf.sh 165 | -------------------------------------------------------------------------------- /Global Macro Group Macros.kmlibrary: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Author 6 | 7 | AuthorURL 8 | 9 | CanDragToMacroGroup 10 | 11 | Category1 12 | Interface Control 13 | Category2 14 | 15 | Description 16 | 17 | Items 18 | 19 | 20 | Activate 21 | Normal 22 | CreationDate 23 | 676304489.32959604 24 | Macros 25 | 26 | 27 | Actions 28 | 29 | 30 | AllWindows 31 | 32 | AlreadyActivatedActionType 33 | Normal 34 | Application 35 | 36 | BundleIdentifier 37 | com.google.Chrome 38 | Name 39 | Google Chrome 40 | NewFile 41 | /Applications/Google Chrome.app 42 | 43 | MacroActionType 44 | ActivateApplication 45 | ReopenWindows 46 | 47 | TimeOutAbortsMacro 48 | 49 | 50 | 51 | CreationDate 52 | 544183761.98992801 53 | ModificationDate 54 | 565005449.23878801 55 | Name 56 | Open Chrome 57 | Triggers 58 | 59 | 60 | FireType 61 | Pressed 62 | KeyCode 63 | 8 64 | MacroTriggerType 65 | HotKey 66 | Modifiers 67 | 6912 68 | 69 | 70 | UID 71 | 8E39D869-4EF4-4135-991B-70320AEDDBD1 72 | 73 | 74 | Name 75 | Global Macro Group 76 | ToggleMacroUID 77 | 9D40F254-8D94-4500-8EB8-8D6B4326FE36 78 | UID 79 | FB6797CB-B9F6-4EEE-B5BD-FBCB678FA973 80 | 81 | 82 | Activate 83 | Normal 84 | CreationDate 85 | 676304489.32959604 86 | Macros 87 | 88 | 89 | Actions 90 | 91 | 92 | AllWindows 93 | 94 | AlreadyActivatedActionType 95 | Normal 96 | Application 97 | 98 | BundleIdentifier 99 | com.microsoft.VSCode 100 | Name 101 | Visual Studio Code 102 | NewFile 103 | /Applications/Visual Studio Code.app 104 | 105 | MacroActionType 106 | ActivateApplication 107 | ReopenWindows 108 | 109 | TimeOutAbortsMacro 110 | 111 | 112 | 113 | CreationDate 114 | 544673356.43304503 115 | ModificationDate 116 | 676343018.56807101 117 | Name 118 | Open code 119 | Triggers 120 | 121 | 122 | FireType 123 | Pressed 124 | KeyCode 125 | 1 126 | MacroTriggerType 127 | HotKey 128 | Modifiers 129 | 6912 130 | 131 | 132 | UID 133 | 2125225D-299F-42A5-93E2-9CB6332348C8 134 | 135 | 136 | Name 137 | Global Macro Group 138 | ToggleMacroUID 139 | 9D40F254-8D94-4500-8EB8-8D6B4326FE36 140 | UID 141 | FB6797CB-B9F6-4EEE-B5BD-FBCB678FA973 142 | 143 | 144 | Activate 145 | Normal 146 | CreationDate 147 | 676304489.32959604 148 | Macros 149 | 150 | 151 | Actions 152 | 153 | 154 | AllWindows 155 | 156 | AlreadyActivatedActionType 157 | Normal 158 | Application 159 | 160 | BundleIdentifier 161 | com.googlecode.iterm2 162 | Name 163 | iTerm 164 | NewFile 165 | /Applications/iTerm.app 166 | 167 | MacroActionType 168 | ActivateApplication 169 | ReopenWindows 170 | 171 | TimeOutAbortsMacro 172 | 173 | 174 | 175 | CreationDate 176 | 544183568.64597404 177 | ModificationDate 178 | 676304676.09361994 179 | Name 180 | Open iTerm 181 | Triggers 182 | 183 | 184 | FireType 185 | Pressed 186 | KeyCode 187 | 17 188 | MacroTriggerType 189 | HotKey 190 | Modifiers 191 | 6912 192 | 193 | 194 | UID 195 | B954C73F-287E-4A8F-B180-4E627C00C91E 196 | 197 | 198 | Name 199 | Global Macro Group 200 | ToggleMacroUID 201 | 9D40F254-8D94-4500-8EB8-8D6B4326FE36 202 | UID 203 | FB6797CB-B9F6-4EEE-B5BD-FBCB678FA973 204 | 205 | 206 | Activate 207 | Normal 208 | CreationDate 209 | 676304489.32959604 210 | Macros 211 | 212 | 213 | Actions 214 | 215 | 216 | AllWindows 217 | 218 | AlreadyActivatedActionType 219 | Normal 220 | Application 221 | 222 | BundleIdentifier 223 | com.tencent.qq 224 | Name 225 | QQ 226 | 227 | MacroActionType 228 | ActivateApplication 229 | ReopenWindows 230 | 231 | TimeOutAbortsMacro 232 | 233 | 234 | 235 | CreationDate 236 | 544689940.70213902 237 | ModificationDate 238 | 565005451.27487898 239 | Name 240 | Open QQ 241 | Triggers 242 | 243 | 244 | FireType 245 | Pressed 246 | KeyCode 247 | 12 248 | MacroTriggerType 249 | HotKey 250 | Modifiers 251 | 6912 252 | 253 | 254 | UID 255 | 37B1BF16-44DE-411C-BEA7-C2E4C2716B60 256 | 257 | 258 | Name 259 | Global Macro Group 260 | ToggleMacroUID 261 | 9D40F254-8D94-4500-8EB8-8D6B4326FE36 262 | UID 263 | FB6797CB-B9F6-4EEE-B5BD-FBCB678FA973 264 | 265 | 266 | Activate 267 | Normal 268 | CreationDate 269 | 676304489.32959604 270 | Macros 271 | 272 | 273 | Actions 274 | 275 | 276 | AllWindows 277 | 278 | AlreadyActivatedActionType 279 | Normal 280 | Application 281 | 282 | BundleIdentifier 283 | com.tencent.WeWorkMac 284 | Name 285 | WeChat Work 286 | NewFile 287 | /Applications/企业微信.app 288 | 289 | MacroActionType 290 | ActivateApplication 291 | ReopenWindows 292 | 293 | TimeOutAbortsMacro 294 | 295 | 296 | 297 | CreationDate 298 | 544183535.75009406 299 | ModificationDate 300 | 565005455.38554096 301 | Name 302 | Open Wechat 303 | Triggers 304 | 305 | 306 | FireType 307 | Pressed 308 | KeyCode 309 | 13 310 | MacroTriggerType 311 | HotKey 312 | Modifiers 313 | 6912 314 | 315 | 316 | UID 317 | 3385F5C3-1821-4696-A283-6DF82D7D2AE6 318 | 319 | 320 | Name 321 | Global Macro Group 322 | ToggleMacroUID 323 | 9D40F254-8D94-4500-8EB8-8D6B4326FE36 324 | UID 325 | FB6797CB-B9F6-4EEE-B5BD-FBCB678FA973 326 | 327 | 328 | Activate 329 | Normal 330 | CreationDate 331 | 676304489.32959604 332 | Macros 333 | 334 | 335 | Actions 336 | 337 | 338 | AllWindows 339 | 340 | AlreadyActivatedActionType 341 | Normal 342 | Application 343 | 344 | BundleIdentifier 345 | com.apple.dt.Xcode 346 | Name 347 | Xcode 348 | NewFile 349 | /Applications/Xcode.app 350 | 351 | MacroActionType 352 | ActivateApplication 353 | ReopenWindows 354 | 355 | TimeOutAbortsMacro 356 | 357 | 358 | 359 | CreationDate 360 | 544674756.04601002 361 | ModificationDate 362 | 676342830.240749 363 | Name 364 | Open Xcode 365 | Triggers 366 | 367 | 368 | FireType 369 | Pressed 370 | KeyCode 371 | 7 372 | MacroTriggerType 373 | HotKey 374 | Modifiers 375 | 6912 376 | 377 | 378 | UID 379 | C8D0B5BA-28D0-4D26-8A0C-60C43FA122BD 380 | 381 | 382 | Name 383 | Global Macro Group 384 | ToggleMacroUID 385 | 9D40F254-8D94-4500-8EB8-8D6B4326FE36 386 | UID 387 | FB6797CB-B9F6-4EEE-B5BD-FBCB678FA973 388 | 389 | 390 | Activate 391 | Normal 392 | CreationDate 393 | 676304489.32959604 394 | Macros 395 | 396 | 397 | Actions 398 | 399 | 400 | AllWindows 401 | 402 | AlreadyActivatedActionType 403 | Normal 404 | Application 405 | 406 | BundleIdentifier 407 | org.gnu.Emacs 408 | Name 409 | Emacs 410 | NewFile 411 | /Applications/Emacs.app 412 | 413 | MacroActionType 414 | ActivateApplication 415 | ReopenWindows 416 | 417 | TimeOutAbortsMacro 418 | 419 | 420 | 421 | CreationDate 422 | 544183501.89248204 423 | ModificationDate 424 | 565005459.11309195 425 | Name 426 | OpenEmacs 427 | Triggers 428 | 429 | 430 | FireType 431 | Pressed 432 | KeyCode 433 | 14 434 | MacroTriggerType 435 | HotKey 436 | Modifiers 437 | 6912 438 | 439 | 440 | UID 441 | 8738304B-DFC5-4D1E-944E-BBF3D73F7838 442 | 443 | 444 | Name 445 | Global Macro Group 446 | ToggleMacroUID 447 | 9D40F254-8D94-4500-8EB8-8D6B4326FE36 448 | UID 449 | FB6797CB-B9F6-4EEE-B5BD-FBCB678FA973 450 | 451 | 452 | Activate 453 | Normal 454 | CreationDate 455 | 676304489.32959604 456 | Macros 457 | 458 | 459 | Actions 460 | 461 | 462 | AllWindows 463 | 464 | AlreadyActivatedActionType 465 | Normal 466 | Application 467 | 468 | BundleIdentifier 469 | com.apple.finder 470 | Name 471 | Finder 472 | NewFile 473 | /System/Library/CoreServices/Finder.app 474 | 475 | MacroActionType 476 | ActivateApplication 477 | ReopenWindows 478 | 479 | TimeOutAbortsMacro 480 | 481 | 482 | 483 | CreationDate 484 | 544183011.36592698 485 | ModificationDate 486 | 565005460.89918494 487 | Name 488 | OpenFinder 489 | Triggers 490 | 491 | 492 | FireType 493 | Pressed 494 | KeyCode 495 | 3 496 | MacroTriggerType 497 | HotKey 498 | Modifiers 499 | 6912 500 | 501 | 502 | UID 503 | CB786C0F-54C8-4051-B5AF-9EE797166203 504 | 505 | 506 | Name 507 | Global Macro Group 508 | ToggleMacroUID 509 | 9D40F254-8D94-4500-8EB8-8D6B4326FE36 510 | UID 511 | FB6797CB-B9F6-4EEE-B5BD-FBCB678FA973 512 | 513 | 514 | Activate 515 | Normal 516 | CreationDate 517 | 676304489.32959604 518 | Macros 519 | 520 | 521 | Actions 522 | 523 | 524 | AddToMacroPalette 525 | 526 | AddToStatusMenu 527 | 528 | EnableRepeat 529 | 530 | IsDisclosed 531 | 532 | KeyCode 533 | 122 534 | MacroActionType 535 | QuickMacro 536 | Modifiers 537 | 2048 538 | QuickMacroUID 539 | CD36EA81-D0C4-4A44-B9F3-77E832F706EC 540 | 541 | 542 | CreationDate 543 | 676304489.32829797 544 | ModificationDate 545 | 676304489.32829797 546 | Name 547 | Quick Macro for ⌥F1 548 | Triggers 549 | 550 | 551 | FireType 552 | Pressed 553 | KeyCode 554 | 122 555 | MacroTriggerType 556 | HotKey 557 | Modifiers 558 | 4096 559 | 560 | 561 | UID 562 | 898BEF21-28D7-4E80-BDCA-21864E957A8D 563 | 564 | 565 | Name 566 | Global Macro Group 567 | ToggleMacroUID 568 | 9D40F254-8D94-4500-8EB8-8D6B4326FE36 569 | UID 570 | FB6797CB-B9F6-4EEE-B5BD-FBCB678FA973 571 | 572 | 573 | Activate 574 | Normal 575 | CreationDate 576 | 676304489.32959604 577 | Macros 578 | 579 | 580 | Actions 581 | 582 | 583 | Default 584 | 585 | IsDisclosed 586 | 587 | MacroActionType 588 | Search 589 | TimeOutAbortsMacro 590 | 591 | Title 592 | Search the web with Google 593 | URL 594 | http://www.google.com/search?q=%Search% 595 | 596 | 597 | CreationDate 598 | 676304489.32292497 599 | ModificationDate 600 | 676304489.32292497 601 | Triggers 602 | 603 | 604 | FireType 605 | Pressed 606 | KeyCode 607 | 5 608 | MacroTriggerType 609 | HotKey 610 | Modifiers 611 | 4608 612 | 613 | 614 | UID 615 | 8130BF41-338F-4AA8-91EF-C4A7FFE4DD5D 616 | 617 | 618 | Name 619 | Global Macro Group 620 | ToggleMacroUID 621 | 9D40F254-8D94-4500-8EB8-8D6B4326FE36 622 | UID 623 | FB6797CB-B9F6-4EEE-B5BD-FBCB678FA973 624 | 625 | 626 | Activate 627 | Normal 628 | CreationDate 629 | 676304489.32959604 630 | Macros 631 | 632 | 633 | Actions 634 | 635 | 636 | MacroActionType 637 | TriggerByName 638 | TimeOutAbortsMacro 639 | 640 | 641 | 642 | CreationDate 643 | 676304489.32414603 644 | ModificationDate 645 | 676304489.32414603 646 | Triggers 647 | 648 | 649 | FireType 650 | Pressed 651 | KeyCode 652 | 17 653 | MacroTriggerType 654 | HotKey 655 | Modifiers 656 | 6400 657 | 658 | 659 | MacroTriggerType 660 | StatusMenu 661 | 662 | 663 | UID 664 | FAC5F3AD-574B-4E01-B6FA-D9A45291CA2F 665 | 666 | 667 | Name 668 | Global Macro Group 669 | ToggleMacroUID 670 | 9D40F254-8D94-4500-8EB8-8D6B4326FE36 671 | UID 672 | FB6797CB-B9F6-4EEE-B5BD-FBCB678FA973 673 | 674 | 675 | UID 676 | A704991B-C845-4935-AA3C-DC338E30B8FE 677 | 678 | 679 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | I use Vundle to management my vim plugins. You can refer to this link for more information: [Vundle]( https://github.com/gmarik/vundle ) 2 | 3 | # Install with: 4 | 5 | git clone https://github.com/andyque/dotvim.git ~/.vim 6 | 7 | cd ~/.vim 8 | 9 | ./install.sh 10 | 11 | # Install plugins 12 | 13 | Open a arbitrary file and run the following ex command of vim: 14 | 15 | :BundleInstall 16 | Note: The BundleInstal commands will not install YouCompleteMe on default, you should uncomment it from *bundles.vim* 17 | 18 | # Install oh-my-zsh, tmux 19 | sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" 20 | brew install tmux 21 | brew install reattach-to-user-namespace 22 | ./rock.sh 23 | 24 | ## Config YouCompleteMe plugin 25 | 26 | You can refer to [this link](https://github.com/Valloric/YouCompleteMe) for more information. 27 | 28 | # Tips: 29 | If you want to use the full power of these vim plugins, you should install python,ruby ctags,jsctags. 30 | 31 | # For Windows Platform 32 | 33 | 1. At first, you should download the [vim version](ftp://ftp.vim.org/pub/vim/pc/gvim74.exe) 34 | 35 | 2. After downloading, you should clone this repository at your home directory. Here is the instructions. 36 | 37 | git clone https://github.com/andyque/dotvim.git 38 | 39 | 3. copy the _vimrc file in the *dotvim* directory to your $Home$ directory 40 | 41 | 4. Issue your gvim editor and input :BundleInstall to install the plugins 42 | 43 | 5. Enjoy! 44 | 45 | 46 | # Config for .gitconfig.local 47 | 48 | ``` 49 | 50 | [credential] 51 | helper = osxkeychain 52 | 53 | [github] 54 | username = zilongshanren 55 | token = a123uber456secret789ceprivate000key78 56 | ``` 57 | 58 | **Licence:** 59 | 60 | Do What The Fuck You Want To Public License ([WTFPL](http://www.wtfpl.net/)). 61 | -------------------------------------------------------------------------------- /UltiSnips/all.snippets: -------------------------------------------------------------------------------- 1 | snippet ignoreXcode "Description" !b 2 | ${1:projectName}.xcodeproj/project.xcworkspace 3 | ${2:projectName}.xcodeproj/xcuserdata 4 | endsnippet 5 | -------------------------------------------------------------------------------- /UltiSnips/cpp.snippets: -------------------------------------------------------------------------------- 1 | snippet cc.dir "Description" !b 2 | CCDirector::sharedDirect() 3 | endsnippet 4 | 5 | snippet func "add a function" !b 6 | ${1:void} ${2:functionName}(${3:int i}){ 7 | ${4://code} 8 | } 9 | endsnippet 10 | -------------------------------------------------------------------------------- /UltiSnips/lua.snippets: -------------------------------------------------------------------------------- 1 | snippet cc.dir "cocos2d-x ccdirector" !b 2 | CCDirector::sharedDirector(): 3 | endsnippet 4 | -------------------------------------------------------------------------------- /UltiSnips/mkd.snippets: -------------------------------------------------------------------------------- 1 | snippet img 2 | {% img left /images/posts/${1:imageName} 1024 300 %} 3 | endsnippet 4 | 5 | snippet code 6 | \`\`\` ${1:language} ${2:title} 7 | ${3:code} 8 | \`\`\` 9 | endsnippet 10 | 11 | snippet thumb 12 | {% img right /images/posts/${1:imageName} 300 300 %} 13 | endsnippet 14 | 15 | snippet more "add more" !b 16 | 17 | endsnippet 18 | -------------------------------------------------------------------------------- /UltiSnips/python.snippets: -------------------------------------------------------------------------------- 1 | snippet ycm "generate ycm config" !b 2 | import os 3 | import ycm_core 4 | from clang_helpers import PrepareClangFlags 5 | 6 | # Set this to the absolute path to the folder (NOT the file!) containing the 7 | # compile_commands.json file to use that instead of 'flags'. See here for 8 | # more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html 9 | # Most projects will NOT need to set this to anything; you can just change the 10 | # 'flags' list of compilation flags. Notice that YCM itself uses that approach. 11 | compilation_database_folder = '' 12 | 13 | # These are the compilation flags that will be used in case there's no 14 | # compilation database set. 15 | flags = [ 16 | '-Wall', 17 | '-std=c++11', 18 | '-stdlib=libc++', 19 | '-x', 20 | 'c++', 21 | '-I', 22 | '.', 23 | '-isystem', 24 | '/usr/lib/c++/v1' 25 | ] 26 | 27 | if compilation_database_folder: 28 | database = ycm_core.CompilationDatabase(compilation_database_folder) 29 | else: 30 | database = None 31 | 32 | 33 | def DirectoryOfThisScript(): 34 | return os.path.dirname(os.path.abspath(__file__)) 35 | 36 | 37 | def MakeRelativePathsInFlagsAbsolute(flags, working_directory): 38 | if not working_directory: 39 | return flags 40 | new_flags = [] 41 | make_next_absolute = False 42 | path_flags = ['-isystem', '-I', '-iquote', '--sysroot='] 43 | for flag in flags: 44 | new_flag = flag 45 | 46 | if make_next_absolute: 47 | make_next_absolute = False 48 | if not flag.startswith('/'): 49 | new_flag = os.path.join(working_directory, flag) 50 | 51 | for path_flag in path_flags: 52 | if flag == path_flag: 53 | make_next_absolute = True 54 | break 55 | 56 | if flag.startswith(path_flag): 57 | path = flag[len(path_flag):] 58 | new_flag = path_flag + os.path.join(working_directory, path) 59 | break 60 | 61 | if new_flag: 62 | new_flags.append(new_flag) 63 | return new_flags 64 | 65 | 66 | def FlagsForFile(filename): 67 | if database: 68 | # Bear in mind that compilation_info.compiler_flags_ does NOT return a 69 | # python list, but a "list-like" StringVec object 70 | compilation_info = database.GetCompilationInfoForFile(filename) 71 | final_flags = PrepareClangFlags( 72 | MakeRelativePathsInFlagsAbsolute( 73 | compilation_info.compiler_flags_, 74 | compilation_info.compiler_working_dir_), 75 | filename) 76 | else: 77 | relative_to = DirectoryOfThisScript() 78 | final_flags = MakeRelativePathsInFlagsAbsolute(flags, relative_to) 79 | 80 | return { 81 | 'flags': final_flags, 82 | 'do_cache': True} 83 | endsnippet 84 | -------------------------------------------------------------------------------- /UltiSnips/tex.snippets: -------------------------------------------------------------------------------- 1 | snippet code "add code to latex fild" !b 2 | {\footnotesize \begin{quote}\begin{verbatim}} 3 | ${1:code goes here} 4 | \end{verbatim}\end{quote}} 5 | endsnippet 6 | -------------------------------------------------------------------------------- /UltiSnips/vim.snippets: -------------------------------------------------------------------------------- 1 | snippet cocos2dx "generate cocos2dx" !b 2 | let s:local_include_option = " -I../libs/cocos2dx/include -I../libs/cocos2dx/kazmath/include -I../libs/cocos2dx -I../libs/CocosDenshion/include -I../usr/include/libxml2 -I../libs/cocos2dx/platform/third_party/ios -I../libs/cocos2dx/platform/ios" 3 | let s:local_include_option .= " -I/usr/local/src/llvm/tools/libcxx/include -L/usr/local/src/llvm/tools/libcxx/lib" 4 | let g:clang_user_options .= s:local_include_option 5 | let g:clang_user_options .= " -DDEBUG -DCOCOS2D_DEBUG=1 -DUSE_FILE32API -DCC_TARGET_OS_IPHONE -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk -fexceptions" 6 | let g:single_compile_options .= s:local_include_option 7 | endsnippet 8 | 9 | 10 | snippet opencv "gene" !b 11 | let s:local_include_option = " -I/usr/local/src/llvm/tools/libcxx/include -L/usr/local/src/llvm/tools/libcxx/lib" 12 | let s:local_include_option .= " -lopencv_core -lopencv_highgui -lopencv_imgproc" 13 | let g:clang_user_options .= s:local_include_option 14 | let g:single_compile_options .= s:local_include_option 15 | endsnippet 16 | 17 | snippet cocos2dxb "generate cocos2dx" !b 18 | let s:local_include_option = " -I../libs/cocos2dx/include -I../libs/cocos2dx/kazmath/include -I../libs/cocos2dx -I../libs/CocosDenshion/include -I../usr/include/libxml2 -I../libs/cocos2dx/platform/third_party/ios -I../libs/cocos2dx/platform/ios -I../libs -I../libs/Box2D" 19 | let s:local_include_option .= " -I/usr/local/src/llvm/tools/libcxx/include -L/usr/local/src/llvm/tools/libcxx/lib" 20 | let g:clang_user_options .= s:local_include_option 21 | let g:clang_user_options .= " -DDEBUG -DCOCOS2D_DEBUG=1 -DUSE_FILE32API -DCC_TARGET_OS_IPHONE -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk -fexceptions" 22 | let g:single_compile_options .= s:local_include_option 23 | endsnippet 24 | -------------------------------------------------------------------------------- /UltiSnips/vimwiki.snippets: -------------------------------------------------------------------------------- 1 | snippet _diary "a template for writing my personal diary " !b 2 | ===Summary=== 3 | 4 | ===Today's ToDo list=== 5 | endsnippet 6 | 7 | snippet _summary "a template for writing summary" !b 8 | Health: 9 | Family: 10 | Love: 11 | Friends: 12 | Career: 13 | Wealth: 14 | life: 15 | Personal: 16 | Learning: 17 | Dream: 18 | endsnippet 19 | -------------------------------------------------------------------------------- /_vimrc: -------------------------------------------------------------------------------- 1 | source $Home/dotfiles/vimrc 2 | 3 | source $VIMRUNTIME/delmenu.vim 4 | source $VIMRUNTIME/menu.vim 5 | -------------------------------------------------------------------------------- /_vsvimrc: -------------------------------------------------------------------------------- 1 | nmap :vsc View.NavigateBackward 2 | nmap :vsc View.NavigateForward 3 | 4 | nmap :vsc Edit.GoToDefinition 5 | 6 | set incsearch 7 | set hlsearch 8 | set number 9 | 10 | set autoindent 11 | set tabstop=4 " tab width is 4 spaces 12 | set shiftwidth=4 " indent also with 4 spaces 13 | set softtabstop=4 14 | set expandtab 15 | set textwidth=300 16 | set t_Co=256 17 | 18 | 19 | imap 20 | imap 21 | imap 22 | imap 23 | imap I 24 | imap A 25 | -------------------------------------------------------------------------------- /autoload/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/dotfiles/cf13333725aedd1f836e89677050a23581bd1754/autoload/.DS_Store -------------------------------------------------------------------------------- /autoload/gocomplete.vim: -------------------------------------------------------------------------------- 1 | if exists('g:loaded_gocode') 2 | finish 3 | endif 4 | let g:loaded_gocode = 1 5 | 6 | fu! s:gocodeCurrentBuffer() 7 | let buf = getline(1, '$') 8 | if &encoding != 'utf-8' 9 | let buf = map(buf, 'iconv(v:val, &encoding, "utf-8")') 10 | endif 11 | if &l:fileformat == 'dos' 12 | " XXX: line2byte() depend on 'fileformat' option. 13 | " so if fileformat is 'dos', 'buf' must include '\r'. 14 | let buf = map(buf, 'v:val."\r"') 15 | endif 16 | let file = tempname() 17 | call writefile(buf, file) 18 | return file 19 | endf 20 | 21 | let s:vim_system = get(g:, 'gocomplete#system_function', function('system')) 22 | 23 | fu! s:system(str, ...) 24 | return (a:0 == 0 ? s:vim_system(a:str) : s:vim_system(a:str, join(a:000))) 25 | endf 26 | 27 | fu! s:gocodeShellescape(arg) 28 | try 29 | let ssl_save = &shellslash 30 | set noshellslash 31 | return shellescape(a:arg) 32 | finally 33 | let &shellslash = ssl_save 34 | endtry 35 | endf 36 | 37 | fu! s:gocodeCommand(cmd, preargs, args) 38 | for i in range(0, len(a:args) - 1) 39 | let a:args[i] = s:gocodeShellescape(a:args[i]) 40 | endfor 41 | for i in range(0, len(a:preargs) - 1) 42 | let a:preargs[i] = s:gocodeShellescape(a:preargs[i]) 43 | endfor 44 | let result = s:system(printf('gocode %s %s %s', join(a:preargs), a:cmd, join(a:args))) 45 | if v:shell_error != 0 46 | return "[\"0\", []]" 47 | else 48 | if &encoding != 'utf-8' 49 | let result = iconv(result, 'utf-8', &encoding) 50 | endif 51 | return result 52 | endif 53 | endf 54 | 55 | fu! s:gocodeCurrentBufferOpt(filename) 56 | return '-in=' . a:filename 57 | endf 58 | 59 | fu! s:gocodeCursor() 60 | if &encoding != 'utf-8' 61 | let c = col('.') 62 | let buf = line('.') == 1 ? "" : (join(getline(1, line('.')-1), "\n") . "\n") 63 | let buf .= c == 1 ? "" : getline('.')[:c-2] 64 | return printf('%d', len(iconv(buf, &encoding, "utf-8"))) 65 | endif 66 | return printf('%d', line2byte(line('.')) + (col('.')-2)) 67 | endf 68 | 69 | fu! s:gocodeAutocomplete() 70 | let filename = s:gocodeCurrentBuffer() 71 | let result = s:gocodeCommand('autocomplete', 72 | \ [s:gocodeCurrentBufferOpt(filename), '-f=vim'], 73 | \ [expand('%:p'), s:gocodeCursor()]) 74 | call delete(filename) 75 | return result 76 | endf 77 | 78 | fu! gocomplete#Complete(findstart, base) 79 | "findstart = 1 when we need to get the text length 80 | if a:findstart == 1 81 | execute "silent let g:gocomplete_completions = " . s:gocodeAutocomplete() 82 | return col('.') - g:gocomplete_completions[0] - 1 83 | "findstart = 0 when we need to return the list of completions 84 | else 85 | return g:gocomplete_completions[1] 86 | endif 87 | endf 88 | -------------------------------------------------------------------------------- /bin/cc_args.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #-*- coding: utf-8 -*- 3 | 4 | import sys 5 | 6 | CONFIG_NAME = ".clang_complete" 7 | 8 | def readConfiguration(): 9 | try: 10 | f = open(CONFIG_NAME, "r") 11 | except IOError: 12 | return [] 13 | 14 | result = [] 15 | for line in f.readlines(): 16 | strippedLine = line.strip() 17 | if strippedLine: 18 | result.append(strippedLine) 19 | f.close() 20 | return result 21 | 22 | def writeConfiguration(lines): 23 | f = open(CONFIG_NAME, "w") 24 | f.writelines(lines) 25 | f.close() 26 | 27 | def parseArguments(arguments): 28 | nextIsInclude = False 29 | nextIsDefine = False 30 | nextIsIncludeFile = False 31 | 32 | includes = [] 33 | defines = [] 34 | include_file = [] 35 | options = [] 36 | 37 | for arg in arguments: 38 | if nextIsInclude: 39 | includes += [arg] 40 | nextIsInclude = False 41 | elif nextIsDefine: 42 | defines += [arg] 43 | nextIsDefine = False 44 | elif nextIsIncludeFile: 45 | include_file += [arg] 46 | nextIsIncludeFile = False 47 | elif arg == "-I": 48 | nextIsInclude = True 49 | elif arg == "-D": 50 | nextIsDefine = True 51 | elif arg[:2] == "-I": 52 | includes += [arg[2:]] 53 | elif arg[:2] == "-D": 54 | defines += [arg[2:]] 55 | elif arg == "-include": 56 | nextIsIncludeFile = True 57 | elif arg.startswith('-std='): 58 | options.append(arg) 59 | elif arg == '-ansi': 60 | options.append(arg) 61 | elif arg.startswith('-pedantic'): 62 | options.append(arg) 63 | elif arg.startswith('-W'): 64 | options.append(arg) 65 | 66 | result = list(map(lambda x: "-I" + x, includes)) 67 | result.extend(map(lambda x: "-D" + x, defines)) 68 | result.extend(map(lambda x: "-include " + x, include_file)) 69 | result.extend(options) 70 | 71 | return result 72 | 73 | def mergeLists(base, new): 74 | result = list(base) 75 | for newLine in new: 76 | if newLine not in result: 77 | result.append(newLine) 78 | return result 79 | 80 | configuration = readConfiguration() 81 | args = parseArguments(sys.argv) 82 | result = mergeLists(configuration, args) 83 | writeConfiguration(map(lambda x: x + "\n", result)) 84 | 85 | 86 | import subprocess 87 | proc = subprocess.Popen(sys.argv[1:]) 88 | ret = proc.wait() 89 | 90 | if ret is None: 91 | sys.exit(1) 92 | sys.exit(ret) 93 | 94 | # vim: set ts=2 sts=2 sw=2 expandtab : 95 | -------------------------------------------------------------------------------- /bin/tmux-session: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Save and restore the state of tmux sessions and windows. 3 | # TODO: persist and restore the state & position of panes. 4 | set -e 5 | 6 | dump() { 7 | local d=$'\t' 8 | tmux list-windows -a -F "#S${d}#W${d}#{pane_current_path}" 9 | } 10 | 11 | save() { 12 | dump > ~/.tmux-session 13 | } 14 | 15 | terminal_size() { 16 | stty size 2>/dev/null | awk '{ printf "-x%d -y%d", $2, $1 }' 17 | } 18 | 19 | session_exists() { 20 | tmux has-session -t "$1" 2>/dev/null 21 | } 22 | 23 | add_window() { 24 | tmux new-window -d -t "$1:" -n "$2" -c "$3" 25 | } 26 | 27 | new_session() { 28 | cd "$3" && 29 | tmux new-session -d -s "$1" -n "$2" $4 30 | } 31 | 32 | restore() { 33 | tmux start-server 34 | local count=0 35 | local dimensions="$(terminal_size)" 36 | 37 | while IFS=$'\t' read session_name window_name dir; do 38 | if [[ -d "$dir" && $window_name != "log" && $window_name != "man" ]]; then 39 | if session_exists "$session_name"; then 40 | add_window "$session_name" "$window_name" "$dir" 41 | else 42 | new_session "$session_name" "$window_name" "$dir" "$dimensions" 43 | count=$(( count + 1 )) 44 | fi 45 | fi 46 | done < ~/.tmux-session 47 | 48 | echo "restored $count sessions" 49 | } 50 | 51 | case "$1" in 52 | save | restore ) 53 | $1 54 | ;; 55 | * ) 56 | echo "valid commands: save, restore" >&2 57 | exit 1 58 | esac -------------------------------------------------------------------------------- /bundles.vim: -------------------------------------------------------------------------------- 1 | " vundle plugins 2 | Bundle 'gmarik/vundle' 3 | Bundle 'tpope/vim-repeat' 4 | Bundle 'tpope/vim-unimpaired' 5 | Bundle 'tpope/vim-surround' 6 | Bundle 'tpope/vim-commentary' 7 | Bundle 'kien/ctrlp.vim' 8 | "Bundle 'Lokaltog/vim-easymotion' 9 | Bundle 'sjl/gundo.vim' 10 | Bundle 'nelstrom/vim-visual-star-search' 11 | Bundle 'Shougo/neocomplcache.vim' 12 | Bundle 'ervandew/supertab' 13 | "Bundle 'Raimondi/delimitMate' 14 | Bundle 'jimmay5469/vim-spacemacs' 15 | Bundle 'jremmen/vim-ripgrep' 16 | 17 | 18 | 19 | " github repo 20 | " Bundle 'tpope/vim-fugitive' 21 | " Bundle 'airblade/vim-gitgutter' 22 | 23 | " Bundle 'scrooloose/nerdtree' 24 | " Bundle 'scrooloose/syntastic' 25 | " Bundle 'tommcdo/vim-exchange' 26 | " Bundle 'terryma/vim-multiple-cursors' 27 | 28 | " tpope's awesome vim plugins 29 | " Bundle 'tpope/vim-speeddating' 30 | " Bundle 'tpope/vim-abolish' 31 | " Bundle 'tpope/vim-eunuch' 32 | 33 | "color scheme 34 | " Bundle 'altercation/vim-colors-solarized' 35 | " Bundle 'nelstrom/vim-blackboard' 36 | " Bundle 'sickill/vim-monokai' 37 | 38 | "very useful plugins 39 | " Bundle 'mileszs/ack.vim' 40 | " Bundle 'xolox/vim-lua-ftplugin' 41 | " Bundle 'gabrielelana/vim-markdown' 42 | " Bundle 'pangloss/vim-javascript' 43 | " Bundle 'majutsushi/tagbar' 44 | " Bundle 'godlygeek/tabular' 45 | " Bundle 'nelstrom/vim-qargs' 46 | " Bundle 'klen/python-mode' 47 | " Bundle 'bling/vim-airline' 48 | " Bundle 'SirVer/ultisnips' 49 | " Bundle 'xuhdev/SingleCompile' 50 | " Bundle 'oblitum/bufkill' 51 | " Bundle 'wikitopian/hardmode' 52 | " Bundle 'mileszs/ack.vim' 53 | " Bundle 'kchmck/vim-coffee-script' 54 | " Bundle 'skammer/vim-css-color' 55 | " Bundle 'xolox/vim-misc' 56 | " Bundle 'Valloric/YouCompleteMe' 57 | " if you use Vim for programming, please comment the necomplcache and use 58 | " YouComplete Me instead 59 | 60 | "text object plugin 61 | " Bundle 'kana/vim-textobj-lastpat' 62 | " Bundle 'kana/vim-textobj-user' 63 | " Bundle 'kana/vim-textobj-line' 64 | " Bundle 'kana/vim-textobj-indent' 65 | " Bundle 'kana/vim-textobj-entire' 66 | " Bundle 'kana/vim-textobj-syntax' 67 | 68 | " gist repo 69 | " Bundle 'mattn/gist-vim' 70 | " Bundle 'mattn/webapi-vim' 71 | 72 | " vim-scripts" 73 | " Bundle 'a.vim' 74 | " Bundle 'bufexplorer.zip' 75 | " Bundle 'calendar.vim--Matsumoto' 76 | " Bundle 'DoxygenToolkit.vim' 77 | " Bundle 'ZoomWin' 78 | -------------------------------------------------------------------------------- /colors/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/dotfiles/cf13333725aedd1f836e89677050a23581bd1754/colors/.DS_Store -------------------------------------------------------------------------------- /colors/ego.vim: -------------------------------------------------------------------------------- 1 | " Vim color file 2 | " Maintainer: Robby Colvin 3 | " Last Change: 2010-04-30 4 | " Version: 0.1 5 | " based on 'ego' theme for Xcode: 6 | " http://developers.enormego.com/view/xcode_ego_theme 7 | 8 | set background=dark 9 | hi clear 10 | if exists("syntax_on") 11 | syntax reset 12 | endif 13 | 14 | let g:colors_name = "ego" 15 | 16 | " GUI Colors 17 | hi Cursor gui=NONE guibg=#8DA1A1 ctermbg=247 guifg=#ffffff ctermfg=15 18 | hi CursorIM gui=bold guifg=#ffffff ctermfg=15 guibg=#8DA1A1 ctermbg=247 19 | hi CursorLine gui=NONE guibg=#3D4646 ctermbg=238 " Uncomment for lighter line bgcolor: #202129 20 | hi CursorColumn gui=NONE guibg=#3D4646 ctermbg=238 " Uncomment for lighter line bgcolor: #202129 21 | hi Directory gui=NONE guifg=#82c057 ctermfg=107 guibg=bg 22 | hi DiffAdd gui=NONE guifg=fg guibg=#9bb2ee ctermbg=111 23 | hi DiffChange gui=NONE guifg=fg guibg=#82c057 ctermbg=107 24 | hi DiffDelete gui=NONE guifg=fg guibg=#000000 ctermbg=0 25 | hi DiffText gui=bold guifg=fg guibg=bg 26 | hi ErrorMsg gui=NONE guifg=#FFFF99 ctermfg=228 guibg=#FF0000 ctermbg=9 27 | hi VertSplit gui=NONE guifg=#000000 ctermfg=0 guibg=#686868 ctermbg=242 28 | hi Folded gui=bold guibg=#305060 ctermbg=239 guifg=#b0d0e0 ctermfg=152 29 | hi FoldColumn gui=NONE guibg=#305060 ctermbg=239 guifg=#b0d0e0 ctermfg=152 30 | hi IncSearch gui=reverse guifg=fg guibg=bg 31 | hi LineNr gui=NONE guibg=#000000 ctermbg=0 guifg=#686868 ctermfg=242 32 | hi ModeMsg gui=NONE guibg=#82c057 ctermbg=107 guifg=#C8F482 ctermfg=192 33 | hi MoreMsg gui=bold guifg=#C8F482 ctermfg=192 guibg=bg 34 | hi NonText gui=NONE guibg=#000000 ctermbg=0 guifg=#95D5F1 ctermfg=117 35 | hi Normal gui=NONE guibg=#18191F ctermbg=234 guifg=#F6F6F6 ctermfg=15 36 | hi Question gui=bold guifg=#C8F482 ctermfg=192 guibg=bg 37 | hi Search gui=NONE guibg=#95D5F1 ctermbg=117 guifg=#18191F ctermfg=234 38 | hi SpecialKey gui=NONE guibg=#103040 ctermbg=235 guifg=#324262 ctermfg=238 39 | hi StatusLine gui=bold guibg=#484848 ctermbg=238 guifg=#000000 ctermfg=0 40 | hi StatusLineNC gui=NONE guibg=#686868 ctermbg=242 guifg=#E0E0E0 ctermfg=7 41 | hi Title gui=bold guifg=#9d7ff2 ctermfg=141 guibg=bg 42 | hi Visual gui=reverse guibg=#ffffff ctermbg=15 guifg=#55747c ctermfg=66 43 | hi VisualNOS gui=bold,underline guifg=fg guibg=bg 44 | hi WarningMsg gui=bold guifg=#FF0000 ctermfg=9 guibg=bg 45 | hi WildMenu gui=bold guibg=#F6DA7B ctermbg=222 guifg=#000000 ctermfg=0 46 | hi Pmenu guibg=#e38081 ctermbg=174 guifg=#ffffff ctermfg=15 47 | hi PmenuSel guibg=#3D4646 ctermbg=238 guifg=#ffffff ctermfg=15 48 | hi NonText guibg=bg guifg=#e29aeb ctermfg=176 49 | hi Scrollbar guibg=bg 50 | 51 | hi ColorColumn guibg=#3D4646 ctermbg=238 52 | 53 | " General Syntax Colors 54 | 55 | " Light green 56 | hi Comment gui=NONE guifg=#C8F482 ctermfg=192 guibg=bg 57 | 58 | " Green 59 | hi Identifier gui=NONE guifg=#82c057 ctermfg=107 guibg=bg 60 | hi Type gui=NONE guifg=#82c057 ctermfg=107 guibg=bg 61 | hi Function gui=NONE guifg=#82c057 ctermfg=107 guibg=bg 62 | 63 | " Yellow 64 | hi Statement gui=NONE guifg=#F6DA7B ctermfg=222 guibg=bg 65 | hi Conditional gui=NONE guifg=#F6DA7B ctermfg=222 guibg=bg 66 | hi Operator gui=NONE guifg=#F6DA7B ctermfg=222 guibg=bg 67 | hi Label gui=NONE guifg=#F6DA7B ctermfg=222 guibg=bg 68 | hi Define gui=NONE guifg=#F6DA7B ctermfg=222 guibg=bg 69 | hi Macro gui=NONE guifg=#F6DA7B ctermfg=222 guibg=bg 70 | 71 | " Rose 72 | hi String gui=NONE guifg=#E38081 ctermfg=174 guibg=bg 73 | 74 | " Pink 75 | hi Todo gui=bold guifg=#e29aeb ctermfg=176 guibg=bg 76 | 77 | " Light Purple 78 | hi Character gui=NONE guifg=#9d7ff2 ctermfg=141 guibg=bg 79 | 80 | " Dark Purple 81 | hi Number gui=NONE guifg=#776CC4 ctermfg=98 guibg=bg 82 | hi Float gui=NONE guifg=#776CC4 ctermfg=98 guibg=bg 83 | hi Boolean gui=bold guifg=#776CC4 ctermfg=98 guibg=bg 84 | 85 | " Cyan 86 | hi StorageClass gui=NONE guifg=#95D5F1 ctermfg=117 guibg=bg 87 | hi Structure gui=NONE guifg=#95D5F1 ctermfg=117 guibg=bg 88 | hi Typedef gui=NONE guifg=#95D5F1 ctermfg=117 guibg=bg 89 | hi Constant gui=NONE guifg=#95D5F1 ctermfg=117 guibg=bg 90 | 91 | " Blue #9bb2ee 92 | 93 | " Dunno color 94 | hi Special gui=NONE guifg=#55747c ctermfg=66 guibg=bg 95 | hi Delimiter gui=NONE guifg=#55747c ctermfg=66 guibg=bg 96 | hi SpecialChar gui=NONE guifg=#55747c ctermfg=66 guibg=bg 97 | hi SpecialComment gui=NONE guifg=#55747c ctermfg=66 guibg=bg 98 | hi Tag gui=NONE guifg=#55747c ctermfg=66 guibg=bg 99 | hi Debug gui=NONE guifg=#55747c ctermfg=66 guibg=bg 100 | 101 | " Brown 102 | hi Repeat gui=NONE guifg=#C67C48 ctermfg=173 guibg=bg 103 | hi PreProc gui=NONE guifg=#C67C48 ctermfg=173 guibg=bg 104 | hi Include gui=NONE guifg=#C67C48 ctermfg=173 guibg=bg 105 | hi PreCondit gui=NONE guifg=#C67C48 ctermfg=173 guibg=bg 106 | hi Keyword gui=NONE guifg=#C67C48 ctermfg=173 guibg=bg 107 | hi Exception gui=NONE guifg=#C67C48 ctermfg=173 guibg=bg 108 | 109 | " Other 110 | hi Underlined gui=underline guifg=#C8F482 ctermfg=192 guibg=bg 111 | hi Ignore guifg=#55747c ctermfg=66 112 | hi Error guifg=#FFFF99 ctermfg=228 guibg=#FF0000 ctermbg=9 113 | 114 | " Ruby-specific 115 | hi rubySharpBang gui=bold guifg=#e29aeb ctermfg=176 116 | hi rubyRegexp guifg=#9BB2EE ctermfg=111 117 | -------------------------------------------------------------------------------- /colors/railscasts.vim: -------------------------------------------------------------------------------- 1 | " Vim color scheme 2 | " 3 | " Name: railscasts.vim 4 | " Maintainer: Nick Moffitt 5 | " Last Change: 01 Mar 2008 6 | " License: WTFPL 7 | " Version: 2.1 8 | " 9 | " This theme is based on Josh O'Rourke's Vim clone of the railscast 10 | " textmate theme. The key thing I have done here is supply 256-color 11 | " terminal equivalents for as many of the colors as possible, and fixed 12 | " up some of the funny behaviors for editing e-mails and such. 13 | " 14 | " To use for gvim: 15 | " 1: install this file as ~/.vim/colors/railscasts.vim 16 | " 2: put "colorscheme railscasts" in your .gvimrc 17 | " 18 | " If you are using Ubuntu, you can get the benefit of this in your 19 | " terminals using ordinary vim by taking the following steps: 20 | " 21 | " 1: sudo apt-get install ncurses-term 22 | " 2: put the following in your .vimrc 23 | " if $COLORTERM == 'gnome-terminal' 24 | " set term=gnome-256color 25 | " colorscheme railscasts 26 | " else 27 | " colorscheme default 28 | " endif 29 | " 3: if you wish to use this with screen, add the following to your .screenrc: 30 | " attrcolor b ".I" 31 | " termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' 32 | " defbce "on" 33 | " term screen-256color-bce 34 | 35 | set background=dark 36 | hi clear 37 | if exists("syntax_on") 38 | syntax reset 39 | endif 40 | 41 | let g:colors_name = "railscasts" 42 | 43 | hi link htmlTag xmlTag 44 | hi link htmlTagName xmlTagName 45 | hi link htmlEndTag xmlEndTag 46 | 47 | highlight Normal guifg=#E6E1DC guibg=#111111 48 | highlight Cursor guifg=#000000 ctermfg=0 guibg=#FFFFFF ctermbg=15 49 | highlight CursorLine guibg=#000000 ctermbg=233 cterm=NONE 50 | 51 | highlight Comment guifg=#BC9458 ctermfg=180 gui=italic 52 | highlight Constant guifg=#6D9CBE ctermfg=73 53 | highlight Define guifg=#CC7833 ctermfg=173 54 | highlight Error guifg=#FFC66D ctermfg=221 guibg=#990000 ctermbg=88 55 | highlight Function guifg=#FFC66D ctermfg=221 gui=NONE cterm=NONE 56 | highlight Identifier guifg=#6D9CBE ctermfg=73 gui=NONE cterm=NONE 57 | highlight Include guifg=#CC7833 ctermfg=173 gui=NONE cterm=NONE 58 | highlight PreCondit guifg=#CC7833 ctermfg=173 gui=NONE cterm=NONE 59 | highlight Keyword guifg=#CC7833 ctermfg=173 cterm=NONE 60 | highlight LineNr guifg=#2B2B2B ctermfg=159 guibg=#C0C0FF 61 | highlight Number guifg=#A5C261 ctermfg=107 62 | highlight PreProc guifg=#E6E1DC ctermfg=103 63 | highlight Search guifg=NONE ctermfg=NONE guibg=#2b2b2b ctermbg=235 gui=italic cterm=underline 64 | highlight Statement guifg=#CC7833 ctermfg=173 gui=NONE cterm=NONE 65 | highlight String guifg=#A5C261 ctermfg=107 66 | highlight Title guifg=#FFFFFF ctermfg=15 67 | highlight Type guifg=#DA4939 ctermfg=167 gui=NONE cterm=NONE 68 | highlight Visual guibg=#5A647E ctermbg=60 69 | 70 | highlight DiffAdd guifg=#E6E1DC ctermfg=7 guibg=#519F50 ctermbg=71 71 | highlight DiffDelete guifg=#E6E1DC ctermfg=7 guibg=#660000 ctermbg=52 72 | highlight Special guifg=#DA4939 ctermfg=167 73 | 74 | highlight pythonBuiltin guifg=#6D9CBE ctermfg=73 gui=NONE cterm=NONE 75 | highlight rubyBlockParameter guifg=#FFFFFF ctermfg=15 76 | highlight rubyClass guifg=#FFFFFF ctermfg=15 77 | highlight rubyConstant guifg=#DA4939 ctermfg=167 78 | highlight rubyInstanceVariable guifg=#D0D0FF ctermfg=189 79 | highlight rubyInterpolation guifg=#519F50 ctermfg=107 80 | highlight rubyLocalVariableOrMethod guifg=#D0D0FF ctermfg=189 81 | highlight rubyPredefinedConstant guifg=#DA4939 ctermfg=167 82 | highlight rubyPseudoVariable guifg=#FFC66D ctermfg=221 83 | highlight rubyStringDelimiter guifg=#A5C261 ctermfg=143 84 | 85 | highlight xmlTag guifg=#E8BF6A ctermfg=179 86 | highlight xmlTagName guifg=#E8BF6A ctermfg=179 87 | highlight xmlEndTag guifg=#E8BF6A ctermfg=179 88 | 89 | highlight mailSubject guifg=#A5C261 ctermfg=107 90 | highlight mailHeaderKey guifg=#FFC66D ctermfg=221 91 | highlight mailEmail guifg=#A5C261 ctermfg=107 gui=italic cterm=underline 92 | 93 | highlight SpellBad guifg=#D70000 ctermfg=160 ctermbg=NONE cterm=underline 94 | highlight SpellRare guifg=#D75F87 ctermfg=168 guibg=NONE ctermbg=NONE gui=underline cterm=underline 95 | highlight SpellCap guifg=#D0D0FF ctermfg=189 guibg=NONE ctermbg=NONE gui=underline cterm=underline 96 | highlight MatchParen guifg=#FFFFFF ctermfg=15 guibg=#005f5f ctermbg=23 97 | -------------------------------------------------------------------------------- /colors/wombat.vim: -------------------------------------------------------------------------------- 1 | " Maintainer: Lars H. Nielsen (dengmao@gmail.com) 2 | " Last Change: January 22 2007 3 | 4 | set background=dark 5 | 6 | hi clear 7 | 8 | if exists("syntax_on") 9 | syntax reset 10 | endif 11 | 12 | let colors_name = "wombat" 13 | 14 | 15 | " Vim >= 7.0 specific colors 16 | if version >= 700 17 | hi CursorLine guibg=#2d2d2d 18 | hi CursorColumn guibg=#2d2d2d 19 | hi MatchParen guifg=#f6f3e8 guibg=#857b6f gui=bold 20 | hi Pmenu guifg=#f6f3e8 guibg=#444444 21 | hi PmenuSel guifg=#000000 guibg=#cae682 22 | endif 23 | 24 | " General colors 25 | hi Cursor guifg=NONE guibg=#656565 gui=none 26 | hi Normal guifg=#f6f3e8 guibg=#242424 gui=none 27 | hi NonText guifg=#808080 guibg=#303030 gui=none 28 | hi LineNr guifg=#857b6f guibg=#000000 gui=none 29 | hi StatusLine guifg=#f6f3e8 guibg=#444444 gui=italic 30 | hi StatusLineNC guifg=#857b6f guibg=#444444 gui=none 31 | hi VertSplit guifg=#444444 guibg=#444444 gui=none 32 | hi Folded guibg=#384048 guifg=#a0a8b0 gui=none 33 | hi Title guifg=#f6f3e8 guibg=NONE gui=bold 34 | hi Visual guifg=#f6f3e8 guibg=#444444 gui=none 35 | hi SpecialKey guifg=#808080 guibg=#343434 gui=none 36 | 37 | " Syntax highlighting 38 | hi Comment guifg=#99968b gui=italic 39 | hi Todo guifg=#8f8f8f gui=italic 40 | hi Constant guifg=#e5786d gui=none 41 | hi String guifg=#95e454 gui=italic 42 | hi Identifier guifg=#cae682 gui=none 43 | hi Function guifg=#cae682 gui=none 44 | hi Type guifg=#cae682 gui=none 45 | hi Statement guifg=#8ac6f2 gui=none 46 | hi Keyword guifg=#8ac6f2 gui=none 47 | hi PreProc guifg=#e5786d gui=none 48 | hi Number guifg=#e5786d gui=none 49 | hi Special guifg=#e7f6da gui=none 50 | 51 | 52 | -------------------------------------------------------------------------------- /colors/wombat256.vim: -------------------------------------------------------------------------------- 1 | " Author: Gerhard Gappmeier 2 | " Description: 256C Scheme for console based VIM 3 | " Based in wombat GVIM scheme from Lars H. Nielsen (dengmao@gmail.com) 4 | " Last Change: 2009-06-01 5 | 6 | set background=dark 7 | 8 | hi clear 9 | 10 | if exists("syntax_on") 11 | syntax reset 12 | endif 13 | 14 | let colors_name = "wombat256" 15 | 16 | " Vim >= 7.0 specific colors 17 | if version >= 700 18 | hi CursorLine ctermbg=236 19 | hi CursorColumn ctermbg=236 20 | hi MatchParen ctermfg=7 ctermbg=243 cterm=bold 21 | hi Pmenu ctermfg=7 ctermbg=238 22 | hi PmenuSel ctermfg=0 ctermbg=186 23 | endif 24 | 25 | " General colors 26 | hi Cursor ctermfg=0 ctermbg=241 cterm=none 27 | hi Normal ctermfg=7 ctermbg=235 cterm=none 28 | hi NonText ctermfg=244 ctermbg=236 cterm=none 29 | hi LineNr ctermfg=243 ctermbg=0 cterm=none 30 | hi StatusLine ctermfg=7 ctermbg=238 cterm=none 31 | hi StatusLineNC ctermfg=243 ctermbg=238 cterm=none 32 | hi VertSplit ctermfg=238 ctermbg=238 cterm=none 33 | hi Folded ctermbg=238 ctermfg=248 cterm=none 34 | hi Title ctermfg=7 ctermbg=0 cterm=bold 35 | hi Visual ctermfg=7 ctermbg=238 cterm=none 36 | hi SpecialKey ctermfg=244 ctermbg=236 cterm=none 37 | hi DiffAdd ctermfg=0 ctermbg=113 cterm=none 38 | hi DiffChange ctermfg=0 ctermbg=175 cterm=none 39 | hi DiffDelete ctermfg=0 ctermbg=17 cterm=none 40 | hi SpellBad ctermfg=0 ctermbg=161 cterm=none 41 | 42 | " Syntax highlighting 43 | hi Comment ctermfg=246 ctermbg=235 44 | hi Todo ctermfg=245 cterm=italic 45 | hi Constant ctermfg=173 cterm=none 46 | hi String ctermfg=113 cterm=none 47 | hi Identifier ctermfg=186 cterm=none 48 | hi Function ctermfg=186 cterm=none 49 | hi Type ctermfg=186 cterm=none 50 | hi Statement ctermfg=117 cterm=none 51 | hi Keyword ctermfg=117 cterm=none 52 | hi PreProc ctermfg=173 cterm=none 53 | hi Number ctermfg=173 cterm=none 54 | hi Special ctermfg=194 cterm=none 55 | 56 | 57 | -------------------------------------------------------------------------------- /ec: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | which osascript > /dev/null 2>&1 && osascript -e 'tell application "Emacs" to activate' 3 | emacsclient -c "$@" 4 | -------------------------------------------------------------------------------- /emacs: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | /Applications/Emacs.app/Contents/MacOS/Emacs "$@" 3 | -------------------------------------------------------------------------------- /emacs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rm ~/.emacs-profiles.el 4 | ln -s ~/.vim/.emacs-profiles.el ~/.emacs-profiles.el 5 | 6 | rm ~/.emacs-profile 7 | ln -s ~/.vim/.emacs-profile ~/.emacs-profile 8 | 9 | -------------------------------------------------------------------------------- /ftplugin/go.vim: -------------------------------------------------------------------------------- 1 | setlocal omnifunc=gocomplete#Complete 2 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # install depency software 4 | # install homebrew 5 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" 6 | # install oh my zsh 7 | sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" 8 | #install fasd 9 | brew install fasd 10 | #install autojump 11 | brew install autojump 12 | # install tmux 13 | brew install tmux 14 | brew install reattach-to-user-namespace 15 | brew install cmake 16 | #install node and nvm 17 | brew install node 18 | brew install nvm 19 | nvm install 16.15.1 20 | # install tmux plugin 21 | git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm 22 | # for ls & cat gnu version for easing dired-quick-sort 23 | brew install coreutils 24 | brew install fd 25 | brew install ripgrep 26 | 27 | brew install pyenv 28 | pyenv install 2.7.18 29 | pyenv global 2.7.18 30 | pip install percol 31 | 32 | echo "Install vim configurations..." 33 | 34 | echo "cd to .vim directory" 35 | cd ~/.vim 36 | 37 | 38 | echo "create .vimrc" 39 | rm ~/.vimrc 40 | rm ~/.gvimrc 41 | rm ~/.ideavimrc 42 | ln -s ~/.vim/vimrc ~/.vimrc 43 | ln -s ~/.vim/vimrc ~/.gvimrc 44 | ln -s ~/.vim/.ideavimrc ~/.ideavimrc 45 | 46 | #echo "update submodules" 47 | git submodule init 48 | git submodule update 49 | -------------------------------------------------------------------------------- /karabiner.json: -------------------------------------------------------------------------------- 1 | { 2 | "global": { 3 | "check_for_updates_on_startup": true, 4 | "show_in_menu_bar": true, 5 | "show_profile_name_in_menu_bar": false 6 | }, 7 | "profiles": [ 8 | { 9 | "complex_modifications": { 10 | "parameters": { 11 | "basic.simultaneous_threshold_milliseconds": 50, 12 | "basic.to_delayed_action_delay_milliseconds": 500, 13 | "basic.to_if_alone_timeout_milliseconds": 1000, 14 | "basic.to_if_held_down_threshold_milliseconds": 500, 15 | "mouse_motion_to_scroll.speed": 100 16 | }, 17 | "rules": [ 18 | { 19 | "manipulators": [ 20 | { 21 | "description": "Change right_command to command+control+option+shift.", 22 | "from": { 23 | "key_code": "right_command", 24 | "modifiers": { 25 | "optional": [ 26 | "any" 27 | ] 28 | } 29 | }, 30 | "to": [ 31 | { 32 | "key_code": "left_shift", 33 | "modifiers": [ 34 | "left_command", 35 | "left_control", 36 | "left_option" 37 | ] 38 | } 39 | ], 40 | "type": "basic" 41 | } 42 | ] 43 | }, 44 | { 45 | "manipulators": [ 46 | { 47 | "description": "Change right_option to command+control+option+shift.", 48 | "from": { 49 | "key_code": "right_option", 50 | "modifiers": { 51 | "optional": [ 52 | "any" 53 | ] 54 | } 55 | }, 56 | "to": [ 57 | { 58 | "key_code": "left_shift", 59 | "modifiers": [ 60 | "left_command", 61 | "left_control", 62 | "left_option" 63 | ] 64 | } 65 | ], 66 | "type": "basic" 67 | } 68 | ] 69 | } 70 | ] 71 | }, 72 | "devices": [ 73 | { 74 | "disable_built_in_keyboard_if_exists": false, 75 | "fn_function_keys": [], 76 | "identifiers": { 77 | "is_keyboard": true, 78 | "is_pointing_device": false, 79 | "product_id": 50484, 80 | "vendor_id": 1133 81 | }, 82 | "ignore": true, 83 | "manipulate_caps_lock_led": false, 84 | "simple_modifications": [] 85 | }, 86 | { 87 | "disable_built_in_keyboard_if_exists": false, 88 | "fn_function_keys": [], 89 | "identifiers": { 90 | "is_keyboard": true, 91 | "is_pointing_device": false, 92 | "product_id": 594, 93 | "vendor_id": 1452 94 | }, 95 | "ignore": false, 96 | "manipulate_caps_lock_led": true, 97 | "simple_modifications": [] 98 | }, 99 | { 100 | "disable_built_in_keyboard_if_exists": false, 101 | "fn_function_keys": [], 102 | "identifiers": { 103 | "is_keyboard": false, 104 | "is_pointing_device": true, 105 | "product_id": 50484, 106 | "vendor_id": 1133 107 | }, 108 | "ignore": true, 109 | "manipulate_caps_lock_led": false, 110 | "simple_modifications": [] 111 | }, 112 | { 113 | "disable_built_in_keyboard_if_exists": false, 114 | "fn_function_keys": [], 115 | "identifiers": { 116 | "is_keyboard": true, 117 | "is_pointing_device": false, 118 | "product_id": 636, 119 | "vendor_id": 1452 120 | }, 121 | "ignore": false, 122 | "manipulate_caps_lock_led": true, 123 | "simple_modifications": [] 124 | } 125 | ], 126 | "fn_function_keys": [ 127 | { 128 | "from": { 129 | "key_code": "f1" 130 | }, 131 | "to": { 132 | "consumer_key_code": "display_brightness_decrement" 133 | } 134 | }, 135 | { 136 | "from": { 137 | "key_code": "f2" 138 | }, 139 | "to": { 140 | "consumer_key_code": "display_brightness_increment" 141 | } 142 | }, 143 | { 144 | "from": { 145 | "key_code": "f3" 146 | }, 147 | "to": { 148 | "key_code": "mission_control" 149 | } 150 | }, 151 | { 152 | "from": { 153 | "key_code": "f4" 154 | }, 155 | "to": { 156 | "key_code": "launchpad" 157 | } 158 | }, 159 | { 160 | "from": { 161 | "key_code": "f5" 162 | }, 163 | "to": { 164 | "key_code": "f5" 165 | } 166 | }, 167 | { 168 | "from": { 169 | "key_code": "f6" 170 | }, 171 | "to": { 172 | "key_code": "illumination_increment" 173 | } 174 | }, 175 | { 176 | "from": { 177 | "key_code": "f7" 178 | }, 179 | "to": { 180 | "consumer_key_code": "rewind" 181 | } 182 | }, 183 | { 184 | "from": { 185 | "key_code": "f8" 186 | }, 187 | "to": { 188 | "key_code": "f8" 189 | } 190 | }, 191 | { 192 | "from": { 193 | "key_code": "f9" 194 | }, 195 | "to": { 196 | "key_code": "f9" 197 | } 198 | }, 199 | { 200 | "from": { 201 | "key_code": "f10" 202 | }, 203 | "to": { 204 | "key_code": "f10" 205 | } 206 | }, 207 | { 208 | "from": { 209 | "key_code": "f11" 210 | }, 211 | "to": { 212 | "key_code": "f11" 213 | } 214 | }, 215 | { 216 | "from": { 217 | "key_code": "f12" 218 | }, 219 | "to": { 220 | "key_code": "f12" 221 | } 222 | } 223 | ], 224 | "name": "Default profile", 225 | "parameters": { 226 | "delay_milliseconds_before_open_device": 1000 227 | }, 228 | "selected": true, 229 | "simple_modifications": [ 230 | { 231 | "from": { 232 | "key_code": "caps_lock" 233 | }, 234 | "to": { 235 | "key_code": "left_control" 236 | } 237 | } 238 | ], 239 | "virtual_hid_keyboard": { 240 | "caps_lock_delay_milliseconds": 0, 241 | "country_code": 0, 242 | "keyboard_type": "ansi", 243 | "mouse_key_xy_scale": 100 244 | } 245 | }, 246 | { 247 | "complex_modifications": { 248 | "parameters": { 249 | "basic.simultaneous_threshold_milliseconds": 50, 250 | "basic.to_delayed_action_delay_milliseconds": 500, 251 | "basic.to_if_alone_timeout_milliseconds": 1000, 252 | "basic.to_if_held_down_threshold_milliseconds": 500, 253 | "mouse_motion_to_scroll.speed": 100 254 | }, 255 | "rules": [ 256 | { 257 | "manipulators": [ 258 | { 259 | "description": "Change right_command to command+control+option+shift.", 260 | "from": { 261 | "key_code": "right_command", 262 | "modifiers": { 263 | "optional": [ 264 | "any" 265 | ] 266 | } 267 | }, 268 | "to": [ 269 | { 270 | "key_code": "left_shift", 271 | "modifiers": [ 272 | "left_command", 273 | "left_control", 274 | "left_option" 275 | ] 276 | } 277 | ], 278 | "type": "basic" 279 | } 280 | ] 281 | }, 282 | { 283 | "manipulators": [ 284 | { 285 | "description": "Change right_option to command+control+option+shift.", 286 | "from": { 287 | "key_code": "right_option", 288 | "modifiers": { 289 | "optional": [ 290 | "any" 291 | ] 292 | } 293 | }, 294 | "to": [ 295 | { 296 | "key_code": "left_shift", 297 | "modifiers": [ 298 | "left_command", 299 | "left_control", 300 | "left_option" 301 | ] 302 | } 303 | ], 304 | "type": "basic" 305 | } 306 | ] 307 | } 308 | ] 309 | }, 310 | "devices": [ 311 | { 312 | "disable_built_in_keyboard_if_exists": false, 313 | "fn_function_keys": [], 314 | "identifiers": { 315 | "is_keyboard": true, 316 | "is_pointing_device": false, 317 | "product_id": 50484, 318 | "vendor_id": 1133 319 | }, 320 | "ignore": true, 321 | "manipulate_caps_lock_led": false, 322 | "simple_modifications": [] 323 | }, 324 | { 325 | "disable_built_in_keyboard_if_exists": false, 326 | "fn_function_keys": [], 327 | "identifiers": { 328 | "is_keyboard": true, 329 | "is_pointing_device": false, 330 | "product_id": 594, 331 | "vendor_id": 1452 332 | }, 333 | "ignore": false, 334 | "manipulate_caps_lock_led": true, 335 | "simple_modifications": [] 336 | }, 337 | { 338 | "disable_built_in_keyboard_if_exists": false, 339 | "fn_function_keys": [], 340 | "identifiers": { 341 | "is_keyboard": false, 342 | "is_pointing_device": true, 343 | "product_id": 50484, 344 | "vendor_id": 1133 345 | }, 346 | "ignore": true, 347 | "manipulate_caps_lock_led": false, 348 | "simple_modifications": [] 349 | } 350 | ], 351 | "fn_function_keys": [ 352 | { 353 | "from": { 354 | "key_code": "f1" 355 | }, 356 | "to": { 357 | "consumer_key_code": "display_brightness_decrement" 358 | } 359 | }, 360 | { 361 | "from": { 362 | "key_code": "f2" 363 | }, 364 | "to": { 365 | "consumer_key_code": "display_brightness_increment" 366 | } 367 | }, 368 | { 369 | "from": { 370 | "key_code": "f3" 371 | }, 372 | "to": { 373 | "key_code": "mission_control" 374 | } 375 | }, 376 | { 377 | "from": { 378 | "key_code": "f4" 379 | }, 380 | "to": { 381 | "key_code": "launchpad" 382 | } 383 | }, 384 | { 385 | "from": { 386 | "key_code": "f5" 387 | }, 388 | "to": { 389 | "key_code": "f5" 390 | } 391 | }, 392 | { 393 | "from": { 394 | "key_code": "f6" 395 | }, 396 | "to": { 397 | "key_code": "illumination_increment" 398 | } 399 | }, 400 | { 401 | "from": { 402 | "key_code": "f7" 403 | }, 404 | "to": { 405 | "consumer_key_code": "rewind" 406 | } 407 | }, 408 | { 409 | "from": { 410 | "key_code": "f8" 411 | }, 412 | "to": { 413 | "key_code": "f8" 414 | } 415 | }, 416 | { 417 | "from": { 418 | "key_code": "f9" 419 | }, 420 | "to": { 421 | "key_code": "f9" 422 | } 423 | }, 424 | { 425 | "from": { 426 | "key_code": "f10" 427 | }, 428 | "to": { 429 | "key_code": "f10" 430 | } 431 | }, 432 | { 433 | "from": { 434 | "key_code": "f11" 435 | }, 436 | "to": { 437 | "key_code": "f11" 438 | } 439 | }, 440 | { 441 | "from": { 442 | "key_code": "f12" 443 | }, 444 | "to": { 445 | "key_code": "f12" 446 | } 447 | } 448 | ], 449 | "name": "win keyboard", 450 | "parameters": { 451 | "delay_milliseconds_before_open_device": 1000 452 | }, 453 | "selected": false, 454 | "simple_modifications": [ 455 | { 456 | "from": { 457 | "key_code": "caps_lock" 458 | }, 459 | "to": { 460 | "key_code": "left_control" 461 | } 462 | }, 463 | { 464 | "from": { 465 | "key_code": "left_alt" 466 | }, 467 | "to": { 468 | "key_code": "left_gui" 469 | } 470 | }, 471 | { 472 | "from": { 473 | "key_code": "left_gui" 474 | }, 475 | "to": { 476 | "key_code": "left_alt" 477 | } 478 | } 479 | ], 480 | "virtual_hid_keyboard": { 481 | "caps_lock_delay_milliseconds": 0, 482 | "country_code": 0, 483 | "keyboard_type": "ansi", 484 | "mouse_key_xy_scale": 100 485 | } 486 | } 487 | ] 488 | } 489 | -------------------------------------------------------------------------------- /rc.py: -------------------------------------------------------------------------------- 1 | percol.view.PROMPT = ur"Input: %q" 2 | 3 | # Emacs like 4 | percol.import_keymap({ 5 | "C-h" : lambda percol: percol.command.delete_backward_char(), 6 | "C-d" : lambda percol: percol.command.delete_forward_char(), 7 | "C-k" : lambda percol: percol.command.kill_end_of_line(), 8 | "C-y" : lambda percol: percol.command.yank(), 9 | "C-t" : lambda percol: percol.command.transpose_chars(), 10 | "C-a" : lambda percol: percol.command.beginning_of_line(), 11 | "C-e" : lambda percol: percol.command.end_of_line(), 12 | "C-b" : lambda percol: percol.command.backward_char(), 13 | "C-f" : lambda percol: percol.command.forward_char(), 14 | "M-f" : lambda percol: percol.command.forward_word(), 15 | "M-b" : lambda percol: percol.command.backward_word(), 16 | "M-d" : lambda percol: percol.command.delete_forward_word(), 17 | "M-h" : lambda percol: percol.command.delete_backward_word(), 18 | "C-n" : lambda percol: percol.command.select_next(), 19 | "C-p" : lambda percol: percol.command.select_previous(), 20 | "C-v" : lambda percol: percol.command.select_next_page(), 21 | "M-v" : lambda percol: percol.command.select_previous_page(), 22 | "M-<" : lambda percol: percol.command.select_top(), 23 | "M->" : lambda percol: percol.command.select_bottom(), 24 | "C-m" : lambda percol: percol.finish(), 25 | "C-j" : lambda percol: percol.finish(), 26 | "C-g" : lambda percol: percol.cancel() 27 | }) 28 | -------------------------------------------------------------------------------- /rock-mac.sh: -------------------------------------------------------------------------------- 1 | echo "start rock with MacOS X" 2 | defaults write com.apple.finder AppleShowAllFiles YES 3 | 4 | # sudo rm /usr/local/bin/emacsclient 5 | # ln -s /Applications/Emacs.app/Contents/MacOS/bin/emacsclient /usr/local/bin 6 | 7 | # sudo cp ec emacs /usr/local/bin 8 | 9 | -------------------------------------------------------------------------------- /rock.sh: -------------------------------------------------------------------------------- 1 | echo "copy all the dot files" 2 | 3 | echo "cd to .vim directory" 4 | cd ~/.vim 5 | 6 | 7 | rm ~/.gitconfig 8 | rm ~/.latexmkrc 9 | rm ~/.zshrc 10 | rm ~/.tmux.conf 11 | rm ~/.tmux-mac 12 | rm ~/.flake8rc 13 | rm ~/.luacheckrc 14 | rm ~/.eslintrc 15 | rm ~/.jshintrc 16 | rm ~/.agignore 17 | rm ~/.jsbeautifyrc 18 | rm ~/.zshenv 19 | # rm ~/.zshenv 20 | rm ~/.npmrc 21 | rm ~/tslint.json 22 | rm ~/.ruby-version 23 | ln -s ~/.vim/.gitconfig ~/.gitconfig 24 | ln -s ~/.vim/.latexmkrc ~/.latexmkrc 25 | ln -s ~/.vim/.zshrc ~/.zshrc 26 | ln -s ~/.vim/.zshenv ~/.zshenv 27 | ln -s ~/.vim/.tmux.conf ~/.tmux.conf 28 | ln -s ~/.vim/.tmux-mac ~/.tmux-mac 29 | ln -s ~/.vim/.flake8rc ~/.flake8rc 30 | ln -s ~/.vim/.luacheckrc ~/.luacheckrc 31 | ln -s ~/.vim/.eslintrc ~/.eslintrc 32 | ln -s ~/.vim/.jshintrc ~/.jshintrc 33 | ln -s ~/.vim/.agignore ~/.agignore 34 | ln -s ~/.vim/.jsbeautifyrc ~/.jsbeautifyrc 35 | # ln -s ~/.vim/.zshenv ~/.zshenv 36 | ln -s ~/.vim/.npmrc ~/.npmrc 37 | ln -s ~/.vim/tslint.json ~/tslint.json 38 | ln -s ~/.vim/.ruby-version ~/.ruby-version 39 | mkdir -p ~/.config/karabiner 40 | ln -s ~/.vim/karabiner.json ~/.config/karabiner/karabiner.json 41 | 42 | rm ~/.xvimrc 43 | ln -s ~/.vim/.xvimrc ~/.xvimrc 44 | 45 | rm ~/.vrapperrc 46 | ln -s ~/.vim/.vrapperrc ~/.vrapperrc 47 | rm ~/.ctags 48 | ln -s ~/.vim/.ctags ~/.ctags 49 | 50 | rm -rf ~/.percol.d 51 | mkdir ~/.percol.d 52 | ln -s ~/.vim/rc.py ~/.percol.d/rc.py 53 | 54 | rm ~/.bash_profile 55 | ln -s ~/.vim/.bash_profile ~/.bash_profile 56 | 57 | rm ~/.ctags 58 | ln -s ~/.vim/.ctags ~/.ctags 59 | 60 | # rm ~/.spacemacs 61 | # ln -s ~/.vim/.spacemacs ~/.spacemacs 62 | rm ~/.pylintrc 63 | ln -s ~/.vim/.pylintrc ~/.pylintrc 64 | rm ~/.pentadactylrc 65 | ln -s ~/.vim/.pentadactylrc ~/.pentadactylrc 66 | ln -s ~/.vim/.gdlintrc ~/.gdlintrc 67 | -------------------------------------------------------------------------------- /study.vim: -------------------------------------------------------------------------------- 1 | " copy all this into a vim buffer, save it, then... 2 | " source the file by typing :so % 3 | " Now the vim buffer acts like a specialized application for mastering vim 4 | 5 | " There are two queues, Study and Known. Depending how confident you feel 6 | " about the item you are currently learning, you can move it down several 7 | " positions, all the way to the end of the Study queue, or to the Known 8 | " queue. 9 | 10 | " type ,, (that's comma comma) 11 | " You know the command pretty well, but not enough to move it to 'Known'. 12 | " ,, moves the current command to the bottom of the 'Study' queue. 13 | nmap ,, ^v/^$dma/^= KnownP'azt 14 | 15 | " type ,c (that's comma c) 16 | " You don't really know the command at all and want to see it again soon. 17 | " ,c moves the current command down a several positions in the 'Study' queue 18 | " so you'll see it again soon. 19 | nmap ,c ^v/^$dma/^$/^$/^$/^$jP'azt:noh 20 | 21 | " type ,k (that's comma k) 22 | " You have the command down cold. Move it to the 'Known' queue. 23 | " ,k moves the current command into the 'Known' queue. 24 | nmap ,k ^v/^$dma/^= KnownjjP'azt 25 | 26 | " Ok, it's time to get this party started. Move to the top of the study queue 27 | " and go for it! 28 | /^= Study 29 | normal jztj 30 | nohls 31 | 32 | " This line keeps the rest of the file from being treated as vimscript 33 | finish 34 | 35 | ----------------------------------------------------------------------------- 36 | 37 | = Study 38 | 39 | - 40 | in normal mode, how do you move to the first non-whitespace character of the previous line 41 | 42 | + 43 | in normal mode, how do you move to the first non-whitespace character of the next line 44 | 45 | g`" 46 | how do you nondestructively move back to the last position when the buffer was closed 47 | 48 | :help shell 49 | how can you see what *all* the commands starting with 'shell' when considering getting help 50 | 51 | :!mkdir -p %:h 52 | if you have a file that you can't save because its directory doesn't exist, how can you create that directory from the path component of the file? 53 | 54 | :set textwidth=78 55 | how do you make vim hard wrap at 78 chars? 56 | 57 | :s/\v([a-z])([A-Z])/\1_\L\2/g 58 | turn camelCase into snake_case 59 | 60 | :s/\%V\v([a-z])([A-Z])/\1_\L\2/g 61 | turn camelCase into snake_case (in only the visually selected part of the line) 62 | 63 | :s/\v_([a-z])/\u\1/g 64 | turn snake_case into camelCase 65 | 66 | :s/\%V\v_([a-z])/\u\1/g 67 | turn snake_case into camelCase (in only the visually selected part of line) 68 | 69 | :'<,'>normal @q 70 | run the macro recorded into the q register on all selected lines (the '<,'> is automatically added) 71 | 72 | :let @q="2dw" 73 | easily fill the q register with a macro that deletes two words 74 | 75 | norm 76 | what's a good shorthand for "normal" on the #vim_command_line 77 | 78 | :argdo norm @q 79 | run your last macro against all files in the args 80 | 81 | :.,. w !sh 82 | execute the contents of the current line in the current file in sh 83 | 84 | 85 | if you have ctags working correctly, how do you jump to the definition of a function? 86 | 87 | 88 | if you've made a ctag jump, how can you jump back other than ? 89 | 90 | gi 91 | if you left insert mode to go look at something elsewhere in the file, how can you get back to where you were and also back into insert mode? 92 | 93 | :tag save 94 | if you want to look up the definition of save using ctags 95 | 96 | :w !sh 97 | run the visually selected lines in the shell (not run as a filter) 98 | 99 | g?(some movement) 100 | rot13 the text selected by some movement 101 | 102 | :all 103 | open in window for each file in the arguments list 104 | 105 | :args 106 | display the argument list 107 | 108 | :reg 109 | show the contents of all registers 110 | 111 | :tj 112 | jump to tag on top of tag stack 113 | 114 | :reg a 115 | show the contents of register a 116 | 117 | :10,30!wc 118 | filter lines 10-30 through an external command (in this case wc) 119 | 120 | 8 121 | insert the character represented by the ASCII value 8 122 | 123 | :43,45d 124 | delete lines 43-45 (can specify any range before the d) 125 | 126 | H 127 | go to the top of the screen 128 | 129 | "a20yy 130 | add the next 20 lines to the 'a' register 131 | 132 | g~(some movement) 133 | switch case for movement command 134 | 135 | o 136 | in visual mode, exchange cursor position with the start/end of highlighting 137 | 138 | !10jwc 139 | filter the next 10 lines through an external command (in this case wc) 140 | 141 | 20!!wc 142 | filter the next 20 lines through an external command (in this case wc) 143 | 144 | 20H 145 | go to the line that is 20 lines below the line that is currently the top of the window 146 | 147 | M 148 | go to the middle of the window 149 | 150 | L 151 | go to the bottom of the window 152 | 153 | 10L 154 | go to the tenth line from the bottom of the window 155 | 156 | 20% 157 | go to the line that is 20% of the way down in the file 158 | 159 | `a 160 | go to the exact position of mark a (not just the beginning of the line like 'a) 161 | 162 | 163 | Go down half a screen 164 | 165 | 166 | Go up half a screen 167 | 168 | 0 169 | move to the start of the line (before whitespace) 170 | 171 | 172 | see location in file and file status 173 | 174 | :set ignorecase (or :set ic) 175 | ignore case when searching 176 | 177 | R 178 | enter replace mode to repeatedly replace the character under the cursor 179 | 180 | :w filename 181 | write the visually selected text to a file 182 | 183 | e 184 | Go to end of (next) word 185 | 186 | ge 187 | Go to end of previous word 188 | 189 | U 190 | restore last changed line 191 | 192 | :set relativenumber 193 | show the line numbers relative to the current cursor position 194 | 195 | g* 196 | Forward find word under cursor (fuzzy) 197 | 198 | g# 199 | Backward find word under cursor (fuzzy) 200 | 201 | # 202 | Backward find word under cursor 203 | 204 | some_command | vim -R - 205 | when in the shell, you can use vim as a pager by piping STDIN to it and putting it in readonly mode 206 | 207 | :set cursorline 208 | highlight the entire line the cursor is on 209 | 210 | Q 211 | when in normal mode, how do you enter into Ex mode (to do extended work in the #vim_command_line) 212 | 213 | /usr/share/vim 214 | in Ubuntu, which folder has the default, system-wide vim files 215 | 216 | :map ,, :w\|:!ruby % 217 | how would you map ,, to writing the current buffer, then running it with ruby 218 | 219 | :!! 220 | repeat the last :! command 221 | 222 | :set colorcolumn=78 223 | in vim 703 and above, how do you specify that you'd like column 78 to be colored, so that you can see whether you are passing an ideal width 224 | 225 | text objects 226 | what do you call the higher level contexts than editing character by character? 227 | 228 | readline vi mode (tagged as #readline_vi_mode) 229 | what's it called when you use vim as your line editor in the shell? 230 | 231 | v 232 | how do you open an editor while the shell is in #readline_vi_mode 233 | 234 | g_ 235 | move to the last non-whitespace character on a line 236 | 237 | bindkey -v 238 | in zsh, how can you use #readline_vi_mode? 239 | 240 | ciw 241 | change a word without necessarily being selected on the first letter of the word 242 | 243 | daw 244 | change the phrase "foo hello" to just "hello" (with cursor located at f*oo hello) 245 | 246 | v 247 | if you're using vim as your line editor, how can you turn it in to a full vim session 248 | 249 | yy@" 250 | execute the vim code in the current line. To execute it in the shell, type :! at the beginning of the line 251 | 252 | mA 253 | mark: set a mark in the 'A' register (globally) 254 | 255 | gu 256 | make the selected text lower case 257 | 258 | gU 259 | make the selected text upper case 260 | 261 | " 262 | paste yanked text into the #vim_command_line 263 | 264 | 'A 265 | mark: return to a globally set mark, even if in another buffer 266 | 267 | 268 | line completion 269 | 270 | 271 | move forward in the jump list 272 | 273 | 274 | move backward in the jump list 275 | 276 | gf 277 | open file under the cursor 278 | 279 | :%s/\r//g 280 | remove all those nasty ^M characters from the end of each line in a file 281 | 282 | = 283 | autoindent lines already selected in visual mode 284 | 285 | == 286 | autoindent current line 287 | 288 | 289 | in insert mode switch to normal mode for one command 290 | 291 | gqap 292 | format the current paragraph 293 | 294 | :jumps 295 | list your movements 296 | 297 | :history 298 | list your recent commands 299 | 300 | guu 301 | lower case the whole line 302 | 303 | gUU 304 | upper case the whole line 305 | 306 | display hex and ASCII value of character under cursor 307 | ga 308 | 309 | g8 310 | display hex value of utf-8 character under cursor 311 | 312 | ggg?G 313 | rot13 whole file 314 | 315 | '. 316 | jumps to last modified line 317 | 318 | `. 319 | jumps to exact position of last modification 320 | 321 | :h slash 322 | list all help topics containing the word "slash" 323 | 324 | g; 325 | go backward in the change list in a file 326 | 327 | g, 328 | go forward in the change list in a file 329 | 330 | "ayy 331 | yank the current line into register "a" 332 | 333 | :set fdm=syntax 334 | fold: make folding use syntax 335 | 336 | :set nofoldenable 337 | fold: turn off folding 338 | 339 | :set foldenable 340 | fold: turn on folding (if it has been turned off) 341 | 342 | zj 343 | fold: moves the cursor to the next fold 344 | 345 | zk 346 | fold: moves the cursor to the previous fold 347 | 348 | [z 349 | fold: move to start of current open fold 350 | 351 | ]z 352 | fold: Move to end of current open fold 353 | 354 | :map 355 | show what is currently mapped to 356 | 357 | :map 358 | show all the mappings 359 | 360 | :reg 361 | show the content of all registers 362 | 363 | :43,45 ce 80 364 | center the lines from 43 to 45 within an 80 char width 365 | 366 | zr 367 | fold: decrease the fold level by one 368 | 369 | aw 370 | in visual mode, select a whole word 371 | 372 | as 373 | in visual mode, select a whole sentence 374 | 375 | zm 376 | fold: increase the fold level by one 377 | 378 | 379 | toggle between last two buffers 380 | 381 | gm 382 | go to the center of the screen on the current line 383 | 384 | ]p 385 | Paste below the current line, adjusting indentation to match current line 386 | 387 | gP 388 | paste register above current line, leaving cursor after new text 389 | 390 | gp 391 | paste register below current line, leaving cursor after new text 392 | 393 | a 394 | insert the content of register a while in insert mode 395 | 396 | [p 397 | Paste above the current line, adjusting indentation to match current line 398 | 399 | :%norm @x 400 | Execute the macro recorded in register x on all lines of the current file 401 | 402 | :norm @x 403 | Execute the macro recorded in register x on a visually selected set of lines 404 | 405 | =5*5 406 | in the #vim_command_line and in insert mode, insert the result of a 5*5 calculation 407 | 408 | gk 409 | move cursor one *screen* line up, regardless of line wrapping 410 | 411 | gj 412 | move cursor one *screen* line down, regardless of line wrapping 413 | 414 | qQ ... added commands ... q 415 | append more commands to a pre-existing @q register macro 416 | 417 | :Rextract _partial_name.erb 418 | rails.vim: extract some functionality into a partial 419 | 420 | :Rintegrationtest 421 | open the cucumber feature with that name [tag:setup_specific:gem] 422 | 423 | 424 | (while searching or ex mode) do previous search or command 425 | 426 | 427 | (while searching or ex mode) do next search or command 428 | 429 | 430 | (while searching or ex mode) see previous searches or commands 431 | 432 | :%s/forward//gn 433 | count the number of occurrences of "forward" in a file 434 | 435 | q: 436 | see previous commands in a "command-line window" 437 | 438 | q/ 439 | see previous searches 440 | 441 | { 442 | back a paragraph 443 | 444 | } 445 | forward a paragraph 446 | 447 | ( 448 | back a sentence 449 | 450 | ) 451 | forward a sentence 452 | 453 | % 454 | find matching parenthesis 455 | 456 | J 457 | join two lines 458 | 459 | gq 460 | reformat the selected text 461 | 462 | xp 463 | transpose two letters (delete and paste, technically) 464 | 465 | e 466 | move to the end of the word 467 | 468 | ea 469 | append at end of word 470 | 471 | w 472 | move the cursor forward by a word 473 | 474 | b 475 | move the cursor backward by a word 476 | 477 | 478 | in insert or the #vim_command_line this turns the next thing typed into a literal 479 | 480 | :set spell 481 | Switch on spell checking 482 | 483 | 484 | in insert mode correct the spelling of the current word 485 | 486 | jjjI// 487 | block comment the next three JavaScript lines 488 | 489 | "+y 490 | copy the current selection to a clipboard where other programs can use it 491 | 492 | ci" 493 | change all the words in between two quotes 494 | 495 | / 496 | switch to search command mode, then copy in the word under the cursor 497 | 498 | :cn 499 | Go to the next item in the quickfix list 500 | 501 | :cp 502 | Go to the previous item in the quickfix list 503 | 504 | i: 505 | insert last #vim_command_line command 506 | 507 | i/ 508 | insert last search command 509 | 510 | :10,30w foo.txt 511 | write lines 10-30 to a file named foo.txt 512 | 513 | :10,30w>>foo.txt 514 | append lines 10-30 to a file named foo.txt 515 | 516 | :r !ls 517 | insert results of ls external command below cursor 518 | 519 | :r file 520 | insert content of file below cursor 521 | 522 | & 523 | repeat last substitution 524 | 525 | :bm 526 | go to next modified buffer 527 | 528 | :w !sudo tee % 529 | save the current file as root (in case you opened it up without sudo accidentally and made changes to it) 530 | 531 | : 532 | in Ex mode, insert the last command 533 | 534 | 535 | In insert mode, insert the character right above the cursor 536 | 537 | 538 | In insert mode, delete the current line from the cursor position to the beginning of the line 539 | 540 | 541 | In insert mode, re-insert the text inserted in the previous insert session 542 | 543 | / 544 | in Ex mode, insert the last search 545 | 546 | 547 | When typing something into the #vim_command_line, switch to the editable command-line mode where the command line becomes a fully vim-compatible text area 548 | 549 | o 550 | when in a visual selection, which key will toggle to the other end of the selection? 551 | 552 | :h i_CTRL-R 553 | get help for how control r is used in insert mode 554 | 555 | :h c_CTRL-R 556 | get help for how control r is used in command mode 557 | 558 | :s/\%V //g 559 | remove all the spaces from the current visual selection, which is only a partial line, not a full line 560 | 561 | :retab 562 | if expandtab is set, this will change all the tabs to spaces, expanding them as appropriate 563 | 564 | _ 565 | maximize size of window split 566 | 567 | I 568 | insert at the beginning of the line 569 | 570 | gv 571 | remark area that was just marked 572 | 573 | ZZ 574 | same as :wq 575 | 576 | 577 | redraw the screen 578 | 579 | 580 | completes using filenames from the current directory. 581 | 582 | 583 | block selection (column editing) 584 | 585 | zo 586 | fold: open a fold at the cursor 587 | 588 | D 589 | delete to the end of the line 590 | 591 | C 592 | change to the end of the line 593 | 594 | :so $MYVIMRC 595 | reload the vimrc file (or ":so %" if you happen to be editing the file) 596 | 597 | A 598 | append at the end of the line 599 | 600 | 601 | decrement a number on the same line when in normal mode (can be used with n before it) 602 | 603 | 604 | increment a number on the same line when in normal mode (can be used with n before it) 605 | 606 | m 607 | NERDTree: opens the filesystem menu for a file, allowing you to remove, rename, etc 608 | 609 | ma 610 | mark: set a mark in the 'a' register in the current buffer 611 | 612 | `a 613 | mark: return to the 'a' mark in the current buffer 614 | 615 | 616 | next 617 | 618 | 619 | old 620 | 621 | ~ 622 | uppercase or lowercase the character under the cursor 623 | 624 | . 625 | repeat the last command 626 | 627 | 628 | switch between windows 629 | 630 | [I 631 | show lines containing the word under the cursor 632 | 633 | redir @a 634 | redirect the output of an Ex command into buffer a 635 | 636 | g? 637 | reverse the characters in a visual selection 638 | 639 | :gui 640 | switch to the gui version 641 | 642 | :g/foo/p 643 | list all the matches with prepended line numbers in ex command output 644 | 645 | 646 | insert previously inserted text (in insert mode) 647 | 648 | 649 | delete word before cursor in insert mode 650 | 651 | 652 | delete all inserted text on the line (in insert mode) 653 | 654 | :echo line('.') 655 | in the #vim_command_line, echo the current line number 656 | 657 | va( 658 | visually select *around* a set of parentheses. Try it by moving the cursor (somewhere in here) and trying it 659 | 660 | redir @a | :g/someregex/ 661 | Capture the lines that match a certain regex into the @a register for pasting 662 | 663 | rm /tmp/clip.txt ; vim -c "normal \"+p" -c "wq" /tmp/clip.txt 664 | Save the contents of the clipboard to a file by opening, pasting into, and closing vim. 665 | 666 | gD 667 | go to the first occurrence in the file of the word under the cursor 668 | 669 | gj 670 | go to next visual line, even if text wrapped 671 | 672 | %s/\v(.*\n){5}/&\r 673 | insert a blank line every 5 lines 674 | 675 | '' 676 | go to the position before the latest jump 677 | 678 | Fx 679 | move the cursor backward to the previous occurrence of the character x on the current line. 680 | 681 | 682 | scroll back one page 683 | 684 | :undolist 685 | list the leaves in the tree of the undo changes 686 | 687 | g+ 688 | go to a newer text state (like , but will move forward through all text states on multiple undo branches) 689 | 690 | g- 691 | go to an older text state (like , but will move backwards through all text states on multiple undo branches) 692 | 693 | fx 694 | move the cursor forward to the next occurrence of the character x on the current line 695 | 696 | Tx 697 | move the cursor backward to right before the previous occurrence of the character x on the current line. 698 | 699 | x 700 | exchange the window with the next window (like if you split a new buffer into the wrong window location) 701 | 702 | M 703 | move the cursor to the middle of the screen 704 | 705 | zt 706 | scroll current line to top of page 707 | 708 | tx 709 | same as fx, but moves the cursor to right before the character, not all the way to it. 710 | 711 | 712 | scroll forward one page 713 | 714 | zz 715 | move current line to middle of page 716 | 717 | ; 718 | repeat the last f/F/t/T command you gave 719 | 720 | 721 | scroll one line up 722 | 723 | 724 | scroll one line down 725 | 726 | ]m 727 | forward to start of next method 728 | 729 | [m 730 | backward to start of previous method 731 | 732 | zh 733 | scroll one character to the right 734 | 735 | zl 736 | scroll one character to the left 737 | 738 | zH 739 | scroll half a screen to the right 740 | 741 | zL 742 | scroll half a screen to the left 743 | 744 | zb 745 | scroll current line to bottom of page 746 | 747 | set -o vi 748 | in a the bash shell, how can you use #readline_vi_mode? 749 | 750 | 751 | return from tag jump. For example, in help, if you've followed a link, how do you go back? 752 | 753 | 754 | jump to tag under cursort (for example, following a link in help) 755 | 756 | K 757 | look up the word under the cursor in man 758 | 759 | tabularize 760 | What's the name of a plugin that will help you align stuff 761 | 762 | VG:norm @x 763 | replay a vim macro recorded into register x on all lines between the current line and the bottom of the buffer 764 | 765 | %g/foo/s/bar/xxx/g 766 | On every line containing foo *anywhere* in the line (before or after the bar), replace every occurrence of bar with xxx 767 | 768 | :'<,'>!uniq | sort 769 | With some lines selected, how can I run them through external commands, substituting the result? 770 | 771 | :put =@% 772 | insert the file directory/filename for the current file into the buffer 773 | 774 | "Ayy 775 | Append the yank of the current line into the 'a' buffer 776 | 777 | %v/bar/m$ 778 | move every line that *does not* contain bar to the end of the file 779 | 780 | :verb set ballooneval? 781 | how can you check who last set ballooneval 782 | 783 | %s/\v("[a-z_]+"): /\1 => /g 784 | replace "foo": with "foo" => (to turn JSON into acceptable Ruby) 785 | 786 | %s/\v +$//g 787 | remove trailing spaces from all lines 788 | 789 | cs"' 790 | how would you change the text "foo hello there" to 'foo hello there' using vim-surround? 791 | 792 | :cold 793 | show the older error list in the quickfix window (error lists are referred to as being in the quickfix stack) 794 | 795 | :cnew 796 | show the newer error list in the quickfix window (error lists are referred to as being in the quickfix stack) 797 | 798 | @: 799 | repeat the last command-line 800 | 801 | "_dd ("_ is the black hole buffer) 802 | delete a line without overriding the buffer 803 | 804 | 805 | open the file listed in quickfix in a horizontal split 806 | 807 | :g/^/m0 808 | reverse the vertical order of all the lines 809 | 810 | :only 811 | if you have a bunch of windows open, close all the other windows, making the current window the only window 812 | 813 | vim +NERDTree 814 | From the shell command line (not vim's command line) how can you easily run a vim command? 815 | 816 | :AS 817 | with rails.vim, how do you open the rspec tests when you are in a model? 818 | 819 | & 820 | repeat last substitution 821 | 822 | ds" 823 | if you have the surround plugin, how would you remove the double quotes from "hello" when inside it? 824 | 825 | vim filename -c 'execute "normal \"' 826 | how can you decrement the first number on the first line of the file? (how would you property escape the ?) 827 | 828 | /\cruby 829 | do a case-insensitive search for ruby (the \c can be anywhere, including at the end) 830 | 831 | = Known 832 | 833 | :wq 834 | write the file and quit. This is basically here just so that there's something in the "Known" queue. 835 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "class-name": true, 4 | "comment-format": [true, "check-space"], 5 | "indent": [true, "spaces"], 6 | "jsdoc-format": true, 7 | "no-angle-bracket-type-assertion": true, 8 | "no-duplicate-variable": true, 9 | 10 | "no-eval": true, 11 | "no-any": true, 12 | "no-reference": true, 13 | "no-conditional-assignment": true, 14 | "no-duplicate-key": false, 15 | "no-empty": true, 16 | "no-internal-module": true, 17 | "no-trailing-whitespace": true, 18 | "no-shadowed-variable": true, 19 | "no-unreachable": true, 20 | "trailing-comma": [ 21 | true, 22 | { 23 | "multiline": "always" 24 | } 25 | ], 26 | "no-var-keyword": false, 27 | "one-line": [true, "check-open-brace", "check-whitespace", "check-else"], 28 | "quotemark": [true, "double"], 29 | "semicolon": [true, "always"], 30 | "triple-equals": [true, "allow-null-check", "allow-undefined-check"], 31 | "typedef-whitespace": [ 32 | true, 33 | { 34 | "call-signature": "nospace", 35 | "index-signature": "nospace", 36 | "parameter": "nospace", 37 | "property-declaration": "nospace", 38 | "variable-declaration": "nospace" 39 | }, 40 | { 41 | "call-signature": "onespace", 42 | "index-signature": "onespace", 43 | "parameter": "onespace", 44 | "property-declaration": "onespace", 45 | "variable-declaration": "onespace" 46 | } 47 | ], 48 | "variable-name": [ 49 | true, 50 | "ban-keywords", 51 | "check-format" 52 | ], 53 | "whitespace": [ 54 | true, 55 | "check-branch", 56 | "check-decl", 57 | "check-operator", 58 | "check-module", 59 | "check-separator", 60 | "check-type", 61 | "check-typecast" 62 | ] 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /ubuntu.sh: -------------------------------------------------------------------------------- 1 | #install vim7.4 2 | 3 | 4 | sudo apt-get install 5 | -------------------------------------------------------------------------------- /uninstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "uninstall vim configurations!" 4 | echo "please input yes or no to continue:" 5 | read ans 6 | while [[ "$ans" != "yes" && "$ans" != "no" ]] 7 | do 8 | echo "you must input yes or no to continue!" 9 | read ans 10 | done 11 | 12 | if [ "$ans" == "yes" ]; then 13 | cd ~ 14 | 15 | rm -f .vimrc 16 | rm -f .gvimrc 17 | 18 | rm -rf .vim 19 | else 20 | echo "exit,do nothing." 21 | fi 22 | -------------------------------------------------------------------------------- /vimrc: -------------------------------------------------------------------------------- 1 | " VIM Configuration File 2 | " Copyright: Common CC 3.0 3 | " Author: guanghui qu 4 | " 5 | set nocompatible 6 | filetype off 7 | 8 | function! GetRunningOS() 9 | if has("win32") 10 | return "win" 11 | endif 12 | if has("unix") 13 | if system('uname')=~'Darwin' 14 | return "mac" 15 | else 16 | return "linux" 17 | endif 18 | endif 19 | endfunction 20 | 21 | let os = GetRunningOS() 22 | 23 | if os=="win" 24 | set guioptions-=m 25 | set guioptions-=T 26 | language message zh_CN.utf-8 27 | endif 28 | 29 | 30 | "Let Vundle manage Vbundle{{{ 31 | if os == "mac" || os == "linux" 32 | set rtp+=~/.vim/bundle/vundle/ 33 | call vundle#rc() 34 | endif 35 | 36 | if os == "win" 37 | set rtp+=~/dotfiles/bundle/vundle/ 38 | let path='~/dotfiles/bundle' 39 | call vundle#rc(path) 40 | endif 41 | "}}} 42 | 43 | " source vundle plugis 44 | if os == "win" 45 | source ~/dotfiles/bundles.vim 46 | else 47 | source ~/.vim/bundles.vim 48 | endif 49 | 50 | filetype plugin indent on 51 | 52 | "keymaping for golang{{{" 53 | filetype off 54 | filetype plugin indent off 55 | set rtp+=$GOROOT/misc/vim 56 | "}}} 57 | 58 | " load plugins that ship with Vim {{{ 59 | filetype on 60 | runtime macros/matchit.vim 61 | runtime ftplugin/man.vim 62 | "}}} 63 | 64 | " Disable swapfile and backup {{{ 65 | set nobackup 66 | set noswapfile 67 | "}}} 68 | 69 | "remap leader key{{{ 70 | let mapleader = "\" 71 | "}}} 72 | 73 | "some common configs {{{ 74 | "map visual mode vertical selectoin" 75 | nmap v 76 | set fenc=utf-8 77 | set termencoding=utf-8 78 | set fileencodings=utf-8 79 | set encoding=utf-8 "if not set, the powerline plugins won't work 80 | if os == "win" 81 | set fileencoding=chinese 82 | endif 83 | set autoindent 84 | set tabstop=4 " tab width is 4 spaces 85 | set shiftwidth=4 " indent also with 4 spaces 86 | set softtabstop=4 87 | set expandtab 88 | set textwidth=80 89 | set relativenumber 90 | set t_Co=256 91 | " set relativenumber 92 | set number 93 | set hidden 94 | set showmatch 95 | set comments=sl:/*,mb:\ *,elx:\ */ 96 | " Use the same symbols as TextMate for tabstops and EOLs 97 | set listchars=tab:▸\ ,eol:¬ 98 | set autoread 99 | set title 100 | set matchpairs+=<:> 101 | set ruler 102 | set backspace=indent,eol,start 103 | map Y y$ 104 | " Change K from being mapped to interactive man pages to being used as the 105 | " vanilla comma ',' key's functionality (intra-line backwards search repeat for 106 | " any t, T, f, F searches). 107 | nnoremap K , 108 | vnoremap K , 109 | set laststatus=2 110 | set pastetoggle= 111 | set nolist 112 | syntax on 113 | "}}} 114 | 115 | "Tab-completion in command-line mode{{{ 116 | set wildmenu 117 | set wildmode=longest:full 118 | set wildignore=*.pdf 119 | "}}} 120 | 121 | 122 | "search" {{{ 123 | set incsearch 124 | set hls 125 | nnoremap nl :nohlsearch 126 | nnoremap :%s///gn 127 | vnoremap < >gv 129 | nnoremap n nzz 130 | nnoremap N Nzz 131 | nnoremap * *zz 132 | nnoremap # #zz 133 | nnoremap g* g*zz 134 | nnoremap g# g#zz 135 | vnoremap "hy:%s/h//gc 136 | "}}} 137 | 138 | "better command line editing {{{ 139 | cnoremap 140 | cnoremap 141 | "}}} 142 | 143 | 144 | " config ctags file locations {{{ 145 | set tags+=./tags 146 | set tags+=~/.vim/tags/cpp 147 | " let g:ProjTags = [ "~/workspace" ] 148 | let g:ProjTags = [["~/workspace/cocos2d-html5", "~/.vim/tags/cocos2d-html5/cocos2d/tags", "~/.vim/tags/cocos2d-html5/chipmunk/tags","~/.vim/tags/cocos2d-html5/box2d/tags","~/.vim/tags/cocos2d-html5/CocosDenshion/tags","~/.vim/tags/cocos2d-html5/extensions/tags"]] 149 | let g:ProjTags += [["~/workspace/cocos2d-x","~/.vim/tags/cocos2d-x/cocos2dx/tags","~/.vim/tags/cocos2d-x/chipmunk/tags","~/.vim/tags/cocos2d-x/Box2d/tags","~/.vim/tags/cocos2d-x/CocosDenshion/tags","~/.vim/tags/cocos2d-x/extensions/tags"]] 150 | let g:ProjTags += [[ "~/workspace/opencv","~/.vim/tags/opencv/tags" ]] 151 | "}}} 152 | 153 | " configure for DoxygenToolkit plugin {{{ 154 | let g:DoxygenToolkit_briefTag_pre="@brief " 155 | let g:DoxygenToolkit_paramTag_pre="@param " 156 | let g:DoxygenToolkit_returnTag="@Returns " 157 | let g:DoxygenToolkit_blockHeader="--------------------------------------------------------------------------" 158 | let g:DoxygenToolkit_blockFooter="----------------------------------------------------------------------------" 159 | let g:DoxygenToolkit_authorName="guanghui.qu " 160 | let g:DoxygenToolkit_licenseTag="MIT License" 161 | "create doxygen comment 162 | map dd :Dox 163 | map da :DoxAuthor 164 | map dl :DoxLic 165 | "}}} 166 | 167 | 168 | 169 | "plugins key maps" {{{ 170 | "--commentary plugin,comment a line 171 | map / \\\ 172 | map ; \\\ 173 | "go back and forth from header file and source file 174 | nmap f :A 175 | "open a tag list ivew 176 | nmap ta :TagbarToggle 177 | "disable default buffergator keymaps" 178 | let g:buffergator_suppress_keymaps = 1 179 | 180 | "config for ZoomWin plugin map 181 | nmap ,o :ZoomWin 182 | 183 | "config for BufferNavigator" 184 | nmap bf :BufExplorer 185 | "}}} 186 | 187 | "nerdTree plugin config {{{ 188 | " autocmd vimenter * NERDTree 189 | nmap n :NERDTreeToggle 190 | let NERDTreeShowHidden=1 191 | " bufkill bd's: really do not mess with NERDTree buffer 192 | nnoremap :BD 193 | nnoremap :BD! 194 | 195 | " Prevent :bd inside NERDTree buffer 196 | au FileType nerdtree cnoreabbrev bd 197 | au FileType nerdtree cnoreabbrev BD 198 | "}}} 199 | 200 | "better tag navigation from www.vimbits.com {{{ 201 | nnoremap 202 | "}}} 203 | 204 | 205 | "automatically save foldings in vim{{{ 206 | " au BufWinLeave * silent! mkview 207 | " au BufWinEnter * silent! loadview 208 | "}}} 209 | 210 | "map markdown to html {{{ 211 | nmap md :%!/usr/local/bin/Markdown.pl --html4tags 212 | "}}} 213 | 214 | "map leader 1 for display cursorline {{{ 215 | :nnoremap 1 :set cursorline! cursorcolumn! 216 | "}}} 217 | 218 | 219 | "map windows command {{{ 220 | nmap j 221 | nmap k 222 | nmap h 223 | nmap l 224 | nmap ,c c 225 | nmap , 226 | nnoremap j gj 227 | nnoremap k gk 228 | "}}} 229 | 230 | "maps from janus{{{ 231 | 232 | " format the entire file 233 | nnoremap fef :normal! gg=G`` 234 | 235 | " upper/lower word 236 | nmap u mQviwU`Q 237 | nmap l mQviwu`Q 238 | 239 | " upper/lower first char of word 240 | nmap U mQgewvU`Q 241 | nmap L mQgewvu`Q 242 | 243 | " cd to the directory containing the file in the buffer 244 | nmap cd :lcd %:h 245 | 246 | nmap md :!mkdir -p %:p:h 247 | 248 | " Swap two words 249 | nmap gw :s/\(\%#\w\+\)\(\_W\+\)\(\w\+\)/\3\2\1/`' 250 | 251 | " Underline the current line with '=' 252 | nmap ul :t.Vr= 253 | 254 | " set text wrapping toggles 255 | " nmap tw :set invwrap:set wrap? 256 | 257 | " find merge conflict markers 258 | nmap fc /\v^[< = >]{7}( .*\|$) 259 | 260 | 261 | " Toggle hlsearch with hs 262 | nmap hs :set hlsearch! hlsearch? 263 | 264 | " Adjust viewports to the same size 265 | " map = = 266 | 267 | "}}} 268 | 269 | "config syntastic {{{ 270 | let g:syntastic_check_on_open=1 271 | let g:syntastic_cpp_include_dirs = ['/usr/include/'] 272 | let g:syntastic_cpp_remove_include_errors = 1 273 | let g:syntastic_cpp_check_header = 1 274 | let g:syntastic_cpp_compiler = 'clang++' 275 | let g:syntastic_cpp_compiler_options = '-std=c++11 -stdlib=libstdc++' 276 | "set error or warning signs 277 | let g:syntastic_error_symbol = '✗' 278 | let g:syntastic_warning_symbol = '⚠' 279 | " let g:syntastic_debug = 1 280 | let g:syntastic_python_checkers=['flake8'] 281 | let g:syntastic_python_flake8_post_args='--ignore=E501,E128' 282 | "whether to show balloons 283 | let g:syntastic_enable_balloons = 1 284 | "}}} 285 | 286 | 287 | "set colorscheme {{{ 288 | syntax enable 289 | set background=dark 290 | colorscheme wombat 291 | "}}} 292 | 293 | "config tagbar plugin {{{ 294 | let Tlist_Use_Right_Window = 1 295 | "}}} 296 | 297 | 298 | "solarized colorschema config{{{ 299 | let g:solarized_diffmode="low" 300 | "}}} 301 | 302 | " Ctlr-P {{{ 303 | nmap p :CtrlP 304 | nmap xb :CtrlPBuffer 305 | let g:ctrlp_open_multiple_files = 'v' 306 | 307 | set wildignore+=*/tmp/*,*.so,*.swp,*.zip 308 | let g:ctrlp_max_height = 100 309 | let g:ctrlp_custom_ignore = { 310 | \ 'dir': '\v[\/]\.(git)$', 311 | \ 'file': '\v\.(log|jpg|png|jpeg)$', 312 | \ } 313 | set wildignore+=*.pyc 314 | set wildignore+=*_build/* 315 | set wildignore+=*.o 316 | "}}} 317 | 318 | 319 | "Configuration for tabular plugin {{{ 320 | nmap = :Tabularize /= 321 | vmap = :Tabularize /= 322 | nmap : :Tabularize /: 323 | vmap : :Tabularize /: 324 | "}}} 325 | 326 | "english spell check {{{ 327 | nmap s :set spell! 328 | " Set region to British English 329 | set spelllang=en_gb 330 | "}}} 331 | 332 | " map Gundo plugin toggle {{{ 333 | " nnoremap U ::GundoToggle 334 | "}}} 335 | 336 | 337 | "command line editing key maps {{{ 338 | cnoremap %% getcmdtype() == ':' ? expand('%:h').'/' : '%%' 339 | map ew :e %% 340 | map es :sp %% 341 | map ev :vsp %% 342 | map et :tabe %% 343 | " Prompt to open file with same name, different extension 344 | map er :e =expand("%:r")."." 345 | "}}} 346 | 347 | 348 | "configure for running opencv {{{ 349 | if !has("win32") 350 | " add command to complie opencv program" 351 | nnoremap 2 : call Compilerunopencv() 352 | 353 | function! Compilerunopencv() 354 | let IncDir = "/usr/local/include" 355 | let LibDir = "/usr/local/lib" 356 | let Libs = "-lopencv_core -lopencv_highgui -lopencv_imgproc" 357 | exec "w" 358 | exec "lcd %:p:h" 359 | exec "r !g++ -I" . IncDir . " -L" . LibDir . " *.cpp " . Libs . " -o %< " 360 | echo "compile finished!" 361 | exec "!./%<" 362 | endfunction 363 | endif 364 | "}}} 365 | 366 | 367 | 368 | " Generate tags on save. Note that this regenerates tags for all files in current folder {{{ 369 | function! GenerateTagsFile() 370 | exec ":!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q ." 371 | endfunction 372 | 373 | function! GenerateJsTags() 374 | exec ":!jsctags ." 375 | endfunction 376 | 377 | nnoremap 8 :call GenerateTagsFile() 378 | nnoremap 9 :call GenerateJsTags() 379 | "}}} 380 | 381 | " Always change to directory of the buffer currently in focus {{{ 382 | nmap cd :cd %:p:h 383 | inoremap \fn =expand("%:t:r") 384 | "}}} 385 | 386 | 387 | 388 | " add cpp11 syntax support {{{ 389 | let g:syntastic_cpp_compiler_options = ' -std=c++11' 390 | "run cpp11 code" 391 | if !has("win32") 392 | nmap rr :!clang++ -std=c++11 -stdlib=libc++ -o %:r % && ./%:r 393 | endif 394 | 395 | if has("win32") || has("win64") 396 | nmap rr :!clang++ -std=c++11 -stdlib=libc++ 397 | \ -IC:/MinGW/include 398 | \ -IC:/MinGW/lib 399 | \ -IC:/MinGW/lib/gcc/mingw32/4.6.2/include/c++ 400 | \ -IC:/MinGW/lib/gcc/mingw32/4.6.2/include/c++/mingw32 401 | \ -o %:r % && %:r 402 | endif 403 | 404 | if has("win32") || has("win64") 405 | " fix cygwin shell redirection 406 | set shellredir=>\"%s\"\ 2>&1 407 | endif 408 | 409 | "}}} 410 | 411 | "add octrpress publish blog key mappings {{{ 412 | nmap ,3 :!noglob rake generate 413 | nmap ,4 :!noglob rake deploy 414 | "}}} 415 | 416 | "add auto complete feature to vim 417 | let g:neocomplcache_enable_at_startup = 1 418 | 419 | " Better navigating through omnicomplete option list {{{ 420 | " See http://stackoverflow.com/questions/2170023/how-to-map-keys-for-popup-menu-in-vim 421 | set completeopt=longest,menuone 422 | function! OmniPopup(action) 423 | if pumvisible() 424 | if a:action == 'j' 425 | return "\" 426 | elseif a:action == 'k' 427 | return "\" 428 | endif 429 | endif 430 | return a:action 431 | endfunction 432 | 433 | inoremap =OmniPopup('j') 434 | inoremap =OmniPopup('k') 435 | "}}} 436 | 437 | " Settings for python-mode {{{ 438 | " cd ~/.vim/bundle 439 | " git clone https://github.com/klen/python-mode 440 | map g :call RopeGotoDefinition() 441 | let ropevim_enable_shortcuts = 1 442 | let g:pymode_rope_goto_def_newwin = "vnew" 443 | let g:pymode_rope_extended_complete = 1 444 | let g:pymode_breakpoint = 0 445 | let g:pymode_syntax = 1 446 | let g:pymode_syntax_builtin_objs = 0 447 | let g:pymode_syntax_builtin_funcs = 0 448 | let g:pymode_rope_complete_on_dot = 0 449 | "}}} 450 | 451 | " Folding rules {{{ 452 | set foldenable " enable folding 453 | set foldcolumn=3 " add a fold column 454 | set foldmethod=marker " detect triple-{ style fold markers 455 | set foldlevelstart=99 " start out with everything folded 456 | set foldopen=block,hor,insert,jump,mark,percent,quickfix,search,tag,undo 457 | " which commands trigger auto-unfold 458 | function! MyFoldText() 459 | let line = getline(v:foldstart) 460 | 461 | let nucolwidth = &fdc + &number * &numberwidth 462 | let windowwidth = winwidth(0) - nucolwidth - 3 463 | let foldedlinecount = v:foldend - v:foldstart 464 | 465 | " expand tabs into spaces 466 | let onetab = strpart(' ', 0, &tabstop) 467 | let line = substitute(line, '\t', onetab, 'g') 468 | 469 | let line = strpart(line, 0, windowwidth - 2 -len(foldedlinecount)) 470 | let fillcharcount = windowwidth - len(line) - len(foldedlinecount) - 4 471 | return line . ' …' . repeat(" ",fillcharcount) . foldedlinecount . ' ' 472 | endfunction 473 | set foldtext=MyFoldText() 474 | 475 | "c/c++/javascript/java fold method 476 | autocmd filetype c,cpp,javascript,java set foldmarker={,} 477 | 478 | nnoremap zO zCzO 479 | nnoremap za 480 | vnoremap za 481 | nnoremap ,z zMzv 482 | "}}} 483 | 484 | "configure for UltiSnips plugin {{{ 485 | let g:UltiSnipsExpandTrigger="" 486 | let g:UltiSnipsJumpForwardTrigger="" 487 | let g:UltiSnipsJumpBackwardTrigger="" 488 | "}}} 489 | 490 | "auto reload vimrc configuration {{{ 491 | au BufWritePost .vimrc so ~/.vimrc 492 | nmap vv :tabedit $MYVIMRC 493 | "}}} 494 | 495 | 496 | 497 | 498 | 499 | "keymaps for c/c++ development{{{ 500 | " Reparse the current translation unit in background 501 | command! Parse call g:ClangBackgroundParse() 502 | " Reparse the current translation unit and check for errors 503 | command! ClangCheck call g:ClangUpdateQuickFix() 504 | 505 | " Set the most common used run command 506 | if has('win32') || has('win64') || has('os2') 507 | let g:common_run_command='$(FILE_TITLE)$' 508 | else 509 | let g:common_run_command='./$(FILE_TITLE)$' 510 | endif 511 | 512 | " SingleCompile for C++ with Clang 513 | function! s:LoadSingleCompileOptions() 514 | call SingleCompile#SetCompilerTemplate('c', 515 | \'clang', 516 | \'the Clang C and Objective-C compiler', 517 | \'clang', 518 | \'-o $(FILE_TITLE)$ ' . g:single_compile_options, 519 | \g:common_run_command) 520 | 521 | call SingleCompile#ChooseCompiler('c', 'clang') 522 | 523 | call SingleCompile#SetCompilerTemplate('cpp', 524 | \'clang', 525 | \'the Clang C and Objective-C compiler', 526 | \'clang++', 527 | \'-o $(FILE_TITLE)$ ' . g:single_compile_options, 528 | \g:common_run_command) 529 | call SingleCompile#ChooseCompiler('cpp', 'clang') 530 | endfunction 531 | 532 | " choose python3 for python compiler 533 | " call SingleCompile#ChooseCompiler('python', 'python3') 534 | 535 | noremap :Parse 536 | noremap :ClangCheck 537 | noremap :SCCompile 538 | noremap :SCCompileRun 539 | noremap! :Parse 540 | noremap! :ClangCheck 541 | noremap! :SCCompile 542 | noremap! :SCCompileRun 543 | "}}} 544 | 545 | 546 | 547 | "some abbreviates for myself {{{ 548 | abbreviate zl zilongshanren 549 | "}}} 550 | 551 | " tab navigation like firefox{{{ 552 | nnoremap :tabnext 553 | nnoremap :tabnew 554 | inoremap :tabnexti 555 | inoremap :tabnew 556 | "}}} 557 | 558 | "configs for vimwiki"{{{ 559 | "I don't use vimwiki anymore. Now I am using emacs org-mode to manage my personal life 560 | "nmap 5 :VimwikiAll2HTML 561 | "let g:vimwiki_list = [{'path': '/Users/guanghui/workspace/myblog/octopress/source/vimwiki/', 562 | " \ 'path_html': '/Users/guanghui/workspace/myblog/octopress/source/vimwiki_html/'}] 563 | "}}} 564 | 565 | "keymaping for HardMode plugin {{{ 566 | " autocmd VimEnter,BufNewFile,BufReadPost * silent! call HardMode() 567 | nnoremap ha :call ToggleHardMode() 568 | "}}} 569 | 570 | "emacs keymaping for insert mode cursor movement{{{ 571 | inoremap I 572 | inoremap A 573 | inoremap 574 | inoremap 575 | " inoremap lxi 576 | inoremap 577 | inoremap 578 | "}}} 579 | 580 | "delimitMate mappings{{{ 581 | let delimitMate_matchpairs = "(:),[:],{:},<:>" 582 | au FileType cpp let b:delimitMate_matchpairs = "(:),[:],{:}" 583 | "}}} 584 | 585 | "mappings for latex-box plugin{{{ 586 | map ls :silent !/Applications/Skim.app/Contents/SharedSupport/displayline 587 | \ =line('.') "=LatexBox_GetOutputFile()" "%:p" 588 | autocmd filetype tex nnoremap F10 :!latexmk -pdf % 589 | "}}} 590 | 591 | "some keymapings for tidying your whitespace{{{ 592 | function! Preserve(command) 593 | " Preparation: save last search, and cursor position. 594 | let _s=@/ 595 | let l = line(".") 596 | let c = col(".") 597 | " Do the business: 598 | execute a:command 599 | " Clean up: restore previous search history, and cursor position 600 | let @/=_s 601 | call cursor(l, c) 602 | endfunction 603 | nmap _$ :call Preserve("%s/\\s\\+$//e") 604 | nmap _= :call Preserve("normal gg=G") 605 | "}}} 606 | 607 | 608 | "keymapings for vim-css-color plugin {{{ 609 | let g:cssColorVimDoNotMessMyUpdatetime = 1 610 | "}}} 611 | 612 | "force saving files that require root permission" {{{ 613 | cmap w!! %!sudo tee > /dev/null % 614 | "}}} 615 | 616 | "use sane regexes {{{ 617 | nnoremap / /\v 618 | vnoremap / /\v 619 | "}}} 620 | 621 | "mappings ctrl-s to save {{{ 622 | nnoremap :Update 623 | " Use CTRL-S for saving, also in Insert mode 624 | noremap :update 625 | vnoremap :update 626 | inoremap :update 627 | "}}} 628 | 629 | 630 | "change you complete me plugin default mappings"{{{ 631 | "refer to this blog post :http://0x3f.org/blog/make-youcompleteme-ultisnips-compatible/ 632 | 633 | "if your os is win, then disable the ycm plugin 634 | if os=="win" 635 | let g:loaded_youcompleteme = 1 636 | endif 637 | let g:ycm_key_list_select_completion = ['', ''] 638 | let g:ycm_key_list_previous_completion = ['', ''] 639 | let g:SuperTabDefaultCompletionType = '' 640 | nnoremap jd :YcmCompleter GoToDefinitionElseDeclaration 641 | let g:ycm_confirm_extra_conf = 1 642 | let g:ycm_global_ycm_extra_conf="~/.vim/.ycm_extra_conf.py" 643 | let g:tern_show_argument_hints='on_hold' 644 | let g:indent_guides_start_level = 2 645 | let g:indent_guides_guide_size = 1 646 | "}}} 647 | 648 | "add gist plgin {{{ 649 | let g:gist_open_browser_after_post =1 650 | "}}} 651 | 652 | "add powerline plugin config{{{ 653 | " let g:Powerline_symbols = 'fancy' 654 | "}}} 655 | 656 | "key maps for gitgutter {{{ 657 | nmap gs GitGutterStageHunk 658 | nmap gr GitGutterRevertHunk 659 | "}}} 660 | 661 | "key maps for vim-airline {{{ 662 | let g:airline#extensions#tabline#enabled = 1 663 | let g:airline_powerline_fonts = 1 664 | "}}} 665 | --------------------------------------------------------------------------------