Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
289 lines (227 sloc) 6.88 KB
set nocompatible
filetype off
" Autoinstall vim-plug
if empty(glob('~/.config/nvim/autoload/plug.vim'))
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs
autocmd VimEnter * PlugInstall
call plug#begin()
" General
Plug 'tpope/vim-surround'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'Shougo/echodoc.vim'
Plug 'Konfekt/FastFold'
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" Buffer management
Plug 'ctrlpvim/ctrlp.vim'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
" Syntax
Plug 'neomake/neomake'
Plug 'kchmck/vim-coffee-script'
Plug 'tpope/vim-rails'
Plug 'ekalinin/Dockerfile.vim'
Plug 'tpope/vim-markdown'
Plug 'fatih/vim-go'
Plug 'mustache/vim-mustache-handlebars'
Plug 'cespare/vim-toml'
Plug 'isRuslan/vim-es6'
Plug 'jparise/vim-graphql'
Plug 'leafgarland/typescript-vim'
Plug 'peitalin/vim-jsx-typescript'
" Debugging
Plug 'sebdah/vim-delve'
" Deoplete sources
Plug 'mhartington/nvim-typescript'
Plug 'autozimu/LanguageClient-neovim', { 'branch': 'next', 'do': 'bash' }
" Colorscheme
Plug 'rakr/vim-one'
" All of your Plugins must be added before the following line
call plug#end() " required
filetype plugin indent on " required
set encoding=utf-8
set scrolloff=3
set autoindent
set showmode
set showcmd
set hidden
set wildmenu
set wildmode=list:longest,list:full
set wildignore+=*.o,*.obj,.git,*.rbc
set ttyfast
set laststatus=2
set clipboard=unnamed
set timeoutlen=500
set foldmethod=syntax
set nofoldenable
set shortmess+=c
" Directories for swp files
set backupdir=~/.vim/backup
set directory=~/.vim/backup
" Use modeline overrides
set modeline
set modelines=4
" Line numbers
set rnu
set number
set ruler
set cursorline
syntax on
" Whitespace
set nowrap
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set list listchars=tab:\ \ ,trail:·
" Re-assign the leader from '.' to ','
let mapleader = ","
" Make ';' do the same as ':'
nnoremap ; :
" Searching
nnoremap / /\v
vnoremap / /\v
set hlsearch
set incsearch
set ignorecase
set smartcase
set gdefault
set showmatch
nnoremap <leader><space> :noh<cr>
" Text wrapping
set wrap
set textwidth=79
set formatoptions=qrn1
" Allow backspacing over everything in insert mode
set backspace=indent,eol,start
" Automatically include external file changes when the cursor moves
au CursorMoved * checktime
set autoread
" make and python use real tabs
au FileType make set noexpandtab
au FileType python set noexpandtab
" Default color scheme
set background=dark
set termguicolors
let g:one_allow_italics=1
color one
hi CursorColumn guibg=#282d36
hi CursorLine guibg=#282d36
hi CursorLineNr ctermfg=114 guifg=#98c379 guibg=#282d36
hi Normal guibg=#212121
" Completion options should only use menus
set completeopt=menu
set completeopt+=noinsert
set fillchars=vert:\ ,stl:\ ,stlnc:\
" Disable arrow keys
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
" Move by screen line, not file line
" Commands prefixed with a count (e.g. 5j) will still behave correctly. Jumps
" larger than 5 lines will automatically be recorded to the jumplist.
nnoremap <expr> j v:count ? (v:count > 5 ? "m'" . v:count : '') . 'j' : 'gj'
nnoremap <expr> k v:count ? (v:count > 5 ? "m'" . v:count : '') . 'k' : 'gk'
" Quick escapes
inoremap jj <Esc>
tnoremap <Esc> <C-\><C-n>
tnoremap jj <C-\><C-n>
" Reselect visual block after indent/outdent
vnoremap < <gv
vnoremap > >gv
" Indent code in normal mode
nnoremap < V<gv<Esc>
nnoremap > V>gv<Esc>
" Select all text in the current buffer
map <Leader>a ggVG
" Absolute line numbers in insert mode, relative numbers in others for easy movement
au InsertEnter * :set nu
au InsertLeave * :set rnu
" Split windows
nnoremap <leader>w <C-w>v<C-w>l
nnoremap <leader>W :split<CR><C-w>j
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
tnoremap <leader>w <C-\><C-n><C-w>v<C-w>l
tnoremap <leader>W <C-\><C-n>:split<CR><C-w>j
tnoremap <C-h> <C-\><C-n><C-w>h
tnoremap <C-j> <C-\><C-n><C-w>j
tnoremap <C-k> <C-\><C-n><C-w>k
tnoremap <C-l> <C-\><C-n><C-w>l
" Opens an edit command with the path of the currently edited file filled in
" Normal mode: <Leader>e
map <Leader>e :e <C-R>=expand("%:p:h") . "/" <CR>
" Shortcuts to manage location/quickfix lists
map <leader>c :lclose<CR>
" Disable mouse support in Terminal (enable mouse support if required in
" gvimrc).
set mouse=
" Automatically reload vimrc when it's saved
"au BufWritePost .vimrc so ~/.vimrc
"au BufWritePost init.vim so ~/.vimrc
" Remember last location in file
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal g'\"" | endif
" Automatically resize splits when Vim is resized
au VimResized * wincmd =
" Thorfile, Rakefile and Gemfile are Ruby
au BufRead,BufNewFile {Gemfile,Rakefile,Thorfile,} set ft=ruby
au BufRead,BufNewFile *.es6 set ft=javascript
"md, markdown, and mk are markdown and define buffer-local preview
"au BufRead,BufNewFile *.{md,markdown,mdown,mkd,mkdn} call s:setupMarkup()
"au BufRead,BufNewFile *.txt call s:setupWrapping()
au FileType gitcommit setlocal fo+=t
" NERDTree configuration
let NERDTreeIgnore=['\.rbc$', '\~$']
let NERDTreeMinimalUI=1
let NERDTreeDirArrows=1
map <Leader>n :NERDTreeToggle<CR>
" CtrlP configuration
let g:ctrlp_match_window='order:ttb'
nmap <Leader>t :CtrlP<CR>
nmap <Leader>T :CtrlPClearCache<CR>
if executable("ag")
" Use ag over grep
set grepprg=ag\ --nogroup\ --nocolor
" Use ag in CtrlP for listing files.
let g:ctrlp_user_command = 'ag %s -l --ignore vendor --nocolor -g ""'
let g:ctrlp_use_caching = 0
" Airline config
let g:airline_powerline_fonts=1
let g:airline_theme='one'
set noshowmode
" Neomake config
autocmd! BufReadPost,BufWritePost * Neomake
let g:neomake_open_list=2
let g:neomake_list_height=5
let g:neomake_ruby_enabled_makers = ['rubocop']
" echodoc config
let g:echodoc#enable_at_startup = 1
" Langserver config
let g:LanguageClient_serverCommands = {
\ 'go': ['go-langserver', '-gocodecompletion'],
\ 'javascript': ['javascript-typescript-stdio'],
\ 'typescript': ['javascript-typescript-stdio'],
\ }
" Deoplete config
let g:deoplete#enable_at_startup = 1
"let g:deoplete#sources={}
"let g:deoplete#sources._ = ['buffer', 'file']
" vim-go config
let g:go_fmt_command = "goimports"
" Import ~/.vimrc.local
if filereadable("~/.vimrc.local")
so ~/.vimrc.local