{"id":583,"date":"2012-06-26T14:02:50","date_gmt":"2012-06-26T14:02:50","guid":{"rendered":"http:\/\/www.plugged.in\/?p=583"},"modified":"2012-06-26T14:02:50","modified_gmt":"2012-06-26T14:02:50","slug":"some-tips-for-vim-users","status":"publish","type":"post","link":"https:\/\/www.veriteknik.net.tr\/en\/some-tips-for-vim-users\/","title":{"rendered":"Some Tips for VIM Users"},"content":{"rendered":"<p>VIM, one of the best text editors of all time, has a lot of useful options which are usually hidden. To get the best out of this text editor, I&#8217;d recommend checking some of these features out.<\/p>\n<p>To get these settings enabled by default, add the lines to your vimrc file, it is usually located at <strong>~\/.vimrc<\/strong> if not, just create it. Below is a part of the .vimrc file I like using.<\/p>\n<pre class=\"brush: text; gutter: true; first-line: 1\">\"set tabwidth to 4 characters, automatic indentation and stuff\nset tabstop=4 shiftwidth=4\nset expandtab\nset smarttab\nset autoindent\nset smartindent\n\n\"set searching case insensitive, but if you type uppercase, it will go case sensitive\nset ignorecase\nset smartcase\n\n\"2 lines above\/below cursor when scrolling\nset scrolloff=2\n\n\"show filename in title bar\nset title\n\n\"show line numbers, and toggle it on\/off with F2\nset number\nmap &lt;F2&gt; :set invnumber&lt;CR&gt;\n\n\"toggle wrapping mode with Ctrl+w\nmap &lt;C-w&gt; :set invwrap&lt;CR&gt;\n\n\"Reload Current File, ask for confirmation if changed\nmap &lt;F5&gt; :confirm :edit&lt;CR&gt;\n\n\"automatically cd into the directory that the file is in, very useful when running commands within vi\nautocmd BufEnter * execute \"chdir \".escape(expand(\"%:p:h\"), ' ')\n\n\"highlight the current line, when you split screen, it will only highlight the line that has focus on\nhi CursorLine cterm=NONE ctermbg=blue ctermfg=NONE\nautocmd WinEnter * setlocal cursorline\nautocmd WinLeave * setlocal nocursorline\nset cursorline\n\n\"set encoding to utf-8\nset encoding=utf-8\n\n\"highlight search results\nset hlsearch\n\"search while typing\nset incsearch<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>VIM, one of the best text editors of all time, has a lot of useful options which are usually hidden. To get the best out of this text editor, I&#8217;d recommend checking some of these features out. To get these settings enabled by default, add the lines to your vimrc file, it is usually located [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"categories":[381],"tags":[426,427],"yst_prominent_words":[605,1450],"class_list":["post-583","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-vi","tag-vim"],"jetpack_featured_media_url":"","uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Mustafa Emre Ayd\u0131n","author_link":"https:\/\/www.veriteknik.net.tr\/en\/author\/eaydin\/"},"uagb_comment_info":0,"uagb_excerpt":"VIM, one of the best text editors of all time, has a lot of useful options which are usually hidden. To get the best out of this text editor, I&#8217;d recommend checking some of these features out. To get these settings enabled by default, add the lines to your vimrc file, it is usually located&hellip;","_links":{"self":[{"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/posts\/583","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/comments?post=583"}],"version-history":[{"count":1,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/posts\/583\/revisions"}],"predecessor-version":[{"id":7288,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/posts\/583\/revisions\/7288"}],"wp:attachment":[{"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/media?parent=583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/categories?post=583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/tags?post=583"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/yst_prominent_words?post=583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}