Skip to content

Instantly share code, notes, and snippets.

@hpsaturn
Created November 13, 2016 17:01
Show Gist options
  • Save hpsaturn/3b5a3039d7565f66b90cb1cf354c135c to your computer and use it in GitHub Desktop.
Save hpsaturn/3b5a3039d7565f66b90cb1cf354c135c to your computer and use it in GitHub Desktop.
"syntax on
"colorscheme murphy
set nocompatible " Use Vim defaults (much better!)
set bs=2 " Allow backspacing over everything in insert mode
set autoindent " Always set auto-indenting on
set smartindent
set ruler " Add bar information
set backup " Keep a backup file
set backupdir=$HOME/vimbackups
set viminfo='20,\"50 " read/write a .viminfo file -- limit to only 50
set history=50 " keep 50 lines of command history
set ruler " Show the cursor position all the time
set ts=4 " 4 space wide tabs
set sw=4
set so=7 " Numero de lineas cuando se hace scroll
set softtabstop=2 "makes backspacing over spaced out tabs work real nice
set expandtab "expand tabs to spaces
set ignorecase
set incsearch "Busquedas incrementales
set hlsearch "Resalta resultados de busquedas
set showmatch "Resalta parentesis complementarios
set background=dark "awesome for terminals with crappy colors (putty!)
set tagstack "lets you push and pop your jumps with ctrl+]
set pastetoggle=<F11> "when you're pasting stuff this keeps it from getting
"all whacked out with indentation
set foldmethod=manual "enable code folding
set encoding=utf8
" Arduino config
"autocmd BufNewFile,BufReadPost *.ino,*.pde set filetype=cpp
"map <f5> :!scons<cr>
"map <f6> :!scons upload<cr>
"au BufNewFile,BufRead *.pde *.ino setf arduino
"autocmd BufNewFile,BufReadPost *.ino,*.pde set filetype=cpp
"javac in vim
"set makeprg=javac\ %
"set errorformat=%A%f:%l\ %m,%-Z%p^,%-C%.%#
"gcc in vim
"set makeprg=gcc\ -o\ %<\ %
" Added to default to high security within Gentoo. Fixes bug #14088
set modelines=0
"dictionary word autocomplete. type <CTL-N> in the middle of a word to use
"set dictionary-=/usr/share/dict/words dictionary+=/usr/share/dict/words
"set complete-=k complete+=k
"fix broke-ass sun terminals (if we're stuck on one)
"set t_cl=^[[2J
" Don't use Ex mode, use Q for formatting
map Q gq
"collapsing window splits
map <C-J> <C-W>j<C-W>_
map <C-K> <C-W>k<C-W>_
"--------------------------------------------------
" winmanager
"--------------------------------------------------
map <F8> :WMToggle<CR>
map <c-w><c-b> :BottomExplorerWindow<CR>
map <c-w><c-f> :FirstExplorerWindow<CR>
let g:winManagerWindowLayout = 'FileExplorer,TagList|BufExplorer'
let g:persistentBehaviour=0
let g:TagsExplorer_title = "[Tag List]"
"--------------------------------------------------------
" Tag List Plugin Config
"--------------------------------------------------------
" Path de exctags
let Tlist_Ctags_Cmd = "/usr/bin/ctags-exuberant"
let Tlist_Exit_OnlyWindow = 1
let Tlist_Auto_Refresh = 1
"--------------------------------------------------
" Aspell config
"--------------------------------------------------
let spell_executable = "aspell"
let spell_options = ""
let spell_insert_mode = 0
let spell_aspell_tex_args = "-t"
let spell_root_menu = "-"
let spell_auto_type="tex,mail,cvs,text"
let spell_language_list = "spanish,en"
map ^s :w!<CR>:!aspell check %<CR>:e! %<CR>
"--------------------------------------------------
" Status line
"--------------------------------------------------
"set statusline=%F%m%r%h%w\ [ASCII=\%03.3b]\ [0x\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]
"set laststatus=2
set showmode
set showcmd
set statusline=%<%f%h%m%r%=%3b%6l,%-4c\ %P
set shell=/bin/bash
"--------------------------------------------------
" Browser Settings
"--------------------------------------------------
"map \p :SearchUsing php
"--------------------------------------------------
" Encryption
"--------------------------------------------------
"rot13 dmca-grade encryption
"this is useful to obfuscate whatever it is that you're working on temporarily
"if someone walks by (vim pr0n?)
"map <F3> mzggVGg?`z
"space bar folding
nnoremap <silent> <space> :exe 'silent! normal! za'.(foldlevel('.')?'':'l')<cr>
"don't expand tabs if we're in a makefile
au BufRead,BufNewFile Makefile set ts=4 sw=4 noexpandtab
"wrap lines in TeX
au BufRead,BufNewFile *.tex set tw=80
"wrap lines in .txt files
autocmd BufNewFile,BufRead *.txt set tw=78
"good tab completion - press <tab> to autocomplete if there's a character
"previously
"function InsertTabWrapper()
" let col = col('.') - 1
" if !col || getline('.')[col - 1] !~ '\k'
" return "\<tab>"
" else
" return "\<c-p>"
" endif
"endfunction
"inoremap <tab> <c-r>=InsertTabWrapper()<cr>
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
"--------------------------------------------------
" Pathogen
"--------------------------------------------------
execute pathogen#infect()
call pathogen#helptags() " generate helptags for everything in 'runtimepath'
syntax on
filetype plugin indent on
"--------------------------------------------------
" TAGBAR
"--------------------------------------------------
nmap <F8> :TagbarToggle<CR>
"--------------------------------------------------
" NerdTree
"--------------------------------------------------
let g:NERDTreeDirArrows=0
"--------------------------------------------------
" CTAGS
"--------------------------------------------------
function CreateTags()
let curNodePath = g:NERDTreeFileNode.GetSelected().path.str()
exec ':!ctags -R --languages="C++,C,Python,Java,Make" -f ' . curNodePath . '/tags ' . curNodePath
endfunction
nmap <silent> <F4> :call CreateTags()<CR>
"--------------------------------------------------
" CPP LINT and CLANG Format
"--------------------------------------------------
if !exists("g:lint")
let g:lint = "cpplint.py"
endif
function CheckLint()
execute "!" . g:lint . " " . bufname("%")
endfunction
nmap <silent> <F11> :call CheckLint()<CR>
imap <C-[> <ESC>:po<CR>
map <C-I> :pyf ~/bin/clang-format.py<cr>
imap <C-I> <c-o>:pyf ~/bin/clang-format.py<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment