Create subcommands based on this key. e.g. If leader is space key, <space> + sf
displays UI to search files.
up/down/left/right
cursor do exactly as they are named.
Alternatively, you cna also use:
k (up)
h(left) l(right)
j(down)
- Paragraph:
shift {
orshift }
- Using GOTO
:<linenumber><enter>
In normal mode:
- Press
x
to delete character at the cursor. dap
: deletes current paragraphdw
: deletes one word after cursord2w
: deletes 2 words afte cursor. You can modify the numberd<n>w
d$
deletes everything starting from the cursor to end of line.
Press u
as many times you want to undo.
presss i
to go to insert mode.
Presss shift+a
. It moves the cursor to the end of line.
TBD
To go Neotree folder view and select the folder with cursor, and press d
.
Many commans that change texts are made from operators and motion.
e.g. format for delete command d motion
.
d = delete operator
motion = w, e, $
Pressing just the motion, will move the cursor in the motion specified.
e.g. if we only press w, cursor will move right by a word.
2w
moves to 2 words forward.0
start of line.
d count motion
d2w
: delete two words
Go to end of file: G
or shift + g
Go to start of file: gg
- Delete a whole line:
dd
- Deleting a line copies the line in Neovim's register. We can also paste it with
p
command. - Adding a count will delete N lines after cursor. For e.g.
2dd
deletes 2 lines
u
to undo last command.U
to fix a whole line. Returns just the line to its original state.- Redo:
ctrl + r
yy
to copy the line where cursor is- Type
v
to enter into visual mode. y
to yank or copy selected linesp
to pasteyap
Yank Around Paragraph: means it copies whole paragraph moving cursor to the starting of the paragraph.
After selecting text or deleting with dd
, we can type p
to paste the line after the cursor.
Shift+5
or %
- `:Explore``
- Go to
../
and press Enter.
- Source whole configs:
:source $MYVIMRC
- Source changed file only:
:source /path/to/your/config/file.lua
Lazy.nvim
andNvchad
. Lazy.nvim seems to be the better one.- To open plugin manager:
:Lazy
- To update all plugins:
:Lazy update
or pressU
after opening Lazy. - Displays how long it took to load nvim:
:Lazy profile
To apply suggestions: ctrl + y
or enter
, tab
for next suggestion
gt
orgT
- close currenttab:
:tabclose
- Switch to a specific tab with number:
:tabn 2
:%s/<original>/<text-to-replace>
e.g. :%s/Hover/Definition
source %
gd
shift + k
To enter inside hover window, press shift k
again and nagivate documentation using usual key maps.
<leader> + ca
Shows which LSPs are running in current buffer.
:LspInfo
Language client log: /Users/nirdosh/.local/state/nvim/lsp.log
Detected filetype: markdown
1 client(s) attached to this buffer:
Client: nirdoshgolsp (id: 1, bufnr: [1])
filetypes:
autostart: false
root directory: Running in single file mode.
cmd: /Users/nirdosh/Personal/golsp/main
Configured servers list: lua_ls, gopls
When you are editing files, various events are fired e.g. opening buffer, entering into insert mode e.t.c. You can write your custom Lua code to trigger in this events. For example, autosaving file when we leave insert mode.
You can see all events using: :h autocmd-events
:tabnew | terminal
and go to insert mode.