Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@wujunchuan
Last active May 6, 2023 13:26
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wujunchuan/6e7ca7b9ff456a332537fe0a73b8112c to your computer and use it in GitHub Desktop.
Save wujunchuan/6e7ca7b9ff456a332537fe0a73b8112c to your computer and use it in GitHub Desktop.
My config files
# If you come from bash you might have to change your $PATH.
# Golang config
export GOPATH=$HOME/go
export PATH=$HOME/bin:/usr/local/bin:$PATH:$HOME/qiniu:/usr/local/opt/go/libexec/bin:$GOPATH/bin
export ARIA_PATH=$HOME/.aria2
export JAVA_HOME='/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home'
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/algs4.jar
export ZPLUG_HOME=/usr/local/opt/zplug
source $ZPLUG_HOME/init.zsh
# export ANDROID_HOME=$HOME/Library/Android/sdk
# export ANDROID_NDK_HOME=$HOME/Library/Android/sdk/ndk-bundle
# export PATH=$PATH:$ANDROID_HOME/tools
# export PATH=$PATH:$ANDROID_HOME/tools/bin
# export PATH=$PATH:$ANDROID_HOME/platform-tools
# export PATH=$PATH:$ANDROID_HOME/build-tools/27.0.2
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="ys"
# ZSH_THEME="robbyrussell"
# Set list of themes to load
# Setting this variable when ZSH_THEME=random
# cause zsh load theme from this variable instead of
# looking in ~/.oh-my-zsh/themes/
# An empty array have no effect
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
export UPDATE_ZSH_DAYS=30
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="false"
# Uncomment the following line to display red dots whilst waiting for completion.
COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
HIST_STAMPS="yyyy-mm-dd"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git autojump)
fpath=(/usr/local/share/zsh-completions $fpath)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# 设置这个可以避免乱码
export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='vim'
else
export EDITOR='nvim'
fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
export SSH_KEY_PATH="~/.ssh/rsa_id"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
alias cls='clear'
alias ll='ls -lh'
alias la='ls -ah'
alias vi='nvim'
alias cat='bat'
alias grep="grep --color=auto"
alias -s gz='tar -xzvf'
alias -s tgz='tar -xzvf'
alias -s zip='unzip'
alias -s rar='unrar'
alias -s 7z='7z x'
alias -s bz2='tar -xjvf'
# fuck gfw 相关的 proxy配置
# alias hp='export http_proxy=http://127.0.0.1:8123 https_proxy=http://127.0.0.1:8123'
# alias nhp='unset http_proxy https_proxy'
# 命令行下
# alias pxy=proxychains4
# 完全代理zsh
# alias pz='proxychains4 -q zsh'
# 代理单个进程(推荐)
# alias x='proxychains4 -q '
# alias xni='proxychains4 -q npm install'
# 在线播放视频音频
alias yg='you-get -p mpv'
# 帮助你方便查找alias内容
alias haha="alias |grep "
#打开dotfiles的位置
alias config='/Users/wujunchuan/Library/Mobile\ Documents/com~apple~CloudDocs/Mackup'
# 避免误删除 使用\rm正常使用rm指令
alias rm="echo Use 'del', or the full path i.e. '/bin/rm'"
alias del="rmtrash" # del / trash are shorter than rmtrash
# 复制上一条命令
alias pbcopylast='fc -ln -1 | pbcopy'
# 最近一周我提交的内容
alias glolar="glola --since=1.week --author='JohnTrump'"
alias mysqls="mysql.server start"
alias mysqld="mysql.server stop"
# 获取服务器上的分支信息
alias gfp="git remote prune origin"
# 删除本地除了master\dev的分支
alias gdremotebranch="git branch |grep -v 'master' | grep -v 'dev' |xargs git branch -D"
# 删除远程除了master\dev的分支
alias gdlocalbranch="git branch -r | grep -v 'master' | grep -v 'dev' | cut -c 10- | xargs git push --delete origin"
# cleos is a command line interface to interact with the blockchain and to manage wallets.
# alias cleos='docker exec eosio /opt/eosio/bin/cleos --wallet-url http://localhost:8888'
# alias cleosm='docker exec eosio /opt/eosio/bin/cleos -u https://mainnet-hk.meet.one --wallet-url http://localhost:8888'
# alias cleoss='docker exec eosio /opt/eosio/bin/cleos -u http://13.251.3.82:8888 --wallet-url http://localhost:8888'
alias devices_ios='xcrun simctl list devices'
alias start_aria2='aria2c --conf-path=$ARIA_PATH/aria2.conf -D'
alias wifi_password='wifi-password-qr'
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# place this after nvm initialization!
autoload -U add-zsh-hook
load-nvmrc() {
local node_version="$(nvm version)"
local nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
if [ "$nvmrc_node_version" = "N/A" ]; then
nvm install
elif [ "$nvmrc_node_version" != "$node_version" ]; then
nvm use
fi
elif [ "$node_version" != "$(nvm version default)" ]; then
echo "Reverting to nvm default version"
nvm use default
fi
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc
#zplug "changyuheng/fz", defer:1
#zplug "rupa/z", use:z.sh
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
autoload bashcompinit
bashcompinit
# source /Users/wujunchuan/Project/open-source/cleos-auto-completion/cleos.bash
"映射leader成 ,
let mapleader="\,"
"项目使用vim-plug作为插件管理工具
"文档查看https://github.com/junegunn/vim-plug
call plug#begin()
"in this place,you can add Plug what you want
"快速注释
"See https://github.com/scrooloose/nerdcommenter
Plug 'scrooloose/nerdcommenter'
"surround可以用来修改括号, 方括号, 标签等等包围在两边的元素
"See https://github.com/tpope/vim-surround
Plug 'git://github.com/tpope/vim-surround.git'
"for repeat -> enhance surround.vim, . to repeat command
Plug 'tpope/vim-repeat'
"模糊搜索文件
Plug 'ctrlpvim/ctrlp.vim'
"Vim mark标记
Plug 'kshenoy/vim-signature'
"EditorConfig的支持
Plug 'editorconfig/editorconfig-vim'
"启动对Emmet的支持
Plug 'mattn/emmet-vim'
" EasyMotion
Plug 'easymotion/vim-easymotion'
"快捷键位置原本为<Ctrl>+y 太远了,修改为<Ctrl>+e+,
let g:user_emmet_leader_key='<C-E>'
let g:user_emmet_install_global = 0
"Enable just for html/css 随着文件类型的丰富,修改这里,启动Emmet
autocmd FileType html,css,sass,less,scss,vue EmmetInstall
"查看当前路径下的目录树
Plug 'scrooloose/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'
"Airline
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
"<F4> => popup the file tree navigation)
nmap <F4> :NERDTreeToggle<CR>
Plug 'altercation/vim-colors-solarized'
"see https://github.com/airblade/vim-gitgutter
Plug 'airblade/vim-gitgutter'
nmap ]] <Plug>GitGutterNextHunk
nmap [[ <Plug>GitGutterPrevHunk
nmap gua <Plug>GitGutterUndoHunk
nmap gpr <Plug>GitGutterPreviewHunk
"搜索项目中出现的关键词
Plug 'mileszs/ack.vim'
"ack支持 <Leader>+ack
nnoremap <Leader>ack :Ack!<Space>
"方便在buffer中快速切换的工具 <Leader>+be
Plug 'jlanzarotta/bufexplorer'
"辅助Airline查看当前Git Branch
Plug 'tpope/vim-fugitive'
"Tagbar is a Vim plugin that provides an easy way to browse the tags of the current file and get an overview of its structure
Plug 'majutsushi/tagbar'
nmap <F8> :TagbarToggle<CR>
"用于代码对齐的神器
"See https://github.com/junegunn/vim-easy-align
Plug 'junegunn/vim-easy-align'
" Start interactive EasyAlign in visual mode (e.g. vipga)
xmap ga <Plug>(EasyAlign)
" Start interactive EasyAlign for a motion/text object (e.g. gaip)
nmap ga <Plug>(EasyAlign)
"可以将不同的词标成不同的颜色, 比如标记在变量名上, 就很方便
":MarkClear可以清除所有的标记
Plug 'vim-scripts/Mark--Karkat'
"代码补齐神器
Plug 'Valloric/YouCompleteMe',{'frozen':'true'}
"自动闭合
"使用<Leader>+a可以关闭AutoClose的功能
Plug 'vim-scripts/AutoClose'
"tern补全JavaScript插件
" Plug 'ternjs/tern_for_vim'
"css语法高亮
Plug 'hail2u/vim-css3-syntax'
"less语法高亮
Plug 'groenewege/vim-less'
"JavaScript语法高亮
Plug 'pangloss/vim-javascript'
"高亮色块
Plug 'gko/vim-coloresque'
"One主题
Plug 'rakr/vim-one'
"检索项目中的所有TODOLIST
Plug 'vim-scripts/TaskList.vim'
"Generate JSDoc to Javascript code
Plug 'heavenshell/vim-jsdoc'
"移动光标到函数名称上,输入<Ctrl>+L即可快速完成注释
nmap <silent> <C-l> ?function<cr>:noh<cr><Plug>(jsdoc)
let g:jsdoc_additional_descriptions = 1
let g:jsdoc_enable_es6 = 1
"显示缩进线,隐藏快捷键(<Leader>ig)
Plug 'nathanaelkane/vim-indent-guides'
let g:jsdoc_allow_input_prompt = 1
let g:indent_guides_start_level = 2
let g:indent_guides_guide_size = 1
let g:indent_guides_enable_on_vim_startup = 1
let g:indent_guides_tab_guides = 0
"隐藏部分场景下的indent-indent_guides
let g:indent_guides_exclude_filetypes = ['help', 'nerdtree']
"搭配Dash使用,查阅文档
Plug 'rizzatti/dash.vim'
:nmap <silent> <leader>d <Plug>DashSearch
"代码片段插件
Plug 'SirVer/ultisnips'
"在片段插入之后可以使用<Ctrl+h>前移
let g:UltiSnipsJumpForwardTrigger="<c-h>"
" Trigger configuration.
" Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
" Why use <c-m> will cause return key missing? I don't know..but anyway ->
" Don't try it that
let g:UltiSnipsExpandTrigger="<c-b>"
"在片段插入之后可以使用<Ctrl+l>后移
let g:UltiSnipsJumpBackwardTrigger="<c-l>"
"search path
"常见代码块集合
Plug 'honza/vim-snippets'
" show Snipts files
nnoremap <Leader>sni :UltiSnipsEdit!<CR>
"可视化内容变更历史记录
Plug 'mbbill/undotree'
nnoremap <F5> :UndotreeToggle<cr>
"自动排序css
Plug 'csscomb/vim-csscomb'
" Map bc to run CSScomb. bc stands for beautify css
autocmd FileType css noremap <buffer> <leader>cb :CSScomb<CR>
" Automatically comb your CSS on save
autocmd BufWritePre,FileWritePre *.css,*.less,*.scss,*.sass silent! :CSScomb
"link https://github.com/othree/eregex.vim
"for use Perl/Ruby Style Regex
Plug 'othree/eregex.vim'
nnoremap / /\v
nnoremap ? :M/
nnoremap <leader>vf :M/<c-r><c-w>
nnoremap <leader>vr :.,$S///gec<left><left><left><left><left>
Plug 'scrooloose/syntastic'
let g:syntastic_error_symbol='>>'
let g:syntastic_warning_symbol='>'
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 1
"暂时关闭
"let g:syntastic_check_on_open = 0
"let g:syntastic_check_on_wq = 0
let g:syntastic_javascript_standard_generic = 1
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_javascript_eslint_exec = 'eslint'
" to see error location list
let g:syntastic_always_populate_loc_list = 0
let g:syntastic_auto_loc_list = 0
let g:syntastic_loc_list_height = 5
"<Leader> + , 打开错误列表
function! ToggleErrors()
let old_last_winnr = winnr('$')
lclose
if old_last_winnr == winnr('$')
" Nothing was closed, open syntastic error location panel
Errors
endif
endfunction
nnoremap <Leader>s :call ToggleErrors()<cr>
highlight link SyntasticError ErrorMsg
highlight link SyntasticErrorSign WarningMsg
"自动格式化,使用vue-beautify 作为外部程序来调用以实现vue文件格式化
"当然可以使用其他的外部程序来调用
Plug 'Chiel92/vim-autoformat'
"调用vim-Autoformat的快捷键(全局)
noremap <F3> :Autoformat<CR>
"format verbose mode 便于调试
let g:autoformat_verbosemode = 1
"自定义formater program
let g:formatdef_jsbeautify_javascript = '"js-beautify -X -a -s 2"'
let g:formatdef_vuebeautify_vue = '"vue-beautify -s 2"'
let g:formatters_vue = ['vuebeautify_vue']
Plug 'posva/vim-vue'
call plug#end()
" Visual shifting (does not exit Visual mode)
vnoremap < <gv
vnoremap > >gv
"允许多次多选编辑
"https://stackoverflow.com/questions/355907/how-do-i-repeat-an-edit-on-multiple-lines-in-vim/8064607#8064607
vnoremap . :normal .<CR>
"Can I use ag (The Silver Searcher) with this?
if executable('ag')
"判断是否拥有ag支持
let g:ackprg = 'ag --vimgrep'
endif
"See http://stackoverflow.com/questions/4775605/vim-syntax-highlight-improve-performance
"See http://www.55228885.com/Ljzenbgk.html
"improve performance
set nocursorcolumn
set nocursorline
set norelativenumber
syntax sync minlines=256
set synmaxcol=200
set scrolljump=5
""插入模式自动转换成绝对行号,正常模式自动转换成相对行号
" CHANGELOG: 在渲染压力大的情况下,相对行号导致卡顿,所以注释掉了
"autocmd InsertEnter * :set norelativenumber number
"autocmd InsertLeave * :set relativenumber
" Fundamental settings
set fileencoding=utf-8
set fileencodings=ucs-bom,utf-8,gbk,cp936,latin-1
set fileformat=unix
set fileformats=unix,dos,mac
set incsearch " Find as you type search
set hlsearch " Highlight search terms
filetype on
filetype plugin on
filetype plugin indent on
syntax enable
set mouse=a " Automatically enable mouse usage
set mousehide " Hide the mouse cursor while typing
"关闭单词拼写检查
set nospell
" Some useful settings
set smartindent
set expandtab " tab to spaces
set linespace=0 " No extra spaces between rows
set winminheight=1 " Windows can be 0 line high
"设置宽度为2
set tabstop=2 " the width of a tab
set shiftwidth=2 " the width for indent
set ignorecase " ignore the case when search texts
set smartcase " if searching text contains uppercase case will not be ignored
set list
set listchars=tab:>>,eol:¬,trail:•,extends:#,nbsp:. " Highlight problematic whitespace
" close buffer
nnoremap <Leader>w :bd<CR>
"YouCompleteMe
let g:ycm_semantic_triggers = {
\ 'css': [ 're!^\s{4}', 're!:\s+'],
\ 'html': [ '</' ],
\ }
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
"在注释输入中也能补全
let g:ycm_complete_in_comments = 1
"在字符串输入中也能补全
let g:ycm_complete_in_strings = 1
"注释和字符串中的文字也会被收入补全
let g:ycm_collect_identifiers_from_comments_and_strings = 0
let g:ycm_min_num_of_chars_for_completion=2 " 从第2个键入字符就开始罗列匹配项
"set completeopt=longest,menu "让Vim的补全菜单行为与一般IDE一致(参考VimTip1228)
"跳转到定义处
nnoremap <leader>jd :YcmCompleter GoToDefinitionElseDeclaration<CR>
"Vim外观设置
nnoremap <F2> :set nonumber!<CR>:set foldcolumn=0<CR>
colorscheme one
set background=dark " for the dark version
" powerline font enable
let g:airline_powerline_fonts=1
set number "line number
set wrap "line wrapping
let g:airline#extensions#tabline#enabled = 1
let g:airline_theme='one'
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
"设置补全框样式
highlight Pmenu ctermbg=75
highlight PmenuSel ctermbg=169
"定制 indent_guides 的样式
let g:indent_guides_auto_colors = 0
hi IndentGuidesOdd ctermbg=237
hi IndentGuidesEven ctermbg=235
"原先需要制定`+`/`*` register作为寄存器
"现在可以直接复制粘贴了 - 有时候这样做很麻烦,所以注释掉了
"See https://stackoverflow.com/questions/11489428/how-to-make-vim-paste-from-and-copy-to-systems-clipboard
"if has('clipboard')
"if has('unnamedplus') " When possible use + register for copy-paste
"set clipboard=unnamed,unnamedplus
"else " On mac and Windows, use * register for copy-paste
"set clipboard=unnamed
"endif
"endif
set nocursorline
" :hi CursorLine cterm=NONE ctermbg=240 ctermfg=white guibg=188 guifg=white
"使用<Leader>+cur来控制是否高亮当前行
:nnoremap <Leader>cur :set cursorline! cursorcolumn!<CR>
"See https://stackoverflow.com/questions/24720587/vim-with-youcompleteme-and-markdown
"YouCompleteMe的黑名单与白名单设置
"1为TRUE,0为FALSE
let g:ycm_filetype_blacklist={'notes': 1, 'markdown': 0, 'unite': 1, 'tagbar': 1, 'pandoc': 1, 'qf': 1, 'vimwiki': 1, 'text': 1, 'infolog': 1, 'mail': 1}
" 定制`CtrlP`的忽略列表
" See https://github.com/kien/ctrlp.vim/issues/58
let g:ctrlp_custom_ignore = '\v[\/](node_modules|target|dist|assets)|(\.(swp|ico|git|svn))$'
if filereadable(".ctrlpignore")
let g:ctrlp_user_command = 'find %s -type f | grep -v "`cat .ctrlpignore`"'
endif
"刷新ctrlp,See https://stackoverflow.com/questions/8663829/vim-ctrlp-vim-plugin-how-to-rescan-files
"在ctrlp激活的情况下F5
set ttyfast " Faster redrawing.
set lazyredraw " Only redraw when necessary.
set display =lastline " Show as much as possible of the last line.
"更加方便的使用命令行历史
cnoremap <c-n> <down>
cnoremap <c-p> <up>
"Ctrl + l 的默认功能是清空并「重新绘制」当前的屏幕,就和 :redraw! 的功能一样。下面的这个映射就是执行重新绘制,并且取消通过 / 和 ? 匹配字符的高亮,而且还可以修复代码高亮问题
"快捷键 <leader>l
nnoremap <leader>l :nohlsearch<cr>:diffupdate<cr>:syntax sync fromstart<cr><c-l>
"快速移动当前行
"快将诶建 [|]+e
nnoremap [e :<c-u>execute 'move -1-'. v:count1<cr>
nnoremap ]e :<c-u>execute 'move +'. v:count1<cr>
"戒掉使用光标键的习惯,如果已经适应的话,就将其注释掉,并且替换为更加有用的功能上
"noremap <Up> <Nup>
"noremap <Down> <NDown>
"noremap <Left> <NLeft>
"noremap <Right> <NRight>
"
"solved issues: My syntax highlighting stops working randomly
"but it will be slow sometimes
"autocmd FileType vue syntax sync fromstart
{
"global": {
"check_for_updates_on_startup": false,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": true
},
"profiles": [
{
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 1000,
"basic.to_if_held_down_threshold_milliseconds": 500
},
"rules": [
{
"description": "Change Control+h/j/k/l to Arrows",
"manipulators": [
{
"from": {
"key_code": "h",
"modifiers": {
"mandatory": [
"left_control"
]
}
},
"to": [
{
"key_code": "left_arrow"
}
],
"type": "basic"
},
{
"from": {
"key_code": "j",
"modifiers": {
"mandatory": [
"left_control"
]
}
},
"to": [
{
"key_code": "down_arrow"
}
],
"type": "basic"
},
{
"from": {
"key_code": "k",
"modifiers": {
"mandatory": [
"left_control"
]
}
},
"to": [
{
"key_code": "up_arrow"
}
],
"type": "basic"
},
{
"from": {
"key_code": "l",
"modifiers": {
"mandatory": [
"left_control"
]
}
},
"to": [
{
"key_code": "right_arrow"
}
],
"type": "basic"
}
]
},
{
"description": "Launch apps by right right_command+letters.",
"manipulators": [
{
"from": {
"key_code": "g",
"modifiers": {
"mandatory": [
"right_command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"shell_command": "open '/Applications/Google Chrome.app'"
}
],
"type": "basic"
},
{
"from": {
"key_code": "w",
"modifiers": {
"mandatory": [
"right_command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"shell_command": "open '/Applications/WeChat.app'"
}
],
"type": "basic"
},
{
"from": {
"key_code": "e",
"modifiers": {
"mandatory": [
"right_command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"shell_command": "open '/Applications/Visual Studio Code.app'"
}
],
"type": "basic"
},
{
"from": {
"key_code": "m",
"modifiers": {
"mandatory": [
"right_command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"shell_command": "open '/Applications/Typora.app'"
}
],
"type": "basic"
},
{
"from": {
"key_code": "f",
"modifiers": {
"mandatory": [
"right_command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"shell_command": "open ~"
}
],
"type": "basic"
},
{
"from": {
"key_code": "s",
"modifiers": {
"mandatory": [
"right_command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"shell_command": "open '/Applications/Safari.app'"
}
],
"type": "basic"
},
{
"from": {
"key_code": "t",
"modifiers": {
"mandatory": [
"right_command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"shell_command": "open '/Applications/iTerm.app'"
}
],
"type": "basic"
},
{
"from": {
"key_code": "f",
"modifiers": {
"mandatory": [
"right_command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"shell_command": "open '/System/Library/CoreServices/Finder.app'"
}
],
"type": "basic"
},
{
"from": {
"key_code": "d",
"modifiers": {
"mandatory": [
"right_command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"shell_command": "open '/Applications/Safari Technology Preview.app'"
}
],
"type": "basic"
},
{
"from": {
"key_code": "r",
"modifiers": {
"mandatory": [
"right_command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"shell_command": "open '/Applications/Siri.app'"
}
],
"type": "basic"
}
]
}
]
},
"devices": [
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 256,
"vendor_id": 2131
},
"ignore": false,
"manipulate_caps_lock_led": false,
"myname": "hhkb",
"simple_modifications": [
{
"from": {
"key_code": "caps_lock"
},
"to": {
"key_code": "left_control"
}
}
]
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 628,
"vendor_id": 1452
},
"ignore": false,
"manipulate_caps_lock_led": true,
"myname": "build in",
"simple_modifications": [
{
"from": {
"key_code": "caps_lock"
},
"to": {
"key_code": "left_control"
}
},
{
"from": {
"key_code": "left_control"
},
"to": {
"key_code": "escape"
}
}
]
}
],
"fn_function_keys": [
{
"from": {
"key_code": "f1"
},
"to": {
"key_code": "display_brightness_decrement"
}
},
{
"from": {
"key_code": "f2"
},
"to": {
"key_code": "display_brightness_increment"
}
},
{
"from": {
"key_code": "f3"
},
"to": {
"key_code": "mission_control"
}
},
{
"from": {
"key_code": "f4"
},
"to": {
"key_code": "launchpad"
}
},
{
"from": {
"key_code": "f5"
},
"to": {
"key_code": "illumination_decrement"
}
},
{
"from": {
"key_code": "f6"
},
"to": {
"key_code": "illumination_increment"
}
},
{
"from": {
"key_code": "f7"
},
"to": {
"key_code": "rewind"
}
},
{
"from": {
"key_code": "f8"
},
"to": {
"key_code": "play_or_pause"
}
},
{
"from": {
"key_code": "f9"
},
"to": {
"key_code": "fastforward"
}
},
{
"from": {
"key_code": "f10"
},
"to": {
"key_code": "mute"
}
},
{
"from": {
"key_code": "f11"
},
"to": {
"key_code": "volume_decrement"
}
},
{
"from": {
"key_code": "f12"
},
"to": {
"key_code": "volume_increment"
}
}
],
"name": "hhkb",
"selected": true,
"simple_modifications": [
{
"from": {
"consumer_key_code": "eject"
},
"to": {
"key_code": "grave_accent_and_tilde"
}
},
{
"from": {
"key_code": "caps_lock"
},
"to": {
"key_code": "left_control"
}
},
{
"from": {
"key_code": "delete_forward"
},
"to": {
"key_code": "vk_consumer_next"
}
},
{
"from": {
"key_code": "f20"
},
"to": {
"consumer_key_code": "play_or_pause"
}
}
],
"virtual_hid_keyboard": {
"caps_lock_delay_milliseconds": 0,
"country_code": 0,
"keyboard_type": "ansi"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment