Skip to content

Instantly share code, notes, and snippets.

@stepancheg
Created September 23, 2009 01:43
Show Gist options
  • Save stepancheg/191618 to your computer and use it in GitHub Desktop.
Save stepancheg/191618 to your computer and use it in GitHub Desktop.
"
" Author: Alex Naanou
"
" WARNING: The following will kill most indent functionality in vim.
" though you still can use ^F
"
" to install just drop me into your plugin dir.
nnoremap o ^y<home>o<esc>pI
nnoremap O ^y<home>O<esc>pI
"nnoremap o ^y<home>o<esc><home>DpI
"nnoremap O ^y<home>O<esc><home>DpI
" this is a SuperDuperIndentHelper function written for yozh....
" NOTE: I recommend tabbing your programs correctly, and then this
" script will never be needed! :)
" from me: currently uses registers 'p' and 'x'
fun! s:SuperDuperIndentHelper(i)
if ! match(a:i,'\s')
let @x = getline('.')
endif
endfun
inoremap <CR> <CR><esc>^d<home>k^"xy<home>^"pyl:call <SID>SuperDuperIndentHelper(@p)<CR>j<home>"xPI
" NOTE: another way to do this is to write an indent file (I had no
" time, that's why you have just read the fast way to do it....).
"""""""""""""""""""""""""""""""""""""""""""" vim:set sw=4 ts=4 wrap : "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment