-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
86 lines (63 loc) · 1.85 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
set number
set smartindent
set tabstop=4
set shiftwidth=4
set softtabstop=4
nmap <C-t> :tabnew<CR>
nmap <C-n> :tabnext<CR>
nmap <C-p> :tabprevious<CR>
nmap <C-.> :tabnew .<CR>
nmap <C-,> :tabprevious<CR>
syntax on
filetype indent plugin on
set background=dark
set colorcolumn=+1
autocmd ColorScheme * highlight ColorColumn ctermbg=yellow guibg=lightyellow
"Configuracao para usar xclip diretamente no vim
"% pega o caminho completo do arquivo.
"alias cbcf='vim `cat %:p | cb`'
nmap <C-F7> :!cat '%:p' <bar> xclip -sel clip <bar> echo Text has been copied to clipboard<CR>
autocmd FileType c,cpp,ruby,python autocmd BufWritePre <buffer> :%s/\s\+$//e
"!gnome-session-quit --no-prompt
"au BufRead .bashrc :call EditConfig()
"au BufRead .vimrc :call EditConfig()
"au BufRead .bash_profile :call EditConfig()
"function! EditConfig()
" if exists("g:gwp")
" unlet g:gwp
" else
" !cinnamon-session-quit --no-prompt
" endif
"endfunction
imap <F9> <Esc>:!clear && make -f '%:p:h/Makefile'<CR>
"Configuração para sitaxe highlight de programas em vala
"so $HOME/.vim/myuser/valaconfigurations.vim
"Open Browser
command -buffer BrowserFile !iceweasel '%:p'
command -buffer Save w !sudo tee '%:p'
"Highlight of all matches
function! HighlightMatch()
if exists("s:highlight_on")
unlet s:highlight_on
set nohlsearch
else
set hlsearch
let s:highlight_on = 1
endif
endfunction
if executable("ag")
set grepprg=ag\ --nogroup\ --nocolor\ --ignore-case\ --column
set grepformat=%f:%l:%c:%m,%f:%l:%m
endif
set incsearch
nmap :call HighlightMatch() <CR>
"Enable dictionary
set dictionary+=/usr/share/dict/words
"Disable paste mode when leaving Insert Mode
au InsertLeave * set nopaste
"Show Git diff in window split when commiting
autocmd FileType gitcommit DiffGitCached | wincmd p
"A more handy Esc
inoremap jj <Esc>
"Abbreviations
ab aab Alexandre Almeida Barbosa