Skip to content

Commit df4c75e

Browse files
committed
update
1 parent b3badc3 commit df4c75e

File tree

2 files changed

+6
-229
lines changed

2 files changed

+6
-229
lines changed

rcs/vimrc

+6-229
Original file line numberDiff line numberDiff line change
@@ -1,194 +1,28 @@
1-
set nocompatible
2-
31
filetype plugin indent on
42

53
syntax on
6-
" @vundle {{{
7-
set rtp+=~/.vim/bundle/Vundle.vim
8-
call vundle#begin()
9-
Plugin 'dense-analysis/ale'
10-
Plugin 'airblade/vim-gitgutter'
11-
Plugin 'tpope/vim-commentary'
12-
Plugin 'godlygeek/tabular'
13-
Plugin 'plasticboy/vim-markdown'
14-
Plugin 'iamcco/mathjax-support-for-mkdp'
15-
Plugin 'iamcco/markdown-preview.vim'
16-
Plugin 'VundleVim/Vundle.vim'
17-
Plugin 'scrooloose/nerdtree'
18-
Plugin 'majutsushi/tagbar'
19-
Plugin 'vim-airline/vim-airline'
20-
Plugin 'ctrlpvim/ctrlp.vim'
21-
Plugin 'junegunn/fzf.vim'
22-
Plugin 'honza/vim-snippets'
23-
Plugin 'SirVer/ultisnips'
24-
Bundle 'Valloric/YouCompleteMe'
25-
call vundle#end()
26-
" }}}
27-
28-
" @fzf {{{
29-
set rtp+=~/.fzf
30-
" }}}
31-
32-
" @ctrlp{{{
33-
" show recently opened files
34-
set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux"
35-
let g:ctrlp_custom_ignore = {
36-
\ 'dir': '\v[\/]\.(git|hg|svn|rvm)$',
37-
\ 'file': '\v\.(exe|so|dll|zip|tar|tar.gz)$',
38-
\ }
39-
let g:ctrlp_working_path_mode=0
40-
let g:ctrlp_match_window_bottom=1
41-
let g:ctrlp_max_height=15
42-
let g:ctrlp_match_window_reversed=0
43-
let g:ctrlp_mruf_max=500
44-
let g:ctrlp_follow_symlinks=1
45-
"}}}
46-
47-
" @nerdtree {{{
48-
let NERDTreeShowLineNumbers=1
49-
let NERDTreeAutoCenter=1
50-
let NERDTreeIgnore=['\.pyc', '\~$', '\.swp']
51-
52-
" open NERDTree automatically when vim starts up with no file specified
53-
autocmd StdinReadPre * let s:std_in=1
54-
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
55-
56-
" open NERDTree automatically when vim starts up on opening a directory
57-
autocmd StdinReadPre * let s:std_in=1
58-
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif
59-
60-
" close vim if the only window left open is a NERDTree
61-
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
62-
" }}}
63-
64-
" @youcompleteme {{{
65-
let g:ycm_auto_trigger=1
66-
let g:ycm_add_preview_to_completeopt=1
67-
let g:ycm_min_num_of_chars_for_completion=2
68-
let g:ycm_autoclose_preview_window_after_insertion=1
69-
let g:ycm_autoclose_preview_window_after_completion=0
70-
let g:ycm_global_ycm_extra_conf='~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
71-
72-
let g:ycm_semantic_triggers = {
73-
\ 'c': ['->', '.', 're![a-zA-Z][a-zA-Z0-9]'],
74-
\ 'objc': ['->', '.', 're!\[[_a-zA-Z]+\w*\s', 're!^\s*[^\W\d]\w*\s',
75-
\ 're!\[.*\]\s'],
76-
\ 'ocaml': ['.', '#'],
77-
\ 'cpp,cuda,objcpp': ['->', '.', '::', 're![a-zA-Z][a-zA-Z0-9]'],
78-
\ 'perl': ['->'],
79-
\ 'php': ['->', '::'],
80-
\ 'cs,d,elixir,go,groovy,java,javascript,julia,perl6,python,scala,typescript,vb': ['.'],
81-
\ 'ruby,rust': ['.', '::'],
82-
\ 'lua': ['.', ':'],
83-
\ 'erlang': [':'],
84-
\ }
85-
let g:ycm_use_clangd = 0
86-
let g:ycm_error_symbol = '>>'
87-
let g:ycm_warning_symbol = '>>'
88-
let g:ycm_enable_diagnostic_signs = 1
89-
let g:ycm_enable_diagnostic_highlighting = 1
90-
" highlight YcmErrorLine guibg=#3fff00
91-
" highlight YcmErrorSection guibg=#3fff00
92-
" hi ErrorMsg term=standout ctermbg=DarkRed ctermfg=White guibg=Red guifg=White
93-
" highlight YcmErrorSign term=standout guibg=#ff0000
944

