Skip to content

Commit

Permalink
feat: add toggleterm, markdown preview keymaps, lualine switch filena…
Browse files Browse the repository at this point in the history
…me and navic (#23)

- Configured toggleterm plugin
- Added keymap for markdown preview
- Changed lualine so Navic is better readable by switching filename and
type with Navic.
  • Loading branch information
dc-tec authored Aug 19, 2024
1 parent 864f443 commit 0331a50
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 16 deletions.
Binary file added .docs/images/neovim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 44 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,63 @@

This repository contains my personal configuration NixVim, a Neovim configuration managed with Nix.

## General Configuration
![Neovim](./.docs/images/neovim.png)

## How to use

You can use this flake as an input:

```nix
{
inputs = {
nixvim.url = "github:dc-tec/nixvim"
};
}
```

You can then install the package either normally or through home-manager.

#### Normal:

```nix
environment.systemPackages = [
inputs.nixvim.packages.x86_64-linux.default
];
```

#### Home-Manager

```nix
home-manager.users.<user>.home.packages = [
inputs.nixvim.packages.x86_64-linux.default
];
```

## Plugins

### General Configuration

- `settings.nix`: Contains general settings for Neovim.
- `keymaps.nix`: Defines key mappings.
- `auto_cmds.nix`: Sets up automatic commands.
- `file_types.nix`: Configures file type specific settings.

## Themes
### Themes

- `default.nix`: Sets the default theme.

## Completion
### Completion

- `cmp.nix`: Configures the cmp completion framework.
- `cmp-copilot.nix`: Adds GitHub Copilot support to cmp.
- `lspkind.nix`: Adds icons to lsp completion items.
- `autopairs.nix`: Adds the autopairs plugin.

## Snippets
### Snippets

- `luasnip.nix`: Configures the LuaSnip snippet engine.

## Editor Plugins and Configurations
### Editor Plugins and Configurations

- `neo-tree.nix`: Configures the NeoTree file explorer.
- `treesitter.nix`: Configures the TreeSitter syntax highlighter.
Expand All @@ -35,31 +69,32 @@ This repository contains my personal configuration NixVim, a Neovim configuratio
- `copilot-chat.nix`: Configures the Copilot Chat plugin for interacting with GitHub Copilot.
- `navic.nix`: Configures the Navic plugin, shows the current code context.

## UI Plugins
### UI Plugins

- `bufferline.nix`: Configures the Bufferline plugin for enhanced buffer/tab display.
- `lualine.nix`: Configures the Lualine status line plugin.
- `startup.nix`: Configures the startup screen.

## LSP
### LSP

- `lsp.nix`: Configures the Neovim LSP client.
- `conform.nix`: Configures the Conform plugin for automatic code formatting.
- `fidget.nix`: Configures the Fidget plugin for displaying LSP diagnostics in the status line.

## Git
### Git

- `lazygit.nix`: Configures the LazyGit plugin for Git integration.
- `gitsigns.nix`: Configures the GitSigns plugin for displaying Git diff information.

## Utils
### Utils

- `telescope.nix`: Configures the Telescope plugin for fuzzy finding and picking.
- `whichkey.nix`: Configures the WhichKey plugin for displaying key mappings.
- `extra_plugins.nix`: Configures additional plugins.
- `mini.nix`: Configures the Mini plugin.
- `obsidian.nix`: Confiugres the Obsidian plugin, for note-taking purposes.
- `markdown-preview.nix`: Configures the Markdown Preview plugin.
- `toggleterm.nix`: Configures Terminal plugin.

Please refer to the individual `.nix` files for more detailed configuration information.

Expand Down
1 change: 1 addition & 0 deletions config/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,6 @@ _: {
./plugins/utils/mini.nix
./plugins/utils/markdown-preview.nix
./plugins/utils/obsidian.nix
./plugins/utils/toggleterm.nix
];
}
2 changes: 1 addition & 1 deletion config/plugins/editor/navic.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
_: {
plugins.navic = {
enable = true;
separator = " ";
separator = " ";
highlight = true;
depthLimit = 5;
lsp = {
Expand Down
2 changes: 1 addition & 1 deletion config/plugins/snippets/luasnip.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
_: {
plugins.luasnip = {
enable = true;
extraConfig = {
settings = {
enable_autosnippets = true;
store_selection_keys = "<Tab>";
};
Expand Down
10 changes: 5 additions & 5 deletions config/plugins/ui/lualine.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ _: {
};
};
}
{
name = "navic";
}
];
lualine_x = [
{
name = "filetype";
extraConfig = {
Expand All @@ -63,11 +68,6 @@ _: {
path = 1;
};
}
];
lualine_x = [
{
name = "navic";
}
{
name.__raw = ''
function()
Expand Down
11 changes: 11 additions & 0 deletions config/plugins/utils/markdown-preview.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,15 @@ _: {
};
};
};

keymaps = [
{
mode = "n";
key = "<leader>mp";
action = "<cmd>MarkdownPreview<cr>";
options = {
desc = "Toggle Markdown Preview";
};
}
];
}
42 changes: 42 additions & 0 deletions config/plugins/utils/toggleterm.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
_: {
plugins.toggleterm = {
enable = true;
settings = {
size = 20;
};
};
keymaps = [
{
mode = "n";
key = "<leader>t";
action = "<cmd>ToggleTerm<cr>";
options = {
desc = "Toggle Terminal Window";
};
}
{
mode = "n";
key = "<leader>tv";
action = "<cmd>ToggleTerm direction=vertical<cr>";
options = {
desc = "Toggle Vertical Terminal Window";
};
}
{
mode = "n";
key = "<leader>th";
action = "<cmd>ToggleTerm direction=horizontal<cr>";
options = {
desc = "Toggle Horizontal Terminal Window";
};
}
{
mode = "n";
key = "<leader>tf";
action = "<cmd>ToggleTerm direction=float<cr>";
options = {
desc = "Toggle Floating Terminal Window";
};
}
];
}

0 comments on commit 0331a50

Please sign in to comment.