📜 ⬆️ ⬇️

Vim and twitter

Recently, I began to use Twitter more actively than before :) ego asks :)
Here, and since quite recently, vim has again begun to be used more actively. I will expand the value to the full screen open in the vim terminal with NERDTree and a bunch of open files and laba. Neither the desktop I see any notifications - the most it. But we are all human beings - and after some time, there is a desire to know the time (read, we are tired). Here, and the rest of the harvester works - vim-browser-browser-vim-console ... :) And all is well - TwitterFox notifies me in time about the few events in my friendline twitter and post from it conveniently ... but no, I need more and that in the shower music was playing and that in a mobile phone there were chess :)
Well, I put myself one plug-in and now I’m writing to Twitter without looking up from my work (and I’ll write).

only a small addition was made because it’s dumb for me to write my twitter password in. vimrc - I’m a little paranoid :) but I’ll stilln’t set up a firewall on my Mac - it's a lazy paranoid
fu! LoginTwitter()
let a:user=input("Your twitter login: ")
let a:pswd=inputsecret(a:user."'s password: ")
let g:twitvim_login=a:user.':'.a:pswd
echo "Credentials are saved"
endf
command! Twil :call LoginTwitter()
"twittervim mappings
nmap <ct>p :PosttoTwitter<cr>
nmap <ct>f :FriendsTwitter<cr>
nmap <ct>l :Twil<cr>


If someone tells you if there is any function like input, just not repeating the input - so that the password you enter is invisible, I will be grateful :)
UPD: nchaly prompted
login is enough once per vim session, but at least it is not stored in a plain text file.
The plugin can do anything - post a line from the buffer or the entire buffer, show it to the friend…
For posting via TwitterFox you need to podlzovatsya
In general, you can use, see how to get accustomed. For the time being, I am tempted by the fact that less time is spent for posting and viewing tweets than before and all this is done exclusively from the keyboard and without the participation of a mouse.

')

Source: https://habr.com/ru/post/55051/


All Articles