Permalink
Browse files

Add the updatebundles.rb script

  • Loading branch information...
1 parent 65fc7f2 commit 43fa676c6bc06fb28721d47708912a537407554c @davidnorth committed Jan 12, 2012
Showing with 149 additions and 23 deletions.
  1. +102 −23 my_vimrc
  2. +47 −0 updatebundles.rb
View
125 my_vimrc
@@ -9,10 +9,15 @@ syntax on
filetype plugin on
filetype indent on
+" Change map leader and reduce timeout to make "," still usable
+let mapleader = ","
+set timeoutlen=500
+
" Vim Behaviour
set hidden
set autoread
set wildmenu
+set vb
" Tabs/indenting
set bs=indent,eol,start
@@ -21,22 +26,33 @@ set autoindent
set smartindent
set expandtab
+map <Tab> >>
+map <S-Tab> v<gv<ESC>0I<ESC>l
+imap <S-Tab> <ESC>v<gv<ESC>0I
+vnoremap <Tab> >gv
+vnoremap <S-Tab> <gv
+
+
" appearance
+set columns=300
colorscheme molokai
+" or pyte , molokai , autumn , dante
set go-=T
set ruler
set cursorline
set number
set nowrap
-set guioptions=aAce
+set guioptions=ce
set guifont=Bitstream\ Vera\ Sans\ Mono:h12
-set columns=300
+set laststatus=2 statusline=%02n:\ %<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P
" searching
set incsearch
set ignorecase
set hlsearch
+
+
" Grep with Ack
set grepprg=ack
command! -nargs=1 Ack grep --column <args>
@@ -61,8 +77,6 @@ imap <C-K> <esc>Da
" Normal Mode Mappings
"
"
-" insert a line break at cursor position in normal mode
-nmap <C-b> i<Return><esc>
" Make Y behave like D,C etc.
nnoremap Y y$
@@ -83,14 +97,16 @@ au! BufWritePre * CleanUpWhitespace
command! TidyHtml %!tidy -iq
-command! BallClose bufdo Bclose!
+command! Bcloseall bufdo Bclose!
+
+
" autocmd FileType ruby set omnifunc=rubycomplete#Complete
"
" Plugin settings
"
-let g:xptemplate_key = '<D-k>'
+" let g:xptemplate_key = '<D-k>'
let g:xptemplate_brace_complete = '0'
@@ -103,33 +119,96 @@ omap al :normal val<CR>
autocmd FileType eruby let b:surround_114 = "<%= \r %>"
-map <Leader>nt :NERDTreeToggle<CR>
+map <Leader>nt :NERDTree<CR>
+map <Leader>ntc :NERDTreeClose<CR>
+
+map <Leader>cc :CoffeeCompile<CR>
+
+" Move current line to the bottom of the file and return to current position
+map <Leader>mb :m$<CR>'.
+" Move current line to top
+map <Leader>mt :m0<CR>
+
" Faster window resizing
nnoremap <C-w>< <C-w>10<
nnoremap <C-w>> <C-w>10>
-let Tlist_Ctags_Cmd="/usr/local/bin/ctags"
-nnoremap <Leader>j <C-j>
+" nnoremap <Leader>j <C-j>
+" TagList
+let Tlist_Ctags_Cmd="/usr/local/bin/ctags"
let Tlist_Show_One_File = 1
-
-
let Tlist_Use_Right_Window = 1
let Tlist_Enable_Fold_Column = 0
let Tlist_WinWidth = 35
+nnoremap <Leader>tl :TlistToggle<CR>
+
+
+" Editing .vimrc
+nnoremap <Leader>ve :e ~/.vimrc<CR>
+nnoremap <Leader>vs :so ~/.vimrc<CR>
+
+" FuzzyFinder
+nnoremap <Leader>ft :FufTag<CR>
+nnoremap <Leader>fb :FufBuffer<CR>
+
+" Command-t
+let g:CommandTMaxHeight=10
+let g:CommandTMatchWindowAtTop=1
+nmap <silent> <leader>tt :CommandT<CR>
+
+" Yankring
+nnoremap <Leader>ys :YRShow<CR>
+
+" Visuall, select the text that was last edited/pasted
+nmap gV `[v`]
+
+" Edit a file in the same directory as the current window's file
+map <leader>ew :e <C-R>=expand("%:p:h") . "/" <CR>
+
+" autocmd InsertEnter * hi CursorLine guibg=#222233
+" autocmd InsertLeave * hi CursorLine guibg=#2E2D22
+
+" nnoremap <Space> /
+nnoremap <Space> i<Space><esc>r
+nnoremap <S-Space> a<Space><esc>r
+
+" Always use 'q' for macro register so make replaying easier
+nnoremap Q @q
+
+" Maintain selection when shifting text left or right
+vnoremap > >gv
+vnoremap < <gv
+
+" Delete empty lines in selection
+vnoremap <leader>de :v/./d<Cr>:noh<Cr>
+
+
+" Single spaces (delete doubles not including indent)
+nnoremap <leader>ss :s/\([^ ]\) \+/\1 /g<Cr>:noh<Cr>
+vnoremap <leader>ss :s/\([^ ]\) \+/\1 /g<Cr>:noh<Cr>
+
+
+
+" Buffers
+nnoremap <Leader>bc :Bclose!<Cr>
+
+
+" au BufWritePost *.coffee silent CoffeeMake!
+"
+"
+" [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
+
+
+nmap <leader>tw :ToggleWord<CR>
+
+
+" Should speed up autocomplete a lot for some projects
+" http://stackoverflow.com/questions/2169645/vims-autocomplete-is-excruciatingly-slow
+set complete-=i
+
-" allow command line editing like emacs
-cnoremap <C-A> <Home>
-cnoremap <C-B> <Left>
-cnoremap <C-E> <End>
-cnoremap <C-F> <Right>
-cnoremap <C-N> <End>
-cnoremap <C-P> <Up>
-cnoremap <ESC>b <S-Left>
-cnoremap <ESC><C-B> <S-Left>
-cnoremap <ESC>f <S-Right>
-cnoremap <ESC><C-F> <S-Right>
-cnoremap <ESC><C-H> <C-W>
+command! FormatXML silent! 1,$!xmllint --format --recover - 2>/dev/null
View
@@ -0,0 +1,47 @@
+#!/usr/bin/env ruby
+require 'fileutils'
+require 'open-uri'
+
+git_bundles = [
+ "git://github.com/scrooloose/nerdtree.git",
+ "git://github.com/tpope/vim-cucumber.git",
+ "git://github.com/tpope/vim-fugitive.git",
+ "git://github.com/tpope/vim-repeat.git",
+ "git://github.com/tpope/vim-surround.git",
+ "git://github.com/tpope/vim-endwise.git",
+ "git://github.com/tsaleh/vim-align.git",
+ "git://github.com/tsaleh/vim-tcomment.git",
+ "git://github.com/vim-ruby/vim-ruby.git",
+ "git://git.wincent.com/command-t.git",
+ "git://github.com/davidnorth/vim-motion-helpers.git",
+ "git://github.com/vim-scripts/toggle_words.vim.git"
+]
+
+vim_org_scripts = [
+ ["matchit", "39", "plugin"]
+]
+
+
+bundles_dir = File.join(File.dirname(__FILE__), "bundle")
+
+FileUtils.cd(bundles_dir)
+
+#puts "Trashing everything (lookout!)"
+#Dir["*"].each {|d| FileUtils.rm_rf d }
+
+git_bundles.each do |url|
+ dir = url.split('/').last.sub(/\.git$/, '')
+ puts " Unpacking #{url} into #{dir}"
+ `git clone #{url} #{dir}`
+ FileUtils.rm_rf(File.join(dir, ".git"))
+end
+
+vim_org_scripts.each do |name, script_id, script_type|
+ puts " Downloading #{name}"
+ local_file = File.join(name, script_type, "#{name}.vim")
+ FileUtils.mkdir_p(File.dirname(local_file))
+ File.open(local_file, "w") do |file|
+ file << open("http://www.vim.org/scripts/download_script.php?src_id=#{script_id}").read
+ end
+end
+

0 comments on commit 43fa676

Please sign in to comment.