{"id":21814032,"url":"https://github.com/hoanhan101/dotfiles","last_synced_at":"2026-04-09T17:12:07.723Z","repository":{"id":112870194,"uuid":"117401576","full_name":"hoanhan101/dotfiles","owner":"hoanhan101","description":"vim, tmux, zsh, git, gpg, iterm2, go","archived":false,"fork":false,"pushed_at":"2023-01-21T23:59:53.000Z","size":86,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-26T06:11:08.326Z","etag":null,"topics":["docker","iterm2","tmux","vim","zsh"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hoanhan101.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-14T04:29:53.000Z","updated_at":"2023-01-21T23:59:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"bd1b3a8a-7e2d-4fd7-a8bf-62bc434d79e5","html_url":"https://github.com/hoanhan101/dotfiles","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoanhan101%2Fdotfiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoanhan101%2Fdotfiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoanhan101%2Fdotfiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoanhan101%2Fdotfiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hoanhan101","download_url":"https://codeload.github.com/hoanhan101/dotfiles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244769318,"owners_count":20507429,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","iterm2","tmux","vim","zsh"],"created_at":"2024-11-27T14:35:01.153Z","updated_at":"2025-12-30T20:53:08.965Z","avatar_url":"https://github.com/hoanhan101.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dev-setup\n\nThis repo contains my development setup, including different configurations for vim, tmux, zsh \nand iTerm2. It works best on Mac OS because Macbook is my main machine. However, I also do include \nthe scripts that support Linux and Docker so I can have other options.\n\n## Table of Contents\n\n- [Installation](#installation)\n  - [Mac OS, Ubuntu Linux x64](#mac-os-ubuntu-linux-x64)\n  - [Docker](#docker)\n- [Configuration](#configuration)\n  - [Github](#github)\n  - [zsh](#zsh)\n  - [Oh My Zsh](#oh-my-zsh)\n  - [iTerm2](#iterm2)\n  - [Ubuntu](#ubuntu)\n  - [MacOS](#macos)\n  - [Golang](#golang)\n  - [vim-go](#vim-go)\n- [Usage](#usage)\n  - [tmux](#tmux)\n  - [Distraction-free writing environment](#distraction-free-writing-environment)\n\n## Installation \n\n### Mac OS, Ubuntu Linux x64\n\n\u003e Mac OS requires Xcode to install some tools.\n\n```\ngit clone https://github.com/hoanhan101/dotfiles.git \u0026\u0026 cd dotfiles \u0026\u0026 ./setup.sh\n```\n\n**MacVim**\n\nIf `brew install vim` doesn't work, might want to try Macvim.\n- Download and the latest version of [Macvim](https://github.com/macvim-dev/macvim/releases)\n- Put this in `.zshrc`: `alias vim='/Applications/MacVim.app/Contents/MacOS/Vim'`.\n\n**Tell vim not to add a new line at end of line**\n\n\u003e https://stackoverflow.com/questions/1050640/how-to-stop-vim-from-adding-a-newline-at-end-of-file\n\n**YouCompleteMe**\n\nIf there is anything wrong with YouComplete, read the [documentaion\n](https://github.com/Valloric/YouCompleteMe#mac-os-x) carefully\none more time.: https://github.com/Valloric/YouCompleteMe#mac-os-x\n\n### Docker\n\nEither one of these 3 options below:\n\n**Quick run**\n```\ndocker run -ti hoanhan/dev-setup\n```\n\n**Build and run**\n```\ndocker build -t dev-setup . \u0026\u0026 docker run -ti dev-setup\n```\n\n**Install script from a Docker container**\n```\ngit clone https://github.com/hoanhan101/dev-setup.git \u0026\u0026 cd dev-setup \u0026\u0026 ./docker-setup.sh\n```\n\n## Configuration\n\n### Github\n\n**Sign commits using GPG**\n\nGenerate the key:\n```\ngpg --full-generate-key\n```\n\nCopy the key ID:\n```\ngpg --list-secret-keys --keyid-format LONG\n```\n\nSubstitute with:\n```\ngpg --armor --export \u003cKEY_ID\u003e\n```\n\u003e [Github reference](https://help.github.com/articles/generating-a-new-gpg-key/)\n\nCopy from stdout and add to Github account.\n\nSet the signing key in Git:\n```\ngit config --global user.signingkey \u003cKEY_ID\u003e\ngit config --global commit.gpgSign true\n```\n\nAdd it to the bash profile:\n```\necho 'export GPG_TTY=$(tty)' \u003e\u003e ~/.profile\n```\n\nIf it is saying failing to write, do this again:\n```\nexport GPG_TTY=$(tty)\n```\n\nIf this is failing to write every time we start a session, try\n[this](https://stackoverflow.com/questions/39494631/gpg-failed-to-sign-the-data-fatal-failed-to-write-commit-object-git-2-10-0).\n\n### zsh\n\n**Mac OS**\n\nInstall and make zsh default shell. Need to restart after this in order for the changes to take place.\n```\nbrew install zsh \u0026\u0026 chsh -s $(which zsh)\n```\n\nIf these command doesn't work then can change the path directly in Terminal settings to `/usr/local/bin/zsh`.\n\n**Ubuntu**\n\nIf running the script doesn't install zsh completely, might want to try:\n```\nsudo apt-get install zsh\n```\n\nMannually `sudo vim /etc/pam.d/chsh` and comment the `auth required pam_shells.so`.\n\n`sudo chsh $USER -s $(which zsh)` and restart.\n\nNow `zsh` is working and we can install `oh-my-zsh`:\n```\nsh -c \"$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)\"\n```\n\n### Oh My Zsh\n\n**Enable syntax hightlight**\n\nLink:\n[github](https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/INSTALL.md#oh-my-zsh)\n\n**Enable fish-like autosuggestion**\n\nLink:\n[github](https://github.com/zsh-users/zsh-autosuggestions/blob/master/INSTALL.md#oh-my-zsh)\n\n### iTerm2\n\n**Font**\n\nNeed to setup [Powerline fonts](https://github.com/powerline/fonts) to prevent Unicode error.\nThe script is already included in the setup. Only need to update font in iTerm2:\n```\nPreferences \u003e Profiles \u003e Text \u003e Change Font \u003e 12pt Inconsolata-dz for Powerline\n```\n\n**tmux**\n\nIn order to switch between planes in tmux, need to remap Alt/Option key to Esc+.\n```\nPreferences \u003e Profiles \u003e Keys \u003e Left Key \u003e Esc+\n```\n\n**Shortcuts**\n```\nPreferences \u003e Profiles \u003e Keys \u003e +\n```\n\nGoing forward one word:\n```\nKeyboard shortcut: Option+f\nAction           : Send Escape Sequence\nEsc+             : f\n```\n\nGoing backward one word:\n```\nKeyboard shortcut: Option+b\nAction           : Send Escape Sequence\nEsc+             : b\n```\n\nDelete backward one word:\n```\nKeyboard shortcut: Option+Delete\nAction           : Send Hex Code \nValue            : 0x1B 0x08\n```\n\n### Ubuntu\n\n**Copy and paste in tmux**\n\nMake sure to install `xclip` in put this one for vim yanking mode in tmux config\nfile:\n\n```\nbind -t vi-copy y copy-pipe \"xclip -sel clip -i\"\n```\n\n### MacOS\n\n**Speed up vim cursor**\n\nSet the Preferences/Keyboard settings at max for these two options:\n- Key Repeat\n- Deplay Until Repeat\n\n**Slow `\u003cSHIFT\u003e + O` in vim**\n\nThe problem is, on some terminals,`\u003cSHIFT\u003e + O` is a prefix for several\nkeycodes. To fix it, need to set the timeout as follows:\n```\n:set timeout timeoutlen=5000 ttimeoutlen=100\n```\n\n\u003e Reference:\n\u003e [https://github.com/vim/vim/issues/24](https://github.com/vim/vim/issues/24)\n\n**`ls` color**\n\nIn case `ls` doesn't have colored output, which might be the result of a\nconflict between zsh theme and `LSCOLORS`. A simple way to fix:\n\n```\nunset LSCOLORS\nexport CLICOLOR=1\nexport CLICOLOR_FORCE=1\n```\n([source](https://github.com/robbyrussell/oh-my-zsh/issues/5349))\n\n### Golang\n\n**Set `GOPATH`**\n\n\u003e Reference:\n\u003e [hoanhan101/go-playground](https://github.com/hoanhan101/go-playground),\n\u003e [hoanhan101/ultimate-go](https://github.com/hoanhan101/ultimate-go)\n\nAfter downloading the binary release fro your system, need to setup the GOPATH\ncorrectly. A simple and straightforward setup is to, first `mkdir $HOME/go`,\nthen in `.zshrc`:\n```\nexport GOPATH=$HOME/go\nexport PATH=$PATH:/usr/local/go/bin:$GOPATH/bin\n```\n\n**Set alias for quick navigation**\n\nIn `.zshrc`, set something like this:\n```\nalias tohoanhan101=\"cd /Users/hoanhan/go/src/github.com/hoanhan101\"\n```\n\n**Setup autocompletion to use with vim**\n\nNeed to get the [nsf/gocode](https://github.com/nsf/gocode) package first\nbefore adding the plugin to vim and update with Vundle. \n\n### vim-go\n\n**`:GoDef`**\n\nIf `:GoDef` (or `gd` for short)  is not working properly, might want to check\nif `go/bin` is added to your `PATH`. Normally it would be configured to\nsomething like this.\n```\nexport PATH=$PATH:$HOME/go/bin\n```\n\nThen `:GoUpdateBinaries` to update.\n\n\u003e Reference:\n\u003e [using `:GoDef` failed](https://github.com/fatih/vim-go/issues/1807)\n\n## Usage\n\n### tmux\n\n**Pre-config tmux with splitted plane**\n\n```\n./tmux.init [session-name] [working-directory]\n```\nwhere default `session-name` is `dev` and default `working-directory` is current directory.\n\n### Distraction-free writing environment\n\nIn vim:\n- `:Goyo` to enter a distraction-free mode.\n- `:SoftPencil` to enable soft-wrap.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoanhan101%2Fdotfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoanhan101%2Fdotfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoanhan101%2Fdotfiles/lists"}