-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvim-tip-make-arrows-behave-in-vim-like-in-a-gui-text-editor.html
73 lines (72 loc) · 3.87 KB
/
vim-tip-make-arrows-behave-in-vim-like-in-a-gui-text-editor.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="generator" content="pandoc">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link href="../css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="../css/style.css" rel="stylesheet">
<link rel="shortcut icon" href="../favicon.png">
<script type="text/javascript" src="../js/modernizr.custom.30122.js"></script>
<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript" src="../js/scrollspy.js"></script>
<script type="text/javascript" src="../js/collapse.js"></script>
<!--metadata-->
<meta name="author" content="Hugo Roy">
<title>Vim Tip: arrow keys</title>
</head>
<body class="blog hentry " data-spy="scroll" data-target="#menu" data-offset="230">
<header id="top">
<a rel="home" class="link-home" href="../">
<img id="ma-tete" alt="Hugo Roy" title="Hugo Roy" src="../favatar.png" />
</a>
<p><span class="title p-name"><a class="u-url" href="#">Vim Tip: arrow keys</a></span>
<span class="author p-author hcard">Hugo Roy</span>
<span class="date"><time class="dt-published">2013-06-20 14:13:00</time> <a href="../index.html#2013-06-20 14:13:00" title="Blog index">↻</a></span>
</p>
</header>
<article role="main" class="e-content">
<section>
<h1 id="make-arrows-behave-in-vim-like-in-a-gui-text-editor">Make arrows behave in VIM like in a GUI text editor</h1>
<p>This is wholly heretic to VIM purists, but I find it very useful for people who do use ↑ and ↓ keys and do not intend to use them as a replacement for k and j. Just add in your <a
href="https://github.com/hugoroy/.vim/blob/master/vimrc">~/.vimrc</a>:</p>
<script src="https://gist.github.com/hugoroy/5822226.js"></script>
<noscript><pre>
" make arrows behave like gui text editor
nnoremap <up> gk
nnoremap <down> gj
inoremap <up> <C-O>gk
inoremap <down> <C-O>gj
vnoremap <up> gk
vnoremap <down> gj
</pre>
<a
href="https://gist.github.com/hugoroy/5822226/raw/4e947e54558ad416cd9abc3290ee651d07a80a12/arrows.vimrc">most updated version on github</a>
</noscript>
</section>
</article>
<aside>
<form action="https://duckduckgo.com/" name="x" id="search" class="input-group">
<input name="sites" value="hugoroy.eu" type="hidden">
<input name="q" type="text" placeholder="Rechercher" class="form-control">
<span class="input-group-btn" id="duckgoforit" onclick="document.x.submit()"><a class="btn btn-default" href="#search-with-duckduckgo-js"><span class="glyphicon glyphicon-search"></span></a></span>
</form>
<ul class="nav"><li><a href="#top">↑ Retour</a></li></ul>
</aside>
<footer id="bottom">
<p id="legal" role="contentinfo">Sauf mention contraire, le contenu de
cette page est publié par <a href="/" rel="author">Hugo Roy</a> sous une licence <a
rel="license"
href="//creativecommons.org/licenses/by-sa/3.0/">Creative Commons
autorisant le partage et la modification sous conditions</a> ou, au
choix, <a href="//creativecommons.org/licenses/by-sa/3.0/fr/">la
version française</a> ou <a href="http://artlibre.org">la licence
Art Libre 1.3</a>.</p>
<p><a href="http://open.blogs.nytimes.com/2011/01/11/emphasis-update-and-source/?_r=0#p[WdeFte]%2Ch[WdeFte%2C3]" target="_blank">Astuce</a> : Appuyer sur la touche Majuscule deux fois (nécessite JavaScript).</p>
</footer>
<script type="text/javascript" src="../js/emphasis.js"></script>
</body>
</html>