Sane defaults

Neovim comes with a number of different defaults than Vim. The defaults are meant to be more applicable to working with a text editor in the modern world. Compared to using Vim with an empty .vimrc, some of the more noticeable defaults include enabled syntax highlighting, sensible indentation settings, wildmenu, highlighted search results, and search-as-you-type.

You can check :help nvim-defaults from within Neovim to learn more about the defaults.

If you wanted to synchronize your settings between Vim and Neovim, you could add the following to your ~/.vimrc (which is hopefully symlinked to ~/.config/nvim/init.vim):

if !has('nvim')
set nocompatible " not compatible with Vi
filetype plugin indent on " mandatory for modern plugins
syntax on " enable syntax highlighting
set autoindent " copy indent from the previous line
set autoread " reload from disk
set backspace=indent,eol,start " modern backspace behavior
set belloff=all " disable the bell
set cscopeverbose " verbose cscope output
set complete-=i " don't scan current on included
" files for completion
set display=lastline,msgsep " display more message text
set encoding=utf-8 " set default encoding
set fillchars=vert:|,fold: " separator characters
set formatoptions=tcqj " more intuitive autoformatting
set fsync " call fsync() for robust file saving
set history=10000 " longest possible command history
set hlsearch " highlight search results
set incsearch " move cursor as you type when searching
set langnoremap " helps avoid mappings breaking
set laststatus=2 " always display a status line
set listchars=tab:> ,trail:-,nbsp:+ " chars for :list
set nrformats=bin,hex " <c-a> and <c-x> support
set ruler " display current line # in a corner
set sessionoptions-=options " do not carry options across sessions
set shortmess=F " less verbose file info
set showcmd " show last command in the status line
set sidescroll=1 " smoother sideways scrolling
set smarttab " tab setting aware <Tab> key
set tabpagemax=50 " maximum number of tabs open by -p flag
set tags=./tags;,tags " filenames to look for the tag command
set ttimeoutlen=50 " ms to wait for next key in a sequence
set ttyfast " indicates that our connection is fast
set viminfo+=! " save global variables across sessions
set wildmenu " enhanced command line completion
endif

I've left some short comments, attempting to briefly describe each one of these settings, and you can learn more about them by checking the corresponding :help entry.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.28.197