diff --git a/.docs/images/neovim.png b/.docs/images/neovim.png new file mode 100644 index 0000000..3241c90 Binary files /dev/null and b/.docs/images/neovim.png differ diff --git a/README.md b/README.md index 6de2d02..8a9bcde 100644 --- a/README.md +++ b/README.md @@ -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..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. @@ -35,24 +69,24 @@ 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. @@ -60,6 +94,7 @@ This repository contains my personal configuration NixVim, a Neovim configuratio - `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. diff --git a/config/default.nix b/config/default.nix index 6c1d3ee..295c307 100644 --- a/config/default.nix +++ b/config/default.nix @@ -49,5 +49,6 @@ _: { ./plugins/utils/mini.nix ./plugins/utils/markdown-preview.nix ./plugins/utils/obsidian.nix + ./plugins/utils/toggleterm.nix ]; } diff --git a/config/plugins/editor/navic.nix b/config/plugins/editor/navic.nix index df5a299..dfdd5c9 100644 --- a/config/plugins/editor/navic.nix +++ b/config/plugins/editor/navic.nix @@ -1,7 +1,7 @@ _: { plugins.navic = { enable = true; - separator = "  "; + separator = "  "; highlight = true; depthLimit = 5; lsp = { diff --git a/config/plugins/snippets/luasnip.nix b/config/plugins/snippets/luasnip.nix index 142ae05..553e437 100644 --- a/config/plugins/snippets/luasnip.nix +++ b/config/plugins/snippets/luasnip.nix @@ -1,7 +1,7 @@ _: { plugins.luasnip = { enable = true; - extraConfig = { + settings = { enable_autosnippets = true; store_selection_keys = ""; }; diff --git a/config/plugins/ui/lualine.nix b/config/plugins/ui/lualine.nix index aafbf47..eef1c66 100644 --- a/config/plugins/ui/lualine.nix +++ b/config/plugins/ui/lualine.nix @@ -46,6 +46,11 @@ _: { }; }; } + { + name = "navic"; + } + ]; + lualine_x = [ { name = "filetype"; extraConfig = { @@ -63,11 +68,6 @@ _: { path = 1; }; } - ]; - lualine_x = [ - { - name = "navic"; - } { name.__raw = '' function() diff --git a/config/plugins/utils/markdown-preview.nix b/config/plugins/utils/markdown-preview.nix index 12b4744..93bc9d0 100644 --- a/config/plugins/utils/markdown-preview.nix +++ b/config/plugins/utils/markdown-preview.nix @@ -15,4 +15,15 @@ _: { }; }; }; + + keymaps = [ + { + mode = "n"; + key = "mp"; + action = "MarkdownPreview"; + options = { + desc = "Toggle Markdown Preview"; + }; + } + ]; } diff --git a/config/plugins/utils/toggleterm.nix b/config/plugins/utils/toggleterm.nix new file mode 100644 index 0000000..8fb0de9 --- /dev/null +++ b/config/plugins/utils/toggleterm.nix @@ -0,0 +1,42 @@ +_: { + plugins.toggleterm = { + enable = true; + settings = { + size = 20; + }; + }; + keymaps = [ + { + mode = "n"; + key = "t"; + action = "ToggleTerm"; + options = { + desc = "Toggle Terminal Window"; + }; + } + { + mode = "n"; + key = "tv"; + action = "ToggleTerm direction=vertical"; + options = { + desc = "Toggle Vertical Terminal Window"; + }; + } + { + mode = "n"; + key = "th"; + action = "ToggleTerm direction=horizontal"; + options = { + desc = "Toggle Horizontal Terminal Window"; + }; + } + { + mode = "n"; + key = "tf"; + action = "ToggleTerm direction=float"; + options = { + desc = "Toggle Floating Terminal Window"; + }; + } + ]; +}