├── .envrc
├── .github
└── assets
│ └── nixvim-dark.webp
├── .gitignore
├── .stylua.toml
├── LICENSE
├── README.md
├── flake.lock
├── flake.nix
├── init.lua
├── lua
├── colorscheme.lua
├── keymaps.lua
├── options.lua
└── plugins
│ ├── bufferline.lua
│ ├── colorizer.lua
│ ├── direnv.lua
│ ├── editorconfig.lua
│ ├── gitsigns.lua
│ ├── ibl.lua
│ ├── lazygit.lua
│ ├── lsp-zero.lua
│ ├── markdown.lua
│ ├── neocord.lua
│ ├── neotree.lua
│ ├── oil.lua
│ ├── staline.lua
│ ├── telescope.lua
│ ├── tint.lua
│ ├── todo-comments.lua
│ ├── toggleterm.lua
│ ├── treesitter.lua
│ └── which-key.lua
└── nix
└── pkgs
└── neovim.nix
/.envrc:
--------------------------------------------------------------------------------
1 | use flake
2 |
--------------------------------------------------------------------------------
/.github/assets/nixvim-dark.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IogaMaster/neovim/685144472f87b386e9bea90618360af18cb77d38/.github/assets/nixvim-dark.webp
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | lazy-lock.json
2 | result/
3 | .direnv/
4 |
--------------------------------------------------------------------------------
/.stylua.toml:
--------------------------------------------------------------------------------
1 | column_width = 160
2 | line_endings = "Unix"
3 | indent_type = "Spaces"
4 | indent_width = 2
5 | quote_style = "AutoPreferSingle"
6 | no_call_parentheses = true
7 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2023 IogaMaster
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4 |
5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6 |
7 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |

2 | My Neovim config, packaged as an (optional) Nix Flake.
3 |
4 |
5 |
26 |
27 |
28 | 
29 |
30 |
31 | 🖼️ Gallery
32 |
33 | 
34 | 
35 |
36 |
37 |
38 | Using [mini.deps](https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-deps.md) and [lz.n](https://github.com/nvim-neorocks/lz.n) (for lazy loading)
39 |
40 | - 📦 Neovim packaged with fhs
41 |
42 | To try it out without installing:
43 |
44 | ```sh
45 | nix run github:IogaMaster/neovim
46 | ```
47 |
48 | Or without Nix:
49 | ```
50 | git clone https://github.com/IogaMaster/neovim --depth=1 ~/.config/nvim/ && nvim
51 | ```
52 |
--------------------------------------------------------------------------------
/flake.lock:
--------------------------------------------------------------------------------
1 | {
2 | "nodes": {
3 | "nixpkgs": {
4 | "locked": {
5 | "lastModified": 1722813957,
6 | "narHash": "sha256-IAoYyYnED7P8zrBFMnmp7ydaJfwTnwcnqxUElC1I26Y=",
7 | "owner": "nixos",
8 | "repo": "nixpkgs",
9 | "rev": "cb9a96f23c491c081b38eab96d22fa958043c9fa",
10 | "type": "github"
11 | },
12 | "original": {
13 | "owner": "nixos",
14 | "ref": "nixos-unstable",
15 | "repo": "nixpkgs",
16 | "type": "github"
17 | }
18 | },
19 | "root": {
20 | "inputs": {
21 | "nixpkgs": "nixpkgs"
22 | }
23 | }
24 | },
25 | "root": "root",
26 | "version": 7
27 | }
28 |
--------------------------------------------------------------------------------
/flake.nix:
--------------------------------------------------------------------------------
1 | {
2 | description = "IogaMaster's Neovim Configuration";
3 |
4 | inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
5 |
6 | outputs = {nixpkgs, ...}: let
7 | inherit (nixpkgs) lib;
8 | forAllSystems = function:
9 | nixpkgs.lib.genAttrs [
10 | "x86_64-linux"
11 | "aarch64-linux"
12 | ] (system: function nixpkgs.legacyPackages.${system});
13 | in rec {
14 | devShells = forAllSystems (pkgs: {
15 | default = pkgs.mkShell {
16 | nativeBuildInputs = with pkgs; [
17 | alejandra
18 | stylua
19 | ];
20 | };
21 | });
22 |
23 | packages = forAllSystems (pkgs: rec {
24 | neovim = pkgs.callPackage ./nix/pkgs/neovim.nix {bundled = false;};
25 | neovim-bundled = pkgs.callPackage ./nix/pkgs/neovim.nix {};
26 | default = neovim-bundled;
27 | });
28 |
29 | overlays.default = final: prev: {
30 | neovim = final.callPackage ./nix/pkgs/neovim.nix {bundled = false;};
31 | neovim-bundled = final.callPackage ./nix/pkgs/neovim.nix {};
32 | };
33 | };
34 | }
35 |
--------------------------------------------------------------------------------
/init.lua:
--------------------------------------------------------------------------------
1 | -- Bootstrap mini.deps
2 | local path_package = vim.fn.stdpath 'data' .. '/site/'
3 | local mini_path = path_package .. 'pack/deps/start/mini.nvim'
4 | if not vim.loop.fs_stat(mini_path) then
5 | vim.cmd 'echo "Installing `mini.nvim`" | redraw'
6 | local clone_cmd = {
7 | 'git',
8 | 'clone',
9 | '--filter=blob:none',
10 | 'https://github.com/echasnovski/mini.nvim',
11 | mini_path,
12 | }
13 | vim.fn.system(clone_cmd)
14 | vim.cmd 'packadd mini.nvim | helptags ALL'
15 | vim.cmd 'echo "Installed `mini.nvim`" | redraw'
16 | end
17 | require('mini.deps').setup { path = { package = path_package } }
18 | deps = MiniDeps
19 |
20 | -- Install lz.n (lazy loading api)
21 | deps.add { source = 'nvim-neorocks/lz.n' }
22 |
23 | -- These must be here for it to package with Nix.
24 | require 'options'
25 | require 'keymaps'
26 | require 'colorscheme'
27 |
28 | -- Enable mini plugins
29 | require('mini.pairs').setup()
30 | require('mini.align').setup()
31 | require('mini.basics').setup()
32 | require('mini.jump').setup()
33 | require('mini.cursorword').setup()
34 |
35 | -- Load all plugins
36 | require('lz.n').load 'plugins'
37 |
--------------------------------------------------------------------------------
/lua/colorscheme.lua:
--------------------------------------------------------------------------------
1 | deps.add { source = 'RRethy/base16-nvim' }
2 |
3 | local colorscheme_path = vim.fn.expand '~/.config/base16.lua'
4 | local colors
5 |
6 | local function apply_colorscheme()
7 | if vim.fn.filereadable(colorscheme_path) == 1 then
8 | -- Load the color scheme from the file
9 | colors = dofile(colorscheme_path)
10 | else
11 | -- Use the fallback color scheme
12 | colors = {
13 | base00 = '#16161D',
14 | base01 = '#2c313c',
15 | base02 = '#3e4451',
16 | base03 = '#6c7891',
17 | base04 = '#565c64',
18 | base05 = '#abb2bf',
19 | base06 = '#9a9bb3',
20 | base07 = '#c5c8e6',
21 | base08 = '#e06c75',
22 | base09 = '#d19a66',
23 | base0A = '#e5c07b',
24 | base0B = '#98c379',
25 | base0C = '#56b6c2',
26 | base0D = '#0184bc',
27 | base0E = '#c678dd',
28 | base0F = '#a06949',
29 | }
30 | end
31 |
32 | require('base16-colorscheme').setup(colors)
33 |
34 | local highlights = {
35 | -- nvim-cmp
36 | CmpItemKindSnippet = { fg = colors.base01, bg = colors.base0E },
37 | CmpItemKindKeyword = { fg = colors.base01, bg = colors.base08 },
38 | CmpItemKindText = { fg = colors.base01, bg = colors.base0C },
39 | CmpItemKindMethod = { fg = colors.base01, bg = colors.base0D },
40 | CmpItemKindConstructor = { fg = colors.base01, bg = colors.base0D },
41 | CmpItemKindFunction = { fg = colors.base01, bg = colors.base0D },
42 | CmpItemKindFolder = { fg = colors.base01, bg = colors.base0D },
43 | CmpItemKindModule = { fg = colors.base01, bg = colors.base0D },
44 | CmpItemKindConstant = { fg = colors.base01, bg = colors.base0A },
45 | CmpItemKindField = { fg = colors.base01, bg = colors.base0B },
46 | CmpItemKindProperty = { fg = colors.base01, bg = colors.base0B },
47 | CmpItemKindEnum = { fg = colors.base01, bg = colors.base0B },
48 | CmpItemKindUnit = { fg = colors.base01, bg = colors.base0B },
49 | CmpItemKindClass = { fg = colors.base01, bg = colors.base09 },
50 | CmpItemKindVariable = { fg = colors.base01, bg = colors.base0F },
51 | CmpItemKindFile = { fg = colors.base01, bg = colors.base0D },
52 | CmpItemKindInterface = { fg = colors.base01, bg = colors.base09 },
53 | CmpItemKindColor = { fg = colors.base01, bg = colors.base08 },
54 | CmpItemKindReference = { fg = colors.base01, bg = colors.base08 },
55 | CmpItemKindEnumMember = { fg = colors.base01, bg = colors.base08 },
56 | CmpItemKindStruct = { fg = colors.base01, bg = colors.base0D },
57 | CmpItemKindValue = { fg = colors.base01, bg = colors.base0A },
58 | CmpItemKindEvent = { fg = colors.base01, bg = colors.base0D },
59 | CmpItemKindOperator = { fg = colors.base01, bg = colors.base0D },
60 | CmpItemKindTypeParameter = { fg = colors.base01, bg = colors.base0D },
61 | CmpItemKindCopilot = { fg = colors.base01, bg = colors.base0C },
62 |
63 | -- Telescope
64 | TelescopeMatching = { fg = colors.base0E },
65 | TelescopeSelection = { fg = colors.base05, bg = colors.base01, bold = true },
66 | TelescopePromptPrefix = { fg = colors.base08 },
67 | TelescopePromptNormal = { bg = colors.base01 },
68 | TelescopeResultsNormal = { bg = colors.base00 },
69 | TelescopePreviewNormal = { bg = colors.base00 },
70 | TelescopePromptBorder = { bg = colors.base01, fg = colors.base01 },
71 | TelescopeResultsBorder = { bg = colors.base00, fg = colors.base00 },
72 | TelescopePreviewBorder = { bg = colors.base00, fg = colors.base00 },
73 | TelescopePromptTitle = { bg = colors.base08, fg = colors.base00 },
74 | TelescopeResultsTitle = { fg = colors.base00 },
75 | TelescopePreviewTitle = { bg = colors.base0B, fg = colors.base00 },
76 | }
77 |
78 | -- Apply highlights
79 | for group, colors in pairs(highlights) do
80 | vim.api.nvim_set_hl(0, group, colors)
81 | end
82 | end
83 |
84 | local function reload_colorscheme()
85 | local interval = 500 -- Interval in milliseconds (500ms = 0.5 seconds)
86 |
87 | local function loop()
88 | apply_colorscheme()
89 | vim.defer_fn(loop, interval)
90 | end
91 |
92 | loop() -- Start the loop
93 | end
94 |
95 | apply_colorscheme() -- apply the first time
96 | reload_colorscheme()
97 |
--------------------------------------------------------------------------------
/lua/keymaps.lua:
--------------------------------------------------------------------------------
1 | vim.keymap.set('n', 'n', 'nzzzv')
2 | vim.keymap.set('n', 'N', 'Nzzzv')
3 |
4 | vim.keymap.set({ 'n', 'v' }, '', '', { silent = true })
5 | vim.keymap.set('v', 'J', ":m '>+1gv=gv")
6 | vim.keymap.set('v', 'K', ":m '<-2gv=gv")
7 | vim.keymap.set('x', 'p', [["_dP]]) -- paste WON'T copy
8 | vim.keymap.set('n', 'Q', '')
9 | vim.keymap.set('n', 'w', '')
10 | vim.keymap.set('n', '', 'bnext')
11 |
12 | vim.keymap.set('n', 'rp', ':%s/\\<\\>//gI') -- Replace all instance of current word in file
13 | vim.keymap.set('v', 'rp', ':s/\\<\\>//gI') -- Replace all instance of current word in file
14 |
15 | -- Unset arrow keys
16 | vim.cmd [[
17 | noremap
18 | noremap
19 | noremap
20 | noremap
21 |
22 |
23 | inoremap
24 | inoremap
25 | inoremap
26 | inoremap
27 | ]]
28 |
29 | -- Disable Mouse
30 | vim.cmd [[
31 | set mouse=
32 | ]]
33 |
--------------------------------------------------------------------------------
/lua/options.lua:
--------------------------------------------------------------------------------
1 | -- Most basic config
2 | vim.g.mapleader = ' '
3 | vim.g.maplocalleader = ' '
4 |
5 | vim.opt.laststatus = 3
6 | vim.cmd [[
7 | let g:loaded_netrw = 1
8 | let g:loaded_netrwPlugin = 1
9 | ]]
10 |
11 | -- Disable Mouse
12 | vim.cmd [[
13 | set mouse=
14 | ]]
15 |
16 | vim.cmd [[set undodir=~/.cache/vim/undodir]]
17 |
18 | -- Settings
19 | vim.opt.nu = true
20 | vim.opt.tabstop = 4
21 | vim.opt.softtabstop = 4
22 | vim.opt.shiftwidth = 4
23 | vim.opt.expandtab = true
24 | vim.opt.smartindent = true
25 | vim.opt.wrap = false
26 | vim.opt.swapfile = false
27 | vim.opt.backup = false
28 | vim.opt.undodir = os.getenv 'HOME' .. '/.vim/undodir'
29 | vim.opt.undofile = true
30 | vim.opt.hlsearch = false
31 | vim.opt.incsearch = true
32 | vim.opt.termguicolors = true
33 | vim.opt.scrolloff = 8
34 | vim.opt.signcolumn = 'yes'
35 | vim.opt.isfname:append '@-@'
36 | vim.opt.updatetime = 50
37 | vim.opt.clipboard = 'unnamedplus'
38 | vim.opt.spelllang = 'en_us'
39 | vim.opt.spell = true
40 |
41 | -- Neovide
42 | if vim.g.neovide then
43 | vim.o.guifont = 'JetBrains Mono Nerd Font:h14'
44 | vim.g.neovide_cursor_vfx_mode = 'railgun'
45 | end
46 |
47 |
--------------------------------------------------------------------------------
/lua/plugins/bufferline.lua:
--------------------------------------------------------------------------------
1 | return {
2 | 'bufferline.nvim',
3 |
4 | before = function()
5 | deps.add { source = 'akinsho/bufferline.nvim', depends = { 'nvim-tree/nvim-web-devicons' } }
6 | end,
7 | after = function()
8 | require('bufferline').setup {
9 | options = {
10 | offsets = {
11 | {
12 | filetype = 'neo-tree',
13 | text = 'NeoTree',
14 | text_align = 'left',
15 | separator = true,
16 | },
17 | },
18 | },
19 | }
20 | end,
21 | }
22 |
--------------------------------------------------------------------------------
/lua/plugins/colorizer.lua:
--------------------------------------------------------------------------------
1 | return {
2 | 'nvim-colorizer.lua',
3 | before = function()
4 | deps.add {
5 | source = 'norcalli/nvim-colorizer.lua',
6 | }
7 | end,
8 | after = function()
9 | require('colorizer').setup()
10 | end,
11 | }
12 |
--------------------------------------------------------------------------------
/lua/plugins/direnv.lua:
--------------------------------------------------------------------------------
1 | return {
2 | 'direnv.vim',
3 | before = function()
4 | deps.add { source = 'direnv/direnv.vim' }
5 | end,
6 | }
7 |
--------------------------------------------------------------------------------
/lua/plugins/editorconfig.lua:
--------------------------------------------------------------------------------
1 | return {
2 | 'editorconfig-vim',
3 | before = function()
4 | deps.add {
5 | source = 'editorconfig/editorconfig-vim',
6 | }
7 | end,
8 | }
9 |
--------------------------------------------------------------------------------
/lua/plugins/gitsigns.lua:
--------------------------------------------------------------------------------
1 | return {
2 | 'gitsigns.nvim',
3 | before = function()
4 | deps.add {
5 | source = 'lewis6991/gitsigns.nvim',
6 | }
7 | end,
8 | after = function()
9 | require('gitsigns').setup {
10 | current_line_blame = true,
11 | }
12 | end,
13 | }
14 |
--------------------------------------------------------------------------------
/lua/plugins/ibl.lua:
--------------------------------------------------------------------------------
1 | return {
2 | 'indent-blankline.nvim',
3 | before = function()
4 | deps.add {
5 | source = 'lukas-reineke/indent-blankline.nvim',
6 | }
7 | end,
8 | after = function()
9 | require('ibl').setup()
10 | end,
11 | }
12 |
--------------------------------------------------------------------------------
/lua/plugins/lazygit.lua:
--------------------------------------------------------------------------------
1 | return {
2 | 'lazygit',
3 | before = function()
4 | deps.add {
5 | source = 'kdheepak/lazygit.nvim',
6 | }
7 | end,
8 | keys = {
9 | { 'gg', 'LazyGit', desc = 'Git' },
10 | },
11 | after = nil,
12 | }
13 |
--------------------------------------------------------------------------------
/lua/plugins/lsp-zero.lua:
--------------------------------------------------------------------------------
1 | return {
2 | 'lsp-zero.nvim',
3 | before = function()
4 | deps.add { source = 'VonHeikemen/lsp-zero.nvim', checkout = 'v4.x' }
5 | deps.add { source = 'neovim/nvim-lspconfig' }
6 | deps.add {
7 | source = 'hrsh7th/nvim-cmp',
8 | depends = {
9 | 'hrsh7th/cmp-nvim-lsp',
10 | 'hrsh7th/cmp-path',
11 | 'saadparwaiz1/cmp_luasnip',
12 | },
13 | }
14 | deps.add { source = 'L3MON4D3/LuaSnip', depends = { 'rafamadriz/friendly-snippets' } }
15 | deps.add { source = 'williamboman/mason.nvim' }
16 | deps.add { source = 'williamboman/mason-lspconfig.nvim' }
17 | deps.add { source = 'folke/lazydev.nvim' }
18 | deps.add { source = 'onsails/lspkind.nvim' }
19 | deps.add { source = 'deathbeam/lspecho.nvim' }
20 | deps.add { source = 'utilyre/barbecue.nvim', depends = { 'SmiteshP/nvim-navic' } }
21 | deps.add { source = 'stevearc/conform.nvim' }
22 | deps.add { source = 'mfussenegger/nvim-lint' }
23 | deps.add { source = 'ray-x/lsp_signature.nvim' }
24 | deps.add { source = 'mrcjkb/rustaceanvim' }
25 | deps.add { source = 'Goose97/timber.nvim' }
26 | end,
27 | after = function()
28 | local lsp_zero = require 'lsp-zero'
29 |
30 | local lsp_attach = function(client, bufnr)
31 | local opts = { buffer = bufnr }
32 | vim.keymap.set('n', 'K', 'lua vim.lsp.buf.hover()', opts)
33 | vim.keymap.set('n', 'gd', 'lua vim.lsp.buf.definition()', opts)
34 | vim.keymap.set('n', 'gD', 'lua vim.lsp.buf.declaration()', opts)
35 | vim.keymap.set('n', 'gi', 'lua vim.lsp.buf.implementation()', opts)
36 | vim.keymap.set('n', 'go', 'lua vim.lsp.buf.type_definition()', opts)
37 | vim.keymap.set('n', 'gr', 'lua vim.lsp.buf.references()', opts)
38 | vim.keymap.set('n', 'gs', 'lua vim.lsp.buf.signature_help()', opts)
39 | vim.keymap.set('n', 'cf', 'lua vim.lsp.buf.rename()', opts)
40 | vim.keymap.set({ 'n', 'x' }, '', 'lua vim.lsp.buf.format({async = true})', opts)
41 | vim.keymap.set('n', 'ca', 'lua vim.lsp.buf.code_action()', opts)
42 | end
43 |
44 | lsp_zero.extend_lspconfig {
45 | sign_text = {
46 | error = '✘',
47 | warn = '',
48 | hint = '',
49 | info = '',
50 | },
51 | lsp_attach = lsp_attach,
52 | capabilities = require('cmp_nvim_lsp').default_capabilities(),
53 | }
54 |
55 | local cmp = require 'cmp'
56 | local cmp_action = require('lsp-zero').cmp_action()
57 | require('lazydev').setup()
58 |
59 | cmp.setup {
60 | sources = {
61 | { name = 'path' },
62 | { name = 'nvim_lsp' },
63 | { name = 'lazydev', group_index = 0 },
64 | },
65 | snippet = {
66 | expand = function(args)
67 | -- You need Neovim v0.10 to use vim.snippet
68 | vim.snippet.expand(args.body)
69 | end,
70 | },
71 | mapping = cmp.mapping.preset.insert {
72 | [''] = cmp.mapping.confirm { select = false },
73 | [''] = cmp_action.luasnip_supertab(),
74 | [''] = cmp_action.luasnip_shift_supertab(),
75 | },
76 | window = {
77 | completion = {
78 | winhighlight = 'Normal:Pmenu,FloatBorder:Pmenu,Search:None',
79 | col_offset = -3,
80 | side_padding = 0,
81 | },
82 | },
83 | formatting = {
84 | expandable_indicator = true,
85 | fields = { 'kind', 'abbr', 'menu' },
86 | format = function(entry, vim_item)
87 | local kind = require('lspkind').cmp_format { mode = 'symbol_text', maxwidth = 50 }(entry, vim_item)
88 | local strings = vim.split(kind.kind, '%s', { trimempty = true })
89 | kind.kind = ' ' .. (strings[1] or '') .. ' '
90 | kind.menu = ' (' .. (strings[2] or '') .. ')'
91 |
92 | return kind
93 | end,
94 | },
95 | }
96 |
97 | vim.diagnostic.config {
98 | virtual_text = true,
99 | }
100 |
101 | require('lspecho').setup {
102 | echo = true, -- Echo progress messages, if set to false you can use .message() to get the current message
103 | decay = 3000, -- Message decay time in milliseconds
104 | }
105 |
106 | require('mini.icons').setup()
107 | require('barbecue').setup()
108 |
109 | require('mason').setup {}
110 | require('mason-lspconfig').setup {
111 | ensure_installed = { 'lua_ls', 'nil_ls' },
112 | handlers = {
113 | function(server_name)
114 | require('lspconfig')[server_name].setup {}
115 | end,
116 | },
117 | }
118 |
119 | require('lspconfig').ols.setup {} -- Mason is being a goofy ass, and wont install ols
120 | require('lspconfig').gleam.setup {}
121 | require('lspconfig').nixd.setup {}
122 |
123 | require('conform').setup {
124 | formatters_by_ft = {
125 | lua = { 'stylua' },
126 | nix = { 'nixfmt' },
127 | rust = { 'rustfmt' },
128 | markdown = { 'mdformat' },
129 | },
130 | format_on_save = {
131 | lsp_fallback = true,
132 | async = false,
133 | timeout_md = 500,
134 | },
135 | }
136 |
137 | vim.api.nvim_create_autocmd('BufWritePre', {
138 | pattern = '*',
139 | callback = function(args)
140 | require('conform').format { bufnr = args.buf }
141 | end,
142 | })
143 |
144 | -- lint
145 | require('lint').linters_by_ft = {
146 | nix = { 'statix' },
147 | }
148 | vim.api.nvim_create_autocmd({ 'BufWritePost' }, {
149 | callback = function()
150 | require('lint').try_lint()
151 | end,
152 | })
153 |
154 | require('lsp_signature').setup()
155 |
156 | require('mini.comment').setup()
157 |
158 | require('timber').setup()
159 | end,
160 | }
161 |
--------------------------------------------------------------------------------
/lua/plugins/markdown.lua:
--------------------------------------------------------------------------------
1 | return {
2 | 'markview.nvim',
3 | lazy = false,
4 | before = function()
5 | deps.add {
6 | source = 'OXY2DEV/markview.nvim',
7 | depends = {
8 | 'nvim-treesitter/nvim-treesitter',
9 | 'nvim-tree/nvim-web-devicons',
10 | },
11 | }
12 | end,
13 | after = function()
14 | local presets = require 'markview.presets'
15 | require('markview').setup {
16 | checkboxes = presets.checkboxes.nerd,
17 | headings = presets.headings.marker,
18 | }
19 | end,
20 | }
21 |
--------------------------------------------------------------------------------
/lua/plugins/neocord.lua:
--------------------------------------------------------------------------------
1 | return {
2 | 'neocord',
3 | before = function()
4 | deps.add { source = 'IogaMaster/neocord' }
5 | end,
6 | after = function()
7 | require('neocord').setup {
8 | logo = 'https://raw.githubusercontent.com/IogaMaster/neovim/main/.github/assets/nixvim-dark.webp',
9 | }
10 | end,
11 | }
12 |
--------------------------------------------------------------------------------
/lua/plugins/neotree.lua:
--------------------------------------------------------------------------------
1 | return {
2 | 'neo-tree.nvim',
3 |
4 | before = function()
5 | deps.add {
6 | source = 'nvim-neo-tree/neo-tree.nvim',
7 | depends = {
8 | 'nvim-tree/nvim-web-devicons',
9 | 'MunifTanjim/nui.nvim',
10 | 'nvim-lua/plenary.nvim',
11 | },
12 | }
13 | end,
14 |
15 | keys = {
16 | { 'op', 'Neotree toggle', desc = 'NeoTree' },
17 | },
18 |
19 | after = function()
20 | require('neo-tree').setup {
21 | filesystem = {
22 | follow_current_file = { enabled = true },
23 | hijack_netrw_behavior = 'open_default',
24 | filtered_items = { visible = true },
25 | use_libuv_file_watcher = true,
26 | },
27 | git_status = {
28 | symbols = {
29 | -- Change type
30 | added = '✚', -- or "✚", but this is redundant info if you use git_status_colors on the name
31 | modified = '', -- or "", but this is redundant info if you use git_status_colors on the name
32 | deleted = '✖', -- this can only be used in the git_status source
33 | renamed = '', -- this can only be used in the git_status source
34 | -- Status type
35 | untracked = '',
36 | ignored = '',
37 | unstaged = '',
38 | staged = '',
39 | conflict = '',
40 | },
41 | },
42 | }
43 | end,
44 | }
45 |
--------------------------------------------------------------------------------
/lua/plugins/oil.lua:
--------------------------------------------------------------------------------
1 | return {
2 | 'oil',
3 | before = function()
4 | deps.add {
5 | source = 'stevearc/oil.nvim',
6 | }
7 | end,
8 | keys = {
9 | { 'fd', 'Oil', desc = 'File Browser' },
10 | },
11 | after = function()
12 | require('mini.icons').setup()
13 | require('oil').setup {
14 | skip_confirm_for_simple_edits = true,
15 | view_options = {
16 | show_hidden = true,
17 | },
18 | }
19 | end,
20 | }
21 |
--------------------------------------------------------------------------------
/lua/plugins/staline.lua:
--------------------------------------------------------------------------------
1 | return {
2 | 'staline.nvim',
3 |
4 | before = function()
5 | deps.add { source = 'tamton-aquib/staline.nvim', depends = { 'nvim-tree/nvim-web-devicons' } }
6 | end,
7 | after = function()
8 | require('staline').setup {
9 | defaults = {
10 | left_separator = ' ',
11 | right_separator = ' ',
12 | branch_symbol = ' ',
13 | mod_symbol = '',
14 | line_column = '[%l/%L]',
15 | },
16 | mode_icons = {
17 | ['n'] = 'NORMAL',
18 | ['no'] = 'NORMAL',
19 | ['nov'] = 'NORMAL',
20 | ['noV'] = 'NORMAL',
21 | ['niI'] = 'NORMAL',
22 | ['niR'] = 'NORMAL',
23 | ['niV'] = 'NORMAL',
24 | ['i'] = 'INSERT',
25 | ['ic'] = 'INSERT',
26 | ['ix'] = 'INSERT',
27 | ['s'] = 'INSERT',
28 | ['S'] = 'INSERT',
29 | ['v'] = 'VISUAL',
30 | ['V'] = 'VISUAL',
31 | [''] = 'VISUAL',
32 | ['r'] = 'REPLACE',
33 | ['r?'] = 'REPLACE',
34 | ['R'] = 'REPLACE',
35 | ['c'] = 'COMMAND',
36 | ['t'] = 'TERMINAL',
37 | },
38 | special_table = {
39 | lazy = { 'Plugins', '💤 ' },
40 | TelescopePrompt = { 'Telescope', ' ' },
41 | },
42 | sections = {
43 | left = { '-mode', ' ', 'branch' },
44 | mid = { 'lsp_name' },
45 | right = { 'file_name', 'line_column' },
46 | },
47 | }
48 |
49 | vim.cmd [[
50 | set noshowmode
51 | ]]
52 | end,
53 | }
54 |
--------------------------------------------------------------------------------
/lua/plugins/telescope.lua:
--------------------------------------------------------------------------------
1 | return {
2 | 'telescope.nvim',
3 | before = function()
4 | deps.add { source = 'nvim-telescope/telescope.nvim', depends = { 'nvim-lua/plenary.nvim', 'nvim-tree/nvim-web-devicons' } }
5 | deps.add { source = 'mrcjkb/telescope-manix' }
6 | end,
7 | keys = {
8 | { 'ff', 'Telescope find_files', desc = 'Find Files' },
9 | { 'fr', 'Telescope oldfiles', desc = 'Recent Files' },
10 | { 'ft', 'Telescope live_grep', desc = 'Search Text in Files' },
11 | { 'bi', 'Telescope buffers', desc = 'List Buffers' },
12 | { '', 'Telescope commands', desc = 'Run Command' },
13 | { 'fm', 'Telescope manix', desc = 'Search Nix Options and Utils' },
14 | },
15 | after = function()
16 | require('telescope').setup {
17 | defaults = {
18 | prompt_prefix = ' ',
19 | selection_caret = ' ',
20 | initial_mode = 'normal',
21 | selection_strategy = 'reset',
22 | sorting_strategy = 'ascending',
23 | layout_strategy = 'horizontal',
24 | layout_config = {
25 | horizontal = {
26 | prompt_position = 'top',
27 | preview_width = 0.55,
28 | results_width = 0.8,
29 | },
30 | vertical = {
31 | mirror = false,
32 | },
33 | width = 0.87,
34 | height = 0.80,
35 | preview_cutoff = 120,
36 | },
37 | path_display = { 'truncate' },
38 | winblend = 0,
39 | -- border = {},
40 | borderchars = { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' },
41 | color_devicons = true,
42 | set_env = { ['COLORTERM'] = 'truecolor' }, -- default = nil,
43 | -- Keymaps
44 | mappings = {
45 | n = {
46 | ['d'] = require('telescope.actions').delete_buffer,
47 | },
48 | },
49 | },
50 | }
51 | end,
52 | }
53 |
--------------------------------------------------------------------------------
/lua/plugins/tint.lua:
--------------------------------------------------------------------------------
1 | return {
2 | 'tint.nvim',
3 | before = function()
4 | deps.add { source = 'levouh/tint.nvim' }
5 | end,
6 | after = function()
7 | require('tint').setup()
8 | end,
9 | }
10 |
--------------------------------------------------------------------------------
/lua/plugins/todo-comments.lua:
--------------------------------------------------------------------------------
1 | return {
2 | 'todo-comments.nvim',
3 | before = function()
4 | deps.add { source = 'folke/todo-comments.nvim', depends = { 'nvim-lua/plenary.nvim' } }
5 | end,
6 | after = function()
7 | require('todo-comments').setup()
8 | end,
9 | }
10 |
--------------------------------------------------------------------------------
/lua/plugins/toggleterm.lua:
--------------------------------------------------------------------------------
1 | return {
2 | 'toggleterm.nvim',
3 | before = function()
4 | deps.add { source = 'akinsho/toggleterm.nvim' }
5 | end,
6 | keys = {
7 | { 'ot', 'ToggleTerm', desc = 'Toggle Terminal' },
8 | },
9 | after = function()
10 | require('toggleterm').setup {}
11 |
12 | vim.cmd [[ tnoremap ]]
13 | end,
14 | }
15 |
--------------------------------------------------------------------------------
/lua/plugins/treesitter.lua:
--------------------------------------------------------------------------------
1 | return {
2 | 'nvim-treesitter',
3 | before = function()
4 | deps.add {
5 | source = 'nvim-treesitter/nvim-treesitter',
6 | hooks = {
7 | post_checkout = function()
8 | vim.cmd 'TSUpdate'
9 | end,
10 | },
11 | }
12 | end,
13 | after = function()
14 | require('nvim-treesitter.configs').setup { auto_install = true, highlight = { enable = true } }
15 | end,
16 | }
17 |
--------------------------------------------------------------------------------
/lua/plugins/which-key.lua:
--------------------------------------------------------------------------------
1 | return {
2 | 'which-key.nvim',
3 | before = function()
4 | deps.add { source = 'folke/which-key.nvim' }
5 | end,
6 | after = function()
7 | require('which-key').setup()
8 | end,
9 | }
10 |
--------------------------------------------------------------------------------
/nix/pkgs/neovim.nix:
--------------------------------------------------------------------------------
1 | {
2 | lib,
3 | wrapNeovimUnstable,
4 | neovim-unwrapped,
5 | neovimUtils,
6 | writeShellScript,
7 | lua5_1,
8 | luarocks,
9 | clang,
10 | pkg-config,
11 | cargo,
12 | statix,
13 | manix,
14 | buildFHSEnv,
15 | bundled ? true,
16 | }: let
17 | nvim = let
18 | config = let
19 | extraPackages = [
20 | lua5_1
21 | luarocks
22 | clang
23 | pkg-config
24 | cargo
25 |
26 | # LSP
27 | statix
28 | manix
29 | ];
30 | in
31 | neovimUtils.makeNeovimConfig
32 | {
33 | withPython3 = false;
34 | withRuby = false;
35 | withNodeJs = false;
36 |
37 | extraLuaPackages = p:
38 | with p; [
39 | magick
40 | ];
41 |
42 | inherit extraPackages;
43 |
44 | customRC =
45 | if bundled
46 | then ''
47 | set runtimepath^=${../../.}
48 | source ${../../.}/init.lua
49 | ''
50 | else ''
51 | set runtimepath^=~/.nvim
52 | set runtimepath-=~/.config/nvim
53 | source ~/.nvim/init.lua
54 | '';
55 | }
56 | // {
57 | wrapperArgs = [
58 | "--prefix"
59 | "PATH"
60 | ":"
61 | "${lib.makeBinPath extraPackages}"
62 | ];
63 | };
64 | in
65 | wrapNeovimUnstable neovim-unwrapped config;
66 | in
67 | buildFHSEnv {
68 | name = "nvim";
69 | targetPkgs = pkgs: [
70 | nvim
71 | ];
72 |
73 | runScript = writeShellScript "nvim-fhs.sh" ''
74 | exec ${nvim}/bin/nvim "$@"
75 | '';
76 | }
77 |
--------------------------------------------------------------------------------