coding/vim.md
... ...
@@ -134,9 +134,22 @@ select several lines containing '0' and type `g<C-a>`
134 134
```
135 135
df <char>
136 136
```
137
-
137
+
138
+## using the shell
139
+[vim and the shell][]
140
+
141
+- in script, highlight line and switch to command mode by pressing `:`
142
+```bash
143
+:'<,'>w !bash -
144
+```
145
+
146
+```python
147
+:'<,'>w !python -
148
+```
149
+
138 150
[using_spellcheck]: https://www.linux.com/learn/using-spell-checking-vim
139 151
[faq]: http://vim.wikia.com/wiki/Vim_buffer_FAQ
140 152
[vanilla vim]: https://stackoverflow.com/questions/16082991/vim-switching-between-files-rapidly-using-vanilla-vim-no-plugins
141 153
[buffers over tabs]: https://stackoverflow.com/questions/26708822/why-do-vim-experts-prefer-buffers-over-tabs
142 154
[reddit]: https://www.reddit.com/r/vim/comments/a1lvb1/til_gca_for_creating_a_column_of_incrementing/
155
+[vim and the shell]: https://vimways.org/2019/vim-and-the-shell/