-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrcl
105 lines (86 loc) · 2.45 KB
/
.vimrcl
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
" =============================================================================
" # Editor Settings
" =============================================================================
" some graphical stuff
syntax on
set autoread
set tabstop=4 softtabstop=4
set shiftwidth=4
set expandtab
set smartindent
set nu
set relativenumber
set nowrap
set smartcase
set noswapfile
set nobackup
set incsearch
set colorcolumn=80 "sets vertical line at 80 characters
set autowriteall "aut safe when changing buffers
"normal behavior of backspace
set backspace=indent,eol,start
" Sane splits
set splitright
set splitbelow
" Permanent undo
set undodir=~/.vimdid
set undofile
highlight ColorColumn ctermbg=0 guibg=lightgrey
"always show status line
set laststatus=2
" set updatetime to 100ms instead of default 4000ms -> affects git for example
set updatetime=100
" concno
nnoremap <C-o> <nop>
inoremap <C-o> <nop>
nnoremap <C-i> <nop>
inoremap <C-i> <nop>
" remap W to w, in case of wrong captial letter
:command W w
:command Q q
" =============================================================================
" # Remapping of Keys
" =============================================================================
" Ctrl+j and Ctrl+k as Esc -> Ctrl is mapped to caps lock via magnet/ ducky
" software
nnoremap <C-j> <Esc>
inoremap <C-j> <Esc>
vnoremap <C-j> <Esc>
snoremap <C-j> <Esc>
xnoremap <C-j> <Esc>
cnoremap <C-j> <C-c>
onoremap <C-j> <Esc>
lnoremap <C-j> <Esc>
tnoremap <C-j> <Esc>
nnoremap <C-k> <Esc>
inoremap <C-k> <Esc>
vnoremap <C-k> <Esc>
snoremap <C-k> <Esc>
xnoremap <C-k> <Esc>
cnoremap <C-k> <C-c>
onoremap <C-k> <Esc>
lnoremap <C-k> <Esc>
tnoremap <C-k> <Esc>
" No arrow keys --- force yourself to use the home row
nnoremap <up> <nop>
nnoremap <down> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
" =============================================================================
" # Some definitions for specific files
" =============================================================================
" Markdown
autocmd FileType markdown setlocal spell
"autocmd FileType markdown setlocal tw=80
" Latex
autocmd FileType tex setlocal spell
autocmd FileType tex setlocal tw=80
" C / C++
autocmd FileType cpp setlocal tabstop=2 softtabstop=2
autocmd FileType cpp setlocal shiftwidth=2
autocmd FileType c setlocal tabstop=2 softtabstop=2
autocmd FileType c setlocal shiftwidth=2
"auto delete trailing white spaces
autocmd BufWritePre * :%s/\s\+$//e