I am trying to make a function that creates a new line and hits the tab key (aka 2 spaces / 4 spaces; what ever is set). I can do it easily with a keybinding:
:inoremap <leader>ind <esc>o<tab>
But when I try to execute this from a function:
function! Indent_New_Line() execute "normal! o<tab>" endfunction :inoremap <leader>ind <esc>:call Indent_New_Line()<cr>
<tab> gets printed literally instead of a tab char:
|def foo |<tab> |end
Any ideas as to why this is happening? I couldn't find very much about this..
Any help is appreciated, Thanks!