2

I mean when I’m editing or reading in vim I need to keep some words or sentences in MySQL database automatically only by hitting a shortcut key.

  • This question: softwarerecs.stackexchange.com/q/13841/6834 might be related if you can import your data from a text file – Tymric Jun 12 '15 at 7:19
  • It might be more easily doable with emacs than with vim – Basile Starynkevitch Jun 13 '15 at 5:51
  • @BasileStarynkevitch Thanks for your recommendation anyway. But so far as I know Vim is more popular than Emacs, which can be proved by searching Vim [Viml] and Emacs [Lisp] on GitHub and looking at the amont of results and stars of those listed on the top. Then I thought Vim users could gain more support from a larger community. – Lerner Jun 15 '15 at 7:39
1

Here is a Vim script to do that:

https://github.com/eduOS/vocabook/blob/master/autoload/pyvocabook.vim

Set the database connection details at line 29.

License: MIT

  • I will definitively upvote this, as it is the best answer that can be hoped for by a question lacking so much detail. OP, please note that you will need to install Mysql and have it running; you will also need to know SQL in order to recode the fine example given to meet your needs. – Mawg Dec 13 '16 at 8:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.