Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ If you add a new configuration file, remember to add it to the

To test your configuration simply run the following command

```
```bash
nix run .
```

Expand Down Expand Up @@ -51,8 +51,17 @@ For more information look at: [NixOS docs](https://nixos.wiki/wiki/flakes)
| n | fb | find buffers |
| n | ft | treesitter |
| n | fg | git commits |
| n | fh | file history |
| n | fh | file history |
| n | fB | git branches |
| n | fo | old files |
| n | fu | undo history |
| n | fd | diagnostics |
| n | fe | todos |

### Auto-Session

| Mode | Keybind | Action |
| ---- | ------- | ------------- |
| n | fs | View Sessions |

### LSP

Expand All @@ -62,7 +71,7 @@ For more information look at: [NixOS docs](https://nixos.wiki/wiki/flakes)
| n | gd | go to definition |
| n | gD | go to declaration |
| n | gi | go to implementation |
| n | go | go to tyoe definition |
| n | go | go to type definition |
| n | gr | go to references |
| n | gd | go to definition |
| n | \<F2\> | rename |
Expand All @@ -71,7 +80,7 @@ For more information look at: [NixOS docs](https://nixos.wiki/wiki/flakes)

| Mode | Keybind | Action |
| ---- | ------- | ----------------------------- |
| n | gl | Show diagnostics in telescope |
| n | gl | Show current line diagnostics |
| n | [d | go to previous diagnostics |
| n | ]d | go to next diagnostics |

Expand Down
6 changes: 6 additions & 0 deletions config/default.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{ pkgs, ... }:
{
imports = [
./auto_cmd.nix
Expand All @@ -8,6 +9,7 @@

colorschemes.gruvbox = {
enable = true;
lazyLoad.enable = true;
settings = {
transparent_mode = true;
terima_colors = true;
Expand Down Expand Up @@ -38,4 +40,8 @@

clipboard.providers.wl-copy.enable = true;
performance.combinePlugins.enable = true;
performance.combinePlugins.standalonePlugins = [
pkgs.vimPlugins.snacks-nvim
pkgs.vimPlugins.markview-nvim
];
}
176 changes: 127 additions & 49 deletions config/mappings.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,118 +5,202 @@
action = "<cmd>NvimTreeToggle<CR>";
mode = "n";
key = "n";
options = {
desc = "Toggle NvimTree";
};
}

# Commentary bindings
{
action = "<cmd>Commentary<CR>";
mode = "n";
key = "cl";
options = {
desc = "Toggle comment line";
};
}

# Telescope bindings

# Snacks (Telescope) bindings
{
action = "<cmd>Telescope live_grep<CR>";
action = "<cmd>lua Snacks.picker.grep()<CR>";
mode = "n";
key = "fw";
options = {
desc = "live grep";
};
}
{
action = "<cmd>Telescope find_files<CR>";
action = "<cmd>lua Snacks.picker.smart()<CR>";
mode = "n";
key = "ff";
options = {
desc = "Smart find files";
};
}
{
action = "<cmd>Telescope buffers<CR>";
action = "<cmd>lua Snacks.picker.buffers()<CR>";
mode = "n";
key = "fb";
options = {
desc = "List buffers";
};
}

{
action = "<cmd>Telescope treesitter<CR>";
action = "<cmd>lua Snacks.picker.git_log()<CR>";
mode = "n";
key = "ft";
key = "fg";
options = {
desc = "List git commits";
};
}
{
action = "<cmd>Telescope git_commits<CR>";
mode = "n";
key = "fg";
key = "fB";
action = ''<cmd>lua Snacks.picker.git_branches()<cr>'';
options = {
desc = "Find git branches";
};
}
{
mode = "n";
key = "fD";
action = ''<cmd>lua Snacks.picker.git_diff()<cr>'';
options = {
desc = "Git Diff (Hunks)";
};
}
{
action = "<cmd>lua Snacks.picker.recent()<CR>";
mode = "n";
key = "fo";
options = {
desc = "View old files";
};
}
{
action = "<cmd>lua Snacks.picker.undo()<CR>";
mode = "n";
key = "fu";
options = {
desc = "List undo history";
};
}
{
action = "<cmd>lua Snacks.picker.diagnostics()<CR>";
mode = "n";
key = "fd";
options = {
desc = "View diagnostics";
};
}
{
action = "<cmd>Telescope oldfiles<CR>";
action = "<cmd>lua Snacks.picker.todo_comments()<CR>";
mode = "n";
key = "fh";
key = "fe";
options = {
desc = "View ToDos";
};
}

# Floatterm toggle
# Auto-Session bindings
{
action = "<cmd>SessionSearch<CR>";
mode = "n";
key = "fs";
options = {
desc = "View Sessions";
};
}

# Floatterm bindings
{
action = "<cmd>FloatermToggle<CR>";
mode = "n";
key = "t";
options = {
desc = "Toggle FloatTerm";
};
}
{
action = "<cmd>FloatermToggle<CR>";
mode = "t";
key = "<Esc>";
}

# Hover information
# LSP bindings
{
mode = "n";
key = "K";
action = "<cmd>lua vim.lsp.buf.hover()<cr>";
options = {
desc = "View lsp hover information";
};
}

# Jump to the definition
{
mode = "n";
key = "gd";
action = "<cmd>lua vim.lsp.buf.definition()<cr>";
options = {
desc = "Jump to definition";
};
}

# Jump to declaration
{
mode = "n";
key = "gD";
action = "<cmd>lua vim.lsp.buf.declaration()<cr>";
options = {
desc = "Jump to declaration";
};
}

# Lists all the implementations for the symbol under the cursor
{
mode = "n";
key = "gi";
action = "<cmd>lua vim.lsp.buf.implementation()<cr>";
options = {
desc = "Jump to implementation";
};
}

# Jumps to the definition of the type symbol
{
mode = "n";
key = "go";
action = "<cmd>lua vim.lsp.buf.type_definition()<cr>";
options = {
desc = "Jump to type definition";
};
}

# Lists all the references
{
mode = "n";
key = "gr";
action = "<cmd>lua vim.lsp.buf.references()<cr>";
options = {
desc = "List all references";
};
}

# Displays a function's signature information
{
mode = "n";
key = "gs";
action = "<cmd>lua vim.lsp.buf.signature_help()<cr>";
key = "gl";
action = "<cmd>lua vim.diagnostic.open_float()<cr>";
options = {
desc = "Show diagnostics of current line";
};
}

# Renames all references to the symbol under the cursor
{
mode = "n";
key = "<F2>";
action = "<cmd>lua vim.lsp.buf.rename()<cr>";
key = "[d";
action = "<cmd>lua vim.diagnostic.goto_prev()<cr>";
options = {
desc = "Move to previous diagnostic";
};
}
{
mode = "n";
key = "]d";
action = "<cmd>lua vim.diagnostic.goto_next()<cr>";
options = {
desc = "Move to next diagnostic";
};
}

# Selects a code action available at the current cursor position
{
mode = "n";
key = "<F4>";
Expand All @@ -127,30 +211,24 @@
key = "<F4>";
action = "<cmd>lua vim.lsp.buf.range_code_action()<cr>";
}

# Show diagnostics in a floating window
{
mode = "n";
key = "gl";
action = "<cmd>lua vim.diagnostic.open_float()<cr>";
}

# Move to the previous diagnostic
{
mode = "n";
key = "[d";
action = "<cmd>lua vim.diagnostic.goto_prev()<cr>";
key = "<F2>";
action = "<cmd>lua vim.lsp.buf.rename()<cr>";
options = {
desc = "Rename";
};
}

# Move to the next diagnostic
{
mode = "n";
key = "]d";
action = "<cmd>lua vim.diagnostic.goto_next()<cr>";
key = "gs";
action = "<cmd>lua vim.lsp.buf.signature_help()<cr>";
options = {
desc = "Show signature information";
};
}

# Notify bindings

{
mode = "n";
key = "dn";
Expand Down
2 changes: 1 addition & 1 deletion config/options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
cmdheight = 0;

# Place a column line
colorcolumn = "80";
colorcolumn = "90";

# Decrease updatetime
updatetime = 50; # faster completion (4000ms default)
Expand Down
Loading
Loading