Skip to content

Commit

Permalink
Fixed vim +GoInstallBinaries
Browse files Browse the repository at this point in the history
 - prevent clobbering terminal
 - add $HOME/go/bin to PATH if not set .zshrc
  • Loading branch information
Phillip Miller committed Oct 17, 2021
1 parent 352c818 commit b356560
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 8 deletions.
14 changes: 9 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
# Changelog

## [v1.5.2](https://github.com/mr-pmillz/pimp-my-shell/tree/v1.5.2) (2021-10-17)
## [v1.5.3](https://github.com/mr-pmillz/pimp-my-shell/tree/v1.5.3) (2021-10-17)

[Full Changelog](https://github.com/mr-pmillz/pimp-my-shell/compare/v1.4.5...v1.5.2)
[Full Changelog](https://github.com/mr-pmillz/pimp-my-shell/compare/v1.5.2...v1.5.3)

## [v1.4.5](https://github.com/mr-pmillz/pimp-my-shell/tree/v1.4.5) (2021-10-16)
## [v1.5.2](https://github.com/mr-pmillz/pimp-my-shell/tree/v1.5.2) (2021-10-17)

[Full Changelog](https://github.com/mr-pmillz/pimp-my-shell/compare/v1.5.1...v1.4.5)
[Full Changelog](https://github.com/mr-pmillz/pimp-my-shell/compare/v1.5.1...v1.5.2)

## [v1.5.1](https://github.com/mr-pmillz/pimp-my-shell/tree/v1.5.1) (2021-10-16)

[Full Changelog](https://github.com/mr-pmillz/pimp-my-shell/compare/v1.5.0...v1.5.1)
[Full Changelog](https://github.com/mr-pmillz/pimp-my-shell/compare/v1.4.5...v1.5.1)

## [v1.4.5](https://github.com/mr-pmillz/pimp-my-shell/tree/v1.4.5) (2021-10-16)

[Full Changelog](https://github.com/mr-pmillz/pimp-my-shell/compare/v1.5.0...v1.4.5)

## [v1.5.0](https://github.com/mr-pmillz/pimp-my-shell/tree/v1.5.0) (2021-10-16)

Expand Down
1 change: 0 additions & 1 deletion extra/extra.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ func InstallExtraPackages(osType string, dirs *localio.Directories, packages *lo
}
}


// install fzf configuration
if exists, err := localio.Exists(fmt.Sprintf("%s/.fzf", dirs.HomeDir)); err == nil && !exists {
installString := fmt.Sprintf("git clone --depth 1 https://github.com/junegunn/fzf.git %s/.fzf && %s/.fzf/install --all", dirs.HomeDir, dirs.HomeDir)
Expand Down
3 changes: 2 additions & 1 deletion vim/vim.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ func InstallVimPlugins(osType string, dirs *localio.Directories) error {
return err
}

if err := localio.RunCommandPipeOutput("vim -c \"GoInstallBinaries\" -c \"qa\""); err != nil {
fmt.Println("[+] Installing vim binaries via +GoInstallBinaries")
if err := localio.RunCommandPipeOutput("vim -es -c \"GoInstallBinaries\" -c \"qa\" || true"); err != nil {
return err
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Add ~/go/bin to path
[[ ":$PATH:" != *":$HOME/go/bin:"* ]] && export PATH="${PATH}:$HOME/go/bin"

# Set CTRL+U to only delete backwards to the left of the cursor.
bindkey \^U backward-kill-line

Expand Down
11 changes: 11 additions & 0 deletions zsh/templates/linux/.zshrc_extra.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Add ~/go/bin to path
[[ ":$PATH:" != *":$HOME/go/bin:"* ]] && export PATH="${PATH}:$HOME/go/bin"
# For linux add ~/.local/bin to path
[[ ":$PATH:" != *":$HOME/.locaal/bin:"* ]] && export PATH="${PATH}:$HOME/.local/bin"

# Set CTRL+U to only delete backwards to the left of the cursor.
bindkey \^U backward-kill-line

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
POWERLEVEL9K_INSTANT_PROMPT=quiet
4 changes: 3 additions & 1 deletion zsh/zsh.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,12 @@ func InstallOhMyZsh(osType string, dirs *localio.Directories) error {
return err
}

zshExtraConfig, err := zshConfigs.ReadFile("templates/.zshrc_extra.zsh")
zshExtraConfigTemplate := fmt.Sprintf("templates/%s/.zshrc_extra.zsh", osType)
zshExtraConfig, err := zshConfigs.ReadFile(zshExtraConfigTemplate)
if err != nil {
return err
}

if err := localio.EmbedFileStringAppendToDest(zshExtraConfig, "~/.zshrc"); err != nil {
return err
}
Expand Down

0 comments on commit b356560

Please sign in to comment.