-
Notifications
You must be signed in to change notification settings - Fork 3
/
basics.vim
92 lines (72 loc) · 2.86 KB
/
basics.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
set nocompatible
filetype indent plugin on
syntax on
let &undodir = NVIMHOME . "/undos"
set undofile " new feature of undo files
let &directory = NVIMHOME . "/swap" " no more swapfiles in the same directory
let &backupdir = NVIMHOME . "/backups" " no more backupfiles in the same directory
set backupskip=/tmp/*,/private/tmp/* " http://vim.wikia.com/wiki/Editing_crontab
" prevents some security exploits having to do with modelines in files
" http://lists.alioth.debian.org/pipermail/pkg-vim-maintainers/2007-June/004020.html
set modeline
set modelines=4
" http://vimcasts.org/episodes/tabs-and-spaces/
" 4 spaces expanded and backspace deletes 4 spaces too
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set colorcolumn=85 " a ruler to indicate line breaks
set backspace=indent,eol,start " allow backspacing over everything in insert mode
set backup " keep a backup file
set scrolloff=99 " Minimal number of screen lines to keep above and below the cursor
set history=1000 " keep xxx lines of command line history
set showmode
set showcmd " display incomplete commands
set incsearch " do incremental searching
set spelllang=de_20,en_gb
" command-line completion menu
set wildmenu
set wildmode=list:longest,full
"
" ignore list e.g. for command-t plugin
set wildignore+=*.o,*.obj
set wildignore+=*.aux,*.bbl,*.blg,*.toc,*.out,*.bak,*.mtc0,*.maf,*.mtc
set wildignore+=*.dvi,*.pdf
set wildignore+=*.jpg,*.png,*.tiff
set visualbell " no beep but visual bell
set cursorline " Highlight the screen line of the cursor
set cursorcolumn " Highlight the screen column of the cursor
set ttyfast " Indicates a fast terminal connection.
set ruler " Show the line and column number of the cursor position
set laststatus=2 " = always
set relativenumber " Show the line number relative to the line with the cursor
set number " show absolute number in addition to relative one
set hlsearch " switch on highlighting the last used search pattern.
set ignorecase " case-sensitive search intelligently
set smartcase " all lower -> insensitive, on upper case -> sensitive
" searches use normal regexes
nnoremap / /\v
vnoremap / /\v
set gdefault " applies substitutions globally on lines
" handle long lines
set wrap
set textwidth=79
set formatoptions=qrn1
set list " show some invisible chars
set listchars=nbsp:•,tab:▸\ ,eol:¬,trail:·,extends:↷,precedes:↶
" Stifle many interruptive "Hit Enter" prompts
set shortmess=atI
" In many terminal emulators the mouse works just fine, thus enable it.
if has('mouse')
set mouse=a
" shift+L for searching http://vim.wikia.com/wiki/Searching
set mousemodel=extend
endif
" set font for gvim or macvim
" set guifont=Inconsolata-dz\ for\ Powerline:h15
set t_Co=256 " turn on 256 colors in terminal on dark background
" set background=dark
set background=light
" standard folding is marker based unless changed by plugins
set foldmethod=marker