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
While Kent's answer is correct and very detailed, I thought I'd submit a visual version.
autocmd FileType twitvim call s:twitvim_my_settings()
|______________________| |__| | |___________________|
| | | |
1 2 3 4
1. Automatically do something when the FileType (the file extension) matches .twitvim
2. call (Vim's way to run a function)
3. Refers to a function local to the current script file
4. The function to be ran
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With