1
0
Fork 0
mirror of synced 2024-11-22 08:45:34 -05:00

Updated plugins

This commit is contained in:
amix 2013-05-04 16:32:47 -04:00
parent 687184f0bb
commit 630b462208
16 changed files with 287 additions and 147 deletions

View file

@ -1,24 +0,0 @@
bufexplorer bufexplorer.txt /*bufexplorer*
bufexplorer-changelog bufexplorer.txt /*bufexplorer-changelog*
bufexplorer-credits bufexplorer.txt /*bufexplorer-credits*
bufexplorer-customization bufexplorer.txt /*bufexplorer-customization*
bufexplorer-installation bufexplorer.txt /*bufexplorer-installation*
bufexplorer-todo bufexplorer.txt /*bufexplorer-todo*
bufexplorer-usage bufexplorer.txt /*bufexplorer-usage*
bufexplorer-windowlayout bufexplorer.txt /*bufexplorer-windowlayout*
bufexplorer.txt bufexplorer.txt /*bufexplorer.txt*
buffer-explorer bufexplorer.txt /*buffer-explorer*
g:bufExplorerChgWin bufexplorer.txt /*g:bufExplorerChgWin*
g:bufExplorerDefaultHelp bufexplorer.txt /*g:bufExplorerDefaultHelp*
g:bufExplorerDetailedHelp bufexplorer.txt /*g:bufExplorerDetailedHelp*
g:bufExplorerFindActive bufexplorer.txt /*g:bufExplorerFindActive*
g:bufExplorerFuncRef bufexplorer.txt /*g:bufExplorerFuncRef*
g:bufExplorerReverseSort bufexplorer.txt /*g:bufExplorerReverseSort*
g:bufExplorerShowDirectories bufexplorer.txt /*g:bufExplorerShowDirectories*
g:bufExplorerShowRelativePath bufexplorer.txt /*g:bufExplorerShowRelativePath*
g:bufExplorerShowTabBuffer bufexplorer.txt /*g:bufExplorerShowTabBuffer*
g:bufExplorerShowUnlisted bufexplorer.txt /*g:bufExplorerShowUnlisted*
g:bufExplorerSortBy bufexplorer.txt /*g:bufExplorerSortBy*
g:bufExplorerSplitBelow bufexplorer.txt /*g:bufExplorerSplitBelow*
g:bufExplorerSplitOutPathName bufexplorer.txt /*g:bufExplorerSplitOutPathName*
g:bufExplorerSplitRight bufexplorer.txt /*g:bufExplorerSplitRight*

View file

@ -1,62 +0,0 @@
'Tlist_Auto_Highlight_Tag' taglist.txt /*'Tlist_Auto_Highlight_Tag'*
'Tlist_Auto_Open' taglist.txt /*'Tlist_Auto_Open'*
'Tlist_Auto_Update' taglist.txt /*'Tlist_Auto_Update'*
'Tlist_Close_On_Select' taglist.txt /*'Tlist_Close_On_Select'*
'Tlist_Compact_Format' taglist.txt /*'Tlist_Compact_Format'*
'Tlist_Ctags_Cmd' taglist.txt /*'Tlist_Ctags_Cmd'*
'Tlist_Display_Prototype' taglist.txt /*'Tlist_Display_Prototype'*
'Tlist_Display_Tag_Scope' taglist.txt /*'Tlist_Display_Tag_Scope'*
'Tlist_Enable_Fold_Column' taglist.txt /*'Tlist_Enable_Fold_Column'*
'Tlist_Exit_OnlyWindow' taglist.txt /*'Tlist_Exit_OnlyWindow'*
'Tlist_File_Fold_Auto_Close' taglist.txt /*'Tlist_File_Fold_Auto_Close'*
'Tlist_GainFocus_On_ToggleOpen' taglist.txt /*'Tlist_GainFocus_On_ToggleOpen'*
'Tlist_Highlight_Tag_On_BufEnter' taglist.txt /*'Tlist_Highlight_Tag_On_BufEnter'*
'Tlist_Inc_Winwidth' taglist.txt /*'Tlist_Inc_Winwidth'*
'Tlist_Max_Submenu_Items' taglist.txt /*'Tlist_Max_Submenu_Items'*
'Tlist_Max_Tag_Length' taglist.txt /*'Tlist_Max_Tag_Length'*
'Tlist_Process_File_Always' taglist.txt /*'Tlist_Process_File_Always'*
'Tlist_Show_Menu' taglist.txt /*'Tlist_Show_Menu'*
'Tlist_Show_One_File' taglist.txt /*'Tlist_Show_One_File'*
'Tlist_Sort_Type' taglist.txt /*'Tlist_Sort_Type'*
'Tlist_Use_Horiz_Window' taglist.txt /*'Tlist_Use_Horiz_Window'*
'Tlist_Use_Right_Window' taglist.txt /*'Tlist_Use_Right_Window'*
'Tlist_Use_SingleClick' taglist.txt /*'Tlist_Use_SingleClick'*
'Tlist_WinHeight' taglist.txt /*'Tlist_WinHeight'*
'Tlist_WinWidth' taglist.txt /*'Tlist_WinWidth'*
:TlistAddFiles taglist.txt /*:TlistAddFiles*
:TlistAddFilesRecursive taglist.txt /*:TlistAddFilesRecursive*
:TlistClose taglist.txt /*:TlistClose*
:TlistDebug taglist.txt /*:TlistDebug*
:TlistHighlightTag taglist.txt /*:TlistHighlightTag*
:TlistLock taglist.txt /*:TlistLock*
:TlistMessages taglist.txt /*:TlistMessages*
:TlistOpen taglist.txt /*:TlistOpen*
:TlistSessionLoad taglist.txt /*:TlistSessionLoad*
:TlistSessionSave taglist.txt /*:TlistSessionSave*
:TlistShowPrototype taglist.txt /*:TlistShowPrototype*
:TlistShowTag taglist.txt /*:TlistShowTag*
:TlistToggle taglist.txt /*:TlistToggle*
:TlistUndebug taglist.txt /*:TlistUndebug*
:TlistUnlock taglist.txt /*:TlistUnlock*
:TlistUpdate taglist.txt /*:TlistUpdate*
Tlist_Get_Tag_Prototype_By_Line() taglist.txt /*Tlist_Get_Tag_Prototype_By_Line()*
Tlist_Get_Tagname_By_Line() taglist.txt /*Tlist_Get_Tagname_By_Line()*
Tlist_Set_App() taglist.txt /*Tlist_Set_App()*
Tlist_Update_File_Tags() taglist.txt /*Tlist_Update_File_Tags()*
taglist-commands taglist.txt /*taglist-commands*
taglist-debug taglist.txt /*taglist-debug*
taglist-extend taglist.txt /*taglist-extend*
taglist-faq taglist.txt /*taglist-faq*
taglist-functions taglist.txt /*taglist-functions*
taglist-install taglist.txt /*taglist-install*
taglist-internet taglist.txt /*taglist-internet*
taglist-intro taglist.txt /*taglist-intro*
taglist-keys taglist.txt /*taglist-keys*
taglist-license taglist.txt /*taglist-license*
taglist-menu taglist.txt /*taglist-menu*
taglist-options taglist.txt /*taglist-options*
taglist-requirements taglist.txt /*taglist-requirements*
taglist-session taglist.txt /*taglist-session*
taglist-todo taglist.txt /*taglist-todo*
taglist-using taglist.txt /*taglist-using*
taglist.txt taglist.txt /*taglist.txt*

View file

@ -1,10 +0,0 @@
expand-region-about expand_region.txt /*expand-region-about*
expand-region-contents expand_region.txt /*expand-region-contents*
expand-region-global-options expand_region.txt /*expand-region-global-options*
expand-region-intro expand_region.txt /*expand-region-intro*
expand-region-mappings expand_region.txt /*expand-region-mappings*
expand-region-usage expand_region.txt /*expand-region-usage*
expand_region_text_objects expand_region.txt /*expand_region_text_objects*
expand_region_use_select_mode expand_region.txt /*expand_region_use_select_mode*
vim-expand-region.txt expand_region.txt /*vim-expand-region.txt*
vim-expand-regions expand_region.txt /*vim-expand-regions*

View file

@ -2,8 +2,8 @@
This vim bundle adds syntax highlighting, indenting and autocompletion for the dynamic stylesheet language [LESS](http://lesscss.org).
This bundle is compatible with [vim-css-color](https://github.com/skammer/vim-css-color),
[vim-css3-syntax](https://github.com/hail2u/vim-css3-syntax) and possibly other plugins that place code
This bundle is compatible with [vim-css-color](https://github.com/skammer/vim-css-color),
[vim-css3-syntax](https://github.com/hail2u/vim-css3-syntax) and possibly other plugins that place code
in `after/syntax/css.vim` or `after/syntax/css/*.vim`.
![vim-less with vim-css-color and vim-css3-syntax (colorscheme solarized)](https://github.com/lenniboy/vim-less/raw/master/screenshot.png)
@ -21,14 +21,15 @@ in `after/syntax/css.vim` or `after/syntax/css/*.vim`.
$ cd ~/.vim/bundle
$ git clone https://github.com/groenewege/vim-less
- OR use [vundle](https://github.com/gmarik/vundle), adding this line to your `~/.vimrc`:
Bundle 'lunaru/vim-less'
- OR use git submodules:
$ git submodule add https://github.com/groenewege/vim-less.git bundle/vim-less
$ git submodule init
That's it. Pathogen should handle the rest. Opening a file with a `.less`
extension will load everything.
### Map
.less to .css , lessc is required.
@ -36,6 +37,10 @@ extension will load everything.
## Credits ##
Inspiration from [vim-haml](https://github.com/tpope/vim-haml),
Inspiration from [vim-haml](https://github.com/tpope/vim-haml),
[scss-syntax.vim](https://github.com/cakebaker/scss-syntax.vim) and
[vim-less](https://github.com/lunaru/vim-less)
## License ##
MIT : [groenewege.mit-license.org](http://groenewege.mit-license.org/)

View file

@ -1,3 +1,11 @@
## 2.1 (04/26/2013)
Bugfixes:
- Fix 1 regression where cursors could potentially get out of sync in insert mode
Features:
- Added some logic to debug latency. Fanning out to 30 cursors in insert mode with my vimrc took over 300ms. It's like than 20ms with a plain vimrc. Need to debug what setting is causing the slowing down in insert mode and inform users.
## 2.0 (04/24/2013)
Bugfixes:

View file

@ -87,8 +87,8 @@ highlight link multiple_cursors_visual Visual
## Issues
- Multi key commands like `ciw` do not work at the moment
- Insert mode can be slow. If you are using Neobundle and have many plugins, try switching to Vundle to see if it helps. See https://github.com/Shougo/neobundle.vim/issues/84 for additional info.
- All user input typed before Vim is able to fan out the last operation to all cursors is lost. This is a implementation decision to keep the input perfectly synced in all locations, at the cost of potentially losing user input.
- Performance in terminal vim degrades significantly with more cursors
- Select mode is not implemented
## Changelog

View file

@ -1,5 +1,11 @@
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = 'spec/multiple_cursors_spec.rb'
end
RSpec::Core::RakeTask.new(:benchmark) do |t|
t.pattern = 'spec/benchmark_spec.rb'
end
task :default => :spec

View file

@ -82,6 +82,10 @@ function! multiple_cursors#debug()
call s:cm.debug()
endfunction
function! multiple_cursors#get_latency_debug_file()
return s:latency_debug_file
endfunction
" Creates a new cursor. Different logic applies depending on the mode the user
" is in and the current state of the buffer.
" 1. In normal mode, a new cursor is created at the end of the word under Vim's
@ -352,6 +356,7 @@ function! s:CursorManager.reset(restore_view) dict
let self.starting_index = -1
let self.saved_winview = []
let self.start_from_find = 0
let s:char = ''
call self.restore_user_settings()
endfunction
@ -425,7 +430,7 @@ function! s:CursorManager.update_current() dict
" Sets the cursor at the right place
exec "normal! gv\<Esc>"
call cur.update_visual_selection(s:get_visual_region(s:pos('.')))
else
elseif s:from_mode ==# 'v' || s:from_mode ==# 'V'
call cur.remove_visual_selection()
endif
let vdelta = line('$') - s:saved_linecount
@ -714,9 +719,6 @@ function! s:revert_mode(from, to)
call s:cm.reapply_visual_selection()
normal! V
endif
if a:to ==# 'i'
startinsert
endif
if a:to ==# 'n' && a:from ==# 'i'
stopinsert
endif
@ -768,9 +770,9 @@ function! s:process_user_inut()
" FIXME(terryma): Undo always places the cursor at the beginning of the line.
" Figure out why.
if s:from_mode ==# 'i' || s:to_mode ==# 'i'
silent! undojoin | call feedkeys(s:char."\<Plug>(a)")
silent! undojoin | call s:feedkeys(s:char."\<Plug>(a)")
else
call feedkeys(s:char."\<Plug>(a)")
call s:feedkeys(s:char."\<Plug>(a)")
endif
" Even when s:char produces invalid input, this method is always called. The
@ -809,9 +811,6 @@ function! s:apply_user_input_next(mode)
" Advance the cursor index
call s:cm.next()
" Update Vim's cursor
call cursor(s:cm.get_current().position)
" We're done if we're made the full round
if s:cm.loop_done()
if s:to_mode ==# 'v' || s:to_mode ==# 'V'
@ -941,6 +940,37 @@ function! s:display_error()
let s:bad_input = 0
endfunction
let s:latency_debug_file = ''
function! s:start_latency_measure()
if g:multi_cursor_debug_latency
let s:start_time = reltime()
endif
endfunction
function! s:skip_latency_measure()
if g:multi_cursor_debug_latency
let s:skip_latency_measure = 1
endif
endfunction
function! s:end_latency_measure()
if g:multi_cursor_debug_latency && !empty(s:char)
if empty(s:latency_debug_file)
let s:latency_debug_file = tempname()
exec 'redir >> '.s:latency_debug_file
silent! echom "Starting latency debug at ".reltimestr(reltime())
redir END
endif
if !s:skip_latency_measure
exec 'redir >> '.s:latency_debug_file
silent! echom "Processing '".s:char."' took ".string(str2float(reltimestr(reltime(s:start_time)))*1000).' ms in '.s:cm.size().' cursors. mode = '.s:from_mode
redir END
endif
endif
let s:skip_latency_measure = 0
endfunction
function! s:wait_for_user_input(mode)
let s:from_mode = a:mode
if empty(a:mode)
@ -958,8 +988,12 @@ function! s:wait_for_user_input(mode)
" Immediately revert the change to leave the user's buffer unchanged
call s:revert_highlight_fix()
call s:end_latency_measure()
let s:char = s:get_char()
call s:start_latency_measure()
" Clears any echoes we might've added
normal! :<Esc>
@ -970,6 +1004,7 @@ function! s:wait_for_user_input(mode)
" If the key is a special key and we're in the right mode, handle it
if index(get(s:special_keys, s:from_mode, []), s:char) != -1
call s:handle_special_key(s:char, s:from_mode)
call s:skip_latency_measure()
else
call s:cm.start_loop()
call s:feedkeys("\<Plug>(i)")

View file

@ -1,21 +0,0 @@
MultipleCursorsFind multiple_cursors.txt /*MultipleCursorsFind*
g:multi_cursor_exit_from_insert_mode multiple_cursors.txt /*g:multi_cursor_exit_from_insert_mode*
g:multi_cursor_exit_from_visual_mode multiple_cursors.txt /*g:multi_cursor_exit_from_visual_mode*
g:multi_cursor_next_key multiple_cursors.txt /*g:multi_cursor_next_key*
g:multi_cursor_prev_key multiple_cursors.txt /*g:multi_cursor_prev_key*
g:multi_cursor_quit_key multiple_cursors.txt /*g:multi_cursor_quit_key*
g:multi_cursor_skip_key multiple_cursors.txt /*g:multi_cursor_skip_key*
g:multi_cursor_start_key multiple_cursors.txt /*g:multi_cursor_start_key*
g:multi_cursor_use_default_mapping multiple_cursors.txt /*g:multi_cursor_use_default_mapping*
multiple-cursors-contents multiple_cursors.txt /*multiple-cursors-contents*
multiple-cursors-contributing multiple_cursors.txt /*multiple-cursors-contributing*
multiple-cursors-credit multiple_cursors.txt /*multiple-cursors-credit*
multiple-cursors-global-options multiple_cursors.txt /*multiple-cursors-global-options*
multiple-cursors-intro multiple_cursors.txt /*multiple-cursors-intro*
multiple-cursors-issues multiple_cursors.txt /*multiple-cursors-issues*
multiple-cursors-license multiple_cursors.txt /*multiple-cursors-license*
multiple-cursors-mappings multiple_cursors.txt /*multiple-cursors-mappings*
multiple-cursors-references multiple_cursors.txt /*multiple-cursors-references*
multiple-cursors-usage multiple_cursors.txt /*multiple-cursors-usage*
vim-multiple-cursors multiple_cursors.txt /*vim-multiple-cursors*
vim-multiple-cursors.txt multiple_cursors.txt /*vim-multiple-cursors.txt*

View file

@ -30,6 +30,7 @@ let s:settings = {
\ 'exit_from_visual_mode': 1,
\ 'exit_from_insert_mode': 1,
\ 'use_default_mapping': 1,
\ 'debug_latency': 0,
\ }
let s:settings_if_default = {

View file

@ -0,0 +1,141 @@
require 'vimrunner'
require 'vimrunner/rspec'
Vimrunner::RSpec.configure do |config|
# Use a single Vim instance for the test suite. Set to false to use an
# instance per test (slower, but can be easier to manage).
config.reuse_server = false
# Decide how to start a Vim instance. In this block, an instance should be
# spawned and set up with anything project-specific.
config.start_vim do
# vim = Vimrunner.start
# vim = Vimrunner::Server.new("/usr/local/bin/vim").start
# Or, start a GUI instance:
vim = Vimrunner.start_gvim
# Setup your plugin in the Vim instance
plugin_path = File.expand_path('../..', __FILE__)
vim.add_plugin(plugin_path, 'plugin/multiple_cursors.vim')
# The returned value is the Client available in the tests.
vim
end
end
def set_file_content(string)
string = normalize_string_indent(string)
File.open(filename, 'w'){ |f| f.write(string) }
vim.edit filename
end
def get_file_content()
vim.write
IO.read(filename).strip
end
def before(string)
set_file_content(string)
end
def after(string)
get_file_content().should eq normalize_string_indent(string)
type ":q<CR>"
end
def type(string)
string.scan(/<.*?>|./).each do |key|
if /<.*>/.match(key)
vim.feedkeys "\\#{key}"
else
vim.feedkeys key
end
end
sleep 0.2
end
describe "Multiple Cursors" do
let(:filename) { 'test.txt' }
specify "#benchmark" do
before <<-EOF
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
EOF
# type ':profile start /tmp/test.result<CR>'
# type ':profile! file *multiple_cursors.vim<CR>'
type ':let g:multi_cursor_debug_latency=1<CR>'
type 'VG<C-n>Vchellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello<Esc>'
type ':echo multiple_cursors#get_latency_debug_file()<CR>'
sleep 3
latency_file = vim.command 'echo multiple_cursors#get_latency_debug_file()'
puts 'latency file = ' + latency_file
after <<-EOF
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
EOF
end
end

View file

@ -256,4 +256,18 @@ describe "Multiple Cursors" do
hell
EOF
end
specify "#multiline visual mode" do
before <<-EOF
hello
hello
EOF
type 'Vj<C-n>A world<Esc>'
after <<-EOF
hello world
hello world
EOF
end
end

View file

@ -14,7 +14,7 @@ In other words: upstream of snipmate is almost dead. (Better to say Marc Weber i
:Author: `Michael Sanders`_
:Maintainer: `Adnan Zafar`_ & `Rok Garbas`_ & `Marc Weber`_
:Homepage: http://www.vim.org/scripts/script.php?script_id=2540
:Contributors: `MarcWeber`_, `lilydjwg`_, `henrik`_, `steveno`_, `asymmetric`_, `jherdman`_, `ironcamel`_, `honza`_, `jb55`_, `robhudson`_, `kozo2`_, `MicahElliott`_, `darkwise`_, `redpill`_, `thisgeek`_, `sickill`_, `pose`_, `marutanm`_, `r00k`_, `jbernard`_, `holizz`_, `muffinresearch`_, `statik`_, `taq`_, `alderz`_, `radicalbit`_, `pielgrzym`_
:Contributors: `MarcWeber`_, `lilydjwg`_, `henrik`_, `steveno`_, `asymmetric`_, `jherdman`_, `ironcamel`_, `honza`_, `jb55`_, `robhudson`_, `kozo2`_, `MicahElliott`_, `darkwise`_, `redpill`_, `thisgeek`_, `sickill`_, `pose`_, `marutanm`_, `r00k`_, `jbernard`_, `holizz`_, `muffinresearch`_, `statik`_, `taq`_, `alderz`_, `radicalbit`_, `pielgrzym`_, `hpesoj`_
.. contents::
@ -255,3 +255,4 @@ TODO / Future
.. _`vim.org`: http://www.vim.org/scripts/script.php?script_id=2540
.. _`GitHub`: http://github.com/msanders/snipmate.vim
.. _`radicalbit`: https://github.com/radicalbit
.. _`hpesoj`: https://github.com/hpesoj

View file

@ -324,9 +324,7 @@ function! s:state_proto.update_changes()
let col = col('.')
if line('.') != self.cur_stop[0] || col < self.start_col || col > self.end_col
call self.remove()
endif
if self.has_vars
elseif self.has_vars
call self.update_vars(change_len)
endif

View file

@ -69,6 +69,41 @@ Historical notes
unfortunately abandoned the project. [Rok Garbas][3] is now maintaining a
[fork][4] of the project in hopes of improving the existing code base.
Versions / dialects / ..
========================
There are some issues, such as newer language versions may require other
snippets than older. If this exists we currently recommend doing this:
add snippets/ruby.snippets (common snippets)
add snippets/ruby-1.8.snippets (1.8 only)
add snippets/ruby-1.9.snippets (1.9 only)
then configure github.com/garbas/vim-snipmate this way:
let g:snipMate = {}
let g:snipMate.scope_aliases = {}
let g:snipMate.scope_aliases['ruby'] = 'ruby,ruby-rails,ruby-1.9'
or github.com/MarcWeber/UltiSnips this way:
let g:UltiSnips = {}
let g:UltiSnips.snipmate_ft_filter = {
\ 'default' : {'filetypes': ["FILETYPE"] },
\ 'ruby' : {'filetypes': ["ruby", "ruby-rails", "ruby-1.9"] },
If it happens that you work on a project requiring ruby-1.8 snippets instead,
consider using vim-addon-local-vimrc and override the filetypes.
Well - of course it may not make sense to create a new file for each
ruby-library-version triplet. Sometimes postfixing a name such as
migrate_lib_20_down
migrate_lib_20_up
will do it then if syntax has changed.
Language maintainers
--------------------
@ -76,6 +111,11 @@ Language maintainers
No one can really be proficient in all programming languages. If you would like
to maintain snippets for a language, please get in touch.
Notes: People are interested in snippets - and their interest may stop again
at will. So its ok if people maintain a language only for a short period of
time - or jump in and get things done - don't let the flow stop :)
vim-snippets is not like the "linux kernel".
* Python - [honza](http://github.com/honza)
* Javascript - [honza](http://github.com/honza)
* HTML Django - [honza](http://github.com/honza)

View file

@ -589,6 +589,8 @@ snippet bf
before_filter :${1:method}
snippet bt
belongs_to :${1:association}
snippet btp
belongs_to :${1:association}, :polymorphic => true${2}
snippet crw
cattr_accessor :${1:attr_names}
snippet defcreate
@ -890,22 +892,27 @@ snippet mrnc
rename_column :${1:table_name}, :${2:old_column_name}, :${3:new_column_name}
snippet mcc
change_column :${1:table}, :${2:column}, :${3:type}
snippet mccc
t.column :${1:title}, :${2:string}
snippet mnc
t.${1:string} :${2:title}${3:, null: false}${4}
snippet mct
create_table :${1:table_name} do |t|
t.column :${2:name}, :${3:type}
${2}
end
snippet migration
snippet migration class .. < ActiveRecord::Migration .. def up .. def down .. end
class ${1:class_name} < ActiveRecord::Migration
def self.up
def up
${2}
end
def self.down
def down
end
end
snippet migration class .. < ActiveRecord::Migration .. def change .. end
class ${1:class_name} < ActiveRecord::Migration
def change
${2}
end
end
snippet trc
t.remove :${1:column}
snippet tre
@ -913,7 +920,6 @@ snippet tre
${3}
snippet tref
t.references :${1:model}
#rspec
snippet it
it "${1:spec_name}" do
@ -944,7 +950,9 @@ snippet aft
${2}
end
snippet let
let(:${1:method}) { ${2} }
let(:${1:object}) ${2:block}
snippet let!
let!(:${1:object}) ${2:block}
snippet subj
subject { ${1} }
snippet spec