Splitting up vimrc to work without plugins
<p>I work on multiple machines, the biggest challenge is when working on a server without the ability to use my plugins. </p>

<p>What I am trying to do is take my vimrc and separate all the plugin specific mappings, functions, plugin calls etc... So that way I can use them when I need them and not worry about them in server environments. This is where my lack of vim knowledge comes into play. </p>

<p>Here is my .vimrc, I was thinking of making a file for Plugins, and one for configs of the plugins. </p>

<pre><code>"-- Main / Behaviours -------------------------------------------------------
set nocompatible
set background=dark

filetype off

"-- Files &amp; Directories -----------------------------------------------------
set nobackup            " do not make backups
set noswapfile          " no swapfile

"-- General &amp; UI Settings ---------------------------------------------------
colorscheme solarized   " set the colorscheme

" set t_Co=256            " force terminal to 256 colors
" let g:solarized_termcolors=256

"set cursorcolumn        " highlights the current column
"set cursorline          " highlights the current line

set fileformats=unix,mac
set backspace=indent,eol,start
set lazyredraw          " redraw only when needed
set ls=2                " always show the status line
set mouse=a             " use mouse everywhere
set noerrorbells        " don't make a noise
set number              " show line numbers by default
set ruler               " show current position along the bottom
set scrolloff=999       " keep the cursor vertically centered
set showcmd             " show command being typed
set showmode            " display mode (INSERT/REPLACE/etc.)
set title               " Display name of file being edited

"set statusline=%F%m%r%h%w\[FORMAT=%{&amp;ff}]\[TYPE=%Y]\[ASCII=\%03.3b]\[HEX=\%02.2B]\ [WC:%{WordCount()}][POS=%04l,%04v][%p%%]\[LEN=%L]
"set viminfo='20,\"100,:20,%,n~/.viminfo"

"-- Searching ----------------------------------------------------------------
set ignorecase          " case insensitive searching by defalt
set incsearch           " show search matches while typing
set hlsearch            " highlight search results
set smartcase           " case insensitive if using capital letter
set wrapscan            " wrap around file when searching

"-- Text Formatting &amp; Layout Settings ----------------------------------------
set autoindent          " always set autoindenting on
set copyindent          " copy the previous indentation on autoindenting
set expandtab           " use spaces instead of tabs
set nocindent           " turn off c indenting
set nowrap              " turn off line wrapping
set pastetoggle=&lt;f2&gt;    " toggle paste
set shiftwidth=2        " match shifting to indenting
set showmatch           " show matching bracket [{(&lt; &gt;)}]
set smartindent         " extra level of indentation in some cases
set smarttab            " insert tabs start of line according to shiftwidth
set softtabstop=2       " indent 2 spaces by default
"set spell              " turn on spellcheck
set spellsuggest=5      " limit spell suggest to top 5 words
set tabstop=2           " set tab to 2 spaces

"-- Wildmenu ------------------------------------------------------------------
set wildmenu            " make tab completion for files buffers act like bash
set wildmode=list:longest,full
set wildignore=*.dll,*.o*.obj,*.bak,*.exe,*.pyc,\*.jpg,*.gif,*.png

"=============================================================================
" HIGHLIGHTING &amp; PLUGIN SETTINGS {{{
"=============================================================================
syntax on

"set list listchars=trail:_
"set listchars=tab:·\ ,trail:·,extends:»,precedes:«
":highlight SpecialKey ctermfg=darkgrey ctermbg=yellow

" don't show tabs in html,xml
autocmd filetype html,xml set listchars-=tab:&gt;.

" remove bracket highlighting
let g:loaded_matchparen = 1

" syntastic - chain multiple php checkers
let g:syntastic_php_checkers=['php', 'phpcs', 'phpmd']

" nerdtree - tabs open on console startup
" let g:nerdtree_tabs_open_on_console_startup=1

"=============================================================================
" CUSTOM KEYMAPPINGS
"
" &lt;leader&gt;dos: remove dos line-endings
" &lt;leader&gt;e: toggle NERDTree
" &lt;leader&gt;ev: edit vimrc
" &lt;leader&gt;sv: source vimrc
" &lt;leader&gt;l: toggle set list
" &lt;leader&gt;md: markdown to html
" &lt;leader&gt;mds: markdown to html and save as .html
" &lt;leader&gt;sn: set nopaste
" &lt;leader&gt;sp: set paste
" &lt;leader&gt;rw: remove trailing whitespace
" &lt;leader&gt;ww: toggle wrap
" &lt;leader&gt;&lt;space&gt;: turn off search highlight
" &lt;F4&gt;: toggle spellcheck
" &lt;F6&gt;: toggle no linenumbers
"
"=============================================================================
let mapleader=","

nmap &lt;leader&gt;dos :%s/\r//g
nmap &lt;leader&gt;e :NERDTreeToggle&lt;cr&gt;
nmap &lt;leader&gt;l :set list!&lt;cr&gt;
nmap &lt;leader&gt;md :%! /usr/local/bin/markdown/ --html4tags &lt;cr&gt;
nmap &lt;leader&gt;mds :%! /usr/local/bin/markdown/ --html4tags &lt;cr&gt;:saveas %:r.html&lt;cr&gt;
nmap &lt;leader&gt;sn :set nopaste&lt;cr&gt;
nmap &lt;leader&gt;sp :set paste&lt;cr&gt;
nmap &lt;leader&gt;rw :%s/\s\+$//e
nmap &lt;leader&gt;ww :set wrap!&lt;cr&gt;
nmap &lt;leader&gt;&lt;space&gt; :nohlsearch&lt;cr&gt;

" Quickly edit/reload the vimrc file
nmap &lt;silent&gt; &lt;leader&gt;ev :vsplit $MYVIMRC&lt;CR&gt;
nmap &lt;silent&gt; &lt;leader&gt;sv :so $MYVIMRC&lt;CR&gt;

map &lt;F4&gt; :setlocal spell! spelllang=en_us&lt;cr&gt;
map &lt;F6&gt; :setlocal nonumber!&lt;cr&gt;

"=============================================================================
" TEMPLATES &amp; CUSTOM VIM FILETYPE SETTINGS {{{
"=============================================================================
autocmd! BufNewFile * silent! or ~/.vim/templates/%:e.tpl

" create a file in ftplugin/filetype.vim for specific settings
au BufRead,BufNewFile,BufReadPost *.text,*.txt set filetype=text
au BufRead,BufNewFile,BufReadPost *.md set filetype=markdown
au BufRead,BufNewFile,BufReadPost *.jade set filetype=pug
au BufRead,BufNewFile,BufReadPost *.pug set filetype=pug
au BufRead,BufNewFile,BufReadPost *.coffee set filetype=coffee

let g:pencil#wrapModeDefault = 'soft'   " default is 'hard'

augroup pencil
  autocmd!
  autocmd FileType markdown,mkd call pencil#init()
  autocmd FileType text         call pencil#init({'wrap': 'hard'})
augroup END

"=============================================================================
" VIM FUNCTIONS
"=============================================================================
function! WordCount()
   let s:old_status = v:statusmsg
   let position = getpos(".")
   exe ":silent normal g\&lt;c-g&gt;"
   let stat = v:statusmsg
   let s:word_count = 0
   if stat != '--No lines in buffer--'
     let s:word_count = str2nr(split(v:statusmsg)[11])
     let v:statusmsg = s:old_status
   end
   call setpos('.', position)
   return s:word_count
endfunction

func! WordProcessorMode()
  set nonumber
  set tw=80
  set formatoptions=1
  set noexpandtab
  set wrap
  set spell spelllang=en_us
  set linebreak
  set nolist
  set complete+=s
  set formatprg=par
endfu
com! WP call WordProcessorMode()

"=============================================================================
" VIM PLUG SETUP &amp; CONFIGS
"=============================================================================

if empty(glob('~/.vim/autoload/plug.vim'))
  silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
        \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  autocmd VimEnter * PlugInstall | source $MYVIMRC
endif

call plug#begin('~/.vim/plugged')

Plug 'altercation/vim-colors-solarized'
Plug 'bling/vim-airline'
Plug 'godlygeek/tabular'
Plug 'jistr/vim-nerdtree-tabs'
Plug 'junegunn/goyo.vim'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'reedes/vim-pencil'
Plug 'scrooloose/nerdtree'
Plug 'scrooloose/syntastic'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-fugitive'
Plug 'sheerun/vim-polyglot'
Plug 'tpope/vim-surround'

" Experimental Plugins

" All of your Plugins must be added before the following line
call plug#end()              " required


" Brief help
" :PlugList          - list configured bundles
" :PlugInstall(!)    - install(update) bundles
" :PlugSearch(!) foo - search(or refresh cache first) for foo
" :PlugClean(!)      - confirm(or auto-approve) removal of unused bundles
"
" NOTE: comments after Plugin command are not allowed..
</code></pre>

<p>Probably everything below the basic configurations I will move so I can have a more natural vimrc on servers. </p>