Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
daniloraisi committed Oct 15, 2024
0 parents commit cdff8e6
Show file tree
Hide file tree
Showing 38 changed files with 2,695 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/renovate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
on:
schedule:
- cron: "30 00 * * 0"

jobs:
renovate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Renovate
uses: renovatebot/[email protected]
with:
configurationFile: renovate.json5
renovate-version: full
token: ${{ secrets.RENOVATE_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/update-flake.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
on:
schedule:
- cron: "30 00 * * 1"

jobs:
lockfile:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v14

- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@v4
with:
nix-option: --debug --log-format raw
token: ${{ secrets.FLAKE_TOKEN }}
pr-title: "deps: update flake.lock"
pr-labels: |
dependencies
automated
101 changes: 101 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# NixVim Configuration

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

## How to use

You can use this flake as an input:

```nix
{
inputs = {
nixvim.url = "github:daniloraisi/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.

### Themes

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

### 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.
- `schemastore.nix`: Adds the schemastore plugin for JSON and YAML schemas.

### Snippets

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

### Editor Plugins and Configurations

- `neo-tree.nix`: Configures the NeoTree file explorer.
- `treesitter.nix`: Configures the TreeSitter syntax highlighter.
- `undotree.nix`: Configures the UndoTree undo history visualizer.
- `illuminate.nix`: Configures the Illuminate plugin for highlighting other uses of the current word under the cursor.
- `indent-blankline.nix`: Configures the Indent Blankline plugin for displaying indentation levels.
- `todo-comments.nix`: Configures the Todo Comments plugin for highlighting TODO comments.
- `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

- `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.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

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

### Utils

- `telescope.nix`: Configures the Telescope plugin for fuzzy finding and picking.
- `whichkey.nix`: Configures the WhichKey plugin for displaying key mappings.
- `mini.nix`: Configures the Mini plugin.
- `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.

## References

This configuration has taken inspiration from the following contributors.

- [Roel de Cort](https://github.com/dc-tec/nixvim)
74 changes: 74 additions & 0 deletions config/auto_cmds.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
autoGroups = {
highlight_yank = {};
vim_enter = {};
indentscope = {};
restore_cursor = {};
};

autoCmd = [
{
group = "highlight_yank";
event = ["TextYankPost"];
pattern = "*";
callback = {
__raw = ''
function()
vim.highlight.on_yank()
end
'';
};
}
{
group = "vim_enter";
event = ["VimEnter"];
pattern = "*";
callback = {
__raw = ''
function()
vim.cmd('Startup')
end
'';
};
}
{
group = "indentscope";
event = ["FileType"];
pattern = [
"help"
"Startup"
"startup"
"neo-tree"
"Trouble"
"trouble"
"notify"
];
callback = {
__raw = ''
function()
vim.b.miniindentscopt_disable = true
end
'';
};
}
{
group = "restore_cursor";
event = ["BufReadPost"];
pattern = "*";
callback = {
__raw = ''
function()
if
vim.fn.line "'\"" > 1
and vim.fn.line "'\"" <= vim.fn.line "$"
and vim.bo.filetype ~= "commit"
and vim.fn.index({ "xxd", "gitrebase" }, vim.bo.filetype) == -1
then
vim.cmd "normal! g`\""
end
end
'';
};
}
];
}
52 changes: 52 additions & 0 deletions config/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
_: {
imports = [
# General Configuration
./settings.nix
./keymaps.nix
./auto_cmds.nix

# Themes
./plugins/themes/default.nix

# Completion
./plugins/cmp/autopairs.nix
./plugins/cmp/cmp.nix
./plugins/cmp/cmp-copilot.nix
./plugins/cmp/lspkind.nix
./plugins/cmp/schemastore.nix

# Snippets
./plugins/snippets/luasnip.nix

# Editor plugins and configurations
./plugins/editor/copilot-chat.nix
./plugins/editor/illuminate.nix
./plugins/editor/indent-blankline.nix
./plugins/editor/navic.nix
./plugins/editor/neo-tree.nix
./plugins/editor/todo-comments.nix
./plugins/editor/treesitter.nix
./plugins/editor/undotree.nix

# UI plugins
./plugins/ui/bufferline.lua
./plugins/ui/lualine.nix
./plugins/ui/startup.nix

# LSP and formatting
./plugins/lsp/conform.nix
./plugins/lsp/fidget.nix
./plugins/lsp/lsp.nix

# Git
./plugins/git/gitsigns.nix
./plugins/git/lazygit.nix

# Utils
./plugins/utils/markdown-preview.nix
./plugins/utils/mini.nix
./plugins/utils/telescope.nix
./plugins/utils/toggleterm.nix
./plugins/utils/whichkey.nix
];
}
Loading

0 comments on commit cdff8e6

Please sign in to comment.