Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove vim config and just instruct the user to run the Janus install…

…. (TODO: Run it yourownself) Backup existing vim configs.
  • Loading branch information...
commit 1105b2d5aaa8b992d3dbdcf255f502873a843b6f 1 parent 46b4dd7
@copyhacker authored
Showing with 11 additions and 415 deletions.
  1. +11 −1 Rakefile
  2. +0 −240 dot.gvimrc
  3. +0 −1  dot.vim
  4. +0 −157 dot.vimrc
  5. +0 −16 lib/dotrot.rb
View
12 Rakefile
@@ -2,7 +2,8 @@ DOTROT_HOME = File.dirname(__FILE__)
DOTROT_BACKUPS = File.join(DOTROT_HOME, 'backups')
# TODO: Move to yaml or somesuch
-DOTROT_FILES = %w{ bash_profile profile screenrc vim vimrc gvimrc boom gitconfig git-prompt.conf git-prompt.sh }
+DOTROT_FILES = %w{ bash_profile profile screenrc boom gitconfig git-prompt.conf git-prompt.sh }
+EXTRA_DOTFILES_TO_BACKUP = %w{ vim vimrc gvimrc }
require "#{DOTROT_HOME}/lib/dotrot"
@@ -10,10 +11,19 @@ task :default => [:install]
desc "Install dotfiles"
task :install do
+ puts "Backing up extra files."
+ EXTRA_DOTFILES_TO_BACKUP.each do |target|
+ puts "** backing up #{name}..."
+ backup_dotfile(File.join(ENV['HOME'], ".#{name}"))
+ end
+
DOTROT_FILES.each do |source|
symlink_dotfile source
end
+ puts "Next steps:"
+ puts "Install vim config:"
+ puts "curl https://raw.github.com/carlhuda/janus/master/bootstrap.sh -o - | sh"
puts "Now run this command to reload the shell:\n\n"
puts " cd ~ && source .bash_profile\n\n"
end
View
240 dot.gvimrc
@@ -1,240 +0,0 @@
-" Include user's local pre .gvimrc config
-if filereadable(expand("~/.gvimrc.pre"))
- source ~/.gvimrc.pre
-endif
-
-if has("gui_macvim")
- " Fullscreen takes up entire screen
- set fuoptions=maxhorz,maxvert
-
- " Command-T for CommandT
- macmenu &File.New\ Tab key=<D-T>
- map <D-t> :CommandT<CR>
- imap <D-t> <Esc>:CommandT<CR>
-
- " Command-Return for fullscreen
- macmenu Window.Toggle\ Full\ Screen\ Mode key=<D-CR>
-
- " Command-Shift-F for Ack
- map <D-F> :Ack<space>
-
- " Command-e for ConqueTerm
- map <D-e> :call StartTerm()<CR>
-
- " Command-/ to toggle comments
- map <D-/> <plug>NERDCommenterToggle<CR>
- imap <D-/> <Esc><plug>NERDCommenterToggle<CR>i
-
-
- " Command-][ to increase/decrease indentation
- vmap <D-]> >gv
- vmap <D-[> <gv
-
- " Map Command-# to switch tabs
- map <D-0> 0gt
- imap <D-0> <Esc>0gt
- map <D-1> 1gt
- imap <D-1> <Esc>1gt
- map <D-2> 2gt
- imap <D-2> <Esc>2gt
- map <D-3> 3gt
- imap <D-3> <Esc>3gt
- map <D-4> 4gt
- imap <D-4> <Esc>4gt
- map <D-5> 5gt
- imap <D-5> <Esc>5gt
- map <D-6> 6gt
- imap <D-6> <Esc>6gt
- map <D-7> 7gt
- imap <D-7> <Esc>7gt
- map <D-8> 8gt
- imap <D-8> <Esc>8gt
- map <D-9> 9gt
- imap <D-9> <Esc>9gt
-
- " Command-Option-ArrowKey to switch viewports
- map <D-M-Up> <C-w>k
- imap <D-M-Up> <Esc> <C-w>k
- map <D-M-Down> <C-w>j
- imap <D-M-Down> <Esc> <C-w>j
- map <D-M-Right> <C-w>l
- imap <D-M-Right> <Esc> <C-w>l
- map <D-M-Left> <C-w>h
- imap <D-M-Left> <C-w>h
-
- " Adjust viewports to the same size
- map <Leader>= <C-w>=
- imap <Leader>= <Esc> <C-w>=
-endif
-
-" Don't beep
-set visualbell
-
-" Start without the toolbar
-set guioptions-=T
-
-" Default gui color scheme
-color ir_black
-
-" ConqueTerm wrapper
-function StartTerm()
- execute 'ConqueTerm ' . $SHELL . ' --login'
- setlocal listchars=tab:\ \
-endfunction
-
-" Project Tree
-if exists("loaded_nerd_tree")
- autocmd VimEnter * call s:CdIfDirectory(expand("<amatch>"))
- autocmd FocusGained * call s:UpdateNERDTree()
- autocmd WinEnter * call s:CloseIfOnlyNerdTreeLeft()
-endif
-
-" Close all open buffers on entering a window if the only
-" buffer that's left is the NERDTree buffer
-function s:CloseIfOnlyNerdTreeLeft()
- if exists("t:NERDTreeBufName")
- if bufwinnr(t:NERDTreeBufName) != -1
- if winnr("$") == 1
- q
- endif
- endif
- endif
-endfunction
-
-" If the parameter is a directory, cd into it
-function s:CdIfDirectory(directory)
- let explicitDirectory = isdirectory(a:directory)
- let directory = explicitDirectory || empty(a:directory)
-
- if explicitDirectory
- exe "cd " . fnameescape(a:directory)
- endif
-
- " Allows reading from stdin
- " ex: git diff | mvim -R -
- if strlen(a:directory) == 0
- return
- endif
-
- if directory
- NERDTree
- wincmd p
- bd
- endif
-
- if explicitDirectory
- wincmd p
- endif
-endfunction
-
-" NERDTree utility function
-function s:UpdateNERDTree(...)
- let stay = 0
-
- if(exists("a:1"))
- let stay = a:1
- end
-
- if exists("t:NERDTreeBufName")
- let nr = bufwinnr(t:NERDTreeBufName)
- if nr != -1
- exe nr . "wincmd w"
- exe substitute(mapcheck("R"), "<CR>", "", "")
- if !stay
- wincmd p
- end
- endif
- endif
-
- if exists(":CommandTFlush") == 2
- CommandTFlush
- endif
-endfunction
-
-" Utility functions to create file commands
-function s:CommandCabbr(abbreviation, expansion)
- execute 'cabbrev ' . a:abbreviation . ' <c-r>=getcmdpos() == 1 && getcmdtype() == ":" ? "' . a:expansion . '" : "' . a:abbreviation . '"<CR>'
-endfunction
-
-function s:FileCommand(name, ...)
- if exists("a:1")
- let funcname = a:1
- else
- let funcname = a:name
- endif
-
- execute 'command -nargs=1 -complete=file ' . a:name . ' :call ' . funcname . '(<f-args>)'
-endfunction
-
-function s:DefineCommand(name, destination)
- call s:FileCommand(a:destination)
- call s:CommandCabbr(a:name, a:destination)
-endfunction
-
-" Public NERDTree-aware versions of builtin functions
-function ChangeDirectory(dir, ...)
- execute "cd " . fnameescape(a:dir)
- let stay = exists("a:1") ? a:1 : 1
-
- NERDTree
-
- if !stay
- wincmd p
- endif
-endfunction
-
-function Touch(file)
- execute "!touch " . shellescape(a:file, 1)
- call s:UpdateNERDTree()
-endfunction
-
-function Remove(file)
- let current_path = expand("%")
- let removed_path = fnamemodify(a:file, ":p")
-
- if (current_path == removed_path) && (getbufvar("%", "&modified"))
- echo "You are trying to remove the file you are editing. Please close the buffer first."
- else
- execute "!rm " . shellescape(a:file, 1)
- endif
-
- call s:UpdateNERDTree()
-endfunction
-
-function Mkdir(file)
- execute "!mkdir " . shellescape(a:file, 1)
- call s:UpdateNERDTree()
-endfunction
-
-function Edit(file)
- if exists("b:NERDTreeRoot")
- wincmd p
- endif
-
- execute "e " . fnameescape(a:file)
-
-ruby << RUBY
- destination = File.expand_path(VIM.evaluate(%{system("dirname " . shellescape(a:file, 1))}))
- pwd = File.expand_path(Dir.pwd)
- home = pwd == File.expand_path("~")
-
- if home || Regexp.new("^" + Regexp.escape(pwd)) !~ destination
- VIM.command(%{call ChangeDirectory(fnamemodify(a:file, ":h"), 0)})
- end
-RUBY
-endfunction
-
-" Define the NERDTree-aware aliases
-if exists("loaded_nerd_tree")
- call s:DefineCommand("cd", "ChangeDirectory")
- call s:DefineCommand("touch", "Touch")
- call s:DefineCommand("rm", "Remove")
- call s:DefineCommand("e", "Edit")
- call s:DefineCommand("mkdir", "Mkdir")
- cabbrev Edit! e!
-endif
-
-" Include user's local vim config
-if filereadable(expand("~/.gvimrc.local"))
- source ~/.gvimrc.local
-endif
1  dot.vim
@@ -1 +0,0 @@
-Subproject commit e306ebac0ede09034a8227e31703ebcd04875741
View
157 dot.vimrc
@@ -1,157 +0,0 @@
-" Include user's local pre .vimrc config
-if filereadable(expand("~/.vimrc.pre"))
- source ~/.vimrc.pre
-endif
-
-set nocompatible
-
-set number
-set ruler
-syntax on
-
-" Set encoding
-set encoding=utf-8
-
-" Whitespace stuff
-set nowrap
-set tabstop=2
-set shiftwidth=2
-set softtabstop=2
-set expandtab
-set list listchars=tab:\ \ ,trail:·
-
-" Searching
-set hlsearch
-set incsearch
-set ignorecase
-set smartcase
-
-" Tab completion
-set wildmode=list:longest,list:full
-set wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/*
-
-" Status bar
-set laststatus=2
-
-" Without setting this, ZoomWin restores windows in a way that causes
-" equalalways behavior to be triggered the next time CommandT is used.
-" This is likely a bludgeon to solve some other issue, but it works
-set noequalalways
-
-" NERDTree configuration
-let NERDTreeIgnore=['\.pyc$', '\.rbc$', '\~$']
-map <Leader>n :NERDTreeToggle<CR>
-
-" Command-T configuration
-let g:CommandTMaxHeight=20
-
-" ZoomWin configuration
-map <Leader><Leader> :ZoomWin<CR>
-
-" CTags
-map <Leader>rt :!ctags --extra=+f -R *<CR><CR>
-map <C-\> :tnext<CR>
-
-" Gundo configuration
-nmap <F5> :GundoToggle<CR>
-imap <F5> <ESC>:GundoToggle<CR>
-
-" Remember last location in file
-if has("autocmd")
- au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
- \| exe "normal g'\"" | endif
-endif
-
-function s:setupWrapping()
- set wrap
- set wrapmargin=2
- set textwidth=72
-endfunction
-
-function s:setupMarkup()
- call s:setupWrapping()
- map <buffer> <Leader>p :Hammer<CR>
-endfunction
-
-" Thorfile, Rakefile, Vagrantfile and Gemfile are Ruby
-au BufRead,BufNewFile {Gemfile,Rakefile,Vagrantfile,Thorfile,config.ru} set ft=ruby
-
-" md, markdown, and mk are markdown and define buffer-local preview
-au BufRead,BufNewFile *.{md,markdown,mdown,mkd,mkdn} call s:setupMarkup()
-
-" add json syntax highlighting
-au BufNewFile,BufRead *.json set ft=javascript
-
-au BufRead,BufNewFile *.txt call s:setupWrapping()
-
-" allow backspacing over everything in insert mode
-set backspace=indent,eol,start
-
-" load the plugin and indent settings for the detected filetype
-filetype plugin indent on
-
-" Opens an edit command with the path of the currently edited file filled in
-" Normal mode: <Leader>e
-map <Leader>e :e <C-R>=expand("%:p:h") . "/" <CR>
-
-" Opens a tab edit command with the path of the currently edited file filled in
-" Normal mode: <Leader>t
-map <Leader>te :tabe <C-R>=expand("%:p:h") . "/" <CR>
-
-" Inserts the path of the currently edited file into a command
-" Command mode: Ctrl+P
-cmap <C-P> <C-R>=expand("%:p:h") . "/" <CR>
-
-" Unimpaired configuration
-" Bubble single lines
-nmap <C-Up> [e
-nmap <C-Down> ]e
-" Bubble multiple lines
-vmap <C-Up> [egv
-vmap <C-Down> ]egv
-
-" Enable syntastic syntax checking
-let g:syntastic_enable_signs=1
-let g:syntastic_quiet_warnings=1
-
-" gist-vim defaults
-if has("mac")
- let g:gist_clip_command = 'pbcopy'
-elseif has("unix")
- let g:gist_clip_command = 'xclip -selection clipboard'
-endif
-let g:gist_detect_filetype = 1
-let g:gist_open_browser_after_post = 1
-
-" Use modeline overrides
-set modeline
-set modelines=10
-
-" Default color scheme
-color desert
-
-" Directories for swp files
-set backupdir=~/.vim/backup
-set directory=~/.vim/backup
-
-" Turn off jslint errors by default
-let g:JSLintHighlightErrorLine = 0
-
-" MacVIM shift+arrow-keys behavior (required in .vimrc)
-let macvim_hig_shift_movement = 1
-
-" % to bounce from do to end etc.
-runtime! macros/matchit.vim
-
-" Show (partial) command in the status line
-set showcmd
-
-if has("gui_running")
- " Automatically resize splits when resizing MacVim window
- autocmd VimResized * wincmd =
-endif
-
-" Include user's local vim config
-if filereadable(expand("~/.vimrc.local"))
- source ~/.vimrc.local
-endif
View
16 lib/dotrot.rb
@@ -1,19 +1,3 @@
-class KeyBindingsInstaller
- PATH = File.join(ENV['HOME'], *%W[Library KeyBindings DefaultKeyBinding.dict])
-
- def self.install!
- return if File.exist?(PATH)
- puts '** Installing KeyBindings'
- puts ' * Creating ~/Library/KeyBindings directory'
- FileUtils.mkdir_p(File.dirname(PATH))
- puts ' * Linking file...'
- FileUtils.ln_s \
- source = File.join(DOTROT_HOME, 'nakajima', 'DefaultKeyBinding.dict'),
- target = PATH
- puts ' * done!'
- end
-end
-
def symlink_dotfile(name, dry_run = false)
source = File.join(DOTROT_HOME, "dot.#{name}")
target = File.join(ENV['HOME'], ".#{name}")
Please sign in to comment.
Something went wrong with that request. Please try again.