-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
100 lines (82 loc) · 2.93 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
"---------------------------------------------------------------------------
" MAP TRICKS
"disable arrow keys - cc Gagu
noremap <Up> :echo "YOU NOOB!"<cr>
noremap <Down> :echo "YOU NOOB!"<cr>
noremap <Left> :echo "YOU NOOB!"<cr>
noremap <Right> :echo "YOU NOOB!"<cr>
"---------------------------------------------------------------------------
" C/C++
set makeprg=g++\ -Wall\ -Wextra\ -Wconversion\ -o\ %<\ % "Compile .c files
"---------------------------------------------------------------------------
"---------------------------------------------------------------------------
" PYTHON
map !! :s/^\(\s*\)/\1#<CR>:nohlsearch<CR>
" " comment (current line or selected lines (in visual mode))
map -- :s/^\(\s*\)#/\1/<CR>:nohlsearch<CR>
" uncomment (current line or selected lines (in visual mode))
"---------------------------------------------------------------------------
set incsearch " Incremental search
set hlsearch
"set autowrite " Automatically save before commands like :next and :make
"set hidden " Hide buffers when they are abandoned
set mouse=a " Enable mouse usage (all modes)
set autoindent " Identation
set tabstop=4
set smarttab
set shiftwidth=4
set expandtab
set number
set cursorline
set cursorcolumn
set nowrap
map <Tab> :tabnext<CR>
map <S-Tab> :tabprevious<CR>
set completeopt=longest,menuone
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
execute pathogen#infect()
if isdirectory(expand($HOME . "/.vim/bundle/vim-colors-solarized/"))
if has('gui_running')
set background=light
else
set background=dark
endif
let g:solarized_termcolors=256
set t_Co=16
colorscheme solarized
endif
"Use TAB to complete when typing words, else inserts TABs as usual.
"Uses dictionary and source files to find matching words to complete.
"See help completion for source,
"Note-> usual completion is on <C-n> but more trouble to press all the time.
"Never type the same word twice and maybe learn a new spellings!
"Use the Linux dictionary when spelling is in doubt.
"Window users can copy the file to their machine.
function! Tab_Or_Complete()
if col('.')>1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^\w'
return "\<C-N>"
else
return "\<Tab>"
endif
endfunction
inoremap <Tab> <C-R>=Tab_Or_Complete()<CR>
set dictionary="/usr/dict/words"
"Fuzzy sile search
set runtimepath^=~/.vim/bundle/ctrlp.vim
" Configurações do vim-airline
if isdirectory(expand($HOME . "/.vim/bundle/vim-airline/"))
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
let g:airline_theme = "powerlineish"
set laststatus=2
endif
function! RemoveBlankSpaces()
silent! :%s/\s*$//g
silent! noh
endfunction
map <C-m> :call RemoveBlankSpaces()<CR>
" Powerline
set rtp+=$HOME/.local/lib/python2.7/site-packages/powerline/bindings/vim/
" Always show statusline
set laststatus=2
set runtimepath^=~/.vim/bundle/ctrlp.vim