Skip to content

Instantly share code, notes, and snippets.

@thnery
Last active June 26, 2020 21:55
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 thnery/53df90998164b5c63d9061ab2da7d4ff to your computer and use it in GitHub Desktop.
Save thnery/53df90998164b5c63d9061ab2da7d4ff to your computer and use it in GitHub Desktop.
simple vim configuration
set autoindent
set backspace=indent,eol,start
set nu
filetype indent plugin on
autocmd BufWritePre * %s/\s\+$//e
set encoding=utf-8
set clipboard=unnamed
set noshowmode
set laststatus=2
set background=dark
syntax enable
set termguicolors
call plug#begin('~/.vim/plugged')
" Syntax & Highlighting
Plug 'sheerun/vim-polyglot'
Plug 'tpope/vim-surround'
Plug 'jiangmiao/auto-pairs'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-endwise'
" Linters
Plug 'dense-analysis/ale'
" Themes
Plug 'dracula/vim', { 'as': 'dracula' }
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" Plug 'romainl/flattened'
Plug 'itchyny/lightline.vim'
Plug 'danilo-augusto/vim-afterglow'
" Plugins
Plug 'terryma/vim-multiple-cursors'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' }
Plug 'junegunn/fzf.vim'
Plug 'tpope/vim-fugitive'
Plug 'thoughtbot/vim-rspec'
call plug#end()
" Themes
" let g:dracula_italic = 0
colorscheme afterglow
" Folding
set foldmethod=indent
set foldlevel=80
set tabstop=4 softtabstop=0 expandtab shiftwidth=2 smarttab
cnoreabbrev W! w!
cnoreabbrev Q! q!
cnoreabbrev Qall! qall!
cnoreabbrev Wq wq
cnoreabbrev Wa wa
cnoreabbrev wQ wq
cnoreabbrev WQ wq
cnoreabbrev W w
cnoreabbrev Q q
cnoreabbrev Qall qall
"" Searching
set hlsearch
set incsearch
set ignorecase
set smartcase
"" Ignore
set wildignore+=*/target/*
set wildignore+=*/node_modules/*
"" Split Navigation
set splitbelow
set splitright
"" Editor Config
let g:EditorConfig_exclude_patterns = ['fugitive://.\*', 'scp://.\*']
let g:EditorConfig_disable_rules = ['trim_trailing_whitespace']
"" Remaps
" nnoremap <Leader>t :BTags<CR>
" nnoremap <Leader>T :Tags<CR>
nnoremap <C-l> :bnext<CR>
nnoremap <C-k> :bprevious<CR>
nnoremap <space> za
nnoremap <C-y> :Rg<CR>
silent! noremap <C-p> :GFiles<CR>
map <Leader>t :call RunCurrentSpecFile()<CR>
map <Leader>s :call RunNearestSpec()<CR>
map <Leader>l :call RunLastSpec()<CR>
map <Leader>a :call RunAllSpecs()<CR>
"" Airline
let g:airline#extensions#tabline#enabled = 1
let g:airline_theme='afterglow'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment