Last active
August 17, 2021 15:44
-
-
Save subdigital/d533871b25e96a55cf31 to your computer and use it in GitHub Desktop.
minimal vim setup for linux servers / vms + swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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 | |
\" compile swift projects | |
:nnoremap <leader>B :!clear && swift build<cr> | |
" > ~/.vimrc | |
echo "Done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment