-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
109 lines (95 loc) · 2.85 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
" VIM Configuration File
" Description: Optimized for C/C++ development, but useful also for other things.
" Author: Gerhard Gappmeier
"
" Auto close brackets, braces etc
ino " ""<left>
ino ' ''<left>
ino ( ()<left>
ino [ []<left>
ino { {}<left>
ino {<CR> {<CR>}<ESC>O
ino #in #include <><Left>
ino #d #define<Space>
" Make commands work in cyrillic
set langmap=явертъуиопасдфгхйклшщасдфгхйклзьцжбнмчЯВЕРТЪУИОПШЩАСДФГХЙКЛЗѝЦЖБНМЧ;qwertyuiopasdfghjkl[]asdfghjklzxcvbnm`QWERTYUIOP{}ASDFGHJKLZXCVBNM~
set scrolloff=5
" auto save file
set autowrite
" set UTF-8 encoding
set enc=utf-8
set fenc=utf-8
set termencoding=utf-8
" disable vi compatibility (emulation of old bugs)
set nocompatible
" use indentation of previous line
set autoindent
" use intelligent indentation for C
set smartindent
" configure tabwidth and insert spaces instead of tabs
set tabstop=4 " tab width is 4 spaces
set shiftwidth=4 " indent also with 4 spaces
set noexpandtab " don't expand tabs to spaces
" wrap lines at 120 chars. 80 is somewaht antiquated with nowadays displays.
set textwidth=120
" set vertical ruler
set colorcolumn=121
highlight ColorColumn ctermbg=9 guibg=red
" turn search highlighting on
se hlsearch
" show trailing spaces
se list
se listchars=trail:-,tab:\ \
" turn syntax highlighting on
set t_Co=256
syntax on
" colorscheme wombat256
" turn line numbers on
set number
" highlight matching braces
set showmatch
" intelligent comments
set comments=sl:/*,mb:\ *,elx:\ */
" Install OmniCppComplete like described on http://vim.wikia.com/wiki/C++_code_completion
" This offers intelligent C++ completion when typing ‘.’ ‘->’ or <C-o>
" Load standard tag files
set tags+=~/.vim/tags/cpp
set tags+=~/.vim/tags/gl
set tags+=~/.vim/tags/sdl
set tags+=~/.vim/tags/qt4
" Enhanced keyboard mappings
"
" in normal mode F2 will save the file
nmap <F2> :w<CR>
" in insert mode F2 will exit insert, save, enters insert again
imap <F2> <ESC>:w<CR>i
" goto definition with F3
map <F3> <C-]>
" switch between header/source with F4
map <F4> :vs %:p:s,.h$,.X123X,:s,.cpp$,.h,:s,.X123X$,.cpp,<CR>
" recreate tags file with F5
map <F5> :!ctags -R –c++-kinds=+p –fields=+iaS –extra=+q .<CR>
" build using make with <F7>
map <F7> :make<CR>
" build using makeprg with <S-F7>
map <S-F7> :make clean all<CR>
" space = page down
nmap <Space> <PageDown>
" cc for command prompt
nnoremap cc :
" yank to clipboard
map Y "+y
" use CTRL-S to toggle spell checker
nnoremap <C-s> :set invspell<CR>
inoremap <C-s> <ESC>:set invspell<CR>i
" ASM files
autocmd FileType asm setlocal shiftwidth=8 tabstop=8
" text files
autocmd FileType txt setlocal nowrap textwidth=0
autocmd FileType text setlocal nowrap textwidth=0
" Zig files
autocmd FileType zig setlocal expandtab
if has("gui_running")
set guifont=Inconsolata\ Medium\ 16
endif
set nospell