Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
toranb committed May 8, 2014
0 parents commit 34cb15e
Show file tree
Hide file tree
Showing 35 changed files with 1,896 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Ignore all the files and folders in the bundle directory
vim/bundle/
vim/bundle/L9/*
vim/bundle/AutoComplPop/*
vim/bundle/bash-support.vim/*
vim/bundle/vim-buffer-explorer-plugin/*
vim/bundle/delimitMate/*
vim/bundle/supertab/*
vim/bundle/syntastic/*
vim/bundle/tagbar/*
vim/bundle/vim-fugitive/*
vim/bundle/vim-javascript/*
vim/bundle/vundle/*

.DS_Store
Mac/.DS_Store
Linux/.DS_Store
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
dotfiles for the javascript and python developer
===========

Install instructions
--------------------
1. Clone this repo into ~/dotfiles
2. Run the symlink.sh script which will create the required symlinks in your home folder
3. Pip install jedi globally
4. After installation the first time you open vim run :BundleInstall wait for it to complete and exit vim

6 changes: 6 additions & 0 deletions ackrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
--literal
--smart-case
--type-set=handlebars=.handlebars
--type=python
--type=ruby
--type=handlebars
2 changes: 2 additions & 0 deletions config/flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length=120
1 change: 1 addition & 0 deletions gemrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gem: --no-ri --no-rdoc
14 changes: 14 additions & 0 deletions gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[color]
ui = true
branch = true
diff = true
interactive = true
status = true
[color "status"]
added = green
changed = red
deleted = red
untracked = yellow
[user]
name = toran billups
email = [email protected]
19 changes: 19 additions & 0 deletions psqlrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
\set PROMPT1 '\n%[%033[1;37m%]┌──(%033[1;34m%]User:%[%033[32m%]%n%[%033[34m%] Port:%[%033[32m%]%>%[%033[34m%] DB:%[%033[32m%]%/%033[37m%])%033[0m%]\n└─➤ '

-- Make null display as NULL and not an empty string
\pset null '[NULL]'

-- Table format default expanded format when too much data for one screen
\x auto

-- Verbose error reports.
\set VERBOSITY verbose

-- Use a separate history file per-database.
\set HISTFILE ~/.psql_history- :DBNAME

-- If command run more than once in a row, only store once in history.
\set HISTCONTROL ignoredups

-- complete keywords (like SELECT) in upper-case
\set COMP_KEYWORD_CASE upper
63 changes: 63 additions & 0 deletions symlink.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/bin/bash

##
# You must delete all existing *zsh*, *vim* and *tmux* files and directories
# in your home folder for these new files to work
##
sudo rm -rf ~/.tmux > /dev/null 2>&1
sudo rm -rf ~/.zsh-custom > /dev/null 2>&1
sudo rm -rf ~/.gemrc > /dev/null 2>&1
sudo rm -rf ~/.gitignore > /dev/null 2>&1
sudo rm -rf ~/.gitmodules > /dev/null 2>&1
sudo rm -rf ~/.gvimrc > /dev/null 2>&1
sudo rm -rf ~/.vimrc > /dev/null 2>&1
sudo rm -rf ~/.viminfo > /dev/null 2>&1
sudo rm -rf ~/.vim > /dev/null 2>&1
sudo rm -rf ~/.oh-my-zsh > /dev/null 2>&1
sudo rm -rf ~/.slate > /dev/null 2>&1
sudo rm -rf ~/.tmux.conf > /dev/null 2>&1
sudo rm -rf ~/.zshrc > /dev/null 2>&1
sudo rm -rf ~/.gitconfig > /dev/null 2>&1
sudo rm -rf ~/.zsh_prompt > /dev/null 2>&1
sudo rm -rf ~/.zsh-syntax-highlighting.zsh > /dev/null 2>&1
sudo rm -rf ~/highlighters > /dev/null 2>&1
sudo rm -rf ~/.ackrc > /dev/null 2>&1
sudo rm -rf ~/README > /dev/null 2>&1
sudo rm -rf ~/.antigen > /dev/null 2>&1
sudo rm -rf ~/.antigen.zsh > /dev/null 2>&1
if [ "$(uname)" = "Darwin" ]; then
sudo rm -rf ~/.config > /dev/null 2>&1
fi
sudo rm -rf ~/.tigrc > /dev/null 2>&1
sudo rm -rf ~/.psqlrc


# Symlink the new config files. Assumes files are saved in ~/dotfiles
ln -s ~/dotfiles/vim ~/.vim
ln -s ~/dotfiles/vimrc ~/.vimrc
if [ "$(uname)" = "Darwin" ]; then
ln -s ~/dotfiles/tmux/mac_tmux ~/.tmux
ln -s ~/dotfiles/config ~/.config
else
ln -s ~/dotfiles/tmux/linux_tmux ~/.tmux
fi
ln -s ~/dotfiles/tmux/tmux.conf ~/.tmux.conf
ln -s ~/dotfiles/zsh/zshrc ~/.zshrc
ln -s ~/dotfiles/ackrc ~/.ackrc
ln -s ~/dotfiles/gitconfig ~/.gitconfig
ln -s ~/dotfiles/gemrc ~/.gemrc
ln -s ~/dotfiles/psqlrc ~/.psqlrc
ln -s ~/dotfiles/tigrc ~/.tigrc

echo -n "Would you like to configure your git name and email? (y/n) => "; read answer
if [[ $answer = "Y" ]] || [[ $answer = "y" ]]; then
echo -n "What is your git user name => "; read name
git config --global user.name "$name"
echo -n "What is your git email => "; read email
git config --global user.email "$email"
fi

echo "*******************************"
echo "* Restart your terminal *"
echo "*******************************"

1 change: 1 addition & 0 deletions tigrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bind status D !@?rm %(file)
46 changes: 46 additions & 0 deletions tmux/linux_tmux/themes/default.tmux
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# -------------
# Try to get close to normal colors in tmux
# -------------
set -g default-terminal "screen-256color"

# -------------
# start with window 1 (instead of 0)
# -------------
set -g base-index 1

# -------------
# start with pane 1
# -------------
set -g pane-base-index 1

# -------------
# status line
# -------------
set -g status-utf8 on
set -g status-justify left
set -g status-bg black
set -g status-fg white
set -g status-interval 4

# -------------
# window status
# -------------
setw -g window-status-format "#[fg=black]#[bg=colour7] #I #[fg=black]#[bg=colour15] #W "
setw -g window-status-current-format "#[fg=colour8]#[bg=white] #I #[bg=colour69]#[fg=white] #W "
setw -g window-status-current-bg black
setw -g window-status-current-fg yellow
setw -g window-status-current-attr bold
setw -g window-status-bg black
setw -g window-status-fg blue
setw -g window-status-attr default
setw -g window-status-content-bg black
setw -g window-status-content-fg blue
setw -g window-status-content-attr bold

# -------------
# Info on left (no session display)
# -------------
set -g status-left ''
set -g status-right-length 150
set -g status-right '#[fg=colour69] #(hostname -I | cut -d " " -f 1) | %H:%M '
set -g status-utf8 on
3 changes: 3 additions & 0 deletions tmux/mac_tmux/scripts/remaining_battery.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

pmset -g ps | sed -n 's/.*[[:blank:]]+*\(.*%\).*/\1/p'
47 changes: 47 additions & 0 deletions tmux/mac_tmux/themes/default.tmux
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# -------------
# Try to get close to normal colors in tmux
# -------------
set -g default-terminal "screen-256color"

