Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
88 lines (71 sloc) 2.25 KB
" use plugins, such as tComment
" execute pathogen#infect()
syntax on
filetype plugin indent on
" set nerd tree key bindings
nmap \e :NERDTreeToggle<CR>
nnoremap j gj
nnoremap k gk
xnoremap j gj
xnoremap k gk
nnoremap <down> gj
nnoremap <up> gk
xnoremap <down> gj
xnoremap <up> gk
"Split navigation
nmap gh <C-w>h
nmap gj <C-w>j
nmap gk <C-w>k
nmap gl <C-w>l
" number lines
set nu
" allow color highlighting
syntax enable
" good color scheme for white background
colorscheme delek
" colorscheme slate
" make sure arrow keys work on mac (
" this was messing things up so comment out
" set term=cons25
" use this instead: (
set term=builtin_ansi
"reselect after indenting
vnoremap < <gv
vnoremap > >gv
"Paste Toggle
" i.e., switch between paste-insert mode and ordinary insert-mode using \1
set pastetoggle=<Leader>1
" in insert mode, map CTRL-E to end-of-line (insert mode)
inoremap <C-e> <esc>$i<right>
" in insert mode, map CTRL-A to beginning-of-line (insert mode)
inoremap <C-a> <esc>0i
" in insert mode, typing jj puts you into normal mode
inoremap jj <esc>
" set macro @s to add HTML tags around a word
let @a='bi<a href="">ea</a>'
let @b='bi<b>ea</b>'
let @c='bi<code>ea</code>'
let @i='bi<i>ea</i>'
let @s='bi<samp>ea</samp>'
let @u='bi<u>ea</u>'
let @m='bi<small>ea</small>'
" in normal mode, <Leader>4 calls Pythonic func to toggle 4 space vs 8 space indents
nnoremap <Leader>4 :call Pythonic()<cr>
function! Pythonic()
" toggle function to make tabs pythonic - i.e., if tab 8 spaces, make 4 but if tab 4 spaces make 8
" echom &tabstop
if &tabstop == 8
set tabstop=4
set shiftwidth=4
set expandtab
echom "Number of spaces per tab:"&tabstop
elseif &tabstop == 4
set tabstop=8
set shiftwidth=8
set expandtab
echom "Number of spaces per tab:"&tabstop