A few vim questions

So I was hoping some old Vim'ers school could help me. These are all separate questions, and I usually posed them each on my own, but I'm not sure that this qualifies as the question that beats here.

Plus, I think if you are knowledgeable enough to ask any of these questions, they will all appear in the near future:

  • I have a library that I am writing, and a number of applications that use this library. It seems that there is no easy way (from what I can say) to build a ctags file for the library and build it for each of my applications and make sure that one refers to the other, m in vim.
  • Using gf to open files from command mode is awesome, but many of my included files do not contain the full path. They relate to the include directory that I installed in the IDE. How can I set this directory as another point when Vim starts looking for files?
  • Is there a way to compile the file inside Vim and send the output to the buffer? I am currently using MSVS 2k3, but in a few weeks I will go to Linux, so if this is possible on any of the systems, I would appreciate it.
+4
source share
5 answers

Re 3)

If you put the makefile in your root directory, you can simply write: Do

This will run make and (iirc) put any errors in a separate buffer and make vim goto the first compilation error. From there you can navigate all the lines with errors using the following error

Also see this page http://wiki.beyondunreal.com/Legacy:Vim

and http://linux.byexamples.com/archives/287/perform-grep-and-make-in-vim/

to learn how to show the result in a separate console.

+3
source

1 tag files are independent and can be used together. See :h 'tags'

I can’t say what is an easy way to create tag files. I have one that consists of using two of my plugins:

  • one (draft) plugin that knows how to update C ++ tag files (it’s easy to adapt to other file types),
  • and another one ( local_vimrc ) that helps me define the local_vimrc directories. Thus, for any files within this directory hierarchy, I can adapt the parameters & tags to use the corresponding tag files and the current tag file, which will be automatically rebuilt (or when keybinding is triggered). (Plugins like the project should do the trick too).

2- :h 'path '

3- :h :make

NTN.

+3
source

2)

 :cd {path} 

For reference:

 :he cd 

Some others, such as :lcd , may be better matched. Just scroll to the help page.

0
source

This is probably not a topic, but it can still be useful: if you use Visual Studio a lot and like Vim, you can watch ViEmu . This is the best Vim emulation for any IDE I have ever seen, and the cost is really low. :) And no, I do not get a commission .: P

0
source

This is not obvious, but if you open a directory instead of a file, it is clearly visible.

eg.

: e. (Colon-e-dot): e .. (colon-e-dot-dot)

will allow you to navigate from the current directory or its parent.

(realizing that you probably hoped to be able to take vim, for example,

: e abc.txt

and take a look at a few directories that I don’t know how to do.)

0
source

All Articles