Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add the updatebundles.rb script

  • Loading branch information...
commit 43fa676c6bc06fb28721d47708912a537407554c 1 parent 65fc7f2
David North authored January 12, 2012

Showing 2 changed files with 149 additions and 23 deletions. Show diff stats Hide diff stats

  1. 125  my_vimrc
  2. 47  updatebundles.rb
125  my_vimrc
@@ -9,10 +9,15 @@ syntax on
9 9
 filetype plugin on
10 10
 filetype indent on
11 11
 
  12
+" Change map leader and reduce timeout to make "," still usable
  13
+let mapleader = ","
  14
+set timeoutlen=500
  15
+
12 16
 " Vim Behaviour
13 17
 set hidden
14 18
 set autoread
15 19
 set wildmenu
  20
+set vb
16 21
 
17 22
 " Tabs/indenting
18 23
 set bs=indent,eol,start
@@ -21,22 +26,33 @@ set autoindent
21 26
 set smartindent
22 27
 set expandtab
23 28
 
  29
+map <Tab> >>
  30
+map <S-Tab> v<gv<ESC>0I<ESC>l
  31
+imap <S-Tab> <ESC>v<gv<ESC>0I
  32
+vnoremap <Tab> >gv
  33
+vnoremap <S-Tab> <gv
  34
+
  35
+
24 36
 " appearance
  37
+set columns=300
25 38
 colorscheme molokai
  39
+" or pyte , molokai , autumn , dante
26 40
 set go-=T
27 41
 set ruler
28 42
 set cursorline
29 43
 set number
30 44
 set nowrap
31  
-set guioptions=aAce
  45
+set guioptions=ce
32 46
 set guifont=Bitstream\ Vera\ Sans\ Mono:h12
33  
-set columns=300
  47
+set laststatus=2 statusline=%02n:\ %<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P
34 48
 
35 49
 " searching
36 50
 set incsearch
37 51
 set ignorecase
38 52
 set hlsearch
39 53
 
  54
+
  55
+
40 56
 " Grep with Ack
41 57
 set grepprg=ack
42 58
 command! -nargs=1 Ack grep --column <args>
@@ -61,8 +77,6 @@ imap <C-K> <esc>Da
61 77
 " Normal Mode Mappings
62 78
 "
63 79
 "
64  
-" insert a line break at cursor position in normal mode
65  
-nmap <C-b> i<Return><esc>
66 80
 
67 81
 " Make Y behave like D,C etc.
68 82
 nnoremap Y y$
@@ -83,14 +97,16 @@ au! BufWritePre * CleanUpWhitespace
83 97
 
84 98
 command! TidyHtml %!tidy -iq
85 99
 
86  
-command! BallClose bufdo Bclose!
  100
+command! Bcloseall bufdo Bclose!
  101
+
  102
+
87 103
 
88 104
 " autocmd FileType ruby set omnifunc=rubycomplete#Complete
89 105
 
90 106
 "
91 107
 " Plugin settings
92 108
 "
93  
-let g:xptemplate_key = '<D-k>'
  109
+" let g:xptemplate_key = '<D-k>'
94 110
 let g:xptemplate_brace_complete = '0'
95 111
 
96 112
 
@@ -103,33 +119,96 @@ omap al :normal val<CR>
103 119
 autocmd FileType eruby let b:surround_114 = "<%= \r %>"
104 120
 
105 121
 
106  
-map <Leader>nt :NERDTreeToggle<CR>
  122
+map <Leader>nt :NERDTree<CR>
  123
+map <Leader>ntc :NERDTreeClose<CR>
  124
+
  125
+map <Leader>cc :CoffeeCompile<CR>
  126
+
  127
+" Move current line to the bottom of the file and return to current position
  128
+map <Leader>mb :m$<CR>'.
  129
+" Move current line to top
  130
+map <Leader>mt :m0<CR>
  131
+
107 132
 
108 133
 " Faster window resizing
109 134
 nnoremap <C-w>< <C-w>10<
110 135
 nnoremap <C-w>> <C-w>10>
111 136
 
112  
-let Tlist_Ctags_Cmd="/usr/local/bin/ctags"
113 137
 
114  
-nnoremap <Leader>j <C-j>
  138
+" nnoremap <Leader>j <C-j>
115 139
 
  140
+" TagList
  141
+let Tlist_Ctags_Cmd="/usr/local/bin/ctags"
116 142
 let Tlist_Show_One_File = 1
117  
-
118  
-
119 143
 let Tlist_Use_Right_Window = 1
120 144
 let Tlist_Enable_Fold_Column = 0
121 145
 let Tlist_WinWidth = 35
  146
+nnoremap <Leader>tl :TlistToggle<CR>
  147
+
  148
+
  149
+" Editing .vimrc
  150
+nnoremap <Leader>ve :e ~/.vimrc<CR>
  151
+nnoremap <Leader>vs :so ~/.vimrc<CR>
  152
+
  153
+" FuzzyFinder
  154
+nnoremap <Leader>ft :FufTag<CR>
  155
+nnoremap <Leader>fb :FufBuffer<CR>
  156
+
  157
+" Command-t
  158
+let g:CommandTMaxHeight=10
  159
+let g:CommandTMatchWindowAtTop=1
  160
