Skip to content

Instantly share code, notes, and snippets.

@juliowaissman
Created February 1, 2017 10:45
Show Gist options
  • Save juliowaissman/7aee37fe41e242edc0e5503045cad86e to your computer and use it in GitHub Desktop.
Save juliowaissman/7aee37fe41e242edc0e5503045cad86e to your computer and use it in GitHub Desktop.
el .vimrc de mi Mac mini
" Mi propia vimrc, copiada de un lado si, y otro tambien
"
" Julio Waissman Vilanova
" Pensado usando mvim, instalado desde HomeBrew
" Requerido por Vundle
set nocompatible " be iMproved, required
filetype off " required
" Path e inicialización de Vundle
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" Los Plugins a utilizar
Plugin 'tpope/vim-fugitive'
Plugin 'scrooloose/syntastic'
Plugin 'tpope/vim-surround'
Plugin 'kien/ctrlp.vim'
Plugin 'bling/vim-airline'
Plugin 'scrooloose/nerdcommenter'
Plugin 'fatih/vim-go'
Plugin 'valloric/youcompleteme'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
" General
" ========
" Sets how many lines of history VIM has to remember
set history=700
set autoread
" With a map leader it's possible to do extra key combinations
let mapleader = ","
let g:mapleader = ","
let maplocalleader = "ñ"
" <ESC> igual a jk con el fin de hacer el escape más a la mano
inoremap jk <ESC>
" Utiliza unicode por default
set encoding=utf-8
" VIM user interface
" ==================
set wildmenu " Turn on the WiLd menu
set wildignore=*.o,*~,*.pyc " Ignore compiled files
set ruler " Always show current position
set cmdheight=2 " Height of the command bar
set number " show line numbers
set showcmd " show command in bottom bar
set lazyredraw " redraw only when we need to.
" set showmatch " highlight matching [{()}]
set clipboard=unnamed " Cuando copias, usas el clipboard
set backspace=indent,eol,start
" Turn backup off, since most stuff is in git
set nobackup
set nowb
set noswapfile
" No annoying sound on errors
set noerrorbells
set novisualbell
set t_vb=
set tm=500
" tab and indent related
" =======================
set expandtab " tabs are spaces
" set smarttabi " Be smart when using tabs ;)
" set shiftwidth=4 " 1 tab == 4 spaces
" set tabstop=4
set lbr " Linebreak on 500 characters
set tw=500
set ai "Auto indent
set si "Smart indent
set wrap "Wrap lines
set textwidth=80 " El ancho de linea típico en python
" Busquedas en documento
" =======================
set ignorecase " Ignore case when searching
set smartcase " When searching try to be smart about cases
set hlsearch " Highlight search results
set incsearch " Makes search act like search in modern browsers
set magic " For regular expressions turn magic on
" turn off search highlight
nnoremap <leader><Space> :nohlsearch<CR>
" Map <Space> to / (search)
noremap <Space> /
" Colores
" =======
" colorscheme badwolf " awesome colorscheme
" colorscheme solarized " awesome colorscheme
" colorscheme molokai " awesome colorscheme
syntax enable " enable syntax processing
set guifont=Monaco:h18
" Folding
" =======
" Es interesante notar que para el folding se utiliza
" principalmente la letra z con el leader, esto se dice
" que se usa porque parece una hoja de papel doblandose.
"
" Los comando a recordar princpalmente son:
" - za para expander/contraer un folder
" - zA para expander/contraer recursivamente
" - zo/zO para abrir (recursivamente)
" - zc/zC para cerrar (recursivamente)
"
" En particular no lo uso mucho pero es práctico en modo terminal
" set foldenable " enable folding
" set foldlevelstart=10 " open most folds by default
" set foldnestmax=10 " 10 nested fold max
" set foldmethod=indent " fold based on indent level (para python)
" Ortografía
" ==========
" Aqui solo ponemos como activar la corrección ortográfica
" así como las instrucciones para cambiar y cargar diccionario
" (el de español por ejemplo y como cambiarlo a inglés)
" Los comandos importantes a recordar son:
" - ]s Ir a la siguiente palabra mal escrita
" - [s Ir a la palabra mal escrita anterior
" - z= proponer palabra para corrección
" - zg agrega palabra al diccionario
" - set spelllang=en_us Usar el diccionario en inglés
" - set spelllang=es Usar el diccionario en español
"
" Toggle spell checking on and off with `,s`
nnoremap <leader>s :set spell!<CR>
nnoremap <leader>f ]s
set spelllang=es " El idioma por default es el español
" Buffers, tabs y ventanas
" ========================
" set hidden " Permite varios buffers abiertos aunque solo se vea uno
" Agrega navegación con tabs, y como abrir uno nuevo con <A-t>
" nnoremap <Tab> gt
" nnoremap <S-Tab> gT
" nnoremap <silent> <S-t> :tabnew<CR>
" Syntastic
" ===========
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 0
let g:syntastic_check_on_wq = 0
" CtrlP settings
" ===============
if executable('ag')
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
endif
let g:ctrlp_map = '<C-p>'
let g:ctrlp_cmd = 'CtrlP'
" let g:ctrlp_working_path_mode = 'ra'
set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux
let g:ctrlp_user_command = 'find %s -type f' " MacOSX/Linux
" Airline
" ==================
set laststatus=2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment