Skip to content

Instantly share code, notes, and snippets.

@Xifax
Last active July 5, 2018 12:40
Show Gist options
  • Save Xifax/45a062456d9f42cea6c07745ad6f009b to your computer and use it in GitHub Desktop.
Save Xifax/45a062456d9f42cea6c07745ad6f009b to your computer and use it in GitHub Desktop.
Lightweight vimrc for server-side usage
" Installation
"
" curl -L https://gist.github.com/xifax/45a062456d9f42cea6c07745ad6f009b/raw/.vimrc --output ~/.vimrc
"
" curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
set nocompatible
filetype plugin on
call plug#begin('~/.vim/plugged')
" Core
Plug 'tpope/vim-sensible'
Plug 'easymotion/vim-easymotion' " <leader> s | also works as sneak
" Plug 'justinmk/vim-sneak' " s{char}{char} | ; (next item)
Plug 'junegunn/fzf' " Ctrl-P
Plug 'itchyny/lightline.vim'
Plug 'tomtom/tcomment_vim' " gcc
Plug 'editorconfig/editorconfig-vim'
" Plug 'jeetsukumaran/vim-buffergator' " <leader> b | gb | <leader> <left>
Plug 'powerman/vim-plugin-ruscmd' " command mode for RU layout
Plug 'conradirwin/vim-bracketed-paste' " paste without :set paste
Plug 'scrooloose/nerdtree' " Ctrl-S
Plug 'szw/vim-ctrlspace' " Ctrl-Space superpowers
" Additional mumbo-jumbo
" Plug 'Valloric/YouCompleteMe' " cd ~/.vim/plugged/YCM && ./install
Plug 'scrooloose/syntastic'
Plug 'mattn/webapi-vim'
Plug 'mattn/gist-vim' " set github.name, then Gist -l
Plug 'duggiefresh/vim-easydir' " :new auto create folders when saving file
Plug 'bronson/vim-trailing-whitespace' " :FixWhitespace
" Themes
Plug 'reedes/vim-colors-pencil'
Plug 'raphamorim/lucario'
Plug 'morhetz/gruvbox'
Plug 'w0ng/vim-hybrid'
Plug 'sjl/badwolf'
Plug 'ayu-theme/ayu-vim'
Plug 'liuchengxu/space-vim-dark'
" Fluff
Plug 'reedes/vim-pencil'
Plug 'junegunn/limelight.vim' " :Limelight | Limelight!
Plug 'mhinz/vim-startify'
Plug 'jreybert/vimagit'
" Additional languages
Plug 'tomlion/vim-solidity'
call plug#end()
" Visuals
" colorscheme gruvbox
" colorscheme badwolf
set termguicolors
let ayucolor="light"
colorscheme ayu
" colorscheme space-vim-dark
" hi Comment cterm=italic
set background=light
set laststatus=2
set number
set tw=80
" Gvim only
set guifont=PragmataPro\ 14
set guioptions=0
" Save all open buffers in background
set hidden
" Highlight 80st column
if exists('+colorcolumn')
set colorcolumn=80
else
au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>80v.\+', -1)
endif
" Mappings
let mapleader = ","
vnoremap > >gv
vnoremap < <gv
" Move between splits
map <C-J> <C-W>j
map <C-K> <C-W>k
map <C-H> <C-W>h
map <C-L> <C-W>l
" To switch horizontal to vertical
" C-w H
" Vice versa
" C-w J
" Disable command history (accidental q presses)
nnoremap q: <nop>
nnoremap Q <nop>
" Copy and paste using system clipboard
vmap <C-c> "+yi
vmap <C-x> "+c
vmap <C-v> c<ESC>"+p
imap <C-v> <ESC>"+pa
" Switch buffers quickly
noremap <C-x> <C-^>
" Easy motion
"
" Similar to snipe/sneak
nmap s <Plug>(easymotion-overwin-f2)
" nmap s <Plug>(easymotion-s2)
nmap t <Plug>(easymotion-t2)
let g:EasyMotion_smartcase = 1
map / <Plug>(easymotion-sn)
omap / <Plug>(easymotion-tn)
map n <Plug>(easymotion-next)
map N <Plug>(easymotion-prev)
map <Leader>j <Plug>(easymotion-j)
map <Leader>k <Plug>(easymotion-k)
" Autosave on buffer change
autocmd TextChanged,TextChangedI <buffer> silent write!
" Configure limelight
let g:limelight_conceal_ctermfg = 'gray'
" Configure fzf
noremap <C-p> :FZF<CR>
" Open all files in gist
let g:gist_get_multiplefile = 1
" Toggle files
map <C-s> :NERDTree<CR>
" Edit this file
map <leader>e :e ~/.vimrc<CR>
" Reload vim config
map <leader>r :w<CR>:so %<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment