Commits

Gabriel AHTUNE committed 896e38d

Add tpope/unimpaired plugins, then remove some redundant mapping in vimrc

Comments (0)

Files changed (1)

 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 " F2:  SyntasticCheck
 " F3:  Toggle Color Column
-" F4:  vim-outline
-" F5:  Run current file
+" F4:  outline
 " F6:  Gundo
-" F7:  Toggle Spell checking
+" F7:  Cycle Spell checking
 " F8:  Cope
 " F9:  MRU
 " F10: Explorer
 " F12: Buffer list
-" C-F5: Compile/make/... 
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-" Automatic reloading of .vimrc {{{1
-if !exists("autocommandes_incluses")
-    let autocommandes_incluses=1
-    autocmd bufwritepost $MYVIMRC source $MYVIMRC
-    autocmd bufwritepost $MYVIMRC setlocal foldmethod=marker
-endif
-" }}}
 " GENERAL: CONFIGURATION       {{{1
 " -----------------------------------------------------------------------------
 
 set showbreak=↪
 set cmdwinheight=5
 set fillchars=""
+set shm=IflnxtToO
 au InsertEnter * set cul
 au InsertLeave * set nocul
 
 set copyindent
 set nowrap "Wrap lines
 set tw=79
-set bs=2
+set backspace=indent,eol,start
 set sidescroll=5 " slow side scroll
 nnoremap <silent> g= :let b:winview=winsaveview()<CR>gg=G:call winrestview(b:winview)<CR>
 
 nnoremap <Leader>l '0
 cnoremap w!! %!sudo tee > /dev/null %
 inoremap <C-u> <C-g>u<C-u>
-onoremap A :<C-u>normal! ggVG<CR>
-vnoremap A `<gg`>G
+onoremap All :<C-u>normal! ggVG<CR>
+vnoremap All `<gg`>G
+
 function! MakeExecutable()
     if (strpart(getline(1), 0, 2) == '#!')
         silent !chmod +x %
 nnoremap <silent> <Leader>w :r !echo "\#\! `which <cword>`"<CR>k"_dd
 
 " Buffers {{{2
-set hidden " Do not need to save file when opening a new file.
+set hidden " Do not need to save file when open a new file.
 nnoremap <Leader>b :enew<CR>
-nnoremap gb :bnext<CR>
-nnoremap gB :bprev<CR>
 map <Leader>x <ESC>:bd<CR>
 
 " Windows {{{2
 nnoremap <C-w>v <C-w>v<C-w>l
-nnoremap <C-w>s <C-w>s<C-w>j
+noremap <C-w>s <C-w>s<C-w>j
 nnoremap <Leader>ss :Windo set scrollbind!<CR>
 
-
 " Tags {{{2
 map <Leader>ct :!/usr/bin/ctags -R .<CR>
 
 " Indentation {{{2
 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
 
 " Search {{{2
-" Removes highlight of your last search
-noremap <silent> <Leader>n :nohl<CR>
-vnoremap <silent> <Leader>n <ESC>:nohl<CR>gv
-noremap <silent> <C-l> <C-L>:noh<CR>
-
-nnoremap <silent> _ *#
+nnoremap <silent> _ :let b:winview=winsaveview()<CR>*:call winrestview(b:winview)<CR>
 nnoremap <silent> <2-LeftMouse> <C-]>
 
 " Moving {{{2
 inoremap <expr> <PageUp>   pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<PageUp>"
 
 " Diff {{{2
-nnoremap <Leader>dd :vert diffsplit 
-nnoremap <Leader>dp :vert diffpatch 
+nnoremap <Leader>dd :vert diffsplit<space>
+nnoremap <Leader>dp :vert diffpatch<space>
 nnoremap <Leader>dw :Windo diffthis<CR>
 nnoremap <Leader>dx :Windo diffoff<CR>
 nnoremap <Leader>dt :diffthis<CR>
 " Explorer {{{2
 
 nn <Leader>cd :lcd %:h<CR>:pwd<CR>
-
-
 nn <Leader>e :e .<CR>7G
 
 " Cope {{{2
 vmap <Leader>ep :!python<CR>
 nmap <Leader>ep :%!python<CR>
 
-" PLUGINS: With configuration {{{1
+autocmd BufRead *.py set makeprg=python\ -c\ \"import\ py_compile,sys;\ sys.stderr=sys.stdout;\ py_compile.compile(r'%')\"
+autocmd BufRead *.py set efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m
+autocmd BufRead *.py nmap <F5> :!python %<CR>
+
+" PLUGINS: {{{1
 " -----------------------------------------------------------------------------
 
 if has('vim_starting')
    set runtimepath+=~/.vim/bundle/neobundle.vim/
- endif
-
+endif
 
 call neobundle#rc(expand('~/.vim/bundle/'))
 
-" Let NeoBundle manage NeoBundle
 NeoBundleFetch 'Shougo/neobundle.vim'
+NeoBundle 'jpalardy/vim-slime'
+NeoBundle 'phillipberndt/python-imports.vim'
+NeoBundle 'vim-scripts/python_match.vim'
+NeoBundle 'vim-scripts/matchit.zip'
+NeoBundle 'tpope/vim-surround'
+NeoBundle 'tpope/vim-unimpaired'
+NeoBundle 'tpope/vim-commentary'
+NeoBundle 'tpope/vim-repeat'
+NeoBundle 'https://bitbucket.org/larchange/supernormal'
+NeoBundle 'https://bitbucket.org/larchange/underline.vim'
+NeoBundle 'Shougo/unite-outline'
+NeoBundle 'michaeljsmith/vim-indent-object'
+NeoBundle 'Lokaltog/vim-easymotion'
 
-NeoBundle 'Shougo/vimproc'
-NeoBundle 'jpalardy/vim-slime'
+NeoBundle 'Shougo/vimproc', {
+     \ 'build' : {
+     \     'windows' : 'make -f make_mingw32.mak',
+     \     'unix' : 'make -f make_unix.mak',
+     \    },
+     \ }
+
 NeoBundle 'http://bitbucket.org/sjl/gundo.vim'
-
-        nnoremap <F6> :GundoToggle<CR>
-        inoremap <F6> <ESC>:GundoToggle<CR>
+    nnoremap <F6> :GundoToggle<CR>
+    inoremap <F6> <ESC>:GundoToggle<CR>
 
 NeoBundle  'git://repo.or.cz/vcscommand.git'
+    nnoremap <Leader>cR <plug>VCSRevert
+    let VCSCommandDeleteOnHide=1
 
-        nnoremap <Leader>cR <plug>VCSRevert
-        let VCSCommandDeleteOnHide=1
+NeoBundle 'nanotech/jellybeans.vim'
+    colorscheme jellybeans
 
+NeoBundle 'bling/vim-airline'
+    set laststatus=2
+    let g:airline_theme='powerlineish'
+    let g:airline_left_sep=''
+    let g:airline_right_sep=''
+
+NeoBundle 'Shougo/unite.vim'
+    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>
+    nnoremap <leader>fv :<C-u>Unite -start-insert -no-split -buffer-name=file_vcs file/vcs<CR>
+
+    " Custom mappings for the unite buffer
+    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)
+        nmap <buffer> <backspace> i<backspace>
+    endfunction
+    autocmd FileType unite call s:unite_settings()
 
 NeoBundleCheck
 
-" 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
-
-" colorscheme {{{2
-"
-colorscheme jellybeans
-
-" Airline {{{2
-set laststatus=2
-let g:airline_theme='powerlineish'
-let g:airline_left_sep=''
-let g:airline_right_sep=''
-
-" Syntastic {{{2
-" git clone https://github.com/scrooloose/syntastic.git
-let g:syntastic_error_symbol='✗'
-let g:syntastic_warning_symbol='⚠'
-let g:syntastic_auto_jump=1
-let g:syntastic_auto_loc_list=1
-let g:syntastic_mode_map = { 'mode': 'passive',
-            \ 'active_filetypes': [],
-            \ 'passive_filetypes': [] }
-map <F2> :w<CR>:SyntasticCheck<CR>
-
-
-
-" 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
-" -----------------------------------------------------------------------------
-
-" cd ~/.vim/bundle/
-" git clone https://github.com/phillipberndt/python-imports.vim.git
-" git clone https://github.com/vim-scripts/python_match.vim.git
-" git clone https://github.com/vim-scripts/matchit.zip.git
-" git clone https://github.com/kien/ctrlp.vim.git
-" git clone https://github.com/rstacruz/sparkup.git
-" git clone https://github.com/tpope/vim-surround
-" git clone https://github.com/psjay/python.vim.git
-" git clone https://github.com/tpope/vim-commentary.git
-" git clone https://github.com/tpope/vim-repeat.git
-" git clone https://github.com/vim-scripts/mru.vim.git
-
-" SuperNormal {{{2
-" hg clone https://bitbucket.org/larchange/supernormal
-" }}}
-
-" Underline
-" hg clone https://bitbucket.org/larchange/underline.vim
-
-" dotoutlinetree
-" git clone https://github.com/vim-scripts/DotOutlineTree.git
-
-" MRU {{{2
-" git clone https://github.com/vim-scripts/mru.vim.git
-
-
 " LAST: CONFIGURATIONS {{{1
 " -----------------------------------------------------------------------------
 
 " Apply the filetype customization only at the end... to avoid conflict
 filetype plugin on
 
-" vim: set ts=4 sw=4 tw=79 foldmethod=marker:
+" Automatic reloading of .vimrc {{{2
+if !exists("autocommandes_incluses")
+    let autocommandes_incluses=1
+    autocmd bufwritepost $MYVIMRC source $MYVIMRC
+    autocmd bufwritepost $MYVIMRC setlocal foldmethod=marker
+    setlocal foldmethod=marker
+endif
+" }}}