Skip to content

Instantly share code, notes, and snippets.

@aechiara
Last active August 29, 2015 13:57
Show Gist options
  • Save aechiara/9506083 to your computer and use it in GitHub Desktop.
Save aechiara/9506083 to your computer and use it in GitHub Desktop.
meu vimrc
set nocompatible
set laststatus=2
set noshowmode
syntax enable,on
filetype plugin indent on
"Easier mapleader than the default "\"
let mapleader = ","
" Set utf8 as standard encoding and en_US as the standard language
set encoding=utf8
" Use Unix as the standard file type
set ffs=unix,dos,mac
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Files, backups and undo
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Turn backup off, since most stuff is in SVN, git et.c anyway...
set nobackup
set nowb
set noswapfile
" Use spaces instead of tabs
set expandtab
" Be smart when using tabs ;)
set smarttab
" 1 tab == 4 spaces
set shiftwidth=4
set tabstop=4
set backspace=indent,eol,start
set autoindent
set copyindent
set showmatch
" highlight search terms
set hlsearch
" show search matches as you type
set incsearch
nmap <silent> ,/ :nohlsearch<CR>
set history=1000
set undolevels=1000
set wildignore=*.swp,*.bak,*.pyc,*.class
" change terminal title
set title
set list
set listchars=tab:>.,trail:.,extends:#,nbsp:.
autocmd filetype html,xml set listchars-=tab:>.
" PASTE MODE
set pastetoggle=<F2>
" Template file for new python files
autocmd bufnewfile *.py 0r ~/.vim/templates/python/default.template
"autocmd BufNewFile test*.py 0r ~/.vim/templates/python/test.template
"folding settings
set foldmethod=indent "fold based on indent
set foldnestmax=10 "deepest fold is 10 levels
set nofoldenable "dont fold by default
set foldlevel=1 "this is just what i use
execute pathogen#infect()
"set statusline+=%{fugitive#statusline()}
"set tags+=/usr/local/google_appengine/google/appengine
" jedi-vim
" let g:jedi#auto_initialization = 0
" let g:jedi#auto_vim_configuration = 0
" let g:jedi#use_tabs_not_buffers = 0
let g:jedi#popup_on_dot = 0
let g:jedi#popup_select_first = 0
let g:jedi#goto_assignments_command = "<leader>g"
let g:jedi#goto_definitions_command = "<leader>d"
let g:jedi#documentation_command = "K"
let g:jedi#usages_command = "<leader>n"
let g:jedi#completions_command = "<C-Space>"
let g:jedi#rename_command = "<leader>r"
let g:jedi#show_call_signatures = "1"
" ------------- Shortcuts
" Python
noremap <C-K> :!python<CR>
noremap <C-L> :!python %<CR>
noremap <F8> :!nosetests --rednose %<CR>
"NerdTree
noremap <C-n> :NERDTreeToggle<CR>
" DJando manage test
noremap <C-b> :!python $VIRTUAL_ENV/manage.py test<CR>
" Flake8
"autocmd BufWritePost *.py call Flake8()
colorscheme darkblue
" --- intelisense menu color
highlight Pmenu ctermfg=Black ctermbg=Grey cterm=None guifg=White guibg=DarkBlue
highlight PmenuSel ctermfg=White ctermbg=Blue cterm=Bold guifg=White guibg=DarkBlue gui=Bold
"highlight Pmenu ctermfg=0 ctermbg=6 guibg=#444444
"highlight PmenuSel ctermfg=7 ctermbg=4 guibg=#555555 guifg=#ffffff
highlight Visual ctermfg=White ctermbg=Black guifg=#8080ff guibg=fg gui=reverse
set cursorline
set number
"Debug
" type ,p to insert breakpoint. ^[ is at the end. Insert with ctrl v and then esc
" (the github web gui doesn't display control characters, but it is there)
nnoremap <leader>p oimport ipdb;ipdb.set_trace()
" type ,w to wipe the whole line clean but keep the \n
nnoremap <leader>W 0d$
if has('python')
py << EOF
import os.path
import sys
import vim
if 'VIRTUAL_ENV' in os.environ:
project_base_dir = os.environ['VIRTUAL_ENV']
sys.path.insert(0, project_base_dir)
activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
execfile(activate_this, dict(__file__=activate_this))
EOF
endif
@aechiara
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment