Compare commits

...

10 commits

14 changed files with 493 additions and 65 deletions

278
flake.lock Normal file
View file

@ -0,0 +1,278 @@
{
"nodes": {
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": {
"lastModified": 1688466019,
"narHash": "sha256-VeM2akYrBYMsb4W/MmBo1zmaMfgbL4cH3Pu8PGyIwJ0=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "8e8d955c22df93dbe24f19ea04f47a74adbdc5ec",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1688466019,
"narHash": "sha256-VeM2akYrBYMsb4W/MmBo1zmaMfgbL4cH3Pu8PGyIwJ0=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "8e8d955c22df93dbe24f19ea04f47a74adbdc5ec",
"type": "github"
},
"original": {
"id": "flake-parts",
"type": "indirect"
}
},
"flake-parts_3": {
"inputs": {
"nixpkgs-lib": [
"neovim-nightly-overlay",
"hercules-ci-effects",
"hercules-ci-agent",
"nixpkgs"
]
},
"locked": {
"lastModified": 1688466019,
"narHash": "sha256-VeM2akYrBYMsb4W/MmBo1zmaMfgbL4cH3Pu8PGyIwJ0=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "8e8d955c22df93dbe24f19ea04f47a74adbdc5ec",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1685518550,
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"haskell-flake": {
"locked": {
"lastModified": 1684780604,
"narHash": "sha256-2uMZsewmRn7rRtAnnQNw1lj0uZBMh4m6Cs/7dV5YF08=",
"owner": "srid",
"repo": "haskell-flake",
"rev": "74210fa80a49f1b6f67223debdbf1494596ff9f2",
"type": "github"
},
"original": {
"owner": "srid",
"ref": "0.3.0",
"repo": "haskell-flake",
"type": "github"
}
},
"hercules-ci-agent": {
"inputs": {
"flake-parts": "flake-parts_3",
"haskell-flake": "haskell-flake",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1688568579,
"narHash": "sha256-ON0M56wtY/TIIGPkXDlJboAmuYwc73Hi8X9iJGtxOhM=",
"owner": "hercules-ci",
"repo": "hercules-ci-agent",
"rev": "367dd8cd649b57009a6502e878005a1e54ad78c5",
"type": "github"
},
"original": {
"id": "hercules-ci-agent",
"type": "indirect"
}
},
"hercules-ci-effects": {
"inputs": {
"flake-parts": "flake-parts_2",
"hercules-ci-agent": "hercules-ci-agent",
"nixpkgs": [
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": {
"lastModified": 1689397210,
"narHash": "sha256-fVxZnqxMbsDkB4GzGAs/B41K0wt/e+B/fLxmTFF/S20=",
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
"rev": "0a63bfa3f00a3775ea3a6722b247880f1ffe91ce",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
"type": "github"
}
},
"neovim-flake": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": {
"dir": "contrib",
"lastModified": 1689836628,
"narHash": "sha256-CDbbn0N6eiknKa4KrYc6+4LAb4za2IYSw/YGy5BPdcQ=",
"owner": "neovim",
"repo": "neovim",
"rev": "63b3408551561127f7845470eb51404bcd6f547b",
"type": "github"
},
"original": {
"dir": "contrib",
"owner": "neovim",
"repo": "neovim",
"type": "github"
}
},
"neovim-nightly-overlay": {
"inputs": {
"flake-compat": "flake-compat",
"flake-parts": "flake-parts",
"hercules-ci-effects": "hercules-ci-effects",
"neovim-flake": "neovim-flake",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1689897867,
"narHash": "sha256-qr3jIEZh6k83i5JBfJ1GuwSTybekrioSnd3iaZACr5g=",
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
"rev": "258dfdf8fec67a1cea88a71d7613584300e062a0",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1688322751,
"narHash": "sha256-eW62dC5f33oKZL7VWlomttbUnOTHrAbte9yNUNW8rbk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0fbe93c5a7cac99f90b60bdf5f149383daaa615f",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"dir": "lib",
"lastModified": 1688049487,
"narHash": "sha256-100g4iaKC9MalDjUW9iN6Jl/OocTDtXdeAj7pEGIRh4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4bc72cae107788bf3f24f30db2e2f685c9298dc9",
"type": "github"
},
"original": {
"dir": "lib",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1690031011,
"narHash": "sha256-kzK0P4Smt7CL53YCdZCBbt9uBFFhE0iNvCki20etAf4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "12303c652b881435065a98729eb7278313041e49",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"neovim-nightly-overlay": "neovim-nightly-overlay",
"nixpkgs": "nixpkgs_2"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

63
flake.nix Normal file
View file

@ -0,0 +1,63 @@
{
description = "Personal NeoVim configuration";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
neovim-nightly-overlay = {
url = "github:nix-community/neovim-nightly-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {neovim-nightly-overlay, ...}: let
extraPackages = {pkgs, ...}:
with pkgs; [
# Misc utils
curl
fzf
git
gnutar
gnumake
gnused
gcc
ripgrep
tree-sitter
# Language servers
nil
lua-language-server
fortls
nodePackages.pyright
nodePackages.yaml-language-server
nodePackages.vim-language-server
nodePackages.bash-language-server
# Null LSP formatters
alejandra
beautysh
black
nodePackages.fixjson
fprettify
isort
python3Packages.mdformat
shellharden
stylua
];
in {
overlay = neovim-nightly-overlay.overlay;
homeManagerModules.default = {pkgs, ...}: {
programs.neovim = {
enable = true;
package = pkgs.neovim-nightly;
defaultEditor = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
withNodeJs = true;
withRuby = true;
withPython3 = true;
extraPackages = extraPackages pkgs;
};
};
};
}

View file

@ -14,15 +14,17 @@ return {
dashboard.section.header.val = vim.split(logo, "\n")
dashboard.section.buttons.val = {
dashboard.button("t", "" .. " Terminal", "<cmd>ToggleTerm <CR>"),
dashboard.button("f", "" .. " Find file", "<cmd>Telescope find_files <CR>"),
dashboard.button("r", "" .. " Recent files", "<cmd>Telescope oldfiles <CR>"),
dashboard.button("o", "" .. " File browser", "<cmd>Oil <CR>"),
dashboard.button("g", "󰊢 " .. " Git status", "<cmd>Neogit <CR>"),
dashboard.button("c", "" .. " Config", "<cmd>e $HOME/.config/home-manager/flake.nix <CR>"),
dashboard.button("l", "󰒲 " .. " Lazy", "<cmd>Lazy<CR>"),
dashboard.button("h", "" .. " Help", "<cmd>Telescope help_tags <CR>"),
dashboard.button("q", "" .. " Quit", "<cmd>qa<CR>"),
dashboard.button("t", "󰝖 Tasks", '<cmd>lua require("taskwarrior_nvim").browser({"ready"}) <CR>'),
dashboard.button("f", " Find file", "<cmd>Telescope find_files <CR>"),
dashboard.button("r", " Recent files", "<cmd>Telescope oldfiles <CR>"),
dashboard.button("o", " File browser", "<cmd>Oil <CR>"),
dashboard.button("p", "󱞁 Personal notes", "<cmd>Neorg workspace personal<CR>"),
dashboard.button("w", "󱞂 Work notes", "<cmd>Neorg workspace work<CR>"),
dashboard.button("g", "󰊢 Git status", "<cmd>Neogit <CR>"),
dashboard.button("c", " Config", "<cmd>e $HOME/.config/home-manager/flake.nix <CR>"),
dashboard.button("l", "󰒲 Lazy", "<cmd>Lazy<CR>"),
dashboard.button("h", " Help", "<cmd>Telescope help_tags <CR>"),
dashboard.button("q", " Quit", "<cmd>qa<CR>"),
}
for _, button in ipairs(dashboard.section.buttons.val) do
button.opts.hl = "AlphaButtons"

View file

@ -1,6 +1,6 @@
return {
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons", "folke/noice.nvim", "folke/tokyonight.nvim" },
dependencies = { "nvim-tree/nvim-web-devicons", "folke/tokyonight.nvim" },
event = { "VeryLazy" },
config = true,
opts = function()
@ -12,27 +12,22 @@ return {
globalstatus = true,
},
sections = {
lualine_a = { { "mode", separator = { left = "" }, right_padding = 2 } },
lualine_a = { "mode" },
lualine_b = { "filename", { "branch", icon = "󰊢" }, "diff" },
lualine_c = {
{
"diagnostics",
symbols = {
error = "",
warn = "",
info = "",
hint = "",
error = require("ui.lsp_icons").Error,
warn = require("ui.lsp_icons").Warn,
info = require("ui.lsp_icons").Info,
hint = require("ui.lsp_icons").Hint,
},
},
-- {
-- require("noice").api.status.mode.get,
-- cond = require("noice").api.status.mode.has,
-- color = { fg = "#ff9e64" },
-- },
},
lualine_x = { "filetype", "fileformat", "encoding" },
lualine_y = { "progress" },
lualine_z = { "selectioncount", { "location", separator = { right = "" }, left_padding = 2 } },
lualine_z = { "selectioncount", "location" },
},
tabline = {},
winbar = {},

8
lua/plugins/nabla.lua Normal file
View file

@ -0,0 +1,8 @@
return {
"jbyuki/nabla.nvim",
lazy = true,
init = function()
vim.keymap.set("n", "<leader>p", "<cmd>lua require('nabla').popup()<cr>")
vim.keymap.set("n", "<leader>m", "<cmd>lua require('nabla').toggle_virt()<cr>")
end,
}

View file

@ -5,7 +5,7 @@ return {
ft = "norg",
cmd = "Neorg",
lazy = true,
dependencies = { "plenary.nvim", "nvim-treesitter", "nvim-cmp" },
dependencies = { "plenary.nvim", "nvim-treesitter", "nvim-cmp", "nabla.nvim" },
init = function()
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
pattern = { "*.norg" },
@ -15,6 +15,14 @@ return {
pattern = { "*.norg" },
command = "setlocal spell spelllang=en_gb",
})
vim.api.nvim_create_autocmd({ "BufReadPre", "BufNewFile" }, {
pattern = { "*.norg" },
command = "setlocal textwidth=79",
})
vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, {
pattern = { "*.norg" },
command = "lua require('nabla').enable_virt()",
})
vim.keymap.set("n", "<leader>wp", "<cmd>Neorg workspace personal <cr>")
vim.keymap.set("n", "<leader>ww", "<cmd>Neorg workspace work <cr>")
vim.keymap.set("n", "<leader>wr", "<cmd>Neorg return <cr>")

View file

@ -4,6 +4,8 @@ return {
event = { "BufReadPre", "BufNewFile" },
config = true,
opts = {
detection_methods = { "lsp", "pattern" },
patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json", "index.norg" },
ignore_lsp = { "null-ls" },
show_hidden = true,
silent_chdir = true,

View file

@ -0,0 +1,18 @@
local browser = function(report)
-- Return function to call taskwarrior browser with given report
return function() require("taskwarrior_nvim").browser { report } end
end
return {
"ColonQExclamationMark/taskwarrior.nvim",
branch = "1-Issues-initializing", -- Temp until PR is merged upstream
dependencies = { "nvim-telescope/telescope.nvim" },
cmd = "Task",
init = function()
vim.keymap.set("n", "<leader>tr", browser "ready")
vim.keymap.set("n", "<leader>ta", browser "active")
vim.keymap.set("n", "<leader>tn", browser "next")
end,
opts = {},
config = function() require("taskwarrior_nvim").setup() end,
}

View file

@ -19,7 +19,6 @@ return {
vim.keymap.set("n", "<leader>ft", "<cmd>Telescope treesitter<cr>")
vim.keymap.set("n", "<leader>fz", "<cmd>Telescope current_buffer_fuzzy_find<cr>")
vim.keymap.set("n", "<leader>fl", "<cmd>Telescope lazy<cr>")
vim.keymap.set("n", "<leader>fn", "<cmd>Telescope noice<cr>")
end,
config = function()
local trouble = require "trouble.providers.telescope"

View file

@ -1,7 +1,47 @@
local options = {
highlight = {
enable = true,
disable = { "fortran" },
additional_vim_regex_highlighting = false,
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "gnn",
node_incremental = "gnr",
scope_incremental = "gnc",
node_decremental = "gnm",
},
},
indent = {
enable = true,
},
refactor = {
smart_rename = {
enable = true,
keymaps = {
smart_rename = "grr",
},
},
navigation = {
enable = true,
keymaps = {
goto_definition_lsp_fallback = "gnd",
},
},
},
}
if vim.fn.executable "nix" == 1 then
options.auto_install = true
options.ensure_installed = "all"
end
return {
"nvim-treesitter/nvim-treesitter",
version = false,
build = ":TSUpdate",
cmd = { "TSUpdate", "TSInstall" },
event = { "BufReadPre", "BufNewFile" },
dependencies = "nvim-treesitter/nvim-treesitter-refactor",
config = function(_, opts)
@ -16,38 +56,5 @@ return {
end
require("nvim-treesitter.configs").setup(opts)
end,
opts = {
auto_install = vim.fn.executable "nix" == 1,
highlight = {
enable = true,
disable = { "fortran" },
additional_vim_regex_highlighting = false,
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "gnn",
node_incremental = "gnr",
scope_incremental = "gnc",
node_decremental = "gnm",
},
},
indent = {
enable = true,
},
refactor = {
smart_rename = {
enable = true,
keymaps = {
smart_rename = "grr",
},
},
navigation = {
enable = true,
keymaps = {
goto_definition_lsp_fallback = "gnd",
},
},
},
},
opts = options,
}

View file

@ -6,6 +6,7 @@ return {
config = true,
opts = {
window = {
width = 80,
options = {
signcolumn = "no", -- disable signcolumn
number = false, -- disable number column
@ -19,12 +20,17 @@ return {
plugins = {
options = {
enabled = true,
ruler = false,
showcmd = false,
},
twilight = { enabled = true },
gitsigns = { enabled = true },
tmux = { enabled = true },
wezterm = {
enabled = false,
font = "+4", -- (10% increase per step)
},
},
on_open = function(win) vim.wo.scrolloff = 999 end,
on_close = function(win) vim.wo.scrolloff = 0 end,
on_close = function(win) vim.wo.scrolloff = -1 end,
},
}

View file

@ -1,5 +1,5 @@
vim.opt.winblend = 30
vim.opt.pumblend = 30
vim.opt.winblend = 20
vim.opt.pumblend = 20
vim.g.neovide_padding_top = 5
vim.g.neovide_padding_bottom = 5
@ -7,9 +7,8 @@ vim.g.neovide_padding_left = 5
vim.g.neovide_padding_right = 5
vim.g.neovide_transparency = 0.8
vim.g.neovide_floating_transparency = 0.5
vim.g.neovide_floating_blur_amount_x = 5.0
vim.g.neovide_floating_blur_amount_y = 5.0
vim.g.neovide_floating_blur_amount_x = 2.0
vim.g.neovide_floating_blur_amount_y = 2.0
vim.g.neovide_hide_mouse_when_typing = false
vim.g.neovide_remember_window_size = false

View file

@ -1 +0,0 @@
require "nvim-treesitter"

44
neovim.nix Normal file
View file

@ -0,0 +1,44 @@
{pkgs, ...}: {
programs.neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
withNodeJs = true;
withRuby = true;
withPython3 = true;
extraPackages = with pkgs; [
# Misc utils
curl
fzf
git
gnutar
gnumake
gnused
gcc
ripgrep
tree-sitter
# Language servers
nil
lua-language-server
fortls
nodePackages.pyright
nodePackages.yaml-language-server
nodePackages.vim-language-server
nodePackages.bash-language-server
# Null LSP formatters
alejandra
beautysh
black
nodePackages.fixjson
fprettify
isort
python3Packages.mdformat
shellharden
stylua
];
};
}