http://stackoverflow.com/questions/236000/whats-a-turing-machine/236027
I'm sharing this configuration file which can be expanded or further developed according to one's needs. Obviously this is intended to be a dot (.) file within the base of the root tree, enabling anyone with root access to invoke the functions defined in this file whenever they are working on a file or creating a file within vim. The functions do several things:
- Function Keys can be defined.
- Within vim, Function Keys are invoked by clicking the defined keys once.
- To have the function cease, click upon the same defined key once more.
- The first function visually identifies indentations in a clear and identifiable manner.
- The second function color codes number lines and functions according to the commands one invokes using vim's
internal color code and font style system. - The third function clarifies for vim users when the Paste function is active.
The functions in .vimrc can be expanded upon as needed to include other functions and commands others find useful.
- Code: Select all
" Name: .vimrc
" Programmer: Derick Centeno
" Date: 3.23.05
" Purpose: Configuration file for vim.
" Modified by DC: 3.23.05 and 7.9.05
" This file will exist in the YDL root account (of the entire system) as a . file or dot file called .vimrc.
" This file is modeled on vimrc_example.vim located within /usr/share/vim/vim70.
" Normally vim-extensions are used to make modifications. Using vimrc however is acceptable.
" If you want true vi-compatibility change the following statements.
set nocompatible " Use Vim defaults instead of 100% vi compatibility.
set backspace=2 " more powerful backspacing
" Don't write backup file if vim is being called by "crontab -e".
au BufWrite /private/tmp/crontab.* set nowritebackup
" Don't write backup file if vim is being called by "chpass"
au BufWrite /private/etc/pw.* set nowritebackup
set listchars=tab:\|\
set wildchar=<Tab>
set background=light
set tabstop=4
set ruler
set showmode
syntax on
" Programmer: DC 7.9.05. Inserted the next line based upon older .bash_profile work involving EXINIT.
hi statement cterm=bold ctermfg=Red|hi LineNr ctermfg=DarkCyan
set autoindent
set nomesg
set showmatch
set mps+=<:>
set matchtime=1
au FileType fortran set textwidth=72
au FileType c set cindent
" First Function Key.
" ShowIndent Mode On/Off.
map <F2> :call ShowIndent_on_off()<CR>
let indent_mode = 0
func! ShowIndent_on_off()
if g:indent_mode ==0
set list
let g:indent_mode = 1
else
set nolist
let g:indent_mode = 0
endif
return
endfunc
" Second Function Key.
" ShowNumbers Mode On/Off.
map <F3> :call ShowNumbers_on_off()<CR>
let number_mode = 0
func! ShowNumbers_on_off()
if g:number_mode == 0
"Programmer Derick Centeno 7/9/2005. Modified next line based on older work using EXINIT.
set nu popt=paper:letter,number:y
let g:number_mode = 1
else
set nonumber
let g:number_mode = 0
endif
return
endfunc
" Third Function Key.
" Allows notification within vim that the Paste function is active.
set pastetoggle=<F4>
Caveats before using this file:
- Make sure that either you are the System Administrator (SA) or have gained permission from the SA of the system
before you use this file. - Make sure that this file is not erasing or destroying an essential file of the same name.
Hopefully this submission will help others become comfortable exploring and working with vim.