Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change g:vimshell_data_directory default value

  • Loading branch information...
commit 9d9b8a5e6513affb04860d857b353c088af5becc 1 parent a93ddae
@Shougo authored
View
13 autoload/vimshell.vim
@@ -1,7 +1,7 @@
"=============================================================================
" FILE: vimshell.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
-" Last Modified: 06 Jan 2014.
+" Last Modified: 04 Feb 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
@@ -32,7 +32,7 @@ if !exists('g:loaded_vimshell')
endif
function! vimshell#version() "{{{
- return str2nr(printf('%02d%02d', 11, 0))
+ return str2nr(printf('%02d%02d', 11, 1))
endfunction"}}}
function! vimshell#echo_error(string) "{{{
@@ -123,11 +123,14 @@ function! vimshell#is_interactive() "{{{
\ || (b:interactive.type ==# 'vimshell' && is_valid)
endfunction"}}}
function! vimshell#get_data_directory()
- if !isdirectory(g:vimshell_temporary_directory) && !vimshell#util#is_sudo()
- call mkdir(g:vimshell_temporary_directory, 'p')
+ let data_directory = vimshell#util#substitute_path_separator(
+ \ vimshell#util#set_default('g:vimshell_temporary_directory',
+ \ expand('~/.cache/vimshell'), 'g:vimshell_temporary_directory'))
+ if !isdirectory(data_directory) && !vimshell#util#is_sudo()
+ call mkdir(data_directory, 'p')
endif
- return g:vimshell_temporary_directory
+ return data_directory
endfunction
"}}}
View
12 autoload/vimshell/util.vim
@@ -1,7 +1,7 @@
"=============================================================================
" FILE: util.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
-" Last Modified: 01 Jan 2014.
+" Last Modified: 04 Feb 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
@@ -115,6 +115,16 @@ function! vimshell#util#expand(path) "{{{
\ '^\$\h\w*', '\=eval(submatch(0))', '') :
\ a:path)
endfunction"}}}
+function! vimshell#util#set_default(var, val, ...) "{{{
+ if !exists(a:var) || type({a:var}) != type(a:val)
+ let alternate_var = get(a:000, 0, '')
+
+ let {a:var} = exists(alternate_var) ?
+ \ {alternate_var} : a:val
+ endif
+
+ return {a:var}
+endfunction"}}}
function! vimshell#util#set_default_dictionary_helper(variable, keys, value) "{{{
for key in split(a:keys, '\s*,\s*')
if !has_key(a:variable, key)
View
13 doc/vimshell.txt
@@ -1,6 +1,6 @@
*vimshell.txt* Powerful shell implemented by Vim script
-Version: 11.0
+Version: 11.1
Author : Shougo <Shougo.Matsu@gmail.com>
License: MIT license {{{
Permission is hereby granted, free of charge, to any person obtaining
@@ -241,11 +241,14 @@ g:vimshell_use_terminal_command
Initial value is an empty string.
-g:vimshell_temporary_directory *g:vimshell_temporary_directory*
- Sets a temporary directory used by vimshell. And history file
- is saved in this directory.
+g:vimshell_data_directory *g:vimshell_data_directory*
+ Specify directories to store vimshell configurations. And
+ history file is saved in this directory.
+
+ Initial value is "expand('~/.cache/vimshell')".
- Initial value is "expand('~/.vimshell')".
+g:vimshell_temporary_directory *g:vimshell_temporary_directory*
+ Note: It is deprecated name.
g:vimshell_max_command_history *g:vimshell_max_command_history*
Maximum number of entries in history.
View
6 plugin/vimshell.vim
@@ -1,7 +1,7 @@
"=============================================================================
" FILE: vimshell.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
-" Last Modified: 03 Feb 2014.
+" Last Modified: 04 Feb 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
@@ -41,10 +41,6 @@ let g:vimshell_enable_debug =
\ get(g:, 'vimshell_enable_debug', 0)
let g:vimshell_use_terminal_command =
\ get(g:, 'vimshell_use_terminal_command', '')
-let g:vimshell_temporary_directory =
- \ substitute(fnamemodify(get(
- \ g:, 'vimshell_temporary_directory', '~/.vimshell'),
- \ ':p'), '\\', '/', 'g')
let g:vimshell_max_command_history =
\ get(g:, 'vimshell_max_command_history', 1000)
let g:vimshell_max_directory_stack =
Please sign in to comment.
Something went wrong with that request. Please try again.