# How to create my dev environment for golang and nodejs on an Ubuntu 16.04 VM. * update os and install vm tools, git and fish * setup [fish](http://fishshell.com/) with [oh-my-fish](https://github.com/oh-my-fish/oh-my-fish) and theme [bobthefish](https://github.com/oh-my-fish/theme-bobthefish) (bobthefish is a theme similar to [agnoster](https://github.com/agnoster/agnoster-zsh-theme)) * install nodejs 8.x and yarn * fix npm permission [issues](https://docs.npmjs.com/getting-started/fixing-npm-permissions) * install go * install _vs code_ ## Setup base system ```bash sudo apt update && \ sudo apt upgrade --yes && \ sudo apt install build-essential curl open-vm-tools-desktop git fish --yes ``` ## Terminal Download [Meslo LG M Regular for Powerline](https://github.com/powerline/fonts/blob/master/Meslo%20Slashed/Meslo%20LG%20M%20Regular%20for%20Powerline.ttf)-Font and install it with double click. ```bash curl https://raw.githubusercontent.com/powerline/fonts/master/Meslo%20Slashed/Meslo%20LG%20M%20Regular%20for%20Powerline.ttf -o ~/Downloads/meslo.ttf ``` Setup fish (see [issue](https://github.com/oh-my-fish/theme-bobthefish/issues/81#issuecomment-343188713) on Ubuntu 16.04): ```bash curl -L https://get.oh-my.fish | fish echo ' # setup npm permissions set -xg NPM_CONFIG_PREFIX $HOME/.npm-global set -xg PATH $HOME/.npm-global/bin $PATH # setup go set -xg PATH $PATH /usr/local/go/bin set -xg GOPATH $HOME/code/go set -xg PATH $PATH (go env GOPATH)/bin # misc stuff set -xg DEFAULT_USER dev alias aptup="sudo apt update; and sudo apt upgrade" ' > ~/.config/omf/init.fish # change to fish shell chsh -s /usr/bin/fish # install theme omf install bobthefish ``` Pin terminal app to task bar and edit terminal profile. Custom Font: **Meslo LG M for Powerline Regular (size 14)** Terminal-Size: **140 Columns and 32 Rows** ## Setup node && npm && yarn ```bash curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo 'deb https://dl.yarnpkg.com/debian/ stable main' | sudo tee /etc/apt/sources.list.d/yarn.list sudo apt update && \ sudo apt install nodejs yarn --yes npm install npm@latest -g ``` ## Setup Go ```bash wget https://redirector.gvt1.com/edgedl/go/go1.9.2.linux-amd64.tar.gz && \ sudo tar -C /usr/local -xzf go1.9.2.linux-amd64.tar.gz && \ rm ./go1.9.2.linux-amd64.tar.gz && \ mkdir -p ~/code/go && \ go get -u github.com/derekparker/delve/cmd/dlv ``` Install [dep](https://github.com/golang/dep/releases). ```bash wget https://github.com/golang/dep/releases/download/v0.3.2/dep-linux-amd64 mv dep-linux-amd64 ~/code/go/bin/dep ``` ## Setup VS Code Install [Visual Studio Code](https://code.visualstudio.com/download) ```bash sudo dpkg -i Downloads/code_1.16.1-1505406497_amd64.deb ``` Install extensions: * Debugger for Chrome, * EditorConfig for Visual Studio Code * Go (reload and run init of plugin) * JavaScript Standard Style * Material Icon Theme My default user settings: ```json { "editor.tabSize": 2, "editor.cursorStyle": "line", "editor.minimap.enabled": true, "explorer.autoReveal": true, "explorer.openEditors.visible": 0, "files.autoSave": "afterDelay", "files.autoSaveDelay": 5000, "files.eol": "\n", "files.insertFinalNewline": true, "git.enabled": true, "window.zoomLevel": 1, "workbench.iconTheme": "material-icon-theme", "workbench.startupEditor": "newUntitledFile", "go.formatOnSave": true, "material-icon-theme.showUpdateMessage": false } ```