logo       

Re: Stuck & confused: msg#00029

editors.vim.mac

Subject: Re: Stuck & confused

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 13-Mar-07, at 11:42 AM, M.C wrote:
The problem is I want to be able to launch vim and then use this window to
launch mysql before submitting queries to the mysql server which are written
in vim(the server is local on my comp btw). how would I put 'mysql - p' into
vim so that I can connect to the server and then how would I submit the
queries?

IIUC, you want to run a shell command and 'capture the output' in vim.

To run a command inside vim you preface it with :!
:!ls will list your current directory, then prompt you to hit enter to go back to using vim

To read in external files you use :r
:r addMe.txt will add the file to your current document

To run a command inside vim and read in the output you combine the commands (very vimmish)
:r!ls will add the directory listing to the bottom of your document

So, you should be able to do something like
:r!mysql -e help
or whatever - the sql I leave to you.

HTH
Brian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFF9snMGnOmb9xIQHQRAstWAJ9MKA/ieYfOObBVIY0xbkcRj78JPQCeLdZt
0MTOwGrib/WatFSX9BnYw4c=
=cFXu
-----END PGP SIGNATURE-----



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise