-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
62 lines (52 loc) · 1.17 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
filetype indent on
filetype plugin on
set incsearch
set hlsearch
set magic
set showmatch
set background=dark
set nobackup
set nowb
set nowrap
set noswapfile
set expandtab
set smarttab
set shiftwidth=4
set tabstop=4
set lbr
set tw=500
set si "Smart indent
map <leader>ss :setlocal spell!<cr>
inoremap <Nul> <C-n>
colorscheme ron
autocmd BufWinLeave *.* mkview
autocmd BufWinEnter *.* silent loadview
" Override w motion
function! MyWMotion()
" Save the initial position
let initialLine=line('.')
" Execute the builtin word motion and get the new position
normal! 5w
let newLine=line('.')
" If the line as changed go back to the previous line
if initialLine != newLine
normal k$
endif
endfunction
" Override b motion
function! MyBMotion()
" Save the initial position
let initialLine=line('.')
" Execute the builtin word motion and get the new position
normal! 5b
let newLine=line('.')
" If the line as changed go back to the previous line
if initialLine != newLine
normal j^
endif
endfunction
nnoremap c <c-v>
nnoremap W 7k
nnoremap S 7j
nnoremap A :call MyBMotion()<CR>
nnoremap D :call MyWMotion()<CR>