How can I use the VIMRUNTIME=runtime ./build/bin/nvim to start nvim from anywhere? - runtime

I installed neovim from source and now I dont know how to use VIMRUNTIME=runtime ./build/bin/nvim to make it start nvim from anywhere by just typing nvim. I tried adding an nvim alias to ./build/bin/nvim in my .zshrc but to no avail.

Related

How to reset vim and neovim when sourcing wrong file .zshrc instead of init.vim

I'm using macOS Catalina which has built in Vim 8.1. I'm also using iTerm with zsh and oh-my-zsh. I installed neovim for my personal use and when I setting it up, I accidentally enter source .zshrc in Command mode instead of source init.vim. From then, when I open neovim or built in vim, it does not source init.vim anymore and shows error message like below:
Error detected while processing VIMINIT:
E33: No previous substitute regular expression
Press ENTER or type command to continue
There is a line in my .zshrc that exports VIMINIT variable
export VIMINIT="~/.config/nvim/init.vim"
How can I undo this or is there any other way to reset vim to original setting? Thank you so much
I tried #Niloct solution, unset VIMINIT and vim/neovim is backed to normal. After that, I reopen the iTerm and it showed error message again. Therefore I removed the export line from .zshrc and the problem has been solved.
To load a clean neovim:
nvim -u NONE -U NONE -N -i NONE
Actually I have an alias for that
alias vinone='nvim -u NONE -U NONE -N -i NONE'
This way you can type vinone and use your default neovim

conda command not found even though path is exported

I installed anaconda3 into my home directory. This is what I am seeing within the terminal:
and my .bash_profile looks like this:
export PATH="/Users/spotter/anaconda3/bin:$PATH"
So I don't understand why conda is not being recognized. When I navigate to anaconda3/bin there is a file called conda in there, but even when I try to call it within that pathway it is still not found.
Spotter, your path to conda is incorrect.
I'm on High Sierra MAC OS and just installed Anaconda3 via HomeBrew command. I had issue with running :
conda
It'd also give me:
-bash: conda: command not found
I tried running:
export PATH=~/anaconda3/bin:$PATH
but it needs ENTIRE path. so here are the correct steps:
$ nano ~/.bash_profile
Now export the ENTIRE path, in my case it was:
export PATH=/usr/local/anaconda3/bin:$PATH
Exit out and run:
$ source ~/.bash_profile
Then try:
$ conda
it'll output:
$ conda --version
conda 4.4.10
I had to type source ~/anaconda3/bin/activate.
For anyone that landed here that is using a non-standard shell (zsh for example) the installer 5.3.1 currently changes the bash_profile not the current active default terminal.
Just open ~/.bash_profile, find the block that is added by the installer and copy it into your .zshrc file (if using zsh)
in Mac OS, for conda >4,4, the conventional way of exporting path (export PATH="Users/myuser/anaconda3/bin:$PATH") is NOT recommended anymore. First, see what is error message in your terminal in Mac when you type conda --version. If it says zsh conda not found then you are using ZSH terminal, so modifying any bash file is useless. In this case, you need to edit your .zprofile. on the other hand, if you get error like bash conda not found you edit .bash_profile. Lets, say we have zsh error, then type in terminal:
sudo nano ~./zprofile
located your conda.sh file by searching in your finder. Most probably it is in
~/anaconda3/etc/profile.d/conda.sh
(for me it was like: /Users/hasbah/opt/anaconda3/etc/profile.d/conda.sh, but instead of anaconda3, it might be conda)
then you type in .zhprfile this:
. /Users/myuser/opt/anaconda3/etc/profile.d/conda.sh
conda activate base
then you save (ctrl+X and Y when was asked to save) and restart the terminal.
Now if you type conda --version you will see it.
so, in short:
sudo nano ~/.zproflie
. /Users/myuser/opt/anaconda3/etc/profile.d/conda.sh
conda activate base
save ./zproflie file
close terminal
open new terminal
conda --version
Rather than adding the ~/anaconda3/bin to your PATH, you should add
. ~/anaconda3/etc/profile.d/conda.sh
conda activate base
to your .bash_profile or .bashrc, or type that in a shell, if you don't want it to be activated for each shell. This is the recommended way to activate conda since conda 4.4. See: https://github.com/conda/conda/blob/master/CHANGELOG.md#440-2017-12-20

Get Vim on Mac terminal to copy to the clipboard

I'm using Vim on a Mac, installed via homebrew, version 8.0.
Vim --version shows +clipboard, and -xterm_clipboard.
I've tried
set clipboard=unnamed
in .vimrc
But I cannot get yanks to go on to the system clipboard. What do I do?
It should "just work" on MacVim. One of the reasons I'm using it is for its OSX integration, including clipboard.
brew install macvim
mvim defaults to graphical mode. To run it in terminal mode:
mvim -v
In the past, I had an alias for vim -> mvim -v which handles most cases. These days I use the following script in ~/bin/vim, which is in my $PATH:
#!/bin/bash
mvim -v "$#"
seems like something is overriding your clipboard setting after loading your vimrc.
try :verbose set clipboard?. It should tell you when and where this variable was last set.
This guide gives you a bunch of hints on what to do to figure out what's going on and fix the problem

I have to type export PATH=~/anaconda/bin:"$PATH" everytime I rerun the terminal

I have installed the Anaconda for Mac, but there is something wrong with me:
when I type the commandwhich conda or which ipython, I get conda not found and ipython not find
Then I find this command export PATH=~/anaconda/bin:"$PATH" works for me. It solves the problem above, but everytime I rerun the terminal the problem is still there, I have to type it again.
so I want to find a way to solve the problem fundamentally
I have tried to add it into the ~/.bashrc, ~/.profile, ~/.bash_profile, but these don't work for me.
Try this in .bash_profile
export PATH="$HOME/anaconda/bin:$PATH"
Then try launching a new terminal and running:
echo $PATH
The output should start with /anaconda/bin:
If that still doesn't work... A work around might be to invoke bash after running terminal i.e. type "bash". Which should cause bash to launch with .bash_profile
I run on MacOs Catalina 10.15 and this did the trick for me:
shell is zsh !
$ source /Users/myprofilename/anaconda3/bin/activate
then
$ conda init zsh
the new anaconda documentation also highlights this:
Make sure you're not using ZShell or another form of a shell. If the case you'd have to add the path to your respective shell file, e.g .zshrc.
sudo xed /etc/environment
after open this archive add :/home/youruser/anaconda3/bin
If you're using ZShell follow the steps below:
In your terminal type open ~/.zshrc
Add the following to the file export PATH=/opt/homebrew/bin:$PATH
Save your file and then run the following command source ~/.zshrc
Please note that the homebrew path on Apple silicon is /opt/homebrew/bin

Why can't I run emacs in X11

I have Emacs installed as an app on my computer and I set a shortcut in my bash_profile as well.
alias emacs='/Applications/Emacs.app/Contents/MacOS/Emacs'
However, x11 doesn't find emacs but when I use Terminal, it runs just fine.
Why could this be?
When I start an xterm in XQuartz, the ~/.bash_profile file is not sourced for some reason. Try putting the alias into ~/.bashrc instead.

Resources