Skip to content

Instantly share code, notes, and snippets.

@camilo
Created September 15, 2016 16:32
Show Gist options
  • Select an option

  • Save camilo/5618504587a24f74ef07102e192e82e2 to your computer and use it in GitHub Desktop.

Select an option

Save camilo/5618504587a24f74ef07102e192e82e2 to your computer and use it in GitHub Desktop.
set guifont=Anonymous\ Pro:h19
set guioptions=-M
set cursorline
syntax on
hi CursorLine guibg=black
filetype on
filetype plugin on
set ofu=syntaxcomplete#Complete
filetype indent on
set tabstop=2
set smarttab
set shiftwidth=2
set autoindent
set expandtab
set number
set spell
set linespace=4
set list listchars=tab:.➜,trail:█,extends:>
au FileType php setl sw=4 sts=4 et
au FileType go autocmd BufWritePre <buffer> Fmt
au FileType go setlocal nolist
"For LaTex
set grepprg=grep\ -nH\ $*
let g:tex_flavor='latex'
" disable arrow keys
map <up> <nop>
map <down> :buffers<CR>
map <left> :bp<CR>
map <right> :bn<CR>
map <space> <=z>
"imap <up> <nop>
"imap <down> <nop>
"imap <left> <nop>
"imap <right> <nop>
""map <return> :nohlsearch
" No huge lines
set textwidth=80
set nowrap
" Status line
set statusline="%{&fo}"
" Move obnoxious swp files to /tmp
set directory=/tmp
" Keep seeing the code underneath!
set scrolloff=15
set ruler
set stl=%F%m%r%h%w\ %y\ %L\ %l\ %v\ %p%%
set laststatus=2
set hlsearch
" Always typeset LaTeX on save
function! AutoTypeSet()
call Tex_CompileLatex()
endfunction
:autocmd BufWritePost *.tex call AutoTypeSet()
function! GetVisualSelection()
" Why is this not a built-in Vim script function?!
let [lnum1, col1] = getpos("'<")[1:2]
let [lnum2, col2] = getpos("'>")[1:2]
let lines = getline(lnum1, lnum2)
let lines[-1] = lines[-1][: col2 - (&selection == 'inclusive' ? 1 : 2)]
let lines[0] = lines[0][col1 - 1:]
return join(lines, "\n")
endfunction
function! CopyRubyHighlited()
let code = GetVisualSelection()
"echo '! echo "' . code . '"| highlight --style=solarized-light --syntax=ruby -Ortf | pbcopy'
ruby << EOF
code = VIM.evaluate("GetVisualSelection()")
`echo "#{code}" | highlight --style=solarized-light --syntax=ruby -Ortf | pbcopy`
EOF
endfunction
call pathogen#infect()
let g:slime_target = "tmux"
set background=dark
let g:solarized_termcolors=256
let g:solarized_visibility="high"
let g:solarized_contrast="high"
colorscheme solarized
if !exists( "*EndToken" )
function EndToken()
let current_line = getline( '.' )
let braces_at_end = '{\s*\(|\(,\|\s\|\w\)*|\s*\)\?$'
if match( current_line, braces_at_end ) >= 0
return '}'
else
return 'end'
endif
endfunction
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment