At the very least I always uncomment "syntax on" in /etc/vim/vimrc
feedback
|
locked by sysadmin1138♦ Jan 18 at 3:24
This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: FAQ.
|
Our CTO has a pretty feature-filled Vim configuration on GitHub. Highlights:
I find it great for Ruby coding, as our system administration tools are written in Ruby. | ||||
feedback
|
|
First, if you have more than a couple machines you work with, consider putting your My current config files are available in my darcs repository, Essential ViM scripts for sysadmins
Syntax filesI haven't seen many useful syntax in the wild, most files sysadmins work with are configs in Useful tip with syntax: if a configuration file isn't recognized (has a weird name, like # vim:filetype=apache ViM configuration optionsMost of the configuraion options is very popular, like
Functions, keyboard mappings
You can easily modify it for other comment systems ( Ending touchIf you have your configuration files in RCS system, you might want to sometimes include configuration options specific to a certain machine. For that, it's good to have
if filereadable(expand("~/.vimrc.local"))
source ~/.vimrc.local
endif
| |||||
feedback
|
|
Not really sure what part of this is specifically sysadmin related, but my essentials are:
I also always ensure the machine has access to the nginx syntax highlighting file. | |||||||
feedback
|
|
If you are usually working at a user, than this make it possible to "pipe" a file to sudo so it can be saved.
use the command:
to envoke sudo and save the file. | |||||||||
feedback
|
|
You can also look at this SO question: What's in your vimrc? | ||||
|
feedback
|
|
Shameless plug. This is not really a .vimrc change but rather a VIM plugin. I use RCSVers on every installed version of VIM. Basically it uses the RCS command to save off a version of any file you edit. You don't know how many times I've screwed up a config file only to have RCSVers save me by showing me the changes I've made. | ||||
|
feedback
|
Don't use .vimrc to avoid learning VIMSince I know that a lot of VIM new comers will read this, the best suggestion I have is: "Do not get lazy and put map entries in your .vimrc" Learning non-standard ways of doing things in VIM will make you feel like a total gimp when you are without your vimrc. The learning curve for vi is steep, but you are not doing yourself any favors by choosing not to learn. | |||||
feedback
|
|
At least a portion of my answer is the same as my programming .vimrc:
If at least some files that you're editing aren't in RCS, they should be! :) | ||||
|
feedback
|
|
Disabling all the "smart" indentation modes. Great for programming, hell for config file. | ||||
|
feedback
|
|
I often end up using strace to track down odd issues. As a result, trying to syntax highlight some of the lines can get ridiculous with a large string string. This being the case, I use set synmaxcol=2048 to limit the syntax highlighting to 2048 columns. I'm also quite a fan of the taglist plugin which uses exuberant tags. So far I've been able to push around the compiled ctags binary around and haven't come across any library issues. This quickly allows me to navigate among any of the code I work with. Those generally being Perl, Python, or C. | ||||
|
feedback
|