Lars Tackmann
Lars Tackmann

Reputation: 20865

How do I open a file in Vim from inside a Conque shell

Often I find my self navigating the filesystem from a Conque shell in Vim and want to open a specific file inside my existing MacVim session. Is this possible ? - I was hoping for something like:

shell> open some/file.txt

and then have file.txt pop up inside my existing Vim window (preferably in a new tab).

Note: I am using @wycats vim dot files (not sure this matters).

Upvotes: 0

Views: 920

Answers (3)

still_dreaming_1
still_dreaming_1

Reputation: 9135

Often I find my self navigating the filesystem from a Conque shell

The beauty of running a shell from inside vim is you have all of vim and the shell at your disposal.

gf is your friend. Once you get the file you want displayed on the screen in some way, you can enter normal mode, move the cursor to the file you want to edit, then use the gf command to navigate to the file. There are many ways to use this. Any program or command that outputs file names is great for this (ll, git status, etc). You could also type the filename into the shell, just to make it visible on the screen without actually running any terminal commands (tab completion is handy here).

Upvotes: 1

Andrew Mcveigh
Andrew Mcveigh

Reputation: 474

Type from ConqueShell

mvim --remote-tab-silent filename

This will open the file in a new tab in MacVim

You could also write a Bash alias to shorten the command (assuming you are using bash). Put in your ~/.profile

alias vim='mvim --remote-tab-silent'

this would enable you to type

vim filename

from ConqueShell or bash, and have it open in a new MacVim tab, rather than terminal vim. It of course does disable your ability to run standard vim (although you could still use the vi command), so maybe you would want to name the alias differently.

Just to add, this will work only if you placed the mvim executable on your path E.G. /usr/bin/mvim. It comes with the MacVim.app

Upvotes: 1

Ency
Ency

Reputation: 633

It is possible, you can start vim as server and then add as many files as you want, but I'm not very familiar with this, so I can't give you just a direction.

Upvotes: 0

Related Questions