Adding astyle bits for arduino + a smidge of unrelated cleanup

main
Dan Buch 10 years ago
parent 2f68be8e4a
commit 064b840f5c

@ -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<CR>:execute '!astyle' shellescape(expand('%'), 1)<CR>:e<CR>:make<CR><CR><CR>
" 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()<CR>
nnoremap H :call MyPrev()<CR>
" astyle the whole thing
map ,a :execute '!astyle' shellescape(expand('%'), 1)<CR>:e<CR>
" easy indentation in visual mode
" This keeps the visual selection active after indenting.
" Usually the visual selection is lost after you indent it.

Loading…
Cancel
Save