mrkd
3/31/2016 - 12:18 AM

minimal vim setup for linux servers / vms + swift

minimal vim setup for linux servers / vms + swift

#! /bin/bash

set -e

if [[ -f ~/.vimrc ]]
then
  echo "You already have a ~/.vimrc. Aborting to avoid losing data..."
  exit 1
fi

echo "installing pathogen"
mkdir -p ~/.vim/bundle ~/.vim/autoload
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

echo "installing sensible.vim..."
cd ~/.vim/bundle && git clone https://github.com/tpope/vim-sensible.git

echo "installing nerdtree.vim"
cd ~/.vim/bundle && git clone https://github.com/scrooloose/nerdtree.git

echo "installing swift.vim"
cd ~/.vim/bundle && git clone https://github.com/keith/swift.vim.git

echo "Adding contents to ~/.vimrc"
echo "set nocompatible

execute pathogen#infect()

syntax on
filetype plugin indent on
color delek
set vb
let mapleader = \",\"
set number
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab

:nnoremap <leader>n :NERDTreeToggle<cr>

\" easier window movement
:nnoremap <C-H> <C-W>h
:nnoremap <C-J> <C-W>j
:nnoremap <C-K> <C-W>k
:nnoremap <C-L> <C-W>l

" > ~/.vimrc

echo "Done!"