Skip to content

Instantly share code, notes, and snippets.

@VentGrey
Created March 27, 2018 01:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VentGrey/6cf3305d2167cd475334355e4a9f4580 to your computer and use it in GitHub Desktop.
Save VentGrey/6cf3305d2167cd475334355e4a9f4580 to your computer and use it in GitHub Desktop.
My vimrc
" Poner los colores en 256
set t_Co=256
" Quitar toda la mierda que trae Gvim
set go-=T
set go-=m
highlight SpellBad term=underline gui=undercurl guisp=orange
" Establecer el encoding bajo el estandar UTF-8
set enc=utf-8
set fenc=utf-8
set termencoding=utf-8
" Opciones básicas
set mouse=a
syntax enable
set nu
set nocompatible
set autoindent
set smartindent
set tabstop=4 " Las tabulaciones serán de 4 espacios
set shiftwidth=4 "Los indents serán de 4 espacios
" Soft-wrap a las líneas de mas de 120 caracteres, 80 es para putos
set textwidth=120
" Guardar cuando se pieda el foco en la ventana
au FocusLost = :wa
" Mantener el tamaño del buffer cuando la ventana sea modificada
au VimResized * exe "normal! \<c-w>="
" Condicional para el superusuario
if $USER == "root"
set nomodeline
set noswapfile
else
set modeline
set swapfile
endif
"Temas (Requiere que se encuentren en el folder ~/.vim)
colorscheme space-vim-dark
set background=dark
"Configuraciones de Airline (Requiere el paquete vim-airline instalado)
let g:airline#extensions#tabline#enabled = 1
let g:airline_theme='violet'
"Configuración para cambiar la forma del cursor en diferentes modos de vim
if has("autocmd")
au VimEnter,InsertLeave * silent execute '!echo -ne "\e[1 q"' | redraw!
au InsertEnter,InsertChange *
\ if v:insertmode == 'i' |
\ silent execute '!echo -ne "\e[5 q"' | redraw! |
\ elseif v:insertmode == 'r' |
\ silent execute '!echo -ne "\e[3 q"' | redraw! |
\ endif
au VimLeave * silent execute '!echo -ne "\e[ q"' | redraw!
endif" ]]]]
" Cosas específicas de archivos
" C
augroup ft_c
au!
au FileType c setlocal foldmethod=marker foldmarker={,}
au FileType c setlocal ts=4 sts=4 sw=4 noexpandtab
augroup END
" C++
augroup ft_cpp
au!
au FileType cpp setlocal foldmethod=marker foldmarker={,}
au FileType cpp setlocal ts=4 sts=4 sw=4 noexpandtab
augroup END
" CSS
augroup ft_css
au!
au BufNewFile,BufRead *.less setlocal filetype=less
au FileType less,css setlocal foldmethod=marker
au FileType less,css setlocal foldmarker={,}
au FileType less,css setlocal omnifunc=csscomplete#CompleteCSS
au FileType less,css setlocal iskeyword+=-
" MakeFile
augroup ft_make
au!
au Filetype make setlocal shiftwidth=4
augroup END
" Markdown
augroup ft_markdown
au!
au BufNewFile,BufRead *.m*down setlocal filetype=markdown
au Filetype markdown setlocal spell
"Usar el local reader para las cabeceras de los archivos
au Filetype markdown nnoremap <buffer> <localleader>1 yypVr=:redraw<cr>
au Filetype markdown nnoremap <buffer> <localleader>2 yypVr-:redraw<cr>
au Filetype markdown nnoremap <buffer> <localleader>3 mzI###<space><esc>`zllll
au Filetype markdown nnoremap <buffer> <localleader>4 mzI####<space><esc>`zlllll
augroup END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment