Maybe somebody could help me to figure out how to save files properly with vim. I made a script that opens all the files I need. I call the script with: :source scriptname. Only problem is that the script works only if I open vim with 'vim' and not with 'sudo vim' (by the way, why is that?). But if I open with 'vim', then it give me problem when I try to save...
Finding your way in vim: tags, cscope, grep and more
11–20 of 34 posts
Re: Finding your way in vim: tags, cscope, grep and more
#12> A word of caution first: there is no perfect symbol-based navigation for programming languages such as C++ or Java in vim, as vim doesn't perform any syntax analysis of the code. At least for Python, Vim's OmniCompletion does a reasonable job of figuring out function names: http://vimdoc.sourceforge.net/htmldoc/version7.html#new-omni...
Re: Finding your way in vim: tags, cscope, grep and more
#13> A word of caution first: there is no perfect symbol-based navigation for programming languages such as C++ or Java in vim, as vim doesn't perform any syntax analysis of the code. At least for Python, Vim's OmniCompletion does a reasonable job of figuring out function names: http://vimdoc.sourceforge.net/htmldoc/version7.html#new-omni...
Re: Finding your way in vim: tags, cscope, grep and more
#14I find VIM so difficult to get my head around. Emacs seems to make more sense.. is there any point in trying to grok VIM?
Re: Finding your way in vim: tags, cscope, grep and more
#15Maybe somebody could help me to figure out how to save files properly with vim. I made a script that opens all the files I need. I call the script with: :source scriptname. Only problem is that the script works only if I open vim with 'vim' and not with 'sudo vim' (by the way, why is that?). But if I open with 'vim', then it give me problem when I try to save...
I made a script that opens all the files I need. I call the script with: :source scriptname. Only problem is that the script works only if I open vim with 'vim' and not with 'sudo vim' (by the way, why is that?). Based on what you've said, I'm not sure if this is an sudo issue or a vim issue. Where is scriptname, and where are the files that scriptname references? Your sudoers may be set up to replace the environment…
Re: Finding your way in vim: tags, cscope, grep and more
#16I find VIM so difficult to get my head around. Emacs seems to make more sense.. is there any point in trying to grok VIM?
However, I like the Vim input model, where you combine commands (like delete or yank) to a motion (like a word, 3 words or everything inside these parentheses).
Emacs has the Viper mode, which gives basic Vi-style input model but it doesn't do advanced stuff like text objects.
IMO any serious coder should try both, Vim and Emacs and see which one works better.
Re: Finding your way in vim: tags, cscope, grep and more
#17I find VIM so difficult to get my head around. Emacs seems to make more sense.. is there any point in trying to grok VIM?
Why? I can do simple things faster (Delete a single char, delete a line, search/replace, etc.), it seems like a more logical way to write, and so on.
Re: Finding your way in vim: tags, cscope, grep and more
#18Re: Finding your way in vim: tags, cscope, grep and more
#19I find VIM so difficult to get my head around. Emacs seems to make more sense.. is there any point in trying to grok VIM?
Speaking as a longtime vim user, not if you already grok Emacs. The one really good reason I can think of is that vi is pretty much ubiquitous on *nix and might be better suited if you need a powerful editor which you can almost always expect to be there for you even over ssh.
Re: Finding your way in vim: tags, cscope, grep and more
#20> A word of caution first: there is no perfect symbol-based navigation for programming languages such as C++ or Java in vim, as vim doesn't perform any syntax analysis of the code. At least for Python, Vim's OmniCompletion does a reasonable job of figuring out function names: http://vimdoc.sourceforge.net/htmldoc/version7.html#new-omni...
For C and C++, clang_complete gives pretty good completion. https://github.com/Rip-Rip/clang_complete
I'd also like some more build system integration hooks (e.g. provide project-specific include dirs and CXXFLAGS on a per-file basis).