-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
135 lines (116 loc) · 2.36 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
" Minimal vimrc without plugins intended for root and remote systems
" Enable syntax highlighting and load indentation rules and plugins
syntax on
filetype plugin indent on
" Options
set nocompatible
set nomodeline
set showcmd
set showmatch
set wildmenu
set clipboard=unnamedplus
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set autoindent
set backspace=indent,eol,start
set ignorecase
set smartcase
set incsearch
set hlsearch
set splitbelow
set splitright
set background=dark
set encoding=utf8
set scrolloff=5
set wrap linebreak
set number relativenumber
set gdefault
" Statusline settings
set laststatus=2
set statusline+=\ %f
set statusline+=\ %m
set statusline+=\ %r
set statusline+=%=
set statusline+=\ \ %y
set statusline+=\ \ %{&fileencoding?&fileencoding:&encoding}
set statusline+=\ \ %l:%c
set statusline+=\ \ %p%%
set statusline+=\
hi StatusLine cterm=NONE ctermbg=237
" Use space as leader key
let mapleader="\<space>"
let maplocalleader="\<space>"
" The following keybindings are adapted to a modified VOU layout
" and mostly won't make sense on a default QWERTY/QWERTZ keyboard
" Joining, replacing and redo
nnoremap ö J
nnoremap ü r
vnoremap ü r
nnoremap ä <c-r>
" Switching to insert mode
nnoremap r i
nnoremap w A
nnoremap l o
nnoremap L O
vnoremap r I
vnoremap w A
" Navigating the jump list
nnoremap <c-k> <c-o>
nnoremap <c-m> <c-i>
" Changing the selection area
vnoremap l o
vnoremap L O
" Deleting last word using <C-BS>
noremap! <c-bs> <c-w>
noremap! <c-h> <c-w>
" Movement
nnoremap A b
nnoremap I w
nnoremap O <c-u>
nnoremap E <c-d>
nnoremap a h
nnoremap e gj
nnoremap o gk
nnoremap i l
vnoremap A b
vnoremap I w
vnoremap O <c-u>
vnoremap E <c-d>
vnoremap a h
vnoremap e gj
vnoremap o gk
vnoremap i l
" Macros
nnoremap Q q
" Saving and quitting
nnoremap <leader>s :update<cr>
nnoremap q :q<cr>
nnoremap <leader>q :qa<cr>
" Searching and substituting
nnoremap j /
nnoremap h *
nnoremap H :%s/
nnoremap <leader>j :noh<cr>
vnoremap j /
vnoremap h "hy/<c-r>h<cr>
vnoremap H :s/
" Jumping and command-line mode
nnoremap k '
nnoremap kk ''
nnoremap _ :
vnoremap k '
vnoremap kk ''
vnoremap _ :
" Yanking to end of line or the buffer
nnoremap Y y$
nnoremap <leader>y :%y<cr>
" Spell checking
nnoremap Z z=
nnoremap <leader>z :setlocal invspell<cr>
" Window management
nnoremap <c-a> <c-w>h
nnoremap <c-e> <c-w>j
nnoremap <c-o> <c-w>k
nnoremap <c-i> <c-w>l