<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://lug.mtu.edu/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Player01</id>
	<title>MTU LUG Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://lug.mtu.edu/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Player01"/>
	<link rel="alternate" type="text/html" href="https://lug.mtu.edu/wiki/Special:Contributions/Player01"/>
	<updated>2026-04-16T18:54:55Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://lug.mtu.edu/w/index.php?title=Vim&amp;diff=7563</id>
		<title>Vim</title>
		<link rel="alternate" type="text/html" href="https://lug.mtu.edu/w/index.php?title=Vim&amp;diff=7563"/>
		<updated>2024-07-15T02:01:16Z</updated>

		<summary type="html">&lt;p&gt;Player01: /* Beginner&amp;#039;s guide */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:LearningToExit im.jpg|alt=Hacker Jeopardy question on &amp;quot;learning to exit _IM&amp;quot;|thumb|The most legendary Hacker Jeopardy goof ever (GrrCON 2022)]]&lt;br /&gt;
&lt;br /&gt;
= Beginner&#039;s guide =&lt;br /&gt;
We talked about vim and how to set it up. Basically type&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vimtutor&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and follow this. You&#039;ll learn the basic hotkeys. &lt;br /&gt;
{{Note|At this point, vim has decreased in popularity as people move towards gui editors and IDEs, but still has a place due to its ubiquity in *nix systems.}}&lt;br /&gt;
&lt;br /&gt;
== .vimrc file ==&lt;br /&gt;
To edit the defaults file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim ~/.vimrc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add the following to this file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;vim&amp;quot; line&amp;gt;&lt;br /&gt;
syntax on&lt;br /&gt;
set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab autoindent&lt;br /&gt;
set number nu relativenumber&lt;br /&gt;
set incsearch wildmenu&lt;br /&gt;
set backspace=indent,eol,start&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Inside vim, typing &amp;lt;code&amp;gt;:source ~/.vimrc&amp;lt;/code&amp;gt; will adjust these defaults. &lt;br /&gt;
&lt;br /&gt;
Line &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; gives syntax coloring for each file.&lt;br /&gt;
&lt;br /&gt;
Line &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; sets an autoindenting where &amp;lt;code&amp;gt;tab&amp;lt;/code&amp;gt; will be replaced with 4 spaces, and backspacing will remove 4 spaces. The &amp;lt;code&amp;gt;smarttab&amp;lt;/code&amp;gt; will auto-indent when writing for loops, and &amp;lt;code&amp;gt;autoindent&amp;lt;/code&amp;gt; will keep the new line&#039;s tab spacing.&lt;br /&gt;
&lt;br /&gt;
Line &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; gives line numbers on the left side of vim. &amp;lt;code&amp;gt;relativenumber&amp;lt;/code&amp;gt; gives a relative distance between each line which is beneficial for commands like &amp;lt;code&amp;gt;j&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt; to go up N lines easily.&lt;br /&gt;
&lt;br /&gt;
Line &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt; works with searching in files. &amp;lt;code&amp;gt;incsearch&amp;lt;/code&amp;gt; will jump to the first instance immediately while typing. &amp;lt;code&amp;gt;wildmenu&amp;lt;/code&amp;gt; shows the files while trying to &amp;lt;code&amp;gt;:edit &amp;lt;file&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;:split &amp;lt;file&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Line &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt; sets backspace to delete lines nicely instead of moving backwards.&lt;br /&gt;
&lt;br /&gt;
{{Note|Type &amp;lt;code&amp;gt;:set&amp;lt;/code&amp;gt; to view all the possible settings, and type &amp;lt;code&amp;gt;:help &amp;lt;setting&amp;gt;&amp;lt;/code&amp;gt; to get more information on specific settings.}}&lt;br /&gt;
&lt;br /&gt;
== Plugins ==&lt;br /&gt;
&lt;br /&gt;
Plugins are the only point at which vim is more usable than VSCode. I use [https://github.com/junegunn/vim-plug vim-plug] and the [https://github.com/junegunn/vim-plug#unix install steps] are a single line. &lt;br /&gt;
&lt;br /&gt;
At this point, add these lines to your &amp;lt;code&amp;gt;.vimrc&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;vim&amp;quot; line start=&amp;quot;6&amp;quot;&amp;gt;&lt;br /&gt;
call plug#begin(&#039;~/.vim/autoload&#039;)&lt;br /&gt;
Plug &#039;scrooloose/nerdtree&#039;&lt;br /&gt;
Plug &#039;vim-airline/vim-airline&#039;&lt;br /&gt;
Plug &#039;vim-airline/vim-airline-themes&#039;&lt;br /&gt;
call plug#end()&lt;br /&gt;
let g:airline_theme=&#039;deus&#039;&lt;br /&gt;
nmap &amp;lt;F2&amp;gt; :NERDTreeToggle&amp;lt;CR&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which will set up 3 plugins. &lt;br /&gt;
&lt;br /&gt;
[https://github.com/preservim/nerdtree Nerdtree] gives a nice directory on the left side of your editor.&lt;br /&gt;
[https://github.com/vim-airline/vim-airline Airline] and [https://github.com/vim-airline/vim-airline-themes themes] give&lt;/div&gt;</summary>
		<author><name>Player01</name></author>
	</entry>
</feed>