vundle_migrator 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a1bf5f73fb83673db5941c4af32aa489771f5ddc
4
- data.tar.gz: ee00a9f5b48382aaf365e484796792aa74a909f7
3
+ metadata.gz: 97f213f9b84a1cf537eb2d86dcd464dcf68ff4ea
4
+ data.tar.gz: 8fa19ccbf28008ab3a60fa85f351718733138358
5
5
  SHA512:
6
- metadata.gz: 4211c09595dbff9a83d3a1befae2e85ca3e951f5479e2239ea377c8b9d14378d0e9c336eee0b5d4c39aad5a1f130a08ff3d383f4fe19c780aef450b7d4a5de54
7
- data.tar.gz: 1dc232eaa2f0d5b333d01253565a1bc64f2fb930bd5d9303ed36f6aa9e8b42a23a94046d5474bbfc4340042a7338fbf3b482f88ddbe67ecfba07c885bde7452a
6
+ metadata.gz: 79cad8a81638031235fb972a9fee632b63291dfcea59ac9f4f43855561f0e86aa859ae7f67509f49eb1968f10ec75be02a757de82dda424541b67e74d4dab744
7
+ data.tar.gz: 4ecf60a5a42e2fc50b51ff5a7202a9918266f7f5aa86d3e51152a8a485d780ad9d21bcf25522d6a7c295d0c91e968b006538c67b12668d997d91fdb537eac8b0
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ .dockerignore
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.3.1
data/Dockerfile ADDED
@@ -0,0 +1,17 @@
1
+ FROM ruby:2.3.1
2
+
3
+ RUN apt-get update && apt-get install -y vim
4
+
5
+ RUN mkdir -p /root/.vim/bundle
6
+ RUN git clone https://github.com/scrooloose/nerdtree.git /root/.vim/bundle/nerdtree
7
+ RUN git clone https://github.com/tpope/vim-commentary.git /root/.vim/bundle/vim-commentary
8
+ RUN git clone https://github.com/tpope/vim-unimpaired.git /root/.vim/bundle/vim-unimpaired
9
+ RUN git clone https://github.com/VundleVim/Vundle.vim.git /root/.vim/bundle/Vundle.vim
10
+
11
+ RUN echo 'alias vundle_migrator="/usr/src/app/bin/vundle_migrator -l /root/.vimrc"' >> /root/.bashrc
12
+
13
+ WORKDIR /usr/src/app
14
+ ADD . /usr/src/app
15
+ ADD fixtures/vimrc /root/.vimrc
16
+
17
+ RUN bundle install --local
data/Gemfile CHANGED
@@ -1,4 +1,12 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ ruby '2.3.1'
4
+
3
5
  # Specify your gem's dependencies in vundle_migrator.gemspec
4
6
  gemspec
7
+
8
+ gem 'bundler'
9
+ gem 'fakefs'
10
+ gem 'minitest'
11
+ gem 'rake'
12
+ gem 'slop'
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Vundle Migrator
2
2
 
