Guest User

Untitled

a guest
Jun 22nd, 2018
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.41 KB | None | 0 0
  1. " An example for a vimrc file.
  2.  
  3. " Maintainer: Bram Moolenaar <Bram@vim.org>
  4. " Last change: 2002 Sep 19
  5. "
  6. " To use it, copy it to
  7. " for Unix and OS/2: ~/.vimrc
  8. " for Amiga: s:.vimrc
  9. " for MS-DOS and Win32: $VIM\_vimrc
  10. " for OpenVMS: sys$login:.vimrc
  11.  
  12. " When started as "evim", evim.vim will already have done these settings.
  13. "
  14.  
  15.  
  16. if v:progname =~? "evim"
  17. finish
  18. endif
  19.  
  20. " Use Vim settings, rather then Vi settings (much better!).
  21. " This must be first, because it changes other options as a side effect.
  22. set nocompatible
  23.  
  24. " allow backspacing over everything in insert mode
  25. set backspace=indent,eol,start
  26.  
  27. set history=50 " keep 50 lines of command line history
  28. set ruler " show the cursor position all the time
  29. set showcmd " display incomplete commands
  30. set incsearch " do incremental searching
  31. set ignorecase
  32. set smartcase
  33. set list
  34. set lcs=tab:\ \ ,trail:~,extends:>,precedes:<
  35.  
  36.  
  37. " For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
  38. " let &guioptions = substitute(&guioptions, "t", "", "g")
  39.  
  40. " Don't use Ex mode, use Q for formatting
  41. map Q gq
  42.  
  43. " This is an alternative that also works in block mode, but the deleted
  44. " text is lost and it only works for putting the current register.
  45. "vnoremap p "_dp
  46.  
  47. " Switch syntax highlighting on, when the terminal has colors
  48. " Also switch on highlighting the last used search pattern.
  49. if &t_Co > 2 || has("gui_running")
  50. syntax on
  51. set hlsearch
  52. endif
  53.  
  54. " Only do this part when compiled with support for autocommands.
  55. if has("autocmd")
  56.  
  57. " Enable file type detection.
  58. " Use the default filetype settings, so that mail gets 'tw' set to 72,
  59. " 'cindent' is on in C files, etc.
  60. " Also load indent files, to automatically do language-dependent indenting.
  61. filetype plugin indent on
  62.  
  63. " Put these in an autocmd group, so that we can delete them easily.
  64. augroup vimrcEx
  65. au!
  66.  
  67. " For all text files set 'textwidth' to 78 characters.
  68. autocmd FileType text setlocal textwidth=78
  69.  
  70. " When editing a file, always jump to the last known cursor position.
  71. " Don't do it when the position is invalid or when inside an event handler
  72. " (happens when dropping a file on gvim).
  73. autocmd BufReadPost *
  74. \ if line("'\"") > 0 && line("'\"") <= line("$") |
  75. \ exe "normal g`\"" |
  76. \ endif
  77.  
  78. augroup END
  79.  
  80. else
  81.  
  82. set autoindent " always set autoindenting on
  83.  
  84. endif " has("autocmd")
  85.  
  86.  
  87. if has('gui_running')
  88. set guioptions+=a
  89. set guioptions+=c
  90. set guioptions-=T
  91. set guioptions-=e
  92. set guioptions-=m
  93. set guioptions-=r
  94. colorscheme xterm16
  95. if has('win32')
  96. set columns=120
  97. set lines=60
  98. set guifont=Consolas\ 11
  99. else
  100. set guifont=Lucida\ Console\ 11
  101. endif
  102. elseif (&term == 'xterm-color')
  103. set t_Co=256
  104. colorscheme xterm16
  105. elseif (&term == 'screen.linux') || (&term =~ '^linux')
  106. set t_Co=8
  107. colorscheme default
  108. elseif (&term == 'rxvt-unicode') || (&term =~ '^xterm') || (&term =~ '^screen-256')
  109. set t_Co=256
  110. set mouse=a
  111. set ttymouse=xterm
  112. set termencoding=utf-8
  113. colorscheme default
  114. else
  115. colorscheme default
  116. endif
  117.  
  118. set wildmenu
  119. set wildmode=longest:full,full
  120. set number
  121.  
  122. set tabstop=4
  123. set softtabstop=4
  124. set shiftwidth=4
  125. set expandtab
  126. set wrap
  127. "writes on make/shell commands
  128. set autowrite
  129. "set tags=~/etc/tags
  130. set backspace=indent,eol,start
  131. set showmatch
  132. "set cursorline
  133.  
  134. " man-page autoreturn after view
  135. map K K<cr>
  136. set pastetoggle=<f5>
  137.  
  138.  
  139. vmap <BS> x
  140.  
  141.  
  142. nmap <C-j> <C-W>j
  143. nmap <C-k> <C-W>k
  144. nmap <C-h> <C-W>h
  145. nmap <C-l> <C-W>l
  146. nmap X ci"
  147.  
  148. "TODO: Autosave en ~/.vim
  149. set backupdir=./.backup,~/.vim/backup_files,/tmp
  150. set dir=./.backpup,~/.vim/backup_files,/tmp
  151.  
  152. "para :W
  153. command! W w !sudo tee % > /dev/null
  154.  
  155. "siempre en la carpeta
  156. autocmd BufEnter * if bufname("") !~ "^\[A-Za-z0-9\]*://" | lcd %:p:h | endif
  157.  
  158. "workarround para el bug de el cursor
  159. set go-=L
  160. "workarround para el bug de los plugins
  161. set runtimepath+=/usr/share/vim
  162.  
  163. "para que deje de parpadear el cursor
  164. set gcr=a:blinkwait0,a:block-cursor
  165.  
  166. "para quitar el preview window de omni-complete
  167. "autocmd CursorMovedI * if pumvisible() == 0|pclose|endif
  168. "autocmd InsertLeave * if pumvisible() == 0|pclose|endif
  169.  
  170.  
  171. "apagar la estupida campanita
  172. set visualbell t_vb=
  173.  
  174. set linebreak
  175. noremap ,vim :new ~/.vimrc<cr>
  176. "lineas de contexto
  177. "set so 5
  178. "
  179.  
  180.  
  181. map <f12> :!ctags -f ~/.vim/localtags -R *.h *.c <CR><CR>
  182.  
  183. set tags=~/.vim/systags,~/.vim/localtags,./.tags
  184. let OmniCpp_NamespaceSearch = 1
  185. let OmniCpp_GlobalScopeSearch = 1
  186. let OmniCpp_ShowAccess = 1
  187. let OmniCpp_MayCompleteDot = 1
  188. let OmniCpp_MayCompleteArrow = 1
  189. let OmniCpp_MayCompleteScope = 1
  190. let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]
  191. " automatically open and close the popup menu / preview window
  192. au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
  193. set completeopt=menuone,menu,longest,preview
  194.  
  195.  
  196. "experimental
  197. autocmd BufRead,BufNew *.vala set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
  198. autocmd BufRead *.vapi set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
  199. au BufRead,BufNewFile *.vala setfiletype cs
  200. au BufRead,BufNewFile *.vala setfiletype cs
Add Comment
Please, Sign In to add comment