Skip to content

Instantly share code, notes, and snippets.

@stav121
Created April 3, 2018 23:44
Show Gist options
  • Save stav121/fec6a16e09e3f20f1fa6028be9b0cfab to your computer and use it in GitHub Desktop.
Save stav121/fec6a16e09e3f20f1fa6028be9b0cfab to your computer and use it in GitHub Desktop.
The best .vimrc in existence, not
" ██
" ░░
" ██ ██ ██ ██████████ ██████ █████
" ░██ ░██░██░░██░░██░░██░░██░░█ ██░░░██
" ░░██ ░██ ░██ ░██ ░██ ░██ ░██ ░ ░██ ░░
" ░░████ ░██ ░██ ░██ ░██ ░██ ░██ ██
" ░░██ ░██ ███ ░██ ░██░███ ░░█████
" ░░ ░░ ░░░ ░░ ░░ ░░░ ░░░░░
if $TERM != "linux" " if we are not in TTY
set t_Co=256 " set 256 colors.
endif
set nocompatible " be iMproved
set laststatus=2 " show status
filetype off " required
syntax on " enable syntax colors
set termguicolors
colorscheme onedark " colorscheme
set mouse=a
" Plugins
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'itchyny/lightline.vim'
Plugin 'tpope/vim-unimpaired'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-endwise'
Plugin 'tpope/vim-commentary'
Plugin 'dikiaap/minimalist'
Plugin 'editorconfig/editorconfig-vim'
Plugin 'garbas/vim-snipmate'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'scrooloose/syntastic'
Plugin 'ryanoasis/vim-devicons'
Plugin 'L9'
Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'mattn/emmet-vim'
Plugin 'ayu-theme/ayu-vim'
Plugin 'sheerun/vim-polyglot'
Plugin 'stanangeloff/php.vim'
Plugin 'tomtom/tlib_vim'
Plugin 'tpope/vim-fugitive'
Plugin 'VundleVim/Vundle.vim'
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
call vundle#end()
filetype plugin indent on
" lightline settings
let g:lightline = {
\ 'colorscheme': 'onedark',
\ 'active': {
\ 'left': [ [ 'filename' ],
\ [ 'readonly', 'fugitive' ] ],
\ 'right': [ [ 'percent', 'lineinfo' ],
\ [ 'fileencoding', 'filetype' ],
\ [ 'fileformat', 'syntastic' ] ]
\ },
\ 'separator': { 'left': '▓▒░', 'right': '░▒▓' },
\ 'subseparator': { 'left': '▒', 'right': '░' }
\ }
" Bindings
" Bubble single lines
nmap <C-k> [e
nmap <C-j> ]e
" Bubble multiple lines
vmap <C-k> [egv
vmap <C-j> ]egv
" Visually select the text that was last edited
nmap gV `[v`]
" Settings
set completeopt-=preview " disable scratch buffer
set cursorline " enable cursor highlight
set showcmd " show command information
set foldmethod=marker " allow marking folds
set showmatch " hilight search pattern
set incsearch " incremental search
set scrolloff=1 " 1 line offset from top-bottom
set sidescrolloff=5 " 5 character offset from left-right
set nowrap " don't wrap lines
set virtualedit=all " enable virtualedit (visual block)
set expandtab " spaces not tabs
set softtabstop=3 " indents
set shiftwidth=3 " more indents
set number " show line numbers
set noswapfile " no swap files
set updatecount=0 " we don't use swap files
set ignorecase " ignore case in search
set smartcase " if uppercase letter, don't ignore
set undolevels=1000 " undo levels
set lazyredraw " don't redraw while executing macros
set noerrorbells " disable bell
set showtabline=1 " show/hide tabs
set cmdheight=1 " cmd height
set modeline " use modelines
set ttimeout " key combination timeout
set ttimeoutlen=50 " lower statusline timeout
set autoindent " indent to last identation
set list " Display unprintable characters f12 - switches
set listchars=tab:•\ ,trail:•,extends:•,precedes:• " Unprintable chars mapping
autocmd vimenter * NERDTree
let g:webdevicons_enable_nerdtree = 1
nmap <F2> :NERDTreeToggle
set encoding=utf-8
set relativenumber
" Whitespace
set wrap
set textwidth=100
set formatoptions=tcqrn1
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set noshiftround
" Formatting
map <leader>q gqip
" Or use your leader key + l to toggle on/off
map <leader>l :set list!<CR>
" vim: set ts=8 sw=3 tw=78 :
" Rendering
set ttyfast
" Searching
nnoremap / /\v
vnoremap / /\v
set hlsearch
set incsearch
set ignorecase
set smartcase
set showmatch
map <leader><space> :let @/=''<cr>
" Last line
set showmode
set showcmd
filetype plugin indent on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment