{"id":10754,"date":"2023-08-31T16:24:28","date_gmt":"2023-08-31T14:24:28","guid":{"rendered":"https:\/\/monodes.com\/predaelli\/?p=10754"},"modified":"2023-08-31T16:24:33","modified_gmt":"2023-08-31T14:24:33","slug":"adding-parenthesis-around-highlighted-text-in-vim","status":"publish","type":"post","link":"https:\/\/monodes.com\/predaelli\/2023\/08\/31\/adding-parenthesis-around-highlighted-text-in-vim\/","title":{"rendered":"Adding parenthesis around highlighted text in Vim"},"content":{"rendered":"\n<p>Lovely, lovely vim<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<div class=\"s-prose js-post-body\">\n<h1>The command<\/h1>\n<p><code class=\"\" data-line=\"\">c()&lt;Esc&gt;P<\/code><\/p>\n<h1>Explanation<\/h1>\n<p>If you want to put the word under the cursor in to brackets this is <code class=\"\" data-line=\"\">viwc()&lt;Esc&gt;P<\/code>.<\/p>\n<p><code class=\"\" data-line=\"\">viw<\/code> will <code class=\"\" data-line=\"\">v<\/code>isually select all charactrs <code class=\"\" data-line=\"\">i<\/code>n a <code class=\"\" data-line=\"\">w<\/code>ord.<\/p>\n<p><code class=\"\" data-line=\"\">c()<\/code> will <code class=\"\" data-line=\"\">c<\/code>change the selection and drops you into insert mode, where you type the literal characters <code class=\"\" data-line=\"\">(<\/code> <code class=\"\" data-line=\"\">)<\/code>. Also, <code class=\"\" data-line=\"\">c<\/code> automatically copies the original content to your <code class=\"\" data-line=\"\">yank<\/code> buffer (clip board).<\/p>\n<p>With <code class=\"\" data-line=\"\">&lt;Esc&gt;P<\/code> you return <code class=\"\" data-line=\"\">Esc<\/code>back from insert to normal mode and <code class=\"\" data-line=\"\">P<\/code>aste the previous content.<\/p>\n<\/div>\n<cite>Source: <em><a href=\"https:\/\/superuser.com\/questions\/875095\/adding-parenthesis-around-highlighted-text-in-vim\">Adding parenthesis around highlighted text in Vim<\/a><\/em><\/cite><\/blockquote>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">Lovely, lovely vim The command c()&lt;Esc&gt;P Explanation If you want to put the word under the cursor in to brackets this is viwc()&lt;Esc&gt;P. viw will visually select all charactrs in a word. c() will cchange the selection and drops you into insert mode, where you type the literal characters ( ). Also, c automatically copies&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/monodes.com\/predaelli\/2023\/08\/31\/adding-parenthesis-around-highlighted-text-in-vim\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[79],"tags":[],"class_list":["post-10754","post","type-post","status-publish","format-standard","hentry","category-vim"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6daft-2Ns","jetpack-related-posts":[{"id":5144,"url":"https:\/\/monodes.com\/predaelli\/2019\/01\/22\/5144\/","url_meta":{"origin":10754,"position":0},"title":"How do I paste from PuTTY into Vim 8.0?","author":"Paolo Redaelli","date":"2019-01-22","format":false,"excerpt":"How do I paste from PuTTY into Vim 8.0? Well, nice question, as I found it quite annoying that the usual right click on the mouse doesn't work. In fact Open a web browser, copy \/ paste some text from a website (eg. GitHub) Use PuTTY 0.67 to SSH to\u2026","rel":"","context":"In &quot;Senza categoria&quot;","block_context":{"text":"Senza categoria","link":"https:\/\/monodes.com\/predaelli\/category\/senza-categoria\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10992,"url":"https:\/\/monodes.com\/predaelli\/2023\/12\/05\/search-and-replace-in-multiple-files-using-vim\/","url_meta":{"origin":10754,"position":1},"title":"Search and replace in multiple files using vim","author":"Paolo Redaelli","date":"2023-12-05","format":false,"excerpt":"Search and replace in multiple files using vim - (source Stack Overflow) It is as simple as Use: :set aw :argdo %s\/happy999\/happy111\/g The first line sets auto-write mode, so when you switch between files, vim will write the file if it has changed. The second line does your global search\u2026","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1037,"url":"https:\/\/monodes.com\/predaelli\/2016\/02\/21\/vim-master-cheat-sheet\/","url_meta":{"origin":10754,"position":2},"title":"Vim master cheat sheet","author":"Paolo Redaelli","date":"2016-02-21","format":false,"excerpt":"Sorgente: Vim by Patrick Schanen | ZEEF Vim, an open-source, powerful and configurable text editor.","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8003,"url":"https:\/\/monodes.com\/predaelli\/2021\/01\/04\/5-lines-i-put-in-a-blank-vimrc-sword-and-signals\/","url_meta":{"origin":10754,"position":3},"title":"5 lines I put in a blank .vimrc | Sword and Signals","author":"Paolo Redaelli","date":"2021-01-04","format":false,"excerpt":"TL;DR To make a default Vim installation more useful, type the following 5 lines into its .vimrc file: set hlsearch \" highlight all search results set ignorecase \" do case insensitive search set incsearch \" show incremental search results as you type set number \" display line number set noswapfile\u2026","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9687,"url":"https:\/\/monodes.com\/predaelli\/2022\/10\/01\/spacevim-has-eiffel-support\/","url_meta":{"origin":10754,"position":4},"title":"SpaceVim has Eiffel support!","author":"Paolo Redaelli","date":"2022-10-01","format":false,"excerpt":"SpaceVim, a community-driven vim distribution that seeks to provide layer feature, besides turning Vim into a nifty IDE for several languages (C\/C++, Rust, Kotlin, Go, Python, Java and JavaScript plus others), it offers among the available layers one for Eiffel! \u00a0","rel":"","context":"In &quot;Eiffel&quot;","block_context":{"text":"Eiffel","link":"https:\/\/monodes.com\/predaelli\/category\/eiffel\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1507,"url":"https:\/\/monodes.com\/predaelli\/2016\/05\/07\/learning-vim\/","url_meta":{"origin":10754,"position":5},"title":"Learning VIM","author":"Paolo Redaelli","date":"2016-05-07","format":false,"excerpt":"She likes to write on the terminal. She is learning VIM. She is 6 years old.","rel":"","context":"In &quot;Mood&quot;","block_context":{"text":"Mood","link":"https:\/\/monodes.com\/predaelli\/category\/mood\/"},"img":{"alt_text":"silvia-usa-vim","src":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2016\/05\/silvia-usa-vim-510x302.jpeg?resize=350%2C200","width":350,"height":200},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/10754","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/comments?post=10754"}],"version-history":[{"count":0,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/10754\/revisions"}],"wp:attachment":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/media?parent=10754"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/categories?post=10754"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/tags?post=10754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}