various improvements
This commit is contained in:
parent
5e1a70ca49
commit
8de5c50daa
14 changed files with 185 additions and 167 deletions
|
|
@ -1,48 +0,0 @@
|
|||
local filetypes = require("core.filetypes")
|
||||
local configurer = require("utils.configurer")
|
||||
local opts = {}
|
||||
|
||||
if vim.g.vscode then
|
||||
-- VSCode Neovim
|
||||
opts.spec = "vscode.plugins"
|
||||
opts.options = require("vscode.options")
|
||||
opts.keymaps = require("vscode.keymaps")
|
||||
else
|
||||
-- Normal Neovim
|
||||
opts.spec = "plugins"
|
||||
opts.options = require("core.options")
|
||||
opts.keymaps = require("core.keymaps")
|
||||
opts.autocmd = require("core.autocmd")
|
||||
opts.signs = require("core.signs")
|
||||
end
|
||||
|
||||
configurer.setup(opts)
|
||||
|
||||
local handlers = require("lsp.handlers") -- Adjust the path as necessary
|
||||
|
||||
local function setup_all_servers()
|
||||
for server, setup_fn in pairs(handlers) do
|
||||
if type(setup_fn) == "function" then
|
||||
-- Call the setup function for each server
|
||||
setup_fn()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
setup_all_servers()
|
||||
|
||||
vim.keymap.set("n", "<left>", '<cmd>echo "Use h to move!!"<CR>')
|
||||
vim.keymap.set("n", "<right>", '<cmd>echo "Use l to move!!"<CR>')
|
||||
vim.keymap.set("n", "<up>", '<cmd>echo "Use k to move!!"<CR>')
|
||||
vim.keymap.set("n", "<down>", '<cmd>echo "Use j to move!!"<CR>')
|
||||
|
||||
vim.keymap.set("i", "<left>", '<cmd>echo "Use h to move!!"<CR>')
|
||||
vim.keymap.set("i", "<right>", '<cmd>echo "Use l to move!!"<CR>')
|
||||
vim.keymap.set("i", "<up>", '<cmd>echo "Use k to move!!"<CR>')
|
||||
vim.keymap.set("i", "<down>", '<cmd>echo "Use j to move!!"<CR>')
|
||||
-- Neovide config
|
||||
vim.o.guifont = "Iosevka Nerd Font Mono:h14"
|
||||
vim.g.neovide_transparency = 0.75
|
||||
|
||||
-- vim.lsp.log.set_level(vim.lsp.log_levels.INFO)
|
||||
vim.filetype.add(filetypes)
|
||||
|
|
@ -27,9 +27,9 @@ return {
|
|||
}:
|
||||
with lib;
|
||||
with lib.custom; let
|
||||
cfg = config.{<>};
|
||||
cfg = config.<>;
|
||||
in {
|
||||
options.{<>} = with types; {
|
||||
options.<> = with types; {
|
||||
enable = mkBoolOpt false "<>";
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -11,9 +11,17 @@ return {
|
|||
},
|
||||
opts = {
|
||||
defaults = {
|
||||
border = true,
|
||||
prompt_prefix = " ",
|
||||
selection_caret = format("Right", ""),
|
||||
prompt_prefix = ">",
|
||||
selection_caret = ">",
|
||||
path_display = { "truncate" },
|
||||
sorting_strategy = "ascending",
|
||||
layout_config = {
|
||||
horizontal = { prompt_position = "top", preview_width = 0.55 },
|
||||
vertical = { mirror = false },
|
||||
width = 0.87,
|
||||
height = 0.80,
|
||||
preview_cutoff = 120,
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
fzf = {},
|
||||
|
|
|
|||
|
|
@ -35,6 +35,18 @@ return {
|
|||
CmpItemKindOperator = { fg = C.base, bg = C.blue },
|
||||
CmpItemKindTypeParameter = { fg = C.base, bg = C.blue },
|
||||
CmpItemKindCopilot = { fg = C.base, bg = C.teal },
|
||||
TelescopeBorder = { fg = C.base, bg = C.base },
|
||||
TelescopeNormal = { bg = C.base },
|
||||
TelescopePreviewBorder = { fg = C.base, bg = C.base },
|
||||
TelescopePreviewNormal = { bg = C.base },
|
||||
TelescopePreviewTitle = { fg = C.base, bg = C.green },
|
||||
TelescopePromptBorder = { fg = C.surface0, bg = C.surface0 },
|
||||
TelescopePromptNormal = { fg = C.blue, bg = C.surface0 },
|
||||
TelescopePromptPrefix = { fg = C.red, bg = C.surface0 },
|
||||
TelescopePromptTitle = { fg = C.base, bg = C.red },
|
||||
TelescopeResultsBorder = { fg = C.base, bg = C.base },
|
||||
TelescopeResultsNormal = { bg = C.base },
|
||||
TelescopeResultsTitle = { fg = C.base, bg = C.base },
|
||||
}
|
||||
end,
|
||||
flavor = "mocha",
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ M.progress = {
|
|||
end,
|
||||
color = function()
|
||||
local colors = require("catppuccin.palettes").get_palette()
|
||||
return { fg = colors.lavender, bg = nil }
|
||||
return { fg = colors.lavender, bg = colors.base }
|
||||
end,
|
||||
}
|
||||
|
||||
|
|
@ -121,7 +121,7 @@ M.location = {
|
|||
end,
|
||||
color = function()
|
||||
local colors = require("catppuccin.palettes").get_palette()
|
||||
return { fg = colors.lavender, bg = nil }
|
||||
return { fg = colors.lavender, bg = colors.base }
|
||||
end,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,24 @@ with lib;
|
|||
with lib.custom; let
|
||||
cfg = config.apps.tools.neovim;
|
||||
|
||||
nvimDir = "/home/${config.home.username}/nixos/modules/home/apps/tools/neovim";
|
||||
lazy-nix-helper-nvim = pkgs.vimUtils.buildVimPlugin {
|
||||
name = "lazy-nix-helper.nvim";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "b-src";
|
||||
repo = "lazy-nix-helper.nvim";
|
||||
rev = "63b20ed071647bb492ed3256fbda709e4bfedc45";
|
||||
hash = "sha256-TBDZGj0NXkWvJZJ5ngEqbhovf6RPm9N+Rmphz92CS3Q=";
|
||||
};
|
||||
};
|
||||
|
||||
sanitizePluginName = input: let
|
||||
name = strings.getName input;
|
||||
intermediate = strings.removePrefix "vimplugin-" name;
|
||||
result = strings.removePrefix "lua5.1-" intermediate;
|
||||
in
|
||||
result;
|
||||
|
||||
pluginList = plugins: strings.concatMapStrings (plugin: " [\"${sanitizePluginName plugin.name}\"] = \"${plugin.outPath}\",\n") plugins;
|
||||
in {
|
||||
options.apps.tools.neovim = with types; {
|
||||
enable = mkBoolOpt false "Enable Neovim";
|
||||
|
|
@ -54,8 +71,9 @@ in {
|
|||
gerbera
|
||||
vscode-extensions.vadimcn.vscode-lldb.adapter
|
||||
];
|
||||
plugins = [
|
||||
pkgs.vimPlugins.lazy-nvim # All other plugins are managed by lazy-nvim
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
lazy-nix-helper-nvim
|
||||
lazy-nvim
|
||||
];
|
||||
extraLuaPackages = with pkgs; [
|
||||
lua51Packages.lua-curl
|
||||
|
|
@ -63,36 +81,102 @@ in {
|
|||
lua51Packages.xml2lua
|
||||
lua51Packages.mimetypes
|
||||
];
|
||||
extraLuaConfig = ''
|
||||
local plugins = {
|
||||
${pluginList config.programs.neovim.plugins}
|
||||
}
|
||||
local lazy_nix_helper_path = "${lazy-nix-helper-nvim}"
|
||||
if not vim.loop.fs_stat(lazy_nix_helper_path) then
|
||||
lazy_nix_helper_path = vim.fn.stdpath("data") .. "/lazy_nix_helper/lazy_nix_helper.nvim"
|
||||
if not vim.loop.fs_stat(lazy_nix_helper_path) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/b-src/lazy_nix_helper.nvim.git",
|
||||
lazy_nix_helper_path,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
-- add the Lazy Nix Helper plugin to the vim runtime
|
||||
vim.opt.rtp:prepend(lazy_nix_helper_path)
|
||||
|
||||
-- call the Lazy Nix Helper setup function
|
||||
local non_nix_lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
local lazy_nix_helper_opts = { lazypath = non_nix_lazypath, input_plugin_table = plugins }
|
||||
require("lazy-nix-helper").setup(lazy_nix_helper_opts)
|
||||
|
||||
-- get the lazypath from Lazy Nix Helper
|
||||
local lazypath = require("lazy-nix-helper").lazypath()
|
||||
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)
|
||||
|
||||
local filetypes = require("core.filetypes")
|
||||
local configurer = require("utils.configurer")
|
||||
local opts = {}
|
||||
|
||||
if vim.g.vscode then
|
||||
-- VSCode Neovim
|
||||
opts.spec = "vscode.plugins"
|
||||
opts.options = require("vscode.options")
|
||||
opts.keymaps = require("vscode.keymaps")
|
||||
else
|
||||
-- Normal Neovim
|
||||
opts.spec = "plugins"
|
||||
opts.options = require("core.options")
|
||||
opts.keymaps = require("core.keymaps")
|
||||
opts.autocmd = require("core.autocmd")
|
||||
opts.signs = require("core.signs")
|
||||
end
|
||||
|
||||
configurer.setup(opts)
|
||||
|
||||
local handlers = require("lsp.handlers") -- Adjust the path as necessary
|
||||
|
||||
local function setup_all_servers()
|
||||
for server, setup_fn in pairs(handlers) do
|
||||
if type(setup_fn) == "function" then
|
||||
-- Call the setup function for each server
|
||||
setup_fn()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
setup_all_servers()
|
||||
|
||||
vim.keymap.set("n", "<left>", '<cmd>echo "Use h to move!!"<CR>')
|
||||
vim.keymap.set("n", "<right>", '<cmd>echo "Use l to move!!"<CR>')
|
||||
vim.keymap.set("n", "<up>", '<cmd>echo "Use k to move!!"<CR>')
|
||||
vim.keymap.set("n", "<down>", '<cmd>echo "Use j to move!!"<CR>')
|
||||
|
||||
vim.keymap.set("i", "<left>", '<cmd>echo "Use h to move!!"<CR>')
|
||||
vim.keymap.set("i", "<right>", '<cmd>echo "Use l to move!!"<CR>')
|
||||
vim.keymap.set("i", "<up>", '<cmd>echo "Use k to move!!"<CR>')
|
||||
vim.keymap.set("i", "<down>", '<cmd>echo "Use j to move!!"<CR>')
|
||||
-- Neovide config
|
||||
vim.o.guifont = "Iosevka Nerd Font Mono:h14"
|
||||
vim.g.neovide_transparency = 0.75
|
||||
|
||||
-- vim.lsp.log.set_level(vim.lsp.log_levels.INFO)
|
||||
vim.filetype.add(filetypes)
|
||||
'';
|
||||
};
|
||||
|
||||
xdg.configFile = {
|
||||
# Raw symlink to the plugin manager lock file, so that it stays writeable
|
||||
"nvim/lazy-lock.json".source = config.lib.file.mkOutOfStoreSymlink "${nvimDir}/lazy-lock.json";
|
||||
"nvim" = {
|
||||
source = ./config;
|
||||
recursive = true;
|
||||
};
|
||||
};
|
||||
|
||||
# home.activation.neovim = hm.dag.entryAfter ["linkGeneration"] ''
|
||||
# #! /bin/bash
|
||||
# NVIM_WRAPPER=~/.nix-profile/bin/nvim
|
||||
# STATE_DIR=~/.local/state/nix/
|
||||
# STATE_FILE=$STATE_DIR/lazy-lock-checksum
|
||||
# LOCK_FILE=~/.config/nvim/lazy-lock.json
|
||||
# HASH=$(nix-hash --flat $LOCK_FILE)
|
||||
# CURL_DIR=${pkgs.curl}
|
||||
#
|
||||
# [ ! -d $STATE_DIR ] && mkdir -p $STATE_DIR
|
||||
# [ ! -f $STATE_FILE ] && touch $STATE_FILE
|
||||
#
|
||||
# if [ "$(cat $STATE_FILE)" != "$HASH" ]; then
|
||||
# echo "Syncing neovim plugins"
|
||||
# PATH="$PATH:${pkgs.git}/bin" $DRY_RUN_CMD $NVIM_WRAPPER --headless "+Lazy! restore" +qa
|
||||
# $DRY_RUN_CMD echo $HASH >$STATE_FILE
|
||||
# else
|
||||
# $VERBOSE_ECHO "Neovim plugins already synced, skipping"
|
||||
# fi
|
||||
# '';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,73 +0,0 @@
|
|||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
|
||||
"LuaSnip": { "branch": "master", "commit": "de1a287c9cb525ae52bc846e8f6207e5ef1da5ac" },
|
||||
"alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" },
|
||||
"blame.nvim": { "branch": "main", "commit": "dedbcdce857f708c63f261287ac7491a893912d0" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "73edc1f2732678e7a681e3d3be49782610914f6b" },
|
||||
"catppuccin": { "branch": "main", "commit": "d97387aea8264f484bb5d5e74f2182a06c83e0d8" },
|
||||
"ccc.nvim": { "branch": "main", "commit": "f388f1981d222967c741fe9927edf9ba5fa3bcbe" },
|
||||
"charm-freeze.nvim": { "branch": "main", "commit": "3ad4dd739b97d92adb219a5752a8734fc8579055" },
|
||||
"clear-action.nvim": { "branch": "master", "commit": "2854c3fda5720c7e53b5a9537774fae212224484" },
|
||||
"cloak.nvim": { "branch": "main", "commit": "6e5bcd50bebc5cdb7cd3a00eb3d97ab7c4cc3b94" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"crates.nvim": { "branch": "main", "commit": "d556c00d60c9421c913ee54ff690df2a34f6264e" },
|
||||
"diffview.nvim": { "branch": "main", "commit": "0bae1a371ac68be86ead374ee2c4f36bd96bb6c6" },
|
||||
"document-color.nvim": { "branch": "main", "commit": "74c487f0e5accfaae033755451b9e367220693fd" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "3c38ac861e1b8d4077ff46a779cde17330b29f3a" },
|
||||
"dropbar.nvim": { "branch": "master", "commit": "9fc10fa1a34ec3e55b470962e4e94644611bd209" },
|
||||
"flash.nvim": { "branch": "main", "commit": "11a2e667d19d8f48c93c6ed2e2e525ac6b1b79be" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "dd2fd1281d4b22e7b4a5bfafa3e142d958e251f2" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "cdfcd9d39d23c46ae9a040de2c6a8b8bf868746e" },
|
||||
"guess-indent.nvim": { "branch": "main", "commit": "b8ae749fce17aa4c267eec80a6984130b94f80b2" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" },
|
||||
"lspkind-nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
|
||||
"move.nvim": { "branch": "main", "commit": "cccbd4ea9049ca5f99f025ffaddb7392359c7d6a" },
|
||||
"neo-rename.nvim": { "branch": "master", "commit": "d3f065ab1168fe95ea3ab939fbc659de47e130fc" },
|
||||
"neo-tree.nvim": { "branch": "main", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" },
|
||||
"neogit": { "branch": "master", "commit": "daebc4bc94bdcfa69d8d75c731878bff758e16fa" },
|
||||
"neovim-session-manager": { "branch": "master", "commit": "4376507a99af4a92c85263c30ab8efee0bb2857f" },
|
||||
"noice.nvim": { "branch": "main", "commit": "883cd5b638aef23d087c334940112d39ebff0aaa" },
|
||||
"nui.nvim": { "branch": "main", "commit": "b1b3dcd6ed8f355c78bad3d395ff645be5f8b6ae" },
|
||||
"null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "c15de7e7981f1111642e7e53799e1211d4606cb9" },
|
||||
"nvim-bufdel": { "branch": "main", "commit": "523d58e94e7212fff3e05c247b962dc8f93bcfde" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" },
|
||||
"nvim-dap": { "branch": "master", "commit": "c65c163daa47e0623dd85d2303fce0c22e52ad01" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "334cf3038c4756e6ab999cbac67c847fb654c190" },
|
||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "d7c695ea39542f6da94ee4d66176f5d660ab0a77" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "2c1877081b237a643e52ebdebaf36c84a2695639" },
|
||||
"nvim-nio": { "branch": "master", "commit": "632024157d01e8bc48fd7df6a7de8ffe3fdd4f3a" },
|
||||
"nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" },
|
||||
"nvim-surround": { "branch": "main", "commit": "79aaa42da1f698ed31bcbe7f83081f69dca7ba17" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "298a9dd4f8a0d95b347a7ebd301849d8b0e3917e" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "8ae54b90e36ef1fc5267214b30c2cbff71525fe4" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "cb064386e667def1d241317deed9fd1b38f0dc2e" },
|
||||
"nvim-ufo": { "branch": "main", "commit": "65dda6360879f6ffe0278163b9192a573a0d2a08" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "e37bb1feee9e7320c76050a55443fa843b4b6f83" },
|
||||
"overseer.nvim": { "branch": "master", "commit": "31f309692c9dd9162d3f63b5456a7932799c347c" },
|
||||
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
|
||||
"promise-async": { "branch": "main", "commit": "93540c168c5ed2b030ec3e6c40ab8bbb85e36355" },
|
||||
"rest.nvim": { "branch": "main", "commit": "f96edb54a2940322bc7ed81a1031be04db7d3a99" },
|
||||
"rustaceanvim": { "branch": "master", "commit": "a73e8618d8518b2a7434e1c21e4da4e66f21f738" },
|
||||
"schemastore.nvim": { "branch": "main", "commit": "9a5992a881583d886bfbb46631a09f736f0fae50" },
|
||||
"telescope-dap.nvim": { "branch": "master", "commit": "8c88d9716c91eaef1cdea13cb9390d8ef447dbfe" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "5665d93988acfbb0747bdbf4f4cb583bcebc8930" },
|
||||
"tiny-devicons-auto-colors.nvim": { "branch": "main", "commit": "699381f502a9c4e8d95925083765768545e994b4" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "fee58a0473fd92b28c34f8f724e4918b15ba30a3" },
|
||||
"treesj": { "branch": "main", "commit": "e1e82ab4237619d342c7102c9f13d4b9833bfd39" },
|
||||
"vim-dadbod": { "branch": "master", "commit": "fb30422b7bee7e2fa4205a4d226f01477f4fc593" },
|
||||
"vim-dadbod-completion": { "branch": "master", "commit": "5d5ad196fcde223509d7dabbade0148f7884c5e3" },
|
||||
"vim-dadbod-ui": { "branch": "master", "commit": "5aa854ee6017e9a3463d3dc8eee5aac93739f021" },
|
||||
"vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" },
|
||||
"vim-smoothie": { "branch": "master", "commit": "df1e324e9f3395c630c1c523d0555a01d2eb1b7e" },
|
||||
"vim-tmux-navigator": { "branch": "master", "commit": "c600cf10db1bf933aab9e357158bf9b202ecf99b" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue