How to temporarily exit Vim and go back

Assuming terminal Vim on a flavor of *nix: To suspend your running Vim Ctrl + Z will suspend the process and get back to your shell fg will resume (bring to foreground) your suspended Vim. To start a new shell Start a subshell using: :sh (as configured by) :set shell? or :!bash followed by: Ctrl+D … Read more

How to see which plugins are making Vim slow?

You can use built-in profiling support: after launching vim do :profile start profile.log :profile func * :profile file * ” At this point do slow actions :profile pause :noautocmd qall! (unlike quitting noautocmd is not really required, it just makes vim quit faster). Note: you won’t get information about functions there were deleted before vim … Read more

Move entire line up and down in Vim

If I want to swap one line with the line above I usually do the following ddkP Explanation dd will delete the line and add it to the default register. k will move up a line (j would move down a line) P will paste above the current line

Traversing text in Insert mode

While it may make sense that you should be able to use the h j k l keys to traverse the editor in insert mode, but that is actually not the way Vim is intended to be used! There are many commands that Vim provides to make editing faster and easier. The right way is … Read more

Using Vim’s tabs like buffers

Stop, stop, stop. This is not how Vim’s tabs are designed to be used. In fact, they’re misnamed. A better name would be “viewport” or “layout”, because that’s what a tab is—it’s a different layout of windows of all of your existing buffers. Trying to beat Vim into 1 tab == 1 buffer is an … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)