Comments on: Vim Cheatsheet http://www.terminally-incoherent.com/blog/2008/10/27/vim-cheatsheet/ I will not fix your computer. Tue, 04 Aug 2020 22:34:33 +0000 hourly 1 https://wordpress.org/?v=4.7.26 By: BC http://www.terminally-incoherent.com/blog/2008/10/27/vim-cheatsheet/#comment-10807 Wed, 26 Nov 2008 07:15:58 +0000 http://www.terminally-incoherent.com/blog/2008/10/27/vim-cheatsheet/#comment-10807

I’m not a coder, but I love Vim for general writing.
If I’m not too late to join the party:

My all-time favorite command, which I don’t think is mentioned in Vimtutor, though it should be, is:
gf (go to file?)
Just hit that when the cursor is on the name of an existing file, and it’ll open it. Voilà, kind of a quick and dirty wiki. When I’m using Linux, I make a bunch of files with no extension, as “wiki words”, and keep them in the same directory. Well, it works in Windows too, though I dislike creating files without an extension in Windows, since the OS is too dumb to know what they are without an extension.
In Cream, shift+Enter does the same thing, and will also open URLs in your browser. (I think gf only opens URLs for editing, using wget)

I also have a problem when I have to use Vim without (one of my various clumsy attempts at) a .vimrc .

Thanks for the cheat sheet — I liked the ones for visual mode especially.
For some reason, I prefer to use right parentheses with visual to select a sentence, rather than as.

Reply  |  Quote
]]>
By: mcai8sh4 http://www.terminally-incoherent.com/blog/2008/10/27/vim-cheatsheet/#comment-10594 Tue, 04 Nov 2008 20:57:05 +0000 http://www.terminally-incoherent.com/blog/2008/10/27/vim-cheatsheet/#comment-10594

I’ve just realised another handy little thing that should be on this cheat sheet. I seem to use this quite a bit – so maybe others will find it useful.
When searching and you want to ignore case, throw in ‘\c’ and the search will ignore the case ie.
/foo
will only find 'foo' (NOT Foo or foO etc)
but throw a '\c' in there...
/\cfoo
will find foo, Foo, FOo, FOO, fOo.. you get the picture

Reply  |  Quote
]]>
By: Luke Maciak http://www.terminally-incoherent.com/blog/2008/10/27/vim-cheatsheet/#comment-10541 Thu, 30 Oct 2008 17:35:05 +0000 http://www.terminally-incoherent.com/blog/2008/10/27/vim-cheatsheet/#comment-10541

@freelancer: Actually, I think it happened before to someone else too. I don’t think I ever figured out why. I think there is a glitch in the notification plugin and sometimes people who commented in the past get notifications for recent threads they did not subscribe to. It happens very rarely though.

I’ll go an check if there is a newer version of the plugin available out there. Maybe they fixed it by now. :P

Reply  |  Quote
]]>
By: freelancer http://www.terminally-incoherent.com/blog/2008/10/27/vim-cheatsheet/#comment-10540 Thu, 30 Oct 2008 17:28:37 +0000 http://www.terminally-incoherent.com/blog/2008/10/27/vim-cheatsheet/#comment-10540

I’m confused. I got an e-mail about a new comment on this article, but I haven’t commented (and therefor not subscribed to updates). I’m not complaining, I’m just…confused…

Reply  |  Quote
]]>
By: vacri http://www.terminally-incoherent.com/blog/2008/10/27/vim-cheatsheet/#comment-10534 Thu, 30 Oct 2008 08:34:23 +0000 http://www.terminally-incoherent.com/blog/2008/10/27/vim-cheatsheet/#comment-10534

That cheatsheet is better than this mug which is currently sitting on my desk. Now if only the printer worked… damn contract printers.

And I don’t even drink coffee…

Reply  |  Quote
]]>
By: alexertech http://www.terminally-incoherent.com/blog/2008/10/27/vim-cheatsheet/#comment-10528 Thu, 30 Oct 2008 03:30:19 +0000 http://www.terminally-incoherent.com/blog/2008/10/27/vim-cheatsheet/#comment-10528

Hey, nice cheatsheet… Directly to my printer. I like to have this kind of things in paper :D

Thanks again! ;)

Reply  |  Quote
]]>
By: Luke Maciak http://www.terminally-incoherent.com/blog/2008/10/27/vim-cheatsheet/#comment-10526 Wed, 29 Oct 2008 03:57:23 +0000 http://www.terminally-incoherent.com/blog/2008/10/27/vim-cheatsheet/#comment-10526

@astine: Nice! Thanks!

@Kenny: Actually I use KDE so I can just type in sftp:// in the address bar and I can edit files as if they were on my local file system.

Reply  |  Quote
]]>
By: Kenny http://www.terminally-incoherent.com/blog/2008/10/27/vim-cheatsheet/#comment-10525 Tue, 28 Oct 2008 21:41:58 +0000 http://www.terminally-incoherent.com/blog/2008/10/27/vim-cheatsheet/#comment-10525

Not related to the article, but to the comments on remote editing.

Instead of all the sftp-ing, you might be interested in setting up FUSE and using sshfs to access those files. Allows you to mount remote directories and edit the files like they were local.

Reply  |  Quote
]]>
By: astine http://www.terminally-incoherent.com/blog/2008/10/27/vim-cheatsheet/#comment-10524 Tue, 28 Oct 2008 20:05:39 +0000 http://www.terminally-incoherent.com/blog/2008/10/27/vim-cheatsheet/#comment-10524

@@ – previous macro
:s/pattern/replace/ – search and replace
:g/pattern/ command – modify by line

Reply  |  Quote
]]>
By: Afton http://www.terminally-incoherent.com/blog/2008/10/27/vim-cheatsheet/#comment-10521 Tue, 28 Oct 2008 17:21:02 +0000 http://www.terminally-incoherent.com/blog/2008/10/27/vim-cheatsheet/#comment-10521

@Luke, k00pa

Instead of using the middle mouse button, which depends a lot on your gui setup (outside of (g)vim), just know that the default buffers differ from system to system. On Windows, the default buffer (when you copy/paste) is the ‘*’ buffer, and on linux (and probably OS X) it’s the ‘+’ register.

So to copy something from another program, you copy it into the default register as usual (ctrl-c), then paste it in vim with "*p or "+p, depending. Ditto in reverse, you use "*y or "+y to yank into these buffers so that you can paste into another program with the standard ‘paste’ commands (usually ctrl-v).

You can copy to any of the a-z registers as well, but they will be inaccessible outside of vim. See :h reg for more.

</pedantic>

Reply  |  Quote
]]>