Git Product home page Git Product logo

Comments (13)

cknadler avatar cknadler commented on July 22, 2024

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.

i3d avatar i3d commented on July 22, 2024

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.

cknadler avatar cknadler commented on July 22, 2024

Awesome! Let me know what you think. I'm going to leave this open as it is a common feature request.

from vim-anywhere.

mwcz avatar mwcz commented on July 22, 2024

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.

cknadler avatar cknadler commented on July 22, 2024

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.

mwcz avatar mwcz commented on July 22, 2024

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.

mwcz avatar mwcz commented on July 22, 2024

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.

cknadler avatar cknadler commented on July 22, 2024

@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.

cknadler avatar cknadler commented on July 22, 2024

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.

just-barcodes avatar just-barcodes commented on July 22, 2024

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.

cknadler avatar cknadler commented on July 22, 2024

Neat! This is interesting. I'll start playing around with this again and see if I can't get something working.

from vim-anywhere.

just-barcodes avatar just-barcodes commented on July 22, 2024

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.

cknadler avatar cknadler commented on July 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.