Skip to content

Instantly share code, notes, and snippets.

@subdigital
Last active August 17, 2021 15:44
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save subdigital/d533871b25e96a55cf31 to your computer and use it in GitHub Desktop.
Save subdigital/d533871b25e96a55cf31 to your computer and use it in GitHub Desktop.
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
\" 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