|
Re: Stuck & confused: msg#00031editors.vim.mac
On Tue, Mar 13, 2007 at 11:56:59AM -0400, Brian McKee wrote: > -----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 I do not think there is anything mac-specific about this question, so you may get more help on the general vim users' list. If your SQL commands are in the vim buffer, you can yank them and paste to the command line. For example (starting in Normal mode) y$:<C-R>" will yank the current line, enter Command-line mode, and paste the yanked text. If you want to do this a lot, you may want to define a mapping for it. :help y :help c_CTRL-R If you want an interactive SQL session in vim, then some plugins may help. I have never used them myself. For example, http://www.vim.org/scripts/script.php?script_id=165 (The site is behaving oddly. Maybe it is just me, but reloading a page seems to help when it initially comes up blank.) HTH --Benji Fisher |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Financial report ICCF available: 00031, Bram Moolenaar |
|---|---|
| Next by Date: | Re: Stuck & confused (vim and mysql): 00031, Dave Price |
| Previous by Thread: | Re: Stuck & confusedi: 00031, Brian McKee |
| Next by Thread: | Financial report ICCF available: 00031, Bram Moolenaar |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |