]> git.mdlowis.com Git - archive/vim_config.git/commitdiff
Check in local changes
authorMike D. Lowis <mike.lowis@gentex.com>
Mon, 29 Jul 2013 15:17:34 +0000 (11:17 -0400)
committerMike D. Lowis <mike.lowis@gentex.com>
Mon, 29 Jul 2013 15:17:34 +0000 (11:17 -0400)
filetype.vim
projects/gentex.vim
templates/ctx.m4 [new file with mode: 0644]
templates/it.m4 [new file with mode: 0644]
vimrc

index db4fca6511ed662d73bbe3da0db5c3dd0aea9251..3515b2af7e7eb1e6be1c40c3a4d707fcd97813ae 100644 (file)
@@ -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
index cc4b79228d79f8df1ee3ba5831edac064d25b79c..8fcb8ef421f8aa79dde4701ea8e462bad4feddd8 100644 (file)
@@ -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<CR>#endif<up><END>
-abbreviate ifndef #ifndef<CR>#endif<up><END>
-abbreviate prf printf("");<left><left><left>
-
-abbreviate ctest
-    \void test_(void)<CR>
-    \{<CR>
-    \   // Setup<CR>
-    \   // Expected calls<CR>
-    \   // Function to test<CR>
-    \   // Asserts<CR>
-    \}<UP><UP><UP><UP><UP><UP><END><ESC>%i
-
 "------------------------------------------------------------------------------
 " Connect To CTags and CScope
 "------------------------------------------------------------------------------
diff --git a/templates/ctx.m4 b/templates/ctx.m4
new file mode 100644 (file)
index 0000000..707f718
--- /dev/null
@@ -0,0 +1,2 @@
+context 'ARGS' do
+end
diff --git a/templates/it.m4 b/templates/it.m4
new file mode 100644 (file)
index 0000000..bcae383
--- /dev/null
@@ -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 433eec03952b12b878cc512e061d821520a128ef..a564965a19faceb36228b20c5c21b49c871a9ba4 100644 (file)
--- 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 "<line1>,<line2>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 . "/" . <f-args> . ".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 <ESC>za
+map zz <ESC>za
 
 " ---- Indenting Visual Blocks ----
 vnoremap < <gv
@@ -183,7 +190,7 @@ map <Leader>h :nohl<CR>
 inoremap <C-Space> <C-n>
 
 " ---- Template Replacement ----
-map ;t :call Template(getline("."))<CR>jdd
+map <Leader>t :call Template(getline("."))<CR>jdd
 
 " ---- Buffer Management ----
 map  <C-S-tab>  :bp<CR>
@@ -191,15 +198,6 @@ imap <C-S-tab>  <ESC>:bp<CR>
 map  <C-tab>    :bn<CR>
 imap <C-tab>    <ESC>:bn<CR>
 
-" ---- Working With Windows ----
-map <M-h> <C-w>h
-map <M-j> <C-w>j
-map <M-k> <C-w>k
-map <M-l> <C-w>l
-map <M-c> <C-w>c
-map <M-v> :vs<CR>
-map <M-s> :split<CR>
-
 " ---- Moving Lines Around ----
 nmap <C-j> ddp
 imap <C-j> <ESC>ddpi
@@ -233,7 +231,7 @@ cnoreabbrev trim %s/\s\+$//
 cnoreabbrev tofn ToFn
 cnoreabbrev fn ToFn
 cnoreabbrev <expr> ff
-          \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs f f'  : 'ff')
+            \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs f f'  : 'ff')
 
 "==============================================================================
 " Auto Commands