Last Updated: 2022-05-26
I had an alias for
clangd set up in
alias clangd="$(brew --prefix llvm)/bin/clangd"
This was required because I didn't want to risk moving the
homebrew C binaries into my path.
.vimrc I had:
if executable('clangd') " code to set up LSP endif
Despite this, the LSP code never executed. This turned out to be because when
!<cmd> in vim or
/bin/bash -c <cmd> from another shell, you are
launching an instance of bash in non-interactive mode. And in non-interactive
mode aliases are not expanded.
.zshrcwill not be booted. However all shells will boot the
$PS1(Prompt String 1) is not set
For example, in a script, which you run with
zsh filename. Technically you
have two shells here: the interactive one you are using to start up the script,
and the non-interactive one running the commands.
You can explicitly request a login zsh shell with
zsh -l (
l for login)