WalaWiki content from p1k3.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

48 lines
2.8 KiB

WareLogging. TextBased. A feature-rich, post-minimalist implementation of ViEditor. [Brennen]'s favorite text editor.
* [http://www.vim.org/ vim.org]
* VimExtensions
* A cheat sheet: http://p1k3.com/2004/11/8/vimcheat.txt
* An HTML-based improvement: http://p1k3.com/2004/11/11/vimcheat
* The current version: VimCheatSheet.
* Someone else's [http://www.viemu.com/vi-vim-cheat-sheet.gif cheatsheet].
* BramMoolenaar: [http://www.moolenaar.net/habits.html Seven habits of effective text editing]. There's a video of him giving a presentation on this somewhere.
* VimAsShell
* VimAndPerl
= ideas =
Can you mix syntax highlighting in a single file? Maybe. Here's a thought: How about something that recognizes filetypes in PerlLanguage (or others) HereDocuments and applies the right syntax? Like
print <<HTML;
<p>Here is some HTML.</p>
<p>And stuff.</p>
HTML
...turns out this works for PHP heredocs by default, I assume it'd be do-able for Perl.
= keys, commands, settings =
VimCheatSheet
* Use tags. ctrl-] to follow a tag, ctrl-t moves backwards through the stack.
* gU''motion'' - uppercase. gUw, for example.
* :colorscheme <name> - use tab completion to cycle various schemes.
* :%sort
* grepping:
** :grep -ri pattern ./*
** :copen
* ctrl-v enters a visual mode that allows for selection of a rectangular block.
* q: gives a command line history.
* :%!''command'' feeds all text to an external command and returns the output.
** frex, :%!sort will sort all lines.
* :set showcmd displays commands on the status line as you enter them.
* :set showmatch & :set matchtime=1 will briefly bounce to the matching bracket whenever a new bracket is typed in.
* vim has a file browser plugin now, which does sort of what you would expect - it lists the files in a directory, and when the cursor is over one, you hit enter to open it. What's cool is that if you hit ?, you get a set of extra commands - o will open a file in a new window, O in a window that's already open. i turns on size/date info, s toggles sorting, etc. Try doing :help file-explorer.
= record macros =
<[Brennen]> Tonight I was doing something stupid-repetitive to a text file - enclosing certain blocks but not others in HTML paragraph tags. It came to me that I ought to try vim's recording feature, rather than screwing around with writing a search and replace that would actually work. Turns out it's really simple to use. Just hit 'q', followed by the name of a register (0-9a-zA-Z), and then go about your business. Once you've finished with the string of commands you wanted to record, just hit q again. Then to execute them, do '@' followed by the name of the register you used.
Think of this as writing a miniature program on the fly. Since vi-style commands are built around a simple verb-object-number syntax, it's surprisingly elegant.