Open multiple files in individual tabs in vim using script

I have always wanted one program to open to access all important (for me) files in a system. This can for instance be http.conf, passwd, groups and so on. Using tabs in vim, the -p option (from version 7 and above) and a small script can make vim into a nice little admin console:

I call my script ‘configs’ and it looks like this (put it in your PATH for easy access):

#!/bin/bash
sudo vim -p /etc/hosts /private/etc/php.ini /etc/httpd.conf

Too move between tabs in command mode:

gt - next tab
gT - previous tab

Too move between tabs in insert mode (and also in command mode):

CTRL + PgUp - next tab
CTRL + PgDown - previous tab  

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">

This site uses Akismet to reduce spam. Learn how your comment data is processed.