GORE Vidal is in Rock Creek Church Yard in Washington, D.C., hunched over a headstone like a drunk at a bar.

This, he says, will be his final resting place, side by side with Howard Austen, his companion of many years, and within sight of the grave of Jimmie Trimble, whom he loved as only teenagers can. "His sweat," Vidal once wrote, "smelled of honey, like that of Alexander the Great." Austen died of cancer in 2003; Trimble was killed in World War Two at Iwo Jima. "That was that. End of Jimmie," wrote Vidal in Palimpsest, his autobiography. "Since then, 'the wars all kind of blend into each other'."

Vidal looks old and weary and vulnerable. He moves slowly, gingerly, aided by a stick. He has reached that age where one has more contact with the medical profession that one would ever want. The grave he is standing over is his own. Indeed, his name is already engraved on it, as is the year of his birth: 1925. All that's missing is the year of his demise, which Vidal knows will not be too far off.

Not that he's about to go gently into that dark night. He is talking about one of his biographers, a nameless man, "famous" for getting everything wrong, who said that he had a "pathological hatred" of death. "Anybody who has that," says Vidal, his lip curling in contempt, "doesn't take somebody to see their tomb."

This is the opening scene of Gore Vidal: The United States of Amnesia, a documentary directed by Nicholas Wrathall, which will be shown later this month at the Glasgow Film Festival. It is a moving yet unsentimental reminder of what we lost when Vidal finally expired two years ago at the age of 86. Raging against the dying of the light, Vidal is in no mood to regret anything. On the contrary, he is still taking swipes at his many enemies, be they Truman Capote, Norman Mailer, William F. Buckley, and the New York Times, all but the last of whom have shuffled off ahead of him.

It is of course a cliché to say on such occasions that we will not see his like again. But in Vidal's case this is surely true because the world which he bestrode is consigned to history and, to an extent, he with it. We will go on reading his books, several of which may survive the harsh winnowing of time, but it is hard to imagine a figure of his heft and intellectual elasticity, let alone his lineage and connections, coming to the fore in this most meretricious (a favourite word of Vidal's) era.

He appeared to know everyone. In the documentary, Tim Robbins - who persuaded Vidal, an actor as well as an author, to appear in his movie Bob Roberts - recalls the occasion when he and his wife and children visited him, then living near Ravello in south-west Italy. Vidal invited them to dinner at La Rondinaia, the swallow's nest, overlooking the Amalfi coast and buried deep in a wood. Two other families would be joining them, he added. Who might they be? wondered Robbins. Bruce Springsteen's and Sting's, replied Vidal.

It was customary for Vidal, dressed in monogrammed slippers, like a pope or an emperor, to give his visitors a tour of the house. There was the room that was reserved for Princess Margaret, another that was the preserve of Paul Newman and Joanne Woodward. It was hard to keep up with the names as they slipped from his lips: Kennedys and Clintons, Gores and Roosevelts, Tennessee Williams, Jack Kerouac, Marlon Brando. He was a great sigher, as if he could not really be bothered to engage in conversation. Not that it took much to wind him up. The mere mention of someone's name could rouse him from his torpor and before you knew it he was blitzkrieging their reputation with aphorisms. He jousted physically with Mailer and verbally with Capote. His on-air spats with William F. Buckley, a conservative pundit, were as compelling as Ali and Foreman's in the ring. "He's to the right and almost always in the wrong," said Vidal.

"Never pass up a chance to appear on television or have sex," he once said, and he took the advice to heart. Literature may have been his preferred medium but he knew that to become truly famous - and therefore listened to - it was necessary to go to where the masses congregated. In the 1950s and 1960s television was in its heyday in the United States. Moreover, Vidal was telegenic and adept at delivering memorable soundbites with a twinkle in his eye. He didn't care that the likes of Buckley called him "queer" or suggested he was degenerate.

His role was that of the insider who rejoices in being an outsider, a member of the elite who takes delight in undermining it. He was often described as "contrarian" and there were occasions when he seemed to take a point of view out perversity, as he did when he suggested that Pearl Harbour and 9/11 were engineered by the US itself. Often he'd portray himself as the only person who dared speak the truth and utter the unutterable. "The war on terrorism is a metaphor," he insists in the documentary, "and terrorism is an abstract noun. It's like a war on dandruff. There's no such thing. It isn't a war, it's just a slogan. But using the slogan, they got through the USA Patriot Act which removes many of our liberties. Nobody made a sound when we lost habeas corpus - due process of law. And suddenly Bush managed to get rid of it. Where were the voices on television - aside from mine - that spoke out against it?"

Asked if there was one thing about his life he could change, he quips: "My mother." Whose mother would he rather have? "I'll take Whistler's, anybody else's." His mother, he says, "was always up to something" and divorced his father - who aspired to be "the Henry Ford of aviation" - when he was 10. Subsequently, the biggest influence on Vidal was his grandfather, Senator Thomas Pryor Gore, who was blind. Vidal's formative years were spent largely in his company, reading aloud to him and passing countless hours in Washington's murky corridors of power. It was a priceless, peerless education. "He was not an enthusiast of the human race," Vidal remarks at one point of his grandfather, adding at another: "Self-pity is very hard to indulge in when you're brought up by someone like that."

"Dah", as Vidal called him controversially opposed the US's entry into the First World War. From him, he learned above all to be his own man, to ignore the herd, to trust in his own convictions. In the documentary, Jay Parini, his literary executor, describes him as "shy". It sounds surprising but one recognises its truth. Often, he was not easy in the company of strangers and seemed discomfited, which could lead him to utter something outrageous. Moreover, his manner was so imperious that it was hard to engage him in debate. Of small talk he had none. His putdowns - as Mailer, Buckley et al found to their cost - were delivered like knock-out blows. Did he rehearse them? It's hard to tell. My guess is that he did not.

In that regard, he was like a politician of old who was never happier than on the stump, trading barbs with whoever flung them in his direction. His hates were legion. "Islam, Judaism and Christianity are the three great evils that have befallen the world," he once said. The political class was not far behind. Though he personally liked JFK and was charmed by him he thought his short tenure in the White House was fatally flawed. Ronald Reagan, he joked, owned two books, both of which had been destroyed when his library had burned down. Even more tragically, he had not finished colouring in one of them. No-one, however, could compare with George W Bush of whom he said: "We've had bad presidents in the past but we've never had a goddam fool."

Ironically, he had aspirations to be a politician but, mercifully, the electorate spared him that indignity. His vocation was the higher one of a writer. Often, I re-read his novels, especially the six he called "Narratives of Empire", and his essays, which glow with intelligence, wit, commonsense and sheer chutzpah. He was our Montaigne, our Emerson, our Swift. His subject was the United States, how it could have been great but blew it because of feckless and venal and stupid leaders who never knowingly over-estimated the intelligence of the people. Thus it was a project doomed to fail which, contrary to those who felt Vidal was a viper in the nest, pained him terribly.

Gore Vidal: The United States of Amnesia will be shown at the Glasgow Film Festival on 26 and 27 February