Skip to content

Instantly share code, notes, and snippets.

@JiaChangGit
Last active April 4, 2024 19:01
Show Gist options
  • Save JiaChangGit/3ba794b8151e9a148b878947c074e07c to your computer and use it in GitHub Desktop.
Save JiaChangGit/3ba794b8151e9a148b878947c074e07c to your computer and use it in GitHub Desktop.
dotfile
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
[Makefile]
indent_style = tab
# 自動把text的斷行做一致化
* text=auto
# 文件類型
*.markdown text
*.md text
*.mdwn text
*.mdown text
*.mkd text
*.mkdn text
*.mdtxt text
*.mdtext text
*.txt text
AUTHORS text
CHANGELOG text
CHANGES text
CONTRIBUTING text
COPYING text
copyright text
*COPYRIGHT* text
INSTALL text
license text
LICENSE text
NEWS text
readme text
*README* text
TODO text
# 範本類型
*.dot text
*.ejs text
*.haml text
*.handlebars text
*.hbs text
*.hbt text
*.jade text
*.latte text
*.mustache text
*.njk text
*.phtml text
*.tmpl text
*.tpl text
*.twig text
# word 類型
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
# visual studio 專案檔案設定
*.sln text eol=crlf
*.csproj text eol=crlf
*.vbproj text eol=crlf
*.vcxproj text eol=crlf
*.vcproj text eol=crlf
*.dbproj text eol=crlf
*.fsproj text eol=crlf
*.lsproj text eol=crlf
*.wixproj text eol=crlf
*.modelproj text eol=crlf
*.sqlproj text eol=crlf
*.wmaproj text eol=crlf
*.xproj text eol=crlf
*.props text eol=crlf
*.filters text eol=crlf
*.vcxitems text eol=crlf
# binary 類型
## 圖像
*.ai binary
*.bmp binary
*.eps binary
*.gif binary
*.ico binary
*.jng binary
*.jp2 binary
*.jpg binary
*.jpeg binary
*.jpx binary
*.jxr binary
*.pdf binary
*.png binary
*.psb binary
*.psd binary
*.svg binary
*.svgz binary
*.tif binary
*.tiff binary
*.wbmp binary
*.webp binary
## 影音
*.kar binary
*.m4a binary
*.mid binary
*.midi binary
*.mp3 binary
*.ogg binary
*.ra binary
## 影片
*.3gpp binary
*.3gp binary
*.as binary
*.asf binary
*.asx binary
*.fla binary
*.flv binary
*.m4v binary
*.mng binary
*.mov binary
*.mp4 binary
*.mpeg binary
*.mpg binary
*.swc binary
*.swf binary
*.webm binary
## 壓縮
*.7z binary
*.gz binary
*.rar binary
*.tar binary
*.zip binary
## FONTS
*.ttf binary
*.eot binary
*.otf binary
*.woff binary
*.woff2 binary
## 可執行
*.exe binary
# linter
.csslintrc text
.eslintrc text
.jscsrc text
.jshintrc text
.jshintignore text
.stylelintrc text
.stylecop text
# 設定類型
*.bowerrc text
*.cnf text
*.conf text
*.config text
.browserslistrc text
.editorconfig text
.gitattributes text
.gitconfig text
.gitignore text
.htaccess text
*.npmignore text
*.yaml text
*.yml text
browserslist text
Makefile text
makefile text
*.ps1 text
*.bat text eol=crlf
*.coffee text
*.css text
*.htm text
*.html text
*.inc text
*.ini text
*.js text
*.json text
*.jsx text
*.less text
*.od text
*.onlydata text
*.php text
*.pl text
*.py text
*.rb text
*.sass text
*.scm text
*.scss text
*.sh text eol=lf
*.sql text
*.styl text
*.tag text
*.ts text
*.tsx text
*.xml text
*.xhtml text
*.cs text diff=csharp
*.dockerignore text
Dockerfile text
# Sources
*.c text diff=cpp
*.cc text diff=cpp
*.cxx text diff=cpp
*.cpp text diff=cpp
*.cpi text diff=cpp
*.c++ text diff=cpp
*.hpp text diff=cpp
*.h text diff=cpp
*.h++ text diff=cpp
*.hh text diff=cpp
# Compiled Object files
*.slo binary
*.lo binary
*.o binary
*.obj binary
# Precompiled Headers
*.gch binary
*.pch binary
# Compiled Dynamic libraries
*.so binary
*.dylib binary
*.dll binary
# Compiled Static libraries
*.lai binary
*.la binary
*.a binary
*.lib binary
# Executables
*.exe binary
*.out binary
*.app binary
# csharp
*.cs text diff=csharp
*.cshtml text diff=html
*.csx text diff=csharp
*.sln text eol=crlf
*.csproj text eol=crlf
# golang
*.go -text diff=golang
# Java sources
*.java text diff=java
*.kt text diff=kotlin
*.groovy text diff=java
*.scala text diff=java
*.gradle text diff=java
*.gradle.kts text diff=kotlin
# These files are text and should be normalized (Convert crlf => lf)
*.css text diff=css
*.scss text diff=css
*.sass text
*.df text
*.htm text diff=html
*.html text diff=html
*.js text
*.mjs text
*.cjs text
*.jsp text
*.jspf text
*.jspx text
*.properties text
*.tld text
*.tag text
*.tagx text
*.xml text
# These files are binary and should be left untouched
# (binary is a macro for -text -diff)
*.class binary
*.dll binary
*.ear binary
*.jar binary
*.so binary
*.war binary
*.jks binary
# Common build-tool wrapper scripts ('.cmd' versions are handled by 'Common.gitattributes')
mvnw text eol=lf
gradlew text eol=lf
# vi
*.vim text eol=lf
.vimrc text eol=lf
.gvimrc text eol=lf
[user]
name = Jia-Chang Chang
email = jiachanggit@gmail.com
[core]
quotepath = off
autocrlf = true
safecrlf = false
editor = vim
[http]
postBuffer = 524288000
lowSpeedLimit = 0
lowSpeedTime = 999999
version = HTTP/1.1
[alias]
adog = log --all --decorate --oneline --graph
co = checkout
ci = commit
st = status
br = branch
[difftool "sourcetree"]
cmd = '' \"$LOCAL\" \"$REMOTE\"
[mergetool "sourcetree"]
cmd = "'' "
trustExitCode = true
[commit]
template = ~/.stCommitMsg
# Name <email> <email2>
# Use "Name" and "<email>" for any commit with the address "<email2>". This is useful
# when a person has used more than one email address.
Jia-Chang Chang <jiachanggit@gmail.com> <louisxchang@gmail.com>
#-type:
#fix:
#style:
#docs:
#feat:
#test:
#chore:
# - scope: 影響範圍
#(Scope):
#{body}:
# - foot: 填寫任務編號
#{foot}:
set nocompatible
set encoding=utf-8 " Encoding UTF-8, to use Gvim correct
set t_Co=256 " set 256 colors
set background=dark " 告訴 Vim 編輯器終端機的背景色
colorscheme torte
set fileencodings=utf-8,big5,ucs-bom,cp950,euc-jp,euc-kr,latinl
set nobackup
set noswapfile
set wildignore=*.swp,*.bak,*.pyc,*.class,.svn
set history=1000
syntax enable " enable syntax
filetype plugin indent on
set backspace=indent,eol,start " Use the Backspace key to delete characters normally
set fileformats=unix
set shiftwidth=4
set tabstop=4 " A tab consumes 4 space
set expandtab " Tabs are spaces
set softtabstop=4 " Delete tabstop spaces when spaces are tab
" set autoindent
set smartindent
set path+=.,/usr/include,,** " 配置檔案路徑
set hlsearch " Highlight search results
set incsearch " Instantly search while typing
set ignorecase " Case-insensitive search
set smartcase " Switch to case-sensitive search when keywords contain uppercase
set wildmenu " Enable wildmenu while entering tab in command mode
set wildmode=list:longest,full " Allow full list and auto-completion in wildmenu
hi Search cterm=reverse ctermbg=none ctermfg=none
set magic " For regular expressions turn magic on
" Interface
set number " Show line number
set wrap " Wrap long lines
set showmatch " Show matching brackets when closing it
set matchtime=2 " Matching brackets highlight duration (200ms)
set showcmd " Show command status
set showmode
set scrolloff=5 " Start to scroll when reaching lines before the edge
se mouse=a " Enable mouse control in all modes
set ttymouse=xterm2 " Resolve mouse mode problem in tmux
set laststatus=2 " Show status line
set cursorline " Highlight current line
set cursorcolumn
hi CursorLine cterm=none ctermbg=DarkMagenta ctermfg=White
set noautowrite
set shortmess=atI " stop show ad
set novisualbell
set noerrorbells
set ruler " The line number at the bottom is displayed
set guifont=Courier_new:h14
hi! link SignColumn LineNr
hi! link ShowMarksHLl DiffAdd
hi! link ShowMarksHLu DiffChange
" for error highlight
highlight clear SpellBad
highlight SpellBad term=standout ctermfg=1 term=underline cterm=underline
highlight clear SpellCap
highlight SpellCap term=underline cterm=underline
highlight clear SpellRare
highlight SpellRare term=underline cterm=underline
highlight clear SpellLocal
highlight SpellLocal term=underline cterm=underline
" 常用的文字替代
" command! : {指令名稱} :execute '{執行動作}'
" command! Br2line :execute '%s/<br>/---/g'
" Unnamed registers are synchronized with the system clipboard
" set clipboard^=unnamed,unnamedplus
{
// Removes the useless "breadcrumbs" tree below our tabs
//"breadcrumbs.enabled": false,
// Add some padding to the top and bottom of our file
"editor.padding.bottom": 10,
"editor.padding.top": 10,
"editor.suggestSelection": "first",
"editor.parameterHints.enabled": false,
// enable or disable code lense
"editor.codeLens": false,
// close min map
"editor.minimap.enabled": false,
// 使用滑鼠滾輪並按住 Ctrl 時,縮放編輯器的字型
"editor.mouseWheelZoom": true,
"workbench.colorTheme": "Visual Studio Light",
// Tab 間隔
"editor.tabSize": 2,
// 字體大小
"editor.fontSize": 16,
"editor.fontFamily": "'Fira Code', Menlo, Monaco,'Courier New'",
"editor.bracketPairColorization.enabled": true,
// 字體間距
"editor.letterSpacing": 1,
// 行高
"editor.lineHeight": 26,
// 設定一行程式碼長度限制
"editor.rulers": [
50,
100
],
// 游標粗細
"editor.cursorWidth": 2,
// 顯示空白字元
"editor.renderWhitespace": "boundary",
"editor.guides.indentation": true,
// 啟用自訂程式碼樣版
"editor.tabCompletion": "on",
"editor.snippetSuggestions": "top",
// 設定儲存時自動格式化
"editor.formatOnSave": true,
"C_Cpp.clang_format_fallbackStyle": "{BasedOnStyle: Google}",
"editor.guides.bracketPairs": true,
// 除存檔案時,自動修正空格
"files.trimTrailingWhitespace": true,
// 新增一行作為檔案結束
"files.insertFinalNewline": true,
// new file using with cpp
"files.defaultLanguage": "cpp",
// 猜測檔案編碼,解決 VScode 不支援判讀檔案是 ASCII 編碼的問題
"files.autoGuessEncoding": true,
// 預設結尾斷行字元.LF使用 \n , CRLF使用\r\n
"files.eol": "\n",
// 控制檔案與資料夾在總管中的排列順序。除了預設排序外,您也可以將順序設定為 'mixed' (檔案與資料夾)、'type' (依檔案類型)、'modified' (依最後修改日期) 或 'filesFirst' (將檔案排序在資料夾前)。
"explorer.sortOrder": "type",
"window.titleBarStyle": "custom",
"workbench.startupEditor": "none",
// 打開VScode取消出現上次關閉的工作區或檔案
"window.restoreWindows": "none",
"terminal.integrated.scrollback": 1024,
// search
"search.showLineNumbers": true,
"search.smartCase": true,
// hide files
"files.exclude": {
//".idea": true,
"**/*.class": true,
//"**/.vscode": true,
"**/.DS_Store": true,
//"**/.git": true,
//"**/.svn": true,
//"**/.hg": true,
//"**/__pycache__": true,
"**/*.pyc": true,
"node_modules/": true,
"templates_module/": true,
"**/.project": true,
".mypy_cache/": true,
"**/*.exe": true
// "**/.classpath": true,
// "**/.coverage": true,
// "**/.factorypath": true,
// "**/.settings": true,
},
"search.exclude": {
"**/.git": true
//"**/node_modules": true
},
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell"
},
"Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
],
"args": [],
"icon": "terminal-cmd"
},
"Git Bash": {
"source": "Git Bash",
"icon": "github"
}
},
"terminal.integrated.defaultProfile.windows": "PowerShell",
// code runner
"code-runner.saveAllFilesBeforeRun": true,
"code-runner.saveFileBeforeRun": true,
"code-runner.clearPreviousOutput": true,
"code-runner.runInTerminal": true,
// delete tempCodeRunnerFile
"code-runner.ignoreSelection": true,
"code-runner.executorMap": {
"javascript": "node",
"java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
"c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"cpp": "cd $dir && g++ \"$fileName\" -o \"$fileNameWithoutExt\" && \"./$fileNameWithoutExt\"",
"objective-c": "cd $dir && gcc -framework Cocoa $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"php": "php",
"python": "python -u",
"perl": "perl",
"perl6": "perl6",
"ruby": "ruby",
"go": "go run",
"lua": "lua",
"groovy": "groovy",
"powershell": "powershell -ExecutionPolicy ByPass -File",
"bat": "cmd /c",
"shellscript": "bash",
"fsharp": "fsi",
"csharp": "cd $dir && dotnet run $fileName",
"vbscript": "cscript //Nologo",
"typescript": "ts-node",
"coffeescript": "coffee",
"scala": "scala",
"swift": "swift",
"julia": "julia",
"crystal": "crystal",
"ocaml": "ocaml",
"r": "Rscript",
"applescript": "osascript",
"clojure": "lein exec",
"haxe": "haxe --cwd $dirWithoutTrailingSlash --run $fileNameWithoutExt",
"rust": "cd $dir && rustc $fileName && $dir$fileNameWithoutExt",
"racket": "racket",
"scheme": "csi -script",
"ahk": "autohotkey",
"autoit": "autoit3",
"dart": "dart",
"pascal": "cd $dir && fpc $fileName && $dir$fileNameWithoutExt",
"d": "cd $dir && dmd $fileName && $dir$fileNameWithoutExt",
"haskell": "runhaskell",
"nim": "nim compile --verbosity:0 --hints:off --run",
"lisp": "sbcl --script",
"kit": "kitc --run",
"v": "v run",
"sass": "sass --style expanded",
"scss": "scss --style expanded",
"less": "cd $dir && lessc $fileName $fileNameWithoutExt.css",
"FortranFreeForm": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"fortran-modern": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"fortran_fixed-form": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"fortran": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"sml": "cd $dir && sml $fileName"
},
// javascript 跟 erb 要自己加
"auto-rename-tag.activationOnLanguage": [
"html",
"xml",
"php",
"javascript",
"erb"
],
// 在 HTML 貼上 <pre> 區段時,這個設定會導致 <pre> 標籤內的內容也被自動縮排,導致格式亂掉。
// 建議關閉 HTML 的自動縮排功能。
"[html]": {
"editor.autoIndent": "none"
},
"[css]": {
// 取消儲存時自動格式化
"editor.formatOnSave": false
},
"[makefile]": {
// 取消儲存時自動格式化
"editor.formatOnSave": false,
"editor.insertSpaces": false,
"editor.detectIndentation": false
},
"[c]": {
"files.encoding": "utf8"
},
"[cpp]": {
"files.encoding": "utf8"
},
"[cc]": {
"files.encoding": "utf8"
},
"[h]": {
"files.encoding": "utf8"
},
"[java]": {
// 設定預設編碼(cp950 utf8)
"files.encoding": "utf8",
},
"[python]": {
"editor.defaultFormatter": "ms-python.python",
},
"[json]": {
// 取消儲存時自動格式化
"editor.formatOnSave": false
},
// jsonc是有注释的json
"[jsonc]": {
// 取消儲存時自動格式化
"editor.formatOnSave": false
},
// cmake
"cmake.buildDirectory": "${workspaceFolder}/build/${buildType}",
"cmake.configureSettings": {
"CMAKE_TOOLCHAIN_FILE": "/vcpkg/scripts/buildsystems/vcpkg.cmake",
// "VCPKG_TARGET_TRIPLET": "x64-linux",
// "VCPKG_TARGET_TRIPLET": "x64-windows",
},
"cmake.configureOnOpen": true,
"cmake.options.statusBarVisibility": "visible",
"cmake.showOptionsMovedNotification": false,
// gremlins
"gremlins.showInProblemPane": true,
// project-tree
"ProjectTree.loadIgnore": true,
"ProjectTree.withComment": true,
"ProjectTree.useDefaultIgnore": true,
"ProjectTree.theme": "perfect",
"security.workspace.trust.untrustedFiles": "open",
"python.defaultInterpreterPath": "C:\\Users\\louis\\AppData\\Local\\Programs\\Python\\Python311\\python.exe",
"extensions.ignoreRecommendations": true,
// Doxygen documentation generator set
// 文件注释:版权信息模板
"doxdocgen.file.copyrightTag": [
"@copyright Copyright (c) {year} JIA-CHANG"
],
// 文件注释:自定义模块,这里我添加一个修改日志
"doxdocgen.file.customTag": [
"@par dialog:",
"<table>",
"<tr><th>Date <th>Version <th>Author <th>Description",
"<tr><td>{date} <td>1.0 <td>jiachang <td>description",
"</table>",
],
// 文件注释的组成及其排序
"doxdocgen.file.fileOrder": [
"file",
"brief",
"author",
"version",
"date",
"empty",
"copyright",
"empty",
"custom"
],
// 下面时设置上面标签tag的具体信息
"doxdocgen.file.fileTemplate": "@file {name}",
"doxdocgen.file.versionTag": "@version 1.0",
"doxdocgen.generic.authorEmail": "jiachanggit@gmail.com",
"doxdocgen.generic.authorName": "jiachang",
"doxdocgen.generic.authorTag": "@author {author} ({email})",
// 日期格式与模板
"doxdocgen.generic.dateFormat": "YYYY-MM-DD",
"doxdocgen.generic.dateTemplate": "@date {date}",
// 根据自动生成的注释模板(目前主要体现在函数注释上)
"doxdocgen.generic.order": [
"brief",
"tparam",
"param",
"return"
],
"doxdocgen.generic.paramTemplate": "@param{indent:8}{param}{indent:25}My Param doc",
"doxdocgen.generic.returnTemplate": "@return {type} ",
"doxdocgen.generic.splitCasingSmartText": true,
"search.followSymlinks": false,
// "git.autorefresh": false,
// pyqt 設定
//"pyqt-integration.pyuic.cmd": "C:\\Users\\louis\\AppData\\Local\\Programs\\Python\\Python311\\Scripts\\pyuic5.exe",
//"pyqt-integration.qtdesigner.path": "C:\\Users\\louis\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\designer.exe",
// 設定Prettier為格式化程序
//"editor.defaultFormatter": "esbenp.prettier-vscode",
// 使用單引號
//"prettier.singleQuote": true,
// 結束是否加分號
//"prettier.semi": true,
// 縮排空幾格
//"prettier.tabWidth": 4,
// 設定代碼最佳長度,超過則執行換行
//"prettier.printWidth": 48,
// 尾隨逗號
//"prettier.trailingComma": "es5",
// vim
//"vim.vimrc.path": "$HOME/.vimrc",
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment