Skip to content

Instantly share code, notes, and snippets.

@maxcountryman
Created October 7, 2019 14:10
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 maxcountryman/1a0ec98015ef00f51ba14832014f93fc to your computer and use it in GitHub Desktop.
Save maxcountryman/1a0ec98015ef00f51ba14832014f93fc to your computer and use it in GitHub Desktop.
set shell=/bin/bash
if &compatible
set nocompatible
endif
call plug#begin('~/.vim/plugged')
Plug 'airblade/vim-gitgutter'
Plug 'arcticicestudio/nord-vim'
Plug 'christoomey/vim-sort-motion'
Plug 'christoomey/vim-tmux-navigator'
Plug 'dense-analysis/ale'
Plug 'ekalinin/Dockerfile.vim'
Plug 'hashivim/vim-terraform'
Plug 'itchyny/lightline.vim'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'kshenoy/vim-signature'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'rust-lang/rust.vim'
Plug 'tmux-plugins/vim-tmux'
Plug 'tmux-plugins/vim-tmux-focus-events'
Plug 'wellle/tmux-complete.vim'
call plug#end()
filetype plugin indent on
syntax enable
" Ctrl-p via FZF
"
nnoremap <c-p> :Files <cr>
" Tab-completion.
"
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<cr>"
" ALE settings
"
let g:ale_lint_on_insert_leave = 1
let g:ale_virtualtext_cursor = 1
let g:ale_rust_rls_config = {
\ 'rust': {
\ 'all_targets': 1,
\ 'build_on_save': 1,
\ 'clippy_preference': 'on'
\ }
\ }
let g:ale_rust_rls_toolchain = ''
let g:ale_linters = {'rust': ['rls']}
let g:ale_fixers = {'rust': 'rustfmt'}
let g:ale_fix_on_save = 1
let g:ale_completion_enabled = 1
let g:ale_set_balloons = 1
nnoremap <silent> K :ALEHover<CR>
nnoremap <silent> gd :ALEGoToDefinition<CR>
" Lightline settings
"
let g:lightline = {'colorscheme': 'nord'}
" Rust
let g:rustfmt_autosave = 1
" Map a new leader.
let mapleader = ","
" Save when we lose focus.
au FocusLost * :silent! wall
" Dynamically resize splits.
au VimResized * :wincmd =
" General Vim config.
set autoread
set autowrite
set backspace=indent,eol,start
set colorcolumn=79
set cursorline
set encoding=utf-8
set expandtab
set gdefault
set history=1000
set hlsearch
set ignorecase
set incsearch
set laststatus=2
set list
set listchars=tab:▸\ ,eol:¬,extends:❯,precedes:❮
set noshowmode
set relativenumber
set shiftwidth=4
set showcmd
set showmatch
set smartcase
set softtabstop=4
set tabstop=4
set undofile
set visualbell
" Make it so we can use the system clipboard.
vmap <C-x> :!pbcopy<CR>
vmap <C-c> :w !pbcopy<CR><CR>
inoremap <C-a> <esc>I
inoremap <C-e> <End>
noremap H ^
noremap L $
noremap vv :vsplit<CR>
colorscheme nord
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment