Commits

rride_a committed b62867b

Added '-login' options to the bash cmd

Comments (0)

Files changed (1)

 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 " Development settings {{{
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" 'Shell cmd args...' will show shell cmd in a scratch buffer
+command! -complete=shellcmd -nargs=+ Shell call s:RunShellCommand(<q-args>)
+function! s:RunShellCommand(cmdline)
+    echo a:cmdline
+    let expanded_cmdline = a:cmdline
+        for part in split(a:cmdline, ' ')
+            if part[0] =~ '\v[%#<]'
+                let expanded_part = fnameescape(expand(part))
+                let expanded_cmdline = substitute(expanded_cmdline, part, expanded_part, '')
+            endif
+        endfor
+    botright new
+    setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile nowrap
+    call setline(1, 'You entered:    ' . a:cmdline)
+    call setline(2, 'Expanded Form:  ' .expanded_cmdline)
+    call setline(3,substitute(getline(2),'.','=','g'))
+    execute '$read !'. expanded_cmdline
+    setlocal nomodifiable
+    1
+endfunction
+if has("mac") || has("unix")
+    if &shell == "/bin/bash"
+        " this will make bash to read config file on startup
+        set shellcmdflag=-login\ -c
+    endif
+endif
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Development settings {{{
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 
 augroup prog
     "echo 123
 
 command! CloseHiddenBuffers call s:CloseHiddenBuffers()
 function! s:CloseHiddenBuffers()
-  let open_buffers = []
+    let open_buffers = []
 
-  for i in range(tabpagenr('$'))
-    call extend(open_buffers, tabpagebuflist(i + 1))
-  endfor
+    for i in range(tabpagenr('$'))
+        call extend(open_buffers, tabpagebuflist(i + 1))
+    endfor
 
-  for num in range(1, bufnr("$") + 1)
-    if buflisted(num) && index(open_buffers, num) == -1
-      exec "bdelete ".num
-    endif
-  endfor
+    for num in range(1, bufnr("$") + 1)
+        if buflisted(num) && index(open_buffers, num) == -1
+            exec "bdelete ".num
+        endif
+    endfor
 endfunction
 
-" 'Shell cmd args...' will show shell cmd in a scratch buffer
-command! -complete=shellcmd -nargs=+ Shell call s:RunShellCommand(<q-args>)
-function! s:RunShellCommand(cmdline)
-  echo a:cmdline
-  let expanded_cmdline = a:cmdline
-  for part in split(a:cmdline, ' ')
-     if part[0] =~ '\v[%#<]'
-        let expanded_part = fnameescape(expand(part))
-        let expanded_cmdline = substitute(expanded_cmdline, part, expanded_part, '')
-     endif
-  endfor
-  botright new
-  setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile nowrap
-  call setline(1, 'You entered:    ' . a:cmdline)
-  call setline(2, 'Expanded Form:  ' .expanded_cmdline)
-  call setline(3,substitute(getline(2),'.','=','g'))
-  execute '$read !'. expanded_cmdline
-  setlocal nomodifiable
-  1
-endfunction
 
 let tmp_dir=vimfiles_dir.'.tmp/'
 let tag_dir=tmp_dir.'tags/'