Last active
August 12, 2020 18:06
-
-
Save lucianosousa/eb5ce7f341796151fa4559702f33fad1 to your computer and use it in GitHub Desktop.
.vimrc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autocmd BufWritePre * :%s/\s\+$//e | |
" Auto reload file | |
au FocusGained,BufEnter * :checktime | |
let mapleader="," | |
" Fzf mapping replacing ControlP command | |
nnoremap <C-p> :Files<Cr> | |
" Fzf mapping for find in files | |
nnoremap <C-g> :Rg<Cr> | |
nnoremap <leader><space> :nohlsearch<CR> | |
nnoremap <Leader>m :ALEDetail<CR> | |
let g:airline#extensions#tabline#enabled = 1 | |
set autoindent | |
set autoread | |
set clipboard+=unnamed | |
set cursorline | |
set display+=lastline | |
set encoding=utf-8 | |
set expandtab | |
set ignorecase | |
set laststatus=2 | |
set number | |
set ruler | |
set shiftwidth=2 | |
set softtabstop=2 | |
set tabstop=2 | |
set wildmenu | |
syntax on | |
filetype plugin indent on | |
" Vim Plug: https://github.com/junegunn/vim-plug | |
call plug#begin() | |
Plug 'airblade/vim-gitgutter' | |
Plug 'dracula/vim', { 'as': 'dracula' } | |
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } | |
Plug 'junegunn/fzf.vim' | |
Plug 'scrooloose/nerdtree' | |
Plug 'sheerun/vim-polyglot' | |
Plug 'tpope/vim-bundler' | |
Plug 'tpope/vim-fugitive' | |
Plug 'tpope/vim-rails' | |
Plug 'vim-airline/vim-airline' | |
Plug 'w0rp/ale' | |
call plug#end() | |
" --column: Show column number | |
" --line-number: Show line number | |
" --no-heading: Do not show file headings in results | |
" --fixed-strings: Search term as a literal string | |
" --ignore-case: Case insensitive search | |
" --no-ignore: Do not respect .gitignore, etc... | |
" --hidden: Search hidden files and folders | |
" --follow: Follow symlinks | |
" --glob: Additional conditions for search (in this case ignore everything in the .git/ folder) | |
" --color: Search color options | |
" command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --glob "!.git/*" --color "always" '.shellescape(<q-args>), 1, <bang>0) | |
"Fzf customization | |
let s:fzf_custom_opts = { 'options': '--tiebreak=end,length,index' } | |
" ALE (lint) | |
" customize linter signs | |
let g:ale_sign_error = '●' | |
let g:ale_sign_warning = '•' | |
"" Enabling only the lints I want from Ruby | |
"" This is mainly because I want to disable the Sorbet typecheck | |
"" After realize it's eating 1.3GB of memory running in the background | |
"" Check the ale linters page to see the available options | |
"" https://github.com/dense-analysis/ale/tree/master/ale_linters/ruby | |
let g:ale_linters = {'ruby': ['ruby, rubocop, standardrb']} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment