Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add g:vimshell_enable_start_insert

  • Loading branch information...
commit 4adfdbf27688db0000de122a348d9786ea663dec 1 parent 508b188
@Shougo authored
View
4 autoload/vimshell/commands/iexe.vim
@@ -1,7 +1,7 @@
"=============================================================================
" FILE: iexe.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
-" Last Modified: 27 Nov 2013.
+" Last Modified: 20 Jan 2014.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
@@ -175,7 +175,7 @@ function! s:command.execute(commands, context) "{{{
call vimshell#interactive#execute_process_out(1)
if b:interactive.process.is_valid
- startinsert!
+ call vimshell#view#_simple_insert()
endif
endfunction"}}}
function! s:command.complete(args) "{{{
View
20 autoload/vimshell/view.vim
@@ -1,7 +1,7 @@
"=============================================================================
" FILE: view.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
-" Last Modified: 06 Jan 2014.
+" Last Modified: 20 Jan 2014.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
@@ -27,6 +27,11 @@
let s:save_cpo = &cpo
set cpo&vim
+" Global options definition. "{{{
+let g:vimshell_enable_start_insert =
+ \ get(g:, 'vimshell_enable_start_insert', 1)
+"}}}
+
function! vimshell#view#_get_prompt(...) "{{{
let line = get(a:000, 0, line('.'))
let interactive = get(a:000, 1,
@@ -180,14 +185,21 @@ function! vimshell#view#_start_insert(...) "{{{
let is_insert = (a:0 == 0)? 1 : a:1
+ call cursor(line('$'), col('$'))
+
if is_insert
" Enter insert mode.
- $
- startinsert!
+ call vimshell#view#_simple_insert()
call vimshell#helpers#imdisable()
+ endif
+endfunction"}}}
+function! vimshell#view#_simple_insert() "{{{
+ if g:vimshell_enable_start_insert
+ startinsert!
else
- normal! $
+ stopinsert
+ call cursor(0, col('$'))
endif
endfunction"}}}
function! vimshell#view#_cd(directory) "{{{
View
7 doc/vimshell.txt
@@ -361,6 +361,12 @@ g:vimshell_enable_transient_user_prompt
Default value is 0.
+ *g:vimshell_enable_start_insert*
+g:vimshell_enable_start_insert
+ If it is non-zero, vimshell will start in insert mode.
+
+ Default value is 0.
+
*g:vimshell_execute_file_list*
g:vimshell_execute_file_list
This is a dictionary value that has keys of the extensions
@@ -950,7 +956,6 @@ EXAMPLES *vimshell-examples*
>
let g:vimshell_user_prompt = 'fnamemodify(getcwd(), ":~")'
"let g:vimshell_right_prompt = 'vcs#info("(%s)-[%b]", "(%s)-[%b|%a]")'
- let g:vimshell_enable_smart_case = 1
if has('win32') || has('win64')
" Display user name on Windows.
View
2  plugin/vimshell.vim
@@ -1,7 +1,7 @@
"=============================================================================
" FILE: vimshell.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
-" Last Modified: 17 Jan 2014.
+" Last Modified: 20 Jan 2014.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
Please sign in to comment.
Something went wrong with that request. Please try again.