+nmap <silent> <leader>tt :CommandT<CR>
  161
+
  162
+" Yankring
  163
+nnoremap <Leader>ys :YRShow<CR>
  164
+
  165
+" Visuall, select the text that was last edited/pasted
  166
+nmap gV `[v`]
  167
+
  168
+" Edit a file in the same directory as the current window's file
  169
+map <leader>ew :e <C-R>=expand("%:p:h") . "/" <CR>
  170
+
  171
+" autocmd InsertEnter * hi CursorLine guibg=#222233
  172
+" autocmd InsertLeave * hi CursorLine guibg=#2E2D22
  173
+
  174
+" nnoremap <Space> /
  175
+nnoremap <Space> i<Space><esc>r
  176
+nnoremap <S-Space> a<Space><esc>r
  177
+
  178
+" Always use 'q' for macro register so make replaying easier
  179
+nnoremap Q @q
  180
+
  181
+" Maintain selection when shifting text left or right
  182
+vnoremap > >gv
  183
+vnoremap < <gv
  184
+
  185
+" Delete empty lines in selection
  186
+vnoremap <leader>de :v/./d<Cr>:noh<Cr>
  187
+
  188
+
  189
+" Single spaces (delete doubles not including indent)
  190
+nnoremap <leader>ss :s/\([^ ]\) \+/\1 /g<Cr>:noh<Cr>
  191
+vnoremap <leader>ss :s/\([^ ]\) \+/\1 /g<Cr>:noh<Cr>
  192
+
  193
+
  194
+
  195
+" Buffers
  196
+nnoremap <Leader>bc :Bclose!<Cr>
  197
+
  198
+
  199
+" au BufWritePost *.coffee silent CoffeeMake!
  200
+"
  201
+"
  202
+" [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
  203
+
  204
+
  205
+nmap <leader>tw :ToggleWord<CR>
  206
+
  207
+
  208
+" Should speed up autocomplete a lot for some projects
  209
+" http://stackoverflow.com/questions/2169645/vims-autocomplete-is-excruciatingly-slow
  210
+set complete-=i
  211
+
122 212
 
123  
-" allow command line editing like emacs
124  
-cnoremap <C-A>      <Home>
125  
-cnoremap <C-B>      <Left>
126  
-cnoremap <C-E>      <End>
127  
-cnoremap <C-F>      <Right>
128  
-cnoremap <C-N>      <End>
129  
-cnoremap <C-P>      <Up>
130  
-cnoremap <ESC>b     <S-Left>
131  
-cnoremap <ESC><C-B> <S-Left>
132  
-cnoremap <ESC>f     <S-Right>
133  
-cnoremap <ESC><C-F> <S-Right>
134  
-cnoremap <ESC><C-H> <C-W>
135 213
 
  214
+command! FormatXML silent! 1,$!xmllint --format --recover - 2>/dev/null
47  updatebundles.rb
... ...
@@ -0,0 +1,47 @@
  1
+#!/usr/bin/env ruby
  2
+require 'fileutils'
  3
+require 'open-uri'
  4
+
  5
+git_bundles = [
  6
+  "git://github.com/scrooloose/nerdtree.git",
  7
+  "git://github.com/tpope/vim-cucumber.git",
  8
+  "git://github.com/tpope/vim-fugitive.git",
  9
+  "git://github.com/tpope/vim-repeat.git",
  10
+  "git://github.com/tpope/vim-surround.git",
  11
+  "git://github.com/tpope/vim-endwise.git",
  12
+  "git://github.com/tsaleh/vim-align.git",
  13
+  "git://github.com/tsaleh/vim-tcomment.git",
  14
+  "git://github.com/vim-ruby/vim-ruby.git",
  15
+  "git://git.wincent.com/command-t.git",
  16
+  "git://github.com/davidnorth/vim-motion-helpers.git",
  17
+  "git://github.com/vim-scripts/toggle_words.vim.git"
  18
+]
  19
+
  20
+vim_org_scripts = [
  21
+  ["matchit", "39", "plugin"]
  22
+]
  23
+
  24
+
  25
+bundles_dir = File.join(File.dirname(__FILE__), "bundle")
  26
+
  27
+FileUtils.cd(bundles_dir)
  28
+
  29
+#puts "Trashing everything (lookout!)"
  30
+#Dir["*"].each {|d| FileUtils.rm_rf d }
  31
+
  32
+git_bundles.each do |url|
  33
+  dir = url.split('/').last.sub(/\.git$/, '')
  34
+  puts "  Unpacking #{url} into #{dir}"
  35
+  `git clone #{url} #{dir}`
  36
+  FileUtils.rm_rf(File.join(dir, ".git"))
  37
+end
  38
+
  39
+vim_org_scripts.each do |name, script_id, script_type|
  40
+  puts "  Downloading #{name}"
  41
+  local_file = File.join(name, script_type, "#{name}.vim")
  42
+  FileUtils.mkdir_p(File.dirname(local_file))
  43
+  File.open(local_file, "w") do |file|
  44
+    file << open("http://www.vim.org/scripts/download_script.php?src_id=#{script_id}").read
  45
+  end
  46
+end
  47
+

0 notes on commit 43fa676

Please sign in to comment.
Something went wrong with that request. Please try again.