Skip to content

Instantly share code, notes, and snippets.

@eclipselu
Last active January 26, 2018 13:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eclipselu/5506736 to your computer and use it in GitHub Desktop.
Save eclipselu/5506736 to your computer and use it in GitHub Desktop.
my vimrc
"vim: curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
"neovim: curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
" Using vim-plug
call plug#begin('~/.vim/plugged')
" UI
Plug 'iCyMind/NeoSolarized'
Plug 'bronson/vim-trailing-whitespace'
Plug 'machakann/vim-highlightedyank'
Plug 'itchyny/lightline.vim'
Plug 'airblade/vim-gitgutter'
" Editing
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-repeat'
Plug 'ervandew/supertab'
" Navigation
Plug 'junegunn/fzf', { 'do': './install --all' }
Plug 'junegunn/fzf.vim'
" Language
Plug 'w0rp/ale'
Plug 'dag/vim-fish'
if has('nvim')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'zchee/deoplete-go', { 'do': 'make'}
let g:deoplete#enable_at_startup = 1
" deoplete-go settings
let g:deoplete#sources#go#gocode_binary = $GOPATH.'/bin/gocode'
let g:deoplete#sources#go#sort_class = ['package', 'func', 'type', 'var', 'const']
endif
Plug 'rust-lang/rust.vim'
Plug 'racer-rust/vim-racer'
Plug 'fatih/vim-go'
call plug#end()
if has('gui_running')
set guifont=Source\ Code\ Pro:h14
endif
" Line number, highlight sarch, cursorline
set number
set relativenumber
set hls
set cursorline
" neocomplete like
set completeopt+=noinsert
" deoplete.nvim recommend
set completeopt+=noselect
set completeopt-=preview
" Theme
set background="dark"
colorscheme NeoSolarized
set termguicolors
" 进入粘贴模式,不自动缩进
set pastetoggle=<F9>
" 设置backspace的行为, neovim中这个值是default
set backspace=indent,eol,start
" 设置编码
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5
set fileencoding=utf-8
set termencoding=utf-8
filetype plugin on
" Indentation
filetype indent on
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
syntax on
set laststatus=2
set t_Co=256
if has('nvim')
set inccommand=split
endif
augroup reload_vimrc
autocmd!
autocmd BufWritePost .vimrc so $MYVIMRC
augroup END
" lightline
set noshowmode
let g:lightline = {
\ 'colorscheme': 'wombat',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'gitbranch': 'fugitive#head'
\ },
\ }
" fzf
nnoremap <Leader>b :Buffers<CR>
nnoremap <Leader>t :GFiles<CR>
nnoremap <Leader>s :BLines<CR>
nnoremap <Leader>l :Lines<CR>
nnoremap <Leader>h :Helptags<CR>
nnoremap <Leader>w :Windows<CR>
nnoremap <Leader>a :Ag<CR>
nnoremap <Leader>c :Commits<CR>
" Rust
let g:ale_linters = {'rust': ['rustc']}
let g:rustfmt_autosave = 1
let g:racer_cmd = "~/.cargo/bin/racer"
let g:racer_experimental_completer = 1
" golang
let g:go_fmt_command = "goimports"
let g:go_term_mode = "split"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment