Neovim configuration for writers with zettelkasten
This is my neovim configuration which is mainly configured for writing and can also be used to build a Zettelkasten.
I got initially triggered and inspired by theena.
Video-tutorial yet to come…
Because I like Niklas Luhmann’s concept of a Zettelkasten, which essentially is nothing else than your own little wikipedia with hyperlinks, I installed a Zettelkasten extension in my neovim configuration.
If you are not familiar with the concept of a Zettelkasten, I highly recommend you do some research and reading.
Since I have copy pasted the blueprint from chris@machine, folke and lazyvim it can also be used for coding and programming.
At the end of the day it is a text editor and can be used for whatever the user decides he wants to use it for.
On a fundamental level there is no real difference between programming and writing.
One is for programming computers, the other one is for programming human minds.
A quite nice scifi book which scratches the topic would be Neil Stephensons Snowcrash.
The book is written in a weird way, but nevertheless I liked it and it had some interesting concepts about words, languages and infecting human minds.
I want to add, that a lot of content which is being pushed and hyped into human minds today, would be equivalent to malware in the computer space.
Firewall your mind.
The more you scroll down on todays most favorite platforms, the more malware you are uploading into your mind.
You think learning and taking in new information is hard?
Unlearning can be much harder.
And unthinking a thought may even be impossible - ask Razor from the first Matrix movie who wants to forget the matrix is unreal.
Deleting malware on a computer is probably much easier than deleting malware from your mind, so be cautious what and how much content you consume.
Here is the Link for github: Neovim configuration on github
I am always glad for feedback, especially since I do not know how to code and it took me quite some time and effort to make it work.
My contact information can be found on my blog.
Below is the README excerpt from github which should have enough information to install it and make it work on ubuntu or fedora.
neovim_configuration_for writers_with_zettelkasten
Because keyboard and text-editor are on par with the sword!
And BigBlockBitcoin is the real Bitcoin!
Follow me on:
steffenkd
RSS available!
WHAT IS THIS?
This is a fork and copy paste script kiddie approach which benefitted from the following projects:
- lunarvim from chris@machine
- lazyvim from folke
- theena’s writing implementation OVI-Write
Thank you very much!
This is a neovim implementation for writers, bloggers and zettelkasten enthusiasts.
It has the following features:
- markdown-browser-preview (toggle on/off).
- light/dark-mode colorscheme (toggle on/off).
- zettelkasten ability (the extension is called telekasten.
- zenmode for distraction free writing (toggle on/off).
- telescope fuzzy finder for searching.
- spell check and adding unknown vocabulary (toggle on/off).
- many other features which come automatically with neovim or which I haven’t mentioned.
LINUX INSTALLATION:
On debian you have to add the unstable repository, because the standard ones are outdated and will give you errors.
sudo add-apt-repository ppa:neovim-ppa/unstable
sudo apt-get update
sudo apt-get install neovim
On Fedora you can use the normal packages sinde they are up to date.
sudo dnf install neovim
Install the following dependencies and packages with the package manager of your choice, so everything works:
ripgrep ack git nodejs xclip clang fd-find fzf curl python3 pandoc npm wget xsel wl-clipboard cmake gettext g++
Maybe some of them are not really necessary, but I haven’t really checked. So better to install all of them.
Set up neovim node support:
npm install -g neovim
For linux I recommend using the following repo to get a Nerd Font (Font that supports icons), but it is not necessary: getnf
Thanks again to chris@machine for mentioning this in his README.
On FreeBSD (unix) you can install nerdfonts via the pkg packet manager.
If you already have another working nvim configuration you should backup the existing folder first or just rename it.
Clone/copy the nvim repository/folder into your /home/.config folder so it looks like this: /home/.config/nvim/ whereas the nvim-folder is the one from my github.
Since you have already installed the git package you can also open the command line and enter:
git clone https://github.com/steffenkd/nvim ~/.config/nvim to clone the nvim configuration folder into /home/.config.
The .config folder is an invisible folder in your home directory and you can make this folder visible by pressing ctrl+h when you are in your home directory.
Run neovim by opening a terminal, type nvim and hit Enter.
If you press F10 you will have the terminal in Fullscreen.
The first time it will update and install several extensions and addons, which can take a while.
Update one more time afterwards by pressing Shift+U.
Close (Shift+Z+Z) and restart (typing nvim again) after everything has installed and updated.
Run the command :checkhealth, to see if there are any packages or dependencies you forgot to install or which I forgot to mention and install them with the package manager of your choice.
GENERAL CONFIGURATION AND CUSTOMIZATION:
Navigate into the /.config/nvim/ folder.
There should be a folder named vaults.
Cut this folder and insert it into your home folder, so that the vaults folder is in the same directory as the /.config folder.
This is necessary for a working zettelkasten functionality.
If you have understood how everything works, you can setup your own structure later if you want.
In the nvim-Folder you will find a file named init.lua.
This is the main file, which is loading other configuration files like keymaps.lua or autocommands.lua.
You can also edit it by pressing c in neovim at the beginning to access this configuration file like stated in the menu.
When working with .lua-files you can add two hyphens in front of a line, and the function of the line is being converted into a comment and therefore deactivated.
If you want to deactivate or activate larger parts like in colorscheme.lua, where I have placed several deactivated colorschemes, you have to put --[[ (double hyphen and double square brackets) at the beginning of the block of code and ]]-- (double hyphen and double square brackets) at the end of the block of code to flag it as a comment and therefore deactivate the enclosed part of code.
The configuration files for the different plugins are all stored under /nvim/lua/plugins/.
Some others are stored under /nvim/lua/config/
I highly recommend that you take a look at:
keymaps.luato learn about the necessary shortcuts and key commands for toggle certain actions and commands and use the Zettelkasten features - or change them if you prefer other keymaps.telekasten.luato configure the Zettelkasten plugin - later you can change the root folder for the Zettelkasten and create your own layout.
Like already mentioned before, I have put a folder namedvaultsinto the nvim configuration. Cut it and paste it into your home directory and everything should work fine.colorscheme.luafor activating/deactivating some other colorschemes, the current colorscheme has a light and a dark theme which can be changed by pressingSpacefollowed bytfollowed by eitherdfor dark orlfor light.alpha.luais for the welcome-screen configuration file, where you have to change the Zettelkasten-folder-path, or change the cat ASCII-picture, the quote or add additional entries.
If you made any changes, you have to restart nvim.
KEYMAPS:
- The most important key is the leader key which is mapped to “Space”.
- If you have several files/tabs open, press
Shift+JorShift+Hto jump to the previous tab andShift+KorShift+Lto go to the next tab. - Press
Ctrl+6to switch between the last two tabs, quite convenient when you are editing two files. - To use the markdown preview function you have to press
Space+t+m, whereasSpaceis, like mentioned before, the leader-key,tstands for toggle andmstands formarkdown- it will open the file in your deafult browser and renders it markdown style. - To toggle the zenmode for distraction free writing you have to press
Space+t+z, whereasSpaceis, again, the leader-key,tstands for toggle andzstands for “zenmode”. - To toggle between nightmode/darkmode you have to press
Space+t+l, whereaslstands for “light”, but it switches between both modes. - Press
Space+eto open and close the foldertree view (NvimTree-toggle) on the left side of the window where you can navigate through the folders and files - use the normal nvim-keymapsjlfor navigation andhlfor moving up or down the folder structure (opening files). - Toggle spell check
Space+s+s. - If you want to add an unregonized word to the spell list, put the cursor over the word in visual mode and press
zg. - If you want to save a file press
Ctrl+s. - If you want to save and close a file press
Space+wwhereaswstands for “write”. - If you just want to close a file without saving/writing press
Space+qwhereasqstands for “quit”. - If you want to exit nvim after you have saved everything you either type
q!and hit enter or you can typeShift+Z+Z.
Telescope file find/search keymaps:
Space+f+fsearch for a file.Space+f+gsearch for a word inside files.Space+f+btelescope buffers.
The Zettelkasten keymaps:
Space+z- show dropdown menu for all mapped Telekasten commands below, Brings up the command paletteSpace+zz- create a new note by template, prompts for title and templateSpace+zn- Create a new note, prompts for titleSpace+zf- Find notes by filenameSpace+zs- Search (grep) IN all notesSpace+zg- Follow the link under the cursorSpace+zp- Insert a link to a noteSpace+zy- Yank a link to the currently open noteSpace+zr- Rename current note AND update the links pointing to itSpace+zt- Search through all tagsSpace+zb- Show all notes linking to the current oneSpace+zl- Show all notes linking to the link under the cursorSpace+zd- open daily template for note and create new diary entry in diary folderSpace+zi- Paste an image from the clipboard into a file and inserts a link to itSpace+zii- Browse images / media files and insert a link to the selected oneSpace+zip- preview image under the cursorSpace+zb- Browse images / media filesSpace+ztd- Toggle - [ ] todo status of a line
If you have any improvements or recommendations which is quite likely, you can write me an e-mail.
My contact information is available on my homepage under about.