~trufas/dot

064356190ebd4ba5239431f6431032e0927c2d40 — Rafael Castillo 2 years ago 7188f5e
Add config for mainline vim
1 files changed, 136 insertions(+), 0 deletions(-)

A vim/.vimrc
A vim/.vimrc => vim/.vimrc +136 -0
@@ 0,0 1,136 @@
" Install vim-plug (For new installs) {{{
if empty(glob('~/.vim/autoload/plug.vim'))
  silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
        \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
"}}}

" Plugins {{{
call plug#begin('~/.vim/plugged')

Plug 'tpope/vim-sensible'
Plug 'Raimondi/delimitMate'
Plug 'AndrewRadev/splitjoin.vim'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-commentary'
Plug 'godlygeek/tabular'
Plug 'machakann/vim-sandwich'

Plug 'jlanzarotta/bufexplorer'
Plug 'airblade/vim-rooter'
Plug 'preservim/nerdtree'

Plug 'marcweber/vim-addon-mw-utils'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'mattn/emmet-vim'
Plug 'dense-analysis/ale'
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
Plug 'lilydjwg/colorizer'
Plug 'itchyny/lightline.vim'
Plug 'majutsushi/tagbar'
Plug 'vimwiki/vimwiki'

Plug 'sheerun/vim-polyglot'
Plug 'fatih/vim-go'
Plug 'junegunn/goyo.vim'
Plug 'prettier/vim-prettier', {
  \ 'do': 'yarn install',
  \ 'for': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'graphql', 'markdown', 'vue', 'yaml', 'html'] }

Plug 'ayu-theme/ayu-vim'

call plug#end()
"}}}

" Editor settings {{{
set nocompatible
filetype on
set clipboard+=unnamed

filetype plugin indent on
syntax enable
set encoding=utf-8
set fenc=utf-8
set number
set ruler
let mapleader="\<Space>"
set mouse=a                       " enable mouse support
set visualbell                    " No beeping.
set title
set noshowmode
set foldmethod=marker

set hidden
set cmdheight=2

set list
set listchars=tab:\ \ ,eol:¬,trail:⋅
set showbreak=↪

set number relativenumber
augroup numbertoggle
  autocmd!
  autocmd BufEnter,FocusGained,InsertLeave,WinEnter * if &nu | set rnu   | endif
  autocmd BufLeave,FocusLost,InsertEnter,WinLeave   * if &nu | set nornu | endif
augroup END

set termguicolors
let ayucolor="dark"
colorscheme ayu

"}}}

" Indentation {{{
set wrap
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set list listchars=tab:\ \ ,trail:·
set scrolloff=3                   " provide some context when editing
set backspace=indent,eol,start    " allow backspacing over everything in insert mode
"}}}

" Ale settings {{{
let g:ale_linters = {
	\ 'go': ['gopls'],
	\}

let g:ale_fixers = {
\   '*': ['remove_trailing_lines', 'trim_whitespace'],
\}

let g:ale_open_list = 1
let g:ale_set_loclist = 0
let g:ale_set_quickfix = 1
let g:ale_echo_msg_error_str = 'E'
let g:ale_echo_msg_warning_str = 'W'
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
"}}}

" Mappings {{{
imap <C-BS> <C-W>

nnoremap <leader><Space> :Files<enter>

nmap <silent> <C-k> <Plug>(ale_previous_wrap)
nmap <silent> <C-j> <Plug>(ale_next_wrap)
"}}}

" Misc plugins {{{
let g:fzf_nvim_statusline = 0 " disable statusline overwriting


let g:lightline = {
      \ 'colorscheme': 'ayu',
      \ }
" Disable statusline when fzf is active
autocmd! FileType fzf set laststatus=0 noshowmode noruler
  \| autocmd BufLeave <buffer> set laststatus=2 showmode ruler

let g:vimwiki_list = [{'path': '~/wiki/',
                     \ 'syntax': 'default', 'ext': '.wiki'}]
"}}}