Closed noscripter closed 6 years ago
Those should be temporary buffers. Maybe you have something in your config that saves files upon exiting, or saves a view. If unsure, you can post your vimrc and I'll check.
I am using spf13, my .vimrc.local is as follow:
" Leo's vim customization which incorporate with spf13
" Set to auto read when a file is changed from the outside
set autoread
" gui for airline
if has('gui_running')
set guifont=Inconsolata-dz\ for\ Powerline:h34
colorscheme solarized "github
else
colorscheme jellybeans
endif
" fast saving
map <leader>w :w!<cr>
" diff current file's changes since last save
map <leader>d :w !diff % -<cr>
" fast nohlsearch
map <leader>h :nohlsearch<cr>
" fast NERDTreeToggle
map <leader>o :NERDTreeToggle<cr>
map <leader>r :NERDTreeFind<cr>
map <leader>b :CtrlPBuffer<cr>
map <leader>bu :CtrlPMRUFiles<cr>
" fast MYVIMRC sourcing
map <leader>s :source $MYVIMRC<cr>
" fast editing MYVIMRC
"map <leader>x :e ~/.vimrc.local<cr>
"map <leader>b :e ~/.vimrc.bundles.local<cr>
autocmd VimEnter * source $MYVIMRC
autocmd! bufwritepost vimrc source ~/.vimrc.local
" :W sudo saves the file
" (useful for handling the permission-denied error)
command! W w !sudo tee % > /dev/null
" Ignore compiled files
set wildignore=*.o,*~,*.pyc
if has("win16") || has("win32")
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store
else
set wildignore+=.git\*,.hg\*,.svn\*
endif
nnoremap <leader>f :%!js-beautify -j -q -B -f -<CR>
" =====================================>
" Overriding current spf13 settings
" No annoying sound on errors
"set t_vb=
"set tm=500
" Add a bit extra margin to the left
"set foldcolumn=1
" Configure backspace to be modern
set backspace=eol,start,indent
set whichwrap+=<,>,h,l
" Don't redraw while executing macros (good performance config)
set lazyredraw
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Colors and Fonts
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Enable syntax highlighting
syntax enable
"try
" colorscheme desert
"catch
"endtry
set background=dark
" Set extra options when running in GUI mode
"if has("gui_running")
" set guioptions-=T
" set guioptions-=e
" set t_Co=256
" set guitablabel=%M\ %t
"endif
"function! GuiTabLabel()
" let label = ''
" let bufnrlist = tabpagebuflist(v:lnum)
" " Add '+' if one of the buffers in the tab page is modified
" for bufnr in bufnrlist
" if getbufvar(bufnr, "&modified")
" let label = '+'
" break
" endif
" endfor
" " Append the tab number
" let label .= v:lnum.': '
" " Append the buffer name
" let name = bufname(bufnrlist[tabpagewinnr(v:lnum) - 1])
" if name == ''
" " give a name to no-name documents
" if &buftype=='quickfix'
" let name = '[Quickfix List]'
" else
" let name = '[No Name]'
" endif
" else
" " get only the file name
" let name = fnamemodify(name,":t")
" endif
" let label .= name
" " Append the number of windows in the tab page
" let wincount = tabpagewinnr(v:lnum, '$')
" return label . ' [' . wincount . ']'
"endfunction
"set guitablabel=%{GuiTabLabel()}
" Use Unix as the standard file type
set ffs=unix,dos,mac
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Files, backups and undo
""""""""""""""""""""
" Turn backup off, since most stuff is in SVN, git et.c anyway...
set nobackup
set nowb
set noswapfile
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Text, tab and indent related
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Be smart when using tabs ;)
set smarttab
" Linebreak on 500 characters
"set lbr
set tw=121
set ai "Auto indent
set si "Smart indent
set wrap "Wrap lines
""""""""""""""""""""""""""""""
" => Visual mode related
""""""""""""""""""""""""""""""
" Visual mode pressing * or # searches for the current selection
" Super useful! From an idea by Michael Naumann
vnoremap <silent> * :call VisualSelection('f', '')<CR>
vnoremap <silent> # :call VisualSelection('b', '')<CR>
" Delete trailing white space on save, useful for Python and CoffeeScript ;)
"func! DeleteTrailingWS()
" exe "normal mz"
" %s/\s\+$//ge
" exe "normal `z"
"endfunc
"autocmd BufWrite *.py :call DeleteTrailingWS()
"autocmd BufWrite *.coffee :call DeleteTrailingWS()
" Open Ack and put the cursor in the right position
map <leader>g :Ack
" When you press <leader>r you can search and replace the selected text
"vnoremap <silent> <leader>r :call VisualSelection('replace', '')<CR>
" Do :help cope if you are unsure what cope is. It's super useful!
"
" When you search with Ack, display your results in cope by doing:
" <leader>cc
"
" To go to the next search result do:
" <leader>n
"
" To go to the previous search results do:
" <leader>p
"
map <leader>cc :botright cope<cr>
map <leader>co ggVGy:tabnew<cr>:set syntax=qf<cr>pgg
map <leader>n :cn<cr>
map <leader>p :cp<cr>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Spell checking
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Pressing ,ss will toggle and untoggle spell checking
map <leader>ss :setlocal spell!<cr>
" Shortcuts using <leader>
map <leader>sn ]s
map <leader>sp [s
map <leader>sa zg
map <leader>s? z=
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Misc
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Remove the Windows ^M - when the encodings gets messed up
noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm
" Quickly open a buffer for scribble
map <leader>q :e ~/buffer<cr>
" Quickly open a markdown buffer for scribble
"map <leader>x :e ~/buffer.md<cr>
" Toggle paste mode on and off
map <leader>pp :setlocal paste!<cr>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Helper functions
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function! CmdLine(str)
exe "menu Foo.Bar :" . a:str
emenu Foo.Bar
unmenu Foo
endfunction
function! VisualSelection(direction, extra_filter) range
let l:saved_reg = @"
execute "normal! vgvy"
let l:pattern = escape(@", '\\/.*$^~[]')
let l:pattern = substitute(l:pattern, "\n$", "", "")
if a:direction == 'b'
execute "normal ?" . l:pattern . "^M"
elseif a:direction == 'gv'
call CmdLine("Ack \"" . l:pattern . "\" " )
elseif a:direction == 'replace'
call CmdLine("%s" . '/'. l:pattern . '/')
elseif a:direction == 'f'
execute "normal /" . l:pattern . "^M"
endif
let @/ = l:pattern
let @" = l:saved_reg
endfunction
" Returns true if paste mode is enabled
function! HasPaste()
if &paste
return 'PASTE MODE '
en
return ''
endfunction
" Don't close window, when deleting a buffer
command! Bclose call <SID>BufcloseCloseIt()
function! <SID>BufcloseCloseIt()
let l:currentBufNum = bufnr("%")
let l:alternateBufNum = bufnr("#")
if buflisted(l:alternateBufNum)
buffer #
else
bnext
endif
if bufnr("%") == l:currentBufNum
new
endif
if buflisted(l:currentBufNum)
execute("bdelete! ".l:currentBufNum)
endif
endfunction
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => GUI related
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Set font according to system
if has("mac") || has("macunix")
set gfn=Source\ Code\ Pro\ for\ Powerline:h14,Menlo:h25
elseif has("win16") || has("win32")
set gfn=Source\ Code\ Pro\ for\ Powerline:h12,Bitstream\ Vera\ Sans\ Mono:h11
au GUIEnter * simalt ~x
elseif has("linux")
set gfn=Source\ Code\ Pro\ for\ Powerline:h12,Bitstream\ Vera\ Sans\ Mono:h11
elseif has("unix")
set gfn=Monospace\ 11
endif
" Open MacVim in fullscreen mode
if has("gui_macvim")
set fuoptions=maxvert,maxhorz
"au GUIEnter * set fullscreen
endif
" Disable scrollbars (real hackers don't use scrollbars for navigation!)
set guioptions-=r
set guioptions-=R
set guioptions-=l
set guioptions-=L
" set fold method
set fdm=indent
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Command mode related
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Smart mappings on the command line
cno $h e ~/
cno $d e ~/Desktop/
cno $j e ./
cno $c e <C-\>eCurrentFileDir("e")<cr>
" $q is super useful when browsing on the command line
" it deletes everything until the last slash
cno $q <C-\>eDeleteTillSlash()<cr>
" Bash like keys for the command line
cnoremap <C-A> <Home>
cnoremap <C-E> <End>
cnoremap <C-K> <C-U>
cnoremap <C-P> <Up>
cnoremap <C-N> <Down>
" Map ½ to something useful
map ½ $
cmap ½ $
imap ½ $
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Parenthesis/bracket
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
vnoremap $1 <esc>`>a)<esc>`<i(<esc>
vnoremap $2 <esc>`>a]<esc>`<i[<esc>
vnoremap $3 <esc>`>a}<esc>`<i{<esc>
vnoremap $$ <esc>`>a"<esc>`<i"<esc>
vnoremap $q <esc>`>a'<esc>`<i'<esc>
vnoremap $e <esc>`>a"<esc>`<i"<esc>
" Map auto complete of (, ", ', [
inoremap $1 ()<esc>i
inoremap $2 []<esc>i
inoremap $3 {}<esc>i
inoremap $4 {<esc>o}<esc>O
inoremap $q ''<esc>i
inoremap $e ""<esc>i
inoremap $t <><esc>i
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => General abbreviations
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" enter 'xdate' then presss <CTRL>_<CR>
"iab date <c-r>=strftime("%d/%m/%y %H:%M:%S")<cr>
nmap <c-s> :w<CR>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Omni complete functions
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xtpl set ft=html
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Helper functions
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
func! DeleteTillSlash()
let g:cmd = getcmdline()
if has("win16") || has("win32")
let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\]\\).*", "\\1", "")
else
let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*", "\\1", "")
endif
if g:cmd == g:cmd_edited
if has("win16") || has("win32")
let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\\]\\).*\[\\\\\]", "\\1", "")
else
let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*/", "\\1", "")
endif
endif
return g:cmd_edited
endfunc
func! CurrentFileDir(cmd)
return a:cmd . " " . expand("%:p:h") . "/"
endfunc
""""""""""""""""""""""""""""""
" FileTypes Configuration "
""""""""""""""""""""""""""""""
" => Python section
""""""""""""""""""""""""""""""
let python_highlight_all = 1
au FileType python syn keyword pythonDecorator True None False self
au BufNewFile,BufRead *.jinja set syntax=htmljinja
au BufNewFile,BufRead *.mako set ft=mako
au FileType python map <buffer> F :set foldmethod=indent<cr>
au FileType python inoremap <buffer> $r return
au FileType python inoremap <buffer> $i import
au FileType python inoremap <buffer> $p print
au FileType python inoremap <buffer> $f #--- PH ----------------------------------------------<esc>FP2xi
au FileType python map <buffer> <leader>1 /class
au FileType python map <buffer> <leader>2 /def
au FileType python map <buffer> <leader>C ?class
au FileType python map <buffer> <leader>D ?def
""""""""""""""""""""""""""""""
" => JavaScript section
"""""""""""""""""""""""""""""""
"au FileType javascript call JavaScriptFold()
au FileType javascript setl fen
au FileType javascript setl nocindent
au FileType javascript imap <c-t> $log();<esc>hi
au FileType javascript imap <c-a> alert();<esc>hi
au FileType javascript inoremap <buffer> $r return
au FileType javascript inoremap <buffer> $f //--- PH ----------------------------------------------<esc>FP2xi
function! JavaScriptFold()
setl foldmethod=syntax
setl foldlevelstart=1
syn region foldBraces start=/{/ end=/}/ transparent fold keepend extend
function! FoldText()
return substitute(getline(v:foldstart), '{.*', '{...}', '')
endfunction
setl foldtext=FoldText()
endfunction
""""""""""""""""""""""""""""""
" => CoffeeScript section
"""""""""""""""""""""""""""""""
function! CoffeeScriptFold()
setl foldmethod=indent
setl foldlevelstart=1
endfunction
au FileType coffee call CoffeeScriptFold()
set colorcolumn=+1 " Indicate text border
" for code convention, line with text longer than 120 would be highlighted
"highlight OverLength ctermbg=darkred ctermfg=white guibg=#FFD9D9
"match OverLength /\%121v.\+/
"highlight ColorColumn ctermbg=235 guibg=#2c2d27
set cursorcolumn
"let &colorcolumn="121,".join(range(121,999),",")
"set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:p:h\")})%)%(\ %a%)\ -\ %{v:servername}
" set auto change working directory to current file's path
set autochdir
"autocmd BufEnter * silent! lcd %:p:h
" automatically set filetypes of rss and atom files to xml
autocmd BufNewFile,BufRead *.rss,*.atom setfiletype xml
" automatically set tab or space for specific filetypes
autocmd Filetype make noexpandtab
autocmd Filetype yaml expandtab
" set format option for specific filetypes
au FileType json setlocal equalprg=python\ -mjson.tool
au BufRead,BufNewFile *.json setf json
" reload when entering the buffer or gaining focus
au FocusGained, BufEnter * :silent! !
" save when exiting the buffer or losing focus
au FocusLost, WinLeave * :silent! w
set showtabline=2 " always show tabline
" set color for comment
highlight Comment ctermfg=green
" set color for mode message (--INSERT--) to green
highlight ModeMsg cterm=bold ctermfg=2 ctermbg=black
highlight StatusLine ctermfg=7 ctermbg=9
" set inactive statusline to black on gray
highlight StatusLineNC ctermfg=8 ctermbg=9
au! BufRead,BufNewFile *.md set filetype=markdown
au! BufNewFile,BufRead *.bat,*.sys setf dosbatch
au! BufNewFile,BufRead *.cmd if getline(1) =~ '^/\*' | setf rexx | else | setf dosbatch | endif
au! BufRead,BufNewFile *.bat if getline(1) =~ '--\*-Perl-\*--' | setf perl | endif
au! BufNewFile,BufRead *.btm call s:FTbtm()
function! s:FTbtm()
if exists("g:dosbatch_syntax_for_btm") && g:dosbatch_syntax_for_btm
setf dosbatch
else
setf btm
endif
endfunction
" Return to last edit position when opening files (You want this!)
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
" Remember info about open buffers on close
set viminfo^=%
set autowrite
set autowriteall "Auto-write all file changes
" autocompletion with dictionary help
set dictionary=/usr/share/dict/words
" toggle between showing and hiding invisible characters
nmap <leader>l :set list!<CR>
nnoremap <Leader>2 :set tabstop=2 softtabstop=2 shiftwidth=2<CR>
nnoremap <Leader>4 :set tabstop=4 softtabstop=4 shiftwidth=4<CR>
nnoremap <Leader>eg :e ++enc=gbk<CR>
nnoremap <Leader>eu :e ++enc=utf8<CR>
" Automatically jump to end of text you pasted
vnoremap <silent> y y`]
vnoremap <silent> p p`]
nnoremap <silent> p p`]
" Set tabstop, softtabstop and shiftwidth to the same value
command! -nargs=* Stab call Stab()
function! Stab()
let l:tabstop = 1 * input('set tabstop = softtabstop = shiftwidth = ')
if l:tabstop > 0
let &l:sts = l:tabstop
let &l:ts = l:tabstop
let &l:sw = l:tabstop
endif
call SummarizeTabs()
endfunction
function! SummarizeTabs()
try
echohl ModeMsg
echon 'tabstop='.&l:ts
echon 'shiftwidth='.&l:sw
echon 'softtabstop='.&l:sts
if &l:et
echon ' expandtab'
else
echon ' noexpandtab'
endif
finally
echohl None
endtry
endfunction
" prompt user when confirmation required
"set confirm
" diable spf13 plugins
UnBundle "spf13/vim-autoclose"
UnBundle "spf13/vim-colors"
UnBundle "spf13/vim-preview"
UnBundle "gorodinskiy/vim-coloresque"
" vim-jsbeautify config
"map <c-f> :call JsBeautify()<cr>
"autocmd FileType javascript vnoremap <buffer> <c-f> :call RangeJsBeautify()<cr>
"autocmd FileType html vnoremap <buffer> <c-f> :call RangeHtmlBeautify()<cr>
"autocmd FileType css vnoremap <buffer> <c-f> :call RangeCSSBeautify()<cr>
" sourcebeautify
" keystroke is <leader>sb
au BufRead,BufNewFile *.json setf json
"set guitablabel=%N:%M%t " Show tab numbers
set showtabline=2 " always show tabs in gvim, but not vim
" set up tab labels with tab number, buffer name, number of windows
function! GuiTabLabel()
let label = ''
let bufnrlist = tabpagebuflist(v:lnum)
" Add '+' if one of the buffers in the tab page is modified
for bufnr in bufnrlist
if getbufvar(bufnr, "&modified")
let label = '+'
break
endif
endfor
" Append the tab number
let label .= v:lnum.': '
" Append the buffer name
let name = bufname(bufnrlist[tabpagewinnr(v:lnum) - 1])
if name == ''
" give a name to no-name documents
if &buftype=='quickfix'
let name = '[Quickfix List]'
else
let name = '[No Name]'
endif
else
" get only the file name
let name = fnamemodify(name,":t")
endif
let label .= name
" Append the number of windows in the tab page
let wincount = tabpagewinnr(v:lnum, '$')
return label . ' [' . wincount . ']'
endfunction
set guitablabel=%{GuiTabLabel()}
set nowrap
unmap Y
" Folding ----------------------------------------------------------------- {{{
" all fold by default
"set foldlevelstart=0
" all expand by default
set foldlevelstart=99
" Space to toggle folds.
nnoremap <Space> za
vnoremap <Space> za
" "Refocus" folds
nnoremap ,z zMzvzz
" Make zO recursively open whatever top level fold we're in, no matter where the
" cursor happens to be.
nnoremap zO zCzO
"function! MyFoldText() " {{{
" let line = getline(v:foldstart)
"
" let nucolwidth = &fdc + &number * &numberwidth
" let windowwidth = winwidth(0) - nucolwidth - 3
" let foldedlinecount = v:foldend - v:foldstart
"
" " expand tabs into spaces
" let onetab = strpart(' ', 0, &tabstop)
" let line = substitute(line, '\t', onetab, 'g')
"
" let line = strpart(line, 0, windowwidth - 2 -len(foldedlinecount))
" let fillcharcount = windowwidth - len(line) - len(foldedlinecount)
" return line . '…' . repeat(" ",fillcharcount) . foldedlinecount . '…' . ' '
"endfunction " }}}
"set foldtext=MyFoldText()
"
" }}}
set autoread
" reload when entering the buffer or gaining focus
au FocusGained,BufEnter * :silent! !
" save when exiting the buffer or losing focus
au FocusLost,WinLeave * :silent! w
cmapclear
iunmap <Esc>
let NERDTreeQuitOnOpen = 0
nnoremap <Leader>d :let NERDTreeQuitOnOpen = 1<bar>NERDTreeToggle<CR>
nnoremap <Leader>D :let NERDTreeQuitOnOpen = 0<bar>NERDTreeToggle<CR>
let g:NERDTreeWinPos = "right"
" Auto-open NERDTree in “EVERY” tab
"autocmd VimEnter * NERDTree
"autocmd BufEnter * NERDTreeMirror
let NERDTreeChDirMode=2
set iskeyword-=.,-_
set nu
set wrap
" bufferline and airline conjuction
let g:airline#extensions#bufferline#enabled = 0
" copy the previous indentation on autoindenting
set copyindent
set wildignore+=*.swp,*.bak,*.pyc,*.class
set pastetoggle=<F2>
cmap w!! w !sudo tee % >/dev/null
" excel.vim
let g:zipPlugin_ext = '*.zip,*.jar,*.xpi,*.ja,*.war,*.ear,*.celzip,*.oxt,*.kmz,
\ *.wsz,*.xap,*.docx,*.docm,*.dotx,*.dotm,*.potx,*.potm,*.ppsx,
\ *.ppsm, *.pptx,*.pptm,*.ppam,*.sldx,*.thmx,*.crtx,*.vdw,*.glox,
\ *.gcsx,*.gqsx'
set nospell
set clipboard=unnamed
set nu
" maximize the window on startup
set lines=999
set columns=999
" fix stupid concealing double quotes behavior in JSON
let g:vim_json_syntax_conceal = 0
" let g:ackprg=ack
let g:ackprg = "ack"
" Source the vimrc file after saving it
if has("autocmd")
autocmd bufwritepost .vimrc source $MYVIMRC
endif
function! <SID>StripTrailingWhitespaces()
" Preparation: save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" Do the business:
%s/\s\+$//e
" Clean up: restore previous search history, and cursor position
let @/=_s
call cursor(l, c)
endfunction
nnoremap <silent> <F5> :call <SID>StripTrailingWhitespaces()<CR>
autocmd BufWritePre *.py,*.js :call <SID>StripTrailingWhitespaces()
" url:http://vimcasts.org/episodes/tidying-whitespace/
function! Preserve(command)
" Preparation: save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" Do the business:
execute a:command
" Clean up: restore previous search history, and cursor position
let @/=_s
call cursor(l, c)
endfunction
nmap _$ :call Preserve("%s/\\s\\+$//e")<CR>
nmap _= :call Preserve("normal gg=G")<CR>
" url:http://vimcasts.org/episodes/whitespace-preferences-and-filetypes/
" Only do this part when compiled with support for autocommands
if has("autocmd")
" Enable file type detection
filetype on
" Syntax of these languages is fussy over tabs Vs spaces
autocmd FileType make setlocal ts=8 sts=8 sw=8 noexpandtab
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType sass setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType scss setlocal ts=2 sts=2 sw=2 expandtab
" Customisations based on house-style (arbitrary)
autocmd FileType html setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType css setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType javascript setlocal ts=4 sts=4 sw=4 noexpandtab
" Treat .rss files as XML
autocmd BufNewFile,BufRead *.rss setfiletype xml
endif
autocmd! bufwritepost $MYVIMRC source %
"autocmd! BufRead,BufNewFile * :color github
autocmd! BufRead,BufNewFile * :set expandtab
" force tabs into spaces
set expandtab
noremap <Leader>W :w !sudo tee % > /dev/null
" tab revert, convert tab character to spaces
"autocmd FileType * set tabstop=2|set shiftwidth=2|set noexpandtab
"autocmd FileType python set tabstop=4|set shiftwidth=4|set expandtab
"=================================>
Bundle 'junegunn/goyo.vim'
"nnoremap <Leader>w :Goyo<CR>
map <silent> <F12> :Goyo<CR>
autocmd User GoyoEnter Limelight
autocmd User GoyoLeave Limelight!
Bundle 'junegunn/seoul256.vim'
Bundle 'junegunn/limelight.vim'
" Color name (:help cterm-colors) or ANSI code
let g:limelight_conceal_ctermfg = 'gray'
let g:limelight_conceal_ctermfg = 240
" Color name (:help gui-colors) or RGB color
let g:limelight_conceal_guifg = 'DarkGray'
let g:limelight_conceal_guifg = '#777777'
" Default: 0.5
let g:limelight_default_coefficient = 0.7
set expandtab
"set guifont=Andale\ Mono\ Regular:h16,Menlo\ Regular:h16,Consolas\ Regular:h16,Courier\ New\ Regular:h16
"set guifont=Inconsolata-dz\ for\ Powerline:h14
"set guifont=Andale\ Mono\ Regular\ 12,Menlo\ Regular\ 11,Consolas\ Regular\ 12,Courier\ New\ Regular\ 14
set guifont=Andale\ Mono\ Regular:h16,Menlo\ Regular:h16,Consolas\ Regular:h16,Courier\ New\ Regular:h16
set iskeyword-=_
set noerrorbells visualbell t_vb=
if has('autocmd')
autocmd GUIEnter * set visualbell t_vb=
endif
"Startify settings
let g:startify_custom_header = [
\ ' ',
\ ' __ ',
\ ' __ __ /\_\ ___ ___ ',
\ ' /\ \/\ \\/\ \ /'' __` __`\ ',
\ ' \ \ \_/ |\ \ \/\ \/\ \/\ \ ',
\ ' \ \___/ \ \_\ \_\ \_\ \_\ ',
\ ' \/__/ \/_/\/_/\/_/\/_/ ',
\ '',
\ '',
\ ]
"IndentGuide settings
let g:indent_guides_enable_on_vim_startup = 0
let g:gitgutter_max_signs = 99999
BTW, what commands are related to macvim exiting or view save?
Ok, this one is huge, normally I would recommend to disable your config file entirely to rule out that it is a problem with the framework you are using, but I spotted this:
" reload when entering the buffer or gaining focus
au FocusGained, BufEnter * :silent! !
" save when exiting the buffer or losing focus
au FocusLost, WinLeave * :silent! w
Try commenting that out.
After
:PluginInstall!
, there were always some[Vundle]
files left in my folders, typically named as '[Vundle] Installer, or '[Vundle] clean
, or '[Vundle] list`, and all the content are empty, this is really annoying. Does anyone know how to get rid of this problem? Or please explain to me why these files are created, is there any way to prevent them from being craeted? Thanks in advance.