Initial Commit
This commit is contained in:
commit
a5dab140d0
|
|
@ -0,0 +1,288 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1696426674,
|
||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
"neovim-nightly-overlay",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1704982712,
|
||||
"narHash": "sha256-2Ptt+9h8dczgle2Oo6z5ni5rt/uLMG47UFTR1ry/wgg=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "07f6395285469419cf9d078f59b5b49993198c00",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts_2": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
"neovim-nightly-overlay",
|
||||
"hercules-ci-effects",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1701473968,
|
||||
"narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "flake-parts",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1705309234,
|
||||
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils_2": {
|
||||
"inputs": {
|
||||
"systems": "systems_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1701680307,
|
||||
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gopher-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1696856053,
|
||||
"narHash": "sha256-8arSYelWObRnzNQ1F4wh/U44USy5aQFIGA9Aa7p9XXM=",
|
||||
"owner": "olexsmir",
|
||||
"repo": "gopher.nvim",
|
||||
"rev": "ac27f4b6794c872140fb205313d79ab166892fe9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "olexsmir",
|
||||
"repo": "gopher.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hercules-ci-effects": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts_2",
|
||||
"nixpkgs": [
|
||||
"neovim-nightly-overlay",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1704029560,
|
||||
"narHash": "sha256-a4Iu7x1OP+uSYpqadOu8VCPY+MPF3+f6KIi+MAxlgyw=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "hercules-ci-effects",
|
||||
"rev": "d5cbf433a6ae9cae05400189a8dbc6412a03ba16",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "hercules-ci-effects",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1706134977,
|
||||
"narHash": "sha256-KwNb1Li3K6vuVwZ77tFjZ89AWBo7AiCs9t0Cens4BsM=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "6359d40f6ec0b72a38e02b333f343c3d4929ec10",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "home-manager",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"neovim-flake": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils_2",
|
||||
"nixpkgs": [
|
||||
"neovim-nightly-overlay",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"dir": "contrib",
|
||||
"lastModified": 1706140641,
|
||||
"narHash": "sha256-H1qHhkf7sF7yrG2rb9Ks1Y4EtLY3cXGp16KCGveJWY4=",
|
||||
"owner": "neovim",
|
||||
"repo": "neovim",
|
||||
"rev": "4e59422e1d4950a3042bad41a7b81c8db4f8b648",
|
||||
"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_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1706141075,
|
||||
"narHash": "sha256-o66/XFTXmcJSpEcO508V5r765HtgT8qtr+H4LRIB9BY=",
|
||||
"owner": "nix-community",
|
||||
"repo": "neovim-nightly-overlay",
|
||||
"rev": "1da2e054a16309d7d7f7669438c8b9a5ef1b4642",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "neovim-nightly-overlay",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1705677747,
|
||||
"narHash": "sha256-eyM3okYtMgYDgmYukoUzrmuoY4xl4FUujnsv/P6I/zI=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "bbe7d8f876fbbe7c959c90ba2ae2852220573261",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1706006310,
|
||||
"narHash": "sha256-nDPz0fj0IFcDhSTlXBU2aixcnGs2Jm4Zcuoj0QtmiXQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "b43bb235efeab5324c5e486882ef46749188eee2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1705856552,
|
||||
"narHash": "sha256-JXfnuEf5Yd6bhMs/uvM67/joxYKoysyE3M2k6T3eWbg=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "612f97239e2cc474c13c9dafa0df378058c5ad8d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"gopher-nvim": "gopher-nvim",
|
||||
"home-manager": "home-manager",
|
||||
"neovim-nightly-overlay": "neovim-nightly-overlay",
|
||||
"nixpkgs": "nixpkgs_3"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_2": {
|
||||
"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
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
{
|
||||
description = "A very basic flake";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
neovim-nightly-overlay = {
|
||||
url = "github:nix-community/neovim-nightly-overlay";
|
||||
};
|
||||
|
||||
# Neovim Plugins
|
||||
gopher-nvim = {
|
||||
url = "github:olexsmir/gopher.nvim";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
outputs = inputs@{ self, nixpkgs, flake-utils, home-manager, ... }:
|
||||
let
|
||||
inherit (self) outputs;
|
||||
nixpkgsConfig = {
|
||||
config.allowUnfree = false;
|
||||
};
|
||||
neovim-overlay = import ./nix/overlay.nix { inherit inputs; };
|
||||
overlays = [
|
||||
neovim-overlay
|
||||
inputs.neovim-nightly-overlay.overlays.default
|
||||
];
|
||||
localLib = {
|
||||
mkPkgs = system:
|
||||
import nixpkgs {
|
||||
inherit system overlays;
|
||||
inherit (nixpkgsConfig) config;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
overlays.default = neovim-overlay;
|
||||
} //
|
||||
flake-utils.lib.eachDefaultSystem
|
||||
(system:
|
||||
let
|
||||
pkgs = localLib.mkPkgs system;
|
||||
in
|
||||
{
|
||||
formatter = pkgs.alejandra;
|
||||
packages = with pkgs; rec {
|
||||
nvim-nightly = neovim-nightly;
|
||||
nvim-ide = neovim-ide;
|
||||
default = nvim-ide;
|
||||
};
|
||||
devShells = {
|
||||
default = pkgs.mkShell {
|
||||
name = "neovim";
|
||||
buildInputs = with pkgs; [
|
||||
lua-language-server
|
||||
stylua
|
||||
luajitPackages.luacheck
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
{ pkgs, ... }:
|
||||
with pkgs.lib; let
|
||||
runtimepath = ../../neovim-empty;
|
||||
nvimLib = pkgs.callPackage ../lib { };
|
||||
inherit (nvimLib) mkNeovim mkNeovimConfig;
|
||||
|
||||
plugins = [];
|
||||
|
||||
extraPackages = [];
|
||||
|
||||
config = mkNeovimConfig {
|
||||
inherit extraPackages plugins runtimepath;
|
||||
};
|
||||
in
|
||||
mkNeovim config
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
## `after` directory
|
||||
|
||||
Scripts put in
|
||||
|
||||
- `after/plugin` will be sourced *after* init.lua
|
||||
or any other scripts are sourced during startup.
|
||||
- `after/ftplugin` will be sourced when opening a
|
||||
filetype, *after* any other `ftplugin` scripts are sourced.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
local indent_size = 2
|
||||
vim.opt.shiftwidth = indent_size
|
||||
vim.opt.tabstop = indent_size
|
||||
vim.opt.softtabstop = indent_size
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
{ inputs, pkgs, ... }:
|
||||
with
|
||||
pkgs.lib; let
|
||||
runtimepath = ./.;
|
||||
plugins = pkgs.callPackage ./plugins.nix { inherit inputs; };
|
||||
nvimLib = pkgs.callPackage ../nix/lib { };
|
||||
inherit (nvimLib) mkNeovim mkNeovimConfig;
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
ripgrep
|
||||
fd
|
||||
nixd
|
||||
rnix-lsp
|
||||
statix
|
||||
alejandra
|
||||
nodePackages.bash-language-server
|
||||
taplo
|
||||
jq
|
||||
shellcheck
|
||||
];
|
||||
|
||||
|
||||
config = mkNeovimConfig {
|
||||
inherit extraPackages plugins runtimepath;
|
||||
};
|
||||
in
|
||||
mkNeovim config
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
require("gopher").setup({
|
||||
commands = {
|
||||
go = "go",
|
||||
gomodifytags = "gomodifytags",
|
||||
gotests = "gotests", -- also you can set custom command path
|
||||
impl = "impl",
|
||||
iferr = "iferr",
|
||||
dlv = "dlv",
|
||||
},
|
||||
})
|
||||
require("gopher.dap").setup()
|
||||
|
|
@ -0,0 +1 @@
|
|||
require("dap-python").setup()
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
local crates = require("crates")
|
||||
require("which-key").register {
|
||||
["<leader>C"] = { name = "Crate", _ = "which_key_ignore" },
|
||||
}
|
||||
|
||||
vim.g.rustaceanvim = {
|
||||
server = {
|
||||
settings = {
|
||||
-- rust-analyzer language server configuration
|
||||
["rust-analyzer"] = {
|
||||
check = { command = "clippy" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
crates.setup {
|
||||
null_ls = {
|
||||
enabled = false,
|
||||
name = "Crates",
|
||||
},
|
||||
}
|
||||
|
||||
local opts = function(opts)
|
||||
return vim.tbl_deep_extend("force", { silent = true }, opts)
|
||||
end
|
||||
|
||||
vim.keymap.set("n", "<leader>Ct", crates.toggle, opts({ desc = "Crate toggle" }))
|
||||
vim.keymap.set("n", "<leader>Cr", crates.reload, opts({ desc = "Crate reload" }))
|
||||
|
||||
vim.keymap.set("n", "<leader>Cv", crates.show_versions_popup, opts({ desc = "Show version popup" }))
|
||||
vim.keymap.set("n", "<leader>Cf", crates.show_features_popup, opts({ desc = "Show features popup" }))
|
||||
vim.keymap.set("n", "<leader>Cd", crates.show_dependencies_popup, opts({ desc = "Show dependencies popup" }))
|
||||
|
||||
vim.keymap.set("n", "<leader>Cu", crates.update_crate, opts({ desc = "Update crate" }))
|
||||
vim.keymap.set("v", "<leader>Cu", crates.update_crates, opts({ desc = "Update Crates" }))
|
||||
vim.keymap.set("n", "<leader>Cp", crates.update_all_crates, opts({desc = "Update all crates" }))
|
||||
vim.keymap.set("n", "<leader>CU", crates.upgrade_crate, opts({ desc = "Upgrade crate" }))
|
||||
vim.keymap.set("v", "<leader>CU", crates.upgrade_crates, opts({ desc = "Upgrade crate" }))
|
||||
vim.keymap.set("n", "<leader>CP", crates.upgrade_all_crates, opts({ desc = "Upgrade all crates" }))
|
||||
|
||||
vim.keymap.set("n", "<leader>Cx", crates.expand_plain_crate_to_inline_table,
|
||||
opts({ desc = "Expand plain crate into inline table" }))
|
||||
vim.keymap.set("n", "<leader>CX", crates.extract_crate_into_table, opts({ desc = "Extract crate into table" }))
|
||||
|
||||
vim.keymap.set("n", "<leader>CH", crates.open_homepage, opts({ desc = "Open homepage" }))
|
||||
vim.keymap.set("n", "<leader>CR", crates.open_repository, opts({ desc = "Open repository" }))
|
||||
vim.keymap.set("n", "<leader>CD", crates.open_documentation, opts({ desc = "Open documentation" }))
|
||||
vim.keymap.set("n", "<leader>CC", crates.open_crates_io, opts({ desc = "Open crates.io" }))
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
---@mod user.lsp
|
||||
---
|
||||
---@brief [[
|
||||
---LSP related functions
|
||||
---@brief ]]
|
||||
|
||||
local M = {}
|
||||
|
||||
---Gets a 'ClientCapabilities' object, describing the LSP client capabilities
|
||||
---Extends the object with capabilities provided by plugins.
|
||||
---@return lsp.ClientCapabilities
|
||||
function M.make_client_capabilities()
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
-- Add com_nvim_lsp capabilities
|
||||
local cmp_lsp = require("cmp_nvim_lsp")
|
||||
local cmp_lsp_capabilities = cmp_lsp.default_capabilities()
|
||||
capabilities = vim.tbl_deep_extend("keep", capabilities, cmp_lsp_capabilities)
|
||||
-- Add any additional plugin capabilities here.
|
||||
-- Make sure to follow the instructions provided in the plugin's docs.
|
||||
return capabilities
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
local indent_size = 4
|
||||
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
vim.opt.whichwrap:append("b,s,<,>,[,],h,l")
|
||||
vim.opt.backspace = "indent,eol,start"
|
||||
|
||||
vim.opt.autoindent = true
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.smarttab = true
|
||||
vim.opt.smartindent = true
|
||||
vim.opt.shiftwidth = indent_size
|
||||
vim.opt.tabstop = indent_size
|
||||
vim.opt.softtabstop = indent_size
|
||||
|
||||
vim.opt.hlsearch = true
|
||||
vim.opt.incsearch = true
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = true
|
||||
|
||||
vim.opt.scrolloff = 8
|
||||
vim.opt.splitbelow = true
|
||||
vim.opt.splitright = true
|
||||
|
||||
vim.opt.startofline = false
|
||||
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
vim.opt.visualbell = true
|
||||
vim.opt.errorbells = false
|
||||
|
||||
vim.opt.textwidth = 80
|
||||
vim.opt.colorcolumn = { 80 }
|
||||
|
||||
vim.opt.cursorline = true
|
||||
|
||||
vim.opt.undodir = vim.fn.stdpath("state") .. "/undo"
|
||||
vim.opt.undofile = true
|
||||
vim.opt.backupdir = vim.fn.stdpath("state") .. "/backup"
|
||||
vim.opt.backup = true
|
||||
|
||||
vim.opt.mouse = "a"
|
||||
vim.opt.selectmode = "mouse"
|
||||
vim.opt.mousemoveevent = true
|
||||
|
||||
vim.opt.timeoutlen = 300
|
||||
|
||||
vim.opt.list = true
|
||||
vim.opt.listchars:append("eol:↴")
|
||||
vim.opt.listchars:append("space:.")
|
||||
|
||||
vim.opt.spell = true
|
||||
vim.opt.spelllang = { "de", "en_us" }
|
||||
vim.opt.helplang = "de"
|
||||
|
||||
vim.opt.laststatus = 3
|
||||
|
||||
vim.opt.conceallevel = 0
|
||||
vim.opt.concealcursor = "nc"
|
||||
|
||||
vim.opt.foldlevel = 0
|
||||
|
||||
vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { silent = true })
|
||||
|
||||
vim.keymap.set("t", "<Esc>", "<C-\\><C-n>")
|
||||
|
||||
vim.keymap.set("n", "q:", "<nop>", { noremap = true })
|
||||
|
||||
vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
|
||||
vim.keymap.set("n", "<M-K>", ":m -2<CR>", {})
|
||||
vim.keymap.set("n", "<M-J>", ":m +1<CR>", {})
|
||||
vim.keymap.set("v", "<M-K>", ":m '<-2<CR>gv=gv", {})
|
||||
vim.keymap.set("v", "<M-J>", ":m '>+1<CR>gv=gv", {})
|
||||
--[[
|
||||
" Bubble single lines
|
||||
nmap <C-Up> ddkP
|
||||
nmap <C-Down> ddp
|
||||
" Bubble multiple lines
|
||||
vmap <C-Up> xkP`[V`]
|
||||
vmap <C-Down> xp`[V`]
|
||||
]]--
|
||||
|
||||
vim.g.inlay_hints_visible = true
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
-- Yank Hightlight
|
||||
local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true })
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
group = highlight_group,
|
||||
pattern = "*",
|
||||
})
|
||||
|
||||
-- Text Conceal
|
||||
local conceal_group = vim.api.nvim_create_augroup("conceal", { clear = true })
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
|
||||
group = conceal_group,
|
||||
pattern = { "*.md", "*.json", "*.norg" },
|
||||
callback = function()
|
||||
vim.opt.conceallevel = 3
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufLeave", "BufWinLeave" }, {
|
||||
group = conceal_group,
|
||||
pattern = { "*.md", "*.json", "*.norg" },
|
||||
callback = function()
|
||||
vim.opt.conceallevel = 0
|
||||
end,
|
||||
})
|
||||
|
||||
-- Remember cursor position
|
||||
vim.api.nvim_create_autocmd("BufRead", {
|
||||
callback = function(opts)
|
||||
vim.api.nvim_create_autocmd("BufWinEnter", {
|
||||
once = true,
|
||||
buffer = opts.buf,
|
||||
callback = function()
|
||||
local ft = vim.bo[opts.buf].filetype
|
||||
local last_known_line = vim.api.nvim_buf_get_mark(opts.buf, '"')[1]
|
||||
if
|
||||
not (ft:match("commit") and ft:match("rebase"))
|
||||
and last_known_line > 1
|
||||
and last_known_line <= vim.api.nvim_buf_line_count(opts.buf)
|
||||
then
|
||||
vim.api.nvim_feedkeys([[g`"]], "nx", false)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
-- LSP Attach
|
||||
local lsp_attach_augroup = vim.api.nvim_create_augroup("lsp_attach", { clear = true })
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = lsp_attach_augroup,
|
||||
callback = function(ev)
|
||||
local client = vim.lsp.get_client_by_id(ev.data.client_id)
|
||||
if not client then
|
||||
return
|
||||
end
|
||||
|
||||
if client.server_capabilities.inlayHintProvider then
|
||||
vim.lsp.inlay_hint.enable(ev.buf, true)
|
||||
end
|
||||
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc"
|
||||
|
||||
-- Buffer local mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, { desc = "Goto Declaration" })
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "Goto Defninition" })
|
||||
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, { desc = "Goto Implementation" })
|
||||
vim.keymap.set("n", "gtd", vim.lsp.buf.type_definition, { desc = "Show Type Definition" })
|
||||
vim.keymap.set("n", "gr", vim.lsp.buf.references, { desc = "Goto References" })
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, { desc = "Hover" })
|
||||
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, { desc = "Rename" })
|
||||
vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, { desc = "Code action" })
|
||||
vim.keymap.set("n", "<leader>fm", function()
|
||||
vim.lsp.buf.format { async = true }
|
||||
end, { desc = "Format Code" })
|
||||
end,
|
||||
})
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
local cmp = require("cmp")
|
||||
local lspkind = require("lspkind")
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
local has_words_before = function()
|
||||
local unpack = unpack or table.unpack
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||
end
|
||||
|
||||
local base_mapping = {
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete {},
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<CR>"] = cmp.mapping.confirm { select = true },
|
||||
}
|
||||
local buffer_mapping = vim.tbl_deep_extend("force", base_mapping, {
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
|
||||
-- that way you will only jump inside the snippet region
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
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" }),
|
||||
})
|
||||
|
||||
local config = {
|
||||
formatting = {
|
||||
format = lspkind.cmp_format {
|
||||
mode = "symbol_text",
|
||||
maxwidth = 50,
|
||||
ellipsis_char = "…",
|
||||
menu = {
|
||||
nvim_lsp = "[LSP]",
|
||||
nvim_lsp_signature_help = "[LSP]",
|
||||
nvim_lsp_document_symbol = "[LSP]",
|
||||
luasnip = "[Snippet]",
|
||||
buffer = "[Buffer]",
|
||||
path = "[Path]",
|
||||
nvim_lua = "[Lua]",
|
||||
emoji = "[Emoji]",
|
||||
},
|
||||
},
|
||||
},
|
||||
completion = {
|
||||
completeopt = "menu,menuone",
|
||||
},
|
||||
window = {
|
||||
completion = {
|
||||
side_padding = 0,
|
||||
scrollbar = false,
|
||||
},
|
||||
documentation = {},
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert(buffer_mapping),
|
||||
sources = cmp.config.sources {
|
||||
{ name = "luasnip" },
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "neorg" },
|
||||
{ name = "buffer" },
|
||||
{ name = "fuzzy_path" },
|
||||
},
|
||||
}
|
||||
|
||||
local cmdline_config = {
|
||||
mapping = cmp.mapping.preset.cmdline(base_mapping),
|
||||
completion = {
|
||||
completeopt = "menu,menuone,noselect",
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = "fuzzy_path" },
|
||||
}, {
|
||||
{ name = "cmdline" },
|
||||
}),
|
||||
}
|
||||
local search_config = {
|
||||
mapping = cmp.mapping.preset.cmdline(base_mapping),
|
||||
completion = {
|
||||
completeopt = "menu,menuone,noselect",
|
||||
},
|
||||
sources = {
|
||||
{ name = "buffer" },
|
||||
},
|
||||
}
|
||||
|
||||
cmp.setup(config)
|
||||
cmp.setup.cmdline("/", search_config)
|
||||
cmp.setup.cmdline("?", search_config)
|
||||
cmp.setup.cmdline(":", cmdline_config)
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
require("catppuccin").setup {
|
||||
flavour = "mocha", -- latte, frappe, macchiato, mocha
|
||||
background = { -- :h background
|
||||
light = "latte",
|
||||
dark = "mocha",
|
||||
},
|
||||
transparent_background = false, -- disables setting the background color.
|
||||
show_end_of_buffer = false, -- shows the '~' characters after the end of buffers
|
||||
term_colors = false, -- sets terminal colors (e.g. `g:terminal_color_0`)
|
||||
dim_inactive = {
|
||||
enabled = false, -- dims the background color of inactive window
|
||||
shade = "dark",
|
||||
percentage = 0.05, -- percentage of the shade to apply to the inactive window
|
||||
},
|
||||
no_italic = false, -- Force no italic
|
||||
no_bold = false, -- Force no bold
|
||||
no_underline = false, -- Force no underline
|
||||
styles = { -- Handles the styles of general hi groups (see `:h highlight-args`):
|
||||
comments = { "italic" }, -- Change the style of comments
|
||||
conditionals = { "italic" },
|
||||
loops = {},
|
||||
functions = {},
|
||||
keywords = {},
|
||||
strings = {},
|
||||
variables = {},
|
||||
numbers = {},
|
||||
booleans = {},
|
||||
properties = {},
|
||||
types = {},
|
||||
operators = {},
|
||||
},
|
||||
color_overrides = {},
|
||||
integrations = {
|
||||
cmp = true,
|
||||
gitsigns = true,
|
||||
neotree = true,
|
||||
treesitter = true,
|
||||
--notify = false,
|
||||
mini = true,
|
||||
fidget = true,
|
||||
noice = true,
|
||||
indent_blankline = {
|
||||
enabled = true,
|
||||
},
|
||||
mason = false,
|
||||
rainbow_delimiters = true,
|
||||
-- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations)
|
||||
},
|
||||
custom_highlights = function(colors)
|
||||
local bg1 = colors.mantle
|
||||
local bg2 = colors.crust
|
||||
local fg0 = colors.text
|
||||
local green = colors.green
|
||||
local red = colors.red
|
||||
return {
|
||||
TelescopePreviewBorder = { fg = bg1, bg = bg1 },
|
||||
TelescopePreviewNormal = { bg = bg1 },
|
||||
TelescopePreviewTitle = { fg = fg0, bg = green },
|
||||
TelescopePromptBorder = { fg = bg2, bg = bg2 },
|
||||
TelescopePromptNormal = { fg = fg0, bg = bg2 },
|
||||
TelescopePromptPrefix = { fg = red, bg = bg2 },
|
||||
TelescopePromptTitle = { fg = fg0, bg = red },
|
||||
TelescopeResultsBorder = { fg = bg1, bg = bg1 },
|
||||
TelescopeResultsNormal = { bg = bg1 },
|
||||
TelescopeResultsTitle = { fg = bg1, bg = bg1 },
|
||||
TelescopeSelection = { bg = bg2, fg = colors.text },
|
||||
TelescopeResultsDiffAdd = { fg = fg0 },
|
||||
TelescopeResultsDiffChange = { fg = fg0 },
|
||||
TelescopeResultsDiffDelete = { fg = fg0 },
|
||||
NotifyBackground = { bg = bg2 },
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
||||
vim.cmd.colorscheme("catppuccin-mocha")
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
local dapui = require("dapui")
|
||||
local dap = require("dap")
|
||||
require("nvim-dap-virtual-text").setup {}
|
||||
dapui.setup()
|
||||
|
||||
require("dap.ext.vscode").load_launchjs(nil, { rt_lldb = { "rust" } })
|
||||
|
||||
dap.listeners.before.attach.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.launch.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.after.event_initialized.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated.dapui_config = function()
|
||||
dapui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited.dapui_config = function()
|
||||
dapui.close()
|
||||
end
|
||||
|
||||
vim.keymap.set("n", "<leader>db", vim.cmd.DapToggleBreakpoint, { desc = "Toggle Debug Breakpoint" })
|
||||
vim.keymap.set("n", "<leader>dc", vim.cmd.DapContinue, { desc = "Debug Continue" })
|
||||
vim.keymap.set("n", "<leader>dC", function() dap.run_last() end, { desc = "Debug Continue" })
|
||||
vim.keymap.set("n", "<leader>dn", vim.cmd.DapStepOver, { desc = "Debug Step Over" })
|
||||
vim.keymap.set("n", "<leader>di", vim.cmd.DapStepIn, { desc = "Debug Step In" })
|
||||
vim.keymap.set("n", "<leader>do", vim.cmd.DapStepOut, { desc = "Debug Step Out" })
|
||||
vim.keymap.set("n", "<leader>dt", vim.cmd.DapTerminate, { desc = "Debug Terminate" })
|
||||
vim.keymap.set("n", "<leader>dr", vim.cmd.DapToggleRepl, { desc = "Debug Toggle REPL" })
|
||||
vim.keymap.set("n", "<leader>du", function()
|
||||
require("dapui").toggle {}
|
||||
end, { desc = "Toggle Debug UI" })
|
||||
|
||||
vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DapBreakpoint", linehl = "", numhl = "DapBreakpoint" })
|
||||
vim.fn.sign_define(
|
||||
"DapBreakpointCondition",
|
||||
{ text = "ﳁ", texthl = "DapBreakpoint", linehl = "", numhl = "DapBreakpoint" }
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"DapBreakpointRejected",
|
||||
{ text = "", texthl = "DapBreakpoint", linehl = "", numhl = "DapBreakpoint" }
|
||||
)
|
||||
vim.fn.sign_define("DapLogPoint", { text = "", texthl = "DapLogPoint", linehl = "", numhl = "DapLogPoint" })
|
||||
vim.fn.sign_define("DapStopped", { text = "", texthl = "DapStopped", linehl = "", numhl = "DapStopped" })
|
||||
|
||||
dap.adapters.gdb = {
|
||||
type = "executable",
|
||||
command = "gdb",
|
||||
args = { "-i", "dap" },
|
||||
}
|
||||
|
||||
dap.adapters.lldb = {
|
||||
type = "executable",
|
||||
command = "lldb-vscode", -- adjust as needed, must be absolute path
|
||||
name = "lldb",
|
||||
}
|
||||
|
||||
local lldb_config = {
|
||||
name = "Launch",
|
||||
type = "lldb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
|
||||
end,
|
||||
cwd = "${workspaceFolder}",
|
||||
}
|
||||
|
||||
local lldb_attach_config = {
|
||||
name = "Attach to process",
|
||||
type = "lldb", -- Adjust this to match your adapter name (`dap.adapters.<name>`)
|
||||
request = "attach",
|
||||
pid = require("dap.utils").pick_process,
|
||||
args = {},
|
||||
}
|
||||
|
||||
local rust_config = vim.tbl_deep_extend("force", lldb_config, {
|
||||
program = function()
|
||||
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/target/debug/", "file")
|
||||
end,
|
||||
})
|
||||
|
||||
dap.configurations.c = {
|
||||
lldb_config,
|
||||
lldb_attach_config
|
||||
}
|
||||
|
||||
dap.configurations.rust = { rust_config, lldb_attach_config }
|
||||
|
||||
dap.adapters.delve = {
|
||||
type = 'server',
|
||||
port = '${port}',
|
||||
executable = {
|
||||
command = 'dlv',
|
||||
args = {'dap', '-l', '127.0.0.1:${port}'},
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
require("gitsigns").setup()
|
||||
require("nvim-web-devicons").setup()
|
||||
require("colorizer").setup {}
|
||||
require("todo-comments").setup()
|
||||
require("tmux").setup {
|
||||
resize = {
|
||||
enable_default_keybindings = true,
|
||||
resize_step_x = 4,
|
||||
resize_step_y = 2,
|
||||
},
|
||||
navigation = {
|
||||
enable_default_keybindings = true,
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
vim.keymap.set("n", "<leader>gg", ":LazyGit<CR>", { silent = true })
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
local colors = require("catppuccin.palettes.mocha")
|
||||
local highlight = {
|
||||
"RainbowRed",
|
||||
"RainbowYellow",
|
||||
"RainbowBlue",
|
||||
"RainbowOrange",
|
||||
"RainbowGreen",
|
||||
"RainbowViolet",
|
||||
"RainbowCyan",
|
||||
}
|
||||
local hooks = require("ibl.hooks")
|
||||
-- create the highlight groups in the highlight setup hook, so they are reset
|
||||
-- every time the colorscheme changes
|
||||
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
|
||||
vim.api.nvim_set_hl(0, "RainbowRed", { fg = colors.red })
|
||||
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = colors.yellow })
|
||||
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = colors.blue })
|
||||
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = colors.peach })
|
||||
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = colors.green })
|
||||
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = colors.mauve })
|
||||
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = colors.teal })
|
||||
end)
|
||||
|
||||
vim.g.rainbow_delimiters = { highlight = highlight }
|
||||
|
||||
require("ibl").setup {
|
||||
scope = {
|
||||
highlight = highlight,
|
||||
},
|
||||
indent = {
|
||||
highlight = highlight,
|
||||
char = "▎",
|
||||
tab_char = "▍",
|
||||
},
|
||||
}
|
||||
|
||||
hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
local lspconfig = require("lspconfig")
|
||||
local null_ls = require("null-ls")
|
||||
local cmp_lsp = require("cmp_nvim_lsp")
|
||||
require("neodev").setup()
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
-- Add com_nvim_lsp capabilities
|
||||
local cmp_lsp_capabilities = cmp_lsp.default_capabilities()
|
||||
capabilities = vim.tbl_deep_extend("keep", capabilities, cmp_lsp_capabilities)
|
||||
|
||||
|
||||
vim.fn.sign_define("DiagnosticSignError", { text = " ", texthl = "DiagnosticSignError" })
|
||||
vim.fn.sign_define("DiagnosticSignWarn", { text = "", texthl = "DiagnosticSignWarn" })
|
||||
vim.fn.sign_define("DiagnosticSignInfo", { text = "", texthl = "DiagnosticSignInfo" })
|
||||
vim.fn.sign_define("DiagnosticSignHint", { text = "", texthl = "DiagnosticSignHint" })
|
||||
--
|
||||
-- Diagnostic keymaps
|
||||
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { desc = "Go to previous diagnostic message" })
|
||||
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Go to next diagnostic message" })
|
||||
vim.keymap.set("n", "<leader>xd", vim.diagnostic.open_float, { desc = "Open floating diagnostic message" })
|
||||
vim.keymap.set("n", "<leader>xl", vim.diagnostic.setloclist, { desc = "Open diagnostics list" })
|
||||
|
||||
null_ls.setup {
|
||||
sources = {
|
||||
null_ls.builtins.code_actions.shellcheck,
|
||||
null_ls.builtins.code_actions.gitsigns,
|
||||
null_ls.builtins.completion.spell,
|
||||
null_ls.builtins.diagnostics.eslint,
|
||||
null_ls.builtins.diagnostics.ruff,
|
||||
null_ls.builtins.diagnostics.static,
|
||||
null_ls.builtins.diagnostics.commitlint,
|
||||
null_ls.builtins.formatting.beautysh,
|
||||
null_ls.builtins.formatting.jq,
|
||||
null_ls.builtins.formatting.ruff,
|
||||
null_ls.builtins.formatting.stylua,
|
||||
},
|
||||
}
|
||||
|
||||
local servers = {
|
||||
["lua_ls"] = {},
|
||||
["tsserver"] = {},
|
||||
["gopls"] = {
|
||||
settings = {
|
||||
gopls = {
|
||||
gofumpt = true,
|
||||
staticcheck = true,
|
||||
completeUnimported = true,
|
||||
usePlaceholders = true,
|
||||
analyses = {
|
||||
unusedparams = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
["emmet_ls"] = {},
|
||||
["html"] = {},
|
||||
["pyright"] = {},
|
||||
["ruff_lsp"] = {},
|
||||
--["nil_ls"] = {},
|
||||
["nixd"] = {},
|
||||
["rnix"] = {},
|
||||
["bashls"] = {},
|
||||
["taplo"] = {},
|
||||
["sqlls"] = {},
|
||||
["clangd"] = {},
|
||||
["postgres_lsp"] = {},
|
||||
}
|
||||
|
||||
for k, v in pairs(servers) do
|
||||
lspconfig[k].setup(vim.tbl_deep_extend("force", {
|
||||
capabilities = capabilities,
|
||||
diagnostic = {
|
||||
virtual_text = true,
|
||||
severity_sort = true,
|
||||
},
|
||||
}, v))
|
||||
end
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
local colors = require("catppuccin.palettes").get_palette "mocha"
|
||||
|
||||
require("lualine").setup {
|
||||
sections = {
|
||||
lualine_a = { "", { "mode" } },
|
||||
lualine_b = {
|
||||
{ "branch" },
|
||||
{ "diff" },
|
||||
},
|
||||
lualine_c = {
|
||||
{ "filetype", icon_only = true },
|
||||
{ "filename" },
|
||||
{ "diagnostics" },
|
||||
{
|
||||
"lsp_progress",
|
||||
display_components = { "lsp_client_name", { "title", "percentage", "message" } },
|
||||
colors = {
|
||||
percentage = colors.blue,
|
||||
title = colors.blue,
|
||||
message = colors.blue,
|
||||
spinner = colors.blue,
|
||||
lsp_client_name = colors.teal,
|
||||
use = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
lualine_x = {},
|
||||
lualine_y = {
|
||||
{ "encoding" },
|
||||
{ "fileformat" },
|
||||
},
|
||||
lualine_z = {
|
||||
{ "progress" },
|
||||
},
|
||||
},
|
||||
winbar = {
|
||||
lualine_x = {
|
||||
{ "filename", path = 1 },
|
||||
{ "filetype", icon_only = true },
|
||||
},
|
||||
},
|
||||
inactive_winbar = {
|
||||
lualine_x = {
|
||||
{ "diagnostics" },
|
||||
{ "filename", path = 1 },
|
||||
{ "filetype", icon_only = true },
|
||||
},
|
||||
},
|
||||
extensions = { "fugitive", "lazy", "man", "neo-tree", "nvim-dap-ui", "quickfix" },
|
||||
options = {
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {
|
||||
"help",
|
||||
"lazy",
|
||||
"neo-tree",
|
||||
"dapui_stacks",
|
||||
"dapui_watches",
|
||||
"dapui_breakpoints",
|
||||
"dapui_scopes",
|
||||
"dapui_console",
|
||||
"dap-repl",
|
||||
"fugitive",
|
||||
},
|
||||
},
|
||||
theme = "catppuccin",
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
--[[
|
||||
require("mini.move").setup {
|
||||
mappings = {
|
||||
-- Move visual selection in Visual mode. Defaults are Alt (Meta) + hjkl.
|
||||
left = "<M-H>",
|
||||
right = "<M-L>",
|
||||
down = "<M-J>",
|
||||
up = "<M-K>",
|
||||
|
||||
-- Move current line in Normal mode
|
||||
line_left = "<M-H>",
|
||||
line_right = "<M-L>",
|
||||
line_down = "<M-J>",
|
||||
line_up = "<M-K>",
|
||||
},
|
||||
}
|
||||
require("mini.pairs").setup()
|
||||
]]--
|
||||
require("mini.comment").setup()
|
||||
require("mini.cursorword").setup()
|
||||
require("mini.surround").setup {
|
||||
custom_surroundings = {
|
||||
["("] = { output = { left = "( ", right = " )" } },
|
||||
["["] = { output = { left = "[ ", right = " ]" } },
|
||||
["{"] = { output = { left = "{ ", right = " }" } },
|
||||
["<"] = { output = { left = "< ", right = " >" } },
|
||||
},
|
||||
mappings = {
|
||||
add = "ys",
|
||||
delete = "ds",
|
||||
find = "fs",
|
||||
find_left = "Fs",
|
||||
highlight = "",
|
||||
replace = "cs",
|
||||
update_n_lines = "",
|
||||
},
|
||||
search_method = "cover_or_next",
|
||||
}
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
local neotree = require("neo-tree")
|
||||
local dap = require("dap")
|
||||
|
||||
dap.listeners.before.attach.dapui_config = function()
|
||||
require("neo-tree.command").execute { action = "close" }
|
||||
end
|
||||
dap.listeners.before.launch.dapui_config = function()
|
||||
require("neo-tree.command").execute { action = "close" }
|
||||
end
|
||||
|
||||
neotree.setup {
|
||||
enable_git_status = true,
|
||||
enable_diagnostics = true,
|
||||
source_selector = {
|
||||
winbar = true,
|
||||
statusline = false,
|
||||
sources = {
|
||||
{ source = "filesystem", display_name = " Files" },
|
||||
{ source = "git_status", display_name = " Git" },
|
||||
},
|
||||
},
|
||||
filesystem = {
|
||||
hijack_netrw_behavior = "open_default",
|
||||
use_libuv_file_watcher = true,
|
||||
follow_current_file = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
default_component_configs = {
|
||||
icon = {
|
||||
folder_closed = "",
|
||||
folder_open = "",
|
||||
folder_empty = "",
|
||||
folder_empty_open = "",
|
||||
},
|
||||
git_status = {
|
||||
symbols = {
|
||||
-- Change type
|
||||
added = "✚", -- or "✚", but this is redundant info if you use git_status_colors on the name
|
||||
modified = "", -- or "", but this is redundant info if you use git_status_colors on the name
|
||||
deleted = "✖", -- this can only be used in the git_status source
|
||||
-- Status type
|
||||
untracked = "",
|
||||
ignored = "",
|
||||
staged = "",
|
||||
conflict = "",
|
||||
renamed = "",
|
||||
unstaged = "",
|
||||
},
|
||||
},
|
||||
diagnostics = {
|
||||
symbols = {
|
||||
hint = "",
|
||||
info = "",
|
||||
warn = "",
|
||||
error = "",
|
||||
},
|
||||
highlights = {
|
||||
hint = "DiagnosticSignHint",
|
||||
info = "DiagnosticSignInfo",
|
||||
warn = "DiagnosticSignWarn",
|
||||
error = "DiagnosticSignError",
|
||||
},
|
||||
},
|
||||
},
|
||||
document_symbols = {
|
||||
kinds = {
|
||||
File = { icon = "", hl = "Tag" },
|
||||
Namespace = { icon = "", hl = "Include" },
|
||||
Package = { icon = "", hl = "Label" },
|
||||
Class = { icon = "", hl = "Include" },
|
||||
Property = { icon = "", hl = "@property" },
|
||||
Enum = { icon = "", hl = "@number" },
|
||||
Function = { icon = "", hl = "Function" },
|
||||
String = { icon = "", hl = "String" },
|
||||
Number = { icon = "", hl = "Number" },
|
||||
Array = { icon = "", hl = "Type" },
|
||||
Object = { icon = "", hl = "Type" },
|
||||
Key = { icon = "", hl = "" },
|
||||
Struct = { icon = "", hl = "Type" },
|
||||
Operator = { icon = "", hl = "Operator" },
|
||||
TypeParameter = { icon = "", hl = "Type" },
|
||||
StaticMethod = { icon = " ", hl = "Function" },
|
||||
},
|
||||
},
|
||||
hover = {
|
||||
enabled = true,
|
||||
delay = 200,
|
||||
},
|
||||
event_handlers = {
|
||||
{
|
||||
event = "file_opened",
|
||||
handler = function(_)
|
||||
require("neo-tree.command").execute { action = "close" }
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
vim.keymap.set("n", "<leader>e", function()
|
||||
vim.cmd.Neotree("toggle")
|
||||
end, { desc = "Toggle File explorer" })
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
local neorg = require("neorg")
|
||||
|
||||
local workspace_root = vim.env.NORG_ROOT
|
||||
if workspace_root == nil then
|
||||
workspace_root = "~/Sync/norg"
|
||||
end
|
||||
|
||||
neorg.setup {
|
||||
load = {
|
||||
["core.defaults"] = {}, -- Loads default behaviour
|
||||
["core.concealer"] = {
|
||||
config = {
|
||||
init_open_folds = "auto",
|
||||
},
|
||||
}, -- Adds pretty icons to your documents
|
||||
["core.dirman"] = { -- Manages Neorg workspaces
|
||||
config = {
|
||||
workspaces = {
|
||||
notes = workspace_root .. "/notes",
|
||||
},
|
||||
default_workspace = "notes",
|
||||
},
|
||||
},
|
||||
["core.completion"] = {
|
||||
config = {
|
||||
engine = "nvim-cmp",
|
||||
},
|
||||
},
|
||||
["core.summary"] = {},
|
||||
["core.manoeuvre"] = {},
|
||||
["core.tangle"] = {},
|
||||
["core.export"] = {
|
||||
config = {
|
||||
export_dir = "~/Sync/notes-export",
|
||||
},
|
||||
},
|
||||
["core.export.markdown"] = {},
|
||||
["core.esupports.metagen"] = {
|
||||
config = {
|
||||
type = "auto",
|
||||
},
|
||||
},
|
||||
--["core.ui.calendar"] = {}, -- Available with nvim 0.10+
|
||||
["core.integrations.telescope"] = {},
|
||||
},
|
||||
}
|
||||
|
||||
vim.keymap.set("n", "<leader>ni", function()
|
||||
vim.cmd.Neorg("index")
|
||||
end, { desc = "Toggle Notes" })
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
local opts = {
|
||||
cmdline = {
|
||||
view = "cmdline",
|
||||
},
|
||||
lsp = {
|
||||
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
["cmp.entry.get_documentation"] = true,
|
||||
},
|
||||
},
|
||||
-- you can enable a preset for easier configuration
|
||||
presets = {
|
||||
bottom_search = true, -- use a classic bottom cmdline for search
|
||||
command_palette = true, -- position the cmdline and popupmenu together
|
||||
long_message_to_split = true, -- long messages will be sent to a split
|
||||
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
||||
lsp_doc_border = false, -- add a border to hover docs and signature help
|
||||
},
|
||||
}
|
||||
require("noice").setup(opts)
|
||||
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
local builtin = require("telescope.builtin")
|
||||
local telescope_config = require("telescope.config")
|
||||
|
||||
-- Clone the default Telescope configuration
|
||||
local vimgrep_arguments = { unpack(telescope_config.values.vimgrep_arguments) }
|
||||
|
||||
-- I want to search in hidden/dot files.
|
||||
table.insert(vimgrep_arguments, "--hidden")
|
||||
-- I don't want to search in the `.git` directory.
|
||||
table.insert(vimgrep_arguments, "--glob")
|
||||
table.insert(vimgrep_arguments, "!**/.git/*")
|
||||
|
||||
|
||||
local is_inside_work_tree = {}
|
||||
local project_files = function()
|
||||
local opts = {} -- define here if you want to define something
|
||||
|
||||
local cwd = vim.fn.getcwd()
|
||||
if is_inside_work_tree[cwd] == nil then
|
||||
vim.fn.system("git rev-parse --is-inside-work-tree")
|
||||
is_inside_work_tree[cwd] = vim.v.shell_error == 0
|
||||
end
|
||||
|
||||
if is_inside_work_tree[cwd] then
|
||||
builtin.git_files(opts)
|
||||
else
|
||||
builtin.find_files(opts)
|
||||
end
|
||||
end
|
||||
|
||||
telescope.setup {
|
||||
defaults = {
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
entry_prefix = " ",
|
||||
initial_mode = "insert",
|
||||
selection_strategy = "reset",
|
||||
sorting_strategy = "ascending",
|
||||
layout_strategy = "horizontal",
|
||||
vimgrep_arguments = vimgrep_arguments,
|
||||
layout_config = {
|
||||
horizontal = {
|
||||
prompt_position = "top",
|
||||
preview_width = 0.55,
|
||||
results_width = 0.8,
|
||||
},
|
||||
vertical = {
|
||||
mirror = true,
|
||||
},
|
||||
width = 0.87,
|
||||
height = 0.80,
|
||||
preview_cutoff = 120,
|
||||
},
|
||||
file_ignore_patterns = { "node_modules", "vendor" },
|
||||
path_display = { "truncate" },
|
||||
winblend = 3,
|
||||
border = {},
|
||||
borderchars = { " ", " ", " ", " ", " ", " ", " ", " " },
|
||||
color_devicons = true,
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true, -- false will only do exact matching
|
||||
override_generic_sorter = true, -- override the generic sorter
|
||||
override_file_sorter = true, -- override the file sorter
|
||||
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
|
||||
},
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown({})
|
||||
}
|
||||
},
|
||||
mappings = {
|
||||
i = {
|
||||
["<esc>"] = actions.close
|
||||
},
|
||||
},
|
||||
pickers = {
|
||||
find_files = {
|
||||
-- `hidden = true` will still show the inside of `.git/` as it's not `.gitignore`d.
|
||||
find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- Enable telescope fzf native, if installed
|
||||
telescope.load_extension("fzf")
|
||||
telescope.load_extension("noice")
|
||||
telescope.load_extension("dap")
|
||||
telescope.load_extension("ui-select")
|
||||
--
|
||||
-- See `:help telescope.builtin`
|
||||
vim.keymap.set("n", "<leader>fo", builtin.oldfiles, { desc = "Find recently opened files" })
|
||||
vim.keymap.set("n", "<leader>fb", builtin.buffers, { desc = "] Find existing buffers" })
|
||||
vim.keymap.set("n", "<leader>gf", builtin.git_files, { desc = "Search Git Files" })
|
||||
vim.keymap.set("n", "<leader>ff", project_files, { desc = "Search Files" })
|
||||
vim.keymap.set("n", "<leader>sh", builtin.help_tags, { desc = "Search Help" })
|
||||
vim.keymap.set("n", "<leader>fG", builtin.grep_string, { desc = "Search current Word" })
|
||||
vim.keymap.set("n", "<leader>fg", builtin.live_grep, { desc = "Search by Grep" })
|
||||
vim.keymap.set("n", "<leader>sd", builtin.diagnostics, { desc = "Search Diagnostics" })
|
||||
vim.keymap.set("n", "<leader>fr", builtin.resume, { desc = "Search Resume" })
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
require("nvim-treesitter.configs").setup {
|
||||
auto_install = false,
|
||||
sync_install = false,
|
||||
ignore_install = {},
|
||||
modules = {},
|
||||
ensure_installed = {},
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["af"] = {
|
||||
query = "@function.outer",
|
||||
desc = "Select outer part of a function region",
|
||||
},
|
||||
["if"] = {
|
||||
query = "@function.inner",
|
||||
desc = "Select outer part of a function region",
|
||||
},
|
||||
["ac"] = { query = "@class.outer", "Select outer part of a class region" },
|
||||
["ic"] = {
|
||||
query = "@class.inner",
|
||||
desc = "Select inner part of a class region",
|
||||
},
|
||||
["as"] = {
|
||||
query = "@scope",
|
||||
query_group = "locals",
|
||||
desc = "Select language scope",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
require("trouble").setup()
|
||||
|
||||
vim.keymap.set("n", "<leader>xx", vim.cmd.TroubleToggle, { desc = "Open Diagnostics" })
|
||||
vim.keymap.set("n", "<leader>xw", function()
|
||||
vim.cmd.TroubleToggle("workspace_diagnostics")
|
||||
end, { desc = "Open Workspace Trouble" })
|
||||
vim.keymap.set("n", "<leader>xd", function()
|
||||
vim.cmd.TroubleToggle("document_diagnostics")
|
||||
end, { desc = "Open Document Trouble" })
|
||||
vim.keymap.set("n", "<leader>xq", function()
|
||||
vim.cmd.TroubleToggle("quickfix")
|
||||
end, { desc = "Open Quickfix Trouble" })
|
||||
vim.keymap.set("n", "<leader>xl", function()
|
||||
vim.cmd.TroubleToggle("loclist")
|
||||
end, { desc = "Open Loclist Trouble" })
|
||||
vim.keymap.set("n", "gR", function()
|
||||
vim.cmd.TroubleToggle("lsp_references")
|
||||
end, { desc = "Open Loclist Trouble" })
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
require("which-key").register {
|
||||
["<leader>c"] = { name = "Code", _ = "which_key_ignore" },
|
||||
["<leader>d"] = { name = "Document", _ = "which_key_ignore" },
|
||||
["<leader>g"] = { name = "Git", _ = "which_key_ignore" },
|
||||
["<leader>h"] = { name = "More git", _ = "which_key_ignore" },
|
||||
["<leader>r"] = { name = "Rename", _ = "which_key_ignore" },
|
||||
["<leader>s"] = { name = "Search", _ = "which_key_ignore" },
|
||||
["<leader>f"] = { name = "Find", _ = "which_key_ignore" },
|
||||
}
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
{ pkgs, inputs, ... }:
|
||||
let
|
||||
nvimLib = pkgs.callPackage ../nix/lib { };
|
||||
inherit (nvimLib) mkNeovimPlugin;
|
||||
vimPlugins = pkgs.vimPlugins;
|
||||
|
||||
lsp = with vimPlugins; [
|
||||
nvim-lspconfig
|
||||
lspkind-nvim
|
||||
nvim-lightbulb
|
||||
neodev-nvim
|
||||
none-ls-nvim
|
||||
];
|
||||
|
||||
cmp = with vimPlugins; [
|
||||
cmp-buffer
|
||||
cmp-cmdline
|
||||
cmp-nvim-lsp
|
||||
cmp-nvim-lsp-signature-help
|
||||
cmp-path
|
||||
cmp_luasnip
|
||||
friendly-snippets
|
||||
luasnip
|
||||
nvim-cmp
|
||||
];
|
||||
|
||||
telescope = with vimPlugins; [
|
||||
telescope-dap-nvim
|
||||
telescope-fzf-native-nvim
|
||||
telescope-nvim
|
||||
telescope-ui-select-nvim
|
||||
];
|
||||
|
||||
dap = with vimPlugins; [
|
||||
nvim-dap
|
||||
nvim-dap-python
|
||||
nvim-dap-ui
|
||||
nvim-dap-virtual-text
|
||||
];
|
||||
|
||||
treesitter = with vimPlugins; [
|
||||
nvim-treesitter-textobjects
|
||||
nvim-treesitter-textsubjects
|
||||
nvim-treesitter.withAllGrammars
|
||||
];
|
||||
|
||||
neorg-nvim = with vimPlugins; [
|
||||
neorg
|
||||
neorg-telescope
|
||||
];
|
||||
|
||||
rust = with vimPlugins; [
|
||||
rustaceanvim
|
||||
crates-nvim
|
||||
];
|
||||
|
||||
go = with vimPlugins; [
|
||||
nvim-dap-go
|
||||
(mkNeovimPlugin inputs.gopher-nvim "gopher.nvim")
|
||||
];
|
||||
|
||||
general = with vimPlugins; [
|
||||
catppuccin-nvim
|
||||
gitsigns-nvim
|
||||
indent-blankline-nvim
|
||||
lazygit-nvim
|
||||
lualine-lsp-progress
|
||||
lualine-nvim
|
||||
mini-nvim
|
||||
neo-tree-nvim
|
||||
noice-nvim
|
||||
nvim-colorizer-lua
|
||||
nvim-lastplace
|
||||
nvim-web-devicons
|
||||
rainbow-delimiters-nvim
|
||||
tmux-nvim
|
||||
todo-comments-nvim
|
||||
trouble-nvim
|
||||
undotree
|
||||
vim-table-mode
|
||||
which-key-nvim
|
||||
];
|
||||
|
||||
plugins = builtins.concatLists [
|
||||
general
|
||||
lsp
|
||||
telescope
|
||||
dap
|
||||
treesitter
|
||||
cmp
|
||||
neorg-nvim
|
||||
rust
|
||||
go
|
||||
];
|
||||
in
|
||||
plugins
|
||||
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{ pkgs, lib, stdenv, ... }: {
|
||||
mkNeovim = pkgs.callPackage ./mkNeovim.nix { };
|
||||
mkNeovimConfig = import ./mkNeovimConfig.nix { inherit pkgs lib stdenv; };
|
||||
mkNeovimPlugin = pkgs.callPackage ./mkNeovimPlugin.nix { };
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
{ pkgs, ... }:
|
||||
pkgs.wrapNeovimUnstable pkgs.neovim-unwrapped
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
{ pkgs
|
||||
, lib
|
||||
, stdenv
|
||||
, ...
|
||||
}:
|
||||
with lib;
|
||||
{ runtimepath ? ../../nvim
|
||||
, viAlias ? true
|
||||
, vimAlias ? true
|
||||
, withPython3 ? true
|
||||
, extraPackages ? [ ]
|
||||
, extraPython3Packages ? (_: [ ])
|
||||
, withNodeJs ? false
|
||||
, withRuby ? true
|
||||
, extraLuaPackages ? (_: [ ])
|
||||
, plugins ? [ ]
|
||||
, customLuaRcContent ? ""
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
rtp = stdenv.mkDerivation {
|
||||
name = "neovim-runtimepath";
|
||||
src = runtimepath;
|
||||
|
||||
buildPhase = ''
|
||||
mkdir -p $out/nvim
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
cp -r * $out/nvim
|
||||
'';
|
||||
};
|
||||
|
||||
luaRcContent =
|
||||
''
|
||||
vim.opt.runtimepath:prepend('${rtp}/nvim')
|
||||
vim.opt.runtimepath:append('${rtp}/nvim/after')
|
||||
'';
|
||||
|
||||
neovim = pkgs.neovimUtils.makeNeovimConfig {
|
||||
inherit extraPython3Packages withPython3 withRuby withNodeJs viAlias vimAlias
|
||||
plugins luaRcContent;
|
||||
};
|
||||
|
||||
makeWrapperArgs =
|
||||
let
|
||||
binPath = lib.makeBinPath (
|
||||
lib.optionals
|
||||
(extraPackages
|
||||
!= [ ])
|
||||
extraPackages);
|
||||
in
|
||||
[ ] ++
|
||||
lib.optionals (binPath != "") [
|
||||
"--suffix"
|
||||
"PATH"
|
||||
":"
|
||||
binPath
|
||||
];
|
||||
in
|
||||
neovim // { wrapperArgs = makeWrapperArgs; }
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{ pkgs, ... }:
|
||||
src: pname:
|
||||
pkgs.vimUtils.buildVimPlugin {
|
||||
inherit pname src;
|
||||
version = src.lastModifiedDate;
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
{ inputs, ... }: final: prev:
|
||||
let
|
||||
pkgs = final;
|
||||
in
|
||||
{
|
||||
neovim-ide = pkgs.callPackage ../neovim-ide { inherit inputs; };
|
||||
neovim-nightly = pkgs.callPackage ../neovim-nightly { inherit inputs; };
|
||||
}
|
||||
Reference in New Issue