Skip to content

Commit 5fe1cc0

Browse files
committed
Remove cruft; add check to put cursor back where it was after closing.
1 parent e018a52 commit 5fe1cc0

File tree

1 file changed

+7
-44
lines changed

1 file changed

+7
-44
lines changed

vimrc

+7-44
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ call pathogen#helptags()
33
call pathogen#runtime_append_all_bundles()
44

55
set nocompatible " use Vim settings; must be first!
6-
let mapleader = "," " set mapleader to comma instead of backslash
6+
let mapleader="," " set mapleader to comma instead of backslash
77
set backspace=indent,eol,start
88
set hidden " set dirty buffer as hidden by default
99
set history=10000 " number of lines of history to remember
@@ -93,10 +93,6 @@ endif
9393
" For when you forget to sudo.. Really Write the file.
9494
cmap w!! w !sudo tee % >/dev/null
9595
96-
" don't need to use a : for commands, just hit ;
97-
" breaks ability to use ; when searching with f/F :(
98-
"nnoremap ; :
99-
10096
" to quickly get the path of current file command mode
10197
cabbr <expr> %% expand('%:p:h')
10298

@@ -144,12 +140,6 @@ map <leader>yr :YRShow<CR>
144140
" snipMate setup
145141
let g:snips_author = 'Matt McKeon'
146142

147-
" setup Gist.vim
148-
let g:gist_detect_filetype = 1
149-
let g:gist_open_browser_after_post = 1
150-
map <leader>gi :Gist<CR>
151-
map <leader>gip :Gist-p<CR>
152-
153143
" lets make quicker
154144
map <leader>m :make<CR>
155145
@@ -236,13 +226,6 @@ map <A-7> 7gt
236226
map <A-8> 8gt
237227
map <A-9> 9gt
238228
239-
240-
" setup php-doc
241-
"source ~/.vim/plugin/php-doc.vim
242-
"inoremap <C-P> <ESC>:call PhpDocSingle()<CR>i
243-
"nnoremap <C-P> :call PhpDocSingle()<CR>
244-
"vnoremap <C-P> :call PhpDocRange()<CR>
245-
246229
" blowout trailing whitespaces,
247230
" they make baby jesus cry
248231
nnoremap <silent> <F5> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar>:nohl<CR>
@@ -254,6 +237,12 @@ map <F7> :set spell!<Bar>set spell?<CR>
254237
if !exists("mm_filetype_config")
255238
let mm_filetype_config = 1
256239

240+
" Jump to last cursor position unless it's invalid or in an event handler
241+
autocmd BufReadPost *
242+
\ if line("'\"") > 0 && line("'\"") <= line("$") |
243+
\ exe "normal g`\"" |
244+
\ endif
245+
257246
" Turn on spelling in subversion/git commits
258247
autocmd BufNewFile,BufRead svn-commit.* set spell
259248
autocmd BufNewFile,BufRead COMMIT_EDITMSG set spell
@@ -269,32 +258,6 @@ if !exists("mm_filetype_config")
269258
autocmd FileType javascript,php,html,python,actionscript set autoindent
270259
endif
271260

272-
" http://www.jukie.net/~bart/conf/vimrc
273-
function! OnlineDoc()
274-
let s:browser = "chromium-browser"
275-
let s:wordUnderCursor = expand("<cword>")
276-
277-
if &ft == "cpp" || &ft == "c" || &ft == "ruby" || &ft == "python"
278-
let s:url = "http://www.google.com/codesearch?q=".s:wordUnderCursor."+lang:".&ft
279-
elseif &ft == "php"
280-
let s:url = "http://php.net/manual-lookup.php?pattern=".s:wordUnderCursor
281-
elseif &ft == "vim"
282-
let s:url = "http://www.google.com/codesearch?q=".s:wordUnderCursor
283-
elseif &ft == "actionscript"
284-
let s:url = "http://community.adobe.com/help/search.html?q=".s:wordUnderCursor."&l=flash_product_adobelr"
285-
else
286-
return
287-
endif
288-
289-
let s:cmd = "silent !".s:browser. " \"".s:url."\""
290-
"echo s:cmd
291-
execute s:cmd
292-
redraw!
293-
endfunction
294-
295-
" online doc search
296-
map <leader>k :call OnlineDoc()<CR>
297-
298261
" setup PHP Code Sniffer
299262
function! RunPhpcs()
300263
let l:filename=@%

0 commit comments

Comments
 (0)