Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78d7cf1014 | ||
|
|
eb15ddf87a | ||
|
|
14382f29e7 | ||
|
|
c20830dcb5 | ||
|
|
40622a84ca | ||
|
|
f9441d3df9 | ||
|
|
4fa6f90a9e |
@@ -1,4 +1,3 @@
|
|||||||
docker-compose.yml
|
docker-compose.yml
|
||||||
Dockerfile
|
Dockerfile
|
||||||
bin/fix_macvim_external_display.sh
|
|
||||||
bin/macos
|
bin/macos
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
.yadr/irb/escaped_colors.rb
|
|
||||||
-10
@@ -1,17 +1,7 @@
|
|||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
custom/zsh
|
custom/zsh
|
||||||
|
|
||||||
vim/backups
|
|
||||||
vim/view
|
|
||||||
*un~
|
*un~
|
||||||
vim/.netrwhist
|
|
||||||
vim/tmp
|
|
||||||
vim/spell
|
|
||||||
vim/after/.vimrc.after
|
|
||||||
vim/.vundles.local
|
|
||||||
vim/.vundles.local.bak
|
|
||||||
vim/bundle
|
|
||||||
vim/sessions
|
|
||||||
.netrwhist
|
.netrwhist
|
||||||
bin/subl
|
bin/subl
|
||||||
tags
|
tags
|
||||||
|
|||||||
+9
-14
@@ -33,20 +33,15 @@ bind -r J resize-pane -D 5
|
|||||||
bind -r K resize-pane -U 5
|
bind -r K resize-pane -U 5
|
||||||
bind -r L resize-pane -R 5
|
bind -r L resize-pane -R 5
|
||||||
|
|
||||||
# Smart pane switching with awareness of Vim splits.
|
# Direct pane switching. This used to be vim-tmux-navigator, which ran
|
||||||
# See: https://github.com/christoomey/vim-tmux-navigator
|
# `ps | grep` on EVERY C-h/j/k/l press just to ask whether vim was in the
|
||||||
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
|
# pane. vim is gone, so the probe can only ever answer no -- two forks per
|
||||||
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
|
# pane switch for nothing.
|
||||||
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
|
bind-key -n 'C-h' select-pane -L
|
||||||
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
|
bind-key -n 'C-j' select-pane -D
|
||||||
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
|
bind-key -n 'C-k' select-pane -U
|
||||||
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
|
bind-key -n 'C-l' select-pane -R
|
||||||
|
bind-key -n 'C-\' select-pane -l
|
||||||
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
|
|
||||||
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
|
|
||||||
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
|
|
||||||
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
|
|
||||||
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
|
|
||||||
|
|
||||||
bind-key -T copy-mode-vi 'C-h' select-pane -L
|
bind-key -T copy-mode-vi 'C-h' select-pane -L
|
||||||
bind-key -T copy-mode-vi 'C-j' select-pane -D
|
bind-key -T copy-mode-vi 'C-j' select-pane -D
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Statusline element-flicker fix (2026-08-19).
|
||||||
|
# Sourced at the end of ~/.yadr/.tmux.conf, so these override what it sets.
|
||||||
|
# Kept HERE so a yadr re-bootstrap cannot clobber it.
|
||||||
|
#
|
||||||
|
# SYMPTOM dissimulo reported: "the statusbar is having a seizure -- elements
|
||||||
|
# appear and disappear at random." NOT the whole bar blanking (a 30fps screen
|
||||||
|
# recording of the bar showed zero frame-to-frame variation, and a whole-desktop
|
||||||
|
# capture showed nothing changing near it). Individual ELEMENTS winking out.
|
||||||
|
#
|
||||||
|
# CAUSE: `#(...)` in a status format is a tmux JOB. While that job is being
|
||||||
|
# (re)started its expansion is EMPTY, so the element vanishes until it finishes.
|
||||||
|
# tmux re-runs those jobs whenever the status is redrawn and the job is not
|
||||||
|
# already running -- and status redraws are driven by PANE ACTIVITY, not by
|
||||||
|
# `status-interval`. With a busy TUI in the pane (a `claude` session) the jobs
|
||||||
|
# were being restarted several times a second, so the username and the IP
|
||||||
|
# flickered in and out constantly. Measured: `#(whoami)` and `#(tmux-net)`
|
||||||
|
# expanded EMPTY in 30 out of 30 consecutive renders.
|
||||||
|
#
|
||||||
|
# FIX: resolve both into tmux USER OPTIONS and reference those. `#{@user}` and
|
||||||
|
# `#{@net}` are plain variable lookups -- no job, so nothing can ever be
|
||||||
|
# half-started and render empty. Rendered text is byte-identical to before.
|
||||||
|
# @user - a username cannot change within a session: read it ONCE.
|
||||||
|
# @net - the IP CAN change, so refresh on a slow background loop
|
||||||
|
# (4 forks/minute instead of several a second). The loop exits by
|
||||||
|
# itself when tmux goes away, because `tmux set` then fails.
|
||||||
|
#
|
||||||
|
# Bonus, already measured: this also cut the tmux server from ~25% of a core to
|
||||||
|
# ~12% and eliminated the fork churn (17 execs/10s -> 0).
|
||||||
|
#
|
||||||
|
# DO NOT "simplify" #{@user}/#{@net} back to #(whoami)/#(~/.local/bin/tmux-net).
|
||||||
|
# That is the bug, not a tidier way of writing it.
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
run-shell 'tmux set -g @user "$(whoami)"'
|
||||||
|
run-shell 'tmux set -g @net "$($HOME/.local/bin/tmux-net)"'
|
||||||
|
run-shell -b 'while sleep 60; do tmux set -g @net "$($HOME/.local/bin/tmux-net)" 2>/dev/null || exit 0; done'
|
||||||
|
|
||||||
|
|
||||||
|
# These lengths are measured against the RAW format string, NOT the rendered
|
||||||
|
# width: tmux applies them as #{T;=/N:status-right}, truncating BEFORE the
|
||||||
|
# #[...] style directives are stripped. status-right renders ~46 columns but is
|
||||||
|
# ~129 characters of source. A cap below the raw length severs the string
|
||||||
|
# mid-way, which looks exactly like 'the right side of the bar disappeared'.
|
||||||
|
# Set here as well as in .tmux.conf so this file stays self-sufficient.
|
||||||
|
set -g status-left-length 451
|
||||||
|
set -g status-right-length 451
|
||||||
|
|
||||||
|
set -g status-left '#[fg=colour235,bg=colour252,bold] ❐ #S #[fg=colour252,bg=colour238,nobold]❯#[fg=colour245,bg=colour238,bold] #{@user} '
|
||||||
|
# The trailing %S is drawn in bg-on-bg (colour234 on colour234) so it is
|
||||||
|
# INVISIBLE, but it makes the status string CHANGE every second.
|
||||||
|
#
|
||||||
|
# WHY THAT MATTERS -- the second half of the bug: tmux only repaints the status
|
||||||
|
# line when its computed content DIFFERS from what it last drew. With the clock
|
||||||
|
# at minute resolution and @user/@net static, the string was byte-identical for
|
||||||
|
# up to 60s at a stretch; so when anything wiped the bar it STAYED wiped until
|
||||||
|
# the minute rolled over. That is the "sometimes the entire bar disappears" half.
|
||||||
|
# A once-per-second change forces a repaint, so a wipe self-heals within ~1s.
|
||||||
|
# It costs one redraw of one row and NO forks (that is only affordable because
|
||||||
|
# the #() jobs above became #{@user}/#{@net}).
|
||||||
|
set -g status-right '#[bold][#[nobold,fg=colour229]#h#[fg=default] / #[fg=colour229]#{@net}#[fg=default,bold]]#[nobold,fg=colour255] %-I:%M%P %d-%b-%Y #[fg=colour39]★ Stardate %Y.%j#[fg=colour255] '
|
||||||
|
|
||||||
|
|
||||||
|
# ---- circled window numbers, stamped asynchronously ----------------------
|
||||||
|
# The icon is computed ONCE per window change and stored as a window-level
|
||||||
|
# user option; the format below is a plain #{@icon} lookup. The old version
|
||||||
|
# nested ten #{?#{==:#{window_index},N},...} conditionals evaluated for every
|
||||||
|
# window on every redraw, and redraws follow PANE ACTIVITY, not status-interval.
|
||||||
|
# run-shell -b is backgrounded, so none of this sits on the render path.
|
||||||
|
set -g window-status-format '#[fg=colour235,bg=colour252,nobold] #{?#{@icon},#{@icon},#{window_index}} #{b:pane_current_path} #W '
|
||||||
|
set -g window-status-current-format '#[fg=colour234,bg=colour39,bold] [#[fg=colour232,bold]#{?window_zoomed_flag,#[fg=colour228],} #{?#{@icon},#{@icon},#{window_index}} #{b:pane_current_path} #W #[fg=colour234,bold]] '
|
||||||
|
|
||||||
|
run-shell -b '$HOME/.local/bin/tmux-window-icons'
|
||||||
|
set-hook -g after-new-window 'run-shell -b "$HOME/.local/bin/tmux-window-icons"'
|
||||||
|
set-hook -g window-linked 'run-shell -b "$HOME/.local/bin/tmux-window-icons"'
|
||||||
|
set-hook -g window-unlinked 'run-shell -b "$HOME/.local/bin/tmux-window-icons"'
|
||||||
|
set-hook -g session-window-changed 'run-shell -b "$HOME/.local/bin/tmux-window-icons"'
|
||||||
@@ -1 +0,0 @@
|
|||||||
.yadr/irb/unescaped_colors.rb
|
|
||||||
@@ -38,7 +38,6 @@ RUN DEBIAN_FRONTEND=noninteractive \
|
|||||||
ruby-full \
|
ruby-full \
|
||||||
sudo \
|
sudo \
|
||||||
tmux \
|
tmux \
|
||||||
vim \
|
|
||||||
wget \
|
wget \
|
||||||
zsh && \
|
zsh && \
|
||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
require 'rake'
|
require 'rake'
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
require File.join(File.dirname(__FILE__), 'bin', 'yadr', 'vundle')
|
|
||||||
|
|
||||||
desc "Hook our dotfiles into system-standard positions."
|
desc "Hook our dotfiles into system-standard positions."
|
||||||
task :install => [:submodule_init, :submodules] do
|
task :install => [:submodule_init, :submodules] do
|
||||||
puts
|
puts
|
||||||
puts "======================================================"
|
puts "======================================================"
|
||||||
puts "Welcome to YADR Installation."
|
puts "Welcome to drunkendotfiles installation."
|
||||||
puts "======================================================"
|
puts "======================================================"
|
||||||
puts
|
puts
|
||||||
|
|
||||||
@@ -19,11 +18,6 @@ task :install => [:submodule_init, :submodules] do
|
|||||||
install_files(Dir.glob('ruby/*')) if want_to_install?('rubygems config (faster/no docs)')
|
install_files(Dir.glob('ruby/*')) if want_to_install?('rubygems config (faster/no docs)')
|
||||||
install_files(Dir.glob('ctags/*')) if want_to_install?('ctags config (better js/ruby support)')
|
install_files(Dir.glob('ctags/*')) if want_to_install?('ctags config (better js/ruby support)')
|
||||||
install_files(Dir.glob('tmux/*')) if want_to_install?('tmux config')
|
install_files(Dir.glob('tmux/*')) if want_to_install?('tmux config')
|
||||||
install_files(Dir.glob('vimify/*')) if want_to_install?('vimification of command line tools')
|
|
||||||
if want_to_install?('vim configuration (highly recommended)')
|
|
||||||
install_files(Dir.glob('{vim,vimrc}'))
|
|
||||||
Rake::Task["install_vundle"].execute
|
|
||||||
end
|
|
||||||
|
|
||||||
Rake::Task["install_prezto"].execute
|
Rake::Task["install_prezto"].execute
|
||||||
|
|
||||||
@@ -44,7 +38,6 @@ end
|
|||||||
|
|
||||||
desc 'Updates the installation'
|
desc 'Updates the installation'
|
||||||
task :update do
|
task :update do
|
||||||
Rake::Task["vundle_migration"].execute if needs_migration_to_vundle?
|
|
||||||
Rake::Task["install"].execute
|
Rake::Task["install"].execute
|
||||||
#TODO: for now, we do the same as install. But it would be nice
|
#TODO: for now, we do the same as install. But it would be nice
|
||||||
#not to clobber zsh files
|
#not to clobber zsh files
|
||||||
@@ -60,7 +53,7 @@ desc "Init and update submodules."
|
|||||||
task :submodules do
|
task :submodules do
|
||||||
unless ENV["SKIP_SUBMODULES"]
|
unless ENV["SKIP_SUBMODULES"]
|
||||||
puts "======================================================"
|
puts "======================================================"
|
||||||
puts "Downloading YADR submodules...please wait"
|
puts "Downloading drunkendotfiles submodules...please wait"
|
||||||
puts "======================================================"
|
puts "======================================================"
|
||||||
|
|
||||||
run %{
|
run %{
|
||||||
@@ -72,45 +65,6 @@ task :submodules do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Performs migration from pathogen to vundle"
|
|
||||||
task :vundle_migration do
|
|
||||||
puts "======================================================"
|
|
||||||
puts "Migrating from pathogen to vundle vim plugin manager. "
|
|
||||||
puts "This will move the old .vim/bundle directory to"
|
|
||||||
puts ".vim/bundle.old and replacing all your vim plugins with"
|
|
||||||
puts "the standard set of plugins. You will then be able to "
|
|
||||||
puts "manage your vim's plugin configuration by editing the "
|
|
||||||
puts "file .vim/vundles.vim"
|
|
||||||
puts "======================================================"
|
|
||||||
|
|
||||||
Dir.glob(File.join('vim', 'bundle','**')) do |sub_path|
|
|
||||||
run %{git config -f #{File.join('.git', 'config')} --remove-section submodule.#{sub_path}}
|
|
||||||
# `git rm --cached #{sub_path}`
|
|
||||||
FileUtils.rm_rf(File.join('.git', 'modules', sub_path))
|
|
||||||
end
|
|
||||||
FileUtils.mv(File.join('vim','bundle'), File.join('vim', 'bundle.old'))
|
|
||||||
end
|
|
||||||
|
|
||||||
desc "Runs Vundle installer in a clean vim environment"
|
|
||||||
task :install_vundle do
|
|
||||||
puts "======================================================"
|
|
||||||
puts "Installing and updating vundles."
|
|
||||||
puts "The installer will now proceed to run PluginInstall to install vundles."
|
|
||||||
puts "======================================================"
|
|
||||||
|
|
||||||
puts ""
|
|
||||||
|
|
||||||
vundle_path = File.join('vim','bundle', 'vundle')
|
|
||||||
unless File.exist?(vundle_path)
|
|
||||||
run %{
|
|
||||||
cd $HOME/.yadr
|
|
||||||
git clone https://github.com/gmarik/vundle.git #{vundle_path}
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
Vundle::update_vundle
|
|
||||||
end
|
|
||||||
|
|
||||||
task :default => 'install'
|
task :default => 'install'
|
||||||
|
|
||||||
|
|
||||||
@@ -173,7 +127,6 @@ def install_homebrew
|
|||||||
puts "Installing Homebrew packages...There may be some warnings."
|
puts "Installing Homebrew packages...There may be some warnings."
|
||||||
puts "======================================================"
|
puts "======================================================"
|
||||||
run %{brew install zsh ctags git hub tmux reattach-to-user-namespace the_silver_searcher ghi}
|
run %{brew install zsh ctags git hub tmux reattach-to-user-namespace the_silver_searcher ghi}
|
||||||
run %{brew install macvim}
|
|
||||||
puts
|
puts
|
||||||
puts
|
puts
|
||||||
end
|
end
|
||||||
@@ -333,16 +286,6 @@ def install_files(files, method = :symlink)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def needs_migration_to_vundle?
|
|
||||||
File.exist? File.join('vim', 'bundle', 'tpope-vim-pathogen')
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def list_vim_submodules
|
|
||||||
result=`git submodule -q foreach 'echo $name"||"\`git remote -v | awk "END{print \\\\\$2}"\`'`.select{ |line| line =~ /^vim.bundle/ }.map{ |line| line.split('||') }
|
|
||||||
Hash[*result.flatten]
|
|
||||||
end
|
|
||||||
|
|
||||||
def apply_theme_to_iterm_profile_idx(index, color_scheme_path)
|
def apply_theme_to_iterm_profile_idx(index, color_scheme_path)
|
||||||
values = Array.new
|
values = Array.new
|
||||||
16.times { |i| values << "Ansi #{i} Color" }
|
16.times { |i| values << "Ansi #{i} Color" }
|
||||||
@@ -354,13 +297,22 @@ def apply_theme_to_iterm_profile_idx(index, color_scheme_path)
|
|||||||
end
|
end
|
||||||
|
|
||||||
def success_msg(action)
|
def success_msg(action)
|
||||||
puts %q{
|
# Single-quoted heredoc: no interpolation and NO escape processing, so the
|
||||||
_ _ _
|
# backslashes in the art survive verbatim. %q{} would collapse every \ to \.
|
||||||
| | | | | |
|
banner = <<~'BANNER'
|
||||||
| |___| |_____ __| | ____
|
___ ___ _ _ _ _ _ _____ _ _ ___ ___ _____ ___ ___ _ ___ ___
|
||||||
|_____ (____ |/ _ |/ ___)
|
| \| _ \ | | | \| | |/ / __| \| | \ / _ \_ _| __|_ _| | | __/ __|
|
||||||
_____| / ___ ( (_| | |
|
| |) | / |_| | .` | ' <| _|| .` | |) | (_) || | | _| | || |__| _|\__ \
|
||||||
(_______\_____|\____|_|
|
|___/|_|_\\___/|_|\_|_|\_\___|_|\_|___/ \___/ |_| |_| |___|____|___|___/
|
||||||
}
|
BANNER
|
||||||
puts "YADR has been #{action}. Please restart your terminal and vim."
|
|
||||||
|
# Rainbow it when lolcat is present; fall back to plain text so the installer
|
||||||
|
# never dies on a box that lacks it.
|
||||||
|
if system('command -v lolcat >/dev/null 2>&1')
|
||||||
|
IO.popen('lolcat', 'w') { |io| io.puts banner }
|
||||||
|
else
|
||||||
|
puts banner
|
||||||
|
end
|
||||||
|
|
||||||
|
puts "drunkendotfiles has been #{action}. Please restart your terminal."
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
rm ~/Library/Preferences/org.vim.MacVim.LSSharedFileList.plist && \
|
|
||||||
rm ~/Library/Preferences/org.vim.MacVim.plist && \
|
|
||||||
echo "Files deleted sucessfully. You may have to restart OSX."
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
require 'fileutils'
|
|
||||||
|
|
||||||
module Vundle
|
|
||||||
@vundles_path = File.expand_path File.join(ENV['HOME'], '.vim', '.vundles.local')
|
|
||||||
def self.add_plugin_to_vundle(plugin_repo)
|
|
||||||
return if contains_vundle? plugin_repo
|
|
||||||
|
|
||||||
vundles = vundles_from_file
|
|
||||||
last_bundle_dir = vundles.rindex{ |line| line =~ /^Bundle / }
|
|
||||||
last_bundle_dir = last_bundle_dir ? last_bundle_dir+1 : 0
|
|
||||||
vundles.insert last_bundle_dir, "Bundle \"#{plugin_repo}\""
|
|
||||||
write_vundles_to_file vundles
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.remove_plugin_from_vundle(plugin_repo)
|
|
||||||
vundles = vundles_from_file
|
|
||||||
deleted_value = vundles.reject!{ |line| line =~ /Bundle "#{plugin_repo}"/ }
|
|
||||||
|
|
||||||
write_vundles_to_file vundles
|
|
||||||
|
|
||||||
!deleted_value.nil?
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.vundle_list
|
|
||||||
vundles_from_file.select{ |line| line =~ /^Bundle .*/ }.map{ |line| line.gsub(/Bundle "(.*)"/, '\1')}
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.update_vundle
|
|
||||||
system "vim --noplugin -u #{ENV['HOME']}/.vim/vundles.vim -N \"+set hidden\" \"+syntax on\" \"+let g:session_autosave = 'no'\" +BundleClean +BundleInstall! +qall"
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
private
|
|
||||||
def self.contains_vundle?(vundle_name)
|
|
||||||
FileUtils.touch(@vundles_path) unless File.exist? @vundles_path
|
|
||||||
File.read(@vundles_path).include?(vundle_name)
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.vundles_from_file
|
|
||||||
FileUtils.touch(@vundles_path) unless File.exist? @vundles_path
|
|
||||||
File.read(@vundles_path).split("\n")
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.write_vundles_to_file(vundles)
|
|
||||||
FileUtils.cp(@vundles_path, "#{@vundles_path}.bak")
|
|
||||||
vundle_file = File.open(@vundles_path, "w")
|
|
||||||
vundle_file.write(vundles.join("\n"))
|
|
||||||
vundle_file.close
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
#!/usr/bin/env ruby
|
|
||||||
#
|
|
||||||
require File.join(File.dirname(__FILE__), 'default_libs')
|
|
||||||
require File.join(File.dirname(__FILE__), 'vundle')
|
|
||||||
|
|
||||||
GitStyleBinary.command do
|
|
||||||
version "yadr-add-vim-plugin 1.0"
|
|
||||||
|
|
||||||
short_desc "Add a vim plugin from a repo"
|
|
||||||
|
|
||||||
opt :url, "Repository URL (see usage)", :required => true, :type => String
|
|
||||||
|
|
||||||
banner <<-'EOS'
|
|
||||||
Usage: yadr-add-vim-plugin --url [URL]
|
|
||||||
Specify a plugin repository URL in one of the following forms:
|
|
||||||
- Custom repository URL (full URL): git://git.wincent.com/command-t.git
|
|
||||||
- Github repository (username/repo_name): robgleesson/hammer.vim.git
|
|
||||||
- Vim script repository (plugin_name): FuzzyFinder
|
|
||||||
EOS
|
|
||||||
run do |command|
|
|
||||||
repo=command.opts[:url]
|
|
||||||
repo=command.opts[:url]
|
|
||||||
puts "Adding \"#{repo}\" to the plugin list"
|
|
||||||
bundle_path=repo.gsub(/http.?:\/\/github\.com\//, "")
|
|
||||||
Vundle::add_plugin_to_vundle repo
|
|
||||||
Vundle::update_vundle
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
#!/usr/bin/env ruby
|
|
||||||
require File.join(File.dirname(__FILE__), 'default_libs')
|
|
||||||
require File.join(File.dirname(__FILE__), 'vundle')
|
|
||||||
|
|
||||||
GitStyleBinary.command do
|
|
||||||
version "yadr-delete-vim-plugin 1.0"
|
|
||||||
|
|
||||||
short_desc "Removes a vim plugin"
|
|
||||||
opt :url, "Repository URL (see usage)", :required => true, :type => String
|
|
||||||
|
|
||||||
banner <<-'EOS'
|
|
||||||
Usage: yadr-delete-vim-plugin --url [URL]
|
|
||||||
Specify a plugin repository URL in one of the following forms:
|
|
||||||
- Custom repository URL (full URL): git://git.wincent.com/command-t.git
|
|
||||||
- Github repository (username/repo_name): robgleesson/hammer.vim.git
|
|
||||||
- Vim script repository (plugin_name): FuzzyFinder
|
|
||||||
EOS
|
|
||||||
run do |command|
|
|
||||||
repo=command.opts[:url]
|
|
||||||
puts "Removing \"#{repo}\" from the plugin list"
|
|
||||||
bundle_path=repo.gsub("https://github.com/", "")
|
|
||||||
removed=Vundle::remove_plugin_from_vundle repo
|
|
||||||
if removed
|
|
||||||
Vundle::update_vundle
|
|
||||||
puts "Successfully removed\"#{repo}\""
|
|
||||||
else
|
|
||||||
puts "Unable to find \"#{repo}\" among the installed plugins"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
#!/usr/bin/env ruby
|
|
||||||
require File.join(File.dirname(__FILE__), 'default_libs')
|
|
||||||
require File.join(File.dirname(__FILE__), 'vundle')
|
|
||||||
|
|
||||||
GitStyleBinary.command do
|
|
||||||
version "yadr-list-vim-plugin 1.0"
|
|
||||||
|
|
||||||
short_desc "List installed vim plugins"
|
|
||||||
|
|
||||||
banner <<-'EOS'
|
|
||||||
Usage: yadr-list-vim-plugin
|
|
||||||
EOS
|
|
||||||
run do |command|
|
|
||||||
puts "Currently configured plugins:"
|
|
||||||
i=1
|
|
||||||
Vundle::vundle_list.each do |plugin|
|
|
||||||
puts "#{i}. #{plugin}"
|
|
||||||
i=i+1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
* tComment - gcc to comment a line, gcp to comment blocks, nuff said
|
|
||||||
* rails.vim - syntax highlighting, gf (goto file) enhancements, and lots more. should be required for any rails dev
|
|
||||||
* rake.vim - like rails.vim but for non-rails projects. makes `:Rtags` and other commands just work
|
|
||||||
* ruby.vim - lots of general enhancements for ruby dev
|
|
||||||
* necomplcache - intelligent and fast complete as you type, and added Command-Space to select a completion (same as Ctrl-N)
|
|
||||||
* snipMate - offers textmate-like snippet expansion + snippets collection (honza/vim-snippets). Try hitting TAB after typing a snippet
|
|
||||||
* jasmine.vim - support for jasmine javascript unit testing, including snippets for it, before, etc..
|
|
||||||
* vim-javascript-syntax, vim-jquery - better highlighting
|
|
||||||
* TagHighlight - highlights class names and method names
|
|
||||||
* vim-coffeescript - support for coffeescript, highlighting
|
|
||||||
* vim-stylus - support for stylus css language
|
|
||||||
* vim-bundler - work with bundled gems
|
|
||||||
* fugitive - "a git wrapper so awesome, it should be illegal...". Try `:Gstatus` and hit `-` to toggle files in and out of the index. Git `d` to see a diff. Use `git mergetool` or `gmt` to launch vim as a mergetool. The left buffer is your branch, the right is the incoming change, and in the middle is the working copy. Move to the left or right and use `dp` to put the change into the middle. Learn more: http://vimcasts.org/blog/2011/05/the-fugitive-series/
|
|
||||||
* gitv - use `:gitv` for a better git log browser
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
* IndexedSearch - when you do searches will show you "Match 2 of 4" in the status line
|
|
||||||
* delimitMate - automatically closes quotes
|
|
||||||
* SearchComplete - tab completion in the / search window
|
|
||||||
* syntastic - automatic syntax checking when you save the file
|
|
||||||
* repeat - adds `.` (repeat command) support for complex commands like surround.vim. i.e. if you perform a surround and hit `.`, it will Just Work (vim by default will only repeat the last piece of the complex command)
|
|
||||||
* endwise - automatically closes blocks (if/end)
|
|
||||||
* autotag - automatically creates tags for fast sourcecode browsing. use `,f` over a symbol name to go to its definition
|
|
||||||
* matchit - helps with matching brackets, improves other plugins
|
|
||||||
* AnsiEsc - inteprets ansi color codes inside log files. great for looking at Rails logs
|
|
||||||
* solarized - a color scheme scientifically calibrated for awesomeness (including skwp mods for ShowMarks)
|
|
||||||
* Lightline - Improved status bar. Requires patched fonts (installed from fonts/ directory)
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
The files in `vim/settings` are customizations stored on a per-plugin
|
|
||||||
basis. The main keymap is available in yadr-keymap.vim, but some of the vim
|
|
||||||
files contain key mappings as well.
|
|
||||||
|
|
||||||
If you are having unexpected behavior, wondering why a particular key works the way it does,
|
|
||||||
use: `:map [keycombo]` (e.g. `:map <C-\>`) to see what the key is mapped to. For bonus points, you can see where the mapping was set by using `:verbose map [keycombo]`.
|
|
||||||
If you omit the key combo, you'll get a list of all the maps. You can do the same thing with nmap, imap, vmap, etc.
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
YADR comes with a dead simple plugin manager that just uses vundles and submodules, without any fancy config files.
|
|
||||||
|
|
||||||
Add a plugin
|
|
||||||
|
|
||||||
yav -u https://github.com/airblade/vim-rooter
|
|
||||||
|
|
||||||
Delete a plugin
|
|
||||||
|
|
||||||
ydv -u airblade/vim-rooter
|
|
||||||
|
|
||||||
The aliases (yav=yadr vim-add-plugin), (ydp=yadr vim-delete-plugin) and (yuv=yadr vim-update-all-plugins) live in the aliases file.
|
|
||||||
You can then commit the change. It's good to have your own fork of this project to do that.
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
* NERDTree - everyone's favorite tree browser
|
|
||||||
* NERDTree-tabs - makes NERDTree play nice with MacVim tabs so that it's on every tab
|
|
||||||
* ShowMarks - creates a visual gutter to the left of the number column showing you your marks
|
|
||||||
* EasyMotion - hit <kbd>,</kbd> <kbd>esc</kbd> (forward) or <kbd>,</kbd> <kbd>Shift</kbd> <kbd>Esc</kbd> (back) and watch the magic happen. Just type the letters and jump directly to your target - in the provided vimrc the keys are optimized for home row mostly. Using @skwp modified EasyMotion which uses vimperator-style two character targets.
|
|
||||||
* CtrlP - <kbd>,</kbd> <kbd>t</kbd> to find a file
|
|
||||||
* Visual-star-search - make the <kbd>*</kbd> (star) search in visual mode behave like expected: searching for the whole selection instead of just the word under the cursor.
|
|
||||||
* Ag - super fast search by Silver Searcher. hit <kbd>,K</kbd> to grep current word
|
|
||||||
* vim-tmux-navigator - nagivate between vim and tmux splits in the same way you move between normal vim splits.
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
You may use `~/.vimrc.before` for settings like the __leader__ setting.
|
|
||||||
You may use `~/.vimrc.after` (for those transitioning from janus) or `~/.yadr/vim/after/.vimrc.after` for any additional overrides/settings.
|
|
||||||
If you didn't have janus before, it is recommended to just put it in `~/.yadr/vim/after` so you can better manage your overrides.
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
* textobj-rubyblock - ruby blocks become vim textobjects denoted with `r`. try var/vir to select a ruby block, dar/dir for delete car/cir for change, =ar/=ir for formatting, etc
|
|
||||||
* vim-indentobject - manipulate chunks of code by indentation level (great for yaml) use vai/vii to select around an indent block, same as above applies
|
|
||||||
* argtextobj - manipulation of function arguments as an "a" object, so vaa/via, caa/cia, daa/dia, etc..
|
|
||||||
* textobj-datetime - gives you `da` (date), `df` (date full) and so on text objects. useable with all standard verbs
|
|
||||||
* vim-textobj-entire - gives you `e` for entire document. so vae (visual around entire document), and etc
|
|
||||||
* vim-textobj-rubysymbol - gives you `:` textobj. so va: to select a ruby symbol. da: to delete a symbol..etc
|
|
||||||
* vim-textobj-function - gives you `f` textobj. so vaf to select a function
|
|
||||||
* vim-textobj-function-javascript - same as above, but for javascript functions
|
|
||||||
* vim-textobj-underscore - gives you `_` textobj. So vi_ selects what's inside a pair of underscores
|
|
||||||
* next-textobject - from Steve Losh, ability to use `n` such as vinb (visual inside (n)ext set of parens)
|
|
||||||
* textobj-word-column - gives you `c` (word) and `C` (WORD) for handling columns/blocks.
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
* SplitJoin - easily split up things like ruby hashes into multiple lines or join them back together. Try :SplitjoinJoin and :SplitjoinSplit or use the bindings sj(split) and sk(unsplit) - mnemonically j and k are directions down and up
|
|
||||||
* tabularize - align code effortlessly by using :Tabularize /[character] to align by a character, or try the keymaps
|
|
||||||
* yankring - effortless sanity for pasting. every time you yank something it goes into a buffer. after hitting p to paste, use ctrl-p or ctrl-n to cycle through the paste options. great for when you accidentally overwrite your yank with a delete.
|
|
||||||
* surround - super easy quote and tag manipulation - ysiw" - sourround inner word with quotes. ci"' - change inner double quotes to single quotes, etc
|
|
||||||
* greplace - use :Gsearch to find across many files, replace inside the changes, then :Greplace to do a replace across all matches - made lightning fast with Silver Searcher
|
|
||||||
* vim-markdown-preview - :Mm to view your README.md as html
|
|
||||||
* html-escape - ,he and ,hu to escape and unescape html
|
|
||||||
* Gundo - visualize your undos - pretty amazing plugin. Hit ,u with my keymappings to trigger it, very user friendly
|
|
||||||
* vim-indent-guides - visual indent guides, off by default
|
|
||||||
* color_highlight - use :ColorCodes to see hex colors highlighted
|
|
||||||
* change-inside-surroundings - change content inside delimiters like quotes/brackets
|
|
||||||
* rspec.vim - used for color highlighting rspec correctly even if specs live outside of spec/ (rails.vim doesn't handle this)
|
|
||||||
* Ag - use :Ag to search across multiple files. Faster than Grep and Ack.
|
|
||||||
* vim-session: use `:SaveSession` and `:OpenSession` to come back to your saved window layout
|
|
||||||
+1
-5
@@ -98,13 +98,9 @@
|
|||||||
pretty = format:%C(blue)%ad%Creset %C(yellow)%h%C(green)%d%Creset %C(blue)%s %C(magenta) [%an]%Creset
|
pretty = format:%C(blue)%ad%Creset %C(yellow)%h%C(green)%d%Creset %C(blue)%s %C(magenta) [%an]%Creset
|
||||||
[mergetool]
|
[mergetool]
|
||||||
prompt = false
|
prompt = false
|
||||||
[mergetool "mvimdiff"]
|
|
||||||
cmd="mvim -c 'Gdiff' $MERGED" # use fugitive.vim for 3-way merge
|
|
||||||
keepbackup=false
|
|
||||||
[merge]
|
[merge]
|
||||||
summary = true
|
summary = true
|
||||||
verbosity = 1
|
verbosity = 1
|
||||||
tool = mvimdiff
|
|
||||||
[apply]
|
[apply]
|
||||||
whitespace = nowarn
|
whitespace = nowarn
|
||||||
[branch]
|
[branch]
|
||||||
@@ -115,7 +111,7 @@
|
|||||||
default = upstream
|
default = upstream
|
||||||
[core]
|
[core]
|
||||||
autocrlf = false
|
autocrlf = false
|
||||||
editor = vim
|
editor = nano
|
||||||
excludesfile = ~/.yadr/git/gitignore
|
excludesfile = ~/.yadr/git/gitignore
|
||||||
[advice]
|
[advice]
|
||||||
statusHints = false
|
statusHints = false
|
||||||
|
|||||||
+3
-3
@@ -25,8 +25,8 @@ PERSONAL_FILES=(
|
|||||||
.zshenv.backup .zshrc.backup
|
.zshenv.backup .zshrc.backup
|
||||||
# Relative symlinks into .yadr/... — YADR's rake install creates equivalents,
|
# Relative symlinks into .yadr/... — YADR's rake install creates equivalents,
|
||||||
# but we deploy these too so things work even if rake install is skipped.
|
# but we deploy these too so things work even if rake install is skipped.
|
||||||
.aprc .ctags .editrc .escaped_colors.rb .gemrc .gitconfig .inputrc .pryrc
|
.ctags .gemrc .gitconfig .pryrc
|
||||||
.rdebugrc .unescaped_colors.rb .vim .vimrc .zlogin .zlogout .zpreztorc
|
.rdebugrc .zlogin .zlogout .zpreztorc
|
||||||
.zprofile .zshenv .zshrc
|
.zprofile .zshenv .zshrc
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ cd "$YADR_DIR"
|
|||||||
log "Ensuring submodules are initialized"
|
log "Ensuring submodules are initialized"
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
|
|
||||||
# 2. Run YADR's native install (Vim plugins, prezto, etc.)
|
# 2. Run YADR's native install (prezto, etc.)
|
||||||
if have rake; then
|
if have rake; then
|
||||||
log "Running YADR rake install"
|
log "Running YADR rake install"
|
||||||
[ "${1:-}" = "ask" ] && export ASK="true"
|
[ "${1:-}" = "ask" ] && export ASK="true"
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
tags
|
|
||||||
*~
|
|
||||||
*.swp
|
|
||||||
.VimballRecord
|
|
||||||
view
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
" This loads after the yadr plugins so that plugin mappings can
|
|
||||||
" be overwritten.
|
|
||||||
|
|
||||||
if filereadable(expand("~/.yadr/vim/after/.vimrc.after"))
|
|
||||||
source ~/.yadr/vim/after/.vimrc.after
|
|
||||||
endif
|
|
||||||
|
|
||||||
if filereadable(expand("~/.vimrc.after"))
|
|
||||||
source ~/.vimrc.after
|
|
||||||
endif
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
if exists("b:did_ftplugin")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:did_ftplugin = 1 " Don't load twice in one buffer
|
|
||||||
|
|
||||||
setlocal spell
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
let vimsettings = '~/.vim/settings'
|
|
||||||
let uname = system("uname -s")
|
|
||||||
|
|
||||||
for fpath in split(globpath(vimsettings, '*.vim'), '\n')
|
|
||||||
|
|
||||||
if (fpath == expand(vimsettings) . "/yadr-keymap-mac.vim") && uname[:4] ==? "linux"
|
|
||||||
continue " skip mac mappings for linux
|
|
||||||
endif
|
|
||||||
|
|
||||||
if (fpath == expand(vimsettings) . "/yadr-keymap-linux.vim") && uname[:4] !=? "linux"
|
|
||||||
continue " skip linux mappings for mac
|
|
||||||
endif
|
|
||||||
|
|
||||||
exe 'source' fpath
|
|
||||||
endfor
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
" Auto open nerd tree on startup
|
|
||||||
let g:nerdtree_tabs_open_on_gui_startup = 0
|
|
||||||
" Focus in the main content window
|
|
||||||
let g:nerdtree_tabs_focus_on_files = 1
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
" Make nerdtree look nice
|
|
||||||
let NERDTreeMinimalUI = 1
|
|
||||||
let NERDTreeDirArrows = 1
|
|
||||||
let g:NERDTreeWinSize = 30
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
This directory contains settings for various vim plugins and vim itself.
|
|
||||||
|
|
||||||
## Plugin Settings
|
|
||||||
|
|
||||||
Each plugin's overrides/settings should be put in a separate file named `{plugin-name}.vim`.
|
|
||||||
|
|
||||||
## Vim Settings
|
|
||||||
|
|
||||||
General vim overrides/settings should be put in a separate file named `yadr-{descriptive-name}.vim`.
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
"Abbreviations, trigger by typing the abbreviation and hitting space
|
|
||||||
|
|
||||||
abbr rlb Rails.logger.banner
|
|
||||||
abbr rld Rails.logger.debug
|
|
||||||
abbr pry! require 'pry'; binding.pry
|
|
||||||
abbr cl! console.log( )<left><left>
|
|
||||||
|
|
||||||
" Rspec Before
|
|
||||||
abbr rbf before { }<left><left>
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
" Open the Ag command and place the cursor into the quotes
|
|
||||||
nmap ,ag :Ag ""<Left>
|
|
||||||
nmap ,af :AgFile ""<Left>
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
" AutoTag
|
|
||||||
" Seems to have problems with some vim files
|
|
||||||
let g:autotagExcludeSuffixes="tml.xml.text.txt.vim"
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
map W <Plug>CamelCaseMotion_w
|
|
||||||
map B <Plug>CamelCaseMotion_b
|
|
||||||
map E <Plug>CamelCaseMotion_e
|
|
||||||
|
|
||||||
sunmap W
|
|
||||||
sunmap B
|
|
||||||
sunmap E
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
if exists("g:ctrlp_user_command")
|
|
||||||
unlet g:ctrlp_user_command
|
|
||||||
endif
|
|
||||||
if executable('ag')
|
|
||||||
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
|
|
||||||
let g:ctrlp_user_command =
|
|
||||||
\ 'ag %s --files-with-matches -g "" --ignore "\.git$\|\.hg$\|\.svn$"'
|
|
||||||
|
|
||||||
" ag is fast enough that CtrlP doesn't need to cache
|
|
||||||
let g:ctrlp_use_caching = 0
|
|
||||||
else
|
|
||||||
" Fall back to using git ls-files if Ag is not available
|
|
||||||
let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$'
|
|
||||||
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files . --cached --exclude-standard --others']
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Default to filename searches - so that appctrl will find application
|
|
||||||
" controller
|
|
||||||
let g:ctrlp_by_filename = 1
|
|
||||||
|
|
||||||
" Don't jump to already open window. This is annoying if you are maintaining
|
|
||||||
" several Tab workspaces and want to open two windows into the same file.
|
|
||||||
let g:ctrlp_switch_buffer = 0
|
|
||||||
|
|
||||||
" We don't want to use Ctrl-p as the mapping because
|
|
||||||
" it interferes with YankRing (paste, then hit ctrl-p)
|
|
||||||
let g:ctrlp_map = ',t'
|
|
||||||
nnoremap <silent> ,t :CtrlP<CR>
|
|
||||||
|
|
||||||
" Additional mapping for buffer search
|
|
||||||
nnoremap <silent> ,b :CtrlPBuffer<cr>
|
|
||||||
|
|
||||||
" Cmd-Shift-P to clear the cache
|
|
||||||
nnoremap <silent> <D-P> :ClearCtrlPCache<cr>
|
|
||||||
|
|
||||||
" Idea from : http://www.charlietanksley.net/blog/blog/2011/10/18/vim-navigation-with-lustyexplorer-and-lustyjuggler/
|
|
||||||
" Open CtrlP starting from a particular path, making it much
|
|
||||||
" more likely to find the correct thing first. mnemonic 'jump to [something]'
|
|
||||||
map ,ja :CtrlP app/assets<CR>
|
|
||||||
map ,jm :CtrlP app/models<CR>
|
|
||||||
map ,jc :CtrlP app/controllers<CR>
|
|
||||||
map ,jv :CtrlP app/views<CR>
|
|
||||||
map ,jj :CtrlP app/assets/javascripts<CR>
|
|
||||||
map ,jh :CtrlP app/helpers<CR>
|
|
||||||
map ,jl :CtrlP lib<CR>
|
|
||||||
map ,jp :CtrlP public<CR>
|
|
||||||
map ,js :CtrlP spec<CR>
|
|
||||||
map ,jf :CtrlP fast_spec<CR>
|
|
||||||
map ,jd :CtrlP db<CR>
|
|
||||||
map ,jC :CtrlP config<CR>
|
|
||||||
map ,jV :CtrlP vendor<CR>
|
|
||||||
map ,jF :CtrlP factories<CR>
|
|
||||||
map ,jT :CtrlP test<CR>
|
|
||||||
|
|
||||||
"Cmd-Shift-(M)ethod - jump to a method (tag in current file)
|
|
||||||
"Ctrl-m is not good - it overrides behavior of Enter
|
|
||||||
nnoremap <silent> <D-M> :CtrlPBufTag<CR>
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
" These keys are easier to type than the default set
|
|
||||||
" We exclude semicolon because it's hard to read and
|
|
||||||
" i and l are too easy to mistake for each other slowing
|
|
||||||
" down recognition. The home keys and the immediate keys
|
|
||||||
" accessible by middle fingers are available
|
|
||||||
let g:EasyMotion_keys='asdfjkoweriop'
|
|
||||||
nmap ,<ESC> ,,w
|
|
||||||
nmap ,<S-ESC> ,,b
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
" Automatically treat .es6 extension files as javascript
|
|
||||||
autocmd BufRead,BufNewFile *.es6 setfiletype javascript
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
" fugitive.git
|
|
||||||
" ========================================
|
|
||||||
" For fugitive.git, dp means :diffput. Define dg to mean :diffget
|
|
||||||
nnoremap <silent> ,dg :diffget<CR>
|
|
||||||
nnoremap <silent> ,dp :diffput<CR>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
" Support for github flavored markdown
|
|
||||||
" via https://github.com/jtratner/vim-flavored-markdown
|
|
||||||
augroup markdown
|
|
||||||
au!
|
|
||||||
au BufNewFile,BufRead *.md,*.markdown setlocal filetype=ghmarkdown
|
|
||||||
augroup END
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
" Automatically jump to a file at the correct line number
|
|
||||||
" i.e. if your cursor is over /some/path.rb:50 then using 'gf' on it will take
|
|
||||||
" you to that line
|
|
||||||
|
|
||||||
" use ,gf to go to file in a vertical split
|
|
||||||
nnoremap <silent> ,gf :vertical botright wincmd F<CR>
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
"Use the silver searcher for lightning fast Gsearch command
|
|
||||||
set grepprg=git\ grep
|
|
||||||
let g:grep_cmd_opts = '--line-number'
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
nmap ,u :GundoToggle<CR>
|
|
||||||
|
|
||||||
" open on the right so as not to compete with the nerdtree
|
|
||||||
let g:gundo_right = 1
|
|
||||||
|
|
||||||
" a little wider for wider screens
|
|
||||||
let g:gundo_width = 60
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
nnoremap ,rs :RunItermSpec<cr>
|
|
||||||
nnoremap ,rl :RunItermSpecLine<cr>
|
|
||||||
nnoremap ,ss :RunItermSpringSpec<cr>
|
|
||||||
nnoremap ,sl :RunItermSpringSpecLine<cr>
|
|
||||||
nnoremap zl :RunItermZeusSpecLine<cr>
|
|
||||||
nnoremap zs :RunItermZeusSpec<cr>
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
let g:lightline = {
|
|
||||||
\ 'colorscheme': 'solarized',
|
|
||||||
\ 'active': {
|
|
||||||
\ 'left': [ [ 'mode', 'paste' ],
|
|
||||||
\ [ 'fugitive', 'readonly', 'filename', 'modified' ] ]
|
|
||||||
\ },
|
|
||||||
\ 'component_function': {
|
|
||||||
\ 'fugitive': 'MyFugitive',
|
|
||||||
\ 'readonly': 'MyReadonly',
|
|
||||||
\ 'filename': 'MyFilename',
|
|
||||||
\ },
|
|
||||||
\ 'separator': { 'left': '⮀', 'right': '⮂' },
|
|
||||||
\ 'subseparator': { 'left': '⮁', 'right': '⮃' }
|
|
||||||
\ }
|
|
||||||
|
|
||||||
function! MyReadonly()
|
|
||||||
if &filetype == "help"
|
|
||||||
return ""
|
|
||||||
elseif &readonly
|
|
||||||
return "⭤ "
|
|
||||||
else
|
|
||||||
return ""
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! MyFugitive()
|
|
||||||
if exists("*fugitive#head")
|
|
||||||
let _ = fugitive#head()
|
|
||||||
return strlen(_) ? '⭠ '._ : ''
|
|
||||||
endif
|
|
||||||
return ''
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! MyFilename()
|
|
||||||
return ('' != MyReadonly() ? MyReadonly() . ' ' : '') .
|
|
||||||
\ ('' != expand('%') ? expand('%') : '[NoName]')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Use status bar even with single buffer
|
|
||||||
set laststatus=2
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
" neocomplete
|
|
||||||
" Next generation completion framework.
|
|
||||||
|
|
||||||
let g:acp_enableAtStartup = 0
|
|
||||||
let g:neocomplete#enable_at_startup = 1
|
|
||||||
let g:neocomplete#enable_camel_case = 1
|
|
||||||
let g:neocomplete#enable_smart_case = 1
|
|
||||||
|
|
||||||
" Default # of completions is 100, that's crazy.
|
|
||||||
let g:neocomplete#max_list = 5
|
|
||||||
|
|
||||||
" Set minimum syntax keyword length.
|
|
||||||
let g:neocomplete#auto_completion_start_length = 3
|
|
||||||
|
|
||||||
" Map standard Ctrl-N completion to Ctrl-Space
|
|
||||||
inoremap <C-Space> <C-n>
|
|
||||||
|
|
||||||
" This makes sure we use neocomplete completefunc instead of
|
|
||||||
" the one in rails.vim, otherwise this plugin will crap out.
|
|
||||||
let g:neocomplete#force_overwrite_completefunc = 1
|
|
||||||
|
|
||||||
" Define keyword.
|
|
||||||
if !exists('g:neocomplete#keyword_patterns')
|
|
||||||
let g:neocomplete#keyword_patterns = {}
|
|
||||||
endif
|
|
||||||
let g:neocomplete#keyword_patterns['default'] = '\h\w*'
|
|
||||||
|
|
||||||
" Enable omni completion.
|
|
||||||
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
|
|
||||||
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
|
|
||||||
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
|
|
||||||
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
|
|
||||||
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
|
|
||||||
autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete
|
|
||||||
@@ -1,136 +0,0 @@
|
|||||||
" Stolen from Steve Losh
|
|
||||||
" https://github.com/sjl/dotfiles/blob/master/vim/vimrc#L1380
|
|
||||||
"
|
|
||||||
" Motion for "next/last object". "Last" here means "previous", not "final".
|
|
||||||
" Unfortunately the "p" motion was already taken for paragraphs.
|
|
||||||
"
|
|
||||||
" Next acts on the next object of the given type, last acts on the previous
|
|
||||||
" object of the given type. These don't necessarily have to be in the current
|
|
||||||
" line.
|
|
||||||
"
|
|
||||||
" Currently works for (, [, {, and their shortcuts b, r, B.
|
|
||||||
"
|
|
||||||
" Next kind of works for ' and " as long as there are no escaped versions of
|
|
||||||
" them in the string (TODO: fix that). Last is currently broken for quotes
|
|
||||||
" (TODO: fix that).
|
|
||||||
"
|
|
||||||
" Some examples (C marks cursor positions, V means visually selected):
|
|
||||||
"
|
|
||||||
" din' -> delete in next single quotes foo = bar('spam')
|
|
||||||
" C
|
|
||||||
" foo = bar('')
|
|
||||||
" C
|
|
||||||
"
|
|
||||||
" canb -> change around next parens foo = bar('spam')
|
|
||||||
" C
|
|
||||||
" foo = bar
|
|
||||||
" C
|
|
||||||
"
|
|
||||||
" vin" -> select inside next double quotes print "hello ", name
|
|
||||||
" C
|
|
||||||
" print "hello ", name
|
|
||||||
" VVVVVV
|
|
||||||
|
|
||||||
onoremap an :<c-u>call <SID>NextTextObject('a', '/')<cr>
|
|
||||||
xnoremap an :<c-u>call <SID>NextTextObject('a', '/')<cr>
|
|
||||||
onoremap in :<c-u>call <SID>NextTextObject('i', '/')<cr>
|
|
||||||
xnoremap in :<c-u>call <SID>NextTextObject('i', '/')<cr>
|
|
||||||
|
|
||||||
onoremap al :<c-u>call <SID>NextTextObject('a', '?')<cr>
|
|
||||||
xnoremap al :<c-u>call <SID>NextTextObject('a', '?')<cr>
|
|
||||||
onoremap il :<c-u>call <SID>NextTextObject('i', '?')<cr>
|
|
||||||
xnoremap il :<c-u>call <SID>NextTextObject('i', '?')<cr>
|
|
||||||
|
|
||||||
|
|
||||||
function! s:NextTextObject(motion, dir)
|
|
||||||
let c = nr2char(getchar())
|
|
||||||
let d = ''
|
|
||||||
|
|
||||||
if c ==# "b" || c ==# "(" || c ==# ")"
|
|
||||||
let c = "("
|
|
||||||
elseif c ==# "B" || c ==# "{" || c ==# "}"
|
|
||||||
let c = "{"
|
|
||||||
elseif c ==# "r" || c ==# "[" || c ==# "]"
|
|
||||||
let c = "["
|
|
||||||
elseif c ==# "'"
|
|
||||||
let c = "'"
|
|
||||||
elseif c ==# '"'
|
|
||||||
let c = '"'
|
|
||||||
else
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Find the next opening-whatever.
|
|
||||||
execute "normal! " . a:dir . c . "\<cr>"
|
|
||||||
|
|
||||||
if a:motion ==# 'a'
|
|
||||||
" If we're doing an 'around' method, we just need to select around it
|
|
||||||
" and we can bail out to Vim.
|
|
||||||
execute "normal! va" . c
|
|
||||||
else
|
|
||||||
" Otherwise we're looking at an 'inside' motion. Unfortunately these
|
|
||||||
" get tricky when you're dealing with an empty set of delimiters because
|
|
||||||
" Vim does the wrong thing when you say vi(.
|
|
||||||
|
|
||||||
let open = ''
|
|
||||||
let close = ''
|
|
||||||
|
|
||||||
if c ==# "("
|
|
||||||
let open = "("
|
|
||||||
let close = ")"
|
|
||||||
elseif c ==# "{"
|
|
||||||
let open = "{"
|
|
||||||
let close = "}"
|
|
||||||
elseif c ==# "["
|
|
||||||
let open = "\\["
|
|
||||||
let close = "\\]"
|
|
||||||
elseif c ==# "'"
|
|
||||||
let open = "'"
|
|
||||||
let close = "'"
|
|
||||||
elseif c ==# '"'
|
|
||||||
let open = '"'
|
|
||||||
let close = '"'
|
|
||||||
endif
|
|
||||||
|
|
||||||
" We'll start at the current delimiter.
|
|
||||||
let start_pos = getpos('.')
|
|
||||||
let start_l = start_pos[1]
|
|
||||||
let start_c = start_pos[2]
|
|
||||||
|
|
||||||
" Then we'll find it's matching end delimiter.
|
|
||||||
if c ==# "'" || c ==# '"'
|
|
||||||
" searchpairpos() doesn't work for quotes, because fuck me.
|
|
||||||
let end_pos = searchpos(open)
|
|
||||||
else
|
|
||||||
let end_pos = searchpairpos(open, '', close)
|
|
||||||
endif
|
|
||||||
|
|
||||||
let end_l = end_pos[0]
|
|
||||||
let end_c = end_pos[1]
|
|
||||||
|
|
||||||
call setpos('.', start_pos)
|
|
||||||
|
|
||||||
if start_l == end_l && start_c == (end_c - 1)
|
|
||||||
" We're in an empty set of delimiters. We'll append an "x"
|
|
||||||
" character and select that so most Vim commands will do something
|
|
||||||
" sane. v is gonna be weird, and so is y. Oh well.
|
|
||||||
execute "normal! ax\<esc>\<left>"
|
|
||||||
execute "normal! vi" . c
|
|
||||||
elseif start_l == end_l && start_c == (end_c - 2)
|
|
||||||
" We're on a set of delimiters that contain a single, non-newline
|
|
||||||
" character. We can just select that and we're done.
|
|
||||||
execute "normal! vi" . c
|
|
||||||
else
|
|
||||||
" Otherwise these delimiters contain something. But we're still not
|
|
||||||
" sure Vim's gonna work, because if they contain nothing but
|
|
||||||
" newlines Vim still does the wrong thing. So we'll manually select
|
|
||||||
" the guts ourselves.
|
|
||||||
let whichwrap = &whichwrap
|
|
||||||
set whichwrap+=h,l
|
|
||||||
|
|
||||||
execute "normal! va" . c . "hol"
|
|
||||||
|
|
||||||
let &whichwrap = whichwrap
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
||||||
" OpenChangedFiles COMMAND
|
|
||||||
" Open a split for each dirty file in git
|
|
||||||
"
|
|
||||||
" Shamelessly stolen from Gary Bernhardt: https://github.com/garybernhardt/dotfiles
|
|
||||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
||||||
function! OpenChangedFiles()
|
|
||||||
only " Close all windows, unless they're modified
|
|
||||||
let status = system('git status -s | grep "^ \?\(M\|A\)" | cut -d " " -f 3')
|
|
||||||
let filenames = split(status, "\n")
|
|
||||||
if len(filenames) > 0
|
|
||||||
exec "edit " . filenames[0]
|
|
||||||
for filename in filenames[1:]
|
|
||||||
exec "sp " . filename
|
|
||||||
endfor
|
|
||||||
end
|
|
||||||
endfunction
|
|
||||||
command! OpenChangedFiles :call OpenChangedFiles()
|
|
||||||
|
|
||||||
nnoremap ,ocf :OpenChangedFiles<CR>
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
" Navigate to the block surrounding this one
|
|
||||||
" For example if you're inside
|
|
||||||
" foo do
|
|
||||||
" bar do
|
|
||||||
" # you are here
|
|
||||||
" end
|
|
||||||
" end
|
|
||||||
"
|
|
||||||
" Then hitting ,orb ("outer ruby block") will take you to 'foo do'
|
|
||||||
"
|
|
||||||
" This is relying on the textobj-rubyblock which gives us 'ar' around ruby
|
|
||||||
" and matchit.vim which gives us jumping to the matching
|
|
||||||
nnoremap <silent> ,orb :normal varar%<esc><esc>
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
" Set the shell to bash so we inherit its path, to make sure
|
|
||||||
" we inherit its path. This affects :Rtags finding the right
|
|
||||||
" path to homebrewed ctags rather than the XCode version of ctags
|
|
||||||
"
|
|
||||||
" Use login Shell instead of interactive shell to avoid
|
|
||||||
" vimdiff suspended at startup
|
|
||||||
if has("gui_running")
|
|
||||||
set shell=bash\ -i
|
|
||||||
else
|
|
||||||
set shell=bash\ -l
|
|
||||||
endif
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
" Stolen from Steve Losh vimrc: https://bitbucket.org/sjl/dotfiles/src/tip/vim/.vimrc
|
|
||||||
" Open a Quickfix window for the last search.
|
|
||||||
nnoremap <silent> <leader>q/ :execute 'vimgrep /'.@/.'/g %'<CR>:copen<CR>
|
|
||||||
|
|
||||||
" Ag for the last search.
|
|
||||||
nnoremap <silent> <leader>qa/ :execute "Ag! '" . substitute(substitute(substitute(@/, "\\\\<", "\\\\b", ""), "\\\\>", "\\\\b", ""), "\\\\v", "", "") . "'"<CR>
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
" Better key maps for switching between controller and view
|
|
||||||
nnoremap ,vv :Eview<cr>
|
|
||||||
nnoremap ,cc :Econtroller<cr>
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
" Does not work on pending 'blocks', only single lines
|
|
||||||
"
|
|
||||||
" Given:
|
|
||||||
" it "foo bar" do
|
|
||||||
" pending("bla bla"
|
|
||||||
"
|
|
||||||
" Produce:
|
|
||||||
" xit "foo bar" do
|
|
||||||
"
|
|
||||||
function! ChangePendingRspecToXit()
|
|
||||||
" Find the next occurrence of pending
|
|
||||||
while(search("pending(") > 0)
|
|
||||||
" Delete it
|
|
||||||
normal dd
|
|
||||||
" Search backwards to the it block
|
|
||||||
?it\s
|
|
||||||
" add an 'x' to the 'it' to make it 'xit'
|
|
||||||
normal ix
|
|
||||||
endwhile
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
nnoremap <silent> ,rxit :call ChangePendingRspecToXit()<cr>
|
|
||||||
|
|
||||||
" insert a before { } block around a line
|
|
||||||
nnoremap <silent> \bf ^ibefore { <esc>$a }
|
|
||||||
|
|
||||||
" insert a specify { } block around a line
|
|
||||||
nnoremap <silent> \sp ^ispecify { <esc>$a }
|
|
||||||
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
function! GetVisual()
|
|
||||||
let reg_save = getreg('"')
|
|
||||||
let regtype_save = getregtype('"')
|
|
||||||
let cb_save = &clipboard
|
|
||||||
set clipboard&
|
|
||||||
normal! ""gvy
|
|
||||||
let selection = getreg('"')
|
|
||||||
call setreg('"', reg_save, regtype_save)
|
|
||||||
let &clipboard = cb_save
|
|
||||||
return selection
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
"grep the current word using ,k (mnemonic Kurrent)
|
|
||||||
nnoremap <silent> ,k :Ag <cword><CR>
|
|
||||||
|
|
||||||
"grep visual selection
|
|
||||||
vnoremap ,k :<C-U>execute "Ag " . GetVisual()<CR>
|
|
||||||
|
|
||||||
"grep current word up to the next exclamation point using ,K
|
|
||||||
nnoremap ,K viwf!:<C-U>execute "Ag " . GetVisual()<CR>
|
|
||||||
|
|
||||||
"grep for 'def foo'
|
|
||||||
nnoremap <silent> ,gd :Ag 'def <cword>'<CR>
|
|
||||||
|
|
||||||
",gg = Grep! - using Ag the silver searcher
|
|
||||||
" open up a grep line, with a quote started for the search
|
|
||||||
nnoremap ,gg :Ag ""<left>
|
|
||||||
|
|
||||||
"Grep for usages of the current file
|
|
||||||
nnoremap ,gcf :exec "Ag " . expand("%:t:r")<CR>
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
" Tell showmarks to not include the various brace marks (),{}, etc
|
|
||||||
let g:showmarks_include = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
" hit ,f to find the definition of the current class
|
|
||||||
" this uses ctags. the standard way to get this is Ctrl-]
|
|
||||||
nnoremap <silent> ,f <C-]>
|
|
||||||
|
|
||||||
" use ,F to jump to tag in a vertical split
|
|
||||||
nnoremap <silent> ,F :let word=expand("<cword>")<CR>:vsp<CR>:wincmd w<cr>:exec("tag ". word)<cr>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
nmap <Space> <Plug>SneakForward
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
" Explicitly set g:snipMate.snippet_version to remove start up message
|
|
||||||
let g:snipMate = { 'snippet_version' : 0 }
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
if !exists("g:yadr_disable_solarized_enhancements")
|
|
||||||
hi! link txtBold Identifier
|
|
||||||
hi! link zshVariableDef Identifier
|
|
||||||
hi! link zshFunction Function
|
|
||||||
hi! link rubyControl Statement
|
|
||||||
hi! link rspecGroupMethods rubyControl
|
|
||||||
hi! link rspecMocks Identifier
|
|
||||||
hi! link rspecKeywords Identifier
|
|
||||||
hi! link rubyLocalVariableOrMethod Normal
|
|
||||||
hi! link rubyStringDelimiter Constant
|
|
||||||
hi! link rubyString Constant
|
|
||||||
hi! link rubyAccess Todo
|
|
||||||
hi! link rubySymbol Identifier
|
|
||||||
hi! link rubyPseudoVariable Type
|
|
||||||
hi! link rubyRailsARAssociationMethod Title
|
|
||||||
hi! link rubyRailsARValidationMethod Title
|
|
||||||
hi! link rubyRailsMethod Title
|
|
||||||
hi! link rubyDoBlock Normal
|
|
||||||
hi! link MatchParen DiffText
|
|
||||||
|
|
||||||
hi! link CTagsModule Type
|
|
||||||
hi! link CTagsClass Type
|
|
||||||
hi! link CTagsMethod Identifier
|
|
||||||
hi! link CTagsSingleton Identifier
|
|
||||||
|
|
||||||
hi! link javascriptFuncName Type
|
|
||||||
hi! link jsFuncCall jsFuncName
|
|
||||||
hi! link javascriptFunction Statement
|
|
||||||
hi! link javascriptThis Statement
|
|
||||||
hi! link javascriptParens Normal
|
|
||||||
hi! link jOperators javascriptStringD
|
|
||||||
hi! link jId Title
|
|
||||||
hi! link jClass Title
|
|
||||||
|
|
||||||
" Javascript language support
|
|
||||||
hi! link javascriptJGlobalMethod Statement
|
|
||||||
|
|
||||||
" Make the braces and other noisy things slightly less noisy
|
|
||||||
hi! jsParens guifg=#005F78 cterm=NONE term=NONE ctermfg=NONE ctermbg=NONE
|
|
||||||
hi! link jsFuncParens jsParens
|
|
||||||
hi! link jsFuncBraces jsParens
|
|
||||||
hi! link jsBraces jsParens
|
|
||||||
hi! link jsParens jsParens
|
|
||||||
hi! link jsNoise jsParens
|
|
||||||
|
|
||||||
hi! link NERDTreeFile Constant
|
|
||||||
hi! link NERDTreeDir Identifier
|
|
||||||
|
|
||||||
hi! link sassMixinName Function
|
|
||||||
hi! link sassDefinition Function
|
|
||||||
hi! link sassProperty Type
|
|
||||||
hi! link htmlTagName Type
|
|
||||||
|
|
||||||
hi! PreProc gui=bold
|
|
||||||
|
|
||||||
" Solarized separators are a little garish.
|
|
||||||
" This moves separators, comments, and normal
|
|
||||||
" text into the same color family as the background.
|
|
||||||
" Using the http://drpeterjones.com/colorcalc/,
|
|
||||||
" they are now just differently saturated and
|
|
||||||
" valued riffs on the background color, making
|
|
||||||
" everything play together just a little more nicely.
|
|
||||||
hi! VertSplit guifg=#003745 cterm=NONE term=NONE ctermfg=NONE ctermbg=NONE
|
|
||||||
hi! LineNR guifg=#004C60 gui=bold guibg=#002B36 ctermfg=146
|
|
||||||
hi! link NonText VertSplit
|
|
||||||
hi! Normal guifg=#77A5B1
|
|
||||||
hi! Constant guifg=#00BCE0
|
|
||||||
hi! Comment guifg=#52737B
|
|
||||||
hi! link htmlLink Include
|
|
||||||
hi! CursorLine cterm=NONE gui=NONE
|
|
||||||
hi! Visual ctermbg=233
|
|
||||||
hi! Type gui=bold
|
|
||||||
hi! EasyMotionTarget ctermfg=100 guifg=#4CE660 gui=bold
|
|
||||||
|
|
||||||
" Make sure this file loads itself on top of any other color settings
|
|
||||||
au VimEnter * so ~/.vim/settings/solarized.vim
|
|
||||||
endif
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
" via: http://whynotwiki.com/Vim
|
|
||||||
" Ruby
|
|
||||||
" Use v or # to get a variable interpolation (inside of a string)}
|
|
||||||
" ysiw# Wrap the token under the cursor in #{}
|
|
||||||
" v...s# Wrap the selection in #{}
|
|
||||||
let g:surround_113 = "#{\r}" " v
|
|
||||||
let g:surround_35 = "#{\r}" " #
|
|
||||||
|
|
||||||
" Select text in an ERb file with visual mode and then press s- or s=
|
|
||||||
" Or yss- to do entire line.
|
|
||||||
let g:surround_45 = "<% \r %>" " -
|
|
||||||
let g:surround_61 = "<%= \r %>" " =
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
"mark syntax errors with :signs
|
|
||||||
let g:syntastic_enable_signs=1
|
|
||||||
"automatically jump to the error when saving the file
|
|
||||||
let g:syntastic_auto_jump=0
|
|
||||||
"show the error list automatically
|
|
||||||
let g:syntastic_auto_loc_list=1
|
|
||||||
"don't care about warnings
|
|
||||||
let g:syntastic_quiet_messages = {'level': 'warnings'}
|
|
||||||
|
|
||||||
" Default to eslint. If you need jshint, you can override this in
|
|
||||||
" ~/.vimrc.after
|
|
||||||
let g:syntastic_javascript_checkers = ['eslint']
|
|
||||||
|
|
||||||
" I have no idea why this is not working, as it used to
|
|
||||||
" be a part of syntastic code but was apparently removed
|
|
||||||
" This will make syntastic find the correct ruby specified by mri
|
|
||||||
function! s:FindRubyExec()
|
|
||||||
if executable("rvm")
|
|
||||||
return system("rvm tools identifier")
|
|
||||||
endif
|
|
||||||
|
|
||||||
return "ruby"
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
if !exists("g:syntastic_ruby_exec")
|
|
||||||
let g:syntastic_ruby_exec = s:FindRubyExec()
|
|
||||||
endif
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
" tComment
|
|
||||||
" ========================================
|
|
||||||
" extensions for tComment plugin. Normally
|
|
||||||
" tComment maps 'gcc' to comment current line
|
|
||||||
" this adds 'gcp' comment current paragraph (block)
|
|
||||||
" using tComment's built in <c-_>p mapping
|
|
||||||
nmap <silent> gcp <c-_>p
|
|
||||||
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
:vmap ,gt :!tidy -q -i --show-errors 0<CR>
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
" https://github.com/carlhuda/janus/blob/master/vimrc
|
|
||||||
|
|
||||||
" Unimpaired configuration
|
|
||||||
" Bubble single lines
|
|
||||||
nmap <C-Up> [e
|
|
||||||
nmap <C-Down> ]e
|
|
||||||
|
|
||||||
" Bubble multiple lines
|
|
||||||
vmap <C-Up> [egv
|
|
||||||
vmap <C-Down> ]egv
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
" The tree buffer makes it easy to drill down through the directories of your
|
|
||||||
" git repository, but it’s not obvious how you could go up a level to the
|
|
||||||
" parent directory. Here’s a mapping of .. to the above command, but
|
|
||||||
" only for buffers containing a git blob or tree
|
|
||||||
autocmd User fugitive
|
|
||||||
\ if get(b:, 'fugitive_type', '') =~# '^\%(tree\|blob\)$' |
|
|
||||||
\ nnoremap <buffer> .. :edit %:h<CR> |
|
|
||||||
\ endif
|
|
||||||
|
|
||||||
" Every time you open a git object using fugitive it creates a new buffer.
|
|
||||||
" This means that your buffer listing can quickly become swamped with
|
|
||||||
" fugitive buffers. This prevents this from becomming an issue:
|
|
||||||
|
|
||||||
autocmd BufReadPost fugitive://* set bufhidden=delete
|
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
let g:indent_guides_auto_colors = 1
|
|
||||||
let g:indent_guides_start_level = 2
|
|
||||||
let g:indent_guides_guide_size = 1
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
" Turn off default key mappings
|
|
||||||
let g:multi_cursor_use_default_mapping=0
|
|
||||||
|
|
||||||
" Switch to multicursor mode with ,mc
|
|
||||||
let g:multi_cursor_start_key=',mc'
|
|
||||||
|
|
||||||
" Ctrl-n, Ctrl-p, Ctrl-x, and <Esc> are mapped in the special multicursor
|
|
||||||
" mode once you've added at least one virtual cursor to the buffer
|
|
||||||
let g:multi_cursor_next_key='<C-n>'
|
|
||||||
let g:multi_cursor_prev_key='<C-p>'
|
|
||||||
let g:multi_cursor_skip_key='<C-x>'
|
|
||||||
let g:multi_cursor_quit_key='<Esc>'
|
|
||||||
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
" Prevent vim-session from asking us to load the session.
|
|
||||||
" If you want to load the session, use :SaveSession and :OpenSession
|
|
||||||
let g:session_autosave = 'no'
|
|
||||||
let g:session_autoload = 'no'
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
" Don't allow any default key-mappings.
|
|
||||||
let g:tmux_navigator_no_mappings = 1
|
|
||||||
|
|
||||||
" Re-enable tmux_navigator.vim default bindings, minus <c-\>.
|
|
||||||
" <c-\> conflicts with NERDTree "current file".
|
|
||||||
|
|
||||||
nnoremap <silent> <c-h> :TmuxNavigateLeft<cr>
|
|
||||||
nnoremap <silent> <c-j> :TmuxNavigateDown<cr>
|
|
||||||
nnoremap <silent> <c-k> :TmuxNavigateUp<cr>
|
|
||||||
nnoremap <silent> <c-l> :TmuxNavigateRight<cr>
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
" Make it beautiful - colors and fonts
|
|
||||||
|
|
||||||
if has("gui_running")
|
|
||||||
"tell the term has 256 colors
|
|
||||||
set t_Co=256
|
|
||||||
|
|
||||||
" Show tab number (useful for Cmd-1, Cmd-2.. mapping)
|
|
||||||
" For some reason this doesn't work as a regular set command,
|
|
||||||
" (the numbers don't show up) so I made it a VimEnter event
|
|
||||||
autocmd VimEnter * set guitablabel=%N:\ %t\ %M
|
|
||||||
|
|
||||||
set lines=60
|
|
||||||
set columns=190
|
|
||||||
|
|
||||||
if has("gui_gtk2")
|
|
||||||
set guifont=Inconsolata\ XL\ 12,Inconsolata\ 15,Monaco\ 12
|
|
||||||
else
|
|
||||||
set guifont=Inconsolata\ XL:h17,Inconsolata:h20,Monaco:h17
|
|
||||||
end
|
|
||||||
else
|
|
||||||
let g:CSApprox_loaded = 1
|
|
||||||
|
|
||||||
" For people using a terminal that is not Solarized
|
|
||||||
if exists("g:yadr_using_unsolarized_terminal")
|
|
||||||
let g:solarized_termcolors=256
|
|
||||||
let g:solarized_termtrans=1
|
|
||||||
end
|
|
||||||
endif
|
|
||||||
|
|
||||||
colorscheme solarized
|
|
||||||
set background=dark
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
" Disable the scrollbars (NERDTree)
|
|
||||||
set guioptions-=r
|
|
||||||
set guioptions-=L
|
|
||||||
|
|
||||||
" Disable the macvim toolbar
|
|
||||||
set guioptions-=T
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
" ========================================
|
|
||||||
" Linux specific General vim sanity improvements
|
|
||||||
" ========================================
|
|
||||||
"
|
|
||||||
" ========================================
|
|
||||||
" RSI Prevention - keyboard remaps
|
|
||||||
" ========================================
|
|
||||||
" Certain things we do every day as programmers stress
|
|
||||||
" out our hands. For example, typing underscores and
|
|
||||||
" dashes are very common, and in position that require
|
|
||||||
" a lot of hand movement. Vim to the rescue
|
|
||||||
"
|
|
||||||
" Now using the middle finger of either hand you can type
|
|
||||||
" underscores with Alt-k or Alt-d, and add Shift
|
|
||||||
" to type dashes
|
|
||||||
imap <silent> <A-k> _
|
|
||||||
imap <silent> <A-d> _
|
|
||||||
imap <silent> <A-K> -
|
|
||||||
imap <silent> <A-D> -
|
|
||||||
|
|
||||||
" Change inside various enclosures with Alt-" and Alt-'
|
|
||||||
" The f makes it find the enclosure so you don't have
|
|
||||||
" to be standing inside it
|
|
||||||
nnoremap <A-'> f'ci'
|
|
||||||
nnoremap <A-"> f"ci"
|
|
||||||
nnoremap <A-(> f(ci(
|
|
||||||
nnoremap <A-)> f)ci)
|
|
||||||
nnoremap <A-[> f[ci[
|
|
||||||
nnoremap <A-]> f]ci]
|
|
||||||
|
|
||||||
" ==== NERD tree
|
|
||||||
" Alt-Shift-N for nerd tree
|
|
||||||
nmap <A-N> :NERDTreeToggle<CR>
|
|
||||||
|
|
||||||
" move up/down quickly by using Alt-j, Alt-k
|
|
||||||
" which will move us around by functions
|
|
||||||
nnoremap <silent> <A-j> }
|
|
||||||
nnoremap <silent> <A-k> {
|
|
||||||
autocmd FileType ruby map <buffer> <A-j> ]m
|
|
||||||
autocmd FileType ruby map <buffer> <A-k> [m
|
|
||||||
autocmd FileType rspec map <buffer> <A-j> }
|
|
||||||
autocmd FileType rspec map <buffer> <A-k> {
|
|
||||||
autocmd FileType javascript map <buffer> <A-k> }
|
|
||||||
autocmd FileType javascript map <buffer> <A-j> {
|
|
||||||
|
|
||||||
" Command-/ to toggle comments
|
|
||||||
map <A-/> :TComment<CR>
|
|
||||||
imap <A-/> <Esc>:TComment<CR>i
|
|
||||||
|
|
||||||
" Use Alt- numbers to pick the tab you want
|
|
||||||
map <silent> <A-1> :tabn 1<cr>
|
|
||||||
map <silent> <A-2> :tabn 2<cr>
|
|
||||||
map <silent> <A-3> :tabn 3<cr>
|
|
||||||
map <silent> <A-4> :tabn 4<cr>
|
|
||||||
map <silent> <A-5> :tabn 5<cr>
|
|
||||||
map <silent> <A-6> :tabn 6<cr>
|
|
||||||
map <silent> <A-7> :tabn 7<cr>
|
|
||||||
map <silent> <A-8> :tabn 8<cr>
|
|
||||||
map <silent> <A-9> :tabn 9<cr>
|
|
||||||
|
|
||||||
" Resize windows with arrow keys
|
|
||||||
nnoremap <C-Up> <C-w>+
|
|
||||||
nnoremap <C-Down> <C-w>-
|
|
||||||
nnoremap <C-Left> <C-w><
|
|
||||||
nnoremap <C-Right> <C-w>>
|
|
||||||
|
|
||||||
" ============================
|
|
||||||
" Tabularize - alignment
|
|
||||||
" ============================
|
|
||||||
" Hit Alt-Shift-A then type a character you want to align by
|
|
||||||
nmap <A-A> :Tabularize /
|
|
||||||
vmap <A-A> :Tabularize /
|
|
||||||
|
|
||||||
" Source current file Alt-% (good for vim development)
|
|
||||||
map <A-%> :so %<CR>
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
" ========================================
|
|
||||||
" Mac specific General vim sanity improvements
|
|
||||||
" ========================================
|
|
||||||
"
|
|
||||||
" ========================================
|
|
||||||
" RSI Prevention - keyboard remaps
|
|
||||||
" ========================================
|
|
||||||
" Certain things we do every day as programmers stress
|
|
||||||
" out our hands. For example, typing underscores and
|
|
||||||
" dashes are very common, and in position that require
|
|
||||||
" a lot of hand movement. Vim to the rescue
|
|
||||||
"
|
|
||||||
" Now using the middle finger of either hand you can type
|
|
||||||
" underscores with apple-k or apple-d, and add Shift
|
|
||||||
" to type dashes
|
|
||||||
imap <silent> <D-k> _
|
|
||||||
imap <silent> <D-d> _
|
|
||||||
imap <silent> <D-K> -
|
|
||||||
imap <silent> <D-D> -
|
|
||||||
|
|
||||||
" Change inside various enclosures with Cmd-" and Cmd-'
|
|
||||||
" The f makes it find the enclosure so you don't have
|
|
||||||
" to be standing inside it
|
|
||||||
nnoremap <D-'> f'ci'
|
|
||||||
nnoremap <D-"> f"ci"
|
|
||||||
nnoremap <D-(> f(ci(
|
|
||||||
nnoremap <D-)> f)ci)
|
|
||||||
nnoremap <D-[> f[ci[
|
|
||||||
nnoremap <D-]> f]ci]
|
|
||||||
|
|
||||||
" ==== NERD tree
|
|
||||||
" Cmd-Shift-N for nerd tree
|
|
||||||
nmap <D-N> :NERDTreeToggle<CR>
|
|
||||||
|
|
||||||
" move up/down quickly by using Cmd-j, Cmd-k
|
|
||||||
" which will move us around by functions
|
|
||||||
nnoremap <silent> <D-j> }
|
|
||||||
nnoremap <silent> <D-k> {
|
|
||||||
autocmd FileType ruby map <buffer> <D-j> ]m
|
|
||||||
autocmd FileType ruby map <buffer> <D-k> [m
|
|
||||||
autocmd FileType rspec map <buffer> <D-j> }
|
|
||||||
autocmd FileType rspec map <buffer> <D-k> {
|
|
||||||
autocmd FileType javascript map <buffer> <D-k> }
|
|
||||||
autocmd FileType javascript map <buffer> <D-j> {
|
|
||||||
|
|
||||||
" Command-/ to toggle comments
|
|
||||||
map <D-/> :TComment<CR>
|
|
||||||
imap <D-/> <Esc>:TComment<CR>i
|
|
||||||
|
|
||||||
" Use numbers to pick the tab you want (like iTerm)
|
|
||||||
map <silent> <D-1> :tabn 1<cr>
|
|
||||||
map <silent> <D-2> :tabn 2<cr>
|
|
||||||
map <silent> <D-3> :tabn 3<cr>
|
|
||||||
map <silent> <D-4> :tabn 4<cr>
|
|
||||||
map <silent> <D-5> :tabn 5<cr>
|
|
||||||
map <silent> <D-6> :tabn 6<cr>
|
|
||||||
map <silent> <D-7> :tabn 7<cr>
|
|
||||||
map <silent> <D-8> :tabn 8<cr>
|
|
||||||
map <silent> <D-9> :tabn 9<cr>
|
|
||||||
|
|
||||||
" Resize windows with arrow keys
|
|
||||||
nnoremap <D-Up> <C-w>+
|
|
||||||
nnoremap <D-Down> <C-w>-
|
|
||||||
nnoremap <D-Left> <C-w><
|
|
||||||
nnoremap <D-Right> <C-w>>
|
|
||||||
|
|
||||||
" ============================
|
|
||||||
" Tabularize - alignment
|
|
||||||
" ============================
|
|
||||||
" Hit Cmd-Shift-A then type a character you want to align by
|
|
||||||
nmap <D-A> :Tabularize /
|
|
||||||
vmap <D-A> :Tabularize /
|
|
||||||
|
|
||||||
" Source current file Cmd-% (good for vim development)
|
|
||||||
map <D-%> :so %<CR>
|
|
||||||
@@ -1,172 +0,0 @@
|
|||||||
" ========================================
|
|
||||||
" General vim sanity improvements
|
|
||||||
" ========================================
|
|
||||||
"
|
|
||||||
"
|
|
||||||
" alias yw to yank the entire word 'yank inner word'
|
|
||||||
" even if the cursor is halfway inside the word
|
|
||||||
" FIXME: will not properly repeat when you use a dot (tie into repeat.vim)
|
|
||||||
nnoremap ,yw yiww
|
|
||||||
|
|
||||||
" ,ow = 'overwrite word', replace a word with what's in the yank buffer
|
|
||||||
" FIXME: will not properly repeat when you use a dot (tie into repeat.vim)
|
|
||||||
nnoremap ,ow "_diwhp
|
|
||||||
|
|
||||||
"make Y consistent with C and D
|
|
||||||
nnoremap Y y$
|
|
||||||
function! YRRunAfterMaps()
|
|
||||||
nnoremap Y :<C-U>YRYankCount 'y$'<CR>
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Make 0 go to the first character rather than the beginning
|
|
||||||
" of the line. When we're programming, we're almost always
|
|
||||||
" interested in working with text rather than empty space. If
|
|
||||||
" you want the traditional beginning of line, use ^
|
|
||||||
nnoremap 0 ^
|
|
||||||
nnoremap ^ 0
|
|
||||||
|
|
||||||
" ,# Surround a word with #{ruby interpolation}
|
|
||||||
map ,# ysiw#
|
|
||||||
vmap ,# c#{<C-R>"}<ESC>
|
|
||||||
|
|
||||||
" ," Surround a word with "quotes"
|
|
||||||
map ," ysiw"
|
|
||||||
vmap ," c"<C-R>""<ESC>
|
|
||||||
|
|
||||||
" ,' Surround a word with 'single quotes'
|
|
||||||
map ,' ysiw'
|
|
||||||
vmap ,' c'<C-R>"'<ESC>
|
|
||||||
|
|
||||||
" ,) or ,( Surround a word with (parens)
|
|
||||||
" The difference is in whether a space is put in
|
|
||||||
map ,( ysiw(
|
|
||||||
map ,) ysiw)
|
|
||||||
vmap ,( c( <C-R>" )<ESC>
|
|
||||||
vmap ,) c(<C-R>")<ESC>
|
|
||||||
|
|
||||||
" ,[ Surround a word with [brackets]
|
|
||||||
map ,] ysiw]
|
|
||||||
map ,[ ysiw[
|
|
||||||
vmap ,[ c[ <C-R>" ]<ESC>
|
|
||||||
vmap ,] c[<C-R>"]<ESC>
|
|
||||||
|
|
||||||
" ,{ Surround a word with {braces}
|
|
||||||
map ,} ysiw}
|
|
||||||
map ,{ ysiw{
|
|
||||||
vmap ,} c{ <C-R>" }<ESC>
|
|
||||||
vmap ,{ c{<C-R>"}<ESC>
|
|
||||||
|
|
||||||
map ,` ysiw`
|
|
||||||
|
|
||||||
" gary bernhardt's hashrocket
|
|
||||||
imap <c-l> <space>=><space>
|
|
||||||
|
|
||||||
"Go to last edit location with ,.
|
|
||||||
nnoremap ,. '.
|
|
||||||
|
|
||||||
"When typing a string, your quotes auto complete. Move past the quote
|
|
||||||
"while still in insert mode by hitting Ctrl-a. Example:
|
|
||||||
"
|
|
||||||
" type 'foo<c-a>
|
|
||||||
"
|
|
||||||
" the first quote will autoclose so you'll get 'foo' and hitting <c-a> will
|
|
||||||
" put the cursor right after the quote
|
|
||||||
imap <C-a> <esc>wa
|
|
||||||
|
|
||||||
" ==== NERD tree
|
|
||||||
" Open the project tree and expose current file in the nerdtree with Ctrl-\
|
|
||||||
" " calls NERDTreeFind iff NERDTree is active, current window contains a modifiable file, and we're not in vimdiff
|
|
||||||
function! OpenNerdTree()
|
|
||||||
if &modifiable && strlen(expand('%')) > 0 && !&diff
|
|
||||||
NERDTreeFind
|
|
||||||
else
|
|
||||||
NERDTreeToggle
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
nnoremap <silent> <C-\> :call OpenNerdTree()<CR>
|
|
||||||
|
|
||||||
" ,q to toggle quickfix window (where you have stuff like Ag)
|
|
||||||
" ,oq to open it back up (rare)
|
|
||||||
nmap <silent> ,qc :cclose<CR>
|
|
||||||
nmap <silent> ,qo :copen<CR>
|
|
||||||
|
|
||||||
"Move back and forth through previous and next buffers
|
|
||||||
"with ,z and ,x
|
|
||||||
nnoremap <silent> ,z :bp<CR>
|
|
||||||
nnoremap <silent> ,x :bn<CR>
|
|
||||||
|
|
||||||
" ==============================
|
|
||||||
" Window/Tab/Split Manipulation
|
|
||||||
" ==============================
|
|
||||||
" Move between split windows by using the four directions H, L, K, J
|
|
||||||
" NOTE: This has moved to vim/settings/vim-tmux-navigator.vim.
|
|
||||||
" nnoremap <silent> <C-h> <C-w>h
|
|
||||||
" nnoremap <silent> <C-l> <C-w>l
|
|
||||||
" nnoremap <silent> <C-k> <C-w>k
|
|
||||||
" nnoremap <silent> <C-j> <C-w>j
|
|
||||||
|
|
||||||
" Make gf (go to file) create the file, if not existent
|
|
||||||
nnoremap <C-w>f :sp +e<cfile><CR>
|
|
||||||
nnoremap <C-w>gf :tabe<cfile><CR>
|
|
||||||
|
|
||||||
" Zoom in
|
|
||||||
map <silent> ,gz <C-w>o
|
|
||||||
|
|
||||||
" Create window splits easier. The default
|
|
||||||
" way is Ctrl-w,v and Ctrl-w,s. I remap
|
|
||||||
" this to vv and ss
|
|
||||||
nnoremap <silent> vv <C-w>v
|
|
||||||
nnoremap <silent> ss <C-w>s
|
|
||||||
|
|
||||||
" create <%= foo %> erb tags using Ctrl-k in edit mode
|
|
||||||
imap <silent> <C-K> <%= %><Esc>3hi
|
|
||||||
|
|
||||||
" create <%= foo %> erb tags using Ctrl-j in edit mode
|
|
||||||
imap <silent> <C-J> <% %><Esc>2hi
|
|
||||||
|
|
||||||
" ============================
|
|
||||||
" Shortcuts for everyday tasks
|
|
||||||
" ============================
|
|
||||||
|
|
||||||
" copy current filename into system clipboard - mnemonic: (c)urrent(f)ilename
|
|
||||||
" this is helpful to paste someone the path you're looking at
|
|
||||||
nnoremap <silent> ,cf :let @* = expand("%:~")<CR>
|
|
||||||
nnoremap <silent> ,cr :let @* = expand("%")<CR>
|
|
||||||
nnoremap <silent> ,cn :let @* = expand("%:t")<CR>
|
|
||||||
|
|
||||||
"Clear current search highlight by double tapping //
|
|
||||||
nmap <silent> // :nohlsearch<CR>
|
|
||||||
|
|
||||||
"(v)im (c)ommand - execute current line as a vim command
|
|
||||||
nmap <silent> ,vc yy:<C-f>p<C-c><CR>
|
|
||||||
|
|
||||||
"(v)im (r)eload
|
|
||||||
nmap <silent> ,vr :so %<CR>
|
|
||||||
|
|
||||||
" Type ,hl to toggle highlighting on/off, and show current value.
|
|
||||||
noremap ,hl :set hlsearch! hlsearch?<CR>
|
|
||||||
|
|
||||||
" These are very similar keys. Typing 'a will jump to the line in the current
|
|
||||||
" file marked with ma. However, `a will jump to the line and column marked
|
|
||||||
" with ma. It’s more useful in any case I can imagine, but it’s located way
|
|
||||||
" off in the corner of the keyboard. The best way to handle this is just to
|
|
||||||
" swap them: http://items.sjbach.com/319/configuring-vim-right
|
|
||||||
nnoremap ' `
|
|
||||||
nnoremap ` '
|
|
||||||
|
|
||||||
" ============================
|
|
||||||
" SplitJoin plugin
|
|
||||||
" ============================
|
|
||||||
nmap sj :SplitjoinSplit<cr>
|
|
||||||
nmap sk :SplitjoinJoin<cr>
|
|
||||||
|
|
||||||
" Get the current highlight group. Useful for then remapping the color
|
|
||||||
map ,hi :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">" . " FG:" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"fg#")<CR>
|
|
||||||
|
|
||||||
" ,hp = html preview
|
|
||||||
map <silent> ,hp :!open -a Safari %<CR><CR>
|
|
||||||
|
|
||||||
" Map Ctrl-x and Ctrl-z to navigate the quickfix error list (normally :cn and
|
|
||||||
" :cp)
|
|
||||||
nnoremap <silent> <C-x> :cn<CR>
|
|
||||||
nnoremap <silent> <C-z> :cp<CR>
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
" w!! to write a file as sudo
|
|
||||||
" stolen from Steve Losh
|
|
||||||
cmap w!! w !sudo tee % >/dev/null
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
" via: http://rails-bestpractices.com/posts/60-remove-trailing-whitespace
|
|
||||||
" Strip trailing whitespace
|
|
||||||
function! <SID>StripTrailingWhitespaces()
|
|
||||||
" Preparation: save last search, and cursor position.
|
|
||||||
let _s=@/
|
|
||||||
let l = line(".")
|
|
||||||
let c = col(".")
|
|
||||||
" Do the business:
|
|
||||||
%s/\s\+$//e
|
|
||||||
" Clean up: restore previous search history, and cursor position
|
|
||||||
let @/=_s
|
|
||||||
call cursor(l, c)
|
|
||||||
endfunction
|
|
||||||
command! StripTrailingWhitespaces call <SID>StripTrailingWhitespaces()
|
|
||||||
nmap ,w :StripTrailingWhitespaces<CR>
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
" Use Q to intelligently close a window
|
|
||||||
" (if there are multiple windows into the same buffer)
|
|
||||||
" or kill the buffer entirely if it's the last window looking into that buffer
|
|
||||||
function! CloseWindowOrKillBuffer()
|
|
||||||
let number_of_windows_to_this_buffer = len(filter(range(1, winnr('$')), "winbufnr(v:val) == bufnr('%')"))
|
|
||||||
|
|
||||||
" We should never bdelete a nerd tree
|
|
||||||
if matchstr(expand("%"), 'NERD') == 'NERD'
|
|
||||||
wincmd c
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
if number_of_windows_to_this_buffer > 1
|
|
||||||
wincmd c
|
|
||||||
else
|
|
||||||
bdelete
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
nnoremap <silent> Q :call CloseWindowOrKillBuffer()<CR>
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
" http://vimcasts.org/episodes/soft-wrapping-text/
|
|
||||||
function! SetupWrapping()
|
|
||||||
set wrap linebreak nolist
|
|
||||||
set showbreak=…
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" TODO: this should happen automatically for certain file types (e.g. markdown)
|
|
||||||
command! -nargs=* Wrap :call SetupWrapping()<CR>
|
|
||||||
|
|
||||||
vmap <D-j> gj
|
|
||||||
vmap <D-k> gk
|
|
||||||
vmap <D-$> g$
|
|
||||||
vmap <D-^> g^
|
|
||||||
vmap <D-0> g^
|
|
||||||
nmap <D-j> gj
|
|
||||||
nmap <D-k> gk
|
|
||||||
nmap <D-$> g$
|
|
||||||
nmap <D-^> g^
|
|
||||||
nmap <D-0> g^
|
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
let g:yankring_history_file = '.yankring-history'
|
|
||||||
nnoremap ,yr :YRShow<CR>
|
|
||||||
nnoremap C-y :YRShow<CR>
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
" ========================================
|
|
||||||
" Vim plugin configuration
|
|
||||||
" ========================================
|
|
||||||
"
|
|
||||||
" This file contains the list of plugin installed using vundle plugin manager.
|
|
||||||
" Once you've updated the list of plugin, you can run vundle update by issuing
|
|
||||||
" the command :BundleInstall from within vim or directly invoking it from the
|
|
||||||
" command line with the following syntax:
|
|
||||||
" vim --noplugin -u vim/vundles.vim -N "+set hidden" "+syntax on" +BundleClean! +BundleInstall +qall
|
|
||||||
" Filetype off is required by vundle
|
|
||||||
filetype off
|
|
||||||
|
|
||||||
set rtp+=~/.vim/bundle/vundle/
|
|
||||||
set rtp+=~/.vim/vundles/ "Submodules
|
|
||||||
call vundle#rc()
|
|
||||||
|
|
||||||
" let Vundle manage Vundle (required)
|
|
||||||
Bundle "gmarik/vundle"
|
|
||||||
|
|
||||||
" YADR's vundles are split up by category into smaller files
|
|
||||||
" This reduces churn and makes it easier to fork. See
|
|
||||||
" ~/.vim/vundles/ to edit them:
|
|
||||||
runtime ruby.vundle
|
|
||||||
runtime languages.vundle
|
|
||||||
runtime git.vundle
|
|
||||||
runtime appearance.vundle
|
|
||||||
runtime textobjects.vundle
|
|
||||||
runtime search.vundle
|
|
||||||
runtime project.vundle
|
|
||||||
runtime vim-improvements.vundle
|
|
||||||
|
|
||||||
" The plugins listed in ~/.vim/.vundles.local will be added here to
|
|
||||||
" allow the user to add vim plugins to yadr without the need for a fork.
|
|
||||||
if filereadable(expand("~/.yadr/vim/.vundles.local"))
|
|
||||||
source ~/.yadr/vim/.vundles.local
|
|
||||||
endif
|
|
||||||
|
|
||||||
"Filetype plugin indent on is required by vundle
|
|
||||||
filetype plugin indent on
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
Bundle "chrisbra/color_highlight.git"
|
|
||||||
Bundle "skwp/vim-colors-solarized"
|
|
||||||
Bundle "itchyny/lightline.vim"
|
|
||||||
Bundle "jby/tmux.vim.git"
|
|
||||||
Bundle "morhetz/gruvbox"
|
|
||||||
Bundle "xsunsmile/showmarks.git"
|
|
||||||
Bundle "chriskempson/base16-vim"
|
|
||||||
|
|
||||||
" Required for Gblame in terminal vim
|
|
||||||
Bundle "godlygeek/csapprox.git"
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
Bundle "gregsexton/gitv"
|
|
||||||
Bundle "mattn/gist-vim"
|
|
||||||
Bundle "tpope/vim-fugitive"
|
|
||||||
Bundle "tpope/vim-git"
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
Bundle 'sheerun/vim-polyglot'
|
|
||||||
Bundle 'pangloss/vim-javascript'
|
|
||||||
Bundle 'w0rp/ale'
|
|
||||||
Bundle 'garbas/vim-snipmate.git'
|
|
||||||
Bundle 'honza/vim-snippets'
|
|
||||||
Bundle 'jtratner/vim-flavored-markdown.git'
|
|
||||||
Bundle 'vim-syntastic/syntastic.git'
|
|
||||||
Bundle 'nelstrom/vim-markdown-preview'
|
|
||||||
Bundle 'skwp/vim-html-escape'
|
|
||||||
Bundle 'MaxMEllon/vim-jsx-pretty'
|
|
||||||
Bundle 'jparise/vim-graphql'
|
|
||||||
Bundle 'mogelbrod/vim-jsonpath'
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
Bundle "jistr/vim-nerdtree-tabs.git"
|
|
||||||
Bundle "preservim/nerdtree.git"
|
|
||||||
Bundle "ctrlpvim/ctrlp.vim"
|
|
||||||
Bundle 'JazzCore/ctrlp-cmatcher'
|
|
||||||
Bundle 'junegunn/fzf'
|
|
||||||
Bundle "xolox/vim-misc"
|
|
||||||
Bundle "xolox/vim-session"
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
Bundle "ecomba/vim-ruby-refactoring"
|
|
||||||
Bundle "tpope/vim-rails.git"
|
|
||||||
Bundle "tpope/vim-rake.git"
|
|
||||||
Bundle "tpope/vim-rvm.git"
|
|
||||||
Bundle "vim-ruby/vim-ruby.git"
|
|
||||||
Bundle "keith/rspec.vim"
|
|
||||||
Bundle "skwp/vim-iterm-rspec"
|
|
||||||
Bundle "skwp/vim-spec-finder"
|
|
||||||
Bundle "ck3g/vim-change-hash-syntax"
|
|
||||||
Bundle "tpope/vim-bundler"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
Bundle "justinmk/vim-sneak"
|
|
||||||
Bundle "rking/ag.vim"
|
|
||||||
Bundle "henrik/vim-indexed-search"
|
|
||||||
Bundle "nelstrom/vim-visual-star-search"
|
|
||||||
Bundle "skwp/greplace.vim"
|
|
||||||
Bundle "Lokaltog/vim-easymotion"
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
" These bundles introduce new textobjects into vim,
|
|
||||||
" For example the Ruby one introduces the 'r' text object
|
|
||||||
" such that 'var' gives you Visual Around Ruby
|
|
||||||
Bundle "austintaylor/vim-indentobject"
|
|
||||||
Bundle "bootleq/vim-textobj-rubysymbol"
|
|
||||||
Bundle "coderifous/textobj-word-column.vim"
|
|
||||||
Bundle "kana/vim-textobj-datetime"
|
|
||||||
Bundle "kana/vim-textobj-entire"
|
|
||||||
Bundle "kana/vim-textobj-function"
|
|
||||||
Bundle "kana/vim-textobj-user"
|
|
||||||
Bundle "lucapette/vim-textobj-underscore"
|
|
||||||
Bundle "nathanaelkane/vim-indent-guides"
|
|
||||||
Bundle "nelstrom/vim-textobj-rubyblock"
|
|
||||||
Bundle "thinca/vim-textobj-function-javascript"
|
|
||||||
Bundle "wellle/targets.vim"
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
Bundle "AndrewRadev/splitjoin.vim"
|
|
||||||
Bundle "Raimondi/delimitMate"
|
|
||||||
Bundle "Shougo/neocomplete.git"
|
|
||||||
Bundle "briandoll/change-inside-surroundings.vim.git"
|
|
||||||
Bundle "godlygeek/tabular"
|
|
||||||
Bundle "tomtom/tcomment_vim.git"
|
|
||||||
Bundle "vim-scripts/camelcasemotion.git"
|
|
||||||
Bundle "vim-scripts/matchit.zip.git"
|
|
||||||
Bundle "kristijanhusak/vim-multiple-cursors"
|
|
||||||
Bundle "Keithbsmiley/investigate.vim"
|
|
||||||
Bundle "chrisbra/NrrwRgn"
|
|
||||||
Bundle "christoomey/vim-tmux-navigator"
|
|
||||||
Bundle "MarcWeber/vim-addon-mw-utils.git"
|
|
||||||
Bundle "bogado/file-line.git"
|
|
||||||
Bundle "mattn/webapi-vim.git"
|
|
||||||
Bundle "sjl/gundo.vim"
|
|
||||||
Bundle "skwp/YankRing.vim"
|
|
||||||
Bundle "tomtom/tlib_vim.git"
|
|
||||||
Bundle "tpope/vim-abolish"
|
|
||||||
Bundle "tpope/vim-endwise.git"
|
|
||||||
Bundle "tpope/vim-ragtag"
|
|
||||||
Bundle "tpope/vim-repeat.git"
|
|
||||||
Bundle "tpope/vim-surround.git"
|
|
||||||
Bundle "tpope/vim-unimpaired"
|
|
||||||
Bundle "vim-scripts/AnsiEsc.vim.git"
|
|
||||||
Bundle "vim-scripts/AutoTag.git"
|
|
||||||
Bundle "vim-scripts/lastpos.vim"
|
|
||||||
Bundle "vim-scripts/sudo.vim"
|
|
||||||
Bundle "goldfeld/ctrlr.vim"
|
|
||||||
Bundle "editorconfig/editorconfig-vim"
|
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
bind -v
|
|
||||||
bind "^R" em-inc-search-prev
|
|
||||||
bind \\t rl_complete
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
set editing-mode vi
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
" Use Vim settings, rather then Vi settings (much better!).
|
|
||||||
" This must be first, because it changes other options as a side effect.
|
|
||||||
set nocompatible
|
|
||||||
|
|
||||||
" TODO: this may not be in the correct place. It is intended to allow overriding <Leader>.
|
|
||||||
" source ~/.vimrc.before if it exists.
|
|
||||||
if filereadable(expand("~/.vimrc.before"))
|
|
||||||
source ~/.vimrc.before
|
|
||||||
endif
|
|
||||||
|
|
||||||
" ================ General Config ====================
|
|
||||||
|
|
||||||
set number "Line numbers are good
|
|
||||||
set backspace=indent,eol,start "Allow backspace in insert mode
|
|
||||||
set history=1000 "Store lots of :cmdline history
|
|
||||||
set showcmd "Show incomplete cmds down the bottom
|
|
||||||
set showmode "Show current mode down the bottom
|
|
||||||
set gcr=a:blinkon0 "Disable cursor blink
|
|
||||||
set visualbell "No sounds
|
|
||||||
set autoread "Reload files changed outside vim
|
|
||||||
|
|
||||||
" This makes vim act like all other editors, buffers can
|
|
||||||
" exist in the background without being in a window.
|
|
||||||
" http://items.sjbach.com/319/configuring-vim-right
|
|
||||||
set hidden
|
|
||||||
|
|
||||||
"turn on syntax highlighting
|
|
||||||
syntax on
|
|
||||||
|
|
||||||
" Change leader to a comma because the backslash is too far away
|
|
||||||
" That means all \x commands turn into ,x
|
|
||||||
" The mapleader has to be set before vundle starts loading all
|
|
||||||
" the plugins.
|
|
||||||
let mapleader=","
|
|
||||||
|
|
||||||
" =============== Vundle Initialization ===============
|
|
||||||
" This loads all the plugins specified in ~/.vim/vundles.vim
|
|
||||||
" Use Vundle plugin to manage all other plugins
|
|
||||||
if filereadable(expand("~/.vim/vundles.vim"))
|
|
||||||
source ~/.vim/vundles.vim
|
|
||||||
endif
|
|
||||||
au BufNewFile,BufRead *.vundle set filetype=vim
|
|
||||||
|
|
||||||
" ================ Turn Off Swap Files ==============
|
|
||||||
|
|
||||||
set noswapfile
|
|
||||||
set nobackup
|
|
||||||
set nowb
|
|
||||||
|
|
||||||
" ================ Persistent Undo ==================
|
|
||||||
" Keep undo history across sessions, by storing in file.
|
|
||||||
" Only works all the time.
|
|
||||||
if has('persistent_undo') && isdirectory(expand('~').'/.vim/backups')
|
|
||||||
silent !mkdir ~/.vim/backups > /dev/null 2>&1
|
|
||||||
set undodir=~/.vim/backups
|
|
||||||
set undofile
|
|
||||||
endif
|
|
||||||
|
|
||||||
" ================ Indentation ======================
|
|
||||||
|
|
||||||
set autoindent
|
|
||||||
set smartindent
|
|
||||||
set smarttab
|
|
||||||
set shiftwidth=2
|
|
||||||
set softtabstop=2
|
|
||||||
set tabstop=2
|
|
||||||
set expandtab
|
|
||||||
|
|
||||||
" Auto indent pasted text
|
|
||||||
nnoremap p p=`]<C-o>
|
|
||||||
nnoremap P P=`]<C-o>
|
|
||||||
|
|
||||||
filetype plugin on
|
|
||||||
filetype indent on
|
|
||||||
|
|
||||||
" Display tabs and trailing spaces visually
|
|
||||||
set list listchars=tab:\ \ ,trail:·
|
|
||||||
|
|
||||||
set nowrap "Don't wrap lines
|
|
||||||
set linebreak "Wrap lines at convenient points
|
|
||||||
|
|
||||||
" ================ Folds ============================
|
|
||||||
|
|
||||||
set foldmethod=indent "fold based on indent
|
|
||||||
set foldnestmax=3 "deepest fold is 3 levels
|
|
||||||
set nofoldenable "dont fold by default
|
|
||||||
|
|
||||||
" ================ Completion =======================
|
|
||||||
|
|
||||||
set wildmode=list:longest
|
|
||||||
set wildmenu "enable ctrl-n and ctrl-p to scroll thru matches
|
|
||||||
set wildignore=*.o,*.obj,*~ "stuff to ignore when tab completing
|
|
||||||
set wildignore+=*vim/backups*
|
|
||||||
set wildignore+=*sass-cache*
|
|
||||||
set wildignore+=*DS_Store*
|
|
||||||
set wildignore+=vendor/rails/**
|
|
||||||
set wildignore+=vendor/cache/**
|
|
||||||
set wildignore+=*.gem
|
|
||||||
set wildignore+=log/**
|
|
||||||
set wildignore+=tmp/**
|
|
||||||
set wildignore+=*.png,*.jpg,*.gif
|
|
||||||
|
|
||||||
" ================ Scrolling ========================
|
|
||||||
|
|
||||||
set scrolloff=8 "Start scrolling when we're 8 lines away from margins
|
|
||||||
set sidescrolloff=15
|
|
||||||
set sidescroll=1
|
|
||||||
|
|
||||||
" ================ Search ===========================
|
|
||||||
|
|
||||||
set incsearch " Find the next match as we type the search
|
|
||||||
set hlsearch " Highlight searches by default
|
|
||||||
set ignorecase " Ignore case when searching...
|
|
||||||
set smartcase " ...unless we type a capital
|
|
||||||
|
|
||||||
" ================ Security ==========================
|
|
||||||
set modelines=0
|
|
||||||
set nomodeline
|
|
||||||
|
|
||||||
" ================ Custom Settings ========================
|
|
||||||
so ~/.yadr/vim/settings.vim
|
|
||||||
+3
-15
@@ -13,9 +13,6 @@ elif [[ $unamestr == 'Darwin' ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# YADR support
|
# YADR support
|
||||||
alias yav='yadr vim-add-plugin'
|
|
||||||
alias ydv='yadr vim-delete-plugin'
|
|
||||||
alias ylv='yadr vim-list-plugin'
|
|
||||||
alias yup='yadr update-plugins'
|
alias yup='yadr update-plugins'
|
||||||
alias yip='yadr init-plugins'
|
alias yip='yadr init-plugins'
|
||||||
|
|
||||||
@@ -48,25 +45,16 @@ TRAPHUP() {
|
|||||||
source $yadr/zsh/aliases.zsh
|
source $yadr/zsh/aliases.zsh
|
||||||
}
|
}
|
||||||
|
|
||||||
alias ae='vim $yadr/zsh/aliases.zsh' #alias edit
|
alias ae='nano $yadr/zsh/aliases.zsh' #alias edit
|
||||||
alias ar='source $yadr/zsh/aliases.zsh' #alias reload
|
alias ar='source $yadr/zsh/aliases.zsh' #alias reload
|
||||||
alias gar="killall -HUP -u \"$USER\" zsh" #global alias reload
|
alias gar="killall -HUP -u \"$USER\" zsh" #global alias reload
|
||||||
|
|
||||||
# vim using
|
|
||||||
mvim --version > /dev/null 2>&1
|
|
||||||
MACVIM_INSTALLED=$?
|
|
||||||
if [ $MACVIM_INSTALLED -eq 0 ]; then
|
|
||||||
alias vim="mvim -v"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# mimic vim functions
|
|
||||||
alias :q='exit'
|
alias :q='exit'
|
||||||
|
|
||||||
# vimrc editing
|
|
||||||
alias ve='vim ~/.vimrc'
|
|
||||||
|
|
||||||
# zsh profile editing
|
# zsh profile editing
|
||||||
alias ze='vim ~/.zshrc'
|
alias ze='nano ~/.zshrc'
|
||||||
|
|
||||||
# Git Aliases
|
# Git Aliases
|
||||||
alias gs='git status'
|
alias gs='git status'
|
||||||
@@ -77,7 +65,7 @@ alias gsa='git stash apply'
|
|||||||
alias gsh='git show'
|
alias gsh='git show'
|
||||||
alias gshw='git show'
|
alias gshw='git show'
|
||||||
alias gshow='git show'
|
alias gshow='git show'
|
||||||
alias gi='vim .gitignore'
|
alias gi='nano .gitignore'
|
||||||
alias gcm='git ci -m'
|
alias gcm='git ci -m'
|
||||||
alias gcim='git ci -m'
|
alias gcim='git ci -m'
|
||||||
alias gci='git ci'
|
alias gci='git ci'
|
||||||
|
|||||||
@@ -2,3 +2,18 @@ source $HOME/.zprezto/runcoms/zshrc
|
|||||||
|
|
||||||
for config_file ($HOME/.yadr/zsh/*.zsh) source $config_file
|
for config_file ($HOME/.yadr/zsh/*.zsh) source $config_file
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
|
|
||||||
|
# bun completions
|
||||||
|
[ -s "/home/dissimulo/.bun/_bun" ] && source "/home/dissimulo/.bun/_bun"
|
||||||
|
|
||||||
|
# bun
|
||||||
|
export BUN_INSTALL="$HOME/.bun"
|
||||||
|
export PATH="$BUN_INSTALL/bin:$PATH"
|
||||||
|
|
||||||
|
# pnpm
|
||||||
|
export PNPM_HOME="/home/dissimulo/.local/share/pnpm"
|
||||||
|
case ":$PATH:" in
|
||||||
|
*":$PNPM_HOME/bin:"*) ;;
|
||||||
|
*) export PATH="$PNPM_HOME/bin:$PATH" ;;
|
||||||
|
esac
|
||||||
|
# pnpm end
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
set -o vi
|
set -o vi
|
||||||
export EDITOR=vim
|
export EDITOR=nano
|
||||||
export VISUAL=vim
|
export VISUAL=nano
|
||||||
|
|||||||
Reference in New Issue
Block a user