-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdot_vimrc.tmpl
49 lines (42 loc) · 1.31 KB
/
dot_vimrc.tmpl
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
set breakindent
set cursorline
set formatoptions=l
set lbr
set mouse=a
set nofoldenable
set nowrap
set number
set showcmd
set showmatch
set shiftwidth=4
set tabstop=4
set expandtab
nnoremap j gj
nnoremap k gk
nnoremap <C-s-tab> :tabprevious<CR>
nnoremap <C-tab> :tabnext<CR>
colorscheme nord
" python
source ~/.vim/.python-vimrc
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h set textwidth=88
set encoding=utf-8
let python_highlight_all=1
syntax on
filetype indent on
set autoindent
set foldmethod=indent
" text files
au FileType text set wrap
au FileType text set linebreak
au BufRead,BufNewFile *.md setlocal wrap
au BufRead,BufNewFile *.md setlocal linebreak
autocmd BufEnter * if &filetype == "" | setlocal ft=text | endif
" Add bracket completions
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h inoremap ( ()<left>
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h inoremap [ []<left>
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h inoremap { {}<left>
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h inoremap <expr> ) strpart(getline('.'), col('.')-1, 1) == ")" ? "\<Right>" : ")"
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h inoremap <expr> ] strpart(getline('.'), col('.')-1, 1) == "]" ? "\<Right>" : "]"
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h inoremap <expr> } strpart(getline('.'), col('.')-1, 1) == "}" ? "\<Right>" : "}"
" Set the GUI font
set guifont=Monaco:h12