The goal of this project is to have a fast Neovim startup, provide mappings that can be easily memorised, interact with the Lua API, and make programming fun.
This setup is mostly customised to for Go (Golang) and Rust development. There is also a few other LSP servers setup for other LSP servers to work with various file types.
This project supports Neovim version 0.10.0
and newer.
- Besides in a few places that Neovim doesn't provide an API in Lua, most configuration is done in Lua.
- LSP, Treesitter, and FZF are setup to work together.
- Seamless navigation with tmux.
- Completion with nvim-cmp plugin is setup.
- It is optimised to handle very large files.
- There are some handy textobjects such as backticks and indents.
- You can add the current location of the cursor or make notes on the current location in the quickfix/local lists with repeatable mappings.
- You can manipulate quickfix/local lists.
- It comes with integration with git and gist.
- Has a lot of useful feedback in the gutter.
- Statusline is configures with feline.
- It is set to give a lot of useful information about the buffer.
- Prettier quickfix buffer and quickfix tools.
- The theme is setup with Lua to take advantage of its performance.
Just clone this project:
$ git clone https://github.com/arsham/shark.git ~/.config/nvim
Once you start Neovim
, it will install the package manager and installs the
listed plugins.
Some default mappings/commands are augmented to centre the buffer after the execution.
Some mappings/commands are obvious, but I've left them here as a reminder. Some are left out either because they are not used too often, or they are defined after writing this document and I've forgot to document.
I would recommend you have a look at the code to see what is available to you.
This list might change at any time depending on if there is a better replacement or the requirement changes.
Click to view the plugin list
Some plugins are not listed here. You can find the complete list in the plugins folder.
Licenses for plugins can be found here.
Function | Plugin | Description |
---|---|---|
🔥 Core | folke/lazy.nvim | Package manager |
🔥 Visual | arsham/arshamiser.nvim | Status line, colour scheme and folds |
🔥 Lists | arsham/listish.nvim | Supporting quickfix and local lists |
🧰 Lib | arsham/arshlib.nvim | Library used in various plugins |
⚡ Visual | nvim-tree/nvim-web-devicons | |
🔍 Finder | junegunn/fzf | Fuzzy finder |
🔍 Finder | junegunn/fzf.vim | fzf plugin for vim |
🔥 Finder | arsham/fzfmania.nvim | Very powerful FZF setup in lua |
🔥 Finder | ibhagwan/fzf-lua | fzf ❤️ lua - fzf frontend |
🧰 Core | nvim-lua/plenary.nvim | |
⏩ Core | tweekmonster/startuptime.vim | Benchmarking startup |
🔁 Core | tpope/vim-repeat | |
🥇 Textobj | arsham/archer.nvim | Mappings and text objects for archers |
🧰 Visuals | MunifTanjim/nui.nvim | UI component |
🥇 Textobj | arsham/indent-tools.nvim | Indent mappings and text object |
🔥 Visuals | arsham/matchmaker.nvim | Creates highlight for user matches |
🛢️ Tool | stevearc/oil.nvim | File explorer |
GIT | tpope/vim-fugitive | git integration |
GIT | tpope/vim-rhubarb | Go to selection's code Github page |
Core | tpope/vim-git | |
🌲 Visuals | nvim-treesitter | Highlighting engine |
🔥 GIT | lewis6991/gitsigns.nvim | git signs in the gutter |
🥇 Textobj | nvim-treesitter-textobjects | Treesitter Text Objects |
🔥 Visuals | freddiehaddad/feline.nvim | Statusline (default) |
🗨️ Visuals | rcarriga/nvim-notify | Better notification UI |
🌈 Visuals | treesitter-refactor | Treesitter plugin |
🗒️ Visuals | nvim-treesitter/playground | Treesitter plugin |
Editing | context-commentstring | |
🥊 Core | andymass/vim-matchup | |
Editing | monaqa/dial.nvim | Enhanced increment/decrement values |
👗 Visuals | stevearc/dressing.nvim | |
GIT | mattn/vim-gist | gist integration |
Core | RaafatTurki/hex.nvim | Hex viewer |
Tool | iamcco/markdown-preview.nvim | |
🧭 Core | numToStr/Navigator.nvim | Seamless navigation with tmux |
📁 Tool | nvim-neo-tree/neo-tree.nvim | File explorer tree |
🪟 Core | s1n7ax/nvim-window-picker | Window picker |
Tool | ralismark/opsort.vim | Sort operator |
Tool | sQVe/sort.nvim | Line-wise and delimiter sorting |
🔭 Tool | dhruvasagar/vim-zoom | Zoom windows |
🥇 Textobj | David-Kunz/treesitter-unit | Treesitter units |
LSP | neovim/nvim-lspconfig | LSP configuration |
LSP | mason.nvim | Package manager for LSP, DAP, etc. |
LSP | mason-lspconfig.nvim | LSP config bridge for mason.nvim |
LSP | hrsh7th/nvim-cmp | Completion with LSP |
LSP | saadparwaiz1/cmp_luasnip | Extension for nvim-cmp |
LSP | L3MON4D3/LuaSnip | Snippet engine |
LSP | hrsh7th/cmp-cmdline | Extension for nvim-cmp |
LSP | friendly-snippets | |
LSP | hrsh7th/cmp-buffer | Extension for nvim-cmp |
LSP | hrsh7th/cmp-calc | Extension for nvim-cmp |
LSP | hrsh7th/cmp-nvim-lsp | Extension for nvim-cmp |
LSP | hrsh7th/lsp-signature-help | Extension for nvim-cmp |
LSP | hrsh7th/cmp-nvim-lua | Extension for nvim-cmp |
LSP | hrsh7th/cmp-path | Extension for nvim-cmp |
LSP | lukas-reineke/cmp-rg | Extension for nvim-cmp |
💡 LSP | j-hui/fidget.nvim | Spinner for LSP status |
📢 LSP | none-ls.nvim | External Tool to LSP bridge |
📢 LSP | mason-null-ls.nvim | Null LS and Mason bridge |
📢 LSP | mason-tool-installer | LSP server installer |
🗒️ Editing | numToStr/Comment.nvim | Comment string |
🗒️ LSP | smjonas/inc-rename.nvim | Incremental renaming |
🗒️ Editing | windwp/nvim-autopairs | |
Editing | arthurxavierx/vim-caser | Case conversion |
🖌️ Visuals | NvChad/nvim-colorizer.lua | Colourise matched colours in buffer |
🦀 Tools | saecki/crates.nvim | Crate.toml helper |
💡 LSP | kosayoda/nvim-lightbulb | Code actions buln |
Editing | gbprod/substitute.nvim | Text exchange operator |
💡 LSP | lsp_lines.nvim | Show LSP diagnostics in extmarks |
👈 Core | milisims/nvim-luaref | |
🗒️ Editing | echasnovski/mini.nvim | For surround, alignments, etc. |
Core | folke/neodev.nvim | |
📆 Tool | nvim-neorg/neorg | Note taking tool |
Lists | kevinhwang91/nvim-bqf | Better quickfix list manager |
Tool | bfredl/nvim-luadev | REPL/debug console for lua plugins |
💡 LSP | SmiteshP/nvim-navic | Current code context with LSP |
Tool | kiran94/s3edit.nvim | Edit files on S3 bucket |
🔍 Tool | woosaaahh/sj.nvim | Search and quickly jump |
Editing | mbbill/undotree | Undo tree browser |
GIT | rbong/vim-flog | git log graph |
🎡 Visual | towolf/vim-helm | Helm syntax highlighting |
Core | tmux-plugins/vim-tmux | |
Editing | mg979/vim-visual-multi | Multiple cursors |
🔫 Core | svban/YankAssassin.vim | Stay where you are after yanking |
Editing | zbirenbaum/copilot.lua | Copilot |
Editing | Exafunction/codeium.vim | Codeium (opensource copilot) |
💡 LSP | utilyre/barbecue.nvim | Complementary to navic |
LSP | uga-rosa/cmp-dynamic | Extension for nvim-cmp |
Tool | stevearc/overseer.nvim | Task runner |
🌈 Tool | ziontee113/color-picker.nvim | Colour picker and updater |
Editing | aduros/ai.vim | OpenAI plugin |
Tool | tamton-aquib/duck.nvim | Fun little ducks |
🕸️ Tool | rest-nvim/rest.nvim | Fast http client in lua |
🧰 Lib | vhyrro/luarocks.nvim | Easily install luarocks with lazy.nvim |
🔍 Tool | arsham/yanker.nvim | Yank history helper |
🗒️ Editing | jbyuki/venn.nvim | Draw ASCII diagrams |
Editing | jackMort/ChatGPT.nvim | ChatGPT |
🔍 Finder | nvim-telescope/telescope.nvim | Fuzzy finder/picker |
Tool | tpope/vim-dadbod | Database connection and query manager |
Note that if copilot is enabled, codeium will be disabled.
In most mappings we are following this theme, unless there is an uncomfortable situation or messes with a community-driven or Vim's very well known mapping:
Part of mapping | Description |
---|---|
q | Quickfix list mappings |
w | Local list mappings (because it's near q) |
w | Window |
] | Jumps to the next item |
[ | Jumps to the previous item |
b | Buffer |
f | File, Find |
a | All, or disabling certain constraints |
a | Argument (parameter) |
i | Indent |
m | Match highlighting |
d | Diff, Diagnostics |
h | Hunk |
c | Change, Copilot, Codium |
s | Statement, Scope |
o | Loop |
e | Element |
y | Yank |
t | Tab |
z | Folds, language/spelling |
g | Go/Jump to, run something that goes/jumps to |
n | Neorg related |
r | Rest |
The leader
key is space
!
Click to view mappings
Mapping | Description |
---|---|
<Alt-,> |
Adds , at the end of current line without moving (repeatable) |
<S-Alt-,> |
Removes , from the end of current line without moving (repeatable) |
<Alt-.> |
Adds . at the end of current line without moving (repeatable) |
<S-Alt-.> |
Removes . from the end of current line without moving (repeatable) |
<Alt-;> |
Adds ; at the end of current line without moving (repeatable) |
<S-Alt-;> |
Removes ; from the end of current line without moving (repeatable) |
<Alt-{> |
Adds curly brackets at the end of line into insert mode (repeatable) |
[count]]<space> |
Inserts [count] empty lines after (repeatable) |
[count][<space> |
Inserts [count] empty lines before (repeatable) |
]i |
Jump down along the indents |
[i |
Jump up along the indents |
<leader>oo |
Open the Oil buffer. |
<leader>gg |
Fugitive git buffer |
<leader>gd |
Fugitive git Diff |
]c |
Jump to the next change |
[c |
Jump to the previous change |
<leader>gs |
(gitsigns) Toggle Signs |
<leader>hb |
(gitsigns) Blame line |
<leader>hs |
(gitsigns) Stage hunk |
<leader>hl |
(gitsigns) Stage line |
<leader>hu |
(gitsigns) Unstage hunk |
<leader>hr |
(gitsigns) Reset hunk |
<leader>hR |
(gitsigns) Reset buffer |
<leader>hp |
(gitsigns) Preview hunk |
]f |
Go to start of the next function |
[f |
Go to start of the previous function |
]F |
Go to end of the next function |
[F |
Go to end of the previous function |
]b |
Go to start of the next block |
[b |
Go to start of the previous block |
]B |
Go to end of the next block |
[B |
Go to end of the previous block |
]gc |
Go to start of the next comment |
[gc |
Go to start of the previous comment |
]a |
Go to start of the next parameter |
[a |
Go to start of the previous parameter |
]A |
Go to end of the next parameter |
[A |
Go to end of the previous parameter |
]o |
Go to the next loop |
[o |
Go to the previous loop |
]s |
Go to the next scope |
[s |
Go to the previous scope |
<leader>.f |
Swap around with the next function |
<leader>,f |
Swap around with the previous function |
<leader>.e |
Swap with the next element |
<leader>,e |
Swap with the previous element |
<leader>.a |
Swap with the next parameter |
<leader>,a |
Swap with the previous parameter |
<leader>df |
Peek function definition |
[count]<Alt-j> |
Shifts line(s) down and format |
[count]<Alt-k> |
Shifts line(s) up and format |
g= |
Re-indents the hole buffer |
<Left> |
Reduce vertical size |
<Right> |
Increase vertical size |
<Up> |
Reduce horizontal size |
<Down> |
Increase horizontal size |
<Esc><Esc> |
Clear hlsearch |
<leader>gw |
Grep current Word in buffer. Populates the locallist. |
<leader>sp |
Toggle Spelling for buffer |
<leader>sf |
Auto fixes previous misspelled word |
[i]<C-s> |
Auto fixes previous misspelled word |
<leader>hh |
Opens the help for current word |
<C-w>b |
Delete current buffer |
<C-w><C-b> |
Delete current buffer |
<C-w>t |
Open current buffer in new tab |
<C-w><C-t> |
Open current buffer in new tab |
cn |
Initiate a cgn on current word |
[V]cn |
Initiate a cgn on current visually |
selected string | |
g. |
Use last change (anything) as the |
initiate a cgn on current word |
|
<leader>zm |
Set folding method to Manual |
<leader>ze |
Set folding method to Expression |
<leader>zi |
Set folding method to Indent |
<leader>zk |
Set folding method to Marker |
<leader>zs |
Set folding method to Syntax |
[c]<Alt-a> |
Go to begging of the line |
[c]<Alt-e> |
Go to end of the line |
[c]<C-r><C-l> |
Copy current line in the buffer |
<Tab><Tab> |
Switch to the alternative buffer |
gso |
Sort objects |
gsoo |
Sort lines |
[s][i]<Ctrl-l> |
Next snippet choice |
[s][i]<Ctrl-h> |
Previous snippet choice |
[n,v]gc |
Comment operator |
<leader>nr |
Return from Neorg buffer |
<leader>nm |
Modify code block with Neorg looking-glass |
<leader>nh |
Neorg workspace Hme |
<leader>nw |
Neorg Workspace |
<leader>nj |
Neorg Journal |
[Neorg]]] |
Neorg buffer next heading |
[Neorg][[ |
Neorg buffer previous heading |
<leader>us |
Unlink all open snippet sessions |
<leader>ce |
Enable Copilot |
<leader>cd |
Disable Copilot |
<leader>cp |
Copilot Panel |
]] |
(copilot panel) Jump to the next suggestion |
[[ |
(copilot panel) Jump to the previous suggestion |
<CR> |
(copilot panel) Accept suggestion |
gr |
(copilot panel) Refresh |
<Alt-CR> |
(copilot panel) Open |
<Alt-]> |
(copilot suggestion) Next suggestion |
<Alt-[> |
(copilot suggestion) Previous suggestion |
<C-y><C-y> |
(copilot suggestion) Accept whole suggestion |
<C-y><C-w> |
(copilot suggestion) Accept a word of suggestion |
<C-y><C-l> |
(copilot suggestion) Accept a line of suggestion |
<Ctrl-]> |
(copilot suggestion) Dismiss |
<Leader>ce |
Enable Codeium |
<Leader>cd |
Disable Codeium |
<Leader>or |
Run overseer task |
<Leader>ot |
Toggle overseer tasks panel |
<Leader>fl |
Locate Files (neess mlocate) |
<Leader>rr |
Run Rest Request under cursor |
<Leader>rp |
Preview Rest Request under cursor in cURL command |
<Leader>R |
Rreview the last Rest Request |
<Leader>v |
Enable/Disable Venn |
[v]<leader>bd |
Base64 decode visually selected text |
[v]<leader>be |
Base64 encode visually selected text |
Note that if copilot is enabled, codeium will be disabled.
There are more specialised mappings provided, keep reading please!
Click to view the text objects
Text Object | Description |
---|---|
i` |
In backtick pairs (multi-line) |
a` |
Around backtick pairs (multi-line) |
an |
Around Next pairs (current lint) |
in |
In Next pairs (current line) |
iN |
In Numeric value (can be float too) |
aN |
Around Numeric value |
az |
Around folds |
iz |
In folds |
ai |
Around Indentation block |
ii |
In Indentation block |
ah |
Around Hunk |
ih |
In Hunk |
af |
Select around a function |
if |
Select inside a function |
am |
Select around a method |
im |
Select inside a method |
ab |
Select around a block |
ib |
Select inside a block |
aa |
Select around a parameter |
ia |
Select inside a parameter |
as |
Select around a statement |
H |
To the beginning of line |
L |
To the end of line |
au |
Select around a unit |
iu |
Select inside a unit |
il |
In line |
al |
Around line |
There are sets of i* and a* text objects, where *
can be any of:
_ . : , ; | / \ * + - #
There are a few tools for interacting with quickfix and local lists.
Following mappings can be used for either cases, all you need to do it to
substitute w
for q
or vice versa. Generally q is for quickfix list
and w is for local list. I chose w because it's beside q and it
makes it easy to think about these two types of lists.
<leader>qq
, <leader>ww
, <leader>qn
and <leader>wn
are repeatable with
.!
After adding an item to the list, an indicator in the statusline will show you how many items you have in a list.
Click to view mappings for lists
Mapping | Description |
---|---|
<leader>cc |
Close both quickfix and local list windows |
<leader>qq |
Add current line and column to the quickfix list. |
<leader>qn |
Add current line and column with your note to the quickfix list. |
<leader>qo |
Open the quickfix list. |
<leader>qd |
Drop the quickfix list. |
<leader>qc |
Close the quickfix list. |
]q |
Go to the next item in the quickfix list and centre. |
[q |
Go to the previous item in the quickfix list and centre. |
<leader>wq |
Add current line and column to the locallist. |
<leader>wn |
Add current line and column with your note to the locallist. |
<leader>wo |
Open the locallist. |
<leader>wd |
Drop the locallist. |
<leader>wc |
Close the locallist. |
]w |
Go to the next item in the locallist and centre. |
[w |
Go to the previous item in the locallist and centre. |
Click to view commands for lists
Command | Description |
---|---|
Clearquickfix |
Clear the quickfix list. |
Clearloclist |
Clear the local list of current buffer. |
Additional to nvim-bqf bindings,
you can do <count>dd
in the quickfix/local list buffers to delete <count>
rows from quickfix/local list buffer.
You can highlight words with random colours.
<leader>ma
and <leader>me
are repeatable with .!
Click to view the mappings
Note that all these mappings are bound to the current window.
Mapping | Description |
---|---|
<leader>ma |
Add current word as a sub-pattern to the highlights. |
<leader>me |
Add an exact match on current term. |
<leader>mp |
Add an match by asking for a pattern. |
<leader>ml |
Add current line |
<leader>md |
Delete Matches with fzf search. |
<leader>mc |
Clear all matched patterns on current window. |
Click to view the mappings
Most actions can apply to multiple selected items if possible.
Mapping | Description |
---|---|
<Ctrl-p> |
File list in current folder. |
<Alt-p> |
File list in home folder. |
<Ctrl-b> |
Buffer list. |
<Alt-b> |
Delete buffers from the buffer list. |
<Ctrl-/> |
Search in lines on current buffer. |
<Alt-/> |
Search in lines of all open buffers. |
<leader>@ |
Search in ctags or LSP symbols (see below). |
<leader>: |
Commands |
<leader>ff |
Find in contents of all files in current folder. |
<leader>fF |
Like <leader>ff , but you can filter filenames too |
<leader>fa |
Find All disabling .gitignore handling. |
<leader>fA |
Like <leader>fA , but you can filter filenames too |
<leader>fi |
Incrementally Find. |
<leader>rg |
Search (rg) with current word. |
<leader>fG |
Like <leader>fG , but you can filter filenames too |
<leader>ra |
Search (rg) disabling .gitignore handling. |
<leader>rA |
Like <leader>rA , but you can filter filenames too |
<leader>ri |
Incrementally search (rg) with current word. |
<leader>fh |
File History |
<leader>fl |
File locate (requires mlocate) |
<leader>gf |
GFiles |
<leader>mm |
Marks |
<Ctrl-x><Ctrl-k> |
Search in dictionaries (requires words-insane) |
<Ctrl-x><Ctrl-f> |
Search in files |
<Ctrl-x><Ctrl-l> |
Search in lines |
<leader>kk |
Toggles file tree |
<leader>kf |
Finds current file in the file tree |
If you keep hitting <Ctrl-/>
the preview window will change width. With
Shift-/
you can show and hide the preview window.
When a file is selected, additional to what fzf provides out of the box, you can invoke one of these secondary actions:
Mapping | Description |
---|---|
alt-/ |
To search in the lines. |
alt-@ |
To search in ctags or lsp symbols. |
alt-: |
To go to a specific line. |
alt-q |
Add items to the quickfix list. |
alt-w |
Add items to the local list. |
Note that if a LSP
server is not attached to the buffer, it will fall back to
ctags
.
Sometimes when you list files and sink
with @, the LSP
might not be
ready yet, therefore it falls back to ctags
immediately. In this case you can
cancel, which will land you to the file, and you can invoke <leader>@
for
LSP symbols.
There are a few added commands to what fzf provides.
Click to view the commands
Command | Description |
---|---|
GGrep |
Run git grep |
GTree |
Browse git commits |
Marks |
Show marks with preview |
MarksDelete |
Delete marks |
Todo |
List todo/fixme lines |
ArgsAdd |
Select and add files to the args list |
ArgsDelete |
Select and delete files from the args list |
Worktree |
Switch between git worktrees |
BLines |
Search in current buffer |
History |
Show open file history |
Checkout |
Checkout a branch |
GitStatus |
Show git status |
Jumps |
Choose from jump list |
Autocmds |
Show autocmds |
Changes |
Show change list |
Registers |
Show register contents |
Yank Mappings | Description |
---|---|
<leader>yh |
List Yank History) |
<leader>y |
Yank to the + register (external clipboard) |
<leader>p |
Paste from the + register |
<leader>P |
Paste from the + register (before/above) |
(v) p |
Paste on selected text without changing "reg |
When a LSP server is attached to a buffer, a series of mappings will be defined for that buffer based on the server's capabilities. When possible, fzf will take over the results of the LSP mappings results.
Click to view the mappings
Mapping | Description |
---|---|
<leader>dd |
Show line Diagnostics |
<leader>dq |
Fill the Quicklist with Diagnostics |
<leader>dw |
Fill the local list with Diagnostics |
]d |
Go to next diagnostic issue (R) |
[d |
Go to previous diagnostic issue (R) |
H |
Hover popup |
[i]<Alt-h> |
Hover popup |
gd |
Go to Definition |
2gd |
Go to Definition in vertical split |
3gd |
Go to Definition in horizontal split |
4gd |
Go to Definition in new tab |
K |
Show Signature help |
[i]<M-l> |
Show Signature help |
[i]<Alt-l> |
Show Signature help |
<leader>gq |
Format the buffer with LSP |
[x]gq |
Format the selection with LSP |
gq |
Format operator with LSP |
<leader>i |
Organise imports |
grn |
Incrementally rename symbol |
grr |
Go to references |
<leader>gi |
Go to Implementation |
gD |
Go to Declaration |
<leader>cr |
Code lens Run |
gra |
Code Actions (also in visual mode) |
<leader>gc |
Go to Caller |
<leader>dr |
Restart the LSP server (see below) |
- Mappings marked with
(R)
are repeatable with;
and,
. Please see the code for all available mappings.
Mapping | Description |
---|---|
[i]<C-j> |
Select next item |
[i]<C-k> |
Select previous item |
[i]<C-b> |
Scroll documents up |
[i]<C-f> |
Scroll documents down |
[i]<C-Space> |
Initiate completion menu (main one) |
[i]<C-x><C-o> |
Initiate completion menu (lsp, buffer, rg) |
[i]<C-x><C-r> |
Initiate completion menu (rg) |
[i]<C-x><C-s> |
Initiate completion menu (luasnip) |
[i]<C-x><C-g> |
Initiate completion menu (git) |
[i,c]<C-e> |
Abort completion and close |
[i,s]<Tab> |
Next placeholder |
[i,s]<S-Tab> |
Previous placeholder |
LSP defines its own set of commands, however I have added a few interesting additions.
Click to view the commands
Command | Description |
---|---|
Diagnostics |
Alternative Diag |
DiagnosticsAll |
Alternative DiagAll |
DiagnosticsDisable |
|
DiagnosticsEnable |
|
Definition |
Go to the definition |
WorkspaceList |
|
WorkspaceRemove |
|
WorkspaceAdd |
|
WorkspaceSymbols |
|
DocumentSymbol |
|
References |
|
Implementation |
|
TypeDefinition |
|
CodeLensRefresh |
|
CodeLensRun |
|
CodeAction |
Also works on a visually selected text. |
Callers |
Show callers and go to one |
Callees |
Show callees and go to one |
RestartLsp |
|
UnlinkSnippets |
Unlink all open snippet sessions |
ListWorkspace |
List attached LSP workspace folders |
The RestartLsp
fixes an issue when the LspRestart
does not have any
effects.
The following list of commands do not fit into any specific categories.
Click to view the commands
Command | Description |
---|---|
Filename |
View the filename |
YankFilename |
Yank the filename to " register |
YankFilenameC |
Yank the filename to + register |
YankFilepath |
Yank the file path to " register |
YankFilepathC |
Yank the file path to + register |
Nowrap |
Stop wrapping current buffer |
ToggleRelativeNumbers |
Start/Stop relative number switching |
ToggleTrimWhitespaces |
Toggles trimming whitespaces on buffer |
Scratch |
Create a scratch buffer |
{range}Duck [args] |
Show some ducks |
Give an icon for something else | |
{range}Cook |
Cook some ducks |
FoldComments |
Fold comments (sets folding to expr) |
EditConfig |
Edit configuration files in a new tab |
LspCaps |
Show short LSP capabilities |
LspCapsFull |
Show sull LSP capabilities |
GoModTidy |
Run go mod tidy on go and mod files |
Tmux |
Start a tmux project (using tmuxp) |
LazyLoadAll |
Load all lazy-loaded plugins |
CC |
Close all floating windows |
ChatGPT |
Open interactive window |
ChatGPTActAs |
Suggest an actor |
I never was a fan of snippets, until I discovered the LuaSnip plugin and it changed my mind. Here is a demo of a couple of snippets shipped with this setup:
Click to view advance snippets demo
Queryrows snippet creates a useful code in Go that uses the Retry library for querying postgres.
Ife snippet is an improvement over a snippet by tjdevries that tries to work better with return values.
These are commands you can use in Lua land. Assign the required module to a variable and re-use.
local quick = require("arshlib.quick")
Executes a normal command. For example:
quick.normal("n", "y2k")
See :h feedkeys()
for values of the mode.
Create highlight
groups:
quick.highlight("LspReferenceRead", { ctermbg = 180, guibg = "#43464F", style = "bold" })
These functions will call your function/command and then centres the buffer:
quick.call_and_centre(function()
print("Yolo!")
end)
quick.cmd_and_centre("SomeCommand")