-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
66 lines (61 loc) · 1.79 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
"set termguicolors " if you want to run vim in a terminal
syntax on
colorscheme breezy2
set number
behave mswin
set mouse=a
set guioptions+=a
map <C-c> "+y
map <C-x> "+c
"vim-plug
"call plug#begin('~/.vim/plugged')
"Plug 'junegunn/goyo.vim'
" " Initialize plugin system
" call plug#end()
"Plugin for borders in vim
au BufNewFile,BufRead,BufEnter *.tex setlocal spell spelllang=de_de
set wrap
set linebreak
" mapping to make movements operate on 1 screen line in wrap mode
function! ScreenMovement(movement)
if &wrap && b:gmove == 'yes'
return "g" . a:movement
else
return a:movement
endif
endfunction
onoremap <silent> <expr> j ScreenMovement("j")
onoremap <silent> <expr> k ScreenMovement("k")
onoremap <silent> <expr> 0 ScreenMovement("0")
onoremap <silent> <expr> ^ ScreenMovement("^")
onoremap <silent> <expr> $ ScreenMovement("$")
nnoremap <silent> <expr> j ScreenMovement("j")
nnoremap <silent> <expr> k ScreenMovement("k")
nnoremap <silent> <expr> 0 ScreenMovement("0")
nnoremap <silent> <expr> ^ ScreenMovement("^")
nnoremap <silent> <expr> $ ScreenMovement("$")
vnoremap <silent> <expr> j ScreenMovement("j")
vnoremap <silent> <expr> k ScreenMovement("k")
vnoremap <silent> <expr> 0 ScreenMovement("0")
vnoremap <silent> <expr> ^ ScreenMovement("^")
vnoremap <silent> <expr> $ ScreenMovement("$")
vnoremap <silent> <expr> j ScreenMovement("j")
" toggle showbreak
function! TYShowBreak()
if &showbreak == ''
set showbreak=>
else
set showbreak=
endif
endfunction
let b:gmove = "yes"
function! TYToggleBreakMove()
if exists("b:gmove") && b:gmove == "yes"
let b:gmove = "no"
else
let b:gmove = "yes"
endif
endfunction
nmap <expr> ,b TYShowBreak()
nmap <expr> ,bb TYToggleBreakMove()
cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!