Skip to content

Instantly share code, notes, and snippets.

@JaosnHsieh
Last active January 7, 2025 01:42
Show Gist options
  • Select an option

  • Save JaosnHsieh/e1bf8c404f6b2ce0301db5a02fb603c2 to your computer and use it in GitHub Desktop.

Select an option

Save JaosnHsieh/e1bf8c404f6b2ce0301db5a02fb603c2 to your computer and use it in GitHub Desktop.
vscode setting, extension list, user setting, keybinding.json, setting.json ( extension export and import from https://stackoverflow.com/a/49398449/6414615), vimrc vim setting
call pathogen#infect()
let g:ctrlp_custom_ignore = 'node_modules'
map <C-n> :NERDTreeToggle<CR>
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif
" background & theme
set background=dark
colorscheme darkblue
" highlight color
set cursorline " highlight the whole current line
highlight ColorColumn ctermbg=235 guibg=#2c2d27
highlight CursorLine cterm=NONE ctermbg=darkblue ctermfg=white guibg=darkblue ctermfg=white
set paste
#https://spellfoundry.com/docs/finding-your-raspberry-pi-on-the-network-from-a-mac/
alias lanscan='sudo nmap -sP 192.168.1.1/24'
alias lanscan2='sudo arp -a -d && arp -a'
export PATH="$HOME/.symfony5/bin:$PATH"
alias movtomp4='ffmpeg -i input.mov output.mp4'
alias togif='ffmpeg -i input.mov -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif'
alias togif-vertical='ffmpeg -i input.mov -s 200x350 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif'
alias open-linux-in-browser='open http://localhost:6901\?password=vncpassword'
alias run-linux-in-browser='docker run --rm -it --user 0 -p 5901:5901 -p 6901:6901 consol/debian-xfce-vnc'
alias yt-dlp='python3 /usr/local/bin/yt-dlp'
alias youtube-dl='python3 /usr/local/bin/youtube-dl'
alias size="stat -f%z"
export PATH="$PATH":"$HOME/.pub-cache/bin"
alias cppdebug="gcc -lstdc++ -std="c++17" ./main.cpp -o main -g && lldb --file ./main"
alias cpprun="gcc -lstdc++ -std="c++17" ./main.cpp -o main && ./main"
alias cpprunleetcode="gcc -lstdc++ -std="c++17" -fsanitize=address -O1 -fno-omit-frame-pointer -g ./main.cpp -o main && ./main"
# Add this to .bashrc or .zshrc or its equivalent
transfer(){ if [ $# -eq 0 ];then echo "No arguments specified.\nUsage:\n transfer <file|directory>\n ... | transfer <file_name>">&2;return 1;fi;if tty -s;then file="$1";file_name=$(basename "$file");if [ ! -e "$file" ];then echo "$file: No such file or directory">&2;return 1;fi;if [ -d "$file" ];then file_name="$file_name.zip" ,;(cd "$file"&&zip -r -q - .)|curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/null,;else cat "$file"|curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/null;fi;else file_name=$1;curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/null;fi;}
#
# Installation:
#
# Via shell config file ~/.bashrc (or ~/.zshrc)
#
# Append the contents to config file
# 'source' the file in the config file
#
# You may also have a directory on your system that is configured
# for completion files, such as:
#
# /usr/local/etc/bash_completion.d/
###-begin-flutter-completion-###
if type complete &>/dev/null; then
__flutter_completion() {
local si="$IFS"
IFS=$'\n' COMPREPLY=($(COMP_CWORD="$COMP_CWORD" \
COMP_LINE="$COMP_LINE" \
COMP_POINT="$COMP_POINT" \
flutter completion -- "${COMP_WORDS[@]}" \
2>/dev/null)) || return $?
IFS="$si"
}
complete -F __flutter_completion flutter
elif type compdef &>/dev/null; then
__flutter_completion() {
si=$IFS
compadd -- $(COMP_CWORD=$((CURRENT-1)) \
COMP_LINE=$BUFFER \
COMP_POINT=0 \
flutter completion -- "${words[@]}" \
2>/dev/null)
IFS=$si
}
compdef __flutter_completion flutter
elif type compctl &>/dev/null; then
__flutter_completion() {
local cword line point words si
read -Ac words
read -cn cword
let cword-=1
read -l line
read -ln point
si="$IFS"
IFS=$'\n' reply=($(COMP_CWORD="$cword" \
COMP_LINE="$line" \
COMP_POINT="$point" \
flutter completion -- "${words[@]}" \
2>/dev/null)) || return $?
IFS="$si"
}
compctl -K __flutter_completion flutter
fi
###-end-flutter-completion-###
## Generated 2022-05-16 04:30:00.931912Z
## By /Users/jh/development/flutter/bin/cache/flutter_tools.snapshot%
alias chrome_dev='open -n -a /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args --user-data-dir="/tmp/chrome_dev_test" --disable-web-security'
chrome_window() {
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --new-window --app=$1
}
export ANDROID_SDK_ROOT="$HOME//Library/Android/sdk/"
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="$HOME/development/flutter/bin:$PATH"
export PATH="$HOME/Library/Python/3.8/bin:$PATH"
export PATH="$HOME/go/bin:$PATH"
alias imgo="imageoptim -a --no-imageoptim ./*.(JPG,jpg|png|jpeg)"
alias resize256="sips -Z 256 (*.(JPG|jpg|png|jpeg)) && ll -h && imgo"
alias resize512="sips -Z 512 (*.(JPG|jpg|png|jpeg)) && ll -h && imgo"
alias resize768="sips -Z 768 (*.(JPG|jpg|png|jpeg)) && ll -h && imgo"
alias resize1024="sips -Z 1024 (*.(JPG|jpg|png|jpeg)) && ll -h && imgo"
export ANDROID_NDK_HOME="$HOME/Library/Android/sdk/ndk/21.2.6472646"
export JAVA_8_HOME=$(/usr/libexec/java_home -v1.8)
export JAVA_11_HOME=$(/usr/libexec/java_home -v11)
alias java8='export JAVA_HOME=$JAVA_8_HOME'
alias java11='export JAVA_HOME=$JAVA_11_HOME'
# default to Java 11
java11
alias dc="docker compose"
alias dcrun="docker compose run --rm"
alias sublime="open /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"i
export PATH="$HOME/Library/Android/sdk/platform-tools:$PATH"
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
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/jh/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="robbyrussell"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will 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 automatically update without prompting.
# DISABLE_UPDATE_PROMPT="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"
# 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="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# Caution: this setting can cause issues with multiline prompts (zsh 5.7.1 and newer seem to work)
# See https://github.com/ohmyzsh/ohmyzsh/issues/5765
# 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.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# 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?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)
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='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# 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 zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
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
export DENO_INSTALL="/Users/jh/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
export DVM_DIR="/Users/jh/.dvm"
export PATH="$DVM_DIR/bin:$PATH"
export PATH="$VOLTA_HOME/bin:$PATH"
export PATH="$HOME/.poetry/bin:$PATH"
PATH="/Users/jh/perl5/bin${PATH:+:${PATH}}"; export PATH;
PERL5LIB="/Users/jh/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="/Users/jh/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"/Users/jh/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/Users/jh/perl5"; export PERL_MM_OPT;
# bun completions
[ -s "/Users/jh/.bun/_bun" ] && source "/Users/jh/.bun/_bun"
# Bun
export BUN_INSTALL="/Users/jh/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
export PATH="/usr/local/opt/qt@5/bin:$PATH"
export PATH="/usr/local/opt/[email protected]/bin:$PATH"
export PATH="/usr/local/opt/[email protected]/sbin:$PATH"
export PATH=/Users/jh/.meteor:$PATH
// https://stackoverflow.com/questions/35773299/how-can-you-export-vs-code-extension-list/49398449#49398449
// code --list-extensions | xargs -L 1 echo code --install-extension
code --install-extension alefragnani.project-manager
code --install-extension austenc.tailwind-docs
code --install-extension bourhaouta.tailwindshades
code --install-extension bradlc.vscode-tailwindcss
code --install-extension closedcontour.very-smart-select
code --install-extension CoenraadS.bracket-pair-colorizer
code --install-extension Dart-Code.dart-code
code --install-extension Dart-Code.flutter
code --install-extension DavidLGoldberg.jumpy2
code --install-extension dbaeumer.vscode-eslint
code --install-extension dbankier.vscode-quick-select
code --install-extension denoland.vscode-deno
code --install-extension donjayamanne.githistory
code --install-extension eamodio.gitlens
code --install-extension ecmel.vscode-html-css
code --install-extension esbenp.prettier-vscode
code --install-extension FelixAngelov.bloc
code --install-extension flowtype.flow-for-vscode
code --install-extension GitHub.copilot
code --install-extension GitHub.copilot-labs
code --install-extension gitkraken.gitkraken-authentication
code --install-extension golang.go
code --install-extension hoovercj.vscode-power-mode
code --install-extension jcbuisson.vue
code --install-extension kumar-harsh.graphql-for-vscode
code --install-extension mathiasfrohlich.Kotlin
code --install-extension mrorz.language-gettext
code --install-extension ms-python.isort
code --install-extension ms-python.python
code --install-extension ms-python.vscode-pylance
code --install-extension ms-vscode-remote.remote-containers
code --install-extension ms-vscode-remote.remote-ssh
code --install-extension ms-vscode-remote.remote-ssh-edit
code --install-extension ms-vscode-remote.remote-wsl
code --install-extension ms-vscode-remote.vscode-remote-extensionpack
code --install-extension ms-vscode.azure-account
code --install-extension ms-vscode.hexeditor
code --install-extension ms-vscode.remote-explorer
code --install-extension ms-vscode.remote-server
code --install-extension ms-vsliveshare.vsliveshare
code --install-extension nhoizey.gremlins
code --install-extension octref.vetur
code --install-extension Prisma.prisma
code --install-extension redhat.vscode-yaml
code --install-extension streetsidesoftware.code-spell-checker
code --install-extension sudoaugustin.tailwindcss-transpiler
code --install-extension tomoki1207.vscode-input-sequence
code --install-extension VisualStudioExptTeam.intellicode-api-usage-examples
code --install-extension VisualStudioExptTeam.vscodeintellicode
code --install-extension vscodevim.vim
code --install-extension waderyan.gitblame
code --install-extension wmaurer.vscode-jumpy
code --install-extension xdebug.php-debug
code --install-extension xdebug.php-pack
code --install-extension ZainChen.json
code --install-extension zobo.php-intellisense
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
git clone https://github.com/kien/ctrlp.vim.git ~/.vim/bundle/ctrlp
git clone https://github.com/scrooloose/nerdtree.git ~/.vim/bundle/nerdtree
git clone https://github.com/Xuyuanp/nerdtree-git-plugin.git ~/.vim/bundle/nerdtree-git-plugin
git clone https://github.com/eugen0329/vim-esearch.git ~/.vim/bundle/vim-esearch
// Place your key bindings in this file to overwrite the defaults
[
// {
// "key": "shift+enter",
// "command": "extension.jumpy-word",
// "when": "editorTextFocus"
// },
// {
// "key": "Escape",
// "command": "extension.jumpy-exit",
// "when": "editorTextFocus && jumpy.isJumpyMode"
// },
{
"key": "ctrl+`",
"command": "workbench.action.terminal.focus"
},
{
"key": "ctrl+`",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
},
{
"key": "f11",
"command": "editor.action.goToDeclaration",
"when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
},
{
"key": "ctrl+j",
"command": "workbench.action.togglePanel"
},
{
"key": "cmd+u",
"command": "workbench.action.toggleMaximizedPanel"
},
{
"key": "shift+cmd+right",
"command": "very-smart-select.grow"
},
{
"key": "shift+cmd+left",
"command": "very-smart-select.shrink"
},
{
"key": "ctrl+l",
"command": "editor.action.triggerSuggest",
"when": "editorHasCompletionItemProvider && textInputFocus && !editorReadonly"
},
{
"key": "alt+escape",
"command": "-editor.action.triggerSuggest",
"when": "editorHasCompletionItemProvider && textInputFocus && !editorReadonly"
},
{ "key": "alt+up", "command": "", "when": "textInputFocus" },
{ "key": "alt+down", "command": "", "when": "textInputFocus" },
{
//https://stackoverflow.com/a/60224585/6414615
"key": "shift+cmd+]",
"command": "workbench.action.terminal.focusNextPane",
"when": "terminalFocus"
},
{
"key": "shift+cmd+a",
"command": "copilot-labs.use-brush-picker",
"when": "editorTextFocus"
}
]
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "shift+enter",
"command": "extension.jumpy-word",
"when": "editorTextFocus"
},
{
"key": "Escape",
"command": "extension.jumpy-exit",
"when": "editorTextFocus && jumpy.isJumpyMode"
},
{
"key": "ctrl+`",
"command": "workbench.action.terminal.focus"
},
{
"key": "ctrl+`",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
},
{
"key": "f11",
"command": "editor.action.goToDeclaration",
"when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
},
{{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.formatOnSave": true,
// "[javascript]": {
// // "editor.formatOnSave": true
// },
// // "eslint.autoFixOnSave": true,
"eslint.alwaysShowStatus": true,
"prettier.trailingComma": "all",
"prettier.singleQuote": true,
// "prettier.disableLanguages": ["js"],
// "files.autoSave": "onFocusChange",
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/logs": true,
"**/assets": true,
"**/public": true,
"**/semantic": true
},
"emmet.includeLanguages": { "javascript": "javascriptreact" },
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"breadcrumbs.enabled": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"window.zoomLevel": 2,
"git.enableSmartCommit": true,
"editor.suggestSelection": "first",
"workbench.colorTheme": "Monokai"
}
"key": "ctrl+j",
"command": "workbench.action.togglePanel"
},
{
"key": "cmd+u",
"command": "workbench.action.toggleMaximizedPanel"
},
{
"key": "shift+cmd+k",
"command": "very-smart-select.grow"
},
{
"key": "shift+cmd+j",
"command": "very-smart-select.shrink"
},
{
"key": "ctrl+l",
"command": "editor.action.triggerSuggest",
"when": "editorHasCompletionItemProvider && textInputFocus && !editorReadonly"
},
{
"key": "alt+escape",
"command": "-editor.action.triggerSuggest",
"when": "editorHasCompletionItemProvider && textInputFocus && !editorReadonly"
}
]
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"editor.formatOnSave": true,
// "[javascript]": {
// "editor.formatOnSave": true
// },
// "eslint.autoFixOnSave": true,
"eslint.validate": ["javascript"],
// "eslint.alwaysShowStatus": false,
"prettier.trailingComma": "all",
"prettier.singleQuote": true,
// "prettier.disableLanguages": ["js"],
// "files.autoSave": "onFocusChange",
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/logs": true,
"**/assets": true,
"**/public": true,
"**/semantic": true
},
"emmet.includeLanguages": { "javascript": "javascriptreact" },
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"breadcrumbs.enabled": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"git.enableSmartCommit": true,
"editor.suggestSelection": "first",
"workbench.colorTheme": "Monokai",
"dart.openDevTools": "flutter",
"tailwindTranspiler.savePath": "/index.css",
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.inlineSuggest.enabled": true,
"editor.folding": false,
"github.copilot.enable": {
"*": true,
"yaml": true,
"plaintext": true,
"markdown": true,
"scminput": false,
"cpp": false
},
"bracketPairColorizer.depreciation-notice": false,
"git.confirmSync": false,
"python.linting.enabled": true,
"python.linting.mypyEnabled": true,
"[dart]": {
"editor.defaultFormatter": "Dart-Code.dart-code"
},
"diffEditor.ignoreTrimWhitespace": false,
"redhat.telemetry.enabled": true,
"workbench.startupEditor": "none",
"workbench.tips.enabled": false,
"emmet.triggerExpansionOnTab": true,
"tabnine.experimentalAutoImports": true,
"window.zoomLevel": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment