Share to EffectHub.com

You can earn money or coins from your share:)

Tips: you can use Sparticle for uploading away3D effects.

Tips: you can download Sparticle for uploading effects.

Tips: The ActionScript editor is supporting Away3D, Starling, Dragonbones and Flex frameworks.

Tips: paste the web page URL then click button:)

EffectHub.com: Your Best Source for Gaming
Login    or

Best Vim Tips(3 and more)

More tips

Pulling objects onto command/search line (SUPER)


CTRL-R CTRL-W   : pull word under the cursor into a command line or search

CTRL-R CTRL-A   : pull whole word including punctuation

CTRL-R -        : pull small register

CTRL-R [0-9a-z] : pull named registers

CTRL-R %        : pull file name (also #)

Manipulating registers


map <F11> "qyy:let @q=@q."zzz"

Options


:verbose set history : show value of history, and where set

Run file through an external program (eg php)


map <F9> :w<CR>:!php %<CR>

Inserting Carriage Returns (TODO replace with \r)


:%s/nubian/<C-V><C-M>&/g : that's what you type

:%s/nubian/<C-Q><C-M>&/g : for Win32

:%s/nubian/^M&/g         : what you'll see where ^M is ONE character

TODO move following to other CTRL-R tips


Retrieving last command line command for copy & pasting into text

<c-r>:

Retrieving last Search Command for copy & pasting into text

<c-r>/

Searching over multiple lines: \_ includes newline


/<!--\_p\{-}-->    : search for multiple line comments

/fred\_s*joe/i     : any whitespace including newline

/bugs\_.*bunny : bugs followed by bunny anywhere in file

:h \_              : help

More completions


<C-X><C-F> :insert name of a file in current directory

Help for help


:h visual<C-D><Tab> : obtain list of all visual help topics

                    : Then use tab to step through them

:h ctrl<C-D> : list help of all control keys

:h :r        : help for :ex command

:h CTRL-R    : normal mode

:h \r        : what's \r in a regexp

:h i_CTRL-R  : help for say <C-R> in insert mode

:h c_CTRL-R  : help for say <C-R> in command mode

:h v_CTRL-V  : visual mode

:h 'ai       : help on setting option 'autoindent'

To number the lines in the file

Try one of these


:%! nl -ba

:%!cat -n

To simply display how many lines are in the current buffer, type Ctrl-g (or g then Ctrl-g for more information).


If you want to delete multiple adjacent duplicate lines

:%s/^\(.*\)\n\(\1\n\)*/\1\r/

More, unformatted tips

TODO Might delete some of these if covered in other tips.


Instead of this:


:map <F12> :set number!<CR>

try this:


map <F12> :set number!<Bar>set number?<CR>

and possibly these:


map <F11> :set hls!<Bar>set hls?<CR>

map <F10> :set paste!<Bar>set paste?<CR>

map <F9>  :set wrap!<Bar>set wrap?<CR>

to easily change (and display) the current state.


If you do not want to remove Windows key mappings, keep the line


noremap <C-kPlus> <C-A>

in your vimrc. Then you can use Ctrl-NumPad+ to increment numbers as others do with Ctrl-A.


Another very useful mapping:


noremap <C-J> gj

noremap <C-K> gk

That's really useful when dealing with long lines. It lets you use Control-J and Control-K to move up and down screen lines instead of buffer lines with j and k. Control-J isn't really mapped to anything by default, it's like hitting enter, but Control-K is something to do with digraphs. However, noremap won't remove this ability in insert mode.


Alternatively, you could use:


noremap <Up> gk

noremap <Down> gj

which would map the arrow keys to screen line movement instead of buffer line movement.


To substitute any word (say FILE) by actual filename you can use


:%s/FILE/\=expand("%:t")

The mappings to wrap visual selections in text clobbers a buffer. I use:


vmap s( <Esc>`>a)<Esc>`<i(<Esc> : wrap a visual selection in ()


...

You must Sign up as a member of Effecthub to view the content.

625 views    0 comments

You must Sign up as a member of Effecthub to join the conversation.

Join Effecthub.com


Or Login with Your Email Address:

Or Sign Up with Your Email Address:
This field must contain a valid email
Password should be at least 1 character