Generate table of contents with anchors for markdown file - Vim plugin Jul 20 2020

Vim is my preferred text editor, and I do most of my writing on markdown. If you haven’t used markdown, I encourage you to try it out. Markdown is a simple markup language that is in common use on the internet for static site generators. The syntax is easy to remember; that is probably why I prefer it. One useful improvement to our markdown files is the addition of a tabel of contents. Having a table of contents on my documents is handy, but more than just having the table of content being able to navigate to the sections is even better. In this short article, I’ll show you how I accomplish this by using my modified version of the vim-markdown-toc plugin.

Read More...

Setup Swift LSP and Vim Jan 22 2019

With the release of SourceKit-LSP we can run an LSP server for the Swift programming language. That means that we can take advantage of autocompletion and jump to the definition in our text editors that support connection to an LSP server. I’ll show how to set this up using Vim 8.

LAST UPDATED: September/25/2019

First install SourceKit-LSP

Clone the source from the SourceKit-LSP repository

Read More...

CTags vim multiple projects Feb 14 2018

If you have to reference multiple directories on your ctags do the following.

Install ctags

Generate CTags for all of your projects, from your project’s root

1
ctags -R .

this will generate a file tags, add it to the git ignore

1
echo "tags" >> ~/.gitignore_global

Now configure your vimrc to search current dir, then add other the tag files from your other projects

set tags=./tags,$HOME/project1/tags,$DEVPATH/project2/tags

Now you can go to the root of all of your projects open vim and Ctrl-] Ctrl-t all you like

Read More...

Vim use ESLint via ALE Jul 17 2017

Why ALE and not Syntastic ? just personal preference, ALE seems to take advantage of the async in Vim 8, just that.

What would we need:

Step 1.

Installing ESLint is very straightforward using NPM  in general just(this will install it in your current directory if you want it global use the -g flag, you should have initialized your npm in the current project npm init prior to run this command):

Read More...

Vim colour schema Jul 15 2017

When you see colours displayed on vim, they are defined by highlight rules, and they are applied to groups (in the example below the group is Normal, you can view all of them running: :so $VIMRUNTIME/syntax/hitest.vim) for example:

" Set the background colour to white 
:highlight Normal ctermbg=White
" Set the background colour to yellow
:highlight Normal ctermbg=Yellow
" Set the background colour to none(back to normal)
:highlight Normal ctermbg=0

Where are colours defined? you can check the value of each colour for x-term256 here

Read More...