" And restore it after all other options were reset.
if has('eval')
let &runtimepath = s:save_runtimepath
+ unlet s:save_runtimepath
endif
" Make sure Vim (and not Vi) settings are used.
" Disable Apple style movements in MacVim.
if has('gui_macvim') && has('eval')
- let macvim_skip_cmd_opt_movement = 1
+ let g:macvim_skip_cmd_opt_movement = 1
endif
" In case 'hlsearch' is used disable it with <C-L>. Thanks to frogonwheels and
" Settings for the NERD commenter.
" Don't create any mappings I don't want to use.
if has('eval')
- let NERDCreateDefaultMappings = 0
+ let g:NERDCreateDefaultMappings = 0
endif
" Map toggle comment.
map <Leader><Leader> <Plug>NERDCommenterToggle
" Thanks to
" http://vim.wikia.com/index.php?title=Indent_text_object&oldid=27126
" (visited on 2011-11-19).
- onoremap <silent>ai :<C-u>call IndTxtObj(0)<CR>
- onoremap <silent>ii :<C-u>call IndTxtObj(1)<CR>
- vnoremap <silent>ai :<C-u>call IndTxtObj(0)<CR><Esc>gv
- vnoremap <silent>ii :<C-u>call IndTxtObj(1)<CR><Esc>gv
+ onoremap <silent>ai :<C-U>call <SID>IndTxtObj(0)<CR>
+ onoremap <silent>ii :<C-U>call <SID>IndTxtObj(1)<CR>
+ vnoremap <silent>ai :<C-U>call <SID>IndTxtObj(0)<CR><Esc>gv
+ vnoremap <silent>ii :<C-U>call <SID>IndTxtObj(1)<CR><Esc>gv
- function! IndTxtObj(inner)
+ function! s:IndTxtObj(inner)
let curline = line(".")
let lastline = line("$")
let i = indent(line(".")) - &shiftwidth * (v:count1 - 1)