basant/output/kendrit-vim.html

233 lines
9.2 KiB
HTML
Raw Normal View History

2022-04-03 06:29:33 -07:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>kendrit-vim | Kitaab</title>
<meta property="og:title" content="kendrit-vim | Kitaab">
<meta property="og:type" content="website">
<meta property="og:description"
content="config.site_meta_description">
<meta property="og:site_name" content="Kitaab">
<meta property="og:url" content="build_url">
<meta property="og:image" content="build_urlassets/social.png">
<meta property="og:image:height" content="300">
<meta property="og:image:width" content="300">
<meta property="og:image:type" content="image/jpeg">
<link rel="stylesheet" href="asset/style.css" type="text/css"
media="screen" title="no title" charset="utf-8">
<!-- Mastodon stuff should go here
<meta name="twitter:site" content="config.twitter_name">
<meta name="twitter:title" content="page_title | config.name_of_site">
<meta name="twitter:image" content="build_urlassets/social.png">
<meta name="twitter:image:alt" content="page_title | config.name_of_site">
--!>
<link rel="apple-touch-icon" sizes="57x57" href="build_urlassets/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="build_urlassets/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="build_urlassets/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="build_urlassets/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="build_urlassets/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="build_urlassets/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="build_urlassets/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="build_urlassets/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="build_urlassets/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="build_urlassets/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="build_urlassets/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="build_urlassets/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="build_urlassets/favicon-16x16.png">
<meta name="msapplication-TileColor" content="#5927e0">
<meta name="msapplication-TileImage" content="build_urlassets/ms-icon-144x144.png">
<meta name="theme-color" content="#5927e0">
<link rel="canonical" href="Raw">
<link rel="stylesheet" href="assets/main.css">
</head>
<body class="flow-large container">
<header>
<a style='display:flex;padding-top:10px' href="home.html" aria-label="Kitaab">Kitaab</a>
</header>
<main>
<div id='navigation' style="float: right;">
<nav>
<h2> <a href='tag_index.html'> Index </a> </h2>
<ul>
<li> <a href='recents.html'>recents</a></li>
<li> <a href='dev_index.html'>dev</a></li>
<li> <a href='way_index.html'>way</a></li>
<li> <a href='recipe_index.html'>recipe</a></li>
<li> <a href='ops_index.html'>ops</a></li>
<li> <a href='blog_index.html'>blog</a></li>
<li> <a href='rock_index.html'>rock</a></li>
<li> <a href='phil_index.html'>phil</a></li>
<li> <a href='story_index.html'>story</a></li>
<li> <a href='blog_index.html'>blog</a></li>
<li> <a href='untagged_index.html'>untagged</a></li>
</ul>
</nav>
</div>
<h1> kendrit-vim </h1>
<div style='max-width:660px;'>
<article class="flow">
<date>1970-01-01 10:00</date>
<p><a href='201015-2153.html' >Vim Kendrit Review</a></p>
<h3>Goals</h3>
<ul>
<li>check out all the vim plugins i have saved<ul>
<li>tagbar</li>
<li>fzf / ctrlP / vim-clap / ag</li>
<li>linting </li>
<li>iron.vim</li>
</ul>
</li>
<li>intermediate vim<ul>
<li>buffers/tabs/sessions</li>
<li>folds</li>
<li>make / build integration</li>
<li>indentation with <code>=</code></li>
</ul>
</li>
<li>how to exit paste mode </li>
<li>how to utilize macros better</li>
<li>compile a vim cheat sheet</li>
<li>learn advanced vim tricks<ul>
<li>complete vimtutor to the end</li>
</ul>
</li>
<li>learn some vimscript</li>
<li>contribute to taskwiki </li>
</ul>
<p>== .vimrc Configuration ==</p>
<ul>
<li><code>set path+=**</code> When using <code>:find</code> like commands, search all subdirectories recursively</li>
<li><code>set wildmenu</code> Display all matching files when tab-completing</li>
</ul>
<p>=### Commands =
Folding:</p>
<ul>
<li><code>zf</code> create fold</li>
<li><code>zo</code> open fold</li>
<li><code>zc</code> close fold</li>
<li><code>za</code> toggle fold</li>
<li><code>zd</code> delete fold</li>
<li><code>zO</code> open all folds</li>
<li><code>zM</code> close all folds
Alternatively use the <code>range</code> command like so:</li>
<li><code>:20,101 fold</code></li>
</ul>
<p>Folding method is defined through the <code>foldmethod</code> option
<code>foldmethod</code> can be one of:</p>
<ul>
<li>manual - the above commands will all require a motion if set to this</li>
<li>indent - fold based on indent</li>
<li>syntax </li>
<li>marker - set a marker with <code>{{{ }}}</code></li>
<li>expr</li>
</ul>
<p>Viewport:</p>
<ul>
<li><code>H</code> top</li>
<li><code>M</code> middle </li>
<li><code>L</code> bottom</li>
<li><code>zz</code> center viewport on cursor</li>
</ul>
<p>Scroll:</p>
<ul>
<li><code>ctrl+e</code> down one line</li>
<li><code>ctrl+y</code> up one line</li>
<li><code>ctrl+d</code> half page down</li>
<li><code>ctrl+u</code> half page up</li>
<li><code>ctrl+f</code> foward one page</li>
<li><code>ctrl+b</code> back one page</li>
</ul>
<p>Find:</p>
<ul>
<li><code>f{character}</code> find char</li>
<li><code>t{character}</code> to char</li>
<li><code>F{character}</code> back find char</li>
<li><code>T{character}</code> back to char
, / ; for navigating matches</li>
</ul>
<p>Change:</p>
<ul>
<li><code>c{motion}</code> change {motion}
e.g. cw is change word
like d{motion} followed by i</li>
</ul>
<p>Marks:</p>
<ul>
<li><code>`m</code> exact position to mark</li>
<li><code>'m</code> go to mark</li>
<li><code>:marks</code> list marks</li>
</ul>
<p>Spelling:</p>
<ul>
<li><code>:set spell</code> activate spelling</li>
<li><code>]s</code> Jump to next mistake</li>
<li><code>[s</code> Jump to previous mistake</li>
<li><code>z=</code> Spelling suggestions</li>
<li><code>:ab</code> abbreviation</li>
<li><code>zg</code> Adds word to regular dictionary</li>
<li><code>zG</code> Adds word to the current session dictionary</li>
</ul>
<p>Modifiers: You can use modifiers to change the meaning of a noun. Some modifiers are i, which means “inner” or “inside”, and a, which means “around”.</p>
<ul>
<li><code>ci(</code> change the contents inside the current pair of parentheses</li>
<li><code>ci[</code> change the contents inside the current pair of square brackets</li>
<li><code>da'</code> delete a single-quoted string, including the surrounding single quotes</li>
</ul>
<p>Substitue: <code>:s</code> or <code>:%s/&lt;find-regex&gt;/&lt;replace-regex&gt;</code></p>
<p>Macro pause: if you started recording macro with <code>qa</code> and need to pause, stop the recording with <code>q</code> and then resume with <code>qA</code></p>
<p>Misc:</p>
<ul>
<li><code>~</code> flips the case of a character</li>
<li><code>)</code> Takes you to the start of the next sentence</li>
<li><code>(</code> Takes you to the start of the previous sentence</li>
<li><code>}</code> Takes you to the start of the next paragraph or block of text</li>
<li><code>{</code> Takes you to the start of the previous paragraph or block of text</li>
<li><code>[[</code> Jump to function start </li>
<li><code>[{</code> Jump to block start</li>
<li><code>Ctrl+A</code>, <code>Ctrl+X</code> Increment, or decrement the first number found after the cursor.</li>
<li><code>:undolist</code> Show the undo <em>tree</em></li>
<li><code>:set nopaste</code> disable pastemode</li>
</ul>
<p>=### external =
<code>bindkey -v</code> to set vim commands in terminal (zsh only)
<code>export EDITOR=vim</code>
<code>echo "set editing-mode vi" &gt; ~/.inputrc</code> for GNU Readline basic vim emulation</p>
<p>=### tutorials =</p>
<ul>
<li><a href="https://danielmiessler.com/study/vim/">https://danielmiessler.com/study/vim/</a></li>
<li><a href="https://catswhocode.com/vim-commands/">https://catswhocode.com/vim-commands/</a></li>
<li><a href="https://www.freecodecamp.org/news/learn-linux-vim-basic-features-19134461ab85/#9b6b">https://www.freecodecamp.org/news/learn-linux-vim-basic-features-19134461ab85/#9b6b</a></li>
<li><a href="https://www.keycdn.com/blog/vim-commands">https://www.keycdn.com/blog/vim-commands</a></li>
<li><a href="https://catswhocode.com/vim-commands/">https://catswhocode.com/vim-commands/</a></li>
<li><a href="https://stevelosh.com/blog/2010/09/coming-home-to-vim/">https://stevelosh.com/blog/2010/09/coming-home-to-vim/</a></li>
</ul>
<p>=### talks =</p>
<ul>
<li><a href="https://www.youtube.com/watch?v=XA2WjJbmmoM">https://www.youtube.com/watch?v=XA2WjJbmmoM</a> </li>
</ul>
<p>=### books =
<a href="https://www.vimfromscratch.com/book">https://www.vimfromscratch.com/book</a></p>
</article>
</div>
</main>
</body>
</html>