Skip to content

Instantly share code, notes, and snippets.

@sirbrillig
Created August 4, 2022 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sirbrillig/a101df153cfaf6eb85439d15046b2674 to your computer and use it in GitHub Desktop.
Save sirbrillig/a101df153cfaf6eb85439d15046b2674 to your computer and use it in GitHub Desktop.
Some of my most basic vim/nvim settings
syntax on
filetype on
filetype plugin on
filetype indent on
set hlsearch "highlight search matches
set autoindent "use previous line's indent level
set preserveindent " when reindenting try to preserve existing indentation as much as possible
set copyindent " when starting a new line use the indent of the previous line
set hidden "allow edited buffers to be hidden
set switchbuf=useopen "use existing buffer rather than opening a new one
set noet "use tabs to indent
set softtabstop=0 " turn off mixing of tabs and spaces
set shiftwidth=2 " number of spaces to use for each step of indent
set tabstop=2 " number of spaces a tab counts for
set showmatch "highlight matching braces, etc.
set ruler "show cursor position
set incsearch "do incremental searches
set ignorecase "case-insensitive searching
set smartcase "do case-sensitive if upper-case characters.
set gdefault "assume the /g flag on :s.
set formatoptions+=crqlj "auto-format comments in code.
set textwidth=0 "for wrapping
set backspace=indent,eol,start "allow erasing previously entered characters in insert mode.
set wildmenu " show autocomplete list instead of just completing
set scrolloff=3 " minimum lines to keep above and below cursor
set laststatus=2 " always show the status line
set cmdheight=2 " slightly more room in the status line for notices
set cursorline " highlight the current cursor line number
set number " show line numbers
set path+=** " Allow recursive find
set completeopt=menuone,noselect " Configure autocomplete
set clipboard=unnamed " Allow copy/paste between MacOS and tmux
" Display indentation guides
set list
set listchars=tab:\|\ ,trail:·,extends:»,precedes:«,nbsp:×
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment