Seite wählen

NETWAYS Blog

VIM ist einfach cool

Als Linux-Consultant arbeitet man viel auf der Shell, daher sollte der Editor der Wahl möglichst auch überall wo man SSH hat einsetzbar sein.
Meine Wahl ist seit einigen Jahren daher VIM, dabei gewöhnt man sich über die Jahre ein seine eigenen Einstellungen und möchte diese auch gar nicht mehr missen.
Ich persönlich werde jedenfalls halb wahnsinnig wenn ich mit so einem blanken VIM ohne meine eigene Konfiguration arbeiten muss 😉
Heute nutze ich die Gelegenheit um meine mühsam gepflegte .vimrc zu teilen, natürlich mit Kommentaren.

syntax on                 " Aktiviert das Syntax Hervorhebung immer
set background=dark       " Hilfreich bei Terminals mit dunklem Hintergrund
                          " dann sieht man auch die Kommentare endlich wieder
set title                 " Titel Text für moderne Terminals (Datei und Pfad)
set modeline modelines=5  " Schaltet die Modeline Erkennung an
set ts=4                  " Setzt den Tabstopp und die Shiftwidth (Sprungweite
set sw=4                  " beim Einrücken) auf 4 Leerzeichen
set expandtab             " Nie Tabstopps benutzen, sondern Leerzeichen
set autoindent            " Automatisches Einrücken bei New-Line
set smarttab              " Intelligenteres Löschen von Leerzeichen-Tabs
set mouse=a               " Schaltet die Maus Bedienung ein
                          " Ein geniales Feature - nach etwas Eingewöhnung...
                          " Tipp: mit Shift-Klick kann man ganz normal im
                          " Terminal markieren
                          " Achja: Mausrad funktioniert wunderbar!
set hlsearch              " Hebt die aktuellen Suchergebnisse hervor
" Tell vim to remember certain things when we exit
"  10  :  marks will be remembered for up to 10 previously edited files
"  100 :  will save up to 100 lines for each register
"  20  :  up to 20 lines of command-line history will be remembered
"  %    :  saves and restores the buffer list
"  n... :  where to save the viminfo files
set viminfo='10,\"100,:20,%,n~/.viminfo
" Und zu guter letzt: Mit dieser kleinen Hilfsfunktion wird die Position
" an der man zuletzt in einer Datei war mit in die .viminfo gespeichert
function! ResCur()
  if line("'\"") <= line("$")
    normal! g`"
    return 1
  endif
endfunction
augroup resCur
  autocmd!
  autocmd BufWinEnter * call ResCur()
augroup END

Ich benutze auch einige Addons:

Weiterführende Links:

FAQ: Nmap and Nagios

faqDespite being over 12 years old, Nmap turned 5.00 and stable last month. The ‘Network Mapper’ is arguably the most used of network enumerator of its kind, and deservedly so. Though it may have been originally developed for penetration testing, we employ Nmap to speed up our Nagios installations.
With nmap2nagios, we can automatically generate a Nagios configuration by converting Nmap‘s host and service XML scan results. A how-to is already available on nagioswiki.com, but it doesn’t cover some FAQ we receive. So below are some of our additional troubleshooting tips:
Q: What is necessary to auto discover my network?
A: The Nmap host must be able to access all network zones. Thus Nmap is not able to discover a network behind a closed firewall.
Q: Can I update an existing configuration with nmap2nagios?
A: Not at the moment. Nmap generates a whole new set of configuration files for host and service definition to replace the old one.
Q: Does Nmap2Nagios support templates?
A: No, but you can add such a feature by using a set of sed or awk scripts, and applying a master template.