At the moment I have found a workaround, pasting from the selection register, simulating a mouse middle click with the next mappings: vnoremap <C-c> "0ygv"+ygv"*yi inoremap <C-v> <MiddleMouse> This allows to paste without going to normal mode so I can't lose my indentation. The problem with this is that is no really portable to other plkatforms out from XWindow
El 8 de mayo de 2009 16:11, Pablo Giménez <[email protected]> escribió: > Thanks > This should be working but probably the problem comes due to the indent way > in python. > Try the next: > - Open a clean buffer and change the filttype to python: > :set filetype-python > - No type the next code: > def test:<CR> > - Here the indent work, so you can type something like: > var=5<CR> > - But in the moment you return to normal mode, with <Esc> for instance, the > cursor returns to the first column of the line instead of keeping the > indentation, you need to go again to the end of the previous line, trype > <CR> top put the cursor in the proper place. > > This is causing the paste maps to fail, cos you always need to go to normal > mode, using <Esc> or <c-o>, and when you do this you loose your indentation. > Makes sense???? > > 2009/5/8 John Beckett <[email protected]> > > >> Pablo Giménez wrote: >> > I have some keymaps to paste text directly in insert mode: >> > inoremap <C-v> <C-O>"+p<Right> >> >> On reflection, it looks like the 'pastetoggle' I recommended is >> not appropriate for your situation. A precise example of what's >> in the clipboard and where the cursor is might help, but the >> following tip should do what you want: >> http://vim.wikia.com/wiki/Smart_paste >> >> Another strategy would be to investigate what the MS Windows >> compatible paste does (I haven't looked at this for ages, so >> can't comment). >> see mappings in file vim72/mswin.vim >> which uses function in vim72/autoload/paste.vim >> >> John >> >> >> >> >> > > > -- > Un saludo > Best Regards > Pablo Giménez > -- Un saludo Best Regards Pablo Giménez --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
