[ home / board list / faq / random / create / bans / search / manage / irc ] [ ]

/prog/ - Programming

Programming board

Catalog

8chan Bitcoin address: 1NpQaXqmCBji6gfX8UgaQEmEstvVY7U32C
The next generation of Infinity is here (discussion) (contribute)
A message from @CodeMonkeyZ, 2ch lead developer: "How Hiroyuki Nishimura will sell 4chan data"
Name
Email
Subject
Comment *
File
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Embed
(replaces files and can be used instead)
Options
Password (For file and post deletion.)

Allowed file types:jpg, jpeg, gif, png, webm, mp4, pdf
Max filesize is 8 MB.
Max image dimensions are 10000 x 10000.
You may upload 1 per post.


File: 1423722319939.gif (154.88 KB, 1024x724, 256:181, vi-vim-cheat-sheet.gif)

b6b845 No.1280

Does anyone know any tips for using vim?

42f7c7 No.1284

break off all your fingers

2a3432 No.1584

>>1280
I see a lot of new Vim users misusing tabs, so I'll give tips about when and how they should be used.

In Vim, multifile editing is done through the use of buffers. A buffer is created every time a file is opened, or when an anonymous buffer is created using the
:new
command. Buffers can be switched between using
:bN
, where N is the number of the buffer (shown in
:ls
), or through
:bn
and
:bp
. To move between buffers in normal mode, use
N<C-^>
.

Tabs are not used to handle multiple files at once; rather, they're used to handle multiple window configurations at once. Say one has four files open at once: main.c, main.h, helpers.c, helpers.h. In Vim, one can quickly establish an editing environment by doing something along the lines of:
$ vim *.[ch]
:vert sbn
:tabe
:b3
:vert sbn
gt

And of course, this being Vim, there are numerous ways to automate this process (see
:help autocommand
for one way).

One other tip: filenames in the current directory can be autocompleted in Insert Mode with
<C-x><C-f>
.

0aad4c No.1599

>>1280
use neovim instead

802e0c No.1621

>>1584
thanks!

anyone here have a good vim poster? I want one for my mancave

ce9661 No.1635

>>1599

I thought neovim wasn't done. Is it already at least usable?

082453 No.1636

>>1635
Probably, but you probably won't get the new features, so it's kind of pointless.

77ee99 No.2101

>>1280
run :!emacs



[Return][Go to top][Catalog][Post a Reply]
Delete Post [ ]
[]
[ home / board list / faq / random / create / bans / search / manage / irc ] [ ]