• Operand
  • # (b)ring mi - belles.

gram:build

> ./config/nvim/init.vim

Lenses
(coming soon!)


if &compatible
  set nocompatible
endif

let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
  silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs  https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

" Install vim-plug if not found
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
endif

" Run PlugInstall if there are missing plugins
autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
  \| PlugInstall --sync | source $MYVIMRC
\| endif

call plug#begin()

" use "Shougo/deoplete.nvim"
" use "roxma/nvim-yarp"
" use "roxma/vim-hug-neovim-rpc"

" Mocion
Plug 'christoomey/vim-sort-motion'
Plug 'christoomey/vim-titlecase'
Plug 'kana/vim-textobj-indent'
Plug 'kana/vim-textobj-user'
Plug 'terryma/vim-multiple-cursors'
Plug 'tpope/vim-abolish'
Plug 'skwp/greplace.vim'
Plug 'godlygeek/tabular'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'nvim-treesitter/nvim-treesitter', { 'do': ':TSUpdate' }

" Interface
Plug 'vim-airline/vim-airline'
Plug 'dracula/vim'

" File navigation
Plug 'preservim/nerdtree'
Plug 'Shougo/denite.nvim'
Plug 'mileszs/ack.vim'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'tpope/vim-projectionist'

" Unix integrations
Plug 'tpope/vim-eunuch'

" git integration
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'

" languages
" Plug 'nvimtools/none-ls.nvim'
Plug 'elkasztano/nushell-syntax-vim'
Plug 'neovim/nvim-lspconfig'
Plug 'isobit/vim-caddyfile'
Plug 'benekastah/neomake'
Plug 'tpope/vim-endwise'
Plug 'chrisbra/csv.vim'
Plug 'maxmellon/vim-jsx-pretty'
Plug 'styled-components/vim-styled-components'
Plug 'hail2u/vim-css3-syntax'
Plug 'elixir-editors/vim-elixir'

" clerk dependencies...
" Plug 'tpope/vim-dispatch'
" Plug 'clojure-vim/vim-jack-in'
" Plug 'radenling/vim-dispatch-neovim'
" Plug 'Olical/conjure'

" Elixir
" Plug 'hrsh7th/nvim-cmp'
" Plug 'hrsh7th/cmp-nvim-lsp'
" Plug 'hrsh7th/cmp-buffer'
" Plug 'hrsh7th/cmp-path'
" Plug 'hrsh7th/cmp-cmdline'
" Plug 'hrsh7th/vim-vsnip'
" Plug 'hrsh7th/cmp-vsnip'

call plug#end()

let mapleader=" "
set clipboard^=unnamed,unnamedplus

" Specific configuration files
source ~/.config/nvim/config/git.vim
source ~/.config/nvim/config/mocion.vim
source ~/.config/nvim/config/quickfix.vim
source ~/.config/nvim/config/refactorings.vim
source ~/.config/nvim/config/search.vim
source ~/.config/nvim/config/splits.vim
source ~/.config/nvim/config/spacing.vim
source ~/.config/nvim/config/spec.vim
source ~/.config/nvim/config/spell.vim
lua require("language")

" Open files
nnoremap <Leader>o :!xdg-open "%"<cr>
" undo slice
nnoremap <Leader>u :GitGutterUndoHunk<cr>

" Fast movement within a file
set relativenumber
set number

" Use 2 spaces as a tab
set expandtab
set shiftwidth=2
set tabstop=2

autocmd FileType Makefile :set noexpandtab

" Don't wrap text
set nowrap

" Colors
" set background=light
" colorscheme tomorrow
colorscheme dracula
" highlight Normal ctermbg=None

" autocmd BufEnter * highlight Normal guibg=0 " see https://github.com/alacritty/alacritty/issues/660
highlight LineNr ctermbg=none ctermfg=grey
highlight CursorLineNr ctermbg=none ctermfg=blue

let g:vim_jsx_pretty_template_tags = [ 'node' ]
" let g:vim_jsx_pretty_colorful_config = 0

" Fast editing of .vimrc file
nnoremap <leader>ve :e $MYVIMRC<cr>
nnoremap <leader>vv :vsp $MYVIMRC<cr>
autocmd! bufwritepost $MYVIMRC source %

" hex and html mode
nnoremap <leader>h :%!xxd<cr>
nnoremap <leader>H :!tidy -mi -xml -wrap 0 %<cr>

" Change measures logically.
let g:ctrlp_map = "<c-i>"
let g:ctrlp_working_path_mode = ""
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git'
let g:ctrlp_user_command = ['.git', 'cd %s; git ls-files -co --exclude-standard']

" Swapfiles are an annoyance.
set noswapfile

" use uppercase U for 'redo'
nnoremap U <C-r>

" Mark long lines
set colorcolumn=81
autocmd FileType gitcommit :set colorcolumn=51

" Never reach for the escape key
inoremap jk <esc>
inoremap kj <esc>
inoremap <c-c> :q<cr>
let g:multi_cursor_exit_from_insert_mode=0
let g:multi_cursor_exit_from_visual_mode=0

" The Silver Searcher
if executable('rg')
  " Use rg over grep
  set grepprg=rg\ --no-heading\ --color\ never
endif

" Clear out the `q` buffer to prepare for recursive macros
nnoremap Q qqqqq

" Recognize additional file extensions
autocmd BufRead,BufNewFile *.es6 setfiletype javascript
autocmd BufRead,BufNewFile *.tsx setfiletype typescript
autocmd BufRead,BufNewFile *.sface setfiletype html