mirror of
https://gitea.blesmrt.net/mikaela/shell-things.git
synced 2024-12-27 13:22:37 +01:00
111 lines
2.6 KiB
VimL
111 lines
2.6 KiB
VimL
" I probably don't need to have Vi compatibility.
|
|
set nocompatible
|
|
|
|
" Show syntax colours
|
|
syntax on
|
|
|
|
set showcmd " Show (partial) command in status line.
|
|
set showmatch " Show matching brackets.
|
|
set ignorecase " Do case insensitive matching
|
|
set smartcase " Do smart case matching
|
|
"set incsearch " Incremental search
|
|
set autowrite " Automatically save before commands like :next and :make
|
|
set hidden " Hide buffers when they are abandoned
|
|
"set mouse=a " Enable mouse usage (all modes)
|
|
|
|
" Source a global configuration file if available
|
|
if filereadable("/etc/vim/vimrc.local")
|
|
source /etc/vim/vimrc.local
|
|
endif
|
|
|
|
set number " Show line numbers.
|
|
|
|
set ruler " Show the line and column number of the cursor position,
|
|
" separated by a comma.
|
|
|
|
set background=dark
|
|
|
|
"Use modelines!
|
|
set modeline
|
|
|
|
" These may be difficult with multiple languages especially if Vim already
|
|
" knows what to do
|
|
set tabstop=4 "four spaces is likely a tab
|
|
"set shiftwidth=4
|
|
" For accessibility tabs instead of spaces (uncomment for spaces instead of
|
|
" tabs)
|
|
"set expandtab
|
|
|
|
set autoindent
|
|
|
|
" Longer history
|
|
set history=1000
|
|
|
|
" Extended % matching
|
|
runtime macros/matchit.vim
|
|
|
|
" Make tab filler useful.
|
|
" INVESTIGATE WHAT THIS ACTUALLY DOES?
|
|
set wildmenu
|
|
set wildmode=list:longest
|
|
|
|
" Flash, do not beep!
|
|
set visualbell
|
|
|
|
" gvim has light background
|
|
"if has('gui_running')
|
|
" set background=light
|
|
"endif
|
|
|
|
" Show hidden characters via
|
|
" https://www.perturb.org/display/679_Make_Vim_show_hidden_characters.html
|
|
set invlist
|
|
|
|
"Prefer to UNIX line endings, but understand DOS too.
|
|
set fileformats=unix,dos
|
|
|
|
"Use UTF-8!
|
|
set encoding=utf-8
|
|
set fileencoding=utf-8
|
|
|
|
" Remove BOMs. They broke things yesterday and now they wasted my time
|
|
" at school!
|
|
" via https://techwelkin.com/how-to-remove-byte-order-mark-bom-characters
|
|
set nobomb
|
|
|
|
" Apply rules per filetype.vim
|
|
set filetype
|
|
filetype plugin indent on
|
|
|
|
" Return to last edit position when opening files (You want this!)
|
|
autocmd BufReadPost *
|
|
\ if line("'\"") > 0 && line("'\"") <= line("$") |
|
|
\ exe "normal! g`\"" |
|
|
\ endif
|
|
|
|
" I think leaving line endings to git may be more safe
|
|
" dos2unix ^M copied from https://stackoverflow.com/a/5361702/1675649
|
|
"fun! Dos2unixFunction()
|
|
" let _s=@/
|
|
" let l = line(".")
|
|
" let c = col(".")
|
|
" try
|
|
" set ff=unix
|
|
" w!
|
|
" "%s/\%x0d$//e
|
|
" catch /E32:/
|
|
" echo "Sorry, the file is not saved."
|
|
" endtry
|
|
" let @/=_s
|
|
" call cursor(l, c)
|
|
"endfun
|
|
"com! Dos2Unix keepjumps call Dos2unixFunction()
|
|
"au BufReadPost * keepjumps call Dos2unixFunction()
|
|
|
|
" Highlight all search results
|
|
set hlsearch
|
|
|
|
" Red column on the right as indication on what I wish to consider as the
|
|
" maximum length of a line.
|
|
set colorcolumn=76
|