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