Showing posts with label Vim. Show all posts
Showing posts with label Vim. Show all posts

[Vim] highlight a search or not, that is the question

As default, when you make a search, Vim highlight the result.
This option can sometimes be irritating, especialy when you search "=" or "," characters.

So, here is a line to put on your .vimrc (Vim default configuration file) :
noremap ‹F7› :set hls!‹cr›:set hls?‹cr›
So now, with the [F7] key you can highlight or not a search result. Usefull, isn't it?

[Vim] open n files with vertical split

How to open 3 files with a vertical split :
[pene@donunix] vim -O fic1 fic2 fic3

To switch between each files press [ctrl+W] + a direction key.
If you want to open another file in your Vim session write in [Escape] mode :
:vsplit fic4 for vertical split
:split fic5 for horizontal split

[Vim] completion

The completion is a very usefull option from one of the best code editor : Vim.

To complete a variable cl_ just press [crtl]+N or [ctrl]+P to go forward or backward in the list of variables beginning by cl_.

Another powerfull completion option is the completion of paths and files names, to complete a path like /home/pene/ press [crtl]+X once, and then [crtl+F] or [ctrl]+P to go forward or backward in the list of files and directories.