我在这里看到了鱼壳的vi模式实现,但我不知道如何使用它.有没有在线提供的教程(我找不到这样的)描述基本功能 - 如何切换模式等等.谢谢.
安装OSX Mavericks 10.9演示后,我在运行捆绑后得到这个
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/sandric/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
extconf.rb:17: Use RbConfig instead of obsolete and deprecated Config.
checking for socket() in -lsocket... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/sandric/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
--with-iconv-dir
--without-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/lib
--with-zlib-dir
--without-zlib-dir …Run Code Online (Sandbox Code Playgroud) 在我的fish函数中,我正在评估构造的命令行
eval (commandline),具体来说 - 我正在寻找fzf中的一些文件名,然后分析命令行是否被预先添加vim.如果是 - 而不是之后返回vim filename按回车,我只是评价它,正如我之前所示.
问题是,如果我评估它,而不是手动输入,它不会进入历史 - 例如,我不能通过按下来看它作为上一个命令.
我set -x history (commandline) $history在eval之后尝试过,但它显示了一个错误set: Tried to change the read-only variable “history”
有没有办法手动将自定义字符串(在我的情况下,命令行缓冲区)添加到历史记录中?谢谢.
要清楚 - 这段代码运行完美 - 带proc的代码
但如果相反我将Proc.new更改为lambda,我收到错误
ArgumentError: wrong number of arguments (1 for 0)
Run Code Online (Sandbox Code Playgroud)
可能是因为instance_eval希望将self作为param传递,而lambda视为一种方法并且不接受未知的params?
有两个例子 - 首先是工作:
class Rule
def get_rule
Proc.new { puts name }
end
end
class Person
attr_accessor :name
def init_rule
@name = "ruby"
instance_eval(&Rule.new.get_rule)
end
end
Run Code Online (Sandbox Code Playgroud)
第二个不是:
class Rule
def get_rule
lambda { puts name }
end
end
class Person
attr_accessor :name
def init_rule
@name = "ruby"
instance_eval(&Rule.new.get_rule)
end
end
Run Code Online (Sandbox Code Playgroud)
谢谢
我很好奇有没有一种方法可以在不加载整个android studio的情况下运行android studio设计器工具?
我问是因为我是emacs用户,所以我可以在emacs中做所有事情,除了预览布局(或以可视方式对其进行更改)。我了解过Android Studio是开源的,设计工具位于机器人插件JetBrains的社区版在这里。
我对android studio源代码一无所知,所以,有谁能向我解释一下是否可行—仅提取可视化编辑器到单独的应用程序中,该应用程序接受布局xml文件路径的文件名作为参数(当前项目设置的mb附加参数)并显示该布局文件的视觉编辑器,或者至少将其渲染为图像,以便我可以看到其在构建设置中指定的设备上的外观?谢谢。
当我在/命令中使用vim中的search 命令时,输入字符时,通过在vim的文本区域中高亮显示,可以看到搜索到的正则表达式模式的首次出现。但是,在使用:s命令时,我希望能够看到第一次出现的内容在我为要替代的块键入模式时被突出显示,但是据我所知,我没有看到任何突出显示是因为命令模式,所以没有给出甚至通过/它突出显示搜索。
例如,当我键入时:s/foo/bar,如果fo文本中有任何序列,我希望在键入之后将其突出显示:s/fo,但不是。
有人知道任何解决方法吗?谢谢。
我需要覆盖函数的某些行为,在调用其他函数之后.问题是这个父函数是一个库,我不想改变它,所以像做一些标志或这个函数的另一个变化的解决方案并不是那么好.我知道我在函数中有一个调用者对象,我可以改变,所以也许我可以用它来弄清楚smth.这是一个例子:
function parent()
{
console.log("some need stuff");
some.handler.function.from.config.that.i.can.change();
console.log("need omit this right till the end");
}
function child()
{
console.log("need to somehow stop evaluation of " + child.caller + " function");
}
Run Code Online (Sandbox Code Playgroud)
作为一个红宝石程序员,我知道有一些lambdas可以用它来终止内部闭包范围的评估.但我不知道如何从javascript中做到这一点.
我想进行快捷键绑定,以清除在提示后直至结束时输入的所有内容。行为Ctr+c与之相同,但不将^C字符附加到当前行和换行符的末尾。可以吗?