I know this is a noob question but I cant seem to find an answer in the internet. I want to execute zsh commands inside the nvim command line. I want to set this up so that I can copy current directory's / file's path I'm currently editing.
Basically I have .zshrc file containing my alias commands. For example...
alias CopyDir="pwd | xclip -selection clipboard"
This command works when executed in terminal, but doesn't work when run in nvim command line. Eg...
:! CopyDir
returns - zsh:1: command not found: CopyDir\ shell returned 127
I can't seem to find any info online about it. Either its impossible, its not widely needed, or I've missed out the command to achieve this in a much easier way. I've been using vim mode for about half a year now so I've been slowly transferring to nvim as my IDE of choice. Been loving the experience so far, just need more experience, and more knowledge on set up.
To run zsh commands in the nvim/vim command line, try these:
zsh -c
::! zsh -c "ZSHCOMMAND"
zsh -ic
::! zsh -ic "ZSHCOMMAND"
Just swap out ZSHCOMMAND
with the command you want to run.