mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-02 22:10:06 +08:00
Fix defx
This commit is contained in:
parent
dc3c23fe3e
commit
4ae4cad290
@ -134,28 +134,33 @@ function! s:defx_init()
|
|||||||
\ defx#do_action('change_vim_cwd')
|
\ defx#do_action('change_vim_cwd')
|
||||||
endf
|
endf
|
||||||
|
|
||||||
|
" in this function we should vim-choosewin if possible
|
||||||
function! DefxSmartL(_)
|
function! DefxSmartL(_)
|
||||||
if defx#is_directory()
|
if defx#is_directory()
|
||||||
call defx#call_action('open_tree')
|
call defx#call_action('open_tree')
|
||||||
normal! j
|
normal! j
|
||||||
else
|
else
|
||||||
let filepath = defx#get_candidate()['action__path']
|
let filepath = defx#get_candidate()['action__path']
|
||||||
if tabpagewinnr(tabpagenr(), '$') >= 3
|
if tabpagewinnr(tabpagenr(), '$') >= 3 " if there are more than 2 normal windows
|
||||||
if has('nvim')
|
if exists(':ChooseWin') == 2
|
||||||
let input = input({
|
ChooseWin
|
||||||
\ 'prompt' : 'ChooseWin No.: ',
|
|
||||||
\ 'cancelreturn': 0,
|
|
||||||
\ })
|
|
||||||
if input == 0 | return | endif
|
|
||||||
else
|
else
|
||||||
let input = input('ChooseWin No.: ')
|
if has('nvim')
|
||||||
|
let input = input({
|
||||||
|
\ 'prompt' : 'ChooseWin No.: ',
|
||||||
|
\ 'cancelreturn': 0,
|
||||||
|
\ })
|
||||||
|
if input == 0 | return | endif
|
||||||
|
else
|
||||||
|
let input = input('ChooseWin No.: ')
|
||||||
|
endif
|
||||||
|
if input == winnr() | return | endif
|
||||||
|
exec input . 'wincmd w'
|
||||||
endif
|
endif
|
||||||
if input == winnr() | return | endif
|
exec 'e' filepath
|
||||||
exec ': ' . input . 'wincmd w'
|
|
||||||
exec ':e' . filepath
|
|
||||||
else
|
else
|
||||||
exec 'wincmd w'
|
exec 'wincmd w'
|
||||||
exec ':e' . filepath
|
exec 'e' filepath
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -32,13 +32,14 @@ CONTENTS *SpaceVim-contents*
|
|||||||
12. guifont...................................|SpaceVim-options-guifont|
|
12. guifont...................................|SpaceVim-options-guifont|
|
||||||
13. lint_on_the_fly...................|SpaceVim-options-lint_on_the_fly|
|
13. lint_on_the_fly...................|SpaceVim-options-lint_on_the_fly|
|
||||||
14. max_column.............................|SpaceVim-options-max_column|
|
14. max_column.............................|SpaceVim-options-max_column|
|
||||||
15. plugin_bundle_dir...............|SpaceVim-options-plugin_bundle_dir|
|
15. max_column......................|SpaceVim-options-home_files_number|
|
||||||
16. plugin_manager_processes.|SpaceVim-options-plugin_manager_processes|
|
16. plugin_bundle_dir...............|SpaceVim-options-plugin_bundle_dir|
|
||||||
17. realtime_leader_guide.......|SpaceVim-options-realtime_leader_guide|
|
17. plugin_manager_processes.|SpaceVim-options-plugin_manager_processes|
|
||||||
18. relativenumber.....................|SpaceVim-options-relativenumber|
|
18. realtime_leader_guide.......|SpaceVim-options-realtime_leader_guide|
|
||||||
19. sidebar_width.......................|SpaceVim-options-sidebar_width|
|
19. relativenumber.....................|SpaceVim-options-relativenumber|
|
||||||
20. snippet_engine.....................|SpaceVim-options-snippet_engine|
|
20. sidebar_width.......................|SpaceVim-options-sidebar_width|
|
||||||
21. windows_leader.....................|SpaceVim-options-windows_leader|
|
21. snippet_engine.....................|SpaceVim-options-snippet_engine|
|
||||||
|
22. windows_leader.....................|SpaceVim-options-windows_leader|
|
||||||
3. Configuration...........................................|SpaceVim-config|
|
3. Configuration...........................................|SpaceVim-config|
|
||||||
4. Commands..............................................|SpaceVim-commands|
|
4. Commands..............................................|SpaceVim-commands|
|
||||||
5. Functions............................................|SpaceVim-functions|
|
5. Functions............................................|SpaceVim-functions|
|
||||||
@ -230,6 +231,14 @@ Change the max number of columns for SpaceVim. Default is 120.
|
|||||||
max_column = 120
|
max_column = 120
|
||||||
<
|
<
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
MAX_COLUMN *SpaceVim-options-home_files_number*
|
||||||
|
|
||||||
|
Change the list number of files for SpaceVim home. Default is 6.
|
||||||
|
>
|
||||||
|
home_files_number = 6
|
||||||
|
<
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
PLUGIN_BUNDLE_DIR *SpaceVim-options-plugin_bundle_dir*
|
PLUGIN_BUNDLE_DIR *SpaceVim-options-plugin_bundle_dir*
|
||||||
|
|
||||||
@ -311,6 +320,12 @@ Change the max number of columns for SpaceVim. Default is 120.
|
|||||||
let g:spacevim_max_column = 120
|
let g:spacevim_max_column = 120
|
||||||
<
|
<
|
||||||
|
|
||||||
|
*g:spacevim_home_files_number*
|
||||||
|
Change the list number of files for SpaceVim home. Default is 6.
|
||||||
|
>
|
||||||
|
let g:spacevim_home_files_number = 6
|
||||||
|
<
|
||||||
|
|
||||||
*g:spacevim_enable_guicolors*
|
*g:spacevim_enable_guicolors*
|
||||||
Enable true color support in terminal. Default is 1.
|
Enable true color support in terminal. Default is 1.
|
||||||
>
|
>
|
||||||
|
26
test.py
Normal file
26
test.py
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import io
|
||||||
|
import sys
|
||||||
|
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
|
||||||
|
|
||||||
|
|
||||||
|
def pv_f(c, r, n, when=1):
|
||||||
|
import numpy as np #导入numpy库
|
||||||
|
c = np.array(c)
|
||||||
|
r = np.array(r)
|
||||||
|
if when == 1:
|
||||||
|
n = np.arange(1, n + 1)
|
||||||
|
else:
|
||||||
|
n = np.arange(0, n)
|
||||||
|
pv = c / (1 + r)**n
|
||||||
|
return pv.sum()
|
||||||
|
|
||||||
|
|
||||||
|
c = 20000
|
||||||
|
r = 0.05
|
||||||
|
n = 5
|
||||||
|
#调用前文定义的函数pv_f(c,r,n,when=1)
|
||||||
|
pv1 = pv_f(c, r, n, when=1)
|
||||||
|
print("普通年金现值(年末):%.2f" % pv1)
|
||||||
|
#如果是预付年金,则when=0
|
||||||
|
pv2 = pv_f(c, r, n, when=0)
|
||||||
|
print("预付年金现值(年初):%.2f" % pv2)
|
Loading…
Reference in New Issue
Block a user