Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for $VISUAL editor #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

averagechris
Copy link

Hi there,

I added the ability to use any editor by checking for $VISUAL after sourcing .profile if it exists. I find it pretty handy and it seems like there were some other requests so I decided to put it in a PR.

remove osx only feature for pasting contents of buffer
meereeum added a commit to meereeum/vim-anywhere that referenced this pull request Mar 9, 2018
@Dbz
Copy link

Dbz commented Apr 2, 2018

@mistahchris I copied your code locally. I use (normal) vim with zsh. I put export VISUAL='vim' in my ~/.zshenv.

I believe the problem are lines similar to if [ -e $HOME/.profile ]; then. What if we just check for the existence of $VISUAL in the environment instead of just in .profile? I noticed that you do: if env | grep -q "VISUAL"; then which does that.

@averagechris
Copy link
Author

That is a good idea @Dbz. You would still often want to define VISUAL in profile depending on how you call the script. For example, in Mac OS's automator, the bash shell there isn't login, if i recall correctly, so it'll only source .profile. But I think the env solution would actually cover that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants