What autocmd FileType is in .vimrc?

vim

Solution

I don't use the plugin, but I could try to explain what the meaning of those lines:

"this just assigning a variable, may be used by the plugin
let twitvim_count = 40  

" create a normal mode mapping, to execute Posttotwitter command.
" The leading ctrl-u just for removing the range information of the 
"command line. if you removed it, range info will be kept
" all following commands have the same meaning for <c-u>
nnoremap ,tp :<C-u>PosttoTwitter<CR>
" the next 4 commands are same as above, but executing different cmd. the ctrl-w j will move cursor
" to  a "belower" window, the cmd may open a new window/split.
nnoremap ,tf :<C-u>FriendsTwitter<CR><C-w>j
nnoremap ,tu :<C-u>UserTwitter<CR><C-w>j
nnoremap ,tr :<C-u>RepliesTwitter<CR><C-w>j
nnoremap ,tn :<C-u>NextTwitter<CR>

"create autocmd, if the filetype is twitvim, call a function
autocmd FileType twitvim call s:twitvim_my_settings()

"here a function was defined
function! s:twitvim_my_settings()
  "this function just do one thing, set nowrap option. (text is gonna be displayed without wrap.)
  set nowrap
endfunction

Problem

I started using twitvim and found this code code for .vimrc. But I am not sure what the last part of code is trying to do. ``` autocmd FileType twitvim call s:twitvim_my_settings() function! s:twitvim_my_settings() set nowrap endfunction ``` And this is the original code. I deleted all of `<C-u>`, `<C-w>` and `j`. ``` """ twitvim let twitvim_count = 40 nnoremap ,tp :<C-u>PosttoTwitter<CR> nnoremap ,tf :<C-u>FriendsTwitter<CR><C-w>j nnoremap ,tu :<C-u>UserTwitter<CR><C-w>j nnoremap ,tr :<C-u>RepliesTwitter<CR><C-w>j nnoremap ,tn :<C-u>NextTwitter<CR> autocmd FileType twitvim call s:twitvim_my_settings() function! s:twitvim_my_settings() set nowrap endfunction ```

Original source