Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- color koehler
- set guioptions=
- set nocompatible
- syntax on
- set encoding=utf8
- set fileformats=unix,dos
- set nonu
- set nocul
- set nohls
- set laststatus=2
- set wildmenu
- set statusline=%<%f\ %h%m%r%=%{\"[\".(&fenc==\"\"?&enc:&fenc).((exists(\"+bomb\")\ &&\ &bomb)?\",B\":\"\").\"]\ \"}%k\ %-14.(%l,%c%V%)\ %P "%{VimBuddy()}"
- set hidden
- set ignorecase
- set smartcase
- set nostartofline
- set incsearch
- set showmatch
- filetype plugin indent on
- nnoremap <C-L> :nohl<CR><C-L>
- set showtabline=0
- set visualbell
- " set scrolloff=10
- set nobackup
- set noswapfile
- set splitright
- set expandtab
- set cm=blowfish
- let g:netrw_list_hide= '\..*$'
- set laststatus=2
- let g:mystatusline_actived = 1
- au BufNewFile,BufRead *.asm set filetype=fasm
- au BufNewFile,BufRead *.inc set filetype=fasm
- au BufNewFile,BufRead *.yar set syntax=yara
- au BufNewFile,BufRead *.boo set syntax=boo
- set formatoptions=t1
- "Useful plgins:
- "Powerline
- "RainbowParenthesis
- "Drawit
- "Edition
- noremap Y y$
- noremap K i<CR><Esc>
- nnoremap <CR> i<CR><Esc>
- inoremap <C-BS> <C-O>h<C-O>diw
- inoremap <C-Z> <C-O>u
- inoremap <C-Y> <C-O>:redo<CR>
- nnoremap <C-Y> :redo<CR>
- inoremap <C-S> <C-O>:w<CR>
- nnoremap <S-Left> hdlph
- nnoremap <S-Right> dlp
- nnoremap "" ci"
- nnoremap Q gqap
- command! -range=% SoftWrap
- \ <line2>put _ |
- \ <line1>,<line2>g/.\+/ .;-/^$/ join |normal $x
- nnoremap <Tab> ==
- nnoremap <C-i> <C-a>
- " noremap <Up> <NOP>
- " noremap <Down> <NOP>
- " noremap <Left> <NOP>
- " noremap <Right> <NOP>
- "Indentation
- set tabstop=4
- set backspace=2
- set shiftwidth=4
- set softtabstop=4
- "Spell
- if has("spell")
- set spelllang=fr_fr
- endif
- "Search
- command! -bang -nargs=+ Bufgrep execute 'vimgrep<bang><args> ' . join(map(filter(range(1, bufnr('$')), 'buflisted(v:val)'), '"#".v:val'), ' ')
- vnoremap <F2> "zd:vnew<CR>:set buftype=nofile<CR>:put! z<CR>Gddgg
- nnoremap <F3> :Bufgrep/\<<C-R><C-W>\>/g<CR>
- inoremap <F3> <C-O>:Bufgrep/\<<C-R><C-W>\>/g<CR>
- nnoremap <F4> :redir @z<CR>:g//<CR>:redir END<CR>:vnew<CR>:set buftype=nofile<CR>gg:put! z<CR><CR>Gddggdj
- "Files
- noremap , :b
- noremap ,, :ls<CR>:e #
- noremap ; :tag
- noremap ;; :tag <C-R><C-W><CR>
- noremap !! :NERDTreeFind<CR>
- inoremap !! <C-o>:NERDTreeFind<CR><Esc>
- nnoremap <BS> zfiB
- noremap <C-Right> :bn<CR>
- noremap <C-Left> :bN<CR>
- inoremap <A-Right> <C-O>:tabnext<CR>
- inoremap <A-Left> <C-O>:tabNext<CR>
- nnoremap <A-Right> :tabnext<CR>
- noremap <A-Left> :tabNext<CR>
- inoremap <C-Space> <C-P>
- nnoremap <C-BS> :Bclose<CR>
- noremap <leader>cd :cd %:p:h<CR>
- "Programmation
- inoremap {<CR> {<CR>}<C-O>O
- inoremap <F5> <C-O>:update<CR><C-O>:make<CR><CR>
- noremap <F5> :update<CR>:make<CR><CR>
- inoremap <F7> <C-O>:cn<CR>
- noremap <F7> :cn<CR>
- inoremap <F6> <C-O>:cN<CR>
- noremap <F6> :cN<CR>
- inoremap <F8> <C-O>:tn<CR>
- noremap <F8> :tn<CR>
- inoremap <F9> <C-O>:tN<CR>
- noremap <F9> :tN<CR>
- inoremap <F12> <Esc>vip:!python<CR><CR>i
- noremap <F12> vip:!python<CR><CR>
- autocmd FileType python nnoremap <buffer> <F11> :<C-u>let save_isk = &iskeyword \|
- \ set iskeyword+=. \|
- \ execute "Pyhelp " . expand("<cword>") \|
- \ let &iskeyword = save_isk<CR>
- command! -nargs=1 -bar Pyhelp :call ShowPydoc(<f-args>)
- "Plugins
- let g:DoxygenToolkit_briefTag_pre="\\brief "
- let g:DoxygenToolkit_paramTag_pre="\\param "
- let g:DoxygenToolkit_returnTag="\\returns "
- let g:DoxygenToolkit_blockHeader="**************************************************"
- let g:DoxygenToolkit_blockFooter="**************************************************"
- let g:DoxygenToolkit_authorName="Renaud Tabary"
- let g:DoxygenToolkit_licenseTag=""
- let g:load_doxygen_syntax=1
- let g:calendar_monday = 1
- let g:calendar_weeknm = 1 " WK01
- let g:calendar_datetime = 'title'
- "functions
- function! Warn(msg)
- echohl ErrorMsg
- echomsg a:msg
- echohl NONE
- endfunction
- function! ShowPydoc(what)
- let bufname = ".pydoc"
- " check if the buffer exists already
- if bufexists(bufname)
- let winnr = bufwinnr(bufname)
- if winnr != -1
- " if the buffer is already displayed, switch to that window
- execute winnr "wincmd w"
- else
- " otherwise, open the buffer in a split
- execute "sbuffer" bufname
- endif
- normal ggdG
- execute "r !" . g:pypath . "python" . " " . g:pypath . "Lib/pydoc.py" . " " . shellescape(a:what, 1)
- else
- " create a new buffer, set the nofile buftype and don't display it in the
- " buffer list
- execute "split" fnameescape(bufname)
- setlocal buftype=nofile
- setlocal nobuflisted
- " read the output from pydoc
- execute "r !" . g:pypath . "python" . " " . g:pypath . "Lib/pydoc.py" . " " . shellescape(a:what, 1)
- endif
- " go to the first line of the document
- 1
- endfunction
- " Command ':Bclose' executes ':bd' to delete buffer in current window.
- " The window will show the alternate buffer (Ctrl-^) if it exists,
- " or the previous buffer (:bp), or a blank buffer if no previous.
- " Command ':Bclose!' is the same, but executes ':bd!' (discard changes).
- " An optional argument can specify which buffer to close (name or number).
- function! Bclose(bang, buffer)
- if empty(a:buffer)
- let btarget = bufnr('%')
- elseif a:buffer =~ '^\d\+$'
- let btarget = bufnr(str2nr(a:buffer))
- else
- let btarget = bufnr(a:buffer)
- endif
- if btarget < 0
- call s:Warn('No matching buffer for '.a:buffer)
- return
- endif
- if empty(a:bang) && getbufvar(btarget, '&modified')
- call s:Warn('No write since last change for buffer '.btarget.' (use :Bclose!)')
- return
- endif
- " Numbers of windows that view target buffer which we will delete.
- let wnums = filter(range(1, winnr('$')), 'winbufnr(v:val) == btarget')
- let wcurrent = winnr()
- for w in wnums
- execute w.'wincmd w'
- let prevbuf = bufnr('#')
- if prevbuf > 0 && buflisted(prevbuf) && prevbuf != w
- buffer #
- else
- bprevious
- endif
- if btarget == bufnr('%')
- " Numbers of listed buffers which are not the target to be deleted.
- let blisted = filter(range(1, bufnr('$')), 'buflisted(v:val) && v:val != btarget')
- " Listed, not target, and not displayed.
- let bhidden = filter(copy(blisted), 'bufwinnr(v:val) < 0')
- " Take the first buffer, if any (could be more intelligent).
- let bjump = (bhidden + blisted + [-1])[0]
- if bjump > 0
- execute 'buffer '.bjump
- else
- execute 'enew'.a:bang
- endif
- endif
- endfor
- execute 'bdelete'.a:bang.' '.btarget
- execute wcurrent.'wincmd w'
- endfunction
- command! -bang -complete=buffer -nargs=? Bclose call Bclose('<bang>', '<args>')
- "abbrevation latex
- noreab bitem \begin{itemize}<CR>\item <CR>\end{itemize}<CR>
- noreab bfra \begin{frame}<CR> <CR>\end{frame}<CR>
- noreab bfri \begin{frame}<CR>\begin{itemize}<CR>\item <CR>\end{itemize}<CR>\end{frame}<CR>
- noreab benu \begin{enumerate}<CR>\item <CR>\end{enumerate}<CR>
- noreab btab \begin{tabular}{c \| c}<CR>\hline<CR>bla & bla \\<CR>\hline<CR>\end{tabular}
- """"""""""""""""""""""""""""""""""""""""""""""""""" MSWIN
- " Set options and add mapping such that Vim behaves a lot like MS-Windows
- " set the 'cpoptions' to its Vim default
- if 1 " only do this when compiled with expression evaluation
- let s:save_cpo = &cpoptions
- endif
- set cpo&vim
- " set 'selection', 'selectmode', 'mousemodel' and 'keymodel' for MS-Windows
- behave mswin
- " backspace and cursor keys wrap to previous/next line
- set backspace=indent,eol,start whichwrap+=<,>,[,]
- " backspace in Visual mode deletes selection
- vnoremap <BS> d
- " CTRL-X and SHIFT-Del are Cut
- vnoremap <C-X> "+x
- vnoremap <S-Del> "+x
- " CTRL-C and CTRL-Insert are Copy
- vnoremap <C-C> "+y
- vnoremap <C-Insert> "+y
- " CTRL-V and SHIFT-Insert are Paste
- map <C-V> "+gP
- map <S-Insert> "+gP
- cmap <C-V> <C-R>+
- cmap <S-Insert> <C-R>+
- " Pasting blockwise and linewise selections is not possible in Insert and
- " Visual mode without the +virtualedit feature. They are pasted as if they
- " were characterwise instead.
- " Uses the paste.vim autoload script.
- exe 'inoremap <script> <C-V>' paste#paste_cmd['i']
- exe 'vnoremap <script> <C-V>' paste#paste_cmd['v']
- " Use CTRL-Q to do what CTRL-V used to do
- noremap <C-Q> <C-V>
- " Use CTRL-S for saving, also in Insert mode
- noremap <C-S> :update<CR>
- vnoremap <C-S> <C-C>:update<CR>
- inoremap <C-S> <C-O>:update<CR>
- " For CTRL-V to work autoselect must be off.
- " On Unix we have two selections, autoselect can be used.
- if !has("unix")
- set guioptions-=a
- endif
- " CTRL-Z is Undo; not in cmdline though
- noremap <C-Z> u
- inoremap <C-Z> <C-O>u
- " CTRL-Y is Redo (although not repeat); not in cmdline though
- noremap <C-Y> <C-R>
- inoremap <C-Y> <C-O><C-R>
- " CTRL-A is Select all
- "noremap <C-A> gggH<C-O>G
- "inoremap <C-A> <C-O>gg<C-O>gH<C-O>G
- "cnoremap <C-A> <C-C>gggH<C-O>G
- "onoremap <C-A> <C-C>gggH<C-O>G
- "snoremap <C-A> <C-C>gggH<C-O>G
- "xnoremap <C-A> <C-C>ggVG
- " CTRL-Tab is Next window
- noremap <C-Tab> <C-W>w
- inoremap <C-Tab> <C-O><C-W>w
- cnoremap <C-Tab> <C-C><C-W>w
- onoremap <C-Tab> <C-C><C-W>w
- " restore 'cpoptions'
- set cpo&
- if 1
- let &cpoptions = s:save_cpo
- unlet s:save_cpo
- endif
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- let g:vimwiki_list = [{'path': '~/doc/wiki/',
- \ 'path_html': '~/doc/wiki/html/',
- \ 'template_path': '~/doc/wiki/html/'}]
- let g:cpplint_cmd = "python ~/projets/sandbox-csi/docs/dev-docs/Cpplint.py"
Advertisement
Add Comment
Please, Sign In to add comment