From 80b5c29100569ebabd76082c3a4e21e3e444631a Mon Sep 17 00:00:00 2001
From: Chris Coley <chris@codingallnight.com>
Date: Tue, 16 Apr 2019 12:47:59 -0700
Subject: [PATCH] Cleanup the vimrc file

---
 vimrc | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/vimrc b/vimrc
index 6caec4c..77caf27 100644
--- a/vimrc
+++ b/vimrc
@@ -16,7 +16,7 @@ syntax enable           " Syntax highlighting
 set backspace=2         " Make Backspace work like you expect
 set formatoptions+=ro   " Automatically insert the comment character when you
                         " hit <Enter> (r) or o/O (o) in a comment block
-set commentstring=#%s   " The comment style for line comments
+set commentstring=#%s   " The default comment style for line comments
 let mapleader='\'       " The <leader> key
 
 
@@ -35,6 +35,11 @@ set incsearch           " Begin matching query as you type it
 set hlsearch            " Highlight search matches
 
 
+" Enable modeline
+set modeline
+set modelines=5
+
+
 " Code folding
 "set foldmethod=indent
 "set foldenable
@@ -69,18 +74,14 @@ endfunction
 
 " Make vim turn *off* expandtab for files named Makefile or makefile
 " We need the tab literal
-autocmd BufNewFile,BufRead [Mm]akefile* setlocal noexpandtab
+autocmd BufRead,BufNewFile [Mm]akefile* setlocal noexpandtab
 
 
 " Set the terminal title to reflect the open file. Even works with Vim tabs.
-autocmd BufEnter * let &titlestring = expand("%:t") . " - %{$USER}@" . hostname() | set title
-autocmd VimLeave * let &titleold = $USER . "@" . hostname() | set title
+autocmd BufEnter * let &titlestring = expand("%:t") . " - %{$USER}@" . hostname() | setlocal title
+autocmd VimLeave * let &titleold = $USER . "@" . hostname() | setlocal title
 
 
-" Enable modeline
-set modeline
-set modelines=5
-
 " Append a modeline at the end of a file. Uses '#' comment character
 nnoremap <leader>ml :call AppendModeline()<CR>
 function! AppendModeline()
-- 
GitLab