Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added f4 shortcut to toggle highlighting

  • Loading branch information...
commit c6ada0150b77ebf38724799fb5ed87d4a84c37b2 1 parent 94e9cfb
Harvey Rogers authored
Showing with 112 additions and 0 deletions.
  1. +109 −0 .old-vimrc
  2. +3 −0  .vimrc
View
109 .old-vimrc
@@ -0,0 +1,109 @@
+" Load pathogen modules
+call pathogen#infect()
+call pathogen#helptags()
+
+" Enable line numbers
+set number
+
+" Enable mouse clicking
+set mouse=a
+
+" Always show the current position
+set ruler
+
+" Highlight search terms
+set hlsearch
+
+" Search as you type like in browsers
+set incsearch
+
+"Ignore case when searching
+set ignorecase
+
+filetype plugin on
+filetype indent on
+
+" Enable syntax highlighting
+syntax enable
+
+" Smart way to move between windows
+map <C-j> <C-W>j
+map <C-k> <C-W>k
+map <C-h> <C-W>h
+map <C-l> <C-W>l
+
+" Close the current buffer
+map <leader>bd :Bclose<cr>
+
+" Close all the buffers
+map <leader>ba :1,1000 bd!<cr>
+
+" Toggle paste on/off. With it on formatting doesn't get messed up when
+" pasting from an external application
+set pastetoggle=<F2>
+
+" Turn on smart indent
+set smartindent
+set smarttab
+set tabstop=4 " set tab character to 4 characters
+set expandtab " turn tabs into whitespace
+set shiftwidth=4 " indent width for autoindent
+set softtabstop=4 " makes backspace go back 4 spaces
+set autoindent
+
+let mapleader = ","
+
+" Show filename always
+set ls=2
+
+" Set color scheme
+set t_Co=256 " Use all 256 colors
+colorscheme molokai
+
+" Show vertical line at col 80
+if exists('+colorcolumn')
+ set colorcolumn=80
+else
+ au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>80v.\+', -1)
+endif
+
+" Tab configuration shortcuts
+map <leader>tn :tabnew<cr>
+map <leader>te :tabedit
+map <leader>tc :tabclose<cr>
+
+" Move a line of text using ALT+[jk]
+nmap <M-j> mz:m+<cr>`z
+nmap <M-k> mz:m-2<cr>`z
+vmap <M-j> :m'>+<cr>`<my`>mzgv`yo`z
+vmap <M-k> :m'<-2<cr>`>my`<mzgv`yo`z
+
+" Auto closing brackets
+inoremap { {}<Left>
+inoremap {<CR> {<CR>}<Esc>O
+inoremap {{ {
+inoremap {} {}
+
+" Return to last edit position when opening files (You want this!)
+autocmd BufReadPost *
+ \ if line("'\"") > 0 && line("'\"") <= line("$") |
+ \ exe "normal! g`\"" |
+ \ endif
+" Remember info about open buffers on close
+set viminfo^=%
+
+" Delete trailing white space, useful for Python ;)
+func! DeleteTrailingWS()
+ exe "normal mz"
+ %s/\s\+$//ge
+ exe "normal `z"
+endfunc
+autocmd BufWrite *.py :call DeleteTrailingWS()
+
+" Use system clipboard for yank, paste, cut, etc.
+set clipboard+=unnamed
+
+"""""""""""
+" Ack
+"""""""""""
+let g:ackprg="ack-grep -H --nocolor --nogroup --column"
View
3  .vimrc
@@ -14,6 +14,9 @@ set ruler
" Highlight search terms
set hlsearch
+" Press F4 to toggle highlighting on/off, and show current value.
+noremap <F4> :set hlsearch! hlsearch?<CR>
+
" Search as you type like in browsers
set incsearch
Please sign in to comment.
Something went wrong with that request. Please try again.