首页 \ 问答 \ 如何在Vim中快速向上和向下重新映射(ctrl u和ctrl d)到ctrl j和ctrl k(How to remap fast up and down (ctrl u and ctrl d) to ctrl j and ctrl k in Vim)

如何在Vim中快速向上和向下重新映射(ctrl u和ctrl d)到ctrl j和ctrl k(How to remap fast up and down (ctrl u and ctrl d) to ctrl j and ctrl k in Vim)

我如何重新映射快速向上和向下命令?
我想将Ctrl-U重新映射到Ctrl-K并将Ctrl-D重新映射到Ctrl-J

我尝试了以下但没有运气...

nnoremap <c-u> <c-k> 
nnoremap <c-d> <c-j>

仅供参考 - Vim安装在Ubuntu Server中


How can I remap the fast up and down commands?
I would like to remap Ctrl-U to Ctrl-K and Ctrl-D to Ctrl-J?

I tried the following but no luck...

nnoremap <c-u> <c-k> 
nnoremap <c-d> <c-j>

FYI - Vim is installed in Ubuntu Server


原文:https://stackoverflow.com/questions/33173311
更新时间:2023-09-18 21:09

最满意答案

以特定的正则表达式模式使用以下方法:

s = 'This is an e x a m p l e about T H I S question.'
result = re.findall(r'\b((?:\w\s){3,})', s)

print(result)

输出:

['e x a m p l e ', 'T H I S ']

Use the following approach with specific regex pattern:

s = 'This is an e x a m p l e about T H I S question.'
result = re.findall(r'\b((?:\w\s){3,})', s)

print(result)

The output:

['e x a m p l e ', 'T H I S ']

相关问答

更多
  • 这个怎么样? 这个想法是将最后一组分成两组。 Pattern p = Pattern.compile("(\\w+)=\"([^\"]+)\"|([^\\s]+)"); String test = "a0=d235 a1=2314 com1=\"abcd\" com2=\"a b c d\""; Matcher m = p.matcher(test); while(m.find()){ System.out.print(m.group(1)); System.out.print("=") ...
  • 对于PHP我世界推荐这个正则表达式: #^"(\w+) (\w+) (\w+) (?:.+?)","(\d+)\.(\d+)\.(\d+)","(\d+):(\d+):(\d+)"(?:.*?)$#i 和更换模式: $6-$5-$4 ==> $7:$8 $1 $2 $3 我刚在这个网站上测试过它https://ru.functions-online.com/preg_replace.html 我认为将这个php_replace regexp翻译成java regexp并不困难 for php I wor ...
  • 因为你的正则表达式中有超过1个捕获组,所以你得到了元组。 请参阅re.findall参考 : 如果模式中存在一个或多个组,则返回组列表 ; 如果模式有多个组,这将是一个元组列表 。 因此,解决方案是仅使用一个捕获组 。 由于你的正则表达式中有令牌,你可以在组内使用它们。 由于只有令牌不同, ([0-9]{4})部分对于两者都是常见的,只需在放入非捕获组的令牌之间使用交替运算符: (?:tokenA|tokenB)([0-9]{4}) ^^^^^^^^^^^^^^^^^ 正则表达式意味着: (?:token ...
  • 我认为非捕获(?:)会告诉它不要捕获单词标题 非捕获组 仍然使用文本 。 它们只是匹配 (文本被抓取并添加到匹配结果中),不捕获 (=在特定的编号或命名缓冲区中存储匹配值的一部分)。 要检查是否存在,只有外观(或锚点)。 很明显,你想要从匹配中丢弃前缀title : 你不能使用lookbehind,因为在Python re模块中不允许使用可变宽度的 lookbehind(里面有量词的那个)。 通常的解决方法是围绕您需要获取的模式使用捕获组 。 您可以在[\w\s]+子模式周围设置捕获组,以将该值捕获到组1中 ...
  • 这个正则表达式怎么样? (\d+)([^;]+) 第二组将捕获一个或多个不是分号的字符。 How about this regex?: (\d+)([^;]+) The second group will capture one or more characters that are not semicolons.
  • 这是由于全局捕获括号,您应该只捕获所需的两个元素。 import re seq=">Bounded_RNA_of:1DDL:Elength : 1" match = re.search(r'>Bounded_RNA_of:(\w+):(\w)length : 1',seq) print match.group(1), match.group(2) This is due to the global catching parenthesis, you should catch only the two ne ...
  • 如果你用一个正则表达式分割一个字符串,你基本上可以知道字符串应该被切割的位置。 这必然会削减你与正则表达式匹配的东西。 这意味着如果你在\w分割,那么每个字符都是一个分割点,它们之间的子串(全部为空)将被返回。 Java会自动删除尾随的空字符串,如文档中所述 。 这也解释了为什么懒匹配\w*? 会给你每个字符,因为它会匹配任何字符(零宽度)之间(和之前和之后)的每个位置。 剩下的是字符串本身的字符。 让我们分解一下: [az] , \w , \w+? 你的字符串是 abcde 比赛如下: a b c ...
  • 以特定的正则表达式模式使用以下方法: s = 'This is an e x a m p l e about T H I S question.' result = re.findall(r'\b((?:\w\s){3,})', s) print(result) 输出: ['e x a m p l e ', 'T H I S '] Use the following approach with specific regex pattern: s = 'This is an e x a m p l e ...
  • 正则表达式: (^[A-Za-z]{0,3}\d{4,}[A-Za-z]{0,3})(?:$|\s+) \w与[A-Za-z0-9_] ,所以为了匹配字母,你应该使用[A-Za-z] 。 (?:$|\s+)匹配字符串的结尾或至少一个空格(因此忽略字符串的其余部分)。 Regex: (^[A-Za-z]{0,3}\d{4,}[A-Za-z]{0,3})(?:$|\s+) \w is same as [A-Za-z0-9_], so to match just letters you should use [A ...
  • 这是一个工作小提琴http://jsfiddle.net/e8tMb/ (如果您对支持嵌套括号的示例感兴趣,我在此答案的底部添加了一个) 这个实现不是纯粹的RegEx,但是,我认为这是非常容易理解的。 它循环遍历字符串,并以非常简单的方式完成您指定的操作。 假设我们有字符串: var str="and something here ( something else here and something else or something else) and something here or somethi ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。