+" Detect the type of file
+" Load indent files for specific filetypes
+" The title of the window
+" Show the line and column number of the cursor position
+" Show (partial) command in status line.
+" Comma separated list of screen columns that are highlighted
+" Maximum width of text that is being inserted. A longer line will be
+" broken after white space to get this width.
" Enable syntax highlighting
-" If using a dark background within the editing area and syntax
+" If using a dark background within the editing area and syntax
" highlighting turn on this option as well
- " Uncomment the following to have Vim jump to the last position when
- au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
+" Convert tabs to spaces
+" Indent/outdent 4 spaces
- " Uncomment the following to have Vim load indentation rules and plugins
- " according to the detected filetype.
- filetype plugin indent on
+" Show matching brackets
+" how many tenths of a second to blink matching brackets for
+" Do case insensitive matching
+" Do smart case matching
+" Do not redraw while running macros
+" Automatically save before commands like :next and :make
+" Hide buffers when they are abandoned
+" Enable mouse usage (all modes)
+" make backspace work normal (indent, eol, start)
+" shortens messages to avoid 'press a key' prompt
-set expandtab " Convert tabs to spaces
-set tabstop=4 " Tabs = 4 spaces
-set shiftwidth=4 " Indent/outdent 4 spaces
+" how automatic formatting is to be done
+" take indent for new line from previous line
+" smart autoindenting for C programs
-" The following are commented out as they cause vim to behave a lot
-" differently from regular Vi. They are highly recommended though.
-set showcmd " Show (partial) command in status line.
-set showmatch " Show matching brackets.
-set ignorecase " Do case insensitive matching
-set smartcase " Do smart case matching
-set incsearch " Incremental search
-set autowrite " Automatically save before commands like :next and :make
-set hidden " Hide buffers when they are abandoned
-set mouse=a " Enable mouse usage (all modes)
+" Switch off automatic creation of backup files
inoremap <c-s> <c-o>:w<cr>
-" Hide files and directories in Explore plugin
-let g:netrw_list_hide = '.pyc,.hg,.svn,.egg-info'
+" zR to unfold everything
+" za to toggle the current fold
+" zA to recursively toggle the current fold
+" Folding based on indentation:
+" Hide files and directories
+let g:netrw_list_hide = '.pyc,.pyo,.o,.hg,.svn,.egg-info'
+" Shorter commands to toggle NERDTree display
+nnoremap TT :NERDTreeToggle<CR>
+" This option is used to specify which files the NERD tree
+" should ignore. It must be a list of regular expressions.
+let NERDTreeIgnore=['\.pyc$', '\.egg-info$', '\.pyo$', '\.gz$', '\.zip$',
+ \ '^__pycache__$', '\.o$', '^build$', '^dist$', '^env$']
+ " Remove any trailing whitespace that is in the file
+ autocmd BufRead,BufWrite * if ! &bin | silent! %s/\s\+$//ge | endif
+ " Uncomment the following to have Vim jump to the last position when
+ autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$")
+ \ | exe "normal! g'\"" | endif