Added folding

This commit is contained in:
madmaurice 2015-11-14 03:17:00 +01:00
parent fd3e547348
commit 52fd0111c4

View file

@ -1,14 +1,15 @@
set nocompatible
filetype off
" --- init vundle
" --- init vundle {{{
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" --- Let Vundle manage Vundle
Plugin 'VundleVim/Vundle.vim'
" }}}
" --- My plugins
" --- My plugins {{{
Plugin 'scrooloose/nerdtree' " FileBrowser on the left side
Plugin 'ervandew/supertab' "Auto completion
Plugin 'ap/vim-templates' "File templates
@ -27,12 +28,14 @@ Plugin 'vim-scripts/L9' "dependency for FuzzyFinder
Plugin 'vim-scripts/FuzzyFinder' "Fuzzy finding
Plugin 'cohama/lexima.vim' "Auto pairs
Plugin 'tpope/vim-surround' "Vim surround
" }}}
" --- End init vundle
" --- End init vundle {{{
call vundle#end()
filetype plugin indent on
" }}}
" --- General configurations
" --- General configurations {{{
set whichwrap+=<,>,[,]
set autoread "auto read file if changed
set wildmenu "Command completion
@ -73,14 +76,27 @@ set backup
set writebackup
set backupdir=~/.vim/backup//
set directory=~/.vim/backup//
" we dont need to show the mode
set noshowmode
" Abbreviations
" }}}
" --- Abbreviations {{{
iab _DATE <C-R>=strftime("%A, %d. %B %Y %H:%M")<CR>
" }}}
" Autoload when saving vimrc
" --- Autoload when saving vimrc {{{
au! BufWritePost .vimrc source ~/.vimrc
" }}}
" --- Own functions
" --- Vim file easyfolding {{{
augroup ft_vim
au!
au FileType vim setlocal foldmethod=marker
augroup END
" }}}
" --- Own functions {{{
function! AddSemicolon()
normal m'A;
normal `'
@ -99,8 +115,9 @@ function! IsModified()
endif
return ''
endfunction
" }}}
" Show insert mode in statusbar
" --- ModeColor {{{
function! ModeColor(mode)
if a:mode == 'i'
if &paste
@ -115,17 +132,13 @@ function! ModeColor(mode)
endif
endfunction
" Remove current buffer
function! BufferClose()
endfunction
au InsertEnter * call ModeColor(v:insertmode)
au InsertChange * call ModeColor(v:insertmode)
au InsertLeave * call ModeColor('n')
call ModeColor('n')
" }}}
" --- Bindings
" --- Bindings {{{
let mapleader = ","
" word movement with tab
nnoremap <Tab> W
@ -167,6 +180,7 @@ nnoremap <C-l> <C-w>l
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap K :q<cr>
" Quick macroing
nnoremap Q @@
" --- Don't need a help
@ -178,13 +192,14 @@ map Y y$
" -- Easy indenting in visual
vnoremap > >gv
vnoremap < <gv
" -- No need to jump around if i press (){}[]
nmap ( <Nop>
nmap ) <Nop>
nmap { <Nop>
nmap } <Nop>
nmap [ <Nop>
nmap ] <Nop>
" Automatic running
autocmd filetype python nnoremap <F5> :w<cr>:!python %<cr>
" Easy changing
nnoremap " f"ci"
nnoremap ( f)ci(
nnoremap ' f'ci'
" Sudo to write
cnoremap w!! w !sudo tee % >/dev/null
@ -200,12 +215,14 @@ ino <right> <Nop>
" --- Different use of undo
nnoremap U <c-r>
" }}}
" --- We don't need useless whitespace at the end of the line
" --- Useless whitespaces {{{
highlight WhitespaceEOL ctermbg=Red guibg=Red
match WhitespaceEOL /\s\+$/
" }}}
" --- Rice
" --- Rice {{{
set statusline=\ %#Modified#%{IsModified()}%*
set statusline+=%f
set statusline+=\ %#ModeLine#%=%*
@ -215,11 +232,13 @@ hi Modified ctermfg=red
hi StatusLine cterm=None ctermfg=green ctermbg=none
hi Search cterm=NONE ctermfg=none ctermbg=none
hi IncSearch cterm=underline ctermbg=none ctermfg=green
" }}}
" --- Supertab
" --- Supertab {{{
let g:SuperTabNoCompleteAfter = ['^',',','\s']
" }}}
" --- NERDTree tabs
" --- NERDTree config {{{
nmap <silent> <leader>e :NERDTreeToggle<CR>
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
@ -230,16 +249,17 @@ let NERDTreeIgnore=['\~$','\.pyc$','\.swp$']
let NERDTreeWinPos="left"
let NERDTreeMinimalUI = 1
let NERDTreeQuitOnOpen = 1
" }}}
" --- EasyMotion
" --- EasyMotion config {{{
map / <Plug>(easymotion-sn)
omap / <Plug>(easymotion-tn)
map ? <Plug>(easymotion-bd-jk)
map n <Plug>(easymotion-next)
map N <Plug>(easymotion-prev)
" }}}
" --- Auto pairs
" --- Auto pairs config {{{
let g:lexima_enable_basic_rules = 1
" --- Sparkup
" }}}