vim定时保存session
把如下代码保存为sess.vim
let g:sname = strftime('.session/%Y_%m_%d__%H_%M_%S.vim')
function! SaveSession(timer)
if !isdirectory(".session")
call mkdir(".session", "p", 0755)
endif
execute "mksession!" g:sname
endfunction
let timer = timer_start(180000, 'SaveSession', {'repeat':-1})
然后在vim中执行
source sess.vim
在json数组中跳转到端点的[]括号
va[ 比如光标在d处,按下va[,可以跳转到[]上 [ {a:b}, {c:d} ]
delete hidden buffer
function DeleteHiddenBuffers()
let tpbl=[]
call map(range(1, tabpagenr('$')), 'extend(tpbl, tabpagebuflist(v:val))')
for buf in filter(range(1, bufnr('$')), 'bufexists(v:val) && index(tpbl, v:val)==-1')
silent execute 'bwipeout' buf
endfor
endfunction
然后
:call DeleteHiddenBuffers()
build from source
configure的命令
set -x
make distclean
export LD_LIBRARY_PATH=/tvm/python3.8-compile/python3.8/lib:${LD_LIBRARY_PATH}
export PATH=/tvm/python3.8-compile/python3.8/bin/:${PATH}
export LDFLAGS="-rdynamic"
#vi_cv_path_python=/home/like12/opt/python3.8/bin/python3.8
./configure --prefix=/tvm/vim-install/ --enable-python3interp=yes --with-python3-config-dir=/tvm/python3.8-compile/python3.8/lib/python3.8/config-3.8-x86_64-linux-gnu/ --with-python3-command=/tvm/python3.8-compile/python3.8/bin/python3.8
YouCompleteMe Python指定解释器,跳转到third-party库
在conda环境中比较有用
在你的项目下新建.ycm_extra_conf.py文件,指定解释器路径和third-party库
(torch2) like@a141:~/package/torchmo$ cat .ycm_extra_conf.py
def Settings(**kwargs):
return {
'interpreter_path': '/share_data/users/like/miniconda3/envs/torch2/bin/python',
'sys_path': [
'/share_data/users/like/miniconda3/envs/torch2/lib/python3.10/site-packages/'
]
}
cscope重新加载数据库
:cs reset