Advertisement
BenjaminPlays

fu LOL Code - Garry's Mod

Sep 29th, 2020
1,933
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. " When started as "evim", evim.vim will already have done these settings.
  2. if v:progname =~? "evim"
  3.    finish
  4. endif
  5.  
  6. " Use Vim settings, rather then Vi settings (much better!).
  7. " This must be first, because it changes other options as a side effect.
  8. set nocompatible
  9.  
  10. " allow backspacing over everything IN insert mode
  11. set backspace=indent,eol,start
  12.  
  13. set nobackup
  14. set history=50    " keep 50 lines of command line history
  15. set ruler    " show the cursor position all the time
  16. set showcmd    " display incomplete commands
  17. set incsearch    " do incremental searching
  18.  
  19. fu! SpellPTBROnOff()
  20.     if !exists('g:spellptbr')
  21.         let g:spellptbr=1 | setlocal spell spelllang=pt
  22.         echo "correção ortográfica para pt_br"
  23.     else
  24.         unlet g:spellptbr | setlocal nospell
  25.         echo "desativando correção ortográfica para pt_br"
  26.     endif
  27. endfu
  28. map <F8> :call SpellPTBROnOff()<cr>
  29.  
  30. setlocal spell spelllang=
  31. fu! SpellOnOff()
  32.     if !exists('g:spell')
  33.         let g:spell=1 | setlocal spell spelllang=en_us
  34.         echo "spell checking for en_us"
  35.     else
  36.         unlet g:spell | setlocal nospell
  37.         echo "disabling spell checking for en_us"
  38.     endif
  39. endfu
  40. map <F7> :call SpellOnOff()<cr>
  41.  
  42. " Don't use Ex mode, use Q for formatting
  43. map Q gq
  44.  
  45. " Switch syntax highlighting ON, when the terminal HAS colors
  46. " Also switch on highlighting the last used search pattern.
  47. if &t_Co > 2 || has("gui_running")
  48.    syntax on
  49.    set hlsearch
  50. endif
  51.  
  52. " Only do this part when compiled WITH support for autocommands.
  53. if HAS("autocmd")
  54.  
  55.     " Enable file type detection.
  56.    " Use the default filetype settings, SO that mail gets 'tw' set to 72,
  57.     " 'cindent' is on in C files, etc.
  58.    " Also load indent files, to automatically do language-dependent indenting.
  59.     filetype plugin indent ON
  60.  
  61.     " Put these in an autocmd group, so that we can delete them easily.
  62.    augroup vimrcEx
  63.        au!
  64.  
  65.        " For all text files set 'textwidth' to 78 characters.
  66.         autocmd FileType text setlocal textwidth=78
  67.  
  68.         " When editing a file, always jump to the last known cursor position.
  69.        " Don't do it when the position is invalid or when inside AN event handler
  70.         " (happens when dropping a file on gvim).
  71.        autocmd BufReadPost *
  72.                    \ if line("'\"") > 0 && line("'\"") <= line("$") |
  73.                    \   exe "normal g`\"" |
  74.                     \ endif
  75.  
  76.     augroup END
  77.  
  78. else
  79.  
  80.     set autoindent    " always set autoindenting on
  81.  
  82. endif " HAS("autocmd")
  83.  
  84. " zero configs :-)
  85. set nowrap
  86. set number
  87. set showmatch
  88. set title
  89. syntax on
  90. syntax enable
  91. set background=light
  92.  
  93. " comeca vim com mouse desabilitado
  94. " set mouse=
  95.  
  96. " Navegar Entre as Tabs
  97. :nmap <C-t>  :tabnew .    <CR>
  98.  
  99. "Gambiarras com tags!
  100. : nmap <C-b> :pop <cr>
  101.  
  102. " Quando abrir um qualquercoisa.sh automativcamente adiciona um #!/bin/bash na
  103. " primeira linha do arquivo
  104. autocmd BufNewFile *.sh execute "normal I#/bin/bash\<C-M>\<C-M>"
  105.  
  106. " Ajusta autocomplete com menu que visualiza opcoes
  107. set wildmenu
  108. set wildmode=full
  109. set wildmode=longest,list:full
  110.  
  111. " Habilita e desabilita o mouse
  112. fu! MouseOnOff()
  113.    if !exists('g:setmouse')
  114.        let g:setmouse=1 | set mouse=a
  115.        echo "mouse ON"
  116.    else
  117.        unlet g:setmouse | set mouse=
  118.        echo "mouse OFF"
  119.    endif
  120. endfu
  121. "set mouse=a
  122. "let g:setmouse=1
  123. map <F2> :call MouseOnOff()<cr>
  124.  
  125. " Desabilitar o arquivo de swp
  126. " By: Ursula
  127. set nobackup
  128. set nowb
  129. set noswapfile
  130.  
  131. "" Algumas porcarias quando usar gvim
  132. if has("gui_running")
  133.    "colorscheme solarized
  134.     colorscheme lettuce
  135.     "colorscheme default
  136.    "set toolbar=
  137.     set go=
  138.     set guifont=Monospace\ 8
  139.     highlight Visual guibg=grey30
  140.     highlight StatusLine guifg=Black guibg=grey20
  141.  
  142.     " realcar a linha atual
  143.    set cul
  144.    hi cursorline guibg=grey10
  145. else
  146.    "colorscheme solarized
  147.     colorscheme lettuce
  148.     "colorscheme default
  149.  
  150.    highlight StatusLine guifg=White guibg=Blue
  151. endif
  152.  
  153.  
  154. " show the name OF the function whre the cursor is
  155. ":cfname
  156. fu! SplitCurrentScreen()
  157.    :Highlight 1 <cr>
  158.    :Hsave
  159.    :vsplit
  160.    :Hrestore
  161.    :exec "normal \<c-w>\<c-w>"
  162.    :exec "normal \<c-]>"
  163.    " :let g:word = expand("<cword>")
  164.     ":tag . g:word
  165. endfu
  166. map <c-\> :call SplitCurrentScreen() <CR>
  167.  
  168.  
  169.  
  170. fu! Goto_tag_on_another_tab()
  171.    :exec "normal \<c-w>\<c-]>"
  172.    :exec "normal \<c-w>\<s-t>"
  173. endfu
  174.  
  175. " Taglist
  176. :map <C-k> :TlistToggle <CR>
  177.  
  178. " open tags on another tab
  179. map <c-w>}  :call Goto_tag_on_another_tab() <cr>
  180.  
  181. set showfulltag
  182.  
  183. "status line:
  184. highlight Pmenu guifg=white guibg=DodgerBlue4 gui=bold
  185. highlight Pmenu ctermfg=white ctermbg=blue cterm=none
  186. highlight PmenuSel ctermfg=blue ctermbg=white term=bold
  187. highlight StatusLine term=bold
  188. let g:ctags_title=1        " To show tag name in title bar.
  189. let g:ctags_statusline=1  " To show tag name IN status line.
  190. let generate_tags=1
  191. "set statusline=%F:%l\ %m
  192. "set statusline=%<%F\ %m\ %R\ -\ \[%l,%c\]\ -\ %p
  193. "set laststatus=2
  194.  
  195. "melhores buscas
  196. set ignorecase
  197. set smartcase
  198.  
  199. " Busca no manual php on-line (K) by edjr :-)
  200. "autocmd FileType php set keywordprg=/dados/programas/scripts/search_php_manual.sh
  201.  
  202. " Plugin para python.
  203. "au FileType python source /usr/share/vim/vimfiles/ftplugin/python/python.vim
  204.  
  205. hi TabLine ctermbg=white ctermfg=black
  206. hi TabLineSel ctermbg=black  ctermfg=white
  207.  
  208. if $TERM =~ '^xterm'
  209.     set t_Co=256
  210. elseif $TERM =~ '^screen-bce'
  211.     set t_Co=256
  212. elseif $TERM =~ '^rxvt'
  213.     set t_Co=256
  214. elseif $TERM =~ '^linux'
  215.     set t_Co=8
  216. else
  217.     set t_Co=16
  218. endif
  219.  
  220. source /home/eterrell/.vim/plugin/cscope_maps.vim
  221. if HAS("cscope")
  222.     set csprg=/usr/bin/cscope
  223.     set csto=0
  224.     set cst
  225.     set nocsverb
  226. endif
  227.  
  228. :map <C-a>m      :make<cr>
  229. :map <C-a>i      :make && make install<cr>
  230.  
  231.  
  232. " only for diff mode/vimdiff
  233. " filler is default AND inserts empty lines for sync
  234. if &DIFF
  235.     set diffopt=filler,context:1000000
  236. endif
  237.  
  238.  
  239. "TESTING THE AUTOCOMPLETE PLUGIN
  240. let did_ftplugin_after = 1
  241.  
  242. "Plugin to respect kernel source style:
  243. source /home/eterrell/.vim/plugin/linuxsty.vim
  244.  
  245. augroup myvimrchooks
  246.     au!
  247.     autocmd bufwritepost .vimrc source ~/.vimrc
  248. augroup END
  249.  
  250.  
  251. " coding style for QEMU
  252. " show existing tab WITH 4 spaces width
  253. set tabstop=4
  254. " when indenting with '>', use 4 spaces width
  255. set shiftwidth=4
  256. " ON pressing tab, insert 4 spaces
  257. set softtabstop=4
  258. set expandtab
  259.  
  260.  
  261. noremap  <ESC>[1;5D <C-S-Left>
  262. inoremap <ESC>[1;5D <C-S-Left>
  263. noremap  <ESC>[1;5C <C-S-Right>
  264. inoremap <ESC>[1;5C <C-S-Right>
  265. :inoremap <C-Left> <C-\><C-O>b
  266. :inoremap <C-Right> <C-\><C-O>w
  267.  
  268. "make C-PageUp / C-PageDown work inside tmux to navigate between tabs
  269. nnoremap <ESC>[5;5~ gT
  270. nnoremap <ESC>[6;5~ gt
  271.  
  272. "for some reason <HOME> is ^[[1~ AND <END> is ^[[4~ inside mutt
  273. noremap <ESC>[1~ ^
  274. inoremap <ESC>[1~ <ESC>^i
  275. noremap <ESC>[4~ $
  276. inoremap <ESC>[4~ <ESC>$i
  277.  
  278. "don't complaing for jumping between buffers if file is not saved
  279. set hidden
  280.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement