From: Mike D. Lowis Date: Mon, 29 Jul 2013 15:17:34 +0000 (-0400) Subject: Check in local changes X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=722adce7f32e4b979f0d26b6c3b6250e28fde30f;p=archive%2Fvim_config.git Check in local changes --- diff --git a/filetype.vim b/filetype.vim index db4fca6..3515b2a 100644 --- a/filetype.vim +++ b/filetype.vim @@ -7,4 +7,6 @@ augroup filetypedetect au! BufRead,BufNewFile *.pslt setfiletype pslt au! BufRead,BufNewFile *.rkt setfiletype scheme au! BufRead,BufNewFile *.md setfiletype markdown + au! BufRead,BufNewFile SConstruct setfiletype python + au! BufRead,BufNewFile *.scons setfiletype python augroup END diff --git a/projects/gentex.vim b/projects/gentex.vim index cc4b792..8fcb8ef 100644 --- a/projects/gentex.vim +++ b/projects/gentex.vim @@ -106,27 +106,12 @@ let g:DoxygenToolkit_authorExtra = "$HeadURL$" if( (&ft == "c") || (&ft == "cpp") ) setlocal cindent setlocal cino={1s=1s:1s(1s +elseif(&ft == "ruby") + setlocal tabstop=2 + setlocal shiftwidth=2 + set softtabstop=2 endif -"============================================================================== -" Abbreviations -"============================================================================== -" Normal mode abbreviations -abbreviate inc #include -abbreviate def #define -abbreviate ifdef #ifdef#endif -abbreviate ifndef #ifndef#endif -abbreviate prf printf(""); - -abbreviate ctest - \void test_(void) - \{ - \ // Setup - \ // Expected calls - \ // Function to test - \ // Asserts - \}%i - "------------------------------------------------------------------------------ " Connect To CTags and CScope "------------------------------------------------------------------------------ diff --git a/templates/ctx.m4 b/templates/ctx.m4 new file mode 100644 index 0000000..707f718 --- /dev/null +++ b/templates/ctx.m4 @@ -0,0 +1,2 @@ +context 'ARGS' do +end diff --git a/templates/it.m4 b/templates/it.m4 new file mode 100644 index 0000000..bcae383 --- /dev/null +++ b/templates/it.m4 @@ -0,0 +1,6 @@ +it 'ARGS' do + # create test state/variables + # mocks/stubs/expected calls + # execute method + # validate results +end diff --git a/vimrc b/vimrc index 433eec0..a564965 100644 --- a/vimrc +++ b/vimrc @@ -31,7 +31,7 @@ set visualbell t_vb= " Turn off visual and error bells set noerrorbells " Turn off auditory bells set hid " Change buffer without saving set clipboard=unnamed " Yank and Put commands use the system clipboard -set laststatus=2 " Turn off the status line +set laststatus=2 " Turn on the status line always set undodir=$VIMHOME/undo " Set directory for storing undo files set undofile " Turn on persistent undo set cscopetag " Search both cscope dbs and ctags files for tags @@ -49,6 +49,8 @@ set lazyredraw " Don't redraw unless we need to set formatoptions+=r " Enable continuation of comments after a newline set omnifunc=syntaxcomplete#Complete " Auto complete based on syntax set completeopt=menu,longest " Show a popup menu with the longest common prefix selected +set wildmode=list:full +set wildmenu "============================================================================== " Global Variables @@ -76,10 +78,10 @@ set statusline+=%<%=[%l][%c][%P][%L]%< " ToFn - Converts a group of C function prototypes to definitions command! -range=% -nargs=0 ToFn execute ",s/;/\r{\r\r}\r/" -" Todo - Opens ~/.todo.md for editing +" Todo - Opens g:TodoList for editing command! Todo execute "edit " . g:TodoList -" Todo - Opens ~/.todo.md for editing +" Template - Opens the specified template for editing command! -nargs=1 Template execute "edit " . g:TemplateDir . "/" . . ".m4" " LoadProject - Searches for and loads project specific settings @@ -98,10 +100,12 @@ endfunction " ReformatWhiteSpace - Convert tabs to spaces and remove trailing whitespace function! ReformatWhiteSpace() + let line_num = line(".") if &modifiable retab silent! exec("%s/\\s\\+$//") endif + execute(":" . line_num) endfunction " Template - Finds and inserts the text of the given template @@ -111,6 +115,9 @@ function! Template(input) let targs = strpart(a:input,stridx(a:input,' ')+1) if filereadable( tdir . '/' . tname ) execute(".-1read !m4 -DARGS='" . targs . "' -I" . tdir . " " . tname) + let line_num = line(".") + execute("normal G=gg") + execute(":" . line_num) else echoerr "No template found: " . tname endif @@ -170,7 +177,7 @@ map j gj map k gk " ---- Toggle Fold ---- -map zz za +map zz za " ---- Indenting Visual Blocks ---- vnoremap < h :nohl inoremap " ---- Template Replacement ---- -map ;t :call Template(getline("."))jdd +map t :call Template(getline("."))jdd " ---- Buffer Management ---- map :bp @@ -191,15 +198,6 @@ imap :bp map :bn imap :bn -" ---- Working With Windows ---- -map h -map j -map k -map l -map c -map :vs -map :split - " ---- Moving Lines Around ---- nmap ddp imap ddpi @@ -233,7 +231,7 @@ cnoreabbrev trim %s/\s\+$// cnoreabbrev tofn ToFn cnoreabbrev fn ToFn cnoreabbrev ff - \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs f f' : 'ff') + \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs f f' : 'ff') "============================================================================== " Auto Commands