Show Count of Matches in Vim

Modern Vim Starting with Vim 8.1.1270, there’s a new feature in core to show the current match position. NeoVim enables this functionality by default, but standard Vim does not. To enable it in standard Vim, run: :set shortmess-=S Originally mentioned below in Ben’s answer, and added here for visibility. Older Versions In Vim 7.4+, the … Read more

How to get path to the current vimscript being executed

” Relative path of script file: let s:path = expand(‘<sfile>’) ” Absolute path of script file: let s:path = expand(‘<sfile>:p’) ” Absolute path of script file with symbolic links resolved: let s:path = resolve(expand(‘<sfile>:p’)) ” Folder in which script resides: (not safe for symlinks) let s:path = expand(‘<sfile>:p:h’) ” If you’re using a symlink to … Read more

Enabling markdown highlighting in Vim

About the native syntax highlight for markdown I think it only works for files with the extension .markdown by default. I was having problems with markdown syntax highlight for my .md files. I tried: :set syntax=markdown And it worked. So i included the following line in my .vimrc: au BufNewFile,BufFilePre,BufRead *.md set filetype=markdown Now my … Read more

Paste in insert mode?

While in insert mode hit CTRL-R {register} Examples: CTRL-R * will insert in the contents of the clipboard CTRL-R ” (the unnamed register) inserts the last delete or yank. To find this in vim’s help type :h i_ctrl-r

Why does using from __future__ import print_function breaks Python2-style print? [closed]

First of all, from __future__ import print_function needs to be the first line of code in your script (aside from some exceptions mentioned below). Second of all, as other answers have said, you have to use print as a function now. That’s the whole point of from __future__ import print_function; to bring the print function … Read more

GnuTLS recv error (-110): The TLS connection was non-properly terminated

Recompile and install git solve it finally, the steps are the following: sudo apt-get install build-essential fakeroot dpkg-dev -y sudo apt-get build-dep git -y sudo apt-get install libcurl4-openssl-dev -y cd ~ mkdir source-git cd source-git/ apt-get source git cd git-2.*.*/ sed -i — ‘s/libcurl4-gnutls-dev/libcurl4-openssl-dev/’ ./debian/control sed -i — ‘/TEST\s*=\s*test/d’ ./debian/rules dpkg-buildpackage -rfakeroot -b -uc -us … Read more

Does Vim load plugins after loading vimrc?

Yes. vimrc is loaded before plugins. If you look at :h initialization you will find that step 3 is load vimrc and step 4 is load plugins. You can also see that vimrc is loaded before plugins by looking at the output of :scriptnames. scriptnames lists all sourced scripts in the order they were sourced … Read more

Cut to the system clipboard from Vim on Ubuntu

Your version of Vim doesn’t support X, which is required for clipboard access. By default, Ubuntu ships several builds of vim and only the GUI variant supports clipboard access. I always recompile vim from source so that a single vim (with symlinks for gvim etc) supports everything required (including :gui to switch from command line … Read more