-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc.after
46 lines (35 loc) · 1.29 KB
/
.vimrc.after
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
set cursorline
highlight CursorLine term=bold cterm=bold ctermbg=235
set mouse=a
set relativenumber
" Allow saving of files as sudo when I forgot to start vim using sudo.
cmap w!! w !sudo tee > /dev/null %
nnoremap <A-up> :m .+1<CR>==
nnoremap <A-down> :m .-2<CR>==
inoremap <A-up> <Esc>:m .+1<CR>==gi
inoremap <A-down> <Esc>:m .-2<CR>==gi
vnoremap <A-up> :m '>+1<CR>gv=gv
vnoremap <A-down> :m '<-2<CR>gv=gv
" Xclip Copy Paste
" vmap <C-c> :!xclip -selection clipboard<CR>
" map <C-v> :-1r !xclip -o -sel clip<CR>
autocmd FileType python nnoremap <buffer> <F9> :exec '!clear;python' shellescape(@%, 1)<cr>
autocmd FileType matlab nnoremap <buffer> <F9> :exec '!clear;matlab' shellescape(@%, 1)<cr>
autocmd FileType cpp nnoremap <buffer> <F9> :!g++ -std=c++11 % -o /tmp/%.out && /tmp/%.out<cr>
" augroup autocom
" autocmd!
" "executes the command on quit
" autocmd VimLeave ~/.abbreviations/commands.conf !abbreivate_source.py
"
" "execute the command on write
" autocmd BufWritePost,FileWritePost ~/.abbreviations/commands.conf !abbreviate_source.py
" augroup END
let &t_SI = "\e[5 q"
let &t_EI = "\e[2 q"
" optional reset cursor on start:
augroup myCmds
au!
autocmd VimEnter * silent !echo -ne "\e[2 q"
autocmd VimLeave * silent !echo -ne "\e[5 q"
augroup END
autocmd! VimEnter * wincmd w