1. Gabriel AHTUNE
  2. gaby-dotfiles

Commits

Gabriel AHTUNE  committed 8435b38

Add unite, airline, unite-outline
remove ctrlP, Powerline, outline
remove a lot of script that I never use

  • Participants
  • Parent commits 9952066
  • Branches default

Comments (0)

Files changed (1)

File vimrc

View file
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 " F2:  SyntasticCheck
 " F3:  Toggle Color Column
-" F4:  Toggle Taglist or Dotoutlinetree in rst
+" F4:  vim-outline
 " F5:  Run current file
 " F6:  Gundo
 " F7:  Toggle Spell checking
 " F8:  Cope
 " F9:  MRU
-" F10: Toggle VExplorer
+" F10: Explorer
 " F12: Buffer list
 " C-F5: Compile/make/... 
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 if !exists("autocommandes_incluses")
     let autocommandes_incluses=1
     autocmd bufwritepost $MYVIMRC source $MYVIMRC
-    autocmd bufwritepost $MYVIMRC call Pl#Load()
     autocmd bufwritepost $MYVIMRC setlocal foldmethod=marker
 endif
 " }}}
-
 " GENERAL: CONFIGURATION {{{1
 " -----------------------------------------------------------------------------
 
 " Editor behaviour {{{2
+let mapleader = ","
 set nocompatible
 set noautochdir
 set backupdir=~/.vim/backup/
 set ffs=unix,dos,mac
 set autoread                  " read file when changed outside of Vim
 set whichwrap+=<,>,h,l,[,]
-
 " Display behaviour and features {{{2
 syntax on
 set gfn=Monaco
 set novisualbell
 set t_vb=
 set tm=500
-
-" Help {{{2
-" -------------------------------------------------------------------------------
-set helplang=fr
-
 " Others {{{2
 set virtualedit=block
 set tags=tags;
-let mapleader = ","
-
 " }}}
-
 " LIBRARY: Useful functions {{{1
 " -----------------------------------------------------------------------------
 
 inoremap <C-u> <C-g>u<C-u>
 onoremap A :<C-u>normal! ggVG<CR>
 vnoremap A `<gg`>G
-
-augroup AutoMkdir
-    autocmd!
-    autocmd  BufNewFile  *  :call EnsureDirExists()
-augroup END
-function! EnsureDirExists ()
-    let required_dir = expand("%:h")
-    if !isdirectory(required_dir)
-        call AskQuit("Directory '" . required_dir . "' doesn't exist.", "&Create it?")
-
-        try
-            call mkdir( required_dir, 'p' )
-        catch
-            call AskQuit("Can't create '" . required_dir . "'", "&Continue anyway?")
-        endtry
-    endif
-endfunction
-
-function! AskQuit (msg, proposed_action)
-    if confirm(a:msg, "&Quit?\n" . a:proposed_action) == 1
-        exit
-    endif
-endfunction
-
-" Execution {{{2
-nnoremap <C-F5> :silent make<CR>:botright cwindow<CR>:echo "make complete"<CR>
-nnoremap <F5> :! ./%<CR><CR>
-
 function! MakeExecutable()
     if (strpart(getline(1), 0, 2) == '#!')
         silent !chmod +x %
 nnoremap <C-w>s <C-w>s<C-w>j
 nnoremap <Leader>ss :Windo set scrollbind!<CR>
 
-" Jumps {{{2
-nnoremap <M-j> :jumps<CR>
 
 " Tags {{{2
 map <Leader>ct :!/usr/bin/ctags -R .<CR>
 vnoremap < <gv
 vnoremap > >gv
 noremap <C-M-h> <ESC>mtgg=G<ESC>:%s/\n[\s\t]*\n\+/\r\r/g<CR>:nohl<CR>'t
+noremap <Leader>c <silent>:.s/\s*$//g<CR>:nohl<CR>
 
 " Fold {{{2
 nnoremap <space> za
     let g:myLang=g:myLang+1
     if g:myLang>=len(g:myLangList) | let g:myLang=0 | endif
     if g:myLang==0
+        set spelllang="en"
         setlocal nospell
     else
         execute "setlocal spell spelllang=".get(g:myLangList, g:myLang)
 nn <Leader>cd :lcd %:h<CR>:pwd<CR>
 nn <Leader>e :e .<CR>7G
 
-function! CleanVExplorer()
-    let g:netrw_browse_split = 0
-    if exists("t:expl_buf_num")
-        unlet t:expl_buf_num
-    endif
-endfunction 
-
-function! ToggleVExplorer()
-    if exists("t:expl_buf_num")
-        try
-            let g:netrw_browse_split = 0
-            let expl_win_num = bufwinnr(t:expl_buf_num)
-            let cur_win_nr = winnr()
-            unlet t:expl_buf_num
-            exec expl_win_num . 'wincmd w'
-            close
-            exec cur_win_nr . 'wincmd w'
-            echo "Vexplorer closed"
-        endtry
-    else
-        let g:netrw_browse_split = 4
-        exec '1wincmd w'
-        topleft Vexplore
-        nmap <buffer> <C-W>q :call ToggleVExplorer()<CR>
-        verbose autocmd BufDelete <buffer> :call CleanVExplorer()
-        let t:expl_buf_num = bufnr("%")
-    endif
-endfunction
-
-map <silent> <F10> :call ToggleVExplorer()<CR>
-
-function! CloseEx()
-    if exists("t:expl_buf_num")
-        try
-            let g:netrw_browse_split = 0
-            let expl_win_num = bufwinnr(t:expl_buf_num)
-            let cur_win_nr = winnr()
-            exec expl_win_num . 'wincmd w'
-            close
-            exec cur_win_nr . 'wincmd w'
-            unlet t:expl_buf_num
-            echo "Vexplorer closed"
-        endtry
-    else
-        exec "bd"
-    endif
-endfunction
-
-autocmd FileType netrw noremap <silent><buffer> q :call CloseEx()<CR>
-
-let g:netrw_altv = 1
-let g:netrw_winsize = 20
-
 " Cope {{{2
 
 function! ToggleCope()
 
 autocmd QuickFixCmdPost * call ArrangeCope()
 
-nnoremap  :cn<CR>
-nnoremap  :cp<CR>
+nnoremap  :cn<CR>
+nnoremap  :cp<CR>
 
 " To Python {{{2
 map <Leader>da gg0idata = """<ESC>GA"""<CR><CR>
 " git clone git://github.com/jpalardy/vim-slime.git
 " once slime and pathogen installed, you can run code in comment to install the
 " other plugins
-let g:slime_python_ipython=1
-let g:slime_target = "tmux"
-let g:slime_paste_file="/tmp/slime_paste_file"
-nmap <F12> <plug>SlimeParagraphSend
-vmap <F12> <plug>SlimeRegionSend
-imap <F12> <ESC><F12>i
+" let g:slime_python_ipython=1
+" let g:slime_target = "tmux"
+" let g:slime_paste_file="/tmp/slime_paste_file"
+" nmap <F12> <plug>SlimeParagraphSend
+" vmap <F12> <plug>SlimeRegionSend
+" imap <F12> <ESC><F12>i
 
-" Jellybeans colorscheme {{{2
-"     cd ~/.vim/bundle/
-"     git clone https://github.com/nanotech/jellybeans.vim
-"colorscheme jellybeans
+" Tommorow night colorscheme {{{2
 "
 colorscheme Tomorrow-Night-Bright
 
-" Powerline {{{2
+" Airline {{{2
 set laststatus=2
-
-" Taglist {{{2
-
-map <silent> <F4> :TlistToggle<CR>
-
-" Ctrlp {{{2
-"     cd ~/.vim/bundle
-"     git clone https://github.com/kien/ctrlp.vim.git
-noremap <silent> <F9> :CtrlPMRUFiles<CR>
-noremap <silent> <F12> :CtrlPBuffer<CR> 
-let g:ctrlp_max_height = 20
-set wildignore+=*.pyc
-set wildignore+=*_build/*
-set wildignore+=*/.hg/*
-set wildignore+=*/coverage/*
-set wildignore+=*.mp3,*.pdf,*.png,*.jpg,*.mov,*.bmp,*.mp4,*.avi,*.cbr,*.djvu,*.epub,*.mobi
+let g:airline_theme='powerlineish'
+let g:airline_left_sep=''
+let g:airline_right_sep=''
+let g:airline_enable_fugitive=1
 
 " Syntastic {{{2
 " git clone https://github.com/scrooloose/syntastic.git
 nnoremap <Leader>cR <plug>VCSRevert
 let VCSCommandDeleteOnHide=1
 
+
+" Unite {{{2
+let g:unite_source_history_yank_enable = 1
+call unite#filters#matcher_default#use(['matcher_fuzzy'])
+nnoremap <C-p> :<C-u>Unite -no-split -buffer-name=files -start-insert file_rec/async<cr>
+nnoremap <F10> :<C-u>Unite -no-split -buffer-name=files -start-insert file<cr>
+nnoremap <F9> :<C-u>Unite -no-split -buffer-name=mru   -start-insert file_mru<cr>
+nnoremap <F4> :<C-u>Unite -no-split -buffer-name=outline -start-insert outline<cr>
+nnoremap <Leader>m :<C-u>Unite -no-split -buffer-name=mark -start-insert mark<cr>
+nnoremap <leader>y :<C-u>Unite -no-split -buffer-name=yank -start-insert history/yank<cr>
+nnoremap <F12> :<C-u>Unite -no-split -buffer-name=buffer -start-insert buffer<cr>
+
+" Custom mappings for the unite buffer
+autocmd FileType unite call s:unite_settings()
+function! s:unite_settings()
+  " Enable navigation with control-j and control-k in insert mode
+  imap <buffer> <C-j>   <Plug>(unite_select_next_line)
+  imap <buffer> <C-k>   <Plug>(unite_select_previous_line)
+endfunction
+
+"
 " PLUGINS: Configurationless {{{1
 " -----------------------------------------------------------------------------