Initial commit
This commit is contained in:
commit
266e536732
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
*.swp
|
||||
/conf/*.conf
|
||||
/BAK/*
|
21
conf/create-lx-container.conf.sample
Normal file
21
conf/create-lx-container.conf.sample
Normal file
@ -0,0 +1,21 @@
|
||||
|
||||
## ========================================================
|
||||
## - Configuration File for "create-lx-container.sh" Script
|
||||
## ========================================================
|
||||
|
||||
# - LXC_ROOT_DIR
|
||||
# -
|
||||
# - The directory where all the LX-Containers are stored.
|
||||
# -
|
||||
# - Defaults to: LXC_ROOT_DIR="/var/lib/lxc"
|
||||
# -
|
||||
#LXC_ROOT_DIR="/var/lib/lxc"
|
||||
|
||||
|
||||
# - LXC_DIST
|
||||
# -
|
||||
# - The Linux distribution used for the new LX-Container.
|
||||
# -
|
||||
# - Defaults to: LXC_DIST="debian"
|
||||
# -
|
||||
#LXC_DIST="debian"
|
1673
create-lx-container.sh
Executable file
1673
create-lx-container.sh
Executable file
File diff suppressed because it is too large
Load Diff
255
supported-files/sshd_config
Normal file
255
supported-files/sshd_config
Normal file
@ -0,0 +1,255 @@
|
||||
# Package generated configuration file
|
||||
# See the sshd_config(5) manpage for details
|
||||
|
||||
#-----------------------------
|
||||
# Daemon
|
||||
#-----------------------------
|
||||
|
||||
# What ports, IPs and protocols we listen for
|
||||
Port 22
|
||||
|
||||
# Use these options to restrict which interfaces/protocols sshd will bind to
|
||||
#ListenAddress ::
|
||||
#ListenAddress 0.0.0.0
|
||||
#ListenAddress 176.9.117.77
|
||||
|
||||
# Specifies the protocol versions sshd(8) supports.
|
||||
# The possible values are ‘1’ , `2' and ‘1,2’.
|
||||
# The default is ‘2’.
|
||||
Protocol 2
|
||||
|
||||
# HostKeys for protocol version 2
|
||||
HostKey /etc/ssh/ssh_host_rsa_key
|
||||
HostKey /etc/ssh/ssh_host_ecdsa_key
|
||||
HostKey /etc/ssh/ssh_host_ed25519_key
|
||||
|
||||
# Lifetime and size of ephemeral version 1 server key
|
||||
KeyRegenerationInterval 3600
|
||||
ServerKeyBits 768
|
||||
|
||||
# Specifies the maximum number of concurrent unauthenticated connections
|
||||
# to the SSH daemon. See sshd_config(5) for specifiing the three colon
|
||||
# separated values.
|
||||
# The default is 10.
|
||||
#MaxStartups 10:30:100
|
||||
#MaxStartups 3
|
||||
MaxStartups 10:30:100
|
||||
|
||||
# Specifies the maximum number of authentication attempts permitted per
|
||||
# connection.
|
||||
# The default is 6.
|
||||
MaxAuthTries 3
|
||||
|
||||
# Specifies the maximum number of open sessions permitted per network
|
||||
# connection.
|
||||
# The default is 10.
|
||||
MaxSessions 10
|
||||
|
||||
|
||||
#-----------------------------
|
||||
# Authentication
|
||||
#-----------------------------
|
||||
|
||||
# Specifies whether sshd(8) separates privileges by creating an unprivileged
|
||||
# child process to deal with incoming network traffic.
|
||||
# The default is "yes" (for security).
|
||||
UsePrivilegeSeparation yes
|
||||
|
||||
# The server disconnects after this time if the user has not
|
||||
# successfully logged in.
|
||||
# The default is 120 seconds.
|
||||
LoginGraceTime 120
|
||||
|
||||
# Specifies whether root can log in using ssh(1).
|
||||
# The default is "yes".
|
||||
#PermitRootLogin yes
|
||||
PermitRootLogin without-password
|
||||
#PermitRootLogin no
|
||||
|
||||
# Specifies whether sshd(8) should check file modes and ownership of the
|
||||
# user's files and home directory before accepting login. This is normally
|
||||
# desirable because novices sometimes accidentally leave their directory or
|
||||
# files world-writable. Note that this does not apply to ChrootDirectory,
|
||||
# whose permissions and ownership are checked unconditionally.
|
||||
# The default is “yes”.
|
||||
StrictModes yes
|
||||
|
||||
# Specifies whether pure RSA authentication is allowed. This option
|
||||
# applies to protocol version 1 only.
|
||||
# The default is “yes”.
|
||||
RSAAuthentication yes
|
||||
|
||||
# Specifies whether public key authentication is allowed. Note that this
|
||||
# option applies to protocol version 2 only.
|
||||
# The default is “yes”.
|
||||
PubkeyAuthentication yes
|
||||
|
||||
# Specifies the file that contains the public keys that can be used for
|
||||
# user authentication. The format is described in the AUTHORIZED_KEYS FILE
|
||||
# FORMAT section of sshd(8).
|
||||
# AuthorizedKeysFile may contain tokens of the form %T which are substituted
|
||||
# during connection setup. The following tokens are defined: %% is replaced
|
||||
# by a literal '%', %h is replaced by the home directory of the user being
|
||||
# authenticated, and %u is replaced by the username of that user. After
|
||||
# expansion, AuthorizedKeysFile is taken to be an absolute path or one relative
|
||||
# to the user's home directory. Multiple files may be listed, separated by
|
||||
# whitespace.
|
||||
# The default is “.ssh/authorized_keys .ssh/authorized_keys2”.
|
||||
#AuthorizedKeysFile %h/.ssh/authorized_keys
|
||||
|
||||
# Specifies whether password authentication is allowed.
|
||||
# Change to no to disable tunnelled clear text passwords
|
||||
# The default is "yes".
|
||||
#PasswordAuthentication yes
|
||||
PasswordAuthentication no
|
||||
|
||||
# When password authentication is allowed, it specifies whether the
|
||||
# server allows login to accounts with empty password strings.
|
||||
# The default is “no”.
|
||||
PermitEmptyPasswords no
|
||||
|
||||
# Specifies whether challenge-response authentication is allowed (e.g. via PAM).
|
||||
# The default is “yes”.
|
||||
ChallengeResponseAuthentication no
|
||||
|
||||
# Don't read the user's ~/.rhosts and ~/.shosts files
|
||||
IgnoreRhosts yes
|
||||
# For this to work you will also need host keys in /etc/ssh_known_hosts
|
||||
RhostsRSAAuthentication no
|
||||
# similar for protocol version 2
|
||||
HostbasedAuthentication no
|
||||
|
||||
# Specifies whether sshd(8) should ignore the user's ~/.ssh/known_hosts
|
||||
# during RhostsRSAAuthentication or HostbasedAuthentication.
|
||||
# The default is “no”.
|
||||
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
|
||||
#IgnoreUserKnownHosts yes
|
||||
|
||||
# If specified, login is allowed only for user names that match one of
|
||||
# the patterns.
|
||||
# The allow/deny directives are processed in the following order: DenyUsers,
|
||||
# AllowUsers, DenyGroups, and finally AllowGroups.
|
||||
# By default, login is allowed for all users.
|
||||
#AllowUsers chris cityslang sysadm
|
||||
|
||||
# Set this to 'yes' to enable PAM authentication, account processing,
|
||||
# and session processing. If this is enabled, PAM authentication will
|
||||
# be allowed through the ChallengeResponseAuthentication and
|
||||
# PasswordAuthentication. Depending on your PAM configuration,
|
||||
# PAM authentication via ChallengeResponseAuthentication may bypass
|
||||
# the setting of "PermitRootLogin without-password".
|
||||
# If you just want the PAM account and session checks to run without
|
||||
# PAM authentication, then enable this but set PasswordAuthentication
|
||||
# and ChallengeResponseAuthentication to 'no'.
|
||||
UsePAM yes
|
||||
|
||||
# Specifies whether login(1) is used for interactive login sessions.
|
||||
# Note that login(1) is never used for remote command execution.
|
||||
# Note also, that if this is enabled, X11Forwarding will be disabled
|
||||
# because login(1) does not know how to handle xauth(1) cookies. If
|
||||
# UsePrivilegeSeparation is specified, it will be disabled after
|
||||
# authentication.
|
||||
# The default is “no”.
|
||||
#UseLogin no
|
||||
|
||||
|
||||
#-----------------------------
|
||||
# Logging
|
||||
#-----------------------------
|
||||
|
||||
# Gives the facility code that is used when logging messages from sshd(8).
|
||||
# The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
|
||||
# LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
|
||||
# The default is AUTH.
|
||||
SyslogFacility AUTH
|
||||
|
||||
# Gives the verbosity level that is used when logging messages from
|
||||
# sshd(8).
|
||||
# The default is INFO.
|
||||
LogLevel INFO
|
||||
|
||||
|
||||
#-----------------------------
|
||||
# Behavior
|
||||
#-----------------------------
|
||||
|
||||
# Specifies whether the distribution-specified extra version suffix is included
|
||||
# during initial protocol handshake.
|
||||
# The default is "yes".
|
||||
DebianBanner no
|
||||
|
||||
# The contents of the specified file are sent to the remote user before
|
||||
# authentication is allowed.
|
||||
# By default, no banner is displayed.
|
||||
#Banner /etc/issue.net
|
||||
|
||||
# Specifies whether sshd(8) should print /etc/motd when a user logs in
|
||||
# interactively. (On some systems it is also printed by the shell,
|
||||
# /etc/profile, or equivalent.)
|
||||
# The default is “yes”.
|
||||
PrintMotd no
|
||||
|
||||
# Specifies what environment variables sent by the client will be copied
|
||||
# into the session's environ(7).
|
||||
# The default is not to accept any environment variables.
|
||||
AcceptEnv LANG LC_*
|
||||
|
||||
# Configures an external subsystem (e.g. file transfer daemon).
|
||||
# By default no subsystems are defined.
|
||||
Subsystem sftp /usr/lib/openssh/sftp-server
|
||||
|
||||
# Specifies whether sshd(8) should look up the remote host name and check
|
||||
# that the resolved host name for the remote IP address maps back to the
|
||||
# very same IP address.
|
||||
# The default is “yes”.
|
||||
UseDNS no
|
||||
|
||||
# Specifies whether X11 forwarding is permitted. The argument must be
|
||||
# “yes” or “no”. See sshd_config(5) for further expalnation
|
||||
# The default is “no”.
|
||||
#X11Forwarding yes
|
||||
|
||||
# Specifies the first display number available for sshd(8)'s X11
|
||||
# forwarding. This prevents sshd from interfering with real X11 servers.
|
||||
# The default is 10.
|
||||
X11DisplayOffset 10
|
||||
|
||||
# Specifies whether the system should send TCP keepalive messages to the
|
||||
# other side. If they are sent, death of the connection or crash of one
|
||||
# of the machines will be properly noticed. However, this means
|
||||
# that connections will die if the route is down temporarily, and some
|
||||
# people find it annoying. On the other hand, if TCP keepalives are not
|
||||
# sent, sessions may hang indefinitely on the server, leaving “ghost” users
|
||||
# and consuming server resources.
|
||||
#
|
||||
# The default is “yes” (to send TCP keepalive messages), and the server
|
||||
# will notice if the network goes down or the client host crashes. This
|
||||
# avoids infinitely hanging sessions.
|
||||
TCPKeepAlive yes
|
||||
|
||||
#Specifies whether sshd(8) should print the date and time of the last
|
||||
# user login when a user logs in interactively.
|
||||
# The default is “yes”.
|
||||
PrintLastLog yes
|
||||
|
||||
|
||||
#-----------------------------
|
||||
# Kerberos options
|
||||
#-----------------------------
|
||||
#KerberosAuthentication no
|
||||
#KerberosGetAFSToken no
|
||||
#KerberosOrLocalPasswd yes
|
||||
#KerberosTicketCleanup yes
|
||||
|
||||
|
||||
#-----------------------------
|
||||
# GSSAPI options
|
||||
#-----------------------------
|
||||
|
||||
#GSSAPIAuthentication no
|
||||
#GSSAPICleanupCredentials yes
|
||||
|
||||
|
||||
|
||||
|
||||
|
71
supported-files/templates_root/.bashrc
Normal file
71
supported-files/templates_root/.bashrc
Normal file
@ -0,0 +1,71 @@
|
||||
# ~/.bashrc: executed by bash(1) for non-login shells.
|
||||
|
||||
# don't put duplicate lines in the history. See bash(1) for more options
|
||||
# don't overwrite GNU Midnight Commander's setting of `ignorespace'.
|
||||
export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups
|
||||
# ... or force ignoredups and ignorespace
|
||||
export HISTCONTROL=ignoreboth
|
||||
|
||||
# append to the history file, don't overwrite it
|
||||
shopt -s histappend
|
||||
|
||||
|
||||
# check the window size after each command and, if necessary,
|
||||
# update the values of LINES and COLUMNS.
|
||||
shopt -s checkwinsize
|
||||
|
||||
|
||||
# Note: PS1 and umask are already set in /etc/profile. You should not
|
||||
# need this unless you want different defaults for root.
|
||||
# PS1='${debian_chroot:+($debian_chroot)}\h:\w\$ '
|
||||
# umask 022
|
||||
export PS1='\h:\w \$ '
|
||||
umask 022
|
||||
|
||||
|
||||
# You may uncomment the following lines if you want `ls' to be colorized:
|
||||
export LS_OPTIONS='--color=auto'
|
||||
eval "`dircolors`"
|
||||
alias ls='ls $LS_OPTIONS'
|
||||
alias ll='ls $LS_OPTIONS -l'
|
||||
alias la='ls $LS_OPTIONS -al'
|
||||
alias l='ls $LS_OPTIONS -lA'
|
||||
#
|
||||
# Some more alias to avoid making mistakes:
|
||||
#alias rm='rm -i'
|
||||
#alias cp='cp -i'
|
||||
#alias mv='mv -i'
|
||||
|
||||
alias ..='cd ..'
|
||||
alias ...='cd ../..'
|
||||
alias ....='cd ../../..'
|
||||
|
||||
|
||||
alias poweroff='echo -e "\n\tplease use: /sbin/poweroff\n"'
|
||||
alias reboot='echo -e "\n\tplease use: /sbin/reboot\n"'
|
||||
|
||||
|
||||
# Alias definitions.
|
||||
# You may want to put all your additions into a separate file like
|
||||
# ~/.bash_aliases, instead of adding them here directly.
|
||||
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
|
||||
|
||||
if [ -f ~/.bash_aliases ]; then
|
||||
. ~/.bash_aliases
|
||||
fi
|
||||
|
||||
# enable programmable completion features (you don't need to enable
|
||||
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
||||
# sources /etc/bash.bashrc).
|
||||
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
|
||||
. /etc/bash_completion
|
||||
fi
|
||||
|
||||
|
||||
export EDITOR=vim
|
||||
|
||||
export LINES=64
|
||||
|
||||
## - set beep more quiet
|
||||
## -
|
||||
#xset b 10 500 50
|
24
supported-files/templates_root/.profile
Normal file
24
supported-files/templates_root/.profile
Normal file
@ -0,0 +1,24 @@
|
||||
# ~/.profile: executed by Bourne-compatible login shells.
|
||||
|
||||
if [ "$BASH" ]; then
|
||||
if [ -f ~/.bashrc ]; then
|
||||
. ~/.bashrc
|
||||
fi
|
||||
fi
|
||||
|
||||
# set PATH so it includes user's private bin if it exists
|
||||
if [ -d "$HOME/bin" ] ; then
|
||||
PATH="$HOME/bin:$PATH"
|
||||
fi
|
||||
if [ -d "$HOME/bin/admin-stuff" ] ; then
|
||||
PATH="$HOME/bin/admin-stuff:$PATH"
|
||||
fi
|
||||
|
||||
# this is for the midnight-commander
|
||||
# to become the last directory the midnight commander was in
|
||||
# as the current directory when leaving the midnight commander
|
||||
#
|
||||
# . /usr/lib/mc/bin/mc.sh
|
||||
. /usr/share/mc/bin/mc.sh
|
||||
|
||||
mesg n
|
2
supported-files/templates_root/.ssh/authorized_keys2
Normal file
2
supported-files/templates_root/.ssh/authorized_keys2
Normal file
@ -0,0 +1,2 @@
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCyWbdnjnN/xfy1F6kPbsRXp8zvJEh8uHfTZuZKyaRV/iRuhsvqRiDB+AhUAlIaPwgQ8itaI6t5hijD+sZf+2oXXbNy3hkOHTrCDKCoVAWfMRKPuA1m8RqS4ZXXgayaeCzVnPEq6UrC5z0wO/XBwAktT37RRSQ/Hq2zCHy36NQEQYrhF3+ytX7ayb10pJAMVGRctYmr5YnLEVMSIREbPxZTNc80H1zqNPVJwYZhl8Ox61U4MoNhJmJwbKWPRPZsJpbTh9W2EU37tdwRBVQP6yxhua3TR6C7JnNPVY0IK23BYlNtQEDY4PHcIuewkamEWpP0+jhEjtwy1TqjRPdU/y+2uQjC6FSOVMsSPxgd8mw4cSsfp+Ard7P+YOevUXD81+jFZ3Wz0PRXbWMWAm2OCe7n8jVvkXMz+KxSYtrsvKNw1WugJq1z//bJNMTK6ISWpqaXDevGYQRJJ8dPbMmbey40WpS5CA/l29P7fj/cOl59w3LZGshrMOm7lVz9qysVV0ylfE3OpfKCGitkpY0Asw4lSkuLHoNZnDo6I5/ulRuKi6gsLk27LO5LYS8Zm1VOis/qHk1Gg1+QY47C4RzdTUxlU1CGesPIiQ1uUX2Z4bD7ebTrrOuEFcmNs3Wu5nif21Qq0ELEWhWby6ChFrbFHPn+hWlDwNM0Nr11ftwg0+sqVw== root@luna
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC5IhVprsvVOcFPbZzD9xR0nCjZ/9qVG6RhLJ7QBSts81nRvLwnmvcMBHSf5Rfaigey7Ff5dLHfJnxRE0KDATn6n2yd/5mXpn2GAA8hDVfhdsmsb5U7bROjZNr8MmIUrP7c3msUGx1FtvzhwxtyvIWOFQpWx+W5biBa6hFjIxT1pkUJqe6fclp7xbGYKZiqZRBS4qKG5CpKnisuOYDsqYPND+OkU+PShoxGVzp1JywIVze7qeKv6GyYbRA9SP9Np+5Mit6B21Io4zOI81c2Rz6sPX7mwEAQEs7iCm2hzG8qJws45Lb4ERqDkVEVhGNUyHjHgGebS1sZx1mLExdurXlPm1l/EamkncDFDCutHXtLP7lsFFiym7fKUjSEgiiLmyu5Xm+mwZvesKa1FYNaeiFWfYZpCJrNzIk+ffs+mgg3kmL4Sd4Ooy7jXPX+WJe5Xyh1KLU/+Wj2TVrhN+LbmupYAti/Wgd3DA1v601svmG82aLmyJRtKC0rGMePH3kDbtqU72kYpzI8mXERe1TIQ00Z77kQBR/7BF/9y5/0YmYDcXt1wNCoSie+mzz3xYcEdLAc7T+DhYpd4M6VgWnuz/exzRzhQwoSdEKkEED8CpEoBrEWEiMdrlElGmlkVomLU7P9i9j1rshX/pAq0asnqeSoPdC3vNbU3keiJQnhIHECvw== chris@luna
|
173
supported-files/templates_root/.vimrc
Normal file
173
supported-files/templates_root/.vimrc
Normal file
@ -0,0 +1,173 @@
|
||||
" An example for a vimrc file.
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last change: 1999 Sep 09
|
||||
"
|
||||
" To use it, copy it to
|
||||
" for Unix and OS/2: ~/.vimrc
|
||||
" for Amiga: s:.vimrc
|
||||
" for MS-DOS and Win32: $VIM\_vimrc
|
||||
|
||||
" This line should not be removed as it ensures that various options are
|
||||
" properly set to work with the Vim-related packages available in Debian.
|
||||
runtime! debian.vim
|
||||
|
||||
set nocompatible " Use Vim defaults (much better!)
|
||||
set bs=2 " allow backspacing over everything in insert mode
|
||||
set ai " always set autoindenting on
|
||||
" set backup " keep a backup file
|
||||
"set viminfo='20,\"50 " read/write a .viminfo file, don't store more
|
||||
" than 50 lines of registers
|
||||
set viminfo='20,\"50,:20,%,n~/.viminfo
|
||||
set history=50 " keep 50 lines of command line history
|
||||
set ruler " show the cursor position all the time
|
||||
set ignorecase " suchen case-insenitiv
|
||||
set showmatch " zeige passende klammern
|
||||
set shell=/bin/bash " shell to start with !
|
||||
set expandtab " tabs --> blanks
|
||||
set showmode " anzeige INSERT/REPLACE/...
|
||||
|
||||
" set smartcase " Do smart case matching
|
||||
|
||||
set incsearch " Incremental search
|
||||
" Start searching when you type the first character of
|
||||
" the search string. As you type in more characters, the
|
||||
" search is refined.
|
||||
|
||||
set t_Co=256 " To enable 256 colors in vim, put this your .vimrc before setting the colorscheme
|
||||
|
||||
" einrueckung
|
||||
set shiftwidth=3
|
||||
set tabstop=3
|
||||
" Round indent to multiple of 'shiftwidth' for > and < commands
|
||||
set shiftround
|
||||
|
||||
" For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
|
||||
" let &guioptions = substitute(&guioptions, "t", "", "g")
|
||||
|
||||
" Don't use Ex mode, use Q for formatting
|
||||
map Q gq
|
||||
|
||||
" Make p in isual Visual mode replace the selected text with the "" register.
|
||||
vnoremap p <Esc>:let current_reg = @"<CR>gvdi<C-R>=current_reg<CR><Esc>
|
||||
|
||||
" Switch syntax highlighting on, when the terminal has colors
|
||||
" Also switch on highlighting the last used search pattern.
|
||||
if &t_Co > 2 || has("gui_running")
|
||||
syntax on
|
||||
set hlsearch
|
||||
endif
|
||||
|
||||
" Only do this part when compiled with support for autocommands.
|
||||
if has("autocmd")
|
||||
|
||||
" In text files, always limit the width of text to 78 characters
|
||||
autocmd BufRead *.txt set tw=78
|
||||
|
||||
augroup cprog
|
||||
" Remove all cprog autocommands
|
||||
au!
|
||||
|
||||
" When starting to edit a file:
|
||||
" For C and C++ files set formatting of comments and set C-indenting on.
|
||||
" For other files switch it off.
|
||||
" Don't change the order, it's important that the line with * comes first.
|
||||
autocmd FileType * set formatoptions=tcql nocindent comments&
|
||||
autocmd FileType c,cpp set formatoptions=croql cindent comments=sr:/*,mb:*,el:*/,://
|
||||
augroup END
|
||||
|
||||
augroup gzip
|
||||
" Remove all gzip autocommands
|
||||
au!
|
||||
|
||||
" Enable editing of gzipped files
|
||||
" set binary mode before reading the file
|
||||
autocmd BufReadPre,FileReadPre *.gz,*.bz2 set bin
|
||||
autocmd BufReadPost,FileReadPost *.gz call GZIP_read("gunzip")
|
||||
autocmd BufReadPost,FileReadPost *.bz2 call GZIP_read("bunzip2")
|
||||
autocmd BufWritePost,FileWritePost *.gz call GZIP_write("gzip")
|
||||
autocmd BufWritePost,FileWritePost *.bz2 call GZIP_write("bzip2")
|
||||
autocmd FileAppendPre *.gz call GZIP_appre("gunzip")
|
||||
autocmd FileAppendPre *.bz2 call GZIP_appre("bunzip2")
|
||||
autocmd FileAppendPost *.gz call GZIP_write("gzip")
|
||||
autocmd FileAppendPost *.bz2 call GZIP_write("bzip2")
|
||||
|
||||
" After reading compressed file: Uncompress text in buffer with "cmd"
|
||||
fun! GZIP_read(cmd)
|
||||
let ch_save = &ch
|
||||
set ch=2
|
||||
execute "'[,']!" . a:cmd
|
||||
set nobin
|
||||
let &ch = ch_save
|
||||
execute ":doautocmd BufReadPost " . expand("%:r")
|
||||
endfun
|
||||
|
||||
" After writing compressed file: Compress written file with "cmd"
|
||||
fun! GZIP_write(cmd)
|
||||
if rename(expand("<afile>"), expand("<afile>:r")) == 0
|
||||
execute "!" . a:cmd . " <afile>:r"
|
||||
endif
|
||||
endfun
|
||||
|
||||
" Before appending to compressed file: Uncompress file with "cmd"
|
||||
fun! GZIP_appre(cmd)
|
||||
execute "!" . a:cmd . " <afile>"
|
||||
call rename(expand("<afile>:r"), expand("<afile>"))
|
||||
endfun
|
||||
|
||||
augroup END
|
||||
|
||||
" This is disabled, because it changes the jumplist. Can't use CTRL-O to go
|
||||
" back to positions in previous files more than once.
|
||||
if 0
|
||||
" When editing a file, always jump to the last cursor position.
|
||||
" This must be after the uncompress commands.
|
||||
autocmd BufReadPost * if line("'\"") && line("'\"") <= line("$") | exe "normal `\"" | endif
|
||||
endif
|
||||
|
||||
endif " has("autocmd")
|
||||
|
||||
" toggle syntax highlighting
|
||||
map <F12> :if exists("syntax_on") <Bar> syntax off <Bar> else <Bar> syntax on <Bar> endif <CR><ESC>
|
||||
map <F11> :nohls <CR>
|
||||
|
||||
" use <F6> to toggle line numbers
|
||||
nmap <silent> <F6> :set number!<CR>
|
||||
|
||||
|
||||
" If using a dark background within the editing area and syntax highlighting
|
||||
" turn on this option as well
|
||||
set background=dark
|
||||
|
||||
|
||||
" set color for search
|
||||
hi clear search
|
||||
hi search term=bold,reverse cterm=bold,reverse gui=bold,reverse
|
||||
|
||||
" set color for Comment
|
||||
hi clear Comment
|
||||
"highlight Comment term=bold cterm=bold ctermfg=LightBlue guifg=#80a0ff gui=bold
|
||||
"highlight Comment term=none cterm=none ctermfg=LightBlue guifg=#80a0ff gui=bold
|
||||
"highlight Comment term=bold cterm=bold ctermfg=grey guifg=#80a0ff gui=bold
|
||||
highlight Comment term=none cterm=none ctermfg=grey guifg=#80a0ff gui=bold
|
||||
"highlight Comment term=none cterm=none ctermfg=177 guifg=#80a0ff gui=bold
|
||||
"highlight Comment term=none cterm=none ctermfg=215 guifg=#80a0ff gui=bold
|
||||
|
||||
" Go back to the position the cursor was on the last time this file was edited
|
||||
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")|execute("normal `\"")|endif
|
||||
|
||||
" visual shifting (does not exit Visual mode)
|
||||
vnoremap < <gv
|
||||
vnoremap > >gv
|
||||
|
||||
" Scroll when cursor gets within 3 characters of top/bottom edge
|
||||
set scrolloff=3
|
||||
|
||||
" Show line, column number, and relative position within a file in the status line
|
||||
" set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]
|
||||
"set statusline=\ %F\ %(\|\ flags:\ %R%M%H%W\ %)%(\|\ type:\ %Y\ %)%(\|\ format:\ %{&ff}\ %)%(\|\ syntax:\ %{synIDattr(synID(line('.'),col('.'),0),'name')}%)\ \ %=line:\ %l/%L\ \|\ column:\ %c%V\ \|\ relative\:\ %p%%\
|
||||
set statusline=\ %F\ %(\|\ flags:\ %R%M%H%W\ %)%(\|\ type:\ %Y\ %)%(\|\ format:\ %{&ff}\ %)\ \ %=line:\ %l/%L\ \|\ col:\ %c%V\ \|\ %p%%
|
||||
" Always show status line, even for one window
|
||||
set laststatus=2
|
||||
highlight StatusLine cterm=none ctermfg=white ctermbg=blue
|
||||
|
Loading…
Reference in New Issue
Block a user