{"id":437,"date":"2018-03-04T05:01:36","date_gmt":"2018-03-04T05:01:36","guid":{"rendered":"http:\/\/kevinmichaelcoy.com\/blog\/?p=437"},"modified":"2022-02-18T21:14:07","modified_gmt":"2022-02-18T21:14:07","slug":"vi-cheatsheet","status":"publish","type":"post","link":"http:\/\/kevinmichaelcoy.com\/blog\/2018\/03\/04\/vi-cheatsheet\/","title":{"rendered":"vi Cheatsheet"},"content":{"rendered":"\n<p>This is a cheatsheet for the defacto standard for editing files in Linux \/ Unix at the terminal or command line. Admittedly, it can be intimidating and frankly confusing to get started if you never have used it; however, it comes with nearly every installation of an operating system based on Unix. As a result, it can pay to learn at least the basics of how to use vi. It can really come in handy in a pinch and, with time, you may find it very useful and much faster to use then a more full featured text editor like UltraEdit \/ NotePad++ \/ etc.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"http:\/\/kevinmichaelcoy.com\/blog\/wp-content\/uploads\/2018\/03\/vi-cheatsheet.pdf\"><img loading=\"lazy\" width=\"1024\" height=\"576\" src=\"http:\/\/kevinmichaelcoy.com\/blog\/wp-content\/uploads\/2018\/03\/vi-cheatsheet-1024x576.png\" alt=\"vi cheatsheet and crib sheet.\" class=\"wp-image-441\" srcset=\"http:\/\/kevinmichaelcoy.com\/blog\/wp-content\/uploads\/2018\/03\/vi-cheatsheet-1024x576.png 1024w, http:\/\/kevinmichaelcoy.com\/blog\/wp-content\/uploads\/2018\/03\/vi-cheatsheet-300x169.png 300w, http:\/\/kevinmichaelcoy.com\/blog\/wp-content\/uploads\/2018\/03\/vi-cheatsheet-768x432.png 768w, http:\/\/kevinmichaelcoy.com\/blog\/wp-content\/uploads\/2018\/03\/vi-cheatsheet-150x84.png 150w, http:\/\/kevinmichaelcoy.com\/blog\/wp-content\/uploads\/2018\/03\/vi-cheatsheet.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption>vi cheatsheet and crib sheet.<\/figcaption><\/figure>\n\n\n\n<p>Additional commands you may find helpful follow:<\/p>\n\n\n\n<h1>Navigate to an index\/character\/column number on a line number<\/h1>\n\n\n\n<p>Let&#8217;s say you are editing fixed-length data and you know where a particular field falls on a line. So, let&#8217;s navigate to line 2 and then character 351<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">2 Shift+G\n351|<\/code><\/pre>\n\n\n\n<p>Now, if you want to confirm the line number and the column number, you can do the following (<a href=\"https:\/\/stackoverflow.com\/questions\/50862344\/how-to-get-character-count-using-vi-or-vim\">more info<\/a>).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">Ctrl+G\n\"fixed_length.txt\" line 2 of 5 --40%-- col 351 <\/code><\/pre>\n\n\n\n<h1>VI JOE Shirt<\/h1>\n\n\n\n<p>And if you consider yourself a vi expert, then maybe you&#8217;d be interested in this t-shirt<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/www.cafepress.com\/nerdt_.348960282\"><img loading=\"lazy\" width=\"350\" height=\"350\" src=\"http:\/\/kevinmichaelcoy.com\/blog\/wp-content\/uploads\/2018\/03\/vi-joe.png\" alt=\"vi Joe\" class=\"wp-image-442\" srcset=\"http:\/\/kevinmichaelcoy.com\/blog\/wp-content\/uploads\/2018\/03\/vi-joe.png 350w, http:\/\/kevinmichaelcoy.com\/blog\/wp-content\/uploads\/2018\/03\/vi-joe-150x150.png 150w, http:\/\/kevinmichaelcoy.com\/blog\/wp-content\/uploads\/2018\/03\/vi-joe-300x300.png 300w\" sizes=\"(max-width: 350px) 100vw, 350px\" \/><\/a><figcaption>vi Joe<\/figcaption><\/figure><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\"><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This is a cheatsheet for the defacto standard for editing files in Linux \/ Unix at the terminal or command line. Admittedly, it can be intimidating and frankly confusing to get started if you never have used it; however, it comes with nearly every installation of an operating system based&#8230;<\/p>\n<p class=\"continue-reading-button\"> <a class=\"continue-reading-link\" href=\"http:\/\/kevinmichaelcoy.com\/blog\/2018\/03\/04\/vi-cheatsheet\/\">Continue reading<i class=\"crycon-right-dir\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[282,326,325,331,327,329,328,133,330,324,332],"_links":{"self":[{"href":"http:\/\/kevinmichaelcoy.com\/blog\/wp-json\/wp\/v2\/posts\/437"}],"collection":[{"href":"http:\/\/kevinmichaelcoy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/kevinmichaelcoy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/kevinmichaelcoy.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/kevinmichaelcoy.com\/blog\/wp-json\/wp\/v2\/comments?post=437"}],"version-history":[{"count":7,"href":"http:\/\/kevinmichaelcoy.com\/blog\/wp-json\/wp\/v2\/posts\/437\/revisions"}],"predecessor-version":[{"id":663,"href":"http:\/\/kevinmichaelcoy.com\/blog\/wp-json\/wp\/v2\/posts\/437\/revisions\/663"}],"wp:attachment":[{"href":"http:\/\/kevinmichaelcoy.com\/blog\/wp-json\/wp\/v2\/media?parent=437"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/kevinmichaelcoy.com\/blog\/wp-json\/wp\/v2\/categories?post=437"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/kevinmichaelcoy.com\/blog\/wp-json\/wp\/v2\/tags?post=437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}