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

ZSH shell #6

Open
regedarek opened this issue Oct 13, 2016 · 9 comments
Open

ZSH shell #6

regedarek opened this issue Oct 13, 2016 · 9 comments

Comments

@regedarek
Copy link

Hi, Is this plugin able to run command in my zsh shell with aliases I have in zshrc?

@skywind3000
Copy link
Owner

skywind3000 commented Oct 13, 2016

That's cool, I just took this idea and updated a new version which use the vim native &shell and &shellcmdflag config to execute commands.

You can have the latest version to execute your zsh commands now.

@regedarek
Copy link
Author

Nice. Maybe i am doing something wrong I have zsh now but i can't use my aliases from .zshrc.

@skywind3000
Copy link
Owner

check the shellcmdflag, commands are executed like these:

zsh -c "YOUR COMMANDS"

maybe you can try to change shellcmdflag from "-c" to "-ci":

:set shellcmdflag=-ci

@chh-wang
Copy link

chh-wang commented Feb 18, 2020

I use win10, the below is the cofiguration in _vimrc to use cygwin shell:

" Makes bash open in the working directory
let $CHERE_INVOKING=1
" Default path for Cygwin 64-bit, change accordingly
set shell=D:\pfs\cygwin\bin\bash.exe\ --login
" Without --login, Cygwin won't mount some directories such as /usr/bin/
set shellcmdflag=--login\ -c
" Default value is (, but bash needs "
set shellxquote=\"
" Paths will use / instead of \
set shellslash

I run:

:AsyncRun ls

But I get the error below:

|| [ls]
|| /usr/bin/bash: C:/Users/user/AppData/Local/Tempasyncrun.cmd: No such file or directory
|| [Finished in 0 seconds with code 127]

What cause the issue?

@skywind3000
Copy link
Owner

skywind3000 commented Feb 18, 2020

别把 shell/shellcmdflag 设置成 cygwin,坑太多了,windows 下的 vim 不是给你这样用的,你这样设置不当 asyncrun 要出错,其他很多用 shell 工具的地方都要出错。

你想再 windows 下用很多 unix 工具,安装个 busybox 就行了。你实在想用 asyncrun 跑 cygwin 命令,可以:

:AsyncRun D:\pfs\cygwin\bin\bash.exe --login -c "ls -la"

嫌弃命令长,你可以自己定一个短点的,比如叫做 AsyncCygwin

@skywind3000
Copy link
Owner

另外,你 windows 10 的话,为什么不用 wsl 呢?AsyncRun 支持 wsl 命令:

:AsyncRun -program=wsl ls -la

@chh-wang
Copy link

谢谢。用Cygwin主要是办公环境用于交叉编译的需要,其他在考虑中,不过短时间内还不好切换。

@skywind3000
Copy link
Owner

那你设置 &shell 成 cygwin 这个操作麻烦了,导致内外路径都对不起来。

@swtch1
Copy link

swtch1 commented May 27, 2022

I "solved" this for myself by creating a separate zshrc file. I run AsyncRun a lot. Your mileage may vary.

  • ~/.zshrc-lite contains only the functionality I want in AsyncRun since loading my proper ~/.zshrc is too slow
  • ~/.zshrc sources ~/.zshrc-lite
  • the command I run to open AsyncRun calls :AsyncRun -mode=term source ~/.zshrc-light && <- with space on the end so I can type the command right away

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

No branches or pull requests

4 participants