95-
nnoremap ga :YcmCompleter GoToDefinitionElseDeclaration<CR>
96-
nnoremap gs :YcmCompleter GoToDeclaration<CR>
97-
nnoremap gd :YcmCompleter GetDoc<CR>
98-
nnoremap gf :YcmCompleter FixIt<CR>
99-
nnoremap gz :YcmCompleter GoToInclude<CR>
100-
" }}}
101-
102-
" @ultisnips {{{
103-
" Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
104-
let g:UltiSnipsExpandTrigger="<c-f>"
105-
let g:UltiSnipsJumpForwardTrigger="<c-j>"
106-
let g:UltiSnipsJumpBackwardTrigger="<c-k>"
107-
set runtimepath+=~/.vim/my-snippets
108-
109-
" If you want :UltiSnipsEdit to split your window.
110-
let g:UltiSnipsEditSplit="vertical"
111-
" }}}
112-
113-
" @airline{{{
114-
let g:airline_section_b = '%{strftime("%Y/%m/%d %H:%M:%S")}'
115-
let g:airline#extensions#tabline#enabled=1
116-
let g:airline#extensions#tabline#show_tab_nr=1
117-
let g:airline#extensions#tabline#tab_nr_type=1
118-
" }}}
119-
120-
" @airline {{{
121-
let g:airline_section_b = '%{strftime("%Y/%m/%d %H:%M:%S")}'
122-
"}}}
123-
124-
" @git {{{
125-
let g:gitgutter_max_signs = 500
126-
highlight GitGutterAdd guifg=#44ff44 ctermfg=2
127-
highlight GitGutterChange guifg=#bbbb00 ctermfg=3
128-
highlight GitGutterDelete guifg=#ff2222 ctermfg=1
129-
" }}}
130-
" @ale {{{
131-
let g:ale_completion_enabled = 1
132-
let g:ale_sign_column_always = 1
133-
" let g:ale_set_highlights = 0
134-
highlight clear ALEErrorSign
135-
highlight clear ALEWarningSign
136-
highlight ALEWarningSign ctermfg=166
137-
highlight ALEWarning ctermfg=166 cterm=underline,bold
138-
highlight ALEErrorSign ctermfg=1
139-
highlight ALEError ctermfg=1 cterm=underline,bold
140-
141-
let g:ale_linters= {
142-
\ 'python': ['pylint'],
143-
\}
144-
let g:ale_python_pylint_options = ''
145-
146-
let g:ale_sign_error = 'xx'
147-
let g:ale_sign_warning = '>>'
148-
let g:airline#extensions#ale#enabled = 1
149-
150-
let g:ale_echo_msg_error_str = 'E'
151-
let g:ale_echo_msg_warning_str = 'W'
152-
let g:ale_echo_msg_format = '[%linter%] [%severity%] %s '
153-
" }}}
154-
155-
" @vimset {{{
156-
syntax on
5+
let line='normal'
1576

