如何在SSH终端之间切换窗口?(How to switch between windows in SSH Terminal?)
我刚开始在SSH服务器上使用VIM(没有图形显示,即ssh -x)。 我知道我可以通过以下任一方式打开多个vim文件
:sp
,vim -o
或:tabnew
但是,我有两组文件在逻辑上有意义将它们放在单独的vim窗口上,所以我执行以下vim file1.txt file2.txt -p; vim file3.txt file4.txt -p
vim file1.txt file2.txt -p; vim file3.txt file4.txt -p
,它创建了两个窗口。 我想知道是否可以在这两个窗口之间切换?I've just started to use VIM on a SSH server (without graphical display i.e ssh -x). I know I can open multiple vim files by either
:sp
,vim -o
or:tabnew
but, I've two set of files which make logical sense to have them on separate vim windows so I do the followingvim file1.txt file2.txt -p; vim file3.txt file4.txt -p
which creates two windows. I want to know is it possible to switch between those two windows?
原文:https://stackoverflow.com/questions/35743867
最满意答案
您需要使用
.text()
的函数参数。 该函数是以文本的旧值作为参数调用的,并且返回值替换它。$('#table tbody').find('tr td:nth-child(2)').text(function(i, oldtext) return parseInt(oldtext)/60; });
如果你不使用函数, 在调用
text()
之前执行$(this).text()/60
,所以它使用调用上下文中的任何内容。您还需要使用
:nth-child
,而不是:eq
来访问每一行中的第三个单元格。 否则,它只访问整个结果集中的第三个单元格。You need to use a function argument to
.text()
. The function is called with the old value of the text as an argument, and the return value replaces it.$('#table tbody').find('tr td:nth-child(2)').text(function(i, oldtext) return parseInt(oldtext)/60; });
If you don't use a function,
$(this).text()/60
is executed before callingtext()
, so it uses whateverthis
is in the calling context.You also need to use
:nth-child
, not:eq
, to access the third cell in each row. Otherwise, it just accesses the third cell in the entire result set.
相关问答
更多-
jquery通过文本查找元素(jQuery: find element by text)[2022-10-29]
您可以使用:contains选择器根据其内容获取元素。This is a testAnother Div$('div:contains("test")').css('background-color', 'red'); 在这里演示 You can use the :contains selector to get elements based on their content. Demo here $('div:contains("test")').cs ... -
$('*[id*=mytext]:visible').each(function() { $(this).doStuff(); }); 请注意,选择器开头的星号“*” 与所有元素匹配 。 请参阅属性包含选择器 ,以及:visible和:hidden选择器。 $('*[id*=mytext]:visible').each(function() { $(this).doStuff(); }); Note the asterisk '*' at the beginning of the sel ...
-
看到这个答案如何。 它基本上涉及.filter来解决已知:contains错误 : $('#demo').filter(function(i, el) { return !!$(el).text().match(/hello :\)/); }); 现场示例 。 请注意,对这个结果执行.length可能会给你一个大于 1的值,即使只有一个元素包含该文本,因为元素的父母也会匹配。 See this answer for how. It basically involves .filter to get ...
-
我建议你以对象数组的格式更改aTags数组。 如果需要,可以自动完成。 片段: var autocomp = jQuery.noConflict(); autocomp(document).ready(function() { var aTags = ["ask<####>1","always<####>2", "all<####>3", "alright<####>4", "one<####>5", "foo<####>6", "blackberry<####>7", "tweet<####>8" ...
-
jQuery AJAX返回结果(jQuery AJAX returned result)[2021-12-12]
看看这个例子 。 它按预期工作。 也许你的反应不好? Look at this example. It works as expected. Maybe your response is not good? -
用jquery查找和替换文本,只有文本没有子元素(Find and replace text with jquery, only text no child elements)[2021-05-11]
因为jquery 1.8你可以这样做: $(".sku_wrapper").html(function(i,t){ return t.replace('SKU:','art nu.') }); since jquery 1.8 you can do it also like this: $(".sku_wrapper").html(function(i,t){ return t.replace('SKU:','art nu.') }); -
这似乎是错的: $('#all-events').each('.views-rows',function(){...}); 这个怎么样: $('.views-rows', '#all-events').each(function(){...}); This seems wrong: $('#all-events').each('.views-rows',function(){...}); How about this: $('.views-rows', '#all-events').each(func ...
-
你可以递归地做到这一点。 这很简单: function replaceTextNodes(node, newText) { if (node.nodeType == 3) { // Filter out text nodes that contain only whitespace if (!/^\s*$/.test(node.data)) { node.data = newText; } } else if (node ...
-
通常的原因是您已将事件绑定到已删除/重新添加的元素,因此事件已消失。 根据此示例,更改text本身应该能够无限期地继续:GoJS: $('#test').click(function() { $('#example').text(Date.now); }); 通过在此处单击GO文本来查看它运行: http : //jsfiddle.net/5BXqg/ The answer ended up bein ...
-
您需要使用.text()的函数参数。 该函数是以文本的旧值作为参数调用的,并且返回值替换它。 $('#table tbody').find('tr td:nth-child(2)').text(function(i, oldtext) return parseInt(oldtext)/60; }); 如果你不使用函数, 在调用text() 之前执行$(this).text()/60 ,所以它使用调用上下文中的任何内容。 您还需要使用:nth-child ,而不是:eq来访问每一行中的第三个单元格。 ...