-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
156 lines (127 loc) · 5.1 KB
/
Copy pathvimrc
File metadata and controls
156 lines (127 loc) · 5.1 KB
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
execute pathogen#infect()
se t_Co=256
"emmet
let g:user_emmet_install_global = 0
autocmd FileType html,css,php EmmetInstall
"airline plugin
"let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
let g:airline_theme='wombat'
set laststatus=2
autocmd BufNewFile,BufReadPost *.cpp,*.hpp let g:syntastic_cpp_compiler_options = ' -std=c++11 -stdlib=libc++ '
autocmd BufNewFile,BufReadPost *.c,*.h let g:syntastic_cpp_compiler_options = ' -std=c++11 -stdlib=libc++ '
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_symbols.space = "\ua0"
"let g:solarized_visibility = "low"
colorscheme solarized
set background=dark
set mouse=a "Obsługa myszki"
set wildmenu "rozwinięte podpowiedzi w commandmodzie"
set wildignore=*.o,*.obj,*.bak,*.exe "podowiedzi omijają takie regexy."
set showcmd "pokazuje komendy wydane w dolnym pasku"
set showmode "Pokazuj tryb w lewym dolnym rogu"
set nowrap "nie zawijaj wierszy wychodzących za ekran"
set showmatch "dopasowuj nawiasy"
set ruler "numer kolumny, wiersza, procent tekstu w prawym dolnym rogu"
set guioptions-=T
set incsearch "szukaj w trakcie pisania
set hlsearch "podświetlaj wyszukane wyniki
set ignorecase "ignoruj wielkość liter"
set smartcase "no chyba że wpiszesz dużą"
set tabstop=4 "konwersja taba na spacje"
set shiftwidth=4
set foldmethod=syntax
set number "wyświetlaj numery wierszy"
set relativenumber "relatywnie do pozycji kursora"
" setlocal spell spelllang=pl "sprawdzanie pisowni guzikami ]s [s. zg - słowo dobre, zb -słowo złe. z= dopasuj dobre słowo"
syntax enable "podświetlanie składni"
filetype plugin indent on "wcięcia"
:filetype indent on
" Autoformat cpp
" TODO
let g:formatprg_args_expr_cpp = '"--mode=cs --style=ansi --indent-namespaces -pcH".(&expandtab ? "s".&shiftwidth : "t")'
let g:formatprg_cpp = "astyle"
let g:formatprg_args_cpp = "--style=linux --indent=tab=8 -xcCKxwfxdp"
let g:formatprg_java = "astyle"
let g:formatprg_args_java = "--style=java --indent=tab=8"
map <C-f> :Autoformat<CR>
" vimdiff tylko prawolewy
set diffopt=vertical,filler
" Omnicompletion settings
set omnifunc=syntaxcomplete#Complete
" configure tags - add additional tags here or comment out not-used ones
set tags+=~/.vim/tags/cpp
set tags+=~/.vim/tags/gl
set tags+=~/.vim/tags/sdl
set tags+=~/.vim/tags/qt4
" Przysługa dla samego siebie - produktywność +10%
inoremap <Up> <NOP>
inoremap <Down> <NOP>
inoremap <Left> <NOP>
inoremap <Right> <NOP>
noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>
" fugitive git bindings
" nnoremap <space>gc :Gcommit -v -q<CR>
" nnoremap <space>gt :Gcommit -v -q %:p<CR>
" nnoremap <space>ge :Gedit<CR>
" nnoremap <space>gr :Gread<CR>
" nnoremap <space>gw :Gwrite<CR><CR>
" nnoremap <space>gp :Ggrep<Space>
" nnoremap <space>gm :Gmove<Space>
" nnoremap <space>gb :Git branch<Space>
" nnoremap <space>go :Git checkout<Space>
nnoremap <space>ga :Git add %:p<CR><CR>
nnoremap <space>gs :Gstatus<CR>
nnoremap <space>gc :Gcommit -v<CR>
nnoremap <space>gd :Gdiff<CR>
nnoremap <space>gps :!git push origin master<CR>
nnoremap <space>gpl :!git pull origin master<CR>
nnoremap <space>gl :!tig<CR>
" Wygeneruj tagi dla projektu
map <F11> :!ctags -R --sort=yes --c++-kinds=+pl --fields=+iaS --extra=+q <CR><CR>
let OmniCpp_NamespaceSearch = 1
let OmniCpp_GlobalScopeSearch = 1
let OmniCpp_ShowAccess = 1
let OmniCpp_ShowPrototypeInAbbr = 1 " show function parameters
let OmniCpp_MayCompleteDot = 1 " autocomplete after .
let OmniCpp_MayCompleteArrow = 1 " autocomplete after ->
let OmniCpp_MayCompleteScope = 1 " autocomplete after ::
let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]
" automatically open and close the popup menu / preview window
au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
" wykomentowane bo lagi
"set completeopt=menuone,menu,longest,preview
" make Enter select an entry when the popup menu is visible
:inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
" CtrlP plugin
" Setup some default ignores
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/](\.(git|hg|svn)|\_site)$',
\ 'file': '\v\.(exe|so|dll|class|png|jpg|jpeg)$',
\}
" Use the nearest .git directory as the cwd
" This makes a lot of sense if you are working on a project that is in version
" control. It also supports works with .svn, .hg, .bzr.
let g:ctrlp_working_path_mode = 'r'
" SQL Settings
if expand('%:t') =~ ".*\.sqlout"
endif
if expand('%:t') =~ ".*\.sql"
endif
map cn <esc>:cn<cr>
map cp <esc>:cp<cr>
map co <esc>:copen<cr>
nnoremap <Leader>s :%s/\<<C-r><C-w>\>//g<Left><Left>
autocmd BufNewFile,BufReadPost *.cpp,*.hpp map <F6> :w<CR> :!clear; <CR>:make all<CR> :redraw!<CR>
autocmd BufNewFile,BufReadPost *.cpp,*.hpp map <F7> :!clear; <CR> :make run<CR>
autocmd BufNewFile,BufReadPost *.sqlout set tabstop=30 set nowrap
autocmd BufNewFile,BufReadPost *.sql map <F6> :w<CR> :!mysql < % &> out.sqlout; ./parser.pl out.sqlout > out.refactored;<CR> :tabe out.refactored<CR>
"map <F2> :!rsync -auvr --exclude=".git" source target<CR>
map <F9> :GundoToggle<CR>
map <F10> :NERDTreeToggle<CR>
map <F12> :TagbarToggle<CR>