-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
executable file
·80 lines (67 loc) · 2.07 KB
/
vimrc
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
" work around to eliminate depracation warning
if has('python3')
silent! python3 1
endif
syntax on
filetype plugin indent on
set background=light
" Tabbing
set tabstop=8
set softtabstop=2
set expandtab
set shiftwidth=2
" Undo history
let vimDir = '$HOME/.vim'
" " Keep undo history across sessions by storing it in a file
if has('persistent_undo')
let myUndoDir = '/tmp/$USER/undodir'
" Create dirs
call system('mkdir ' . myUndoDir)
let &undodir = myUndoDir
set undofile
endif
" New split to right and below
set splitright
set splitbelow
" Line numbers
set number
set relativenumber
" Remap window switching
nnoremap <C-H> <C-W>h
nnoremap <C-J> <C-W>j
nnoremap <C-K> <C-W>k
nnoremap <C-L> <C-W>l
" Quick disable highlighting
nnoremap <C-=> :nohl<CR>
noremap <C-N> :NERDTreeFind<CR>
let g:UltiSnipsExpandTrigger = '<c-k>'
let g:UltiSnipsJumpForwardTrigger = '<c-k>'
let g:UltiSnipsJumpBackwardTrigger = '<c-j>'
let g:UltiSnipsSnippetDirectories = ['~/.vim/UltiSnips', 'UltiSnips']
let g:ycm_key_list_select_completion = ['<tab>', '<C-n>', '<Down>']
let g:ycm_key_list_previous_completion = ['<S-tab>', '<C-p>', '<Up>']
" Automatically strip whitespace from the end of lines
autocmd BufWritePre * :%s/\s\+$//e
" Backspace behaviour in vim
" to make it work like "other" programs
"
set backspace=indent,eol,start
"
"Longer answer
"
"Though the default behaviour may be surprising, the backspace "not working"
"can be considered a feature; it can prevents you from accidentally removing
"indentation, and from removing too much text by restricting it to the current
"line and/or the start of the insert.
"
":help 'backspace' tells us:
"
"Influences the working of `<BS>`, `<Del>`, `CTRL-W` and `CTRL-U` in Insert
"mode. This is a list of items, separated by commas. Each item allows
"a way to backspace over something:
"
"value effect
"indent allow backspacing over autoindent
"eol allow backspacing over line breaks (join lines)
"start allow backspacing over the start of insert; CTRL-W and CTRL-U
" stop once at the start of insert.