158-
au BufNewFile,BufRead string,map,set,unordered_map,unordered_set,vector,deque,queue,list,algorithm,stack setf cpp
7+
set rtp+=~/.fzf
1598

160-
let line='normal'
9+
set nocompatible
16110
set number
162-
16311
set expandtab
164-
set sts=4 sw=4 ts=4
165-
autocmd FileType html set sts=2 sw=2 ts=2
166-
autocmd FileType javascript set sts=2 sw=2 ts=2
167-
12+
set sts=2 sw=2 ts=2
16813
set colorcolumn=81
169-
highlight ColorColumn ctermbg=gray
170-
171-
172-
" @serach
17314
set hls
17415
set incsearch
17516
set ignorecase
176-
17717
set fileencodings=utf-8,gb2312,gbk,gb18030
178-
179-
" @folder
18018
set foldcolumn=4
18119
set foldenable
18220
set foldlevel=100
18321
set foldmethod=marker
184-
18522
set showcmd
186-
187-
" @mouse
18823
set mouse=a
18924
set selection=exclusive
19025
set selectmode=mouse,key
191-
19226
set title
19327
set backupcopy=yes
19428
set backspace=indent,eol,start
@@ -199,68 +33,11 @@ set nobackup
19933
set pastetoggle=``
20034
set shortmess=atl
20135
set ttyfast
202-
" }}}
20336

204-
" @shortcut {{{
37+
highlight ColorColumn ctermbg=gray
38+
20539
:command W w
20640
:command WQ wq
20741
:command Wq wq
20842
:command Q q
20943

210-
nmap <F2> :call TurnOnGit()<CR>
211-
nmap <F3> :call SwitchNum()<CR>
212-
nmap <F4> :Commentary<CR>
213-
nmap <F5> :NERDTreeToggle<CR>
214-
nmap <F6> :TagbarToggle<CR>
215-
216-
map <F9> : call Compile()<CR>
217-
map <F10> : call Run()<CR>
218-
219-
nmap <s-tab> <<
220-
nmap <tab> >>
221-
" }}}
222-
223-
let g:githighlight=0
224-
function TurnOnGit() " {{{
225-
if g:githighlight == 0
226-
exec 'GitGutterLineHighlightsEnable'
227-
let g:githighlight = 1
228-
else
229-
exec 'GitGutterLineHighlightsDisable'
230-
let g:githighlight = 0
231-
endif
232-
endfunction
233-
" }}}
234-
function SwitchNum() " {{{
235-
if &rnu == 1
236-
exec ':set nornu'
237-
else
238-
exec ':set rnu'
239-
endif
240-
endfunc
241-
" }}}
242-
243-
function Compile() " {{{
244-
exec "w"
245-
if &filetype == "c" || &filetype == "h"
246-
exec ":! clear; gcc % -o %:r -Wall; if [ $? = 0 ]; then echo '\033[1;32;m[SUC] Compile Succeed..\033[0m'; else echo '\033[1;31;m[ERR] Compile Error..\033[0m'; fi;"
247-
elseif &filetype == "cpp" || &filetype == "hpp"
248-
exec ":! clear; g++ % -o %:r -Wall; if [ $? = 0 ]; then echo '\033[1;32;m[SUC] Compile Succeed..\033[0m'; else echo '\033[1;31;m[ERR] Compile Error..\033[0m'; fi;"
249-
elseif &filetype == "python"
250-
exec ":! clear; python3 %"
251-
elseif &filetype == "sh"
252-
exec ":! chmod +x %"
253-
endif
254-
endfunction
255-
" }}}
256-
257-
function Run() " {{{
258-
if &filetype == "cpp" || &filetype == "c"
259-
exec ":! clear; ./%:r;"
260-
elseif &filetype == "sh"
261-
exec ":! clear; ./%"
262-
elseif &filetype == "python"
263-
exec ":! clear; python3 %"
264-
endif
265-
endfunction
266-
" }}}

optional.sh win_ubuntu.sh

File renamed without changes.

0 commit comments

Comments
 (0)