sublime multi cursor

 

cmd + d 키로 sublime text(이하 서브라임)에서 위 동영상과 같은 기능을 쓸 수 있다. 같은 단어를 손쉽게 치환할 수 있는 기능인데, multi cursor(이하 멀티커서)의 가장 기본이라고 보면 될 듯. 하지만, 겨우 이런 동영상 하나로 퉁치려고 이 포스팅을 작성한 것은 물론 아니다. cmd + d 말고도 멀티커서를 활용할 수 있는 방법이 있었으니, 그것은 바로 cmd + shift + l 의 존재!

이 두 번째 단축키는 선택된 줄 각각의 끝에 커서를 만들어준다. 이것으로는 어떤 짓(?)을 할 수 있을까. 최근에 metrobank의 branch 목록을 받아와서 select-option html element를 만드는 작업을 한 적이 있었는데, 이 작업은 물론 스크립트를 짜서 해결할 수 있겠지만(!) 그런 프로그래밍 없이 서브라임만으로도(!!) 달성가능함을 보여주고 싶었다.

 

Screen Shot 2016-07-28 at 7.22.55 PM.png

1)) 일단 이 링크에 들어가서 위 은행목록을 서브라임에 복사하자.

 

2)) 위와 같이 따라한다. 참 쉽죠? 개인적으로 자바스크립트에서 큰따옴표를 쓰는 걸 너무 싫어해서, 중간에 `를 escaping 해주는 부분도 보이는데, cmd + 방향키 , option + 방향키 의 활용을 적당히 섞어주면서 텍스트를 조작하는 것이 포인트.

var metroBankList = [['001', 'Ayala-Alabang'], ['002', 'Bacolod-Araneta'], ['003', 'Baguio-Magsaysay'], ['004', 'Grace Park Center'], ['006', 'Cebu-Downtown Center'], ['007', 'Santolan-Pasig'], ['008', 'Davao-Center'], ['009', 'Divisoria Center'], ['010', 'Federal Tower'], ['011', 'North Bay Blvd-Navotas'], ['012', 'Iloilo-Delgado'], ['013', 'Araneta Center'], ['014', 'Plaza Cervantes'], ['015', 'Escolta Tower'], ['016', 'Downtown Center'], ['017', 'Marikina Center'], ['018', 'Pasong Tamo'], ['019', 'Pasay-Libertad'], ['020', 'Cubao'], ['021', 'Quiapo'], ['022', 'Blue Ridge'], ['023', 'San Nicolas'], ['024', 'Davao-Agdao'], ['025', 'Sta. Cruz-Manila'], ['026', 'Arranque Center'], ['027', 'Paco'], ['028', 'Cebu-Tabo-an'], ['029', 'Marulas-Valenzuela'], ['030', 'Zamboanga-Gov. Lim'], ['031', 'Urdaneta Village-Makati'], ['032', 'Commonwealth'], ['033', 'Ermita'], ['034', 'B.F. Homes'], ['035', 'Ortigas Comm\'l. Complex Ctr'], ['036', 'Cebu-Mandaue Center'], ['037', 'Cagayan de Oro-Velez'], ['038', 'Kawit-Cavite'], ['039', 'Imus-Cavite'], ['040', 'Davao-Toril'], ['042', 'Las Piñas'], ['043', 'Novaliches'], ['044', 'U.N. Avenue'], ['045', 'Dau'], ['046', 'Folgueras'], ['047', 'Kamias'], ['048', 'Cagayan de Oro-Cogon'], ['049', 'Lavezares'], ['050', 'Cagayan de Oro-Lapasan'], ['051', 'Alabang'], ['052', 'Angeles-Main'], ['053', 'Sto. Cristo-CM Recto'], ['054', 'España'], ['055', 'Legaspi Village-Makati'], ['056', 'Aurora Blvd.'], ['057', 'Soler'], ['058', 'Davao-Rizal'], ['059', 'Kalentong-Mandaluyong'], ['060', 'West Triangle'], ['061', 'Retiro-Mayon'], ['062', 'Shaw Boulevard'], ['063', 'Evangelista-Quiapo'], ['064', 'Edsa-Caloocan Center'], ['065', 'Banawe'], ['066', 'Head Office Center'], ['067', 'N. Domingo-San Juan'], ['068', 'Sta. Mesa'], ['069', 'San Fernando-Main'], ['070', 'Baclaran'], ['071', 'Greenhills-Wilson Center'], ['072', 'Ylaya-Tondo'], ['073', 'Magdalena'], ['074', 'Cotabato-Main'], ['075', 'Roosevelt'], ['076', 'Quezon Avenue'], ['077', 'Taft Avenue'], ['078', 'Meycauayan-Bulacan'], ['079', 'Bacolod-Capitol'], ['080', 'Pasig-Mabini'], ['081', 'Doña Soledad Ave-Bicutan'], ['082', 'C.M. Recto-Mendiola'], ['083', 'Salcedo Village'], ['084', 'Malabon'], ['085', 'Blumentritt-Sta. Cruz'], ['086', 'Boni Avenue'], ['087', 'Masangkay-Mayhaligue'], ['088', 'Balintawak'], ['089', 'A. Arnaiz-San Lorenzo'], ['090', 'Zamboanga-Brillantes'], ['091', 'UST-España'], ['092', 'Iloilo-Guanco'], ['093', 'Katipunan'], ['094', 'Cebu-Colon'], ['095', 'Davao-Sta. Ana'], ['096', 'GT Tower Center'], ['097', 'Cainta'], ['098', 'Timog'], ['099', 'Cebu-Mabolo'], ['100', 'Tacurong'], ['101', 'San Jose, Nueva Ecija'], ['102', 'Tarlac-Main'], ['103', 'Tuguegarao-Main'], ['104', 'Dagupan-Main'], ['105', 'Surigao'], ['106', 'Baliuag-JP Rizal'], ['107', 'La Union-Main'], ['108', 'Calapan'], ['109', 'Pagadian-Rizal'], ['110', 'Dumaguete-Main'], ['111', 'General Santos-Pioneer'], ['112', 'Occ. Mindoro'], ['113', 'Jolo'], ['114', 'Aparri'], ['115', 'Biñan'], ['116', 'Catbalogan'], ['117', 'Daet'], ['118', 'Ozamiz-Rizal'], ['119', 'Cabanatuan-Main'], ['120', 'Santiago-Maharlika Highway'], ['121', 'San Carlos-Negros Occ.'], ['122', 'Tacloban-Main'], ['123', 'Tagbilaran-Main'], ['124', 'Dipolog-Gen. Luna'], ['125', 'Solano'], ['126', 'Naga-Main'], ['127', 'Tabaco'], ['128', 'Kalibo'], ['129', 'Digos'], ['130', 'Palawan'], ['131', 'Vigan'], ['132', 'Basilan'], ['133', 'Guagua'], ['134', 'Cauayan'], ['135', 'Ilagan'], ['136', 'Gapan'], ['137', 'Gumaca'], ['138', 'Legaspi-Rizal'], ['139', 'Ormoc'], ['140', 'Laoag-Rizal'], ['141', 'Roxas'], ['142', 'Butuan-Main'], ['143', 'Batangas-Main'], ['144', 'Olongapo'], ['145', 'Lipa-B. Morada'], ['146', 'Calamba-Crossing'], ['147', 'Sumulong'], ['148', 'Agusan del Sur'], ['149', 'Marilao-Bulacan'], ['150', 'Bayview'], ['151', 'Anda Circle-Port Area'], ['152', 'Sucat-Gatchalian'], ['153', 'Lucena-Main'], ['154', 'Annapolis-Greenhills'], ['155', 'Pasong Tamo-Buendia'], ['156', 'Sta. Maria-Bulacan'], ['157', 'San Pablo-Main'], ['158', 'Sta. Cruz-Laguna'], ['159', 'ADB Ext. Office'], ['160', 'Rosario-Cavite'], ['161', 'Antique'], ['162', 'Harrison Plaza-Adriatico'], ['163', 'Del Monte'], ['164', 'NAIA'], ['165', 'Bagbaguin-Valenzuela'], ['166', 'Corinthian Plaza-Makati'], ['167', 'Edsa-Shaw'], ['168', 'Seafront'], ['169', 'Cebu-Lahug'], ['170', 'Iligan-Main'], ['171', 'Subic Bay'], ['172', 'Cebu-Tabunok'], ['173', 'Pasong Tamo-Javier St.'], ['174', 'Ayala Ave.-Bankmer'], ['175', 'Midtown-U.N. Ave.'], ['176', 'Sta. Elena'], ['177', 'Q.C. Rotonda Center'], ['179', 'Talipapa-Novaliches'], ['180', 'Tomas Morato'], ['181', 'Kalaw Hill'], ['182', 'Tagaytay'], ['183', 'Visayas Avenue'], ['184', 'Morayta'], ['185', 'Cebu-Lapu-Lapu'], ['186', 'Kalayaan Avenue'], ['187', 'Davao-Bankerohan'], ['188', 'Balagtas-Bulacan'], ['189', 'Boni Serrano'], ['190', 'Sta. Monica-Novaliches'], ['191', 'China Plaza'], ['192', 'Edsa-Tramo'], ['193', 'Tutuban'], ['194', 'Pateros'], ['195', 'Bacoor-Cavite'], ['196', 'Edsa-Congressional'], ['197', 'Asuncion'], ['198', 'West Avenue'], ['199', 'Valle Verde'], ['200', 'Intramuros'], ['202', 'Valencia, Bukidnon'], ['204', 'Urdaneta, Pangasinan'], ['205', 'Tacloban-P. Burgos'], ['206', 'Paniqui, Tarlac'], ['208', 'Davao-Tagum'], ['209', 'Cagayan de Oro-Main'], ['211', 'Gen. Luna-Paco'], ['212', 'Adriatico'], ['213', 'Zurbaran'], ['214', 'General Santos-Santiago Blvd.'], ['215', 'A. Maceda'], ['216', 'Cebu-Mango Avenue'], ['217', 'Cebu-Leon Kilat'], ['218', 'Almanza-Las Piñas'], ['219', 'Raon'], ['220', 'Brixton Hill'], ['221', 'Balanga, Bataan'], ['222', 'La Trinidad-Benguet'], ['223', 'Samson Road-Caloocan'], ['224', 'Pritil-Tondo'], ['225', 'Mother Ignacia-Timog'], ['226', 'Concepcion-Marikina'], ['227', 'Buendia-Dian'], ['228', 'Tugatog-Malabon'], ['229', 'Kamuning'], ['230', 'Caridad-Cavite'], ['231', 'Sta. Ana-Manila'], ['232', 'V. Luna-East Avenue'], ['233', 'Kayamanan C'], ['234', 'J.P. Rizal'], ['235', 'Dasmariñas-Cavite'], ['236', 'Cebu-North Road'], ['237', 'Cabanatuan-M. North'], ['238', 'Baguio-Bonifacio'], ['239', 'Davao-Bajada'], ['240', 'Iloilo-Iznart'], ['241', 'Fairview'], ['242', 'Ocean Tower'], ['243', 'Edsa-Corinthian'], ['244', 'Farmers Plaza'], ['245', 'New Manila'], ['246', 'Cebu-Banilad'], ['247', 'Naga-Peñafrancia'], ['248', 'Frontera Verde'], ['249', 'Silang-Cavite'], ['250', 'Ongpin'], ['251', 'Bacolod-Gonzaga'], ['252', 'Cebu-Magallanes'], ['253', 'Zamboanga-Veterans'], ['254', 'Wack-Wack'], ['255', 'J. Abad Santos-Mayhaligue'], ['256', 'New Divisoria Market'], ['257', 'Shaw Blvd.-Oranbo'], ['258', 'Comercio'], ['259', 'Pacific Center'], ['260', 'San Pedro-Laguna'], ['261', 'H.V. Dela Costa'], ['262', 'Lagro'], ['263', 'Sucat-Ireneville'], ['265', 'E. Rodriguez'], ['266', 'Acropolis'], ['267', 'Taytay'], ['268', 'J. Nakpil-Taft Ave.'], ['269', 'Reina Regente'], ['270', 'Alfaro'], ['271', 'Pasay-Rotonda'], ['272', 'Rosario-Pasig'], ['273', 'Libertad-Mandaluyong'], ['275', 'MacArthur Hiway-Malinta'], ['276', 'Ortigas Ave. Ext.-Cainta'], ['278', 'Dapitan-Banawe'], ['279', 'Masangkay-Luzon'], ['280', 'Edsa-Magallanes'], ['281', 'Marbel'], ['283', 'Pureza-R. Magsaysay Blvd.'], ['284', 'Addition Hills'], ['285', 'Nueva'], ['286', 'Pasong Tamo-Metropolitan Ave'], ['287', 'Cebu-Subangdaku'], ['288', 'Shaw Blvd.-Pinagtipunan'], ['289', 'San Mateo'], ['290', 'Felix Avenue'], ['291', 'Pasong Tamo-Bagtikan'], ['292', 'Paseo De Roxas'], ['293', 'Quirino Ave.-L. Guinto'], ['294', 'Calbayog'], ['295', 'Lucena-Quezon'], ['296', 'San Fernando-Dolores'], ['297', 'Angeles-Sto. Rosario'], ['298', 'Cebu-Ramos'], ['299', 'Iloilo-Mabini'], ['300', 'Sta. Rosa-Balibago'], ['301', 'F.B. Harrison-Gil Puyat Ave.'], ['302', 'Redemptorist-Baclaran'], ['303', 'Anabu-Imus Cavite'], ['304', 'Aurora Blvd.-Anonas'], ['305', 'Malolos-Bulacan'], ['306', 'V. Mapa'], ['307', 'Rizal Ave. Ext.-3rd Ave.'], ['308', 'Cebu-Manalili'], ['309', 'Kalayaan-Bel Air'], ['310', 'Rada-Rodriguez'], ['311', 'Susano Road-Novaliches'], ['312', 'Aguirre-Salcedo'], ['313', 'Carmona-Cavite'], ['314', 'Camarin Road-Caloocan'], ['315', 'Calumpang-Marikina'], ['316', 'San Roque-Marikina'], ['317', 'General Santos-Makar'], ['318', 'Bacolod-Libertad'], ['319', 'Edsa-Dasmariñas Vill. Makati'], ['320', '20th Ave.-Cubao'], ['321', 'Naic-Cavite'], ['322', 'Balayan-Batangas'], ['323', 'Don Antonio Heights'], ['324', 'Cabanatuan-M. South'], ['326', 'Tandang Sora'], ['327', 'Plaridel-Bulacan'], ['328', 'Subic-Baraca'], ['329', 'Tungkong Mangga-Bulacan'], ['330', 'Cebu-Capitol'], ['331', 'Cebu-Mambaling'], ['332', 'Davao-Buhangin'], ['333', 'M. Naval-Navotas'], ['334', 'Midsayap'], ['335', 'Tanauan'], ['336', 'Candon'], ['337', 'Kidapawan'], ['338', 'Guiguinto-Bulacan'], ['339', 'Congressional Avenue'], ['341', 'Perea-Gallardo'], ['342', 'FTI Complex-Taguig'], ['343', 'Valencia Hills'], ['344', 'Ortigas-Xavier'], ['345', 'Binangonan'], ['346', 'Catarman'], ['347', 'Sikatuna Village-Anonas'], ['348', 'Sorsogon'], ['349', 'Muntinlupa'], ['350', 'Cebu-Plaza Independencia'], ['351', 'Cebu-Talamban'], ['352', 'Trece Martires-Cavite'], ['353', 'Tomas Mapua-Fuguso'], ['354', 'General Trias-Cavite'], ['355', 'Cabuyao-Laguna'], ['356', 'Baybay'], ['357', 'Maasin, Leyte'], ['358', 'Davao-Matina'], ['359', 'Potrero-Malabon'], ['360', 'Sucat-San Antonio Valley'], ['361', 'Vasra-Visayas Ave.'], ['362', 'E. Rodriguez-Cordillera'], ['363', 'Lemery-Batangas'], ['364', 'Tutuban Prime Block'], ['365', 'Baesa'], ['366', 'Gen. Luis-Novaliches'], ['367', 'Carmona-Biñan Hway'], ['368', 'Alaminos, Pangasinan'], ['369', 'Masbate'], ['370', 'Silay-Negros Occ.'], ['371', 'Apalit'], ['372', 'San Fernando-B.Mendoza'], ['373', 'Tarlac-McArthur H-Way'], ['374', 'Angeles-Balibago'], ['375', 'Iloilo-Jaro'], ['376', 'Cagayan de Oro-Carmen'], ['377', 'Clark'], ['378', 'Calamba-Real'], ['379', 'Calamba-Parian'], ['380', 'Bocaue-Bulacan'], ['382', 'Parang-Marikina'], ['383', 'Batangas-Bauan'], ['385', 'Bulan, Sorsogon'], ['386', 'Laguna Bel-Air Sta. Rosa'], ['387', 'Paso De Blas-Maysan'], ['388', 'Baguio-Cariño'], ['390', 'Borongan-Samar'], ['391', 'Angono'], ['392', 'Molino-Bacoor Cavite'], ['393', 'Roxas-Arnaldo'], ['394', 'San Pablo-Colago'], ['395', 'Dagupan-Perez'], ['396', 'Calamba-Market'], ['397', 'Rosario-Batangas'], ['398', 'Cebu-Guadalupe'], ['399', 'Baliuag-Trinidad H-Way'], ['400', 'Tanza-Cavite'], ['401', 'Cebu-AS Fortuna'], ['402', 'Circumferential Road-Antipolo'], ['403', 'Cavite Economic Zone'], ['404', 'Agoo-La Union'], ['405', 'San Joaquin-Pasig'], ['406', 'Cotabato-Pendatun'], ['408', 'Davao-Panabo'], ['409', 'Dinalupihan, Bataan'], ['410', 'Bangued, Abra'], ['411', 'PRC-J.P. Rizal'], ['412', 'Tayuman-Felix Huertas'], ['413', 'Siniloan, Laguna'], ['414', 'Tabora'], ['416', 'Baguio-Session'], ['417', 'Caloocan'], ['418', 'Naga-Gen. Luna'], ['419', 'Cebu-Borromeo'], ['420', 'Benavidez'], ['422', 'Dagupan-Fernandez Avenue'], ['423', 'North Edsa'], ['424', 'Concepcion, Tarlac'], ['426', 'Cagayan de Oro-Divisoria Park'], ['427', 'Legaspi-Mabini'], ['428', 'Batac, Ilocos Norte'], ['429', 'Zamboanga-Galleria'], ['431', 'Leonor Rivera-Blumentritt'], ['432', 'Tacloban-Rizal Ave.'], ['435', 'Cagayan de Oro-JR Borja'], ['438', 'Bacolod-Gatuslao'], ['439', 'Iloilo-General Luna'], ['441', 'Karuhatan-Valenzuela'], ['442', 'Rockwell Center'], ['443', 'Dumaguete-Real'], ['444', 'Honorio Lopez Blvd-Balut'], ['445', 'Zabarte Road-Novaliches'], ['446', 'Pasay-Buendia Avenue'], ['447', 'Macaria Bus. Center-Carmona'], ['448', 'Barangka Riverbanks'], ['450', 'Ozamiz-Burgos'], ['462', 'A. Lacson Ave-Sampaloc'], ['463', 'Lucena-Red V'], ['464', 'Concepcion-Malabon'], ['465', 'El Grande-BF Homes'], ['466', 'San Fernando-Sindalan'], ['467', 'Mindanao Avenue'], ['469', 'San Pablo-Maharlika'], ['470', 'Culiat-Tandang Sora'], ['471', 'Mayamot-Cogeo'], ['472', 'Iba, Zambales'], ['473', 'Edsa-Cubao Aurora'], ['475', 'Greenhills North'], ['476', 'Nasugbu, Batangas'], ['477', 'Bambang'], ['478', 'Daraga, Albay'], ['480', 'Edsa-Muñoz Market'], ['481', 'Roces Avenue'], ['482', 'Cebu-Bogo'], ['483', 'Bustillos-Sampaloc'], ['484', 'Malanday-Valenzuela'], ['485', 'Los Baños'], ['486', 'Cebu-Minglanilla'], ['487', 'Iloilo-La Paz'], ['488', 'Cebu-Gorordo'], ['489', 'F. Blumentritt-San Juan'], ['490', 'East Service Road-Bicutan'], ['492', 'Bonifacio-Global City'], ['494', 'West Service Road-Alabang Hills'], ['495', 'Madrigal Bus. Park-Alabang'], ['496', 'Vigan-Market'], ['498', 'Trinoma'], ['499', 'Iloilo-Diversion Road'], ['500', 'Acacia-Ayala Alabang'], ['501', 'Kamagong-Sampaloc'], ['503', 'C3-A. Mabini'], ['504', 'Eastwood City'], ['505', 'Tayug, Pangasinan'], ['506', 'Bacolod-Eastside'], ['507', 'Batangas-Kumintang Ilaya'], ['508', 'Iriga, Camarines Sur'], ['509', 'Domestic Airport'], ['512', 'Jupiter-Bel Air'], ['513', 'Plaza Lorenzo Ruiz'], ['514', 'Skyland Plaza'], ['515', 'Camiling, Tarlac'], ['516', 'San Miguel, Bulacan'], ['517', 'Cebu-Opon'], ['518', 'San Carlos, Pangasinan'], ['522', 'Tarlac-F. Tañedo'], ['523', 'Carmen Rosales, Pangasinan'], ['526', 'La Union-ML Quezon'], ['527', 'Linagayen, Pangasinan'], ['528', 'Laoag-Gen. Segundo Avenue'], ['532', 'Ayala Triangle'], ['533', 'Cebu-Parkmall'], ['534', 'Ilocos Norte-San Nicolas'], ['542', 'Hagonoy, Bulacan'], ['543', 'Iligan-Pala-O'], ['544', 'Pagadian-Sta. Lucia'], ['545', 'Ortigas-San Miguel Ave.'], ['546', 'Bacolod-North Drive'], ['547', 'Davao-Ecoland'], ['550', 'Santiago City Road'], ['559', 'Xavierville'], ['571', 'Boracay'], ['588', 'Lipa-Ayala'], ['592', 'Dasmariñas-FCIE'], ['596', 'Canlubang-Carmelray'], ['597', 'Cebu-MEPZ II'], ['600', 'Dasmariñas-T. Pinpin'], ['601', 'Luneta-T.M. Kalaw'], ['602', 'Cebu-Salinas Drive'], ['604', 'Evangelista-Pio Del Pilar Mkti'], ['605', 'Del Monte-Talayan Village'], ['606', 'West Service Road-Merville'], ['607', 'Dela Rosa-Salcedo St.'], ['608', 'Don Bosco-Makati'], ['609', 'Laguna-Technopark'], ['610', 'Robinson\'s Place-Adriatico'], ['611', 'G. Araneta-Quezon Ave.'], ['613', 'Greenbelt'], ['614', 'Greenhills-Eisenhower'], ['616', 'San Agustin-HV Dela Costa'], ['623', 'Acacia Lane-Mandaluyong'], ['629', 'Ortigas Robinson\'s Galleria'], ['630', 'Ortigas Meralco Ave.'], ['631', 'Ortigas Taipan'], ['632', 'Pedro Gil-Paco'], ['633', 'Shaw Blvd-J.M. Escriva'], ['634', 'Pasong Tamo-Extension'], ['636', 'Examiner-Quezon Ave.'], ['637', 'Retiro-Cordillera'], ['638', 'Ayala Ave.-VA Rufino'], ['639', 'Bacao-CEPZ'], ['640', 'Roxas Blvd.-Vito Cruz'], ['641', 'Tordesillas-Gil Puyat Ave.'], ['642', 'San Lorenzo Village'], ['643', 'Paseo de Sta. Rosa'], ['645', 'Sto. Cristo-San Nicolas St.'], ['647', 'BF Resort Las Piñas **'], ['652', 'Bacolod-Lacson'], ['653', 'Bacolod-Singcang'], ['654', 'Cebu-Business Park'], ['657', 'Cebu-Mactan MEPZ'], ['658', 'Ortigas-Emerald Ave.'], ['660', 'Filinvest Corporate City'], ['665', 'Davao-Roxas'], ['667', 'Davao-Doctos'], ['668', 'Davao-D. Suazo'], ['674', 'Iloilo-J.M. Basa'], ['676', 'SFDO-Olongapo H-Way'], ['705', 'Mayon-Sta. Teresita'], ['710', 'Magallanes Village'], ['712', 'Tagbilaran-Cogon'], ['713', 'Butuan-Montilla Blvd.'], ['714', 'Maysilo Circle-Mandaluyong'], ['715', 'Metropolitan Park-Roxas Blvd'], ['733', 'Cebu-Consolacion'], ['736', 'FPIP- Sto.Tomas, Batangas'], ['738', 'Tuguegarao-Balzain'], ['740', 'Dipolog-P. Burgos'], ['742', 'Taft Avenue-La Salle'], ['752', 'Sto. Niño-Marikina']];

3)) 결과!

 


 

 

개인적으로 multi cursor를 자주 쓰는 부분은 디버깅할 때 변수 찍어보기인 것 같더라. 그래서 console.log('변수명', 변수명); 과 같이 찍어보는데, 이것도 생각보다 참 귀찮은 일이더라고. 그래서 아예 Alfred workflow를 만들어버렸다. 어차피 보는 사람도 없는 블로그인데 파일 첨부하기는 귀찮고 (?) 워크플로우 중간에 들어간 파이썬 스크립트는 다음과 같다.

import sys

query = '''{query}'''

a = query.split()
result = ""
for i in a:
  result += "console.log(\'" + i + "\', " + i + ");\n"

sys.stdout.write(result)

옆자리 친구가 최근 vim을 쓰기 시작했는데, 나도 내 생산성을 올릴 수 있는 알프레드 워크플로우를 조금씩 만들어볼까 싶기도 하고, 하지만 우분투에서도 돌아가는 툴은 아니니까 망설여지기도 하고… 아니면 아예 내가 에디어에 플러그인을 만들어버릴까 생각을 하니, 그럴꺼면 atom을 쓰는 게 더 좋을 것 같다는 생각도 들었다. 아톰 써볼까…

Leave a Reply