Skip to content

Instantly share code, notes, and snippets.

@almet almet/.vimrc
Created May 1, 2010

What would you like to do?
" My .vimrc configuration file.
" =============================
" Plugins
" -------
" Comes with a set of utilities to enhance the user experience.
" Django and python snippets are possible thanks to the snipmate
" plugin.
" A also uses taglist and NERDTree vim plugins.
" Shortcuts
" ----------
" Here are some shortcuts I like to use when editing text using VIM:
" <alt-left/right> to navigate trough tabs
" <ctrl-e> to display the explorator
" <ctrl-p> for the code explorator
" <ctrl-space> to autocomplete
" <ctrl-n> enter tabnew to open a new file
" ,v and ,V to show/edit and reload the vimrc configuration file
syntax on " syntax highlighting
filetype on " to consider filetypes ...
filetype plugin on " ... and in plugins
set directory=~/.vim/swp " store the .swp files in a specific path
set expandtab " enter spaces when tab is pressed
set textwidth=80 " break lines when line length increases
set tabstop=4 " use 4 spaces to represent tab
set softtabstop=4
set shiftwidth=4 " number of spaces to use for auto indent
set autoindent " copy indent from current line on new line
set number " show line numbers
set backspace=indent,eol,start " make backspaces more powerful
set ruler " show line and column number
set showcmd " show (partial) command in status line
" shortcuts
map <c-n> :tabnew
map <c-e> :NERDTreeToggle <cr>
map <c-p> :TlistToggle <cr>
nnoremap <a-right> gt
nnoremap <a-left> gT
" edit vim quickly
map ,v :sp ~/.vimrc<CR><C-W>_
map <silent> ,V :source ~/.vimrc<CR>:filetype detect<CR>:exe ":echo'vimrc reloaded'"<CR>
" configure expanding of tabs for various file types
au BufRead,BufNewFile *.py set expandtab
au BufRead,BufNewFile *.c set noexpandtab
au BufRead,BufNewFile *.h set noexpandtab
au BufRead,BufNewFile Makefile* set noexpandtab
" remap omnifunc to CTRL + space
inoremap <expr> <C-Space> pumvisible() \|\| &omnifunc == '' ?
\ "\<lt>C-n>" :
\ "\<lt>C-x>\<lt>C-o><c-r>=pumvisible() ?" .
\ "\"\\<lt>c-n>\\<lt>c-p>\\<lt>c-n>\" :" .
\ "\" \\<lt>bs>\\<lt>C-n>\"\<CR>"
imap <C-@> <C-Space>
" Omnifunc completers
autocmd FileType python set ft=python.django
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType html set ft=htmldjango.html
" Tlist configuration
let Tlist_GainFocus_On_ToggleOpen = 1
let Tlist_Close_On_Select = 0
let Tlist_Auto_Update = 1
let Tlist_Process_File_Always = 1
let Tlist_Use_Right_Window = 1
let Tlist_WinWidth = 40
let Tlist_Show_One_File = 1
let Tlist_Show_Menu = 1
let Tlist_File_Fold_Auto_Close = 1
let Tlist_Ctags_Cmd = '/usr/bin/ctags'
let tlist_css_settings = 'css;e:SECTIONS'
let tlist_python_settings = 'python;c:CLASSES;f:METHODS;p:PROPERTIES'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.