Skip to content

Instantly share code, notes, and snippets.

@alexandre1985
Created September 9, 2020 16:42
Show Gist options
  • Save alexandre1985/1459593c5dad6ff3c0a88b7cdd7e81c7 to your computer and use it in GitHub Desktop.
Save alexandre1985/1459593c5dad6ff3c0a88b7cdd7e81c7 to your computer and use it in GitHub Desktop.
" ---------------------- USABILITY CONFIGURATION ----------------------
" Basic and pretty much needed settings to provide a solid base for
" source code editting
" don't make vim compatible with vi
set nocompatible
" turn on syntax highlighting
syntax on
" and show line numbers
" set number
" make vim try to detect file types and load plugins for them
filetype on
filetype plugin on
filetype indent on
" encoding is utf 8
set encoding=utf-8
set fileencoding=utf-8
" set unix line endings
set fileformat=unix
" when reading files try unix line endings then dos, also use unix for new
" buffers
set fileformats=unix,dos
" search settings
set incsearch " find the next match as we type the search
set hlsearch " hilight searches by default
" keep the cursor visible within 3 lines when scrolling
set scrolloff=3
" indentation
set expandtab " use spaces instead of tabs
set autoindent " autoindent based on line above, works most of the time
set smartindent " smarter indent for C-like languages
set shiftwidth=3 " when reading, tabs are 3 spaces
set softtabstop=3 " in insert mode, tabs are 3 spaces
" use <C-Space> for Vim's keyword autocomplete
" ...in the terminal
inoremap <Nul> <C-n>
" ...and in gui mode
inoremap <C-Space> <C-n>
" On file types...
" .md files are markdown files
autocmd BufNewFile,BufRead *.md setlocal ft=markdown
" .twig files use html syntax
autocmd BufNewFile,BufRead *.twig setlocal ft=html
" .less files use less syntax
autocmd BufNewFile,BufRead *.less setlocal ft=less
" .jade files use jade syntax
autocmd BufNewFile,BufRead *.jade setlocal ft=jade
" ------- ARCHLINUX -------
runtime! archlinux.vim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment