This commit is contained in:
♥ Minnie ♥ 2024-08-04 22:21:23 +08:00
parent 41e97a6fc9
commit 96e676112c
Signed by: jasmine
GPG key ID: 8563E358D4E8040E
12 changed files with 374 additions and 509 deletions

View file

@ -8,11 +8,11 @@
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1718371084, "lastModified": 1722339003,
"narHash": "sha256-abpBi61mg0g+lFFU0zY4C6oP6fBwPzbHPKBGw676xsA=", "narHash": "sha256-ZeS51uJI30ehNkcZ4uKqT4ZDARPyqrHADSKAwv5vVCU=",
"owner": "ryantm", "owner": "ryantm",
"repo": "agenix", "repo": "agenix",
"rev": "3a56735779db467538fb2e577eda28a9daacaca6", "rev": "3f1dae074a12feb7327b4bf43cbac0d124488bb7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -31,11 +31,11 @@
"pre-commit-hooks": "pre-commit-hooks" "pre-commit-hooks": "pre-commit-hooks"
}, },
"locked": { "locked": {
"lastModified": 1720397980, "lastModified": 1722597419,
"narHash": "sha256-vI92Y+f4iTDsoy+xg0n0I/bIY1xatvZ807spIgTjTc0=", "narHash": "sha256-YbMzll0Dh2ln/TryDP+S3IGm8nRHkzcSQIubI4ZEOAw=",
"owner": "oddlama", "owner": "oddlama",
"repo": "agenix-rekey", "repo": "agenix-rekey",
"rev": "c071067f7d972552f5170cf8665643ed0ec19a6d", "rev": "126b4a5133eb361cbf5bf90e44c71b6f830845ec",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -52,11 +52,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1717702314, "lastModified": 1720978971,
"narHash": "sha256-C0UwatW9w+wHCNedn6iWHbM3AxADZ2XK49sZfs4aUlM=", "narHash": "sha256-AtDyr1FjqoveFqgu9ebQHSzxu0tMgF2ejWBfiN4NKS4=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "824048e7503820d508f25d44ebe2570263a20d79", "rev": "79461e2bc663aed53dcadc2a40c181aad97cee8e",
"revCount": 11, "revCount": 14,
"type": "git", "type": "git",
"url": "https://codeberg.org/kampka/nix-flake-crowdsec.git" "url": "https://codeberg.org/kampka/nix-flake-crowdsec.git"
}, },
@ -109,6 +109,28 @@
"type": "github" "type": "github"
} }
}, },
"devshell_2": {
"inputs": {
"nixpkgs": [
"nixvim-config",
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1722113426,
"narHash": "sha256-Yo/3loq572A8Su6aY5GP56knpuKYRvM2a1meP9oJZCw=",
"owner": "numtide",
"repo": "devshell",
"rev": "67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"flake-compat": { "flake-compat": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -141,6 +163,60 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_3": {
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"revCount": 57,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1722555600,
"narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "8471fe90ad337a8074e957b69ca4d0089218391d",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"nixvim-config",
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1719994518,
"narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems_3" "systems": "systems_3"
@ -194,6 +270,57 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_4": {
"inputs": {
"systems": "systems_6"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": [
"nixvim-config",
"nixvim",
"flake-compat"
],
"gitignore": "gitignore_2",
"nixpkgs": [
"nixvim-config",
"nixvim",
"nixpkgs"
],
"nixpkgs-stable": [
"nixvim-config",
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1721042469,
"narHash": "sha256-6FPUl7HVtvRHCCBQne7Ylp4p+dpP3P/OYuzjztZ4s70=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "f451c19376071a90d8c58ab1a953c6e9840527fd",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": { "gitignore": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -216,6 +343,29 @@
"type": "github" "type": "github"
} }
}, },
"gitignore_2": {
"inputs": {
"nixpkgs": [
"nixvim-config",
"nixvim",
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -258,6 +408,28 @@
"type": "github" "type": "github"
} }
}, },
"home-manager_3": {
"inputs": {
"nixpkgs": [
"nixvim-config",
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1722407237,
"narHash": "sha256-wcpVHUc2nBSSgOM7UJSpcRbyus4duREF31xlzHV5T+A=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "58cef3796271aaeabaed98884d4abaab5d9d162d",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"impermanence": { "impermanence": {
"locked": { "locked": {
"lastModified": 1719091691, "lastModified": 1719091691,
@ -273,6 +445,28 @@
"type": "github" "type": "github"
} }
}, },
"nix-darwin": {
"inputs": {
"nixpkgs": [
"nixvim-config",
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1722082646,
"narHash": "sha256-od8dBWVP/ngg0cuoyEl/w9D+TCNDj6Kh4tr151Aax7w=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "0413754b3cdb879ba14f6e96915e5fdf06c6aab6",
"type": "github"
},
"original": {
"owner": "lnl7",
"repo": "nix-darwin",
"type": "github"
}
},
"nix-minecraft": { "nix-minecraft": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_2",
@ -280,11 +474,11 @@
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1720402492, "lastModified": 1722562463,
"narHash": "sha256-yNR1XyrETihSjQqV8cKsXPkAc1B5LcFdWe2fFc5ehP8=", "narHash": "sha256-LctuHlTmJPqQna/3F10v4eNE8/KYh2bu0naEwalJ73o=",
"owner": "Infinidoge", "owner": "Infinidoge",
"repo": "nix-minecraft", "repo": "nix-minecraft",
"rev": "9332af58a21aba1c5a7fe6a76d6ab48ac68339dc", "rev": "6c5e8f138e4ba944f423850148651e00589dde73",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -309,6 +503,18 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-lib": {
"locked": {
"lastModified": 1722555339,
"narHash": "sha256-uFf2QeW7eAHlYXuDktm9c25OxOyCoUOQmh5SZ9amE5Q=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz"
}
},
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1685801374, "lastModified": 1685801374,
@ -327,11 +533,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1720031269, "lastModified": 1722630782,
"narHash": "sha256-rwz8NJZV+387rnWpTYcXaRNvzUSnnF9aHONoJIYmiUQ=", "narHash": "sha256-hMyG9/WlUi0Ho9VkRrrez7SeNlDzLxalm9FwY7n/Noo=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "9f4128e00b0ae8ec65918efeba59db998750ead6", "rev": "d04953086551086b44b6f3c6b7eeb26294f207da",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -359,11 +565,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1720244366, "lastModified": 1722651103,
"narHash": "sha256-WrDV0FPMVd2Sq9hkR5LNHudS3OSMmUrs90JUTN+MXpA=", "narHash": "sha256-IRiJA0NVAoyaZeKZluwfb2DoTpBAj+FLI0KfybBeDU0=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "49ee0e94463abada1de470c9c07bfc12b36dcf40", "rev": "a633d89c6dc9a2a8aae11813a62d7c58b2c0cc51",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -373,6 +579,107 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_4": {
"locked": {
"lastModified": 1722630782,
"narHash": "sha256-hMyG9/WlUi0Ho9VkRrrez7SeNlDzLxalm9FwY7n/Noo=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "d04953086551086b44b6f3c6b7eeb26294f207da",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_5": {
"locked": {
"lastModified": 1722185531,
"narHash": "sha256-veKR07psFoJjINLC8RK4DiLniGGMgF3QMlS4tb74S6k=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "52ec9ac3b12395ad677e8b62106f0b98c1f8569d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixvim": {
"inputs": {
"devshell": "devshell_2",
"flake-compat": "flake-compat_3",
"flake-parts": "flake-parts_2",
"git-hooks": "git-hooks",
"home-manager": "home-manager_3",
"nix-darwin": "nix-darwin",
"nixpkgs": "nixpkgs_5",
"nuschtosSearch": "nuschtosSearch",
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1722531900,
"narHash": "sha256-COtoy+Y/j2QLX818mRI7BweRJOltf0bndxbps/eoH0s=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "7c39d77b9f1fbcbd8f2a575c4f2948dd54efc5c1",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixvim",
"type": "github"
}
},
"nixvim-config": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs_4",
"nixvim": "nixvim"
},
"locked": {
"lastModified": 1722777823,
"narHash": "sha256-3WtxsFjAYar8FOnFJinM6nE9itD3hqJ9erARfSB1WpQ=",
"ref": "refs/heads/master",
"rev": "46b72f24f9c64432a1c25e4010512458ce4f400f",
"revCount": 3,
"type": "git",
"url": "https://git.sajenim.dev/jasmine/nvim.nix.git"
},
"original": {
"type": "git",
"url": "https://git.sajenim.dev/jasmine/nvim.nix.git"
}
},
"nuschtosSearch": {
"inputs": {
"flake-utils": "flake-utils_4",
"nixpkgs": [
"nixvim-config",
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1722144272,
"narHash": "sha256-olZbfaEdd+zNPuuyYcYGaRzymA9rOmth8yXOlVm+LUs=",
"owner": "NuschtOS",
"repo": "search",
"rev": "16565307c267ec219c2b5d3494ba66df08e7d403",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"repo": "search",
"type": "github"
}
},
"pre-commit-hooks": { "pre-commit-hooks": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
@ -410,7 +717,8 @@
"impermanence": "impermanence", "impermanence": "impermanence",
"nix-minecraft": "nix-minecraft", "nix-minecraft": "nix-minecraft",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_3",
"nixpkgs-unstable": "nixpkgs-unstable" "nixpkgs-unstable": "nixpkgs-unstable",
"nixvim-config": "nixvim-config"
} }
}, },
"systems": { "systems": {
@ -487,6 +795,43 @@
"repo": "default", "repo": "default",
"type": "github" "type": "github"
} }
},
"systems_6": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"nixvim-config",
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1722330636,
"narHash": "sha256-uru7JzOa33YlSRwf9sfXpJG+UAV+bnBEYMjrzKrQZFw=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "768acdb06968e53aa1ee8de207fd955335c754b7",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -28,6 +28,7 @@
# Add any other flake you might need. # Add any other flake you might need.
nix-minecraft.url = "github:Infinidoge/nix-minecraft"; nix-minecraft.url = "github:Infinidoge/nix-minecraft";
nixvim-config.url = "git+https://git.sajenim.dev/jasmine/nvim.nix.git";
}; };
outputs = { self, nixpkgs, home-manager, ... }@inputs: outputs = { self, nixpkgs, home-manager, ... }@inputs:

View file

@ -3,6 +3,7 @@
{ {
imports = [ imports = [
./git.nix ./git.nix
# ./nvim.nix
./zsh.nix ./zsh.nix
]; ];

View file

@ -0,0 +1,7 @@
{ inputs, system, ... }:
{
# Install our nixvim configuration for neovim.
home.packages = [ inputs.nixvim-config.packages.${system}.default ];
}

View file

@ -1,31 +0,0 @@
--
-- Bootstrap lazy.nvim
--
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable', -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
--
-- Load our configurations
--
require('configs.options')
--
-- Load our plugin specs
--
require('lazy').setup('plugins')

View file

@ -1,17 +0,0 @@
-- Keybinds
vim.g.mapleader = ' '
-- General
vim.opt.number = true
vim.opt.showmode = false
vim.opt.swapfile = false
vim.opt.clipboard = 'unnamedplus'
-- Tabs & spaces
vim.opt.tabstop = 2
vim.opt.softtabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true
vim.opt.autoindent = true
vim.opt.copyindent = true

View file

@ -1,207 +0,0 @@
return {
--
-- Ollama Workflows
--
{
'nomnivore/ollama.nvim',
dependencies = {
'nvim-lua/plenary.nvim',
'stevearc/dressing.nvim',
},
-- All the user commands added by the plugin
cmd = { "Ollama", "OllamaModel", "OllamaServe", "OllamaServeStop" },
keys = {
-- Sample keybind for prompt menu. Note that the <c-u> is important for selections to work properly.
{
"<leader>oo",
":<c-u>lua require('ollama').prompt()<cr>",
desc = "ollama prompt",
mode = { "n", "v" },
},
-- Sample keybind for direct prompting. Note that the <c-u> is important for selections to work properly.
{
"<leader>oG",
":<c-u>lua require('ollama').prompt('Generate_Code')<cr>",
desc = "ollama Generate Code",
mode = { "n", "v" },
},
},
---@type Ollama.Config
opts = {
model = "llama3:8b",
}
},
--
-- LSP Configuration
--
{
'neovim/nvim-lspconfig',
event = { 'BufReadPost', 'BufNewFile' },
dependencies = {
'hrsh7th/nvim-cmp', -- Autocompletion plugin
'hrsh7th/cmp-nvim-lsp', -- LSP source for nvim-cmp
'saadparwaiz1/cmp_luasnip', -- Snippets source for nvim-cmp
'L3MON4D3/LuaSnip', -- Snippets plugin
},
config = function ()
--
-- Setup language servers.
--
local lspconfig = require('lspconfig')
-- Lua
lspconfig.lua_ls.setup {
on_init = function(client)
local path = client.workspace_folders[1].name
if not vim.loop.fs_stat(path..'/.luarc.json') and not vim.loop.fs_stat(path..'/.luarc.jsonc') then
client.config.settings = vim.tbl_deep_extend('force', client.config.settings, {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using
-- (most likely LuaJIT in the case of Neovim)
version = 'LuaJIT'
},
-- Make the server aware of Neovim runtime files
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME
-- "${3rd}/luv/library"
-- "${3rd}/busted/library",
}
-- or pull in all of 'runtimepath'. NOTE: this is a lot slower
-- library = vim.api.nvim_get_runtime_file("", true)
}
}
})
client.notify("workspace/didChangeConfiguration", { settings = client.config.settings })
end
return true
end
}
-- Haskell
lspconfig.hls.setup{
filetypes = { 'haskell', 'lhaskell', 'cabal' },
}
-- Nix
lspconfig.nil_ls.setup{}
-- C
lspconfig.clangd.setup{}
-- YAML
lspconfig.yamlls.setup{}
--
-- Global mappings
--
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist)
-- Use LspAttach autocommand to only map the following keys
-- after the language server attaches to the current buffer
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
callback = function(ev)
-- Buffer local mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local opts = { buffer = ev.buf }
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts)
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts)
vim.keymap.set('n', '<space>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, opts)
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts)
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts)
vim.keymap.set({ 'n', 'v' }, '<space>ca', vim.lsp.buf.code_action, opts)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
vim.keymap.set('n', '<space>f', function()
vim.lsp.buf.format { async = true }
end, opts)
end,
})
--
-- Autocompletion
--
-- Add additional capabilities supported by nvim-cmp
local capabilities = require("cmp_nvim_lsp").default_capabilities()
-- Enable some language servers with the additional completion capabilities offered by nvim-cmp
local servers = { 'clangd', 'rust_analyzer', 'pyright', 'tsserver' }
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
-- on_attach = my_custom_on_attach,
capabilities = capabilities,
}
end
-- luasnip setup
local luasnip = require 'luasnip'
-- nvim-cmp setup
local cmp = require 'cmp'
cmp.setup {
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
['<C-u>'] = cmp.mapping.scroll_docs(-4), -- Up
['<C-d>'] = cmp.mapping.scroll_docs(4), -- Down
-- C-b (back) C-f (forward) for snippet placeholder navigation.
['<C-Space>'] = cmp.mapping.complete(),
['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
},
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { 'i', 's' }),
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { 'i', 's' }),
}),
sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
},
}
end
},
}

View file

@ -1,21 +0,0 @@
return {
--
-- Modified version of gruvbox
--
{
'sainnhe/gruvbox-material',
lazy = false,
priority = 1000,
config = function()
vim.o.termguicolors = true
vim.o.background = 'dark'
vim.g.gruvbox_material_background = 'hard'
vim.g.gruvbox_material_better_performance = 1
vim.cmd([[colorscheme gruvbox-material]])
end,
},
}

View file

@ -1,97 +0,0 @@
return {
--
-- Treesitter
--
{
'nvim-treesitter/nvim-treesitter',
build = ":TSUpdate",
config = function()
local configs = require('nvim-treesitter.configs')
configs.setup({
auto_install = true,
highlight = { enable = true },
indent = { enable = true },
})
end
},
--
-- Fuzzy Finder
--
{
'nvim-telescope/telescope.nvim',
tag = '0.1.3',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons',
},
keys = {
{ '<leader>ff', '<cmd>Telescope find_files<cr>', desc = 'Find Files' },
{ '<leader>fg', '<cmd>Telescope live_grep<cr>' , desc = 'Live Grep' },
{ '<leader>fb', '<cmd>Telescope buffers<cr>' , desc = 'Buffers' },
{ '<leader>fh', '<cmd>Telescope help_tags<cr>' , desc = 'Help Tags' },
},
config = function()
require('telescope').setup()
end
},
--
-- Commenting
--
{
'numToStr/Comment.nvim',
config = function()
require('Comment').setup()
end
},
--
-- Git Commands
--
{
'kdheepak/lazygit.nvim',
dependencies = {
'nvim-lua/plenary.nvim'
},
keys = {
{ '<leader>gg', '<cmd>LazyGit<cr>', desc = 'LazyGit' },
}
},
--
-- Display Keybindings
--
{
'folke/which-key.nvim',
event = 'VeryLazy',
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 300
end,
opts = { },
},
--
-- Delete Buffers
--
{
'famiu/bufdelete.nvim',
cmd = { 'Bdelete', 'Bwipeout' },
keys = {
{ '<leader>bd', '<cmd>Bdelete<cr>', desc = 'Buffer Delete' },
{ '<leader>bw', '<cmd>Bwipeout<cr>', desc = 'Buffer Wipeout' },
},
},
}

View file

@ -1,86 +0,0 @@
return {
--
-- File explorer
--
{
'nvim-neo-tree/neo-tree.nvim',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons',
'MunifTanjim/nui.nvim',
},
keys = {
{ '\\', '<cmd>Neotree reveal<cr>', desc = 'Neotree' },
},
},
--
-- Statusline
--
{
'nvim-lualine/lualine.nvim',
event = 'VeryLazy',
dependencies = {
'nvim-tree/nvim-web-devicons',
},
config = function()
-- Define a function to check that ollama is installed and working
local function get_condition()
return package.loaded["ollama"] and require("ollama").status ~= nil
end
-- Define a function to check the status and return the corresponding icon
local function get_status_icon()
local status = require("ollama").status()
if status == "IDLE" then
return "OLLAMA IDLE"
elseif status == "WORKING" then
return "OLLAMA BUSY"
end
end
require('lualine').setup {
options = {
icons_enabled = true,
theme = 'gruvbox-material',
component_separators = { left = '', right = ''},
section_separators = { left = '', right = ''},
globalstatus = true,
extensions = {
'neotree'
},
},
tabline = {
lualine_a = {'buffers'},
};
sections = {
lualine_a = {'mode'},
lualine_b = {'branch', 'diff', 'diagnostics'},
lualine_c = { { 'filename', path = 1 } },
lualine_x = { get_status_icon, get_condition, 'encoding', 'fileformat', 'filetype' },
lualine_y = { "progress" },
lualine_z = { "location" },
},
}
end,
},
--
-- Git decorations
--
{
'lewis6991/gitsigns.nvim',
config = function()
require('gitsigns').setup()
end
},
}

View file

@ -1,29 +0,0 @@
{ pkgs, ... }:
{
programs.neovim = {
enable = true;
#package = pkgs.neovim-nightly;
defaultEditor = true;
extraPackages = with pkgs; [
# Required for nvim-treesitter
gcc
# Required for telescope.nvim
fd
ripgrep
# Required for markdown-preview.nvim
nodejs
yarn
# Language server packages
nil
haskell-language-server
lua-language-server
clang-tools
yaml-language-server
];
};
home.persistence."/persist/home/sajenim".directories = [ ".local/share/nvim" ];
xdg.configFile.nvim = { source = ./config; recursive = true; };
}

View file

@ -2,7 +2,6 @@
imports = [ imports = [
inputs.impermanence.nixosModules.home-manager.impermanence inputs.impermanence.nixosModules.home-manager.impermanence
../features/cli ../features/cli
../features/nvim
]; ];
nixpkgs = { nixpkgs = {