# -------------
# start with window 1 (instead of 0)
# -------------
set -g base-index 1

# -------------
# start with pane 1
# -------------
set -g pane-base-index 1

# -------------
# status line
# -------------
set -g status-utf8 on
set -g status-justify left
#set -g status-bg black
set -g status-bg colour234
set -g status-fg white
set -g status-interval 4

# -------------
# window status
# -------------
setw -g window-status-format "#[fg=black]#[bg=colour7] #I #[fg=black]#[bg=colour15] #W "
setw -g window-status-current-format "#[fg=colour8]#[bg=white] #I #[bg=colour69]#[fg=white] #W "
setw -g window-status-current-bg black
setw -g window-status-current-fg yellow
setw -g window-status-current-attr bold
setw -g window-status-bg black
setw -g window-status-fg blue
setw -g window-status-attr default
setw -g window-status-content-bg black
setw -g window-status-content-fg blue
setw -g window-status-content-attr bold

# -------------
# Info on left (no session display)
# -------------
set -g status-left ''
set -g status-right-length 150
set -g status-right " #[fg=colour160] ♥ #[fg=colour69]#(bash ~/.tmux/scripts/remaining_battery.sh) | #(ifconfig | grep 192 | cut -d ' ' -f 2) | %H:%M "
set -g status-utf8 on
55 changes: 55 additions & 0 deletions tmux/tmux.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
set -sg escape-time 0
set -g prefix C-Space
set -g default-terminal "xterm"
source-file "${HOME}/.tmux/themes/default.tmux"

# -----------------------------------------------------------------------------
# Turn on window renumbering
# -----------------------------------------------------------------------------
set-option -g renumber-windows on

