diff --git a/Nvim-setup-in-Linux.md b/Nvim-setup-in-Linux.md index 47c4e80..e2c2d8c 100644 --- a/Nvim-setup-in-Linux.md +++ b/Nvim-setup-in-Linux.md @@ -46,13 +46,13 @@ if [[ ! "$PYTHON_INSTALLED" = true ]]; then # Install conda silently if [[ -d $CONDA_DIR ]]; then - rm -rf $CONDA_DIR + rm -rf "$CONDA_DIR" fi - bash $HOME/packages/$CONDA_NAME -b -p $CONDA_DIR + bash "$HOME/packages/$CONDA_NAME" -b -p "$CONDA_DIR" # Setting up environment variables if [[ "$ADD_TO_SYSTEM_PATH" = true ]]; then - echo "export PATH=$CONDA_DIR/bin:$PATH" >> $HOME/.bash_profile + echo "export PATH=$CONDA_DIR/bin:$PATH" >> "$HOME/.bash_profile" fi fi @@ -82,7 +82,7 @@ RIPGREP_LINK="https://github.com/BurntSushi/ripgrep/releases/download/11.0.2/rip if [[ ! -f $RIPGREP_SRC_NAME ]]; then echo "Downloading ripgrep and renaming" - wget $RIPGREP_LINK -O $RIPGREP_SRC_NAME + wget $RIPGREP_LINK -O "$RIPGREP_SRC_NAME" fi if [[ ! -d "$RIPGREP_DIR" ]]; then @@ -91,10 +91,10 @@ if [[ ! -d "$RIPGREP_DIR" ]]; then fi echo "Extracting to $HOME/tools/ripgrep directory" -tar zxvf $RIPGREP_SRC_NAME -C $RIPGREP_DIR --strip-components 1 +tar zxvf "$RIPGREP_SRC_NAME" -C "$RIPGREP_DIR" --strip-components 1 if [[ "$ADD_TO_SYSTEM_PATH" = true ]]; then - echo "export PATH=$RIPGREP_DIR:$PATH" >> $HOME/.bash_profile + echo "export PATH=$RIPGREP_DIR:$PATH" >> "$HOME/.bash_profile" fi ####################################################################### @@ -107,16 +107,16 @@ CTAGS_DIR=$HOME/tools/ctags CTAGS_LINK="https://github.com/universal-ctags/ctags.git" if [[ ! -d $CTAGS_SRC_DIR ]]; then - mkdir -p $CTAGS_SRC_DIR + mkdir -p "$CTAGS_SRC_DIR" fi -cd $CTAGS_SRC_DIR +cd "$CTAGS_SRC_DIR" git clone $CTAGS_LINK . -./autogen.sh && ./configure --prefix=$CTAGS_DIR -make -j$(nproc) && make install +./autogen.sh && ./configure --prefix="$CTAGS_DIR" +make -j && make install if [[ "$ADD_TO_SYSTEM_PATH" = true ]]; then - echo "export PATH=$CTAGS_DIR/bin:$PATH" >> $HOME/.bash_profile + echo "export PATH=$CTAGS_DIR/bin:$PATH" >> "$HOME/.bash_profile" fi ####################################################################### @@ -136,18 +136,18 @@ fi echo "Downloading Neovim" if [[ ! -f $NVIM_SRC_NAME ]]; then - wget $NVIM_LINK -O $NVIM_SRC_NAME + wget "$NVIM_LINK" -O "$NVIM_SRC_NAME" fi echo "Extracting neovim" -tar zxvf $NVIM_SRC_NAME --strip-components 1 -C $NVIM_DIR +tar zxvf "$NVIM_SRC_NAME" --strip-components 1 -C "$NVIM_DIR" echo "Setting up config and installing plugins" -git clone https://github.com/jdhao/nvim-config.git $NVIM_CONFIG_DIR \ - && $NVIM_DIR/bin/nvim +PlugInstall +qall +git clone https://github.com/jdhao/nvim-config.git "$NVIM_CONFIG_DIR" \ + && "$NVIM_DIR/bin/nvim" +PlugInstall +qall if [[ "$ADD_TO_SYSTEM_PATH" = true ]]; then - echo "export PATH=$NVIM_DIR/bin:$PATH" >> $HOME/.bash_profile + echo "export PATH=$NVIM_DIR/bin:$PATH" >> "$HOME/.bash_profile" fi @@ -155,5 +155,6 @@ fi # Post processing # ####################################################################### # Let PATH changes take effect -source $HOME/.bash_profile +# shellcheck source=/dev/null +source "$HOME/.bash_profile" ``` \ No newline at end of file