Commits

Brodie Rao committed 332f525

Reorganized auto command stuff

  • Participants
  • Parent commits 9e87d17

Comments (0)

Files changed (1)

 set smarttab
 set softtabstop=4
 set textwidth=78
+if has("autocmd")
+    autocmd FileType css,html,htmldjango,xhtml,xml
+                   \ setlocal shiftwidth=2 softtabstop=2
+endif
 
 " Search
 set hlsearch
 if has("syntax")
     syntax enable " Automatic syntax highlighting
 endif
-
-" Auto-commands
 if has("autocmd")
-    " Tabbing settings
-    autocmd FileType css,html,htmldjango,xhtml,xml
-                   \ setlocal shiftwidth=2 softtabstop=2
     autocmd FileType python highlight PyFlakes gui=bold guibg=#aa2222
-    " Resize splits when the window is resized
-    autocmd VimResized * :wincmd =
-
-    " Set the cursor line in the active window
-    if has("gui")
-        augroup cline
-            autocmd!
-            autocmd WinLeave,InsertEnter * set nocursorline
-            autocmd WinEnter,InsertLeave * set cursorline
-        augroup END
-    endif
-
-    " Restore the line the cursor was on when reloading a file
-    augroup line_return
-        autocmd!
-        autocmd BufReadPost *
-            \ if line("'\"") > 0 && line("'\"") <= line("$") |
-            \     execute 'normal! g`"zvzz' |
-            \ endif
-    augroup END
 endif
 
 " Leader bindings
 
 let g:ctrlp_user_command = ['.git/', my_ctrlp_git_command, my_ctrlp_user_command]
 
+" Window/buffer management
 function! SmartSplit()
     vsplit
     if winwidth(0) <= &columns
     endif
 endfunction
 
-" Window/buffer management
 nnoremap <silent> <Leader>c <Esc>:bd<CR>
 nnoremap <silent> <Leader>q <Esc>:q<CR>
 nnoremap <silent> <Leader>Q <Esc>:qa<CR>
 nnoremap <C-k> <C-w>k
 nnoremap <C-l> <C-w>l
 
+if has("autocmd")
+    " Resize splits when the window is resized
+    autocmd VimResized * :wincmd =
+
+    " Set the cursor line in the active window
+    if has("gui")
+        augroup cline
+            autocmd!
+            autocmd WinLeave,InsertEnter * set nocursorline
+            autocmd WinEnter,InsertLeave * set cursorline
+        augroup END
+    endif
+
+    " Restore the line the cursor was on when reloading a file
+    augroup line_return
+        autocmd!
+        autocmd BufReadPost *
+            \ if line("'\"") > 0 && line("'\"") <= line("$") |
+            \     execute 'normal! g`"zvzz' |
+            \ endif
+    augroup END
+endif
+
 " Clear search highlighting
 nnoremap <silent> <Leader><Space> <Esc>:noh<CR>