Skip to content

Instantly share code, notes, and snippets.

@drconopoima
Last active May 12, 2020 07:00
Show Gist options
  • Save drconopoima/58b1e691630dc0d3780e3f724d355356 to your computer and use it in GitHub Desktop.
Save drconopoima/58b1e691630dc0d3780e3f724d355356 to your computer and use it in GitHub Desktop.
Minimalist vimrc config with vim-plug plugin manager
set showcmd " Show (partial) command in status line.
set showmatch " Show matching brackets.
set incsearch " Incremental search
set autowrite " Automatically save before commands like :next and :make
set hidden " Hide buffers when they are abandoned
set nocompatible " be iMproved, required
filetype off " required
set nu rnu " Show line numbers and relative line numbers in hybrid mode
set ignorecase
set smartcase " ...except when serach query contains a capital letter
set autoread " Auto load files if they change on disc
" Display 5 lines above/below the cursor when scrolling with a mouse.
set scrolloff=7
" Fixes common backspace problems
set backspace=indent,eol,start
" Speed up scrolling in Vim
set ttyfast
" Status bar
set laststatus=2
" Display options
set showmode
" Highlight matching pairs of brackets. Use the '%' character to jump between them.
set matchpairs+=<:>
" Display different types of white spaces.
set list
set listchars=tab:›\ ,trail:•,extends:#,nbsp:.
" Set status line display
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ [BUFFER=%n]\ %{strftime('%c')}
" Encoding
set encoding=utf-8
" Highlight matching search patterns
set hlsearch
" Store info from no more than 100 files at a time, 9999 lines of text, 100kb of data. Useful for copying large amounts of data between files.
set viminfo='100,<9999,s100
color desert
" Specify a directory for plugins
" - For Neovim: stdpath('data') . '/plugged'
" - Avoid using standard Vim directory names like 'plugin'
" Make sure you use single quotes
call plug#begin('~/.vim/plugged')
" Shorthand notation; fetches https://github.com/sheerun/vim-polyglot
Plug 'sheerun/vim-polyglot'
Plug 'preservim/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'
call plug#end()
nmap <C-f> :NERDTreeToggle<CR>
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment