I moved from Vim to Neovim and I still use my .vimrc and amazingly this kind of setup seems to work with vscode-neovim too.
As per the :help nvim-from-vim have the following ~/.config/nvim/init.vim:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This happily loads my ~/.vimrc file for terminal nvim and then loads ~/.vimrc.vscode for vscode-neovim – which also appears to load:
It sets my leader to <space>
It loads Plug
It loads my custom key mappings
It loads vim-surround and and vim-repeat
I know it loads these because I have a command map <leader>' ysiw'
This puts single quotes around the current word
This works (so vim-surround works)
I can then ‘repeat’ my adding quotes with . which means vim-repeat is working in combination with it.
I have massively stripped my .vimrc file down and renamed it to ~/.vimrc.vscode:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You have the same problem as with VSCode Vim that undoing all changes doesn’t get rid of the file ‘dirty bit’ so you have to save it to fully undo
:bd doesn’t work as you expect – you need to use :q instead
I found the :e <type file path> didn’t work with auto-complete beyond the current directory – just use Ctrl + P instead.
There is no command history – you can’t use the up arrow to go to previous ex commands that you typed – I’m surprised about this so maybe there is a config setting somewhereCtrl + N/Ctrl + P are used instead of up/down
I’ll try to list more as I go further.
For a couple of hours spent setting it up and to have 90% of the plugins I need working is really great.
Until I can get fugitive and vim diffs (in combination with fugitive) working I will still want to use terminal nvim, but that fits quite easily into my coding process for now.
This recommends installing Jupyter which adds a whole ton of stuff to VS Code but it all seems quite cool.
You can start in pseudo REPL mode where you just keep running a single line of code.
Or you can properly generate a ‘node notebook’ *.nnb file that you can use as a scratch pad. This then gives you full notebook support – this might be interesting for debug logs. I could create a JIRA-XXX.nnb notebook for each issue – then attach this to the Jira issue. Similar to the vim logs.
Note: You need to disable Vim mode for the nnb file
Then you have nice shortcuts you can use:
b – create new run section below
enter – focus in the section (like INSERT mode for Vim)
esc – lose focus on the section (like NORMAL mode for Vim)
shift+enter – run the section
j,k – move up and down sections
dd – delete section
It also nicely shows up functions that you have created inside the notebook in the intellisense.
What I don’t think a lot of VSCode users are used to is constantly living with the debugger turned on. Most web devs grew up in a world without Visual Studio, so console.log is the norm. However anyone who used Visual Studio for Visual Basic or C# development will know the power of constantly using and setting break points in your code. I’ve long ago stopped using Visual Studio, but here’s rough notes of what I did to bring debugging love back.
The debugger attaches a firefox/chrome extension to a running server and debug session.
So you must:
npm run dev
npm run dev:workers (in packages/server)
Start debug session via VS Code (see below)
No more logs
So trying to get VSCode debugging working again so that I don’t keep pissing around with console.log.
Now you should be able to the ‘Run and Debug’ side bar and run the “Next: Firefox” as in the name setting above.
I added a breakpoint to a file, which showed up as a grey circle next to the line numbers. I was expecting a red filled circle. When you run the debug session the breakpoint doesn’t stop there. The error comes down to the path settings because next.js isn’t running at the root of the workspace:
Similar to Firefox when I had to set a pathMappings config, for Chrome its easier because you just set the webRoot to the packages/client directory. This should work for Firefox too – but doesn’t :woman_shrugging: :woman_facepalming:
// This is runtimeExecutable is mildly crazy because of flatpak
// Normal chrome installs won't need runtimeExecutable
"type": "chrome", // must be chrome
"name": "Next: Chromium (flatpak)",
// Regular Chrome
"name": "Next: Chrome",
Once you have a debug session running, you can access the tab ‘Debug Console’ in the output panel (the same panel as the terminal).
This then gives you what seems to be a perfect console session as you get within a browser.
When you hit a breakpoint you can refer to the locally defined variables and inspect them.
Diego posted a link to Matt Might’s article “The Illustrated Guide to a PhD“, which was funny, sad, and many would think is accurate. Since I feel optimistic today, I would like to extend on that with an encouraging note.
While we’re all familiar with “perfect” objects, like a circle, triangle, or square:
…they’re not the only class of object that can exist. “Ah! I know what you mean”, Kate would say, “but when you look close enough, everything else can be described as a combination of these elements!” And she’d point to this picture of a house.
And if this is true and all that there is, pushing the boundary of any shape will give us the same inconsequential bulge:
Viewed in this light, the years of anxiety while doing a PhD suddenly become even more of a
This is an article from a Belgian magazine, Knack – all copyright is theirs. I’m just posting it here, because Hannah Arendt (“The banality of evil“) is a fascinating person and I think this article is important enough to be shared in English.
‘In times of rapidly increasing polarization, it is especially important not to rely on ‘gut feelings’, but to base yourself as much as possible on findings from high-quality research’, write Rectors Caroline Pauwels (VUB), Herman Van Goethem (UAntwerp), Rik Van de Walle (UGent) and Luc Sels (KU Leuven). In this contribution they explain what the Hannah Arendt Institute stands for, after the N-VA and Vlaams Belang called on the Flemish Parliament to stop the subsidies.
‘Science is not for scientists, but for the world’ Hannah Arendt
In the Internal Governance, Equal Opportunities and Civic Integration Committee, in addition to much praise, the Hannah Arendt Institute was hit hard by Flemish representatives Nadia Sminate (N-VA) and Sam Van Rooy (Vlaams Belang) yesterday. During the presentation of the functioning of the institute, a press release was sent out in which Nadia Sminate (N-VA) described the institute as “a glorified communication agency of the left-liberal vision of urbanity and citizenship” and called for subsidies to be stopped. As rectors of the four universities involved in the Hannah Arendt Institute (VUB, UAntwerp, UGent & KU Leuven), we regret this tendentious description of the Hannah Arendt Institute and we believe it is of great importance to clarify what the Institute stands for.
Science is not for scientists, but for the world. That is why universities try to actively disseminate their knowledge and insights. With the Hannah Arendt Institute, for example, we want to inspire professionals, policymakers and citizens to get started with scientific insights into diversity, urbanity and citizenship. A solid scientific basis also contributes to a thorough dialogue with such themes.
Science is not for scientists, but for the world.
New scientific insights can offer great social added value. In the behavioural and social sciences, the path from science to policy development and concrete practice is often difficult and long. Knowledge in such disciplines too often remains underused, perhaps because its application sometimes bumps into ideological walls, preconceptions or even prejudices. We consider it our task to draw attention to that knowledge. The Hannah Arendt Institute has this ambition to disseminate knowledge outside the university walls, more specifically on themes such as diversity, urbanity and citizenship. Because that knowledge matters. Because she is important.
Need for progressive insight
Just with ‘difficult’ social themes, there is a great need for progressive insight. In conversations about complex topics such as migration or free speech, disinformation and ideological bias all too often prevent the possibility of arriving at a workable solution. In that case, sound empirical findings are a good basis and an opportunity to find each other. The opposite is also true. A lack of scientific diligence and in-depth knowledge is a breeding ground for toxic polarization. Hannah Arendt spent her whole life trying to understand what is incomprehensible, because we ‘have our noses at it’. She asks us to think about what we are ‘doing’. She passionately advocated ‘thinking for oneself’, sometimes against friends and prejudices. Advances in scientific understanding and permanent dialogue help us do this.
The social need is there. The scientific research results are also there. Together with the Hannah Arendt Institute, we are working on valorisation: making scientific insights valuable for society. At the Hannah Arendt Institute we provide citizens with knowledge and research results through podcasts, videos and events. We reach professionals with targeted training. We address policy makers through reports and round tables, always with an openness to dialogue and respectful debate. Because especially in the hands of those groups, the knowledge becomes impactful.
With the Institute, we expressly reach out to civil society and to citizens who are ‘in practice’ and who want to make a constructive contribution to the development of society. We can learn from their findings and thus respond to their questions for further research.
The Hannah Arendt Institute is a link between university and society. The Institute’s employees are investigating how you can strengthen the social fabric in sports practice. They investigate how polarization, disinformation and hate speech influence our reference and action framework and advise local authorities and other government services to respond appropriately. They pool knowledge about how cities and municipalities deal with today’s complex challenges and help build communities of practice to inspire other cities and let them learn from each other.
Gut feeling or science
Does the confrontation with a new insight sometimes hurt? Yes, and changing your mind isn’t always easy. It grinds and sometimes pulls to adopt a new idea, change policy, or try out a new method. In times of rapidly increasing polarization it is extra important not to rely on ‘gut feelings’, but to base yourself as much as possible on findings from high-quality research. Universities should not sit back and counter disinformation and feed society with the also constantly evolving insights from scientific research.
With an organization such as the Hannah Arendt Institute, we take on that responsibility to bring our knowledge to the world, for everyone who wants to use it. Of course, this knowledge cannot be taken or abandoned. It is the basis for dialogue, debate and practical training. The Institute is, as it were, an academic form of citizenship. We want to look beyond ideological boundaries and come up with solutions together with other social actors. The world needs that more. Not less.
I went to Krakow, Auschwitz I and Auschwitz II – Birkenau. It was surprising how un-horrifying it was. Birkenau was certainly bleak but its very hard to picture in my my mind the terror of the victims, even as you walk along the same path they do to the gas chamber.
What stuck in my mind was the Nazi doctors and in particular Josef Mengele who would smile and whistle whilst they went about selecting people for the gas chamber. This was not to make me think about I hate them, but to view them as humans who had no compassion at all towards the Jews and the other victims in the camp.
Rather than look at whether people are good or bad, I think that we can look at humans along a spectrum of how much compassion they show. Even this gets harder to judge because Hitler was a supporter of animal welfare (assuming it wasn’t all Nazi propaganda) and was very fond of dogs, so he certainly had compassion but none for the Jews. So compassion alone is not enough, selective compassion can be just as bad.
Perhaps a better way to look at it is having compassion for things we hate or don’t care for. This becomes a clearer way of separating ourselves and our future selves from those who try to kill under the idea of some ‘just’ cause.
Taking this as far as I can imagine matches the Buddhist criteria for having compassion for all things that can suffer. To prevent the future horrors of another version of the Nazis, our compassion has to include all humans whatever they have done. Whatever our feelings are for others we must have compassion for them.
This is where I see a difference between the Christian “Love thy neighbour” against the Buddhist “remove suffering for all that can suffer”. Love is more powerful than compassion and I appreciate that part of Christianity more and more. But I want to prevent future wars and “Love thy neighbour” is too open to cynicism and misinterpretation. Christianity is too often twisted to fuel wars. Buddhism appears to be a more humble attempt to get people to change the way they think.
So I see space for having a Buddhist focus of compassion for all living creatures (or all that can suffer) and then keep moving towards the Christian ideal of love.
Coming from a Windows world getting into Vim, to me is almost exactly like the struggles I had learning French or Dutch. I spent 10 years learning French growing up and I can’t speak a proper sentence. I then moved from England to the Dutch speaking part of Belgium (Flanders) and I learnt to speak Dutch to a conversational level within 2 years.
If you’re going to learn Vim you need to immerse yourself in it. I suspect the majority of Vim users only ever use it to make minor file modifications via SSH. That’s what I did anyway.
I’ve used lots of editors in Windows but the one I prefer now is Sublime Text (ST). However ST has almost all the exact same commands as other editors, with the one major improvement which is Ctrl+P, we’ll come to that later. ST is free to use with a popup once in a while, its a great tool, you should buy a licence.
So for users of all other editors, all you have to do is learn the elements of Sublime Text I use here and then you should be able to translate them to your own editor. I hear you notepad lovers. So we’ll use ST as the boundary layer between our nice fuzzy Ctrl + N, Ctrl + C, Ctrl + V and :e, y and P.
Why O Why
Is it worth the pain? I have spent in excess of 100 hours doing nothing but learning Vim and getting it set up the way I want.
I mean, the question ‘How to close Vim?’ has a 1000+ up votes on Stack Overflow. That’s insanity.
However, I think that if you master Vim the layer between your thought and your code becomes thinner. So this has nothing to do with linting or plugins this has to do with performing at a higher level with the code that you write.
Also I think Vim is just misunderstood. This is where my analogy of learning a spoken language comes from. Switching between Windows editors is like switching dialects sure some of the Scottish folk sound funny, but you can understand what they say. All of us assume that Vim is just another dialect, but it’s not. It’s like nothing you’ve used before. So there’s nothing for your brain to grab on to and understand.
Vim gets you closer to your code. Once performant in Vim you can perform code editing tasks faster and keep up with the speed of your thought. This breaks through the ceiling that you will hit with most other GUI editors.
Vim is very fast, I don’t think it’s necessarily faster than ST, but certainly it’s at that level, everything happens instantly. There’s none of the delay that you sometimes have with opening ST or other heavier editors e.g. Netbeans, IntelliJ. Speed is one of the barriers between your thought and your code, slow editors are slowing you down.
Vim is ‘hyper’ cross-platform (Windows, Mac, Linux, SSH, Docker, Browser (via WASM), Android, Amiga …) and works via the command line, every benefit you learn on Windows means that you have the multiplied benefit that you can use the exact same instructions on Linux or on Mac. Again so it ST, but Vim works via SSH, it works in Docker, it works everywhere.
Once you learn the commands you can do things quicker, deleting a word is just typing dw, once fluent this can be performed faster than using the mouse or Ctrl+Shift+Right-arrow, Delete. These are small 1% improvements, but they add up.
Vim has a command history. This is really useful for doing repeated things. Sure your search box in other editors has it plus you’ll have recent files that you’ve opened, but every single command that you type is recorded. My example for this is reformatting code with Regex. Once you’ve closed your regular editor your search and replace history is lost. In Vim it’s there waiting for you.
Not only that but anything you did as the last command can be repeated with .. This can be complex things like repeating all the text you just typed in Insert mode. Or if you just cut a line and you want to paste it a few times, now you’re just typing . instead of Ctrl + V.
Syntax highlighting! In the DOS prompt, SSH prompt! Seriously, this is amazing. Windows has been around for 30 years and there’s nothing else I know of that can give you this.
Less Chrome. Vim is mostly like using the distration free mode of Sublime Text all the time. Less distraction, more thinking.
Everything you’ve got in your editor currently: Tabs, Split screen, Projects, Linting, REPL, Plugins, Sidebar file tree. But we’re still in the donkey DOS prompt here.
Closer to the command line. Again thinning that barrier between you and your code. In Vim you can type ! and then any command line command, e.g. !mkdir temp or !python will allow you to drop into the python REPL and then come straight back to Vim once you’re done.
Vim’s buffers, which are the equivalent of tabs in other editors, are amazing. When you have a regular editor open you’ll typically have 10 or so tabs open, or at least that’s what I had as otherwise it becomes too crammed. With Vim you just keep opening all the files you want into buffers. I regularly now work with 100 buffers open, but then I can very easily switch between them – :b [part of file name] then <Tab> and you switch to the other file, if you have more than one file open with that bit of the name then you just tab through the list, e.g. :b Controller will allow you to tab through all the *Controller* files (buffers) that you have open.
Not strictly Vim itself, but it has excellent integration with FZF and Ripgrep, which are Rust commandline tools for fuzzy file finding and ‘find in files’. These tools are ridiculously fast. Having a fuzzy file finder means that you don’t need the folder structure on the left any more. Ripgrep works better on Linux but in any place it will churn through GB of source code. Also once you have the search results you can do more with them, they open up in a standard Vim ‘window’ and so you can search/highlight in your search, can then also run search/replaces on the list that you get back.
Vim sessions are what allow Vim to work in a similar way to Sublime Text in that you can save all the open files that you had when you close Vim and open up exactly where you were last time.
But Vim sessions are really flexible, the one great thing I’ve found about them is that I can combine all the projects that I’m working on into one. My colleagues use various other IDEs and we have a set of projects each with their own git repo and docker container. My colleagues need to switch projects each time they want to look at code in one project. However I can put all the repos in one folder and then create my Vim session above all of them. Then FZF can find any files amongst them, Ripgrep can search through all of them at the same time. So it means I can jump-to-definition across any project that I have.
Combining all you do with other tools in one. Here’s a few things that I now do in Vim that I used to use other tools for: file diffs, git diffs, subversion diffs, todo lists, database connections/commands, git conflicts, subversion conflicts. This is not quite a case of Emacs where you never need to leave it again, but all my development tools work perfectly inside Vim, so I can use the power of the various commands I’ve learnt in Vim across these other tools
Git diffs, this is a surprising one, but once you start using Fugitive plugin doing a side by side diff is easy and comes with nice syntax highlighting
Git conflicts are handled beautifully with the Fugitive plugin, the majority of developers that I know only know how to use SourceTree or the output from Bitbucket diffs. With Fugitive you can do a 3-way vertical diff (see the Vimcast on Git conflicts), so you have the conflicted file in the middle with the two files you want to merge either side. It is the nicest way possible to do a merge. Even the GUI tools that I’ve seen that do do a 3-way merge are pretty ugly. Meld is quite good one for Linux and Windows, but it’s not fully supported on Mac, but this suffers from being slow. In Vim everything is fast and again I’ve got all my Vim tools handy as the diff windows are just Vim windows.
Todo lists is a simple one – but you have things like Org mode in Emacs that you can replicate in Vim, but for the most part Markdown does everything you need.
Database connections are always done in a special application. The main one I’ve used is SQL Server Management Studio (SSMS) – but of course that only works for SQL Server. If you work with MySQL either you need to use things like PHPMyAdmin or just use the MySQL command line, there are sometimes closed source tools for connecting to various databases but I’ve never particularly liked one. Tim Pope recently created the dadbod plugin that allows you to connect and run commands on all the major databases. This means that like SSMS I can have my SQL file open with syntax highlighting but then I can highlight a few lines and run those. This is super powerful, you then of course get all the query results in a Vim window and can use all the regular commands to search that and copy paste text from there. I still regard SSMS as the most powerful SQL editor that I used, but now I can have the majority of the functionality that I used there but for any database. I don’t have the things like query optimisations, but it’s rare that I need that.
Making a tailored editor… typically all you do with other editors is install a few plugins. With Vim it’s expected that you’ll customise almost everything. People with ST share their list of plugins, where as people with Vim share their .vimrc file which contains all their plugins and all their settings. It’s the difference between an off the peg suit and a tailored suit, other people might not see the difference but you will feel it. You create Vim exactly as you want it.
Made by individuals…
Fully free and open source, it’s inspired a whole bunch of new editors – neovim, gonvim, AMP…
Touch typing becomes more important. Once you use the keys for everything then you encourage yourself to touchtype more. This adds benefits to your coding. And as Joel Spolsky says, fast accurate typing is one of the fundamentals of a developer. I’m still not great at this but using Vim is helping me to improve.
Split windows are something that I never bothered with in ST, but recently they’ve become very useful. When I’m trying to implement a new feature based on someone elses code I find it useful to have a side-by-side view of the two files. Further I can have the main code I’m working on in one window and then search throughout the code in the other window. Again you can do things like this in ST but I never really started doing this until I got used to Vim and Vim split windows.
Lesson 1: Install GVim
GVim is by far the best way to get introduced to Vim, it is a much more standardised way of using Vim rather than starting in the terminal and hitting problems. I really want to encourage people to try using Vim in the DOS prompt just because it’s amazing to finally see it there but for anyone starting just use GVim. I still use GVim on Windows as there’s still a frustrating slowness to editing in the DOS prompt but almost all my other gripes with it have disappeared over the last two years – the Windows team changing it are doing an amazing job.
Nevertheless, we’ll start with GVim, as well as being more consistent it allows for discovery as it has a lot of common menu commands at top that typically say what the commands are so that you can slowly familiarise yourself with it.
I suggest installing GVim via Chocolatey, or otherwise you can just download it and install it from the vim.org site (that’s all Chocolatey does behind the scenes).
Hopefully it also means I can help more people, Powershell users can probably translate the DOS commands more easily to Powershell than vice-versa. Linux and Mac users used to using GUI tools should be able to figure it out too. When I write Ctrl + C people will understand, when I write <C-c> users unfamiliar with Vim / Emacs will stare blankly.
Install Vim in DOS (not required)
If you’ve installed GVim then this also installs a command line version of GVim. The good part of this is that it comes with the most recent version of Vim – currently 8.1. There are some very nice things that have been added in the most recent version that improves the colour handling inside the Windows 10 DOS prompt.
Add C:\Program Files\GVim\bin to your PATH.
I love using Vim inside the DOS prompt. I think it is the simplest, purest way of using Vim in Windows.
Vim 7.4 also comes with Git for Windows. You can install this via Chocolatey, or just via the Git website.
> choco install -y git
We then need to add the GNU usr tools to our PATH – add C:\Program Files\Git\usr\bin to your PATH.
This gives you all the loveliness of all the GNU tools e.g., ls, grep as well. If you really want to do yourself a favour install clink and solarized DOS prompt colours too.
Lesson 2: Basic commands
You can skip this if you know the commands. I knew the basics of these for years before I started immersing myself in the rest of Vim.
You go into the INSERT mode by hitting the i key and switch back to NORMAL mode by hitting escape.
Once you’re in edit mode then it’s fairly similar to other editors, you can move left, right, up, down with the arrow keys, then just type and delete stuff with the backspace or delete keys.
Initially to be more familiar with other non-modal editors most users will spend all their time in INSERT mode. I personally think there is nothing wrong with this and this is exactly what I did to be as productive as possible in the beginning.
To be more productive though, it is necessary to learn the other Vim commands, otherwise you’re just taking away all the other features that you’re used to in ST which almost all do exist in Vim, just that they’re more hidden or you need to install a plugin for it.
Searching / moving code
A lot of the Ctrl + ... commands that you expect from other editors are handled in Vim’s NORMAL mode – you should see the word NORMAL in the bottom left-hand corner.
This is the weirdest part of Vim, that you delete words via three or four letter commands.
Ctrl+Home / gg
Ctrl+End / G
Ctrl+g, N, Enter
End of the line
End / $
Start of the line
Home / 0
Ctrl+f, [text], Enter (forward)
/[regex] (forward) / ?[regex] (back)
Ctrl+h, [search], [replace], Enter (forward)
:s/[search]/[replace]/, Enter (line) / :%s/[search]/[replace]/, Enter (global)
I actually practiced the commands by installing an Android app with Vim commands and the beginnger free part of shortcutFoo Vim.
After those commands the next most important one is :. This is the most common way of starting the command line typing at the bottom. It’s similar to when you type Ctrl + P into ST.
The first command to type is :help, this shows the first cool thing of Vim – split windows as standard.
The weirdest concept I had (after years of very light usage) is typing :w instead of :x to write the file, because now we actually want to stay in Vim, rather than get the hell out as fast as possible.
I guess this is not much more than a review of Leo Tolstoy’s book ‘A Confession’ and his other books on religion. I’ve been an atheist as long as I felt that the words in the Lord’s Prayer were ridiculous. I believe the Bible is a work of fiction like any other book that talks of dragons and giants. I find it crazy that rational people can believe that. I find the hypocrisy of the Bishops who abused children and the cover up of the Church unforgivable – but I guess many more worse things have been done in the name of Christ. Greek and Roman Gods are seen as fake but the one dreamt up 500 years later is somehow real. If there’s only one God then only one of Christianity, Islam, Buddhism or any other religion can be right and the rest of us are damned.
I believe in Science. Lots of things can’t be explained by science yet, but science doesn’t pretend to know things it doesn’t. It remains humble it never believes you get further than a theory, even if you work your whole life on it. Science knows that what we know today is partially right but still very much wrong. Science has it’s problems and the people that abuse it, but it is explainable and doesn’t require tales of fiction to back it up. If Science is right we’re all saved from the hellish after lives, but if science is right there is no after life.
But at the same time, I’m doing like all other thinking people and searching for meaning in life. My father believed that the basic rules of Christianity were good ones to live by, but nothing more. I wonder at the cathedrals built by people looking to worship God. I wonder at the vast amount of good work that Christians do. I wonder at the happiness that my Grandmother had from just doing the flowers and helping at the church. Christians may believe in something fake but their happiness is real. Their good deeds are real. But I can’t ever join that because I know it’s fake. I can’t eat the body of Christ and believe that it’s really his body, or drink his blood and really think it’s his blood and not be put off by the rather disgusting idea of cannibalising God. I can’t bow down to an almighty nothing.
Tolstoy’s Confession is basically talking about the same. But he did much worse things in his life. He killed people in duels, killed people in war. I don’t have the direct blood of anyone on my hands. Just the blood of all the animals that have been killed for me to eat and to safely take the medicines I take. He did all that I have done but much more, he spoke to the great scientists of his day, he knew the Orthodox Church very well, read up way more than me on Buddhism and Islam. He read all that he could searching for meaning. He read all the philosophers he could all the poets, looking for something or anything with meaning.
This is the closest that I have come to someone who feels as I feel. He saw how clearly that science showed that the teachings in the Bible were fake. But his answer was the biggest crush to any hopes I had. He simply put his faith in Christianity but one that ignored all the clearly made up stories but left open the real stories and teachings of Jesus together with the existence of God. Of course the stupid thing is that in my search for the meaning of life, basically the only answer to that is religion. Religion is just all the different ways that people have tried to create meaning in life. So Tolstoy simply returned to Christianity, the Christianity of the poor where a simple, honest life gets rewarded in this life, and the next.
But this then leaves me nowhere. You get to the top of the tower searching for the answer, you open the trapdoor at the top and there’s nothing but emptiness. The meaning of life is religion and there is no religion, so there’s no meaning. Humanists and other atheists try to claim that there still is meaning, that you can lead a good life and that this one life becomes more precious. But that’s not how I feel and it’s not how Tolstoy clearly lays it out.
So this is what I understand from ‘A Confession’. Life is either finite or infinite. Scientists believe it’s finite, but God and the Universe is infinite. Religion simply matches up our finite life with an infinite afterlife. Science can never explain this like we can never count all the way to infinity. So if science is right, then us, our children, our grandchildren and all the people and animals and insects and bacteria that ever live on this planet ever are pointless. Without meaning to be forgotten. We’ve been going for 14 billion years and in 1,000 billion years everything will be gone. An infinite of nothing. That’s it there’s no way round it, there’s no hope that science will find an answer. There’s no experiment to trial, no thought experiment to see it more clearly. Newton and Einstein won’t save us. They’ll be gone and forgotten, so will we.
Tolstoy wrote that all you could do if you believed there was no God, was to either kill yourself or limp on like a coward.
But Tolstoy carries on about what his version of the real Christianity should be. He views it above all other religions because it puts love as the only rule. “Love thy neighbour” is the only commandment. Thou shalt not kill isn’t needed if you love the one you want to kill. But this is not the jealous love that we think of where a man murders his wife because he loves her too much. The love taught by Jesus is a love that conquers all. You must simply turn the other cheek if someone strikes you. The law of love comes before the law of violence. There is no space for violence, bullying, hatred, jealousy. The law of love is available to all, you don’t need money, talent, beauty, fortune, family. You just need to love those around you.
I understand this kind of Christianity. I can understand why it is so powerful. There’s nothing to laugh at when you see the power of what love can do. The impact that Gandhi managed to have through getting independence for India without resorting to war. That was love. I don’t see humanists or atheists talking about love when they talk about the meaning of life. It’s just a small part in what they believe. I also agree with how he explains that Christianity has more meaning than Paganism because it puts love as the one and only law.
The only trouble I had with Tolstoy’s discussions about religion was the conflict between “non-resistance to violence” and “non-violent resistance”. You can’t resist if you believe in non-resistance. But I’m happy to live with that conflict. I’d see it as never using violence to resist, but if someone is violent to you then you don’t resist them. But you can resist them as long as they don’t turn to violence.
This love at the centre of Christianity is something that I’ve never heard before. “Thou shalt not kill” comes up, “forgive us our trespasses” and so forth. Jesus talks about love, but I’ve never heard it expressed that love is the only thing that matters. But what I see is that this line of thinking is open to all. You can be an atheist but follow the guidance of Jesus and put love above all else. You can love your family more, love your partner more, love your children more. Forgive them for when they are angry, apologise for the things you say and do. You can love your fellow neighbour and check how they are doing and what you can do for them.
I’m not saying I do these things, but I see it as perfectly valid that an atheist can follow the teachings of Jesus where he speaks about love. There is no church required. There is no afterlife required. But if you do choose to dedicate your life to loving others it will be a happy one. You can believe in science, think God is a fraud, limp cowardly forward without meaning, but still find happiness with Jesus and Love.
More generically this would be meditation is better than coffee, but the only meditation I do is via Headspace.
My central point is that it’s better to give up on coffee and replace it with meditation. I’ve been drinking a lot of coffee for years. I guess 4-5 mugs of coffee per day plus at least one mug of tea. But during these years my ability to concentrate has been terrible. So I’ve been slowly ever increasing the amount of tea and coffee. I do IT and avoid any kind of management – so the only thing I rely on is concentration for long periods.
Wake up 2-3 hours earlier than usual and get plenty of outdoor light in the morning
Eat breakfast as soon as possible
Exercise only in the morning
Have lunch at the same time every day and eat nothing after 19:00
Banish caffeine after 15:00
Have no naps after 16:00
Go to bed 2-3 hours earlier than usual and limit light in the evenings
Maintain the same sleep and wake times every day
The one that was easiest to implement was “Banish caffeine after 15:00” – so that was easy enough to stop coffee after 3. The next trigger was a Quora post saying that when waking up we need water and not coffee to help our kidneys get going.
For kidneys is very important that you go sleep on time, before 10pm if possible, and that you do a lot of exercises in the morning or afternoon (but not in the evening, our body should rest at that time of the day). Avoid any stimulants like coffee and alcohol which directly influence on our kidneys, making them dry and slow. When you wake up the first thing you should do is drink loads of warm water, this will warm up your kidneys and put them in work.
Obviously this is from a random stranger on the internet, so trust it less, but it’s easy enough to try drinking water first thing in the morning. However I don’t do this consistently – drinking water is boring, coffee tastes nice. I was doing this and not much was changing. Drinking no coffee after 3, but drinking quite a lot in the morning. Stopping regularly with my work to go make some more coffee or re-heat the coffee pot.
In the past I got into Headspace for doing meditation. I kept it up for about 2 years, but I stopped about 18 months ago. I hadn’t noticed any productivity increase during that period so I didn’t see the benefit, but looking back I realised that I managed to spend a full 18 months learning Machine Learning and Deep Learning through Coursera and also learning about Category Theory – almost entirely in the evenings. So it does seem like meditation helps – but maybe I’m just making up the link, there’s lots of other factors involved. So I tried to restart doing Headspace 6 months ago, but I would do it maybe one or two times and then stop for weeks on end, nothing changed. In an attempt to get myself to get Headspace done in the morning I came up with this phrase:
“Headspace is better than coffee.”
My main idea behind it is that Headspace does something similar to coffee – it helps me concentrate but it also has long term benefits. Coffee does bugger all except make you run around like a headless chicken for 30 minutes until you get the next ‘fix’ of caffeine. This statement is all well and good but it still didn’t change my habits. I had similar ideas about apples, that it’s better to eat an apple than drink coffee – but not sure where I heard that from.
I have finally though come to the conclusion that coffee is completely ineffective. It doesn’t work, it doesn’t help, so the only thing left to do is stop taking it completely. I might as well be completely unproductive without coffee than completely unproductive with coffee. Instead, in the mornings, I have switched to drinking green tea with a slice of lemon squeezed into it (and sometimes with local honey added too). There’s lots of benefits to green tea, so at least it’s useful. Then on top of that I take some grapes or fresh pineapple up with me as I start work.
Further to this I have added that I spend 5 minutes doing yoga and then the 15 minutes it takes to get Headspace done. The irony is that by stopping making coffee, I actually save about 15 minutes a day from the time I spend faffing around brewing and re-heating the stuff, so I now have time for Headspace. I’ve been doing this for 3 weeks now and the turnaround has been fantastic. My mornings are now almost totally focussed and I get a full morning’s work done.
Aside from that I also make sure to leave my phone outside the room that I’m working in and I also stopped going for walks in the morning. Walks are nice but they added too much pressure from the hour I lost going for a walk. I hope to start walks again in the afternoons because I know they’re good, but for now they’ll have to wait.
Update (Feb 2022): I wrote this a while ago now, and it didn’t carry on indefinitely, but I’ve come back to it with a bit more balance. I easily fall back to just drinking coffee and stop with Headspace, especially as time pressure mounts.
But this post helped me to come back to Headspace, things that ring true:
The time spent making coffee tea can be used for Headspace
You don’t need coffee, but it’s nice and you don’t have to stop it
You can work without coffee
Headspace has long term benefits, caffeine has none that I know of
So I’ve changed my thinking slightly:
Headspace before coffee
Keep your coffee, but use the coffee as a trigger to remind you to sit down to Headspace first.