上一页 1 ··· 48 49 50 51 52 53 54 55 56 ··· 259 下一页
摘要: 原文 出现在自定义动态数组类型中. //用-preview=dip1000编译 @safe: struct Arr { int** ptr; ref int* index() return scope { return *ptr; } void assign(int* p) scope { *ptr 阅读全文
posted @ 2022-08-16 10:53 zjh6 阅读(20) 评论(0) 推荐(0)
摘要: 原文 fn嵌套函数不会在这里推断return. int* gPtr; void main() @safe { scope int* sPtr; int* fn() { return sPtr; } gPtr = fn(); } 可能最明智方法是允许非静态嵌套函数具有"return"和"scope"属 阅读全文
posted @ 2022-08-16 10:32 zjh6 阅读(15) 评论(0) 推荐(0)
摘要: 原文 垃集规范提到,结构中具有内部指针是未定义行为. @safe代码中禁止未定义行为,但允许创建内部指针,而这可能会破坏dip1000: //用-preview=dip1000编译 @safe: struct S { int storage; int* ptr; this(int dummy) { 阅读全文
posted @ 2022-08-16 10:23 zjh6 阅读(16) 评论(0) 推荐(0)
摘要: 原文 import std.stdio; import std.exception; private: class E1 : Exception { mixin basicExceptionCtors; } class E2 : Exception { mixin basicExceptionCto 阅读全文
posted @ 2022-08-15 10:10 zjh6 阅读(15) 评论(0) 推荐(0)
摘要: fun! Dft(t="") "单符头." exe 'set opfunc='.a:t return "\<Esc>g@e" endf fun! Ts2(t) "只处理1个符即可." let i="dj".Qyf() echo i endf //然后 nnoremap <expr> gz Dft(' 阅读全文
posted @ 2022-08-14 21:28 zjh6 阅读(9) 评论(0) 推荐(0)
摘要: fun! Ts(t="") echo a:t if a:t=="" set opfunc=Ts return "g@e" "return "I"" endif let i="dj".Qyf() echo i endf " 实验表明,效果并不好.不折腾这种了. 阅读全文
posted @ 2022-08-14 16:38 zjh6 阅读(12) 评论(0) 推荐(0)
摘要: 设置/时间语言==语言键盘/输入语言热键 在输入语言间,或切换到极点中改一改.先选中,再点tab键. 阅读全文
posted @ 2022-08-14 16:17 zjh6 阅读(85) 评论(0) 推荐(0)
摘要: 加行号: function! s:Seqno(type,...) let i = line("'[") let j = line("']") for l in range(i,j) execute l."s/^\\s*/\\0".(l-i+1).'. ' endfor endfunction fun 阅读全文
posted @ 2022-08-13 18:13 zjh6 阅读(23) 评论(0) 推荐(0)
摘要: 原文 如用\u打开url.而\ui]打开[]中url.而\u$/\uu/等. "从unimpaired.vim改编" function! s:DoAction(algorithm,type) " 备份设置" let sel_save = &selection let cb_save = &clipb 阅读全文
posted @ 2022-08-13 18:09 zjh6 阅读(22) 评论(0) 推荐(0)
摘要: 更改列表,:changes显示,是更改的位置列表,可用g;和g,浏览. g+和g-用于撤销列表.可用:undolist显示它. vim默认关闭永久会话列表.用set undofile来打开. 你部分原因是,@/在函数结束时恢复了.见:help function-search-undo,可从函数中用r 阅读全文
posted @ 2022-08-13 16:51 zjh6 阅读(29) 评论(0) 推荐(0)
上一页 1 ··· 48 49 50 51 52 53 54 55 56 ··· 259 下一页