From 064b840f5c8096391eccf946dee5968e0f152d86 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sat, 8 Feb 2014 18:45:54 -0500 Subject: [PATCH] Adding astyle bits for arduino + a smidge of unrelated cleanup --- vimrc.after | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/vimrc.after b/vimrc.after index fbb15a8..031e73c 100644 --- a/vimrc.after +++ b/vimrc.after @@ -20,6 +20,11 @@ autocmd FileType ruby set shiftwidth=2 autocmd BufNew,BufRead *.ino,*.pde setf arduino +autocmd FileType arduino set tabstop=4 + \| set softtabstop=4 + \| let g:syntastic_cpp_check_header=0 + \| map ,t :w:execute '!astyle' shellescape(expand('%'), 1):e:make + " Set up some sane java compilation bits autocmd BufNew,BufRead *.java set efm=%A\ %#[javac]\ %f:%l:\ %m,%-Z\ %#[javac]\ %p^,%-C%.%# \| set makeprg=ant\ -find\ build.xml @@ -50,7 +55,7 @@ endfunction " MyNext() and MyPrev(): Movement between tabs OR buffers function! MyNext() - if exists( '*tabpagenr' ) && tabpagenr('$') != 1 + if exists('*tabpagenr') && tabpagenr('$') != 1 " Tab support && tabs open normal gt else @@ -59,7 +64,7 @@ function! MyNext() endif endfunction function! MyPrev() - if exists( '*tabpagenr' ) && tabpagenr('$') != '1' + if exists('*tabpagenr') && tabpagenr('$') != '1' " Tab support && tabs open normal gT else @@ -72,6 +77,9 @@ endfunction nnoremap L :call MyNext() nnoremap H :call MyPrev() +" astyle the whole thing +map ,a :execute '!astyle' shellescape(expand('%'), 1):e + " easy indentation in visual mode " This keeps the visual selection active after indenting. " Usually the visual selection is lost after you indent it.