Also, how can I go about finding out what a sequence means? Lets say I see a command

au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif

and I want to find out what some sequences mean? Google does not allow searching for symbols, it just ignores them, so I rarely find anything.

  • 4
    use vim's :help, not google. :help g, :help g', :help '"
    – Mass
    Jul 14, 2018 at 13:42
  • Also, symbolhound.com is an imperfect solution for searching the internet for specific symbols/regexes, if you want alternatives. Jul 14, 2018 at 23:12

1 Answer 1

if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif`

This is if else statement which can be written as follows:

if line("'\"") > 1 && line("'\"") <= line("$") 
  exe "normal! g'\"" 

The meaning of au BufReadPost can be found here: http://vimdoc.sourceforge.net/htmldoc/autocmd.html#BufReadPost

g'\" means go to the mark ", but don't change the jumplist when jumping within the current buffer as pointed out here: https://vimhelp.appspot.com/motion.txt.html#mark-motions

Here the mark " indicates: jump to position where last exited current buffer

If you ran g'" in normal mode in VIM it would work fine, but you are running a normal mode command in Exmode, which is why you need to use the \ to escape the ".

  • Good explanation of the equivalence to if else but you do realise you didn't actually answer the question specifically asked in the title, yes? The What does g'\“” mean? one. It would probably be a more complete answer if you covered that.
    – user579
    Sep 15, 2018 at 0:50
  • Thanks for your comment @paxdiablo. I modified the answer before. I was actually explaining the post, rather than the title of OP..
    – alpha_989
    Sep 15, 2018 at 2:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.