> 'N' takes you back. More specifically it repeats the search in the
> opposite direction.
I see, thank you. That did help!
On Sat, Apr 7, 2012 at 11:52, Simon Nicolussi <sinic@sinic.name> wrote:
> `. takes you back to the position where the last change was made,
> whereas `` takes you back to the position before the latest jump.
>
Thanks. Often there would not have been a change in the spot that I
need to get back to, such as when I'm trying to figure out somebody
else's code. Frustratingly, `` takes me to the end of the current
line. There seems to be a problem with my .vimrc, as starting with no
config file aliviates the problem as per Tim's advice below. I'll
address that shortly. Thanks.
On Sat, Apr 7, 2012 at 12:42, Marcin Szamotulski <mszamot@gmail.com> wrote:
> One should also mention # (:help #) which does the opposite to *. It will take
> you back if you did not move the cursor though.
Thanks.
On Sat, Apr 7, 2012 at 17:13, Sung Pae <sungpae@gmail.com> wrote:
> You may also be interested in the gd and gD commands, which will
> actually jump to the in-file declaration of that constant. Using Ctrl-]
> with a tags file is even better.
>
Thank you. The gd and gD commands are helpful. I have problems with
ctags for some reason, I should really try to solve that.
On Sat, Apr 7, 2012 at 23:03, Tim Chase <vim@tim.thechases.com> wrote:
> While others have addressed alternate means of going back, I'm somewhat
> confused on why ctrl+O didn't work for you. It works here for me (I use it
> rather regularly), and I've got a somewhat old version of Vim (7.2). Does
> it work for you if you start Vim with
>
> vim -u NONE somefile.txt
>
> If it does, it sounds like some script/setting/plugin is interfering either
> with "*" adding items to the jumplist (you can check the output of ":jumps"
> after pressing control+O), or with the behavior of control+O (in which case
> you can check your mappings).
>
> -tim
>
>
Starting with no config file does in fact solve the issue, and fixes
both Ctrl-O and the `` issue mentioned above. My .vimrc is a mess that
I need to clean up, but I don't see where the conflict may be. Any
ideas:
set showmatch
set background=dark
set scrolloff=3
set tabstop=4
set hidden
set smartindent
set ignorecase
set smartcase
set incsearch
set noexpandtab
set nu
set cul
set laststatus=2
set listchars=tab:._,trail:.
set foldmethod=marker foldmarker={,} foldlevel=5
hi CursorLine term=none cterm=none ctermbg=20
imap ii <Esc>
imap jj <Esc>A
map <space> <C-F>
map <F7> <Esc>mO<C-V>aBy:new<Return>p:set nu<Return>:set
ft=php<Return>ggi<?php<Return><Esc>
map <F8> <Esc>ggdd<C-V>aBx:bd!<Return>`O<C-V>aBp
filetype plugin on
au BufNewFile,BufRead * if &ft == '' | set ft=php | endif
"Account for vBulletin use of / to begin relative paths
set path=/home/dotan.cohen/dev/forum
nnoremap gf :exe 'find' substitute(expand('<cfile>'), '^/', '', '')<CR>
"Easily navigate xdebug:
http://stackoverflow.com/questions/8402412/vim-navigating-xdebug-traces
nnoremap <F5> 0f- :exe '/^.\{'.(col(".")-2).'\}-'<CR>
" Add current buffer number and cound of all buffers to ruler
set rulerformat=%22(%{g:zbuflistcount};%M%n\ %=%l,%c%V\ %P%)
autocmd BufAdd * let g:zbuflistcount += 1
autocmd BufDelete * let g:zbuflistcount -= 1
autocmd VimEnter * call UpdateZBufLC()
function UpdateZBufLC()
let lst = range(1, bufnr('$'))
call filter(lst, 'buflisted(v:val)')
let g:zbuflistcount = len(lst)
endfunction
" Insert and command-line mode Caps Lock.
" Lock search keymap to be the same as insert mode.
set imsearch=-1
" Load the keymap that acts like capslock.
set keymap=insert-only_capslock
" Turn it off by default.
set iminsert=0
" Kill the capslock when leaving insert mode.
autocmd InsertLeave * set iminsert=0
:highlight Cursor guifg=NONE guibg=Green
:highlight lCursor guifg=NONE guibg=Cyan
:set statusline=%<%f%=%([%{Tlist_Get_Tagname_By_Line()}]%)
inoremap <F5> <Esc>mP<Esc>:call searchpair('<!\[CDATA\[\zs', '',
'\ze]]>', 'b')<CR><Space>v:<C-u>call searchpair('<!\[CDATA\[\zs', '',
'\ze]]>')<CR><Backspace>v`<ox:new<Return>p:set nu<Return>:set
ft=php<Return>ggi<?php<Return><Esc><C-w>_3<C-w>-
nnoremap <F5> <Esc>mP<Esc>:call searchpair('<!\[CDATA\[\zs', '',
'\ze]]>', 'b')<CR><Space>v:<C-u>call searchpair('<!\[CDATA\[\zs', '',
'\ze]]>')<CR><Backspace>v`<ox:new<Return>p:set nu<Return>:set
ft=php<Return>ggi<?php<Return><Esc><C-w>_3<C-w>-
inoremap <F6> <Esc>ggdd<S-V>Gx:bd!<Return>`PP
nnoremap <F6> <Esc>ggdd<S-V>Gx:bd!<Return>`PP
inoremap <F7> <Esc>mO<C-V>aBy:new<Return>p:set nu<Return>:set
ft=php<Return>ggi<?php<Return><Esc><C-w>_3<C-w>-
nnoremap <F7> <Esc>mO<C-V>aBy:new<Return>p:set nu<Return>:set
ft=php<Return>ggi<?php<Return><Esc><C-w>_3<C-w>-
inoremap <F8> <Esc>ggdd<C-V>aBx:bd!<Return>`O<C-V>aBp
nnoremap <F8> <Esc>ggdd<C-V>aBx:bd!<Return>`O<C-V>aBp
set statusline=%{PHP_Cursor_Position()}
function! PHP_Cursor_Position()
let pos = getpos(".")
let curline = pos[1]
let win = winsaveview()
let decl = ""
let startline =
search('^\s*\(static\|public\|private\)\=\s*\(static\|public\|private\)\=\s*\(static\|public\|private\)\=\s*\(function\|class\)\s*&\=\w\+','cbW')
call search('{','cW')
sil exe "normal %"
let endline = line(".")
if curline >= startline && curline <= endline
let decl = getline(startline)
endif
call cursor(pos)
call winrestview(win)
return decl
endfunction
--
Dotan Cohen
http://gibberish.co.il
http://what-is-what.com
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
No comments:
Post a Comment