-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
114 lines (96 loc) · 2.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
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
set guicursor=a:blinkon0
"colorscheme murphy
colorscheme elflord
set hlsearch
set autoindent
set tabstop=4
set shiftwidth=4
set whichwrap=h,l,[,]
set backspace=2
set showcmd
set scrolloff=17
set expandtab
syntax on
" % får gärna tro på <> oxo
"set matchpairs+=<:>
" Använd syntax highlighting för att se skillnad på tab och space.
" även saker förbi tkn80 och mellanslag sist på rader.
" Av ngn anledning får Over80 alltid prioritet över EndSpace.
" (Varför är dom ens exklusiva?)
syn match Tab "\t"
"syn match Over80 /\%81v.*/
syn match EndSpace / *$/
hi def Tab ctermbg=darkblue guibg=#000060
hi def Over80 ctermfg=yellow guifg=#ffffcc
hi def EndSpace ctermbg=blue guibg=#0000ff
" Kopiera indentering exakt. (Default ersätter space med tab "när det går", vilket oftast är fel.
set copyindent
set viminfo='100,\"1000,:200,%,n~/.viminfo
function! ResCur()
if line("'\"") <= line("$")
normal! g`"
return 1
endif
endfunction
augroup resCur
autocmd!
autocmd BufWinEnter * call ResCur()
augroup END
" Change buffer using alt + arrow
nmap <esc>[1;3A <C-w><esc>OA
nmap <esc>[1;3B <C-w><esc>OB
nmap <esc>[1;3C <C-w><esc>OC
nmap <esc>[1;3D <C-w><esc>OD
" Change buffer using alt + arrow while in insert mode
imap <esc>[1;3A <C-O><C-w><esc>OA
imap <esc>[1;3B <C-O><C-w><esc>OB
imap <esc>[1;3C <C-O><C-w><esc>OC
imap <esc>[1;3D <C-O><C-w><esc>OD
nmap <esc>[c $
nmap <esc>[d 0
imap <esc>[c <C-O>$
imap <esc>[d <C-O>0
nmap <esc>[1;5C w
nmap <esc>[1;5D b
imap <esc>[1;5C <C-O>w
imap <esc>[1;5D <C-O>b
nmap <esc>Oc w
nmap <esc>Od b
imap <esc>Oc <C-O>w
imap <esc>Od <C-O>b
nmap <esc>[1;4C / <CR>
nmap <esc>[1;4D ? <CR>
nmap <esc>[1;8C / <CR>
nmap <esc>[1;8D ? <CR>
imap <esc>[1;4C <C-O>/ <CR>
imap <esc>[1;4D <C-O>? <CR>
imap <esc>[1;8C <C-O>/ <CR>
imap <esc>[1;8D <C-O>? <CR>
nmap <esc><esc>[c / <CR>
nmap <esc><esc>[d ? <CR>
imap <esc><esc>[c <C-O>/ <CR>
imap <esc><esc>[d <C-O>? <CR>
" inoremap ( ()<Left>
" inoremap <expr> ) strpart(getline('.'), col('.')-1, 1) == ")" ? "\<Right>" : ")"
"
" inoremap { {}<Left>
" inoremap <expr> } strpart(getline('.'), col('.')-1, 1) == "}" ? "\<Right>" : "}"
"
" inoremap [ []<Left>
" inoremap <expr> ] strpart(getline('.'), col('.')-1, 1) == "]" ? "\<Right>" : "]"
"
" inoremap [ []<Left>
" inoremap <expr> ] strpart(getline('.'), col('.')-1, 1) == "]" ? "\<Right>" : "]"
"
" inoremap < <><Left>
" inoremap <expr> > strpart(getline('.'), col('.')-1, 1) == ">" ? "\<Right>" : ">"
nmap <tab> gt
autocmd BufEnter *.rb source ~/.vim/rb.vim
autocmd BufEnter *.sql source ~/.vim/sql.vim
autocmd BufEnter *.rhtml source ~/.vim/rhtml.vim
autocmd BufEnter *.scss source ~/.vim/scss.vim
autocmd BufEnter *.php source ~/.vim/php.vim
:command Wq %s/\s\+$//e | wq
:command WQ %s/\s\+$//e | wq
:command W %s/\s\+$//e | w
:command Q q