Comments (13)
Right now, there isn't support for it. I almost never use MacVim either, but for this project it just made a lot of sense (ditto for gVim on Linux).
There are a few reasons that there is only support for GUI versions of vim. First, both MacVim and gVim close their window when you :wq
your current buffer. This gets the window out of your way. With terminal vim, after you did that, the terminal would be left open and then shuffled to the background when your previous window is refocused. I'm trying to make the process as unintrusive as possible, and MacVim seems like the way to go for that.
Both MacVim and gVim function pretty much identically to terminal Vim, so it should work just like what you're familiar with (they will source your .vimrc
, etc).
That said, I'm totally open to be persuaded that vim-anywhere should also support terminal Vim. ^_^
from vim-anywhere.
Thanks Chris. That does sound a reasonable consideration. Ok, I will give a
try and see how it works out. :)
On Mon, Dec 30, 2013 at 12:37 AM, Chris Knadler [email protected]:
Right now, there isn't support for it. I almost never use MacVim either,
but for this project it just made a lot of sense (ditto for gVim on Linux).There are a few reasons that there is only support for GUI versions of
vim. First, both MacVim and gVim close their window when you :wq your
current buffer. This gets the window out of your way. With terminal vim,
after you did that, the terminal would be left open and then shuffled to
the background when your previous window is refocused. I'm trying to make
the process as unintrusive as possible, and MacVim seems like the way to go
for that.Both MacVim and gVim function pretty much identically to terminal Vim, so
it should work just like what you're familiar with (they will source your
.vimrc, etc).That said, I'm totally open to be persuaded that vim-anywhere should also
support terminal Vim. ^_^—
Reply to this email directly or view it on GitHubhttps://github.com//issues/5#issuecomment-31337244
.
from vim-anywhere.
Awesome! Let me know what you think. I'm going to leave this open as it is a common feature request.
from vim-anywhere.
I'm fine with gvim, myself, but it isn't necessarily the case that the terminal would hang around after closing vim. Try this:
$ gnome-terminal -e vim
A terminal opens and launches vim. When you quit vim, the terminal goes away as well. I'm not sure if this is universal behavior, but it works in the three terminals I just tried:
$ gnome-terminal -e vim
$ terminator -e vim
$ xterm -e vim
Caveat: Linux. I'm not sure about the Mac terminal's behavior.
from vim-anywhere.
Oh, interesting! Tagging @pyrated as he did some investigation regarding this as well. This looks promising.
I'm wondering if there is a way to do this on OSX as well (probably only through applescript).
from vim-anywhere.
I don't have time to put in enough work to make a satisfactory pull request, but I added this bit of customization to get terminal vim to work. I put this right below the declaration for $file:
linux_editor_cmd="terminator -e 'vim $file'"
#linux_editor_cmd="gvim --nofork $file"
#linux_editor_cmd="gnome-terminal -e 'vim $file'"
#linux_editor_cmd="xterm -e 'vim $file'"
And I replaced the gvim call with this:
eval $linux_editor_cmd
This launches terminal vim as expected. However I have another problem with vim-anywhere (it doesn't paste anything after :wq
) so I need to sort that out first.
from vim-anywhere.
Ah, I mistakenly thought that vim-anywhere would automatically paste into whatever text area was active. Nevermind, it's working as intended.
from vim-anywhere.
@mwcz This is actually a common misconception. I'm going to bold the part of the readme that says otherwise. Sorry about that! Also, thanks for the details. I'll see if I can work something up on the OSX side as well. I don't want to release this as a feature without support for it on all platforms.
from vim-anywhere.
I'm still stuck on the OSX side. I've opened up a question on Ask Different:
http://apple.stackexchange.com/questions/115994/terminal-app-equivalent-of-xterm-e-cmd
We'll see if that gets anywhere.
from vim-anywhere.
I also wanted to use vim in a terminal, but it would not work, because the script didn't wait for the terminal to exit so xclip would just copy the empty string every time
this is how I ended up "fixing" it...
there should probably be a better solution if someone has an idea
.vim-anywhere/bin/run
[...]
if [[ $OSTYPE == "linux-gnu" ]]; then
gnome-terminal -e "vim -c 'startinsert' $TMPFILE"
sleep 0.1
PROC_PID_PATH=/proc/$(pidof vim)
while [ -e $PROC_PID_PATH ]; do sleep 0.1; done
cat $TMPFILE | xclip -selection clipboard
[...]
from vim-anywhere.
Neat! This is interesting. I'll start playing around with this again and see if I can't get something working.
from vim-anywhere.
That actually didn't work when I didn't have a terminal open before (didn't notice because I almost always have a terminal open...), but anyway, changing the while line to
while [ $(pidof vim) != "" ]; do sleep 0.1; done
did the trick
(I also forked and super minimized it for my personal use; works perfectly on linux mint 16 with cinnamon)
from vim-anywhere.
Closing this for now as I don't want to add more scope to the project. GVim/MacVim work fine.
from vim-anywhere.
Related Issues (20)
- macOS - No hotkey in Services HOT 3
- feature proposition: Automatic pasting HOT 5
- Can't auto refocus the previous editer after quit vim in Ubuntu18.04 HOT 2
- How to open a new buffer in current MacVim window? HOT 1
- Doesnt work on only i3wm? Really needs gnome? HOT 1
- Can't lock the PC, the lock file doesn't exist HOT 1
- Keybind Not Working in Chrome HOT 1
- Workflow starts, but nothing else happens HOT 1
- change key board shortcut on ubuntu HOT 1
- Switch to soft wrap on launch?
- Use without temp files on mac [suggestion]
- Plugin not working HOT 2
- Vim takes a long time to start after being invoked.
- Open Vim with selected text
- On Linux Mint Cinnamon: use `cinnamon-settings` or `dconf`
- Support without gvim. HOT 9
- Changing xclip to xsel for Linux HOT 2
- not working? (with screencast) HOT 2
- Windows version HOT 3
- put vim in insert mode automatically HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-anywhere.