In this repo I want to keep my neo vim config. It might evolve over time, let's see. Currently I'm just playing around. So don't expect anything functional here....
And right at the moment I'm moving my current setup from init.vim to completely using lua. So at the beginning it will be a downgrade. Stuff is heavily influenced by [neovim configuration from brainfucksec(https://github.com/brainfucksec/neovim-lua)
Needed neovim version >=0.8.0
use :checkhealth
to get a first overview of the current status of the system.
Some specific packages should be present on the system
python3
ruby
git
luarocks
Make sure to install and enable Nerd Fonts
init.lua
- main configuration file, used to only reference other config fileslua
- Containing all the lua stuffcore
- All main configuration filesoptions.lua
- Config options for vim and neovimkeymaps.lua
- All keybindings, generic and specific for pluginslazy_config.lua
- enabling of used plugins. For details see section about plugins
- To exit insert or terminal mode, you can also use
jk
>
,<
for indentation in visual modeShift-h
,Shift-l
to switch between buffersCtrl-Left
,Ctrl-Right
switch between windows (specifically treeview)
/
invoke incremental searchn
move to next matchN
move to previous matchC-p
fzf a fileC-\
fzf open buffersC-l
do a live grep (using rg)C-k
search available keymaps
In insert or command mode you can insert content of a register by pressing C-r <register_name>
where register_name is the according key.
Key | Does what | Key | Does what |
---|---|---|---|
h |
Move left | l |
Move right |
j |
Move down | k |
Move up |
Key | Does what | Key | Does what |
---|---|---|---|
0 |
Move to line start | $ |
Move to line end |
^ |
Move to first non blank char | e |
Move to end of word |
w |
Move to next word | b |
Move to previous word |
F<c> |
Move to next occurrence of <c> |
Key | Does what | Key | Does what |
---|---|---|---|
( |
Move up one sentence | ) |
Move down one sentence |
{ |
Move up one paragraph | } |
Move down one paragraph |
ctrl + u |
Move up half a page | ctrl + d |
Move down half a page |
ctrl + b |
ctrl + f |
Move down a page | |
gg |
Move to buffer start | G |
Move to end of buffer |
Key | Does what | Key | Does what |
---|---|---|---|
i |
Insert before cursor | I |
Insert at start of line (before first char) |
I |
In vertical select multi edit | ||
a |
Insert after cursor | A |
Insert after end of line |
o |
Insert new line in next line | O |
Insert new line in previous line |
C |
Clear from cursor until end of line | ciw |
Change current word |
s |
Clear symbol under cursor | S |
Clear line |
J |
Join next line | ||
r |
Replace character under cursor | ~ |
Change case of character under cursor |
gUw |
Change word to uppercase | guw |
Change word to lowercase |
Key | Does what | Key | Does what |
---|---|---|---|
y<n>y |
Yank <n> lines (if n is omitted, 1 line) |
yw |
Yank to start of next word |
y^ |
Yank until start of line | y$ |
Yank until end of line |
yiw |
Yank current word | yi{ |
Yank current region enclosed by {} , could also be () or [] |
yt<c> |
Yank until next occurence of <c> |
||
d<n>d |
Delete <n> lines (if n is omitted 1 line) |
Remaining shortcuts are similar to yanking | |
p |
Paste unnamed register in line after cursor | P |
Paste unnamed register in line before cursor |
ctrl + v |
Enter visual select mode |
Key | Does what | Key | Does what |
---|---|---|---|
u |
Undo | ctrl + r |
Redo |
. |
Repeat last action |
Key | Does what | Key | Does what |
---|---|---|---|
/ |
Invoke incremental serch | ||
n |
Move to next match | N |
Move to previous match |
* |
Search next occurence of word under cursor | # |
Search previous occurrence of word under cursor |
Key | Does what | Key | Does what |
---|---|---|---|
m<c> |
Bookmark position of cursor in <c> |
`<c> |
Return to position bookmarked in <c> |
` |
Toggle between last two positions | `. |
Return to last editing |
Key | Does what | Key | Does what |
---|---|---|---|
== |
Indent current line | % |
Jump to corresponding bracket |
Key | Does what | Key | Does what |
---|---|---|---|
q<c> |
Record macro in named register <c> |
@<c> |
Recall macro from named register <c> |
Key | Does what | Key | Does what |
---|---|---|---|
:s/<pattern>/<substitute>/ |
Replace occurrence of <pattern> with <substitute> (once per line) |
:%s/<pattern>/<substitute>/ |
Replace occurrences of <pattern> with <substitute> (several per line) |
:g/<pattern>/d |
Delete all lines matching <pattern> |
:v/<pattern>/d |
Delete all lines not matching <pattern> |
:'<'> <...> |
Apply <...> to current selection |
||
:read <path> |
Read file into current buffer | :read !<command> |
Read output of command in current buffer |
:sort |
Sort lines in file | :sort! |
Sort lines in file descending |
vim offers several different registers. They are either automatically or explicitly filled.
They can be accessed by prepending "
to the register name. For example you are in visual mode
and want to yank the current selection to the named register e, then you would enter "ey
.
To read from the register in insert or command mode you can use C-r <register_name>
These are the different register names:
"
The unnamed register. Contains last yanked/deleted region (if not specifically writing to named register or black hole)-
the last small delete (smaller than a line)_
The black hole. Anything you write to this register is lost.0
-9
Numbered register. Yank/delete fills according region in0
and shifts previous content by one numbera
-z
,A
-Z
named registers. Can be used to store something in it.%
read only Current filename with full path#
alternate filename (the previous file in this buffer, if applicable)*
or+
clipboard/
Last search pattern:
read only Last command line.
read only Last inserted text (Does not work withC-r
on command line)=
The expression register. All subsequent inputs until<CR>
(or<ESC>
) are evaluated as a command (or abandoned)
For handling plugins the lazy plugin manager is used. The basic setup should happen automatically.
The overall configuration is handled in lua/core/lazy_config.lua
.
Here you cna enable plugins by adding them to a list.
If you need specific configuration for a plugin, you can also
create a file in lua/plugins/...
.
:Lazy health
equal to:checkhealth lazy
get details about any problems with the packager.:Lazy
show lazy panel:Lazy help
help text:Lazy install
install missing packages:Lazy clean
remove unused packages:Lazy update
gets updates for packages:Lazy sync
calls install, clean, update:Lazy log
show changelog for packages
nvim-tree
is a file explorer.
Making it easier to browse the available files
Shortcuts
g?
Show helpa
add file or directoryq
closex
cutp
paste<C-t>
Open in new tab<C-v>
Open in vertical split<C-x>
Open in horizontal split
nvim-web-devicons
adds filetype glyphs and colors.
feline
a minimal, stylish and customizable statusline
fzf-lua
lua implementation for using fzf
Some general introduction about fzf on YT
Shortcuts
C-p
Search for filesC-\
Search for buffersC-g
Grep - search for grep expression and then interactively search the resultsC-l
Live grep - interactively search for grep expressionC-k
Keymaps
yanky
The aim ofyanky.nvim
is to improve yank and put functionalities for Neovim.
- nvim - Documentation main page
- nvim lua - Lua documentation by neovim project
- vim diff - Differences between nvim and vim
- Options - Neovim's options listed
- vim cheat sheet - Standard vim cheat sheet, grouped by different modes. Done by Kethqwerty in Notion
- Keyboard layout - A cheat sheet representing all the keys in QWERTY keyboard layout. Done via google docs
- Lua in Y minutes - Quick one page overview about lua
- Quick guide - Another guide