{"id":6864,"date":"2017-02-26T20:23:44","date_gmt":"2017-02-26T20:23:44","guid":{"rendered":"https:\/\/itnigblog.live-website.com\/?p=6795"},"modified":"2020-06-11T13:11:46","modified_gmt":"2020-06-11T13:11:46","slug":"breaking-vims-unbreakable-learning-wall","status":"publish","type":"post","link":"https:\/\/itnig.net\/blog\/breaking-vims-unbreakable-learning-wall\/","title":{"rendered":"Breaking VIM\u2019s unbreakable \u00ablearning wall\u00bb"},"content":{"rendered":"<p id=\"93fd\" class=\"graf graf--p graf-after--h3\">First of all, let\u2019s make things clear. VIM does not stand for\u00a0<strong class=\"markup--strong markup--p-strong\">V<\/strong>ery\u00a0<strong class=\"markup--strong markup--p-strong\">I<\/strong>ntuitive\u00a0<strong class=\"markup--strong markup--p-strong\">M<\/strong>agic. It\u2019s not easy to learn and it\u2019s like going to the gym. You have to be consistent and use it daily to see the results and keep in shape once you are fit.<\/p>\n<p id=\"a781\" class=\"graf graf--p graf-after--p\">But why is it so confusing for most of the people? It is a modal editor, and every mode has its own key bindings. By default VIM opens in \u00abnormal mode\u00bb, which won\u2019t allow you to type. You have to get into \u00abinsert mode\u00bb pressing the \u00abi\u00bb key to be able to insert text, but you could also place the cursor on a character and press \u00abr\u00bb to replace it with whatever you typed next, or you could press \u00abo\u00bb to create a new line and enter \u00abinsert mode\u00bb at the same time, etc. You have to remember what every key does in every mode, and you\u2019ll only achieve this with practice. That\u2019s what makes VIM different.<\/p>\n<h3 id=\"8097\" class=\"graf graf--h3 graf-after--p\">Why bother?<\/h3>\n<p id=\"29e7\" class=\"graf graf--p graf-after--h3\">So why would anyone try to break the learning wall and master VIM? Some will say it\u2019s just to prettend you are cool, but they couldn\u2019t be more wrong. There are some features that make the VIM user objectively faster than any other editor user.<\/p>\n<h4 id=\"7e80\" class=\"graf graf--h4 graf-after--p\">No mouse<\/h4>\n<p id=\"3e21\" class=\"graf graf--p graf-after--h4\">The first one is the fact that you don\u2019t have to use the mouse for anything. Think about how many times you use the mouse to move around a document in any other editor and sum all those precious miliseconds. It\u2019s a lot at the end of the year.<\/p>\n<figure id=\"018a\" class=\"graf graf--figure graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*TMIo9fotX2sYlXQ4ELmNkw.gif\" data-width=\"824\" data-height=\"390\" data-action=\"zoom\" data-action-value=\"1*TMIo9fotX2sYlXQ4ELmNkw.gif\" data-scroll=\"native\"><canvas class=\"progressiveMedia-canvas js-progressiveMedia-canvas\" width=\"75\" height=\"35\"><\/canvas><img decoding=\"async\" class=\"progressiveMedia-image js-progressiveMedia-image\" src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/1*TMIo9fotX2sYlXQ4ELmNkw.gif\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/1*TMIo9fotX2sYlXQ4ELmNkw.gif\" \/><\/div>\n<\/div><figcaption class=\"imageCaption\">Changing an \u201cIF\u201d condition and adding an \u201cIF\u201d in 10\u00a0seconds<\/figcaption><\/figure>\n<h4 id=\"4a16\" class=\"graf graf--h4 graf-after--figure\">Hands always in standard\u00a0position<\/h4>\n<p id=\"2e8a\" class=\"graf graf--p graf-after--h4\">It\u2019s not only that you don\u2019t use the mouse, but you actually don\u2019t have to move your hands out of the standard position, meaning that you don\u2019t need to use arrow keys, or other keys outside the normal reach.<\/p>\n<h4 id=\"6bd6\" class=\"graf graf--h4 graf-after--p\">Preinstalled<\/h4>\n<p id=\"48d8\" class=\"graf graf--p graf-after--h4\">It comes preinstalled in almost every decent operative system, so you don\u2019t have to go through the hassle of downloading it every time you change your computer or want to edit something somewhere else.<\/p>\n<h4 id=\"95b1\" class=\"graf graf--h4 graf-after--p\">Runs in Console\/Terminal<\/h4>\n<p id=\"d6dd\" class=\"graf graf--p graf-after--h4\">It runs GUIless, in a Terminal or Console, so if you are working on a development project running servers, scripts and commands, you don\u2019t have to switch context. You can feel at home even when editing files in remote servers. This means you can even access and use VIM from a smartphone with an SSH app.<\/p>\n<figure id=\"70e7\" class=\"graf graf--figure graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*NoFRNh5uFWE3iCiabrkGjA.jpeg\" data-width=\"1600\" data-height=\"805\" data-action=\"zoom\" data-action-value=\"1*NoFRNh5uFWE3iCiabrkGjA.jpeg\" data-scroll=\"native\"><canvas class=\"progressiveMedia-canvas js-progressiveMedia-canvas\" width=\"75\" height=\"37\"><\/canvas><img decoding=\"async\" class=\"progressiveMedia-image js-progressiveMedia-image\" src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/1*NoFRNh5uFWE3iCiabrkGjA.jpeg\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/1*NoFRNh5uFWE3iCiabrkGjA.jpeg\" \/><\/div>\n<\/div><figcaption class=\"imageCaption\">Editing the itnig website in a Mac, with and iPad, through\u00a0SSH<\/figcaption><\/figure>\n<h4 id=\"84d6\" class=\"graf graf--h4 graf-after--figure\">Lightweight and\u00a0fast<\/h4>\n<p id=\"c55f\" class=\"graf graf--p graf-after--h4\">It\u2019s lightweight and fast, super responsive and never crashes. It takes 60ms for it to open a file containing the 131843 lines of the Holly Bible.<\/p>\n<h4 id=\"9db3\" class=\"graf graf--h4 graf-after--p\">100% Customizable<\/h4>\n<p id=\"7a01\" class=\"graf graf--p graf-after--h4\">If there is something you don\u2019t like just change it. The\u00a0.vimrc config file lets you customize the behaviour of your editor and confortably replicate your settings between setups. If there is something missing, just\u00a0<a class=\"markup--anchor markup--p-anchor\" href=\"http:\/\/vimawesome.com\/\" target=\"_blank\" rel=\"noopener noreferrer\" data-href=\"http:\/\/vimawesome.com\">install it as a plugin<\/a>.<\/p>\n<h4 id=\"d861\" class=\"graf graf--h4 graf-after--p\">Macros and\u00a0scripts<\/h4>\n<p id=\"eaa7\" class=\"graf graf--p graf-after--h4\">You can actually record your commands to automatise repetitive tasks. Imagine you have a data file you want to make JSON compliant. By recording what you want just once, you can replicate it as many times as you need.<\/p>\n<figure id=\"37c6\" class=\"graf graf--figure graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*W4bXPaCw6DAKzSSzrwZEbg.gif\" data-width=\"824\" data-height=\"206\" data-action=\"zoom\" data-action-value=\"1*W4bXPaCw6DAKzSSzrwZEbg.gif\" data-scroll=\"native\"><canvas class=\"progressiveMedia-canvas js-progressiveMedia-canvas\" width=\"75\" height=\"18\"><\/canvas><img decoding=\"async\" class=\"progressiveMedia-image js-progressiveMedia-image\" src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/1*W4bXPaCw6DAKzSSzrwZEbg.gif\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/1*W4bXPaCw6DAKzSSzrwZEbg.gif\" \/><\/div>\n<\/div><figcaption class=\"imageCaption\">Making a data set JSON compliant by recording and playing a\u00a0macro<\/figcaption><\/figure>\n<p id=\"886c\" class=\"graf graf--p graf-after--figure\">And if that\u2019s not enough for you, you can write scripts using VIM Script and customize your VIM even more.<\/p>\n<figure id=\"fdc9\" class=\"graf graf--figure graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*su1XuM_TpLMBAHx43pNoNQ.gif\" data-width=\"824\" data-height=\"122\" data-action=\"zoom\" data-action-value=\"1*su1XuM_TpLMBAHx43pNoNQ.gif\" data-scroll=\"native\"><canvas class=\"progressiveMedia-canvas js-progressiveMedia-canvas\" width=\"75\" height=\"10\"><\/canvas><img decoding=\"async\" class=\"progressiveMedia-image js-progressiveMedia-image\" src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/1*su1XuM_TpLMBAHx43pNoNQ.gif\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/1*su1XuM_TpLMBAHx43pNoNQ.gif\" \/><\/div>\n<\/div><figcaption class=\"imageCaption\">How fast can you type all IP\u2019s in a local network in your\u00a0editor?<\/figcaption><\/figure>\n<p id=\"fed7\" class=\"graf graf--p graf-after--figure\">With just a few lines you can for example create your custom syntax highlighting toggle, and use a shortcut to activate it.<\/p>\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"iframeContainer\"><iframe loading=\"lazy\" src=\"https:\/\/blog.itnig.net\/media\/b07efa649636f13ee808bf64bc23736e?postId=6fd9c28215bc\" width=\"700\" height=\"250\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\" data-media-id=\"b07efa649636f13ee808bf64bc23736e\" data-mce-fragment=\"1\"><\/iframe><\/div>\n<\/div>\n<p>VIM syntax toggling script\u00a0<a class=\"markup--anchor markup--figure-anchor\" href=\"https:\/\/www.ibm.com\/developerworks\/library\/l-vim-script-1\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" data-href=\"https:\/\/www.ibm.com\/developerworks\/library\/l-vim-script-1\/\">https:\/\/www.ibm.com\/developerworks\/library\/l-vim-script-1\/<\/a><\/p>\n<h3 id=\"952d\" class=\"graf graf--h3 graf-after--figure\">Breaking the\u00a0wall<\/h3>\n<p id=\"8200\" class=\"graf graf--p graf-after--h3\">The best way for learning VIM is using it for everything. From writing documetation to typing code in every project you have. Start with the basic commands:<em class=\"markup--em markup--p-em\">\u00a0i,\u00a0:wq, dd, p, hjkl<\/em>.<\/p>\n<div id=\"bb84\" class=\"graf graf--mixtapeEmbed graf-after--p\"><a class=\"markup--anchor markup--mixtapeEmbed-anchor\" title=\"http:\/\/yannesposito.com\/Scratch\/en\/blog\/Learn-Vim-Progressively\/\" href=\"http:\/\/yannesposito.com\/Scratch\/en\/blog\/Learn-Vim-Progressively\/\" data-href=\"http:\/\/yannesposito.com\/Scratch\/en\/blog\/Learn-Vim-Progressively\/\"><strong class=\"markup--strong markup--mixtapeEmbed-strong\">YBlog &#8211; Learn Vim Progressively<\/strong><br \/>\n<em class=\"markup--em markup--mixtapeEmbed-em\">But before we start, just a warning. Learning vim will be painful at first. It will take time. It will be a lot like\u2026<\/em>yannesposito.com<\/a><\/div>\n<p id=\"e8e6\" class=\"graf graf--p graf-after--mixtapeEmbed\">You can try this awesome Zelda-like game to learn how to use VIM.<\/p>\n<div id=\"c6ca\" class=\"graf graf--mixtapeEmbed graf-after--p\"><a class=\"markup--anchor markup--mixtapeEmbed-anchor\" title=\"https:\/\/vim-adventures.com\" href=\"https:\/\/vim-adventures.com\/\" data-href=\"https:\/\/vim-adventures.com\"><strong class=\"markup--strong markup--mixtapeEmbed-strong\">VIM Adventures &#8211; Learn VIM while playing a game<\/strong><br \/>\n<em class=\"markup--em markup--mixtapeEmbed-em\">VIM Adventures is an online game based on VIM&#8217;s keyboard shortcuts. It&#8217;s the &#8220;Zelda meets text editing&#8221; game. So come\u2026<\/em>vim-adventures.com<\/a><\/div>\n<p id=\"2189\" class=\"graf graf--p graf-after--mixtapeEmbed\">Keep using it, because you\u2019ll never feel you know it enough.<\/p>\n<p id=\"6163\" class=\"graf graf--p graf-after--p graf--trailing\">I hope this gave you the essentials to start exploring the eternal possibilities of VIM. Feel free to comment below if you have experience using it yourself, the more tips the better. When you master VIM, I can guarantee that you\u2019ll never use any other editor again. Enjoy!<\/p>\n<p>&nbsp;\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>First of all, let\u2019s make things clear. VIM does not stand for\u00a0Very\u00a0Intuitive\u00a0Magic. It\u2019s not easy to learn and it\u2019s like going to the gym. You have to be consistent and use it daily to see the results and keep in shape once you are fit. But why is it so confusing for most of the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":6794,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-6864","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/itnig.net\/blog\/wp-json\/wp\/v2\/posts\/6864","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itnig.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itnig.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itnig.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/itnig.net\/blog\/wp-json\/wp\/v2\/comments?post=6864"}],"version-history":[{"count":1,"href":"https:\/\/itnig.net\/blog\/wp-json\/wp\/v2\/posts\/6864\/revisions"}],"predecessor-version":[{"id":9625,"href":"https:\/\/itnig.net\/blog\/wp-json\/wp\/v2\/posts\/6864\/revisions\/9625"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itnig.net\/blog\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/itnig.net\/blog\/wp-json\/wp\/v2\/media?parent=6864"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itnig.net\/blog\/wp-json\/wp\/v2\/categories?post=6864"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itnig.net\/blog\/wp-json\/wp\/v2\/tags?post=6864"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}