You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -884,7 +884,7 @@ <h2>Configuring Vim with a Vimrc file</h2>
884
884
" when using the >> or << commands, shift lines by 4 spaces
885
885
set shiftwidth=4
886
886
887
-
" show a visual line under the cursor's current line
887
+
" show a visual line under the cursor's current line
888
888
set cursorline
889
889
890
890
" show the matching part of the pair for [] {} and ()
@@ -895,18 +895,18 @@ <h2>Configuring Vim with a Vimrc file</h2>
895
895
</pre></div>
896
896
897
897
898
-
<p>Here is how these configuration options look with a dark background on
898
+
<p>Here is how these configuration options look with a dark background on
899
899
Mac OS X while editing the markdown for this webpage (how meta!).</p>
900
900
<p><imgsrc="theme/img/vim-dark-bg.jpg" width="100%" alt="Vim with basic configuration options on a dark background." class="technical-diagram" style="border-radius: 5px;"></p>
901
901
<p>Take a look at another example using these configuration options, this time
902
-
with a light background and editing Python code from my
902
+
with a light background and editing Python code from my
903
903
<ahref="https://github.com/makaimc/choose-your-own-adventure-presentations">Choose Your Own Adventures Presentations</a>
904
904
project.</p>
905
905
<p><imgsrc="theme/img/vim-white-bg.png" width="100%" alt="Vim with basic configuration options on a white background." class="technical-diagram" style="border-radius: 5px; border: 1px solid #999;"></p>
906
906
<p>The Vimrc file lives under the home directory of the user account running
907
907
Vim. For example, when my user account is 'matt', on Mac OS X my Vimrc
908
908
file is found at <code>/Users/matt/.vimrc</code>. On Ubuntu Linux my .vimrc file
909
-
can be found within the <code>/home/matt/</code> directory.</p>
909
+
can be found within the <code>/home/matt/</code> directory.</p>
910
910
<p>If a Vimrc file does not already exist, just create it within the user's
911
911
home directory and it will be picked up by Vim the next time you open the
912
912
editor.</p>
@@ -921,7 +921,7 @@ <h2>Vim tutorials</h2>
921
921
<li>
922
922
<p><ahref="http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/">Learn Vim Progressively</a>
923
923
is a wonderful tutorial that follows the path I took when learning Vim:
924
-
learn just enough to survive with it as your day-to-day editor then begin
924
+
learn just enough to survive with it as your day-to-day editor then begin
925
925
adding more advanced commands on top.</p>
926
926
</li>
927
927
<li>
@@ -948,75 +948,78 @@ <h2>Vim tutorials</h2>
948
948
</ul>
949
949
<h2>Vimrc resources</h2>
950
950
<p>These are a few resources for learning how to structure a <code>.vimrc</code> file. I
951
-
recommend adding configuration options one at a time to test them
951
+
recommend adding configuration options one at a time to test them
952
952
individually instead of going whole hog with a Vimrc you are unfamiliar with.</p>
953
953
<ul>
954
954
<li>
955
955
<p><ahref="http://dougblack.io/words/a-good-vimrc.html">A Good Vimrc</a> is a fantastic,
956
-
detailed overview and opinionated guide to configuring Vim. Highly
956
+
detailed overview and opinionated guide to configuring Vim. Highly
957
957
recommended for new and experienced Vim users.</p>
958
958
</li>
959
959
<li>
960
960
<p><ahref="https://justin.abrah.ms/vim/vim_and_python.html">Vim and Python</a> shows
961
961
and explains many Python-specific .vimrc options.</p>
962
962
</li>
963
963
<li>
964
-
<p>This
964
+
<p>This
965
965
<ahref="https://github.com/amix/vimrc/tree/master/vimrcs">repository's folder with Vimrc files</a>
966
-
has example configurations that are well commented and easy to learn from.</p>
966
+
has example configurations that are well commented and easy to learn from.</p>
967
967
</li>
968
968
<li>
969
969
<p>For people who are having trouble getting started with Vim, check out this
970
-
blog post on the
970
+
blog post on the
971
971
<ahref="http://adamdelong.com/two-simple-steps-helped-me-learn-vim/">two simple steps that helped this author learn Vim</a>.</p>
972
972
</li>
973
973
</ul>
974
974
<h2>Vim installation guides</h2>
975
-
<p>These installation guides will help you get Vim up and running on Mac OS X,
975
+
<p>These installation guides will help you get Vim up and running on Mac OS X,
976
976
Linux and Windows.</p>
977
977
<ul>
978
978
<li>
979
979
<p><ahref="http://prioritized.net/blog/upgrading-vim-on-os-x/">Upgrading Vim on OS X</a>
980
-
explains why to upgrade from Vim 7.2 to 7.3+ and how to do it using
980
+
explains why to upgrade from Vim 7.2 to 7.3+ and how to do it using
981
981
<ahref="http://brew.sh/">Homebrew</a>.</p>
982
982
</li>
983
983
<li>
984
-
<p>The easiest way to install Vim on Windows 7+ is to download and run the
984
+
<p>The easiest way to install Vim on Windows 7+ is to download and run the
<ahref="https://launchpad.net/ubuntu/+source/vim">vim package</a> with
990
990
<code>sudo apt-get install vim</code>.</p>
991
991
</li>
992
992
<li>
993
-
<p>If you're using PyCharm as your IDE you won't need to install Vim as a
994
-
separate text editor - instead use the
993
+
<p>If you're using PyCharm as your IDE you won't need to install Vim as a
994
+
separate text editor - instead use the
995
995
<ahref="https://plugins.jetbrains.com/plugin/164">IdeaVim</a> PyCharm plugin to get
996
996
Vim keybindings, visual/insert mode, configuration with ~/.ideavimrc and
997
-
other Vim emulation features.</p>
997
+
other Vim emulation features.</p>
998
998
</li>
999
999
</ul>
1000
1000
<h2>Using Vim as a Python IDE</h2>
1001
-
<p>Once you get comfortable with Vim as an editor, there are several
1002
-
configuration options and plugins you can use to enhance your Python
1001
+
<p>Once you get comfortable with Vim as an editor, there are several
1002
+
configuration options and plugins you can use to enhance your Python
1003
1003
productivity. These are the resources and tutorials to read when you're
1004
1004
ready to take that step.</p>
1005
1005
<ul>
1006
1006
<li>
1007
+
<p><ahref="https://realpython.com/blog/python/vim-and-python-a-match-made-in-heaven/">VIM and Python - a Match Made in Heaven</a> details how to set up a powerful VIM environment geared towards wrangling Python day in and day out.</p>
1008
+
</li>
1009
+
<li>
1007
1010
<p>The <ahref="https://github.com/klen/python-mode">python-mode</a> project is a Vim
1008
1011
plugin with syntax highlighting, breakpoints, PEP8 linting, code completion
1009
1012
and many other features you'd expect from an integrated development
1010
1013
environment.</p>
1011
1014
</li>
1012
1015
<li>
1013
1016
<p><ahref="http://haridas.in/vim-as-your-ide.html">Vim as Your IDE</a> discusses how to
1014
-
set up Vim for greater productivity once you learn the initial Vim language
1017
+
set up Vim for greater productivity once you learn the initial Vim language
1015
1018
for using the editor.</p>
1016
1019
</li>
1017
1020
<li>
1018
1021
<p><ahref="http://unlogic.co.uk/2013/02/08/vim-as-a-python-ide/">Vim as a Python IDE</a>
1019
-
goes through the steps necessary to make Vim into a more comfortable
1022
+
goes through the steps necessary to make Vim into a more comfortable
1020
1023
environment for Python development.</p>
1021
1024
</li>
1022
1025
<li>
@@ -1025,7 +1028,7 @@ <h2>Using Vim as a Python IDE</h2>
1025
1028
</li>
1026
1029
<li>
1027
1030
<p>If you're writing your documentation in Markdown using Vim, be sure to
1028
-
read this
1031
+
read this
1029
1032
<ahref="http://www.swamphogg.com/2015/vim-setup/">insightful post on a Vim setup for Markdown</a>.</p>
Copy file name to clipboardExpand all lines: source/content/pages/02-development-environments/02-vim.markdown
+37-35Lines changed: 37 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,26 +7,26 @@ meta: Vim is a text editor with powerful string manipulation capabilities. Learn
7
7
8
8
# Vim
9
9
Vim, short for Vi IMproved, is a configurable text editor often used as
10
-
a Python development environment. Vim proponents commonly cite the numerous
10
+
a Python development environment. Vim proponents commonly cite the numerous
11
11
plugins, Vimscript and logical command language as major Vim strengths.
12
12
13
13
14
14
## Why is Vim a good Python development environment?
15
-
Vim's philosophy is that developers are more productive when they avoid
16
-
taking their hands off the keyboard. Code should flow naturally from the
17
-
developer's thoughts through the keyboard and onto the screen. Using a mouse
18
-
or other peripheral is a detriment to the rate at which a developer's
15
+
Vim's philosophy is that developers are more productive when they avoid
16
+
taking their hands off the keyboard. Code should flow naturally from the
17
+
developer's thoughts through the keyboard and onto the screen. Using a mouse
18
+
or other peripheral is a detriment to the rate at which a developer's
19
19
thoughts become code.
20
20
21
-
Vim has a logical, structured command language. When a beginner is learning
22
-
the editor she may feel like it is impossible to understand all the key
23
-
commands. However, the commands stack together in a logical way so that over
21
+
Vim has a logical, structured command language. When a beginner is learning
22
+
the editor she may feel like it is impossible to understand all the key
23
+
commands. However, the commands stack together in a logical way so that over
24
24
time the editor becomes predictable.
25
25
26
26
<divclass="well see-also">
27
-
If you're interested in Vim you'll also want to read about
27
+
If you're interested in Vim you'll also want to read about
28
28
<ahref="/development-environments.html">development environments for coding</a>
29
-
and learn
29
+
and learn
30
30
<ahref="/why-use-python.html">what makes Python a great programming language</a>.
31
31
</div>
32
32
@@ -36,7 +36,7 @@ The Vimrc file is used to configure the Vim editor. A Vimrc file can range
36
36
from nothing in it to very complicated with hundreds or thousands of lines
37
37
of configuration commands.
38
38
39
-
Here's a short, commented example .vimrc file I use for Python development
39
+
Here's a short, commented example .vimrc file I use for Python development
40
40
to get a feel for some of the configuration statements:
41
41
42
42
" enable syntax highlighting
@@ -57,7 +57,7 @@ to get a feel for some of the configuration statements:
57
57
" when using the >> or << commands, shift lines by 4 spaces
58
58
set shiftwidth=4
59
59
60
-
" show a visual line under the cursor's current line
60
+
" show a visual line under the cursor's current line
61
61
set cursorline
62
62
63
63
" show the matching part of the pair for [] {} and ()
@@ -67,13 +67,13 @@ to get a feel for some of the configuration statements:
67
67
let python_highlight_all = 1
68
68
69
69
70
-
Here is how these configuration options look with a dark background on
70
+
Here is how these configuration options look with a dark background on
71
71
Mac OS X while editing the markdown for this webpage (how meta!).
72
72
73
73
<imgsrc="theme/img/vim-dark-bg.jpg"width="100%"alt="Vim with basic configuration options on a dark background."class="technical-diagram"style="border-radius: 5px;">
74
74
75
75
Take a look at another example using these configuration options, this time
76
-
with a light background and editing Python code from my
76
+
with a light background and editing Python code from my
77
77
[Choose Your Own Adventures Presentations](https://github.com/makaimc/choose-your-own-adventure-presentations)
78
78
project.
79
79
@@ -84,7 +84,7 @@ project.
84
84
The Vimrc file lives under the home directory of the user account running
85
85
Vim. For example, when my user account is 'matt', on Mac OS X my Vimrc
86
86
file is found at ``/Users/matt/.vimrc``. On Ubuntu Linux my .vimrc file
87
-
can be found within the ``/home/matt/`` directory.
87
+
can be found within the ``/home/matt/`` directory.
88
88
89
89
If a Vimrc file does not already exist, just create it within the user's
90
90
home directory and it will be picked up by Vim the next time you open the
@@ -100,7 +100,7 @@ to get started with these tutorials.
100
100
101
101
*[Learn Vim Progressively](http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/)
102
102
is a wonderful tutorial that follows the path I took when learning Vim:
103
-
learn just enough to survive with it as your day-to-day editor then begin
103
+
learn just enough to survive with it as your day-to-day editor then begin
104
104
adding more advanced commands on top.
105
105
106
106
*[A vim Tutorial and Primer](https://danielmiessler.com/study/vim/) is an
@@ -123,74 +123,76 @@ to get started with these tutorials.
123
123
124
124
## Vimrc resources
125
125
These are a few resources for learning how to structure a `.vimrc` file. I
126
-
recommend adding configuration options one at a time to test them
126
+
recommend adding configuration options one at a time to test them
127
127
individually instead of going whole hog with a Vimrc you are unfamiliar with.
128
128
129
129
*[A Good Vimrc](http://dougblack.io/words/a-good-vimrc.html) is a fantastic,
130
-
detailed overview and opinionated guide to configuring Vim. Highly
130
+
detailed overview and opinionated guide to configuring Vim. Highly
131
131
recommended for new and experienced Vim users.
132
132
133
133
*[Vim and Python](https://justin.abrah.ms/vim/vim_and_python.html) shows
134
134
and explains many Python-specific .vimrc options.
135
135
136
-
* This
136
+
* This
137
137
[repository's folder with Vimrc files](https://github.com/amix/vimrc/tree/master/vimrcs)
138
-
has example configurations that are well commented and easy to learn from.
138
+
has example configurations that are well commented and easy to learn from.
139
139
140
140
* For people who are having trouble getting started with Vim, check out this
141
-
blog post on the
141
+
blog post on the
142
142
[two simple steps that helped this author learn Vim](http://adamdelong.com/two-simple-steps-helped-me-learn-vim/).
143
143
144
144
## Vim installation guides
145
-
These installation guides will help you get Vim up and running on Mac OS X,
145
+
These installation guides will help you get Vim up and running on Mac OS X,
146
146
Linux and Windows.
147
147
148
148
*[Upgrading Vim on OS X](http://prioritized.net/blog/upgrading-vim-on-os-x/)
149
-
explains why to upgrade from Vim 7.2 to 7.3+ and how to do it using
149
+
explains why to upgrade from Vim 7.2 to 7.3+ and how to do it using
150
150
[Homebrew](http://brew.sh/).
151
151
152
-
* The easiest way to install Vim on Windows 7+ is to download and run the
152
+
* The easiest way to install Vim on Windows 7+ is to download and run the
[vim package](https://launchpad.net/ubuntu/+source/vim) with
157
157
``sudo apt-get install vim``.
158
158
159
-
* If you're using PyCharm as your IDE you won't need to install Vim as a
160
-
separate text editor - instead use the
159
+
* If you're using PyCharm as your IDE you won't need to install Vim as a
160
+
separate text editor - instead use the
161
161
[IdeaVim](https://plugins.jetbrains.com/plugin/164) PyCharm plugin to get
162
162
Vim keybindings, visual/insert mode, configuration with ~/.ideavimrc and
163
-
other Vim emulation features.
163
+
other Vim emulation features.
164
164
165
165
166
166
## Using Vim as a Python IDE
167
-
Once you get comfortable with Vim as an editor, there are several
168
-
configuration options and plugins you can use to enhance your Python
167
+
Once you get comfortable with Vim as an editor, there are several
168
+
configuration options and plugins you can use to enhance your Python
169
169
productivity. These are the resources and tutorials to read when you're
170
170
ready to take that step.
171
171
172
+
*[VIM and Python - a Match Made in Heaven](https://realpython.com/blog/python/vim-and-python-a-match-made-in-heaven/) details how to set up a powerful VIM environment geared towards wrangling Python day in and day out.
173
+
172
174
* The [python-mode](https://github.com/klen/python-mode) project is a Vim
173
175
plugin with syntax highlighting, breakpoints, PEP8 linting, code completion
174
176
and many other features you'd expect from an integrated development
175
177
environment.
176
178
177
179
*[Vim as Your IDE](http://haridas.in/vim-as-your-ide.html) discusses how to
178
-
set up Vim for greater productivity once you learn the initial Vim language
180
+
set up Vim for greater productivity once you learn the initial Vim language
179
181
for using the editor.
180
182
181
183
*[Vim as a Python IDE](http://unlogic.co.uk/2013/02/08/vim-as-a-python-ide/)
182
-
goes through the steps necessary to make Vim into a more comfortable
184
+
goes through the steps necessary to make Vim into a more comfortable
183
185
environment for Python development.
184
186
185
187
*[Setting up Vim for Python](http://stackoverflow.com/questions/9172802/setting-up-vim-for-python)
186
188
has a well written answer on Stack Overflow for getting started with Vim.
187
189
188
190
* If you're writing your documentation in Markdown using Vim, be sure to
189
-
read this
191
+
read this
190
192
[insightful post on a Vim setup for Markdown](http://www.swamphogg.com/2015/vim-setup/).
191
193
192
194
193
-
## Vim Plugin Managers
195
+
## Vim Plugin Managers
194
196
*[Vundle](https://github.com/gmarik/Vundle.vim) comes highly recommended
195
197
as a plugin manager for Vim.
196
198
@@ -207,7 +209,7 @@ ready to take that step.
207
209
and EasyMotion Vim plugins.
208
210
209
211
*[Getting more from Vim with plugins](http://benmccormick.org/2014/07/21/learning-vim-in-2014-getting-more-from-vim-with-plugins/)
210
-
provides a list of plugins with a description for each one on its
212
+
provides a list of plugins with a description for each one on its
211
213
usefulness. The comments at the bottom are also interesting as people have
212
214
suggested alternatives to some of the plugins mentioned in the post.
0 commit comments