Skip to content

Commit

Permalink
Sublime Text configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ssaunier committed Dec 14, 2015
1 parent 2da817a commit d54a53a
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 50 deletions.
20 changes: 20 additions & 0 deletions Package Control.sublime-settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"bootstrapped": true,
"installed_packages":
[
"AdvancedNewFile",
"All Autocomplete",
"ApplySyntax",
"BracketHighlighter",
"DocBlockr",
"Emmet",
"Git",
"GitGutter",
"JSX",
"Package Control",
"Ruby on Rails snippets",
"SCSS",
"Solarized Color Scheme",
"Theme - SoDaReloaded"
]
}
34 changes: 34 additions & 0 deletions Preferences.sublime-settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"color_scheme": "Packages/Solarized Color Scheme/Solarized (dark).tmTheme",
"detect_indentation": false,
"draw_white_space": true,
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
[
"tmp",
"log",
".git",
"_site",
".bundle",
".sass-cache",
"build"
],
"highlight_modified_tabs": true,
"hot_exit": false,
"ignored_packages":
[
"Vintage"
],
"remember_open_files": false,
"rulers":
[
80
],
"tab_size": 2,
"theme": "SoDaReloaded Dark.sublime-theme",
"translate_tabs_to_spaces": true,
"trim_automatic_white_space": true,
"trim_trailing_white_space_on_save": true,
"use_tab_stops": true,
"wordWrap": false
}
26 changes: 1 addition & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1 @@
Install
-------

**Assumption**: you have [`oh-my-zsh`](http://ohmyz.sh/) is already installed.

Your dotfiles are personal. [Fork this repo](https://github.com/lewagon/dotfiles/fork) on Github, and then clone it on your computer.

```
# Don't blindly copy paste this line, type it and put *your*
$ export GITHUB_USERNAME=my_github_username
```

```
# Sure you did not just copy paste the previous line? Sure? OK go on!
# You can now blinly copy paste this line *without changing anything*
$ mkdir -p ~/code/$GITHUB_USERNAME && cd $_ && git clone [email protected]:$GITHUB_USERNAME/dotfiles.git && cd dotfiles
```

Run the `dotfiles` installer. It will prompt you for your name and your email.

```bash
$ zsh install.sh
```

You're all set! Go back to [lewagon/setup](https://github.com/lewagon/setup)
Once this repo is forked, go back to [lewagon/setup](https://github.com/lewagon/setup)
13 changes: 13 additions & 0 deletions git_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
echo "Type in your first and last name (no accent or special characters - e.g. 'ç'): "
read full_name
echo "Type in your email address (the one used for your GitHub account): "
read email

git config --global user.email $email
git config --global user.name $full_name

git add .
git commit --message "My identity for @lewagon in the gitconfig"
git push origin master

git remote add upstream [email protected]:lewagon/dotfiles.git
6 changes: 5 additions & 1 deletion gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
.DS_Store
# Mac OSX Finder hidden files
.DS_Store

# Figaro gem
config/application.yml
49 changes: 26 additions & 23 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
backup() {
target=$1
if [ -e "$target" ]; then # Does the config file already exist?
if [ ! -L "$target" ]; then # as a pure file?
mv "$target" "$target.backup" # Then backup it
echo "-----> Moved your old $target config file to $target.backup"
fi
fi
}

#!/bin/zsh
for name in *; do
if [ ! -d "$name" ]; then
target="$HOME/.$name"
if [[ ! "$name" =~ '\.sh$' ]] && [ "$name" != 'README.md' ]; then
if [ -e "$target" ]; then # Does the config file already exist?
if [ ! -L "$target" ]; then # as a pure file?
mv "$target" "$target.backup" # Then backup it
echo "-----> Moved your old $target config file to $target.backup"
fi
fi
backup $target

if [ ! -e "$target" ]; then
echo "-----> Symlinking your new $target"
Expand Down Expand Up @@ -36,34 +41,32 @@ if [ ! -d "$ZSH_PLUGINS_DIR/zsh-history-substring-search" ]; then
fi
cd "$CURRENT_DIR"


echo "Type in your first and last name (no accent or special characters - e.g. 'ç'): "
read full_name
echo "Type in your email address (the one used for your GitHub account): "
read email
git config --global user.email $email
git config --global user.name $full_name

setopt nocasematch
if [[ ! `uname` =~ "darwin" ]]; then
git config --global core.editor "subl -n -w $@ >/dev/null 2>&1"
echo 'export BUNDLER_EDITOR="subl $@ >/dev/null 2>&1"' >> zshrc
else
git config --global core.editor "'/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl' -n -w"
bundler_editor="'/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl'"
git config --global core.editor "'/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl' -n -w"
bundler_editor="'/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl'"
echo "export BUNDLER_EDITOR=\"${bundler_editor}\"" >> zshrc
fi

git add .
git commit --message "My identity for @lewagon in the gitconfig"
git push origin master

git remote add upstream [email protected]:lewagon/dotfiles.git
# Sublime Text
if [[ ! `uname` =~ "darwin" ]]; then
SUBL_PATH=~/.config/sublime-text-3
else
SUBL_PATH=~/Library/Application\ Support/Sublime\ Text\ 3
fi
mkdir -p $SUBL_PATH/Packages/User $SUBL_PATH/Installed\ Packages
backup "$SUBL_PATH/Packages/User/Preferences.sublime-settings"
curl https://sublime.wbond.net/Package%20Control.sublime-package > $SUBL_PATH/Installed\ Packages/Package\ Control.sublime-package
ln -s $PWD/Preferences.sublime-settings $SUBL_PATH/Packages/User/Preferences.sublime-settings
ln -s $PWD/Package\ Control.sublime-settings $SUBL_PATH/Packages/User/Package\ Control.sublime-settings

zsh ~/.zshrc

if [[ `uname` =~ "darwin" ]]; then
echo "Quit your terminal (⌘ + Q) and restart it."
echo "Quit your terminal and restart it (⌘ + Q)."
else
echo "Quit your terminal (Alt + F4) and restart it."
echo "Quit your terminal and restart it (Alt + F4)."
fi
4 changes: 3 additions & 1 deletion zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ COMPLETION_WAITING_DOTS="true"
plugins=(gitfast brew rbenv last-working-dir common-aliases sublime zsh-syntax-highlighting zsh-history-substring-search)

source $ZSH/oh-my-zsh.sh
export PATH='/usr/local/bin:/usr/local/share:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/share/npm/bin:/usr/X11/bin:/usr/texbin:~/bin'
export PATH='./bin:/usr/local/bin:/usr/local/share:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/share/npm/bin:/usr/X11/bin:/usr/texbin:~/bin'

# Disable zsh correction
unsetopt correct_all
Expand All @@ -33,3 +33,5 @@ bindkey '^[OB' history-substring-search-down
# UTF-8 is our default encoding
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

# Bundle editor

0 comments on commit d54a53a

Please sign in to comment.