Skip to content

Instantly share code, notes, and snippets.

@lotuc
Last active February 25, 2019 08:32
Show Gist options
  • Save lotuc/a7c040698917725c26f87255d84ff6be to your computer and use it in GitHub Desktop.
Save lotuc/a7c040698917725c26f87255d84ff6be to your computer and use it in GitHub Desktop.
nvim
" vim-plug {{{
call plug#begin()
Plug 'jiangmiao/auto-pairs'
call plug#end()
" }}} vim-plug
" Spaces & Tabs {{{
set tabstop=4 " number of visual spaces per TAB
set softtabstop=4 " number of spaces in tab when editing
set shiftwidth=4 " number of spaces to use for autoindent
set expandtab " tabs are space
set autoindent
set copyindent " copy indent from the previous line
" }}} Spaces & Tabs
" Clipboard {{{
set clipboard+=unnamedplus
" }}} Clipboard
" UI Config {{{
set hidden
set number " show line number
set showcmd " show command in bottom bar
set cursorline " highlight current line
set wildmenu " visual autocomplete for command menu
set showmatch " highlight matching brace
set laststatus=2 " window will always have a status line
set nobackup
set noswapfile
" }}} UI Config
" Search {{{
set incsearch " search as characters are entered
set hlsearch " highlight matche
set ignorecase " ignore case when searching
set smartcase " ignore case if search pattern is lower case
" case-sensitive otherwise
" set Ag as the grep command
if executable('ag')
" Note we extract the column as well as the file and line number
set grepprg=ag\ --nogroup\ --nocolor\ --column
set grepformat=%f:%l:%c%m
endif
" }}} Search
" Folding {{{
set foldenable
set foldlevelstart=10 " default folding level when buffer is opened
set foldnestmax=10 " maximum nested fold
set foldmethod=syntax " fold based on indentation
" }}} Folding

init.vim: ~/.config/nvim/init.vim

vim-plug

curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs \
  https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

Call :PlugInstall to install plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment