Source

vim-python-ide / shortkeys.vim

" Change <leader> key to ,
let mapleader=","

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Coding shorcuts
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

" tune vim-makegreen shortcuts. Launch the current file
map <leader>tf :call MakeGreen()<cr>
map <leader>tc :call MakeGreen(TestFileForCurrentClass())<cr>

" Display tag list
map <leader>tgl :TlistToggle<cr>

" Display the task list
map <leader>td <Plug>TaskList


""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Generic mappings
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

" Don't use Ex mode, use Q for formatting
map Q gq

" Seriously, guys. It's not like :W is bound to anything anyway.
command! W :w

" clear the search buffer when hitting return
nnoremap <CR> :nohlsearch<CR>/<BS>

" Map ,e to open files in the same directory as the current file
map <leader>e :e <C-R>=expand("%:h")<cr>/
map <leader>ws :%s/ *$//g<cr><c-o><cr>
map <silent> <leader>y :<C-u>silent '<,'>w !pbcopy<CR>

" Make <leader>' switch between ' and "
nnoremap <leader>' ""yls<c-r>={'"': "'", "'": '"'}[@"]<cr><esc>

" NERDToggleComment
map <leader>co <Plug>NERDCommenterToggle