Skip to content

Instantly share code, notes, and snippets.

@rydurham
Last active May 10, 2017 14:34
Show Gist options
  • Save rydurham/2e0a2fa99285d3d20398419f420627bc to your computer and use it in GitHub Desktop.
Save rydurham/2e0a2fa99285d3d20398419f420627bc to your computer and use it in GitHub Desktop.
Sublime Text Configuration Notes
Sublime Text Configuration Notes
1. Install Package Control
ctrl + `
import urllib.request,os,hashlib; h = 'df21e130d211cfc94d9b0905775a7c0f' + '1e3d39e33b79698005270310898eea76'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
2. Install SidebarEnhancements
3. Install AdvancedNewFile
4. Make sure there is a global installation of composer available
5. Create MET and PMET snippets
6. Install PHP Companion
7. Set up Key bindings
{ "keys": ["f9"], "command": "expand_fqcn"},
{ "keys": ["f10"], "command": "find_use"},
{ "keys": ["f4"], "command": "import_namespace"},
{"keys": ["ctrl+alt+w"], "command": "close_all"},
{"keys": ["ctrl+m"], "command": "reindent"}
8. Install Laravel 5 Artisan Commands package
9. Install Sublime Linter and Sublime Linter PHP plugins
10 Configure Sublime Linter user settings:
"show_errors_on_save": true,
11. Install php-cs-fixer
composer global require friendsofphp/php-cs-fixer
12. Set up PSR-2 build
"shell_cmd": "php-cs-fixer fix $file --rules=@PSR2"
Git Config:
git config --global user.name "Ryan Durham"
git config --global user.email [email protected]
git config --global core.editor "vim"
git config --global push.default simple
PHP Installation Notes
https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-in-ubuntu-16-04
sudo apt update
sudo apt install nginx php-fpm
Configure Nginx to use PHP:
/etc/nginx/sites-available/default:
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name server_domain_or_IP;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
Global Composer installation:
sudo apt update
sudo apt install curl
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
sudo chown -R ryan ~/.composer/
add to /etc/environment
home/ryan/.composer/vendor/bin
(you may need to log out and log back in for this to take effect)
Autocompletion in bash
$ echo set completion-ignore-case on | sudo tee -a /etc/inputrc
(you may need to log out and log back in for this to take effect)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment