Guest User

Untitled

a guest
May 22nd, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.33 KB | None | 0 0
  1. color koehler
  2. set guioptions=
  3. set nocompatible
  4. syntax on
  5. set encoding=utf8
  6. set fileformats=unix,dos
  7. set nonu
  8. set nocul
  9. set nohls
  10. set laststatus=2
  11. set wildmenu
  12. set statusline=%<%f\ %h%m%r%=%{\"[\".(&fenc==\"\"?&enc:&fenc).((exists(\"+bomb\")\ &&\ &bomb)?\",B\":\"\").\"]\ \"}%k\ %-14.(%l,%c%V%)\ %P "%{VimBuddy()}"
  13. set hidden
  14. set ignorecase
  15. set smartcase
  16. set nostartofline
  17. set incsearch
  18. set showmatch
  19. filetype plugin indent on
  20. nnoremap <C-L> :nohl<CR><C-L>
  21. set showtabline=0
  22. set visualbell
  23. " set scrolloff=10
  24. set nobackup
  25. set noswapfile
  26. set splitright
  27. set expandtab
  28. set cm=blowfish
  29. let g:netrw_list_hide= '\..*$'
  30.  
  31. set laststatus=2
  32. let g:mystatusline_actived = 1
  33.  
  34. au BufNewFile,BufRead *.asm set filetype=fasm
  35. au BufNewFile,BufRead *.inc set filetype=fasm
  36. au BufNewFile,BufRead *.yar set syntax=yara
  37. au BufNewFile,BufRead *.boo set syntax=boo
  38.  
  39. set formatoptions=t1
  40.  
  41. "Useful plgins:
  42. "Powerline
  43. "RainbowParenthesis
  44. "Drawit
  45.  
  46.  
  47. "Edition
  48. noremap Y y$
  49. noremap K i<CR><Esc>
  50. nnoremap <CR> i<CR><Esc>
  51. inoremap <C-BS> <C-O>h<C-O>diw
  52. inoremap <C-Z> <C-O>u
  53. inoremap <C-Y> <C-O>:redo<CR>
  54. nnoremap <C-Y> :redo<CR>
  55. inoremap <C-S> <C-O>:w<CR>
  56. nnoremap <S-Left> hdlph
  57. nnoremap <S-Right> dlp
  58. nnoremap "" ci"
  59. nnoremap Q gqap
  60. command! -range=% SoftWrap
  61. \ <line2>put _ |
  62. \ <line1>,<line2>g/.\+/ .;-/^$/ join |normal $x
  63. nnoremap <Tab> ==
  64. nnoremap <C-i> <C-a>
  65. " noremap <Up> <NOP>
  66. " noremap <Down> <NOP>
  67. " noremap <Left> <NOP>
  68. " noremap <Right> <NOP>
  69.  
  70. "Indentation
  71. set tabstop=4
  72. set backspace=2
  73. set shiftwidth=4
  74. set softtabstop=4
  75.  
  76. "Spell
  77. if has("spell")
  78. set spelllang=fr_fr
  79. endif
  80.  
  81. "Search
  82. command! -bang -nargs=+ Bufgrep execute 'vimgrep<bang><args> ' . join(map(filter(range(1, bufnr('$')), 'buflisted(v:val)'), '"#".v:val'), ' ')
  83. vnoremap <F2> "zd:vnew<CR>:set buftype=nofile<CR>:put! z<CR>Gddgg
  84. nnoremap <F3> :Bufgrep/\<<C-R><C-W>\>/g<CR>
  85. inoremap <F3> <C-O>:Bufgrep/\<<C-R><C-W>\>/g<CR>
  86. nnoremap <F4> :redir @z<CR>:g//<CR>:redir END<CR>:vnew<CR>:set buftype=nofile<CR>gg:put! z<CR><CR>Gddggdj
  87.  
  88. "Files
  89. noremap , :b
  90. noremap ,, :ls<CR>:e #
  91. noremap ; :tag
  92. noremap ;; :tag <C-R><C-W><CR>
  93. noremap !! :NERDTreeFind<CR>
  94. inoremap !! <C-o>:NERDTreeFind<CR><Esc>
  95. nnoremap <BS> zfiB
  96. noremap <C-Right> :bn<CR>
  97. noremap <C-Left> :bN<CR>
  98. inoremap <A-Right> <C-O>:tabnext<CR>
  99. inoremap <A-Left> <C-O>:tabNext<CR>
  100. nnoremap <A-Right> :tabnext<CR>
  101. noremap <A-Left> :tabNext<CR>
  102. inoremap <C-Space> <C-P>
  103. nnoremap <C-BS> :Bclose<CR>
  104. noremap <leader>cd :cd %:p:h<CR>
  105.  
  106.  
  107. "Programmation
  108. inoremap {<CR> {<CR>}<C-O>O
  109. inoremap <F5> <C-O>:update<CR><C-O>:make<CR><CR>
  110. noremap <F5> :update<CR>:make<CR><CR>
  111. inoremap <F7> <C-O>:cn<CR>
  112. noremap <F7> :cn<CR>
  113. inoremap <F6> <C-O>:cN<CR>
  114. noremap <F6> :cN<CR>
  115. inoremap <F8> <C-O>:tn<CR>
  116. noremap <F8> :tn<CR>
  117. inoremap <F9> <C-O>:tN<CR>
  118. noremap <F9> :tN<CR>
  119. inoremap <F12> <Esc>vip:!python<CR><CR>i
  120. noremap <F12> vip:!python<CR><CR>
  121. autocmd FileType python nnoremap <buffer> <F11> :<C-u>let save_isk = &iskeyword \|
  122. \ set iskeyword+=. \|
  123. \ execute "Pyhelp " . expand("<cword>") \|
  124. \ let &iskeyword = save_isk<CR>
  125. command! -nargs=1 -bar Pyhelp :call ShowPydoc(<f-args>)
  126.  
  127. "Plugins
  128. let g:DoxygenToolkit_briefTag_pre="\\brief "
  129. let g:DoxygenToolkit_paramTag_pre="\\param "
  130. let g:DoxygenToolkit_returnTag="\\returns "
  131. let g:DoxygenToolkit_blockHeader="**************************************************"
  132. let g:DoxygenToolkit_blockFooter="**************************************************"
  133. let g:DoxygenToolkit_authorName="Renaud Tabary"
  134. let g:DoxygenToolkit_licenseTag=""
  135. let g:load_doxygen_syntax=1
  136.  
  137. let g:calendar_monday = 1
  138. let g:calendar_weeknm = 1 " WK01
  139. let g:calendar_datetime = 'title'
  140.  
  141. "functions
  142.  
  143. function! Warn(msg)
  144. echohl ErrorMsg
  145. echomsg a:msg
  146. echohl NONE
  147. endfunction
  148.  
  149.  
  150. function! ShowPydoc(what)
  151. let bufname = ".pydoc"
  152. " check if the buffer exists already
  153. if bufexists(bufname)
  154. let winnr = bufwinnr(bufname)
  155. if winnr != -1
  156. " if the buffer is already displayed, switch to that window
  157. execute winnr "wincmd w"
  158. else
  159. " otherwise, open the buffer in a split
  160. execute "sbuffer" bufname
  161. endif
  162. normal ggdG
  163. execute "r !" . g:pypath . "python" . " " . g:pypath . "Lib/pydoc.py" . " " . shellescape(a:what, 1)
  164. else
  165. " create a new buffer, set the nofile buftype and don't display it in the
  166. " buffer list
  167. execute "split" fnameescape(bufname)
  168. setlocal buftype=nofile
  169. setlocal nobuflisted
  170. " read the output from pydoc
  171. execute "r !" . g:pypath . "python" . " " . g:pypath . "Lib/pydoc.py" . " " . shellescape(a:what, 1)
  172. endif
  173. " go to the first line of the document
  174. 1
  175. endfunction
  176.  
  177.  
  178. " Command ':Bclose' executes ':bd' to delete buffer in current window.
  179. " The window will show the alternate buffer (Ctrl-^) if it exists,
  180. " or the previous buffer (:bp), or a blank buffer if no previous.
  181. " Command ':Bclose!' is the same, but executes ':bd!' (discard changes).
  182. " An optional argument can specify which buffer to close (name or number).
  183. function! Bclose(bang, buffer)
  184. if empty(a:buffer)
  185. let btarget = bufnr('%')
  186. elseif a:buffer =~ '^\d\+$'
  187. let btarget = bufnr(str2nr(a:buffer))
  188. else
  189. let btarget = bufnr(a:buffer)
  190. endif
  191. if btarget < 0
  192. call s:Warn('No matching buffer for '.a:buffer)
  193. return
  194. endif
  195. if empty(a:bang) && getbufvar(btarget, '&modified')
  196. call s:Warn('No write since last change for buffer '.btarget.' (use :Bclose!)')
  197. return
  198. endif
  199. " Numbers of windows that view target buffer which we will delete.
  200. let wnums = filter(range(1, winnr('$')), 'winbufnr(v:val) == btarget')
  201. let wcurrent = winnr()
  202. for w in wnums
  203. execute w.'wincmd w'
  204. let prevbuf = bufnr('#')
  205. if prevbuf > 0 && buflisted(prevbuf) && prevbuf != w
  206. buffer #
  207. else
  208. bprevious
  209. endif
  210. if btarget == bufnr('%')
  211. " Numbers of listed buffers which are not the target to be deleted.
  212. let blisted = filter(range(1, bufnr('$')), 'buflisted(v:val) && v:val != btarget')
  213. " Listed, not target, and not displayed.
  214. let bhidden = filter(copy(blisted), 'bufwinnr(v:val) < 0')
  215. " Take the first buffer, if any (could be more intelligent).
  216. let bjump = (bhidden + blisted + [-1])[0]
  217. if bjump > 0
  218. execute 'buffer '.bjump
  219. else
  220. execute 'enew'.a:bang
  221. endif
  222. endif
  223. endfor
  224. execute 'bdelete'.a:bang.' '.btarget
  225. execute wcurrent.'wincmd w'
  226. endfunction
  227. command! -bang -complete=buffer -nargs=? Bclose call Bclose('<bang>', '<args>')
  228.  
  229. "abbrevation latex
  230. noreab bitem \begin{itemize}<CR>\item <CR>\end{itemize}<CR>
  231. noreab bfra \begin{frame}<CR> <CR>\end{frame}<CR>
  232. noreab bfri \begin{frame}<CR>\begin{itemize}<CR>\item <CR>\end{itemize}<CR>\end{frame}<CR>
  233. noreab benu \begin{enumerate}<CR>\item <CR>\end{enumerate}<CR>
  234. noreab btab \begin{tabular}{c \| c}<CR>\hline<CR>bla & bla \\<CR>\hline<CR>\end{tabular}
  235.  
  236. """"""""""""""""""""""""""""""""""""""""""""""""""" MSWIN
  237. " Set options and add mapping such that Vim behaves a lot like MS-Windows
  238.  
  239. " set the 'cpoptions' to its Vim default
  240. if 1 " only do this when compiled with expression evaluation
  241. let s:save_cpo = &cpoptions
  242. endif
  243. set cpo&vim
  244.  
  245. " set 'selection', 'selectmode', 'mousemodel' and 'keymodel' for MS-Windows
  246. behave mswin
  247.  
  248. " backspace and cursor keys wrap to previous/next line
  249. set backspace=indent,eol,start whichwrap+=<,>,[,]
  250.  
  251. " backspace in Visual mode deletes selection
  252. vnoremap <BS> d
  253.  
  254. " CTRL-X and SHIFT-Del are Cut
  255. vnoremap <C-X> "+x
  256. vnoremap <S-Del> "+x
  257.  
  258. " CTRL-C and CTRL-Insert are Copy
  259. vnoremap <C-C> "+y
  260. vnoremap <C-Insert> "+y
  261.  
  262. " CTRL-V and SHIFT-Insert are Paste
  263. map <C-V> "+gP
  264. map <S-Insert> "+gP
  265.  
  266. cmap <C-V> <C-R>+
  267. cmap <S-Insert> <C-R>+
  268.  
  269. " Pasting blockwise and linewise selections is not possible in Insert and
  270. " Visual mode without the +virtualedit feature. They are pasted as if they
  271. " were characterwise instead.
  272. " Uses the paste.vim autoload script.
  273.  
  274. exe 'inoremap <script> <C-V>' paste#paste_cmd['i']
  275. exe 'vnoremap <script> <C-V>' paste#paste_cmd['v']
  276.  
  277. " Use CTRL-Q to do what CTRL-V used to do
  278. noremap <C-Q> <C-V>
  279.  
  280. " Use CTRL-S for saving, also in Insert mode
  281. noremap <C-S> :update<CR>
  282. vnoremap <C-S> <C-C>:update<CR>
  283. inoremap <C-S> <C-O>:update<CR>
  284.  
  285. " For CTRL-V to work autoselect must be off.
  286. " On Unix we have two selections, autoselect can be used.
  287. if !has("unix")
  288. set guioptions-=a
  289. endif
  290.  
  291. " CTRL-Z is Undo; not in cmdline though
  292. noremap <C-Z> u
  293. inoremap <C-Z> <C-O>u
  294.  
  295. " CTRL-Y is Redo (although not repeat); not in cmdline though
  296. noremap <C-Y> <C-R>
  297. inoremap <C-Y> <C-O><C-R>
  298.  
  299. " CTRL-A is Select all
  300. "noremap <C-A> gggH<C-O>G
  301. "inoremap <C-A> <C-O>gg<C-O>gH<C-O>G
  302. "cnoremap <C-A> <C-C>gggH<C-O>G
  303. "onoremap <C-A> <C-C>gggH<C-O>G
  304. "snoremap <C-A> <C-C>gggH<C-O>G
  305. "xnoremap <C-A> <C-C>ggVG
  306.  
  307. " CTRL-Tab is Next window
  308. noremap <C-Tab> <C-W>w
  309. inoremap <C-Tab> <C-O><C-W>w
  310. cnoremap <C-Tab> <C-C><C-W>w
  311. onoremap <C-Tab> <C-C><C-W>w
  312.  
  313. " restore 'cpoptions'
  314. set cpo&
  315. if 1
  316. let &cpoptions = s:save_cpo
  317. unlet s:save_cpo
  318. endif
  319.  
  320. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  321. let g:vimwiki_list = [{'path': '~/doc/wiki/',
  322. \ 'path_html': '~/doc/wiki/html/',
  323. \ 'template_path': '~/doc/wiki/html/'}]
  324.  
  325. let g:cpplint_cmd = "python ~/projets/sandbox-csi/docs/dev-docs/Cpplint.py"
Advertisement
Add Comment
Please, Sign In to add comment