# -----------------------------------------------------------------------------
# Turn on Vim mode for movement
# Also allows easy upwards searching
# -----------------------------------------------------------------------------
setw -g mode-keys vi

# -----------------------------------------------------------------------------
# Vim visual selection and yank when in copy mode
# -----------------------------------------------------------------------------
bind Space copy-mode
bind C-Space copy-mode
bind -t vi-copy v begin-selection
bind -t vi-copy y copy-selection
bind -t vi-copy Escape cancel

# -----------------------------------------------------------------------------
# After we have something yanked back in Vim we can paste our yanked selection
# anywhere we are in insert mode with (prefix p). This works in the vim buffer,
# search and fuzzy finder buffer for example
# -----------------------------------------------------------------------------
bind p paste-buffer

# -----------------------------------------------------------------------------
# Easier for my brain to remember to split the pane with - and \
# which resemble a horizontal and vertical split respectively
# doesn't override default (prefix ") and (prefix &)
# -----------------------------------------------------------------------------
bind \ split-window -h
bind - split-window

# -----------------------------------------------------------------------------
# Put Ctrl-l back as Ctrl-u
# Here is how to do this good luck finding a key
# -----------------------------------------------------------------------------
#bind -n C-u send-keys 'C-l'

# -----------------------------------------------------------------------------
# Switch between tmux screen splits and Vim splits with the same keys!
# <C-h><C-j><C-k><C-l>
# -----------------------------------------------------------------------------
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys 'C-\\') || tmux select-pane -l"
13 changes: 13 additions & 0 deletions vim/ftplugin/coffee.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"===================================================================================
" FILE: coffee.vim
" DESCRIPTION: Settings that load only for files with the .coffee extension
" AUTHOR: IMT APPS
"===================================================================================
"
" Settings for proper indentation
setlocal tabstop=2
setlocal softtabstop=2
setlocal shiftwidth=2

" Poor mans jump to definition short cut
nnoremap <leader>j <C-]>
28 changes: 28 additions & 0 deletions vim/ftplugin/css.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"===================================================================================
" FILE: css.vim
" DESCRIPTION: Settings that load only for files with the .css extension
" AUTHOR: IMT Apps
"===================================================================================
"

" Folds multiline css files into single line, the readability of a multiline
" with the space saving of a single line. How you going to beat that?
function! CssFoldText()
let line = getline(v:foldstart)
let nnum = nextnonblank(v:foldstart + 1)
while nnum < v:foldend+1
let line = line . " " . substitute(getline(nnum), "^ *", "", "g")
let nnum = nnum + 1
endwhile
return line
endfunction

setlocal foldtext=CssFoldText()
setlocal foldmethod=marker
setlocal foldmarker={,}
setlocal fillchars=fold:\

" Alphabetize the next css property group below the cursor with <F7>. only
" does one property group at a time. Feels safer to me than doing the
" whole thing all at once.
nmap <F7> /{/+1<CR>vi{:sort<CR>
3 changes: 3 additions & 0 deletions vim/ftplugin/html.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
setlocal shiftwidth=2
setlocal tabstop=2
runtime macros/matchit.vim
12 changes: 12 additions & 0 deletions vim/ftplugin/javascript.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"===================================================================================
" FILE: javascript.vim
" DESCRIPTION: Settings that load only for files with the .js extension
" AUTHOR: IMT Apps
"===================================================================================
"
" Settings for proper indentation
setlocal tabstop=4
setlocal softtabstop=4
setlocal shiftwidth=4
setlocal smarttab
setlocal expandtab
15 changes: 15 additions & 0 deletions vim/ftplugin/python.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"===================================================================================
" FILE: python.vim
" DESCRIPTION: Settings that load only for files with the .py extension
" AUTHOR: IMT Apps
"===================================================================================
"
" Settings for proper indentation
setlocal tabstop=4
setlocal softtabstop=4
setlocal shiftwidth=4
setlocal smarttab
setlocal expandtab

" Make sure we use the correct comment string in vim-commentary plug-in
set commentstring=#\ %s
15 changes: 15 additions & 0 deletions vim/ftplugin/ruby.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"===================================================================================
" FILE: ruby.vim
" DESCRIPTION: Settings that load only for files with the .rb extension
" AUTHOR: IMT Apps
"===================================================================================
"
" Settings for proper indentation
setlocal tabstop=2
setlocal softtabstop=2
setlocal shiftwidth=2
setlocal smarttab
setlocal expandtab

" Make sure we use the correct comment string in vim-commentary plug-in
set commentstring=#\ %s
Loading

0 comments on commit 34cb15e

Please sign in to comment.