3
+ [![Circle CI](https://circleci.com/gh/trayo/mv_listr.svg?style=svg)](https://circleci.com/gh/trayo/mv_listr)
4
+ [![Stories in Ready](https://badge.waffle.io/trayo/vundle_migrator.svg?label=ready&title=Ready)](http://waffle.io/trayo/vundle_migrator)
5
+
3
6
  Vundle Migrator is a tool that will migrate your current vim setup to use Vundle. It works by creating a `plugins.vim` that contains a list of your existing plugins from your bundle folder. The list will already be formatted in the vundle format: `Plugin "username/repo"`.
4
7
 
5
8
  ## Installation
data/bin/vundle_migrator CHANGED
@@ -2,8 +2,9 @@
2
2
 
3
3
  $:.unshift File.dirname(__FILE__) + '/../lib'
4
4
  require "slop"
5
- require 'vundle_migrator'
6
- require 'vundle_migrator/version'
5
+ require "fileutils"
6
+ require "vundle_migrator"
7
+ require "vundle_migrator/version"
7
8
 
8
9
  opts = Slop.parse do |o|
9
10
  o.banner = "usage: vundle_migrate vimrc-location [OPTIONS]"
data/fixtures/vimrc ADDED
@@ -0,0 +1,68 @@
1
+ set rtp+=/usr/local/go/misc/vim
2
+ filetype plugin indent on
3
+ syntax on
4
+ syntax enable
5
+
6
+
7
+ "" ========== setup stuff ==========
8
+ set nobackup " no backup files
9
+ set nowritebackup " only in case you don't want a backup file while editing
10
+ set noswapfile " no swap files
11
+ set scrolloff=2 " adds top/bottom buffer between cursor and window
12
+ set cursorline " colours the line the cursor is on
13
+ set number " line numbers
14
+ set clipboard=unnamed " allows y and p to clipboard vim > 7.4
15
+ set complete-=i " ignores included files in autocomplete
16
+ set splitbelow " sets vim splits to default right and bottom
17
+ set splitright
18
+ set hlsearch " highlight matches
19
+ set incsearch " incremental searching
20
+ set nowrap " don't wrap lines
21
+ set tabstop=2 shiftwidth=2 " a tab is two spaces (or set this to 4)
22
+ set expandtab " use spaces, not tabs (optional)
23
+ set backspace=indent,eol,start " backspace through everything in insert mode
24
+ set wildmode=longest:list " better command line completion
25
+ set ignorecase " use case ignore by default
26
+ set laststatus=2 " Always show the statusline
27
+ set t_Co=256 " Explicitly tell vim that the terminal supports 256 colors
28
+ set nocompatible " choose no compatibility with legacy vi
29
+ set encoding=utf-8
30
+ set showcmd " display incomplete commands
31
+
32
+
33
+ " change highlight text colors to black
34
+ highlight Visual ctermfg=7 ctermbg=8
35
+
36
+
37
+ " ========= leader snippets =========
38
+ nmap <Leader>e :NERDTreeToggle<CR>
39
+
40
+
41
+ " ========= easier pane navigation =========
42
+ " make left pane fullscreen
43
+ nnoremap <Leader>] <c-w>l<c-w><BAR>0
44
+ " make right pane fullscreen
45
+ nnoremap <Leader>[ <c-w>h<c-w><BAR>0
46
+ " make panes equal size
47
+ nnoremap <Leader>= <c-w>=
48
+
49
+
50
+ " ========= easier navigation between split windows =========
51
+ nnoremap <c-j> <c-w>j
52
+ nnoremap <c-k> <c-w>k
53
+ nnoremap <c-h> <c-w>h
54
+ nnoremap <c-l> <c-w>l
55
+
56
+
57
+ " ======= command navigation =======
58
+ cnoremap <C-a> <Home>
59
+ cnoremap <C-e> <End>
60
+ cnoremap <C-f> <Right>
61
+ cnoremap <C-b> <Left>
62
+ cnoremap <C-y> <C-r><C-o>"
63
+ cnoremap <C-d> <Right><C-h>
64
+
65
+
66
+ " ========== nerdtree ==========
67
+ " close vim if NERDTree is the only open buffer
68
+ autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
@@ -18,7 +18,7 @@ module VundleMigrator
18
18
  "set rtp+=~/.vim/bundle/Vundle.vim\n\n" \
19
19
  "call vundle#begin()\n\n"
20
20
 
21
- PLUGINS_END = "\n\ncall vundle#end()\n\n" \
21
+ PLUGINS_END = "\ncall vundle#end()\n\n" \
22
22
  "filetype plugin indent on"
23
23
 
24
24
  def initialize(vimrc, source, destination)
@@ -30,10 +30,13 @@ module VundleMigrator
30
30
  end
31
31
 
32
32
  def run
33
+ puts "starting the migration"
33
34
  create_plugins_list
34
35
  create_vundle_folder
35
36
  create_plugins_file
36
37
  prepend_vimrc
38
+ puts "migration finished"
39
+ puts "don't forget to run ':PluginInstall' after loading vim"
37
40
  end
38
41
 
39
42
  def dry_run
@@ -42,6 +45,7 @@ module VundleMigrator
42
45
  end
43
46
 
44
47
  def create_plugins_list
48
+ puts "creating list of plugins"
45
49
  @plugins = @entries.map do |plugin_directory|
46
50
  Dir.chdir("#{@source}/#{plugin_directory}") do
47
51
  package = `git remote -v`.match(/com[\/|:](.+)\.git/)[1]
@@ -51,15 +55,17 @@ module VundleMigrator
51
55
  end
52
56
 
53
57
  def create_vundle_folder
58
+ puts "creating folder at #{File.dirname(@destination)}"
54
59
  FileUtils.mkdir_p(File.dirname(@destination))
55
60
  end
56
61
 
57
62
  def create_plugins_file
63
+ puts "creating #{@destination}"
58
64
  File.open(@destination, "w") do |f|
59
65
  f.write(PLUGINS_START)
60
66
 
61
67
  @plugins.each do |plugin|
62
- f.write(plugin)
68
+ f.write("#{plugin}\n")
63
69
  end
64
70
 
65
71
  f.write(PLUGINS_END)
@@ -67,6 +73,7 @@ module VundleMigrator
67
73
  end
68
74
 
69
75
  def prepend_vimrc
76
+ puts "adding 'source vundle' to #{@vimrc}"
70
77
  File.rename("#{@vimrc}", "#{@vimrc}.old")
71
78
 
72
79
  File.open("#{@vimrc}", 'w') do |f|
@@ -80,6 +87,7 @@ module VundleMigrator
80
87
  end
81
88
 
82
89
  def print_file_contents
90
+ puts "file contents:\n------\n"
83
91
  puts PLUGINS_START
84
92
  puts @plugins
85
93
  puts PLUGINS_END
@@ -1,3 +1,3 @@
1
1
  module VundleMigrator
2
- VERSION = "0.0.2"
2
+ VERSION = "0.1.0"
3
3
  end
Binary file
Binary file
Binary file
Binary file
@@ -17,8 +17,8 @@ Gem::Specification.new do |spec|
17
17
  spec.executables = ["vundle_migrator"]
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_development_dependency "bundler", "~> 1.11"
21
- spec.add_development_dependency "fakefs", "~> 0.8.1"
20
+ spec.add_development_dependency "bundler", "~> 1.12"
21
+ spec.add_development_dependency "fakefs", "~> 0.8"
22
22
  spec.add_development_dependency "minitest", "~> 5.8"
23
23
  spec.add_development_dependency "rake", "~> 11.1"
24
24
  spec.add_development_dependency "slop", "~> 4.3"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vundle_migrator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Travis Yoder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-26 00:00:00.000000000 Z
11
+ date: 2016-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.11'
19
+ version: '1.12'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.11'
26
+ version: '1.12'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: fakefs
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.8.1
33
+ version: '0.8'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.8.1
40
+ version: '0.8'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: minitest
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -89,14 +89,21 @@ extensions: []
89
89
  extra_rdoc_files: []
90
90
  files:
91
91
  - ".gitignore"
92
+ - ".ruby-version"
92
93
  - ".travis.yml"
94
+ - Dockerfile
93
95
  - Gemfile
94
96
  - LICENSE.txt
95
97
  - README.md
96
98
  - Rakefile
97
99
  - bin/vundle_migrator
100
+ - fixtures/vimrc
98
101
  - lib/vundle_migrator.rb
99
102
  - lib/vundle_migrator/version.rb
103
+ - vendor/cache/fakefs-0.8.1.gem
104
+ - vendor/cache/minitest-5.8.4.gem
105
+ - vendor/cache/rake-11.1.2.gem
106
+ - vendor/cache/slop-4.3.0.gem
100
107
  - vundle_migrator.gemspec
101
108
  homepage: https://github.com/trayo/vundle_migrator
102
109
  licenses: