Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/SherrySeibel/dotfiles-1:
  add snipmate settings
  Fix apt error
  fix(test) interactive rake install
  feat(test): Ubuntu Bionic Beaver docker
  Use single quote string
  Use single quote strings
  Remove zshrc post-install inserts
  zshrc override
  Install directly prezto-override
  automate plugin install of vim s no prompt is displayed
  copy-mode-vi key binds
  Update tmux-vim configuration
  Fix C- tmux error
  Revert setting +x
  Fix skwp#845 Vim suspends in some times
  added contributors alias into git.
  Update Homebrew install method
  feat(*): Colorized irb prompt
  • Loading branch information
Sherry Seibel committed Dec 14, 2021
2 parents 5df04a7 + e9c8cf5 commit 271ff23
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 308 deletions.
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
FROM ubuntu:16.04
FROM ubuntu:18.04
LABEL maintainer="Luiz Filho <[email protected]>"

# Let the container know that there is no tty
ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm-256color

# Bootstrapping packages needed for installation
Expand All @@ -23,8 +21,8 @@ RUN localedef -i en_US -f UTF-8 en_US.UTF-8 && \
# Install dependencies
# `universe` is needed for ruby
# `security` is needed for fontconfig and fc-cache
RUN \
add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe security" && \
# Let the container know that there is no tty
RUN DEBIAN_FRONTEND=noninteractive \
add-apt-repository ppa:aacebedo/fasd && \
apt-get update && \
apt-get -yqq install \
Expand Down
41 changes: 15 additions & 26 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def install_homebrew
puts "Installing Homebrew, the OSX package manager...If it's"
puts "already installed, this will do nothing."
puts "======================================================"
run %{ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"}
run %{bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"}
end

puts
Expand Down Expand Up @@ -275,11 +275,12 @@ def install_prezto
run %{ ln -nfs "$HOME/.yadr/zsh/prezto" "${ZDOTDIR:-$HOME}/.zprezto" }

# The prezto runcoms are only going to be installed if zprezto has never been installed
install_files(Dir.glob('zsh/prezto/runcoms/z*'), :symlink)

puts
puts "Overriding prezto ~/.zpreztorc with YADR's zpreztorc to enable additional modules..."
run %{ ln -nfs "$HOME/.yadr/zsh/prezto-override/zpreztorc" "${ZDOTDIR:-$HOME}/.zpreztorc" }
install_files(Dir.glob('zsh/prezto-override/zshrc'), :symlink)
install_files(Dir.glob('zsh/prezto/runcoms/zlogin'), :symlink)
install_files(Dir.glob('zsh/prezto/runcoms/zlogout'), :symlink)
install_files(Dir.glob('zsh/prezto-override/zpreztorc'), :symlink)
install_files(Dir.glob('zsh/prezto/runcoms/zprofile'), :symlink)
install_files(Dir.glob('zsh/prezto/runcoms/zshenv'), :symlink)

puts
puts "Creating directories for your customizations"
Expand Down Expand Up @@ -342,18 +343,6 @@ def install_files(files, method = :symlink)
run %{ cp -f "#{source}" "#{target}" }
end

# Temporary solution until we find a way to allow customization
# This modifies zshrc to load all of yadr's zsh extensions.
# Eventually yadr's zsh extensions should be ported to prezto modules.
source_config_code = "for config_file ($HOME/.yadr/zsh/*.zsh) source $config_file"
if file == 'zshrc'
File.open(target, 'a+') do |zshrc|
if zshrc.readlines.grep(/#{Regexp.escape(source_config_code)}/).empty?
zshrc.puts(source_config_code)
end
end
end

puts "=========================================================="
puts
end
Expand All @@ -380,13 +369,13 @@ def apply_theme_to_iterm_profile_idx(index, color_scheme_path)
end

def success_msg(action)
puts ""
puts " _ _ _ "
puts " | | | | | | "
puts " | |___| |_____ __| | ____ "
puts " |_____ (____ |/ _ |/ ___) "
puts " _____| / ___ ( (_| | | "
puts " (_______\_____|\____|_| "
puts ""
puts %q{
_ _ _
| | | | | |
| |___| |_____ __| | ____
|_____ (____ |/ _ |/ ___)
_____| / ___ ( (_| | |
(_______\_____|\____|_|
}
puts "YADR has been #{action}. Please restart your terminal and vim."
end
2 changes: 1 addition & 1 deletion bin/yadr/vundle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def self.vundle_list
end

def self.update_vundle
system "vim --noplugin -u #{ENV['HOME']}/.vim/vundles.vim -N \"+set hidden\" \"+syntax on\" +BundleClean +BundleInstall! +qall"
system "vim --noplugin -u #{ENV['HOME']}/.vim/vundles.vim -N \"+set hidden\" \"+syntax on\" \"+let g:session_autosave = 'no'\" +BundleClean +BundleInstall! +qall"
end


Expand Down
2 changes: 2 additions & 0 deletions git/gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# add
a = add # add
chunkyadd = add --patch # stage commits chunk by chunk
# Shows list of contributors of a repository.
contributors = shortlog --summary --numbered --email

# via http://philjackson.github.io/2013/04/07/handy-git-tips-to-stop-you-getting-fired.html
snapshot = !git stash save "snapshot: $(date)" && git stash apply "stash@{0}"
Expand Down
24 changes: 0 additions & 24 deletions irb/aprc

This file was deleted.

68 changes: 0 additions & 68 deletions irb/escaped_colors.rb

This file was deleted.

117 changes: 10 additions & 107 deletions irb/pryrc
Original file line number Diff line number Diff line change
@@ -1,113 +1,16 @@
# === EDITOR ===
Pry.editor = 'vi'

# == Pry-Nav - Using pry as a debugger ==
Pry.commands.alias_command 'c', 'continue' rescue nil
Pry.commands.alias_command 's', 'step' rescue nil
Pry.commands.alias_command 'n', 'next' rescue nil

# === CUSTOM PROMPT ===
# This prompt shows the ruby version (useful for RVM)
Pry.prompt = [proc { |obj, nest_level, _| "#{RUBY_VERSION} (#{obj}):#{nest_level} > " }, proc { |obj, nest_level, _| "#{RUBY_VERSION} (#{obj}):#{nest_level} * " }]

# === Listing config ===
# Better colors - by default the headings for methods are too
# similar to method name colors leading to a "soup"
# These colors are optimized for use with Solarized scheme
# for your terminal
Pry.config.ls.separator = "\n" # new lines between methods
Pry.config.ls.heading_color = :magenta
Pry.config.ls.public_method_color = :green
Pry.config.ls.protected_method_color = :yellow
Pry.config.ls.private_method_color = :bright_black

# == PLUGINS ===
# awesome_print gem: great syntax colorized printing
# look at ~/.aprc for more settings for awesome_print
# == JazzFingers ===
# jazz_fingers gem: great syntax colorized printing
begin
require 'awesome_print'
require 'jazz_fingers'
# The following line enables awesome_print for all pry output,
# and it also enables paging
Pry.config.print = proc {|output, value| Pry::Helpers::BaseHelpers.stagger_output("=> #{value.ai}", output)}

# If you want awesome_print without automatic pagination, use the line below
# Pry.config.print = proc { |output, value| output.puts value.ai }
rescue LoadError => err
puts "gem install awesome_print # <-- highly recommended"
end

# === CUSTOM COMMANDS ===
# from: https://gist.github.com/1297510
default_command_set = Pry::CommandSet.new do
command "copy", "Copy argument to the clip-board" do |str|
IO.popen('pbcopy', 'w') { |f| f << str.to_s }
end

command "clear" do
system 'clear'
if ENV['RAILS_ENV']
output.puts "Rails Environment: " + ENV['RAILS_ENV']
end
end

command "sql", "Send sql over AR." do |query|
if ENV['RAILS_ENV'] || defined?(Rails)
pp ActiveRecord::Base.connection.select_all(query)
else
pp "No rails env defined"
end
end
command "caller_method" do |depth|
depth = depth.to_i || 1
if /^(.+?):(\d+)(?::in `(.*)')?/ =~ caller(depth+1).first
file = Regexp.last_match[1]
line = Regexp.last_match[2].to_i
method = Regexp.last_match[3]
output.puts [file, line, method]
end
end
end

Pry.config.commands.import default_command_set


# === CONVENIENCE METHODS ===
# Stolen from https://gist.github.com/807492
# Use Array.toy or Hash.toy to get an array or hash to play with
class Array
def self.toy(n=10, &block)
block_given? ? Array.new(n,&block) : Array.new(n) {|i| i+1}
end
end

class Hash
def self.toy(n=10)
Hash[Array.toy(n).zip(Array.toy(n){|c| (96+(c+1)).chr})]
end
end

# === COLOR CUSTOMIZATION ===
# Everything below this line is for customizing colors, you have to use the ugly
# color codes, but such is life.
CodeRay.scan("example", :ruby).term # just to load necessary files
# Token colors pulled from: https://github.com/rubychan/coderay/blob/master/lib/coderay/encoders/terminal.rb

$LOAD_PATH << File.dirname(File.realpath(__FILE__))

# In CodeRay >= 1.1.0 token colors are defined as pre-escaped ANSI codes
if Gem::Version.new(CodeRay::VERSION) >= Gem::Version.new('1.1.0')
require "escaped_colors"
else
require "unescaped_colors"
end

module CodeRay
module Encoders
class Terminal < Encoder
# override old colors
TERM_TOKEN_COLORS.each_pair do |key, value|
TOKEN_COLORS[key] = value
end
end
JazzFingers.configure do |config|
config.colored_prompt = true
config.amazing_print = true
config.coolline = false
config.application_name = MyAwesomeProject
end
rescue LoadError => error
puts "gem install jazz_fingers # <-- highly recommended"
end
68 changes: 0 additions & 68 deletions irb/unescaped_colors.rb

This file was deleted.

Loading

0 comments on commit 271ff23

Please sign in to comment.