Knowledge

Sam (text editor)

Source 📝

590: 66: 128: 250: 25: 447:, which additionally allows point-and-click operations through pop-up context menus. This two-process structure allowed sam to access files on networked host systems through remote execution of the file-access process while running the windowing interface locally, thereby bypassing latency over slow connections. 471:
based conditional and loop functions and scope addressing, even sharing some of ed's syntax for such functions. But while ed's commands are line-oriented, sam's are selection-oriented. Selections are contiguous strings of text (which may span multiple lines), and are specified either with the mouse
450:
Samterm presents windows to files being edited and to a persistent command window which accepts input as sam commands. Most common editing operations are quickly and naturally accomplished with the point-and-click interface, which also functions inside the command window. This latter fact allows
518:
to revert any number of editing errors. This feature, combined with Sam's facility to easily edit its own commands and, fundamentally, its small, orthogonal command set (containing only 33 commands), represent the program's bias toward a low learning threshold over other more expressive "power
505:
Sam extends its basic text-editing command set to handling of multiple files, providing similar pattern-based conditional and loop commands for filename specification. Any sequence of text-editing commands may be applied as a unit to each such specification.
502:, which can recursively apply regular-expression matching to obtain other (sub)selections within a given selection. In this way, sam's command set can be applied to substrings that are identified by arbitrarily complex context. 482:. Sam's commands take such selections as basic—more or less as other Unix tools treat lines; thus, multi-line and sub-line patterns are as naturally handled by Sam as whole-line patterns are by 435:
Sam is designed as two synchronous programs: a command interpreter and a mouse-oriented bitmap windowing interface. The interpreter's command set is modeled after the UNIX editor
707: 921: 192: 164: 595: 1265: 1088: 613: 528: 405: 171: 145: 38: 229: 211: 109: 87: 52: 80: 1207: 333: 178: 1260: 1142: 439:
and may be used to operate the editor from a standard text terminal. By default, however, Sam presents its own
149: 1280: 423:
aesthetic. It is internally simple, its power leveraged by the composability of a small command language and
759: 559:, an editor with the same command language as sam, but with an assortment of additional features, including 160: 1137: 693: 1275: 1200: 715: 1270: 1255: 1116: 954: 914: 356: 1147: 1012: 975: 527:
Sam is the preferred text editor of several eminent programmers. It was the first full screen editor
1168: 970: 452: 440: 417: 409: 298: 74: 765: 138: 1178: 1081: 889: 91: 44: 451:
commands to be edited (and resubmitted) just as any other text, a function inherited from the
1111: 991: 949: 907: 623: 618: 361: 314: 185: 566:
The latest version of sam was written as part of the Plan 9 operating system, but there are
667: 8: 393: 1163: 831: 603: 556: 468: 811: 737: 1074: 567: 532: 318: 850: 835: 996: 823: 609: 487: 483: 479: 464: 436: 345: 305: 649:
A Research Unix reader: annotated excerpts from the Programmer's Manual, 1971–1986
575: 540: 536: 1224: 870: 1229: 1018: 647: 560: 548: 1183: 1249: 474: 424: 413: 930: 827: 643: 389: 351: 338: 275: 263: 1132: 1034: 397: 280: 880: 127: 1097: 894: 552: 544: 401: 268: 786: 249: 416:; it was later ported to other systems. Sam follows a classical 1039: 899: 791: 1234: 1055: 885: 571: 606:— Rob Pike's other popular text editor and successor of sam. 514:
Sam was one of the first text editors to support "infinite"
1066: 1001: 944: 515: 495: 420: 310: 881:
sam(1): screen editor with structural regular expressions
491: 696:, Posted by Roblimo on Monday October 18, 2004, Slashdot 875: 372: 585: 463:
Sam's command syntax is formally similar to ed's or
396:. It was originally designed in the early 1980s at 152:. Unsourced material may be challenged and removed. 498:, etc. This is implemented through a model called 761:Brian Kernighan's Programming Setup | Lex Fridman 1247: 1082: 915: 53:Learn how and when to remove these messages 1089: 1075: 922: 908: 248: 851:"A tutorial for the sam command language" 735: 705: 655:(Technical report). CSTR. Bell Labs. 139. 230:Learn how and when to remove this message 212:Learn how and when to remove this message 110:Learn how and when to remove this message 764:. YouTube. Event occurs at 44 seconds. 740:(Interview). Interviewed by Budiu, Mihai 73:This article includes a list of general 757: 642: 1248: 708:"Stiff asks, great programmers answer" 563:and automatic tiling of opened files. 531:liked. Sam is the text editor used by 430: 1070: 903: 636: 809: 596:Free and open-source software portal 150:adding citations to reliable sources 121: 59: 18: 738:"An Interview with Brian Kernighan" 612:— The original Unix text editor by 555:and Russ Cox, have transitioned to 13: 706:Rzeszótko, Jarosław (2006-10-16). 478:it over a region of text) or by a 408:and other Unix developers for the 79:it lacks sufficient corresponding 14: 1292: 864: 816:Software: Practice and Experience 509: 458: 34:This article has multiple issues. 1208:The Unix Programming Environment 929: 871:ssam(1): stream interface to sam 848: 668:"Structural Regular Expressions" 665: 588: 126: 64: 23: 768:from the original on 2021-12-12 137:needs additional citations for 42:or discuss these issues on the 779: 751: 736:Kernighan, Brian (July 2000). 729: 699: 687: 659: 500:structural regular expressions 412:windowing terminal running on 1: 803: 758:Fridman, Lex (19 July 2020). 1096: 522: 7: 1201:The Practice of Programming 714:(Interview). Archived from 694:Interview:Rob Pike Responds 581: 467:, containing (structural-) 427:through shell integration. 10: 1297: 1266:Inferno (operating system) 895:A sam quick reference card 810:Pike, Rob (October 1987). 1217: 1192: 1156: 1125: 1104: 1048: 1027: 984: 963: 937: 886:A new Unix version of sam 367: 344: 332: 324: 304: 294: 286: 274: 262: 247: 629: 441:graphical user interface 1028:Associated institutions 94:more precise citations. 890:Plan 9 from User Space 828:10.1002/spe.4380171105 161:"Sam" text editor 16:Multi-file text editor 1261:Plan 9 from Bell Labs 1126:Programming languages 1112:Plan 9 from Bell Labs 964:Programming languages 950:Plan 9 from Bell Labs 812:"The Text Editor sam" 624:List of Unix commands 619:Plan 9 from Bell Labs 1281:Windows text editors 455:terminal interface. 392:based on structural 146:improve this article 431:Design and features 394:regular expressions 244: 1276:MacOS text editors 718:on October 5, 2011 604:acme (text editor) 469:regular expression 264:Original author(s) 242: 1271:Unix text editors 1256:Free text editors 1243: 1242: 1105:Operating systems 1064: 1063: 938:Operating systems 578:ports available. 568:Microsoft Windows 533:Bjarne Stroustrup 404:with the help of 383: 382: 240: 239: 232: 222: 221: 214: 196: 120: 119: 112: 57: 1288: 1091: 1084: 1077: 1068: 1067: 924: 917: 910: 901: 900: 860: 858: 857: 845: 843: 842: 797: 796: 783: 777: 776: 774: 773: 755: 749: 748: 746: 745: 733: 727: 726: 724: 723: 703: 697: 691: 685: 684: 682: 681: 675:EUUG Spring 1987 672: 663: 657: 656: 654: 640: 610:ed (text editor) 598: 593: 592: 591: 388:is a multi-file 379: 376: 374: 306:Operating system 254:A screenshot of 252: 245: 241: 235: 228: 217: 210: 206: 203: 197: 195: 154: 130: 122: 115: 108: 104: 101: 95: 90:this article by 81:inline citations 68: 67: 60: 49: 27: 26: 19: 1296: 1295: 1291: 1290: 1289: 1287: 1286: 1285: 1246: 1245: 1244: 1239: 1213: 1188: 1152: 1121: 1100: 1095: 1065: 1060: 1044: 1023: 980: 959: 933: 928: 867: 855: 853: 840: 838: 822:(11): 813–845. 806: 801: 800: 785: 784: 780: 771: 769: 756: 752: 743: 741: 734: 730: 721: 719: 704: 700: 692: 688: 679: 677: 670: 664: 660: 652: 641: 637: 632: 594: 589: 587: 584: 576:X Window System 547:. Others, like 541:Douglas McIlroy 537:Brian Kernighan 525: 512: 461: 433: 371: 359: 354: 287:Initial release 258: 236: 225: 224: 223: 218: 207: 201: 198: 155: 153: 143: 131: 116: 105: 99: 96: 86:Please help to 85: 69: 65: 28: 24: 17: 12: 11: 5: 1294: 1284: 1283: 1278: 1273: 1268: 1263: 1258: 1241: 1240: 1238: 1237: 1232: 1230:Mark V. Shaney 1227: 1221: 1219: 1215: 1214: 1212: 1211: 1204: 1196: 1194: 1190: 1189: 1187: 1186: 1181: 1176: 1171: 1166: 1160: 1158: 1154: 1153: 1151: 1150: 1145: 1140: 1135: 1129: 1127: 1123: 1122: 1120: 1119: 1114: 1108: 1106: 1102: 1101: 1094: 1093: 1086: 1079: 1071: 1062: 1061: 1059: 1058: 1052: 1050: 1046: 1045: 1043: 1042: 1037: 1031: 1029: 1025: 1024: 1022: 1021: 1019:Thompson shell 1016: 1009: 1004: 999: 994: 988: 986: 982: 981: 979: 978: 973: 967: 965: 961: 960: 958: 957: 952: 947: 941: 939: 935: 934: 927: 926: 919: 912: 904: 898: 897: 892: 883: 878: 873: 866: 865:External links 863: 862: 861: 846: 805: 802: 799: 798: 795:. 17 May 2022. 787:"Deadpixi/Sam" 778: 750: 728: 698: 686: 658: 644:McIlroy, M. D. 634: 633: 631: 628: 627: 626: 621: 616: 607: 600: 599: 583: 580: 561:mouse chording 549:Dennis Ritchie 524: 521: 511: 510:Infinite undos 508: 460: 459:Command syntax 457: 443:(GUI) window, 432: 429: 381: 380: 369: 365: 364: 348: 342: 341: 336: 330: 329: 326: 322: 321: 308: 302: 301: 296: 292: 291: 288: 284: 283: 278: 272: 271: 266: 260: 259: 253: 238: 237: 220: 219: 202:September 2012 134: 132: 125: 118: 117: 100:September 2012 72: 70: 63: 58: 32: 31: 29: 22: 15: 9: 6: 4: 3: 2: 1293: 1282: 1279: 1277: 1274: 1272: 1269: 1267: 1264: 1262: 1259: 1257: 1254: 1253: 1251: 1236: 1233: 1231: 1228: 1226: 1223: 1222: 1220: 1216: 1210: 1209: 1205: 1203: 1202: 1198: 1197: 1195: 1191: 1185: 1182: 1180: 1177: 1175: 1172: 1170: 1167: 1165: 1162: 1161: 1159: 1155: 1149: 1146: 1144: 1141: 1139: 1136: 1134: 1131: 1130: 1128: 1124: 1118: 1115: 1113: 1110: 1109: 1107: 1103: 1099: 1092: 1087: 1085: 1080: 1078: 1073: 1072: 1069: 1057: 1054: 1053: 1051: 1047: 1041: 1038: 1036: 1033: 1032: 1030: 1026: 1020: 1017: 1015: 1014: 1010: 1008: 1005: 1003: 1000: 998: 995: 993: 990: 989: 987: 983: 977: 974: 972: 969: 968: 966: 962: 956: 953: 951: 948: 946: 943: 942: 940: 936: 932: 925: 920: 918: 913: 911: 906: 905: 902: 896: 893: 891: 887: 884: 882: 879: 877: 876:Sam Resources 874: 872: 869: 868: 852: 847: 837: 833: 829: 825: 821: 817: 813: 808: 807: 794: 793: 788: 782: 767: 763: 762: 754: 739: 732: 717: 713: 709: 702: 695: 690: 676: 669: 662: 651: 650: 645: 639: 635: 625: 622: 620: 617: 615: 611: 608: 605: 602: 601: 597: 586: 579: 577: 573: 569: 564: 562: 558: 554: 550: 546: 542: 538: 534: 530: 520: 517: 507: 503: 501: 497: 493: 489: 485: 481: 480:pattern match 477: 476: 470: 466: 456: 454: 448: 446: 442: 438: 428: 426: 425:extensibility 422: 419: 415: 411: 407: 403: 399: 395: 391: 387: 378: 370: 366: 363: 358: 353: 349: 347: 343: 340: 337: 335: 331: 327: 323: 320: 316: 312: 309: 307: 303: 300: 297: 293: 289: 285: 282: 279: 277: 273: 270: 267: 265: 261: 257: 251: 246: 234: 231: 216: 213: 205: 194: 191: 187: 184: 180: 177: 173: 170: 166: 163: –  162: 158: 157:Find sources: 151: 147: 141: 140: 135:This article 133: 129: 124: 123: 114: 111: 103: 93: 89: 83: 82: 76: 71: 62: 61: 56: 54: 47: 46: 41: 40: 35: 30: 21: 20: 1225:Renée French 1206: 1199: 1193:Publications 1173: 1013:Space Travel 1011: 1006: 931:Ken Thompson 854:. Retrieved 839:. Retrieved 819: 815: 790: 781: 770:. Retrieved 760: 753: 742:. Retrieved 731: 720:. Retrieved 716:the original 711: 701: 689: 678:. Retrieved 674: 661: 648: 638: 614:Ken Thompson 565: 529:Ken Thompson 526: 513: 504: 499: 473: 462: 449: 444: 434: 406:Ken Thompson 385: 384: 357:GPL-2.0-only 325:Available in 276:Developer(s) 255: 226: 208: 199: 189: 182: 175: 168: 156: 144:Please help 139:verification 136: 106: 97: 78: 50: 43: 37: 36:Please help 33: 888:as part of 849:Pike, Rob. 666:Pike, Rob. 390:text editor 339:Text editor 290:early 1980s 92:introducing 1250:Categories 856:2008-11-01 841:2008-11-01 804:References 772:2020-10-03 744:2008-11-01 722:2008-11-01 680:2008-11-01 519:editors." 295:Written in 172:newspapers 75:references 39:improve it 1133:Newsqueak 1035:Bell Labs 523:Endorsers 398:Bell Labs 281:Bell Labs 45:talk page 1157:Software 1098:Rob Pike 985:Software 836:36076160 766:Archived 712:Stifflog 646:(1987). 582:See also 553:Rob Pike 545:Tom Duff 475:sweeping 453:DMD 5620 402:Rob Pike 362:LPL-1.02 269:Rob Pike 1143:Sawzall 1117:Inferno 955:Inferno 445:samterm 418:modular 414:v9 Unix 368:Website 346:License 328:English 186:scholar 88:improve 1040:Google 834:  792:GitHub 375:.cat-v 360:2002: 355:2014: 350:2021: 315:Plan 9 188:  181:  174:  167:  159:  77:, but 1235:UTF-8 1218:Other 1138:Limbo 1056:UTF-8 1049:Other 992:Belle 832:S2CID 671:(PDF) 653:(PDF) 630:Notes 572:macOS 319:Win32 193:JSTOR 179:books 1169:Blit 1164:acme 1002:grep 945:Unix 574:and 557:acme 543:and 516:undo 496:Perl 472:(by 465:ex's 421:Unix 410:Blit 377:.org 334:Type 311:Unix 165:news 1179:rio 1174:sam 1007:sam 824:doi 492:AWK 400:by 386:Sam 373:sam 352:MIT 256:Sam 243:Sam 148:by 1252:: 1184:8½ 1148:Go 997:ed 976:Go 830:. 820:17 818:. 814:. 789:. 710:. 673:. 570:, 551:, 539:, 535:, 494:, 490:, 488:vi 486:, 484:ed 437:ed 317:, 313:, 48:. 1090:e 1083:t 1076:v 971:B 923:e 916:t 909:v 859:. 844:. 826:: 775:. 747:. 725:. 683:. 299:C 233:) 227:( 215:) 209:( 204:) 200:( 190:· 183:· 176:· 169:· 142:. 113:) 107:( 102:) 98:( 84:. 55:) 51:(

Index

improve it
talk page
Learn how and when to remove these messages
references
inline citations
improve
introducing
Learn how and when to remove this message

verification
improve this article
adding citations to reliable sources
"Sam" text editor
news
newspapers
books
scholar
JSTOR
Learn how and when to remove this message
Learn how and when to remove this message

Original author(s)
Rob Pike
Developer(s)
Bell Labs
C
Operating system
Unix
Plan 9
Win32

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.