Guest User

Untitled

a guest
Jan 5th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 5.47 KB | None | 0 0
  1. " REQUIRED. This makes vim invoke Latex-Suite when you open a tex file.
  2. filetype plugin on
  3.  
  4. " IMPORTANT: win32 users will need to have 'shellslash' set so that latex
  5. " can be called correctly.
  6. set shellslash
  7.  
  8. " IMPORTANT: grep will sometimes skip displaying the file name if you
  9. " search in a singe file. This will confuse Latex-Suite. Set your grep
  10. " program to always generate a file-name.
  11. set grepprg=grep\ -nH\ $*
  12. set backspace+=indent,eol,start
  13.  
  14. " OPTIONAL: This enables automatic indentation as you type.
  15. filetype indent on
  16.  
  17. " OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to
  18. " 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
  19. " The following changes the default filetype back to 'tex':
  20. let g:tex_flavor='latex'
  21.  
  22. syntax on
  23.  
  24. set ruler
  25.  
  26. "---------
  27. syn on
  28. set nu
  29. set nowrap
  30. set linebreak
  31. set showbreak=>>>
  32. "colorscheme zenburn
  33. colorscheme wombat256
  34. set hls
  35. "set incsearch             " use incremental search
  36. set autoindent
  37. set smartindent
  38. set cino=i0
  39. set mouse=a
  40. set mousemodel=popup
  41. set hidden
  42. set t_Co=256
  43. set so=5
  44.  
  45. set tabstop=2
  46. set softtabstop=2
  47. set expandtab
  48. set shiftwidth=2
  49. set laststatus=2
  50. set statusline=%h%m%r%w%y\ %f%=l:%l\/%L\ c:%c\ p:%o\ a:0x%B\ %P
  51. set cursorline
  52. let fortran_free_source=1
  53.  
  54. "Spell checking
  55. nmap <Leader>se :setlocal spell spelllang=en_us<CR>
  56. nmap <Leader>su :setlocal spell spelllang=en_gb<CR>
  57. nmap <Leader>sb :setlocal spell spelllang=en_gb<CR>
  58. nmap <Leader>sg :setlocal spell spelllang=de_ch<CR>
  59.  
  60. "Buffers
  61. map <C-L> <ESC>:bn<cr>
  62. map <C-H> <ESC>:bp<cr>
  63. imap <C-L> <ESC>:bn<cr>i
  64. imap <C-H> <ESC>:bp<cr>i
  65.  
  66. "Tab commands
  67. map <C-tab> :bn<cr>
  68. map <C-S-tab> :bp<cr>
  69. map <F3> :bn<cr>
  70. map <F4> :bp<cr>
  71.  
  72. "copy paste with insert
  73. imap <S-Del> <ESC>"+di
  74. imap <C-Insert> <ESC>:set paste<CR>"+y:set nopaste<CR>i
  75. imap <S-Insert> <ESC>:set paste<CR>"+P:set nopaste<CR>i
  76.  
  77. map <S-Del> "+d
  78. map <C-Insert> "+y
  79. map <C-S-Insert> "*y
  80. map <S-Insert> :set paste<CR>"+p:set nopaste<CR>
  81.  
  82. "-------------------------------------------------------------------------------
  83. " Moving cursor to other windows
  84. "
  85. " shift down   : change window focus to lower one (cyclic)
  86. " shift up     : change window focus to upper one (cyclic)
  87. " shift left   : change window focus to one on left
  88. " shift right  : change window focus to one on right
  89. "-------------------------------------------------------------------------------
  90. "
  91. nmap <s-down>   <c-w>w
  92. nmap <c-s-down>   <c-w>w<c-w>_
  93. nmap <s-up>     <c-w>W
  94. nmap <c-s-up>     <c-w>W<c-w>_
  95. nmap <s-left>   <c-w>h
  96. nmap <c-s-left>   <c-w>h<c-w>\|
  97. nmap <s-right>  <c-w>l
  98. nmap <c-s-right>  <c-w>l<c-w>\|
  99.  
  100. "Quickfix windows + errors
  101. imap <F5> <ESC>:make <cr>i
  102. map  <F5> <ESC>:make <cr>
  103. imap <S-F5> <ESC>:make install<cr>i
  104. map  <S-F5> <ESC>:make install<cr>
  105. imap <C-F5> <ESC>:make clean<cr>:make install<cr>i
  106. map  <C-F5> <ESC>:make clean<cr>:make install<cr>
  107.  
  108. map   <silent> <F6>    :copen<CR>
  109. map   <silent> <S-F6>  :cclose<CR>
  110. map   <silent> <F7>    :cp<CR>
  111. map   <silent> <F8>    :cn<CR>
  112.  
  113. imap  <silent> <F6>    <Esc>:copen<CR>
  114. imap  <silent> <S-F6>  <Esc>:cclose<CR>
  115. imap  <silent> <F7>    <Esc>:cp<CR>
  116. imap  <silent> <F8>    <Esc>:cn<CR>
  117.  
  118. "-------------------------------------------------------------------------------
  119. " Filename completion
  120. "
  121. "   wildmenu : command-line completion operates in an enhanced mode
  122. " wildignore : A file that matches with one of these
  123. "              patterns is ignored when completing file or directory names.
  124. "-------------------------------------------------------------------------------
  125. "
  126. set wildmenu
  127. set wildignore=*.bak,*.o,*.e,*~
  128.  
  129. " Folding
  130. "highlight Folded ctermfg=yellow ctermbg=NONE
  131. vmap <space> zf
  132. nmap <space> za
  133. nmap <S-space> zd
  134. nmap <C-space> zA
  135. set foldcolumn=2
  136. set foldmethod=syntax
  137. set foldlevelstart=2
  138.  
  139. " Tags
  140. set tags=./tags
  141. set tags+=/home/sandro/gravis/src/libs/tags
  142. "set tags+=/home/sandro/.vim/tags/stl
  143.  
  144. nnoremap <F2> :buffers<CR>:buffer<Space>
  145.  
  146. set guifont=Monospace\ 13
  147. set guioptions-=m
  148. set guioptions-=T
  149. set guioptions-=r
  150. set guioptions-=L
  151.  
  152. " Formatting
  153. nmap Q gwap
  154.  
  155. nnoremap <silent> <PageUp> <C-U><C-U>
  156. vnoremap <silent> <PageUp> <C-U><C-U>
  157. inoremap <silent> <PageUp> <C-\><C-O><C-U><C-\><C-O><C-U>
  158.  
  159. nnoremap <silent> <PageDown> <C-D><C-D>
  160. vnoremap <silent> <PageDown> <C-D><C-D>
  161. inoremap <silent> <PageDown> <C-\><C-O><C-D><C-\><C-O><C-D>
  162.  
  163. nmap <Up> gk
  164. nmap <Down> gj
  165.  
  166. "
  167. " OmniCppComplete
  168. "let OmniCpp_NamespaceSearch = 1
  169. "let OmniCpp_GlobalScopeSearch = 1
  170. "let OmniCpp_ShowAccess = 1
  171. "let OmniCpp_MayCompleteDot = 1
  172. "let OmniCpp_MayCompleteArrow = 1
  173. "let OmniCpp_MayCompleteScope = 1
  174. "let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]
  175.  
  176. " build tags of your own project with CTRL+F12
  177. "map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
  178. noremap <F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<cr>
  179. inoremap <F12> <Esc>:!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<cr>
  180.  
  181. "Language
  182. au BufRead,BufNewFile *.smp set filetype=sampling
  183. au! Syntax sampling source $HOME/.vim/syntax/sampling.vim
  184. au BufRead,BufNewFile *.scv set filetype=veritas
  185. au! Syntax veritas source $HOME/.vim/syntax/veritas_scripting.vim
  186.  
  187. function! s:insert_gates()
  188.   let gatename = substitute(toupper(expand("%:t")), "\\.", "_", "g")
  189.   execute "normal! i#ifndef " . gatename
  190.   execute "normal! o#define " . gatename . " "
  191.   execute "normal! Go#endif /* " . gatename . " */"
  192.   normal! kk
  193. endfunction
  194. autocmd BufNewFile *.{h,hpp} call <SID>insert_gates()
Add Comment
Please, Sign In to add comment