-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy path.ideavimrc
49 lines (40 loc) · 1.41 KB
/
.ideavimrc
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
syntax on
" relative line numbers in navigation mode
:set number relativenumber
:augroup numbertoggle
: autocmd!
: autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
: autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
:augroup END
set ruler
set colorcolumn=80
set autoindent
set smartindent
" tabstop: Width of tab character
" softtabstop: Fine tunes the amount of white space to be added
" shiftwidth Determines the amount of whitespace to add in normal mode
" expandtab: When on uses space instead of tabs
set tabstop =4
set softtabstop =4
set shiftwidth =4
set expandtab
" show tabs
set list
set listchars=tab:\|_
set ttyfast
set mouse=a
set ttymouse=xterm2
set backspace=2 " make backspace work like most other apps
set backspace=indent,eol,start
" highlight unwanted spaces like trailing spaces, spaces before tab, tabs
" that aren't at the start of a line.
" (adopted from https://vim.fandom.com/wiki/Highlight_unwanted_spaces)
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$\| \+\ze\t/
match ExtraWhitespace /[^\t]\zs\t\+/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()
" for git commit editor, show an extra ruler for the first line
autocmd FileType gitcommit set colorcolumn+=51