-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathathamerc
67 lines (58 loc) · 2.07 KB
/
athamerc
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
" WARNING: By default /etc/athamerc will get rewritten on updates. You should
" create a ~/.athamerc that sources this file and make changes there.
"
" /etc/athamerc is only read if no ~/.athamerc is found
"
" If you don't want /etc/athamerc overidden, supply the --norc flag to the setup
" script.
set nocompatible
set ttimeoutlen=10 "Otherwise, you have to wait for the escape key.
set backspace-=eol "For more traditional shell behavior
set backspace+=start "Without this, you can't delete shell completions
set textwidth=0 "Don't try to wrap text
"Start each line in insert mode. Most shell vi-modes do this:
autocmd User Vimbed_StartLine call feedkeys("\<C-\>\<C-N>i","n")
" These make arrows more shell like. Feel free to comment them out:
if v:version>=800 || has("patch928")
" These maps can segfault in earlier vim versions.
inoremap <Up> <Up><ESC>A
inoremap <Down> <Down><ESC>A
endif
" Uncomment these maps to have the up and down arrow
" only match lines that share text before cursor
" (Similar to how arrows work for vim ex expressions)
"
"inoremap <Up> <C-\><C-O>:silent call HistorySearchBackward()<CR>
"inoremap <Down> <C-\><C-O>:silent call HistorySearchForward()<CR>
"nnoremap <Up> :silent call HistorySearchBackward()<CR>
"nnoremap <Down> :silent call HistorySearchForward()<CR>
"Similar to bash's history-search-backward.
function! HistorySearchBackward()
let curcol = col('.')
if curcol > 1
let searchText = getline('.')[0:curcol - 2]
for line in range(line('.') - 1, 1, -1)
if getline(line)[0:curcol - 2] == searchText
call cursor(line, curcol)
break
endif
endfor
elseif line('.') > 1
call cursor(line('.') - 1, 1)
endif
endfunction
"Similar to bash's history-search-forward.
function! HistorySearchForward()
let curcol = col('.')
if curcol > 1
let searchText = getline('.')[0:curcol - 2]
for line in range(line('.') + 1, line('$'))
if getline(line)[0:curcol - 2] == searchText
call cursor(line, curcol)
break
endif
endfor
else
call cursor(line('.') + 1, 1)
endif
endfunction