Skip to content

Commit 623b5e5

Browse files
committed
add pull request spf13#1099 spf13#1092
1 parent 1e2e818 commit 623b5e5

File tree

6 files changed

+252
-10
lines changed

6 files changed

+252
-10
lines changed

.vimrc

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
" Modeline and Notes {
2-
" vim: set sw=4 ts=4 sts=4 et tw=78 foldmarker={,} foldlevel=0 foldmethod=marker spell:
2+
" vim: set sw=4 ts=4 sts=4 et tw=78 foldmarker={,} foldlevel=9 foldmethod=marker spell:
33
"
44
" __ _ _____ _
55
" ___ _ __ / _/ |___ / __ __(_)_ __ ___
@@ -205,7 +205,7 @@
205205
set laststatus=2
206206

207207
" Broken down into easily includeable segments
208-
set statusline=%<%f\ " Filename
208+
set statusline=%<%F\ " Filename,%f->%F
209209
set statusline+=%w%h%m%r " Options
210210
if !exists('g:override_spf13_bundles')
211211
set statusline+=%{fugitive#statusline()} " Git Hotness
@@ -229,7 +229,8 @@
229229
set whichwrap=b,s,h,l,<,>,[,] " Backspace and cursor keys wrap too
230230
set scrolljump=5 " Lines to scroll when cursor leaves screen
231231
set scrolloff=3 " Minimum lines to keep above and below cursor
232-
set foldenable " Auto fold code
232+
"set foldenable " Auto fold code
233+
set nofoldenable " Auto fold code
233234
set list
234235
set listchars=tab:›\ ,trail:•,extends:#,nbsp:. " Highlight problematic whitespace
235236

@@ -370,7 +371,11 @@
370371
if !exists('g:spf13_no_keyfixes')
371372
if has("user_commands")
372373
command! -bang -nargs=* -complete=file E e<bang> <args>
373-
command! -bang -nargs=* -complete=file W w<bang> <args>
374+
"command! -bang -nargs=* -complete=file W w<bang> <args>
375+
"
376+
" Sample command W
377+
"
378+
command W :execute ':silent w !sudo tee % > /dev/null' | :edit!
374379
command! -bang -nargs=* -complete=file Wq wq<bang> <args>
375380
command! -bang -nargs=* -complete=file WQ wq<bang> <args>
376381
command! -bang Wa wa<bang>
@@ -581,7 +586,10 @@
581586
let NERDTreeShowBookmarks=1
582587
let NERDTreeIgnore=['\.py[cd]$', '\~$', '\.swo$', '\.swp$', '^\.git$', '^\.hg$', '^\.svn$', '\.bzr$']
583588
let NERDTreeChDirMode=0
584-
let NERDTreeQuitOnOpen=1
589+
"let NERDTreeQuitOnOpen=1
590+
" Notice: If let it =1, the tree will auto close after the file
591+
" open
592+
let NERDTreeQuitOnOpen=0
585593
let NERDTreeMouseMode=2
586594
let NERDTreeShowHidden=1
587595
let NERDTreeKeepTreeInNewTab=1

.vimrc.bundles

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
" Modeline and Notes {
2-
" vim: set sw=4 ts=4 sts=4 et tw=78 foldmarker={,} foldlevel=0 foldmethod=marker spell:
2+
" vim: set sw=4 ts=4 sts=4 et tw=78 foldmarker={,} foldlevel=9 foldmethod=marker spell:
33
"
44
" __ _ _____ _
55
" ___ _ __ / _/ |___ / __ __(_)_ __ ___
@@ -102,6 +102,7 @@
102102
" General {
103103
if count(g:spf13_bundle_groups, 'general')
104104
Bundle 'scrooloose/nerdtree'
105+
Bundle 'Xuyuanp/nerdtree-git-plugin'
105106
Bundle 'altercation/vim-colors-solarized'
106107
Bundle 'spf13/vim-colors'
107108
Bundle 'tpope/vim-surround'
@@ -124,7 +125,7 @@
124125
Bundle 'powerline/fonts'
125126
Bundle 'bling/vim-bufferline'
126127
Bundle 'easymotion/vim-easymotion'
127-
Bundle 'jistr/vim-nerdtree-tabs'
128+
"Bundle 'jistr/vim-nerdtree-tabs'
128129
Bundle 'flazz/vim-colorschemes'
129130
Bundle 'mbbill/undotree'
130131
Bundle 'nathanaelkane/vim-indent-guides'
@@ -202,7 +203,8 @@
202203
" Python {
203204
if count(g:spf13_bundle_groups, 'python')
204205
" Pick either python-mode or pyflakes & pydoc
205-
Bundle 'klen/python-mode'
206+
"Bundle 'klen/python-mode'
207+
Bundle 'python-mode/python-mode'
206208
Bundle 'yssource/python.vim'
207209
Bundle 'python_match.vim'
208210
Bundle 'pythoncomplete'
@@ -244,7 +246,8 @@
244246

245247
" HTML {
246248
if count(g:spf13_bundle_groups, 'html')
247-
Bundle 'vim-scripts/HTML-AutoCloseTag'
249+
"Bundle 'heracek/HTML-AutoCloseTag'
250+
Bundle 'vim-scripts/HTML-AutoCloseTag'
248251
Bundle 'hail2u/vim-css3-syntax'
249252
Bundle 'gorodinskiy/vim-coloresque'
250253
Bundle 'tpope/vim-haml'

.vimrc.bundles.local

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
" Modeline and Notes {
2+
" vim: set sw=4 ts=4 sts=4 et tw=78 foldmarker={,} foldlevel=0 foldmethod=marker spell:
3+
"
4+
" __ _ _____ _
5+
" ___ _ __ / _/ |___ / __ __(_)_ __ ___
6+
" / __| '_ \| |_| | |_ \ _____\ \ / /| | '_ ` _ \
7+
" \__ \ |_) | _| |___) |_____|\ V / | | | | | | |
8+
" |___/ .__/|_| |_|____/ \_/ |_|_| |_| |_|
9+
" |_|
10+
"
11+
" This is the personal .vimrc.bundles file of Steve Francia.
12+
" While much of it is beneficial for general use, I would
13+
" recommend picking out the parts you want and understand.
14+
"
15+
" This file imports the various plugins of spf13. If you
16+
" wish to alter which groups are imported, see vimrc.before.
17+
" If you wish to add or remove individual bundles, create
18+
" ~/.vimrc.bundles.local and `Bundle` or `UnBundle` as needed
19+
" from there.
20+
"
21+
" You can find me at http://spf13.com
22+
" }
23+
24+
" Bundle 'file://~/.vim/bundle/cscope_map.vim'
25+
" Bundle 'file://~/.vim/bundle/goyo.vim'
26+
Bundle 'junegunn/goyo.vim'
27+
Bundle 'chazy/cscope_maps'
28+
"Bundle 'file://~/.vim/bundle/bufexplorer'
29+
"Repeat with the vimrc.bundles
30+
"Bundle 'The-NERD-Commenter'
31+
32+
" <leader>k/K is nice
33+
Bundle 'lfv89/vim-interestingwords'
34+
Bundle 'itchyny/vim-cursorword'
35+
36+
" Bundle 'file://~/.vim/bundle/gutentags_plus'
37+
Bundle 'yaoyz-yuneec/gutentags_plus'
38+
Bundle 'ludovicchabant/vim-gutentags'
39+
Bundle 'sainnhe/vim-color-forest-night'
40+
Bundle 'isene/hyperlist.vim'
41+
Bundle 'voldikss/vim-translate-me'

.vimrc.local

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
" 关闭NERDTree快捷键
2+
" map <leader>t :NERDTreeToggle<CR>
3+
" 显示行号
4+
let NERDTreeShowLineNumbers=1
5+
let NERDTreeAutoCenter=1
6+
" 是否显示隐藏文件
7+
let NERDTreeShowHidden=1
8+
" 设置宽度
9+
let NERDTreeWinSize=31
10+
" 在终端启动vim时,共享NERDTree
11+
let g:nerdtree_tabs_open_on_console_startup=1
12+
" 忽略一下文件的显示
13+
let NERDTreeIgnore=['\.pyc','\~$','\.swp']
14+
" 显示书签列表
15+
let NERDTreeShowBookmarks=1
16+
17+
let g:NERDTreeIndicatorMapCustom = {
18+
\ "Modified" : "?",
19+
\ "Staged" : "?",
20+
\ "Untracked" : "?",
21+
\ "Renamed" : "?",
22+
\ "Unmerged" : "═",
23+
\ "Deleted" : "?",
24+
\ "Dirty" : "?",
25+
\ "Clean" : "??",
26+
\ "Unknown" : "?"
27+
\ }
28+
" Show the line number
29+
set nu
30+
" Enable wrap
31+
set wrap
32+
" Auto open NERDTree when enter vim
33+
" Use vim, not vim ./dir
34+
autocmd vimenter * NERDTree
35+
" NERDTree config
36+
map <silent><F2> :NERDTreeToggle<CR>
37+
imap <F2> <ESC> :NERDTreeToggle<CR>
38+
"Use the pre dir tree
39+
"nmap <F2> :NERDTreeToggle<CR> :NERDTreeMirror<CR>
40+
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") &&b:NERDTreeType == "primary") | q | endif
41+
42+
43+
"安装tagbar插件
44+
""设置tagbar使用的ctags的插件,必须要设置对
45+
let g:tagbar_ctags_bin='/usr/bin/ctags'
46+
"设置tagbar的窗口宽度
47+
"let g:tagbar_width=30
48+
""设置tagbar的窗口显示的位置,为左边
49+
let g:tagbar_right=1
50+
"打开文件自动 打开tagbar
51+
"autocmd BufReadPost *.cpp,*.c,*.h,*.hpp,*.cc,*.cxx call tagbar#autoopen()
52+
let Tlist_Show_One_File=1
53+
let Tlist_OnlyWindow=1
54+
let Tlist_Use_Right_Window=1
55+
let Tlist_Sort_Type='name'
56+
let Tlist_Exit_OnlyWindow=1
57+
let Tlist_Show_Menu=1
58+
let Tlist_Max_Submenu_Items=10
59+
let Tlist_Max_Tag_length=20
60+
let Tlist_Use_SingleClick=0
61+
let Tlist_Auto_Open=0
62+
let Tlist_Close_On_Select=0
63+
let Tlist_File_Fold_Auto_Close=1
64+
let Tlist_GainFocus_On_ToggleOpen=1
65+
let Tlist_Process_File_Always=1
66+
let Tlist_WinHeight=10
67+
let Tlist_WinWidth=30
68+
let Tlist_Use_Horiz_Window=0
69+
map <silent><F3> :TagbarToggle<CR>
70+
imap <F3> <ESC> :TagbarToggle<CR>
71+
autocmd StdinReadPre * let s:std_in=1
72+
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif
73+
colorschem murphy
74+
"In normal mode, ; is equal to :
75+
nmap ; :
76+
77+
" Buf explore
78+
nnoremap <silent> <leader>f :CtrlPMRU<CR>
79+
80+
" airline statusline etc.
81+
let g:airline#extensions#tabline#enabled = 1
82+
let g:airline#extensions#tabline#formatter = 'unique_tail_improved'
83+
84+
85+
" Close the current buffer
86+
map <leader>bd :Bclose<cr>:tabclose<cr>gT
87+
88+
" Close all the buffers
89+
map <leader>ba :bufdo bd<cr>
90+
91+
map <leader>l :bnext<cr>
92+
map <leader>h :bprevious<cr>
93+
94+
" Useful mappings for managing tabs
95+
map <leader>tn :tabnew<cr>
96+
map <leader>to :tabonly<cr>
97+
map <leader>tc :tabclose<cr>
98+
map <leader>tm :tabmove
99+
map <leader>t<leader> :tabnext
100+
101+
" Let 'tl' toggle between this and the last accessed tab
102+
let g:lasttab = 1
103+
nmap <Leader>tl :exe "tabn ".g:lasttab<CR>
104+
au TabLeave * let g:lasttab = tabpagenr()
105+
106+
""""""""""""""""""""""""""""""
107+
" => bufExplorer plugin
108+
""""""""""""""""""""""""""""""
109+
" Disalbe the bufExplorer, Because it conflict with many other vim plugs
110+
" When enable it often pop the warning as follow:
111+
" Error detected while processing function <SNR>49_BEActivateBuffer:
112+
" line 18:
113+
" E684: list index out of range: 2
114+
" This will disable the bufExplorer
115+
let g:bufexplorer_version = "disabled"
116+
let g:bufExplorerDefaultHelp=0
117+
let g:bufExplorerShowRelativePath=1
118+
let g:bufExplorerFindActive=1
119+
let g:bufExplorerSortBy='name'
120+
"map <leader>o :BufExplorer<cr>
121+
122+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
123+
" => Vimroom
124+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
125+
let g:goyo_width=100
126+
let g:goyo_margin_top = 2
127+
let g:goyo_margin_bottom = 2
128+
nnoremap <silent> <leader>z :Goyo<cr>
129+
130+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
131+
" => Global copy/paste
132+
" Use the global clipbord by install vim-gnome
133+
" See: https://www.cnblogs.com/songlen/p/6883522.html
134+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
135+
set clipboard=unnamedplus
136+
137+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
138+
" => cscope quickfix
139+
"See:
140+
" https://stackoverflow.com/questions/28185067/vim-go-to-next-search-result-across-multiple-files
141+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
142+
" Replaced by the gutentags_plus plug@2019-08-02
143+
" set cscopequickfix=s-,c-,d-,i-,t-,e-
144+
145+
" view the list of matches with:
146+
" :cw[indow] Open the quickfix window
147+
map <silent><F5> :cw<CR>
148+
imap <F5> <ESC> :cw<CR>
149+
" :ccl[ose] Close the quickfix window
150+
nmap <S-c> :ccl<cr>
151+
map <silent><F4> :ccl<CR>
152+
imap <F4> <ESC> :ccl<CR>
153+
" :[count]cn[ext][!]
154+
nmap <S-z> :cn<cr>
155+
" :[count]cp[revious][!]
156+
nmap <S-x> :cp<cr>
157+
158+
" Use the new colorscheme plug
159+
colorscheme forest-night
160+
let g:airline_theme = 'forest_night'
161+
162+

README2.markdown

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Some trip
2+
3+
# Vim
4+
## Upgrade to 8.0
5+
The vim 8.0 has better support for the spf13 project.
6+
The installation steps are as follows:
7+
8+
sudo add-apt-repository ppa:jonathonf/vim
9+
sudo apt update
10+
sudo apt install vim
11+
12+
13+
14+
## Uninstall Vim 8.0:
15+
To uninstall Vim 8.0 and downgrade it to the stock version in Ubuntu repository, run the command below to purge the PPA:
16+
17+
sudo apt install ppa-purge && sudo ppa-purge ppa:jonathonf/vim
18+
19+
20+
## +lua(vim --version)
21+
22+
sudo apt install vim-gtk/nox
23+
24+
It may improve the autocomplete feature.
25+

bootstrap.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ do_backup() {
8686
if [ -e "$1" ] || [ -e "$2" ] || [ -e "$3" ]; then
8787
msg "Attempting to back up your original vim configuration."
8888
today=`date +%Y%m%d_%s`
89+
# remove the current vim config and backup
8990
for i in "$1" "$2" "$3"; do
9091
[ -e "$i" ] && [ ! -L "$i" ] && mv -v "$i" "$i.$today";
9192
done
@@ -124,14 +125,16 @@ create_symlinks() {
124125
lnif "$source_path/.vimrc" "$target_path/.vimrc"
125126
lnif "$source_path/.vimrc.bundles" "$target_path/.vimrc.bundles"
126127
lnif "$source_path/.vimrc.before" "$target_path/.vimrc.before"
128+
lnif "$source_path/.vimrc.local" "$target_path/.vimrc.local"
127129
lnif "$source_path/.vim" "$target_path/.vim"
128130

129131
if program_exists "nvim"; then
130132
lnif "$source_path/.vim" "$target_path/.config/nvim"
131133
lnif "$source_path/.vimrc" "$target_path/.config/nvim/init.vim"
132134
fi
133135

134-
touch "$target_path/.vimrc.local"
136+
# Use the file in the spf13-vim-3 project, not create the file in the ~ dir
137+
#touch "$target_path/.vimrc.local"
135138

136139
ret="$?"
137140
success "Setting up vim symlinks."

0 commit comments

Comments
 (0)