mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 10:30:05 +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')
|
||||
endf
|
||||
|
||||
" in this function we should vim-choosewin if possible
|
||||
function! DefxSmartL(_)
|
||||
if defx#is_directory()
|
||||
call defx#call_action('open_tree')
|
||||
normal! j
|
||||
else
|
||||
let filepath = defx#get_candidate()['action__path']
|
||||
if tabpagewinnr(tabpagenr(), '$') >= 3
|
||||
if has('nvim')
|
||||
let input = input({
|
||||
\ 'prompt' : 'ChooseWin No.: ',
|
||||
\ 'cancelreturn': 0,
|
||||
\ })
|
||||
if input == 0 | return | endif
|
||||
if tabpagewinnr(tabpagenr(), '$') >= 3 " if there are more than 2 normal windows
|
||||
if exists(':ChooseWin') == 2
|
||||
ChooseWin
|
||||
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
|
||||
if input == winnr() | return | endif
|
||||
exec ': ' . input . 'wincmd w'
|
||||
exec ':e' . filepath
|
||||
exec 'e' filepath
|
||||
else
|
||||
exec 'wincmd w'
|
||||
exec ':e' . filepath
|
||||
exec 'e' filepath
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
@ -32,13 +32,14 @@ CONTENTS *SpaceVim-contents*
|
||||
12. guifont...................................|SpaceVim-options-guifont|
|
||||
13. lint_on_the_fly...................|SpaceVim-options-lint_on_the_fly|
|
||||
14. max_column.............................|SpaceVim-options-max_column|
|
||||
15. plugin_bundle_dir...............|SpaceVim-options-plugin_bundle_dir|
|
||||
16. plugin_manager_processes.|SpaceVim-options-plugin_manager_processes|
|
||||
17. realtime_leader_guide.......|SpaceVim-options-realtime_leader_guide|
|
||||
18. relativenumber.....................|SpaceVim-options-relativenumber|
|
||||
19. sidebar_width.......................|SpaceVim-options-sidebar_width|
|
||||
20. snippet_engine.....................|SpaceVim-options-snippet_engine|
|
||||
21. windows_leader.....................|SpaceVim-options-windows_leader|
|
||||
15. max_column......................|SpaceVim-options-home_files_number|
|
||||
16. plugin_bundle_dir...............|SpaceVim-options-plugin_bundle_dir|
|
||||
17. plugin_manager_processes.|SpaceVim-options-plugin_manager_processes|
|
||||
18. realtime_leader_guide.......|SpaceVim-options-realtime_leader_guide|
|
||||
19. relativenumber.....................|SpaceVim-options-relativenumber|
|
||||
20. sidebar_width.......................|SpaceVim-options-sidebar_width|
|
||||
21. snippet_engine.....................|SpaceVim-options-snippet_engine|
|
||||
22. windows_leader.....................|SpaceVim-options-windows_leader|
|
||||
3. Configuration...........................................|SpaceVim-config|
|
||||
4. Commands..............................................|SpaceVim-commands|
|
||||
5. Functions............................................|SpaceVim-functions|
|
||||
@ -230,6 +231,14 @@ Change the max number of columns for SpaceVim. Default is 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*
|
||||
|
||||
@ -311,6 +320,12 @@ Change the max number of columns for SpaceVim. Default is 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*
|
||||
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