Skip to content

Instantly share code, notes, and snippets.

@Miuler
Created September 21, 2011 13:25
Show Gist options
  • Save Miuler/1232027 to your computer and use it in GitHub Desktop.
Save Miuler/1232027 to your computer and use it in GitHub Desktop.
Archivo de configuracion de VIM
" .VIMRC
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" TEMPORAL PARA USAR MIENTRAS USO DARES
au BufWritePost *.js silent! !ctags -R src/main/java src/main/webapp/resources/js/ &
au BufWritePost *.js :TlistUpdate
map ,rr :!rsync -avze ssh /home/miuler/Personal/Clients/Proyectos/gas/ virtuar0@miuler.com:/home1/virtuar0/miuler/www/www/dares/<CR>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" OPCIONES GENERALES PARA PROGRAMAR
syntax on "coloreado
set ignorecase
set autoindent
set number
set wrap!
"set foldcolumn=4
"set foldmethod=marker
set foldmethod=indent
set foldlevelstart=20
setlocal omnifunc=syntaxcomplete#Complete
set cursorline
set modeline! "Para que reconozca la configuracion de cada archivo
set tabstop=4
set shiftwidth=4
set expandtab " Reemplazar tabs con espacios
set tb=tooltips
set smarttab
set sw=4 " sw -> espacios de la indentacion
"Configuración para el plugin taglist
nnoremap <silent> <F4> :TlistToggle<CR>
"setlocal spell spelllang=es "Corrector ortografico
"set noexpandtab
"set cindent "identa segun el lenguaje C
"la siquiente linea produce un efecto no deseado cuando se pega
"información usando Ctrl+Shift
"set smartindent "identa segun el lenguaje que se esta usando
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" VIM + Mercurial
let mapleader = ","
map ,cd :VCSDiff<CR>
map ,cv :VCSVimDiff<CR>
map ,ca :VCSAdd<CR>
map ,cc :VCSCommi<CR>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" GENERAL
"Pasar de un tab a otro
nnoremap <silent> <A-w> :tabnext<CR>
nnoremap <silent> <A-q> :tabprevious<CR>
nnoremap <silent> <C-N> :tabnew<CR>
"- LA LINEA QUE SIGUE IMPIDE QUE PUEDAS USAR EL textwidth PARA QUE CORTE EL
"- CODIGO AUTOMATICAMENTE, POR ESO LO DEJO COMENTADO, ADEMAS NO SE PARA QUE
"- SIRVE (https://www.ritlabs.com/bt/view.php?id=1128)
"set fo=croq
map ,# :s/^/#/<CR>
map ,/ :s/^/\/\//<CR>
"map ,s :mksession! ~/.vim/.session<CR>
"map ,r :source ~/.vim/.session<CR>
filetype on
filetype plugin on
"LaTeX
"set grepprg=grep\ -nH\ $*
"filetype indent on
""" para seleccionar el color de la linea cuando el cursor se encuentra sobre
""" ella
"highlight Pmenu guibg=blue guifg=white ctermbg=blue ctermfg=white
"highlight PmenuSel guibg=white guifg=blue ctermbg=white ctermfg=blue
"highlight CursorLine guibg=white
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" COSOS DE VALA QUE PUEDEN SER UTILES
" Enable comment strings
let vala_comment_strings = 1
" Highlight space errors
let vala_space_errors = 1
" Disable space-tab-space errors
let vala_no_tab_space_error = 1
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" PYTHON
map <F5> :silent !python %<CR>
map <S-F5> :!python %<CR>
set tags+=/home/miuler/.vim/tags/python.ctags
"python << EOF
"import os
"import sys
"import vim
"for p in sys.path:
" if os.path.isdir(p):
" vim.command(r"set path+=%s" % (p.replace(" ", r"\ ")))
"EOF
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" COMPILACIÓN
set makeprg=waf
"set makeprg=scons
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Configuración del explorador de ficheros (":Explore")
"""""""""""""""""""""
" Al abrir un fichero, hacerlo en la ventana actual
let g:netrw_browse_split=2
" Modo de lista larga (con detalles)
let g:netrw_longlist=1
" Activar la ocultacion de ficheros
"let g:netrw_hide=1
" Lista de ficheros a ocultar (separar por comas)
"let g:netrw_list_hide='^..*'
" Ordenar por 'name', 'time', o 'size'
"let g:netrw_sort_by="name"
" Orden 'normal' o 'reverse'
"let g:netrw_sort_direction="normal"
""""""""""""""""""
" Mostrar siempre la barra de tabs
"set stal=2
" Pegar sin problemas
"set pastetoggle=<F12>
" Habilitar/Deshabilitar uso de ratón
"map <F8> :set mouse=a<CR>
"map <C-F8> :set mouse=<CR>
" No guardar fichero de backup *~
"set nobackup
"indent/ unindent
""Do this by hitting the mapped key, then clicking the bottom of the block
"that you want indented.
"map <F4> >
"map! <F4> <ESC><F4>
"map <F5> <
"map! <F5> <ESC><F5>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" CODIGO PARA QUE EL SISTEMA RECONOZCA LOS ARCHIVOS DE POSTGRESQL
au BufNewFile,BufRead *.psql setf psql
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" CODIGO PARA QUE EL SISTEMA RECONOZCA LOS GCONFSCHEMA COMO XML
au BufNewFile,BufRead * if getline(1) =~ 'gconfschemafile'
au BufNewFile,BufRead * set filetype=xml
au BufNewFile,BufRead * endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" CODIGO PARA QUE EL SISTEMA RECONOZCA LAS PLANTILLAS TAL (DE ZOPE) COMO XHTML
au BufNewFile,BufRead * if getline(1) =~ 'xmlns'
au BufNewFile,BufRead * set filetype=xhtml
au BufNewFile,BufRead * endif
au BufNewFile,BufRead * if getline(2) =~ 'xmlns'
au BufNewFile,BufRead * set filetype=xhtml
au BufNewFile,BufRead * endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" CODIGO PARA QUE RECONOZCA LOS ARCHIVOS ASSEMBLER DE LOS PICs
au BufNewFile,BufRead * if getline(1) =~ '16F877'
au BufNewFile,BufRead * set filetype=pic
au BufNewFile,BufRead * endif
au BufNewFile,BufRead * if getline(2) =~ '16F877'
au BufNewFile,BufRead * set filetype=pic
au BufNewFile,BufRead * endif
au BufNewFile,BufRead * if getline(3) =~ '16F877'
au BufNewFile,BufRead * set filetype=pic
au BufNewFile,BufRead * endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" CODIGO PARA QUE RECONOZCA LOS ARCHIVOS DE VALA
autocmd BufRead *.vala set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
autocmd BufRead *.vapi set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
au BufRead,BufNewFile *.vala setfiletype vala
au BufRead,BufNewFile *.vapi setfiletype vala
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" CODIGO PARA CERRAR TAGS ABIERTOS
au Filetype html,xml,xsl,jsp source ~/.vim/macros/closetag.vim
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"ROPE=======================0=====================0=====================0====================
let $PYTHONPATH .= ":/home/miuler/cversion/ropemode/:/home/miuler/cversion/ropevim"
source /home/miuler/cversion/ropevim/ropevim.vim
let ropevim_vim_completion=1
"ROPE=======================0=====================0=====================0====================
"NERDTree=================================================================================
nnoremap <silent> <F9> :NERDTreeToggle<CR>
let NERDTreeIgnore=['lost+found', '\.pyc$', '\.egg-info']
let NERDTreeChDirMode=2
"NERDTree=================================================================================
"PYDICTION================================================================================
let g:pydiction_location = '/home/miuler/.vim/plugin/pydiction/complete-dict'
"PYDICTION================================================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment