如何在mac os中删除iTerm中的单词

时间:2017-03-11 13:44:18

标签: macos shell iterm

我在我的mac中使用iTerm作为终端。我无法在命令行中删除命令行path中的单词,我只想删除fn+option+delete个单词,那我怎么能在iTerm中这样做。

基本上删除iTerm中单词的快捷方式是什么。

我看了https://apple.stackexchange.com/questions/154292/iterm-going-one-word-backwards-and-forwards{   "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",   "contentVersion": "1.0.0.0",   "parameters": {     "functionappname": {       "type": "string"     }   },   "variables": {     "serviceplanname": "[concat('functionserviceplan-',parameters('functionappname'),'-', uniqueString(resourceGroup().id))]",     "functionstoragename": "[substring(toLower(concat('st',parameters('functionappname'), uniqueString(resourceGroup().id))),0,24)]"   },   "resources": [     {         "name": "[variables('serviceplanname')]",         "type": "Microsoft.Web/serverfarms",         "kind": "functionapp",         "sku": {             "name": "Y1",             "tier": "Dynamic",             "size": "Y1",             "family": "Y",             "capacity": 0         },         "apiVersion": "2015-08-01",         "location": "[resourceGroup().location]",         "properties": { "name": "[variables('serviceplanname')]" }     },     {       "type": "Microsoft.Storage/storageAccounts",       "name": "[variables('functionstoragename')]",       "apiVersion": "2016-01-01",       "sku": { "name": "Standard_LRS" },       "location": "[resourceGroup().location]",       "kind": "Storage"     },     {         "type": "Microsoft.Web/sites",         "kind": "functionapp",         "name": "[parameters('functionappname')]",         "apiVersion": "2015-08-01",         "location": "[resourceGroup().location]",         "properties": {             "name": "[parameters('functionappname')]",             "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('serviceplanname'))]",             "hostNames": [ "[concat(parameters('functionappname'),'.azurewebsites.net')]" ],             "enabledHostNames": [                 "[concat(parameters('functionappname'),'.azurewebsites.net')]",                 "[concat(parameters('functionappname'),'.scm.azurewebsites.net')]"             ],             "siteConfig": {                 "appSettings": [                     { "name": "FUNCTIONS_EXTENSION_VERSION", "value": "~1" },                     { "name": "AzureWebJobsDashboard", "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',variables('functionstoragename'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('functionstoragename')), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value)]" },                     { "name": "AzureWebJobsStorage", "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',variables('functionstoragename'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('functionstoragename')), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value)]" },                     { "name": "WEBSITE_NODE_DEFAULT_VERSION", "value": "6.5.0" }                 ]             }         },         "dependsOn": [             "[resourceId('Microsoft.Web/serverfarms', variables('serviceplanname'))]",             "[resourceId('Microsoft.Storage/storageAccounts', variables('functionstoragename'))]"         ]     }   ] } 只删除了一个字符,而不是整个字。

4 个答案:

答案 0 :(得分:7)

转到您的iTerm偏好设置,依次选择“配置文件”和“密钥”,然后在“自然文本编辑”中更改您的预设

iTerm Preferences

它应该在之后立即工作。

它与iTerm版本3.3.12兼容

答案 1 :(得分:3)

esc + d 应该作为默认值。

或者您可以为<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto" android:id="@+id/card_view" android:layout_width="match_parent" android:layout_height="wrap_content" card_view:cardBackgroundColor="@color/rippelColor" card_view:cardCornerRadius="4dp"> <TextView android:id="@+id/mName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="Dummy Name" /> </android.support.v7.widget.CardView> </LinearLayout> 添加基于Send Escape Sequence的键盘映射:

enter image description here

答案 2 :(得分:2)

这对我有帮助。

删除一个单词-发送转义序列-0x1b 0x080x17

删除一行-发送转义序列-0x15

iTerm2 delete a word shortcut

答案 3 :(得分:1)

ctrl + w在iTerm中,

顺便说一句,在文本编辑器中
alt + delete删除整个先前的单词
fn + delete删除下一个单词