Skip to content

Instantly share code, notes, and snippets.

@alculquicondor
Created June 10, 2014 05:26
Show Gist options
  • Save alculquicondor/442448d2b5b88b7b0bf9 to your computer and use it in GitHub Desktop.
Save alculquicondor/442448d2b5b88b7b0bf9 to your computer and use it in GitHub Desktop.
set nomodeline
set background=dark
syntax on
set smarttab
set nobackup
set autoindent
set smartindent
set sw=2
set tabstop=2
set softtabstop=2
set number
set expandtab
set fdm=syntax
set foldnestmax=2
set makeprg=g++\ -g\ %
command C11 set makeprg=g++\ --std=c++11\ -g\ %
" Closing characters
inoremap {<CR> {<CR>}<Esc>O
inoremap {{ {
vnoremap _( <Esc>`>a)<Esc>`<i(<Esc>)
" Relative numbering
function! NumberToggle()
if(&relativenumber == 1)
set norelativenumber
else
set relativenumber
endif
endfunc
nnoremap \rn :call NumberToggle()<CR>
autocmd InsertEnter * :set norelativenumber
autocmd InsertLeave * :set relativenumber
" Copying
command Cpy !cat %|xclip
command -range Cv :silent :<line1>,<line2>w !xsel -i -b
" Other
function! CfGetTest()
let prid = expand("%:r")
let l = len(prid)
let c = prid[0:l-2]
let p = prid[l-1]
execute "!cfrunner -c ".c." -p ".p
execute "!cfrunner %"
endfunc
command Cf call CfGetTest()
nnoremap \cf :!cfrunner %<CR>
nnoremap \nt :NERDTree<CR>
nnoremap \bn :bNext<CR>
let Tlist_Use_Right_Window=1
let g:NERDTreeWinSize=22
let Tlist_WinWidth=22
colorscheme Tomorrow-Night
" ================ LATEX ================
"set runtimepath=~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after
" REQUIRED. This makes vim invoke Latex-Suite when you open a tex file.
filetype plugin on
" IMPORTANT: grep will sometimes skip displaying the file name if you
" search in a singe file. This will confuse Latex-Suite. Set your grep
" program to always generate a file-name.
set grepprg=grep\ -nH\ $*
" OPTIONAL: This enables automatic indentation as you type.
filetype indent on
" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to
" 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
" The following changes the default filetype back to 'tex':
let g:tex_flavor='latex'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment