wyc
wyc

Reputation: 55273

Adding a ":" command inside autocmd in .vimrc

I have this in my .vimrc:

autocmd Filetype mkd call SetWritingOptions()
function SetWritingOptions()
  setlocal guioptions-=T
  colorscheme pencil
  setlocal background=light
endfunction

I have a plugin which I activate by doing :VimroomToggle

Now, I would like to add that to the SetWritingOptions() function, so :VimroomToggle gets called each time I open a mkd file. How to do that?

Upvotes: 0

Views: 107

Answers (1)

user149341
user149341

Reputation:

Using this line in the function:

VimroomToggle

Commands you call in functions are the same as functions you enter using the : leader.

Upvotes: 3

Related Questions