-
Notifications
You must be signed in to change notification settings - Fork 715
Migrating from Vim popular plugins
This page lists how tasks performed by popular Vim plugins can be executed by kakoune native commands.
- tabular
- vim-exchange
- vim-swap
- vim-highlightedyank
- vim-textobj-entire
- vim-textobj-indent
- NERD Commenter / vim-commentary
- syntastic
- vim-gitgutter
- rainbow
- vim-hexokinase
https://github.com/godlygeek/tabular
Easily align text.
from
one = 1
two = 2
three = 3
four = 4
:Tab/=
to
one = 1
two = 2
three = 3
four = 4
- select all buffer
%
- select all
=
chars withs=
- confirm selection with
<cr>
- use the align command
&
https://github.com/tommcdo/vim-exchange
Easy text exchange operator for Vim.
cx
On the first use, define the first {motion} to exchange. On the second use, define the second {motion} and perform the exchange.
Let's say we want to exchange the words bananas and chocolate in the following sentence :
I like bananas but I prefer chocolate
- select the word
bananas
(without the trailing white space, for example by placing the cursor on the letterb
and select until the end of the word using thee
movement) - save this selection to the default mark register (^) with
Z
- select the word
chocolate
- append the previous selection from the default mark register with
<a-z> a
- rotate the selections content with
<a-)>
forward or<a-(>
backward
Note that this approach is not limited to only 2 selections.
https://github.com/machakann/vim-swap
Swap delimited items, like function arguments (foo, bar, quux)
to (quux, foo, bar)
new operator are available to do the swapping g<
and g>
- select inside the parens with
<a-i>(
- split selection pressing
S
, then,
(notice trailing white space) and confirm<cr>
- rotate the selections content with
<a-)>
https://github.com/machakann/vim-highlightedyank
Make the yanked region apparent!
By adding this plugin, every time you yank something, like a text-object, it will briefly flash to visually confirm that you yanked what you intented.
It is in kakoune's DNA to always highlight the current selections, so there's no surprise. It always matches your expectations.
https://github.com/kana/vim-textobj-entire
Entire content of buffer.
It avoids the ggVG
dance. Let you do things like yie
to yank all buffer.
Use the builtin %
. To yank all buffer: %y
https://github.com/kana/vim-textobj-indent
Add the i
text object to select a block of lines which are similarly indented to the current line. Example to delete dii
.
Use the builtin i
text object. Example to delete <a-i>id
https://github.com/scrooloose/nerdcommenter https://github.com/tpope/vim-commentary
use the new command gc
followed by a move or a text-object to add comments.
use the builtin commands comment-block
and comment-line
.
https://github.com/vim-syntastic/syntastic
syntastic runs an external tool in background to find syntax errors. it then updates the UI to show them
use the builtin lint commands.
When you provide the correct path to the external tool for a given language (example eslint
for JavaScript files), it will list the errors in a dedicated buffer (similar to location list in vim), add error and warning flags in the gutter and also show inline infoboxes displaying error messages.
https://github.com/airblade/vim-gitgutter
vim-gitgutter displays signs like +
(green) or -
(red) near line numbers indicating additions or deletions of code.
use the builtin git command git show-diff
https://github.com/luochen1990/rainbow or https://github.com/p00f/nvim-ts-rainbow
This plugin help you read complex codes were composed of a mass of different kinds of parentheses by showing different levels of parentheses in different colors
There are Kak-rainbow, Kakoune-rainbow or Kak-rainbower plugins.
https://github.com/RRethy/vim-hexokinase
The plugin for asynchronously displaying the colours in the file (#rrggbb
, #rgb
, rgb(a)?
functions, hsl(a)?
functions, web colours, custom patterns).
Try Kakoune-palette or Colorcol plugins. If non satisfied you, check out this discuss.
Kakoune also has many plugins on its own!
- Normal mode commands
- Avoid the escape key
- Implementing user mode (Leader key)
- Kakoune explain
- Kakoune TV