{"id":3407,"date":"2010-09-02T00:00:00","date_gmt":"2010-09-01T22:00:00","guid":{"rendered":"http:\/\/www.theill.com\/blog\/2010\/09\/02\/using-vi-for-your-simple-day-to-day-editing-needs\/"},"modified":"2010-09-02T00:00:00","modified_gmt":"2010-09-01T22:00:00","slug":"using-vi-for-your-simple-day-to-day-editing-needs","status":"publish","type":"post","link":"https:\/\/www.theill.com\/blog\/2010\/09\/02\/using-vi-for-your-simple-day-to-day-editing-needs\/","title":{"rendered":"Using vi for your simple, day-to-day editing needs"},"content":{"rendered":"

My favorite editor isn’t vi<\/code>, but I’m still using it at least a couple of times each day. It’s a short two character command, it’s always available and it starts fast.<\/p>\n

I have used it for decades and still, I only know these commands. I really don’t need to learn any others, contrary what some of my friends tell me.<\/p>\n

Need to know<\/h3>\n
\n
j = move down <\/dt>\n
k = move up <\/dt>\n
l = move right <\/dt>\n
h = move left <\/dt>\n
i = go into “insert” mode<\/dt>\n
= go into “command-line” mode
\nESC = go out of current mode
\nx = delete character
\nwq! = save file and quit (when in command mode)
\nq! = quit (when in command mode)<\/dd>\n<\/dl>\n

Good to know<\/h3>\n

{number}G = goto line
\nyy = copy line
\ndd = delete line
\np = paste line below
\nP = paste line above
\nr = replace character
\nA = go into “insert” mode and append to end-of-line
\n\/ = go into “search” mode<\/p>\n

That’s it .. you might want to check out variants of these commands e.g. “5dd” to delete five lines, “4yy” to copy four lines.<\/p>\n

If you need a list of all commands, look up the index help page in the vim (you are probably using vim<\/code> and not vi<\/code>) documentation using:<\/p>\n

: help index<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"

My favorite editor isn’t vi, but I’m still using it at least a couple of times each day. It’s a short two character command, it’s always available and it starts fast. I have used it for decades and still, I only know these commands. I really don’t need to learn any others, contrary what some … Continue reading Using vi for your simple, day-to-day editing needs<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[1],"tags":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"yoast_head":"\nUsing vi for your simple, day-to-day editing needs • Peter Theill Site<\/title>\n<meta name=\"robots\" content=\"index, follow\" \/>\n<meta name=\"googlebot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta name=\"bingbot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.theill.com\/blog\/2010\/09\/02\/using-vi-for-your-simple-day-to-day-editing-needs\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using vi for your simple, day-to-day editing needs • Peter Theill Site\" \/>\n<meta property=\"og:description\" content=\"My favorite editor isn’t vi, but I’m still using it at least a couple of times each day. It’s a short two character command, it’s always available and it starts fast. I have used it for decades and still, I only know these commands. I really don’t need to learn any others, contrary what some … Continue reading Using vi for your simple, day-to-day editing needs\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.theill.com\/blog\/2010\/09\/02\/using-vi-for-your-simple-day-to-day-editing-needs\/\" \/>\n<meta property=\"og:site_name\" content=\"Peter Theill Site\" \/>\n<meta property=\"article:published_time\" content=\"2010-09-01T22:00:00+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary\" \/>\n<meta name=\"twitter:creator\" content=\"@theill\" \/>\n<meta name=\"twitter:site\" content=\"@theill\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.theill.com\/#website\",\"url\":\"https:\/\/www.theill.com\/\",\"name\":\"Peter Theill Site\",\"description\":\"What\\u2019s going on in the personal life of Peter Theill\",\"publisher\":{\"@id\":\"https:\/\/www.theill.com\/#\/schema\/person\/d65d009363af2cc0a150b55dc20fa301\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/www.theill.com\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.theill.com\/blog\/2010\/09\/02\/using-vi-for-your-simple-day-to-day-editing-needs\/#webpage\",\"url\":\"https:\/\/www.theill.com\/blog\/2010\/09\/02\/using-vi-for-your-simple-day-to-day-editing-needs\/\",\"name\":\"Using vi for your simple, day-to-day editing needs • Peter Theill Site\",\"isPartOf\":{\"@id\":\"https:\/\/www.theill.com\/#website\"},\"datePublished\":\"2010-09-01T22:00:00+00:00\",\"dateModified\":\"2010-09-01T22:00:00+00:00\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.theill.com\/blog\/2010\/09\/02\/using-vi-for-your-simple-day-to-day-editing-needs\/\"]}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/www.theill.com\/blog\/2010\/09\/02\/using-vi-for-your-simple-day-to-day-editing-needs\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.theill.com\/blog\/2010\/09\/02\/using-vi-for-your-simple-day-to-day-editing-needs\/#webpage\"},\"author\":{\"@id\":\"https:\/\/www.theill.com\/#\/schema\/person\/d65d009363af2cc0a150b55dc20fa301\"},\"headline\":\"Using vi for your simple, day-to-day editing needs\",\"datePublished\":\"2010-09-01T22:00:00+00:00\",\"dateModified\":\"2010-09-01T22:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.theill.com\/blog\/2010\/09\/02\/using-vi-for-your-simple-day-to-day-editing-needs\/#webpage\"},\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.theill.com\/#\/schema\/person\/d65d009363af2cc0a150b55dc20fa301\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.theill.com\/blog\/2010\/09\/02\/using-vi-for-your-simple-day-to-day-editing-needs\/#respond\"]}]},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.theill.com\/#\/schema\/person\/d65d009363af2cc0a150b55dc20fa301\",\"name\":\"Peter\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.theill.com\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f4f96a08152550e603ee595403f3ba57?s=96&d=retro&r=g\",\"caption\":\"Peter\"},\"logo\":{\"@id\":\"https:\/\/www.theill.com\/#personlogo\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","jetpack_shortlink":"https:\/\/wp.me\/p8TYI1-SX","jetpack-related-posts":[{"id":3418,"url":"https:\/\/www.theill.com\/blog\/2009\/03\/12\/extend-your-shell-toolbox-with-pbcopy\/","url_meta":{"origin":3407,"position":0},"title":"Extend your shell toolbox with pbcopy","date":"March 12, 2009","format":false,"excerpt":"I'm developing Rails applications on Mac and a command which isn\u2019t used enough in my opinion is \u201cpbcopy\u201d. This command will allow you to grab the standard input from a terminal and put it on the clipboard. I find myself using commands such as \u201cpwd | pbcopy\u201d a lot. This\u2026","rel":"","context":"In "development"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3406,"url":"https:\/\/www.theill.com\/blog\/2010\/10\/27\/how-to-backup-redmine-on-google-storage\/","url_meta":{"origin":3407,"position":1},"title":"How to backup Redmine on Google Storage","date":"October 27, 2010","format":false,"excerpt":"If you would like to backup your Redmine database and files, you might to consider Google Storage as your backup location. It comes with a 100 GB free monthly usage. First, you need to sign up for a Google Storage account if you don\u2019t have an account already. Once done,\u2026","rel":"","context":"Similar post","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3395,"url":"https:\/\/www.theill.com\/blog\/2013\/08\/14\/immediately-flush-iis-log-for-real-time-tail-to-avoid-60-second-buffer-delay\/","url_meta":{"origin":3407,"position":2},"title":"Immediately flush IIS log for real time tail to avoid 60 second buffer delay","date":"August 14, 2013","format":false,"excerpt":"I wanted to tail my IIS log in realtime to avoid having to wait 60 seconds as is the default on IIS 7. I found out that I could run the command > netsh http flush logbuffer This is great but I wanted to do a tail so this short\u2026","rel":"","context":"Similar post","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3417,"url":"https:\/\/www.theill.com\/blog\/2009\/03\/16\/upgrading-rails-engines-project-to-rails-2-3-2\/","url_meta":{"origin":3407,"position":3},"title":"Upgrading Rails Engines Project to Rails 2.3.2","date":"March 16, 2009","format":false,"excerpt":"My lifestyleapps project (still in very early beta) was running Rails 2.2.2 with the Rails Engines plugin ten minutes ago. Today, Rails 2.3.2 was released so I decided to try if I could easily upgrade it and avoid using the Rails Engines plugin anymore. It was beautiful simple and took\u2026","rel":"","context":"In "development"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3414,"url":"https:\/\/www.theill.com\/blog\/2010\/01\/27\/facebook-css-for-will_paginate-gem\/","url_meta":{"origin":3407,"position":4},"title":"Facebook CSS for will_paginate gem","date":"January 27, 2010","format":false,"excerpt":"Today I needed to add pagination to my Danish beta application for handling your accounting called Hurtigmoms. Since I'm developing in Rails it was a logically choice to use \u201cwill_paginate\u201d to support pagination. Our prototype layout is using a Facebook header and so I wanted my pagination control to mimic\u2026","rel":"","context":"In "development"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3412,"url":"https:\/\/www.theill.com\/blog\/2010\/08\/14\/send-your-weight-from-an-iphone-through-sms\/","url_meta":{"origin":3407,"position":5},"title":"Send your weight from an iPhone through SMS","date":"August 14, 2010","format":false,"excerpt":"While working on lifestyleapps I have been asked a couple of times, if it would be possible to report your weight by sending an SMS from your phone. This is already possible and I have been using it from my iPhone 3G for a long time. The trick is to\u2026","rel":"","context":"Similar post","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"amp_validity":null,"_links":{"self":[{"href":"https:\/\/www.theill.com\/wp-json\/wp\/v2\/posts\/3407"}],"collection":[{"href":"https:\/\/www.theill.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.theill.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.theill.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.theill.com\/wp-json\/wp\/v2\/comments?post=3407"}],"version-history":[{"count":0,"href":"https:\/\/www.theill.com\/wp-json\/wp\/v2\/posts\/3407\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.theill.com\/wp-json\/wp\/v2\/media?parent=3407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.theill.com\/wp-json\/wp\/v2\/categories?post=3407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.theill.com\/wp-json\/wp\/v2\/tags?post=3407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}