Skip to content

Instantly share code, notes, and snippets.

@yzguy
Created February 11, 2018 02:32
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 yzguy/449952ddba4e24778bec9dd27999143d to your computer and use it in GitHub Desktop.
Save yzguy/449952ddba4e24778bec9dd27999143d to your computer and use it in GitHub Desktop.
" Use vim-plug for plugins
set nocompatible
call plug#begin('~/.vim/plugged')
if has('nvim')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'zchee/deoplete-jedi'
Plug 'zchee/deoplete-go'
Plug 'fishbullet/deoplete-ruby'
endif
" Languages
Plug 'vim-ruby/vim-ruby'
Plug 'fatih/vim-go'
Plug 'airblade/vim-gitgutter'
Plug 'godlygeek/tabular'
" Colors
Plug 'joshdick/onedark.vim'
call plug#end()
" Enable filetype plugin
filetype indent on
filetype plugin on
syntax on
" General
let mapleader=","
set encoding=utf8
set t_Co=256
set mouse=a
" Colors
set background=dark
colorscheme onedark
set termguicolors
" Text Format
set tabstop=2
set softtabstop=2
set expandtab " expand tabs to spaces
set shiftwidth=2 " Shift << and >>
set lcs=tab:▸\ ,trail:·,eol:¬,nbsp:_ " Show invisible characters
set list
" UI
set noerrorbells novisualbell " Disable error bells
set ruler " Show the cursor position
set backspace=indent,eol,start " Allow backspace in insert mode
set number " Show line numbers
set showmode " Show the current mode
set showcmd
set scrolloff=3 " Set scrolling three lines before bottom
" Backups
set directory=~/.vim/swp
" Type specific things
au BufRead,BufNewFile *.md set wrap linebreak spell filetype=markdown
au BufRead,BufNewFile *.markdown set wrap linebreak spell filetype=markdown
au BufRead,BufNewFile *.py set softtabstop=4 shiftwidth=4 tabstop=4
au BufRead,BufNewFile *.rb set softtabstop=2 shiftwidth=2 tabstop=2
au BufRead,BufNewFile *.yml set softtabstop=2 shiftwidth=2 tabstop=2
au Filetype gitcommit set textwidth=80 wrap spell
au FileType make set noexpandtab shiftwidth=8 tabstop=8 cindent softtabstop=0
au FileType sh set expandtab shiftwidth=4 tabstop=4 cindent softtabstop=4
au FileType yaml set expandtab shiftwidth=2 tabstop=2 cindent softtabstop=2
"Deoplete
let g:deoplete#enable_at_startup = 1
"Vim-go
let g:go_fmt_command = "goimports"
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
" Tabularize
nnoremap <Leader>aa :Tabularize /=><CR>
vnoremap <Leader>aa :Tabularize /=><CR>
nnoremap <Leader>a= :Tabularize /=<CR>
vnoremap <Leader>a= :Tabularize /=<CR>
nnoremap <Leader>a: :Tabularize /:\zs<CR>
vnoremap <Leader>a: :Tabularize /:\zs<CR>
nnoremap <Leader>a" :Tabularize /"<CR>
vnoremap <Leader>a" :Tabularize /"<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment