Skip to content

Commit

Permalink
New clean automated setup
Browse files Browse the repository at this point in the history
  • Loading branch information
sd65 committed Jun 1, 2016
1 parent 5270313 commit 4038bfe
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 22 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ Cmd | Action
`:UndoCloseTab` | Reopen the last close buffer/tab in a new tab
`:RemoveTrailingSpaces` | Remove the unwanted spaces at the end of lines

## How to add plugins to MiniVim

The [automated setup](#automated-setup) source in the main Vim configuration file *(.vimrc)* MiniVim.
This means that you have a clean and standard .vimrc.

**To keep MiniVim, don't delete the `source [...]/MiniVim` instruction in the .vimrc file.**

To add plugins, simply follow the plugin's instructions. You should manage them with a plugin manager as [Vundle](https://github.com/VundleVim/Vundle.vim) or the old [Pathogen](https://github.com/tpope/vim-pathogen).

## Other info

The file is **heavily** commented. You're welcome to open, read and change what you want. *It's easy.*
Expand All @@ -122,6 +131,11 @@ The file is **heavily** commented. You're welcome to open, read and change what

## Changelog

### 1.3.1

- New clean install with the [automated setup](#automated-setup)
- Small fixes

### 1.3

- Custom save function
Expand Down
61 changes: 40 additions & 21 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,33 +1,52 @@
#!/bin/sh

# Backup old .vimrc
if [ -f "$HOME/.vimrc" ] && ! [ -f "$HOME/.vimrc.beforeMiniVim" ]; then
vimrc="$HOME/.vimrc"
thisDir="$(cd "$(dirname "$0")" && pwd)"
shellRc="$HOME/.${SHELL##*/}rc"
s='source $HOME/.vim/MiniVim.vimrc'

## Backup old .vimrc
if [ -f "$vimrc" ] && ! [ -f "$HOME/.vimrc.beforeMiniVim" ]; then
echo "Backup old .vimrc to .vimrc.beforeMiniVim"
mv "$HOME/.vimrc" "$HOME/.vimrc.beforeMiniVim"
mv "$vimrc" "$HOME/.vimrc.beforeMiniVim"
fi

# Install
dir="$(cd "$(dirname "$0")" && pwd)"
echo "Creating the .vimrc..."
cp "${dir}/vimrc" "$HOME/.vimrc"
## Install
# Create the destination dir
echo "Creating the .vim dir..."
mkdir -p "$HOME/.vim"
# Copying the MiniVim file
echo "Copying the MiniVim config..."
cp "${thisDir}/vimrc" "$HOME/.vim/MiniVim.vimrc"
# Sourcing in the main vimrc
touch "$vimrc"
if fgrep -q "$s" "$vimrc"; then
echo "Great, your already installed MiniVim."
else
echo "Configuring the .vimrc..."
echo "$s" >> "$vimrc"
fi

# Set an option in your shell to ignore XOFF and XON signals
# (in order to use Ctrl S and Ctrl Q)
rc="$HOME/.${SHELL##*/}rc"
if [ -f "$rc" ] && fgrep -q "stty -ixon" "$rc"; then
echo "Ignoring XON signals...."
echo "stty -ixon" >> "$HOME/.${SHELL##*/}rc"
## Set an option in your shell to ignore XOFF and XON signals
## (in order to use Ctrl S and Ctrl Q)
if [ -f "$shellRc" ]; then
if fgrep -q "stty -ixon" "$shellRc"; then
echo "Great, your shell is already ignoring XON signals."
else
echo "Ignoring XON signals...."
echo "stty -ixon" >> "$shellRc"
echo "> You need to reload your shell config by running :"
echo " source $shellRc"
echo "Or by opening a new terminal prompt."
fi
else
echo "No shell configuration file found."
echo "You must have yourself this line :"
echo "Add this line to your shell config (.bashrc, .zshrc, etc) :"
echo "stty -ixon"
echo "Then open a new terminal prompt"
fi

# Ready
echo
echo "Installed!"
echo "You need to reload your shell config by running:"
echo " source \"$HOME/.${SHELL##*/}rc\""
echo "Or by opening a new terminal prompt."
## Ready
echo
echo "Then you're ready to use MiniVim!"
echo "> Installed !"
echo "Just open vim now."
2 changes: 1 addition & 1 deletion vimrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Details on : https://github.com/sd65/MiniVim
let MiniVimVersion = "1.3"
let MiniVimVersion = "1.3.1"
let UseCustomKeyBindings = 1
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Expand Down

0 comments on commit 4038bfe

Please sign in to comment.