All pastes #1315634 Raw Edit

Someone

public text v1 · immutable
#1315634 ·published 2009-01-22 12:16 UTC
rendered paste body
""" Prelimimary settings
"   Vim, not vi
set nocompatible
set ignorecase

syntax enable
set encoding=utf8
set fileencodings=utf8,latin1

set background=dark



set shell=bash      " *the* shell
set backspace=2    " allow backspacing over everything in insert mode
set showbreak=@    " glyph to mark continuation of a wrapped line
set showmatch      " when a bracket is inserted, briefly jump to the match
set matchtime=7    " 10ths of a second to show match
set scrolloff=2    " keep this many lines of context around cursor
set autoindent     " if previous line is indented, so will the next one
set history=500	   " keep 100 lines of command line history
set ruler          " show the cursor position all the time
set vb t_vb=       " don't ring any kind of bell, ever
set showcmd        " display incomplete commands
set showmode       " display mode, normal or insert
set incsearch      " do incremental searching
set report=0       " threshold for reporting changes, 0 = always
set shiftwidth=4   " number of spaces to use for each step of (auto)indent
set softtabstop=4  " number of spaces that a <tab> counts for while editing
set tabstop=4      " number of spaces that a <tab> in the file counts for
set esckeys        " make use of function keys possible
set hidden         " when off a buffer is unloaded when it is abandoned
set autowrite      " automagically write buffers when switching away from them
set smarttab       " indent next line as the previous
set whichwrap=b,s,<,>,[,] " when to wrap when moving, see ':help whichwrap'
set cmdheight=1    " massage buffer size
set autoread       " automagically re-read the file when it has changed
set grepprg=grep\ -e\ -n " give extended regex support in grep
set viewdir=~/.vimviews " store views here


" Barra de status
set laststatus=2 
"set statusline=%4*%m%3*%<%F\ buffer=%n%3*\ byte=0x%B%=%{SpellCheck()}\ %{CurTime()}\ Saladino\ %5*\ L:\ %l\ C:\ %c\ %p%%
set statusline=%m%<%F\ buffer=%n\ byte=0x%B%=%{SpellCheck()}\ %{CurTime()}\ Saladino\ \ L:\ %l\ C:\ %c\ %p%%

hi StatusLine   term=NONE cterm=NONE ctermfg=NONE ctermbg=blue
hi StatusLineNC term=NONE cterm=NONE ctermfg=NONE  ctermbg=darkgray

fu! CurTime()
        let ftime=""
        let ftime=ftime." ".strftime("%b,%d %y %H:%M:%S")
        return ftime
endf 

fu! SpellCheck()
	if &spell
		return "SpellLang=".&spelllang
	else
		return "SpellCheck=off"
	endif
endf

"
"set path=./**  
"" visualbell = No pita, invierte los colores de la pantalla
""set vb 
"set incsearch       " do incremental searching
"set showmatch       " see matches on {} and ()
"
"set so=7 "7 lineas antes de el final empieza el scroll
"" get rid of 
"if has("user_commands")
"  " remove ^M from the file
"  com! RemoveCtrlM :%s/^M/\r/g 
"endif
"
"
"" Only do this part when compiled with support for autocommands.
"if has("autocmd")
"
"" Algunas cabeceras para archivos de tipos comunes
"" mirar :help template
"	
"	au BufNewFile *.tex 0r ~/.vim/headers/tex
"	
"	au BufNewFile *.c,*.cc,*.cpp 0r ~/.vim/headers/c
"	
"	au BufNewFile *.java 0r ~/.vim/headers/java
"	
"	au BufNewFile *.py 0r ~/.vim/headers/python
"	
"	au BufNewFile [mM]akefile 0r ~/.vim/headers/makefile
"	au BufNewFile build.xml 0r ~/.vim/headers/build.xml
"
"	au BufRead,BufNewFile *.t setfiletype=perl 
"	
"
"	
"filetype plugin indent on
"
"" Cargamos los comandos propios de cada Lenguaje
""
""	au FileType c,cpp,h,cc,java call LoadProgCommands()
""	au FileType c,cpp,h,cc,java 0r ~/.vim/commands/java
"	
"	au FileType tex call LoadTexCommands()
"	au FileType c,cpp,h,cc call LoadCCommands()
"	au FileType java call LoadJavaCommands()
"	au FileType python call LoadPythonCommands()
"	au FileType cs call LoadCSCommands()	
"	au FileType perl call LoadPerlCommands()	
"	
"	au BufNewFile *.c,*.cc,*.cpp,*.h,*.java,*.py,[mM]akefile,build.xml  ks|call WriteHeader()|'s 
"
"
""Al cerrar
""
"        au BufWritePre     *.c,*.cc,*.cpp,*.h,*.java,*.py,[mM]akefile,build.xml   ks|call LastMod()|'s
"        au FileWritePre    *.c,*.cc,*.cpp,*.h,*.java,*.py,[mM]akefile,build.xml   ks|call LastMod()|'s
"
"
"
"endif "has(autocmd)
"
""Normal-time keybindings
"map <C-l>	<Esc>:tabnext<CR>
"map <C-h>	<Esc>:tabprevious<CR>
"map t		:tabnew 
"map td		:tabclose <CR> 
"map tm		:tabmove  
""Insert-time keybindings
"imap ,t <Esc>0i//TODO: 
"
"autocmd FileType java inoremap <buffer> $r return
"au FileType java inoremap <buffer> <C-t> System.out.println();<esc>hi
"
""----------PLUGINS CONFIG---------------"
"""Configurao para o plugin taglist
"let Tlist_Ctags_Cmd = '/usr/bin/ctags-exuberant'
"let Tlist_Use_Right_Window = 0
"let Tlist_Sort_Type = "name"
""let Tlist_Auto_Open = 1
""let Tlist_Display_Prototype = 1
""let Tlist_Inc_Winwidth = 0
""let Tlist_Key = '\l'
"
""Configurao para o plugin tagexplorer
"let TE_Ctags_Cmd = '/usr/bin/ctags'
"let TE_Use_Right_Window = 1
"let TE_Sort_Type = "name"
"
""----------FUNCIONES--------------------"
""
"fun LoadProgCommands()
"	
""	com Main call Main()
"	nmap <F9> :Tlist<CR>
"	nmap <F10> :TagExplorer<CR>
"endfun
"
""LaTex
""
"function LoadPerlCommands()
"	nmap <F7> :!perl %<CR>
"endfunction
"function LoadTexCommands()
"	
"	"maps
"	nmap <F6> :TexPdf<CR>
"	nmap <F7> :TexOpen<CR>
"	nmap <F5> :! ispell %<cr><cr> 
"	
"
"	com! -nargs=0 TexPdf call TexPdf(expand("%"))
"	com! -nargs=0 TexOpen call TexPdf(expand("%"))|call TexOpen(expand("%<"))
"
"endfunction
"
"function LoadCCommands()
"
""	set foldmethod=syntax
"	
"	nmap <C-+> :foldopen<CR>	
"	nmap <F9> :Tlist<CR>
"	nmap <F10> :TagExplorer<CR>
"	set textwidth=80
"
""Comentarios
"
"	
"" F1 comentar lineas
" 	map <F1> 0i/* <esc>$a */<esc>j
"	imap <F1> <esc>0i/* <esc>$a */<esc>j
"	
"	" F2 descomentar lo que F1 ha comentado: no sirve para comentarios genricos
" 	map <F2> 03x$xxxj
"	imap <F2> <esc>03x$xxxj
"	
"	"Insertar linea para comentario
"	map <F3> o/<esc>a*<esc>58.yyp0xA/<esc>ko
"	map <F3> <esc>o/<esc>a*<esc>58.yyp0xA/<esc>ko
"
""Compilar
	nmap <silent> <F6> :w<CR>:make<CR>
	nmap <F7> :make test<CR>
"	
"	
"	com! Main call Main()
"	
"	
"	fun! Main()
"		exe "normal Oint main(int argc, char* argv[]){\n\n}"
"		exe "normal O "
"	endfun
"		
"	
"endfunction
"
"fun LoadCSCommands()
""	source ~/.vim/commands/cs.vim
"endfun
"
"
"fun LoadJavaCommands()
"	
"	nmap <silent> <F6> :w<CR>:!ant<CR><CR>:cw<CR>
"	nmap <F9> :Tlist<CR>
"	nmap <F10> :TagExplorer<CR>
"
"	
"	com Main call Main()
"	com New call New()
"	
"	
"	fun New()
"		exe "normal Opublic class " .  expand('%:t:r') . "{\n\n}"
"		exe "normal O"
"	endfun
"		
"	
"	fun Main()
"		exe "normal Opublic static void main(String[] args){\n\n}"
"		exe "normal O "
"	endfun
"		
"endfun
"
"fun LoadPythonCommands()
"	
"	
"	nmap <silent> <F6> :w<CR>:!python '%:t'<CR>
"	nmap <F9> :Tlist<CR>
"	nmap <F10> :TagExplorer<CR>
"
"	
""	com Main call Main()
""	com New call New()
"	
"	
""	fun New()
""		exe "normal Opublic class " .  expand('%:t:r') . "{\n\n}"
""		exe "normal O"
""	endfun
"		
"	
""	fun Main()
""		exe "normal Opublic static void main(String[] args){\n\n}"
""		exe "normal O "
""	endfun
"
"endfun
"		
"" TexPdf
"" Crea um documento pdf utilizando el programa pdflatex 
""
"
"function! TexPdf (filename)
"    w
"    let texfile = a:filename
"    exec "!pdflatex ".expand("%:t")
"    if v:shell_error != ""
"        echo "pdflatex error\n"
"        return
"    endif
"    silent exec "!pdflatex ".expand("%:t")
"endfunction
"
"fun! TexOpen (filename)
"	call TexPdf(filename.".tex")
"	let pdffile = a:filename.".pdf"
"	exec "!xpdf "pdffile
"endfun
"
"fun WriteHeader()
"	
"	
"	exe "1," . 5 . "g/<filename>/s/<filename>/file: " . expand("%:t")
"	exe "1," . 5 . "g/<CREATE_TIME>/s/<CREATE_TIME>/created: " . strftime("%Y-%m-%d, %T")
"	
"endfun
"function LastMod()
"
"	exe "1," . 5 . "g/modified/s/modified: .*/modified: " . strftime("%Y-%m-%d, %T")
"
"endfunction
"
"function! CleverTab()
"" Ortogonaliza el uso de TAB para autocompletar. Vim tiene el comando CTRL-N
"" para realizar esta funcin, con esta funcin y el correspondiente mapeo a la
"" tecla TAB obtenemos la funcin en la tecla pero sin dejar de obtener un
"" verdadero caracter tab cuando lo necesitamos
"" el mapeo a utilizar es este:
"" inoremap <Tab> <C-R>=CleverTab()<enter>
"	if strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$'
"		  return "\<Tab>"
"	else
"		  return "\<C-N>"
"endfunction
"
"set t_ku=OA
"set t_kd=OB
"set t_kl=OD
"set t_kr=OC
"
set viminfo='10,\"100,:20,%,n~/.viminfo
au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif