Advertisement
sacred_fox

.vimrc

Apr 19th, 2019
660
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 1.89 KB | None | 0 0
  1. if has("mouse")
  2.   set mouse=a
  3.   if &term =~ '^screen'
  4.     set ttymouse=xterm2
  5.   endif
  6. endif
  7. if has("cscope") && filereadable("/usr/bin/cscope")
  8.    set csprg=/usr/bin/cscope
  9.    set csto=0
  10.    set cst
  11.    set nocsverb
  12.    " add any database in current directory
  13.    if filereadable("cscope.out")
  14.       cs add cscope.out
  15.    " else add database pointed to by environment
  16.    elseif $CSCOPE_DB != ""
  17.       cs add $CSCOPE_DB
  18.    endif
  19.    set csverb
  20. endif
  21. if has("title")
  22.   set title
  23.   if &term =~ '^screen'
  24.     set t_ts=
  25.                  set t_fs=
  26.   endif
  27. endif
  28.  
  29. " stty on PuTTY does not generate ixany, while gnome-terminal does
  30. if &term =~ '^screen' || system('stty -F /dev/tty') !~ 'ixany'
  31.   set background=dark
  32. endif
  33.  
  34. set expandtab
  35. set ignorecase
  36. set number
  37. set showmatch
  38. set fileencodings=utf-8,euc-jp,sjis,iso-2022-jp,latin1
  39. set wildmode=list:longest
  40. augroup vimrc
  41.   autocmd!
  42.   autocmd FileType make setlocal noexpandtab
  43.   autocmd FileType c call FT_c()
  44.   autocmd FileType cpp call FT_c()
  45.   autocmd FileType perl call FT_perl()
  46.   autocmd FileType sh call FT_sh()
  47.   autocmd FileType bash call FT_sh()
  48.   if has("cscope") && filereadable("/usr/bin/cscope")
  49.     autocmd VimResized * cscope reset
  50.   endif
  51. augroup END
  52. function! FT_c()
  53.   setlocal shiftwidth=4
  54.   setlocal tabstop=8
  55.   setlocal cindent
  56. endfunction
  57. function! FT_perl()
  58.   setlocal noexpandtab
  59.   setlocal shiftwidth=2
  60.   setlocal tabstop=8
  61.   setlocal cindent
  62. endfunction
  63. function! FT_sh()
  64.   setlocal noexpandtab
  65.   setlocal shiftwidth=2
  66.   setlocal tabstop=8
  67. endfunction
  68. function! Kernel_source()
  69.   setlocal noexpandtab
  70.   setlocal shiftwidth=8
  71. endfunction
  72.  
  73. if &term =~ "xterm"
  74.   let &t_SI .= "\e[?2004h"
  75.   let &t_EI .= "\e[?2004l"
  76.   let &pastetoggle = "\e[201~"
  77.  
  78.   function XTermPasteBegin(ret)
  79.     set paste
  80.     return a:ret
  81.   endfunction
  82.  
  83.   inoremap <special> <expr> <Esc>[200~ XTermPasteBegin("")
  84. endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement