Skip to content

Instantly share code, notes, and snippets.

@lucianosousa
Created September 3, 2019 13:41
Show Gist options
  • Save lucianosousa/318489e44a5e36af799566c41ac93366 to your computer and use it in GitHub Desktop.
Save lucianosousa/318489e44a5e36af799566c41ac93366 to your computer and use it in GitHub Desktop.
vimrc
autocmd BufWritePre * :%s/\s\+$//e
color desert
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
" ALE (lint)
" customize linter signs
let g:ale_sign_error = '●'
let g:ale_sign_warning = '•'
" only lint when leaving insert mode after an edit
let g:ale_lint_on_text_changed = 'normal'
let g:ale_lint_on_insert_leave = 1
" show error details with m[ore details]
set cursorline
set display+=lastline
set encoding=utf-8
set expandtab
set ignorecase
set laststatus=2
set number
set paste
set ruler
set shiftwidth=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 '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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment