This commit is contained in:
Dmitri 2026-04-18 18:11:18 +02:00
parent 1999612bf2
commit e73936f278
Signed by: kanopo
GPG Key ID: 759ADD40E3132AC7
22 changed files with 25 additions and 789 deletions

View File

@ -1,4 +0,0 @@
require("kanopo.options")
require("kanopo.keymaps")
require("kanopo.autocmds")
require("kanopo.lazy")

View File

@ -1,40 +0,0 @@
-- Highlight yanked text
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 = "*",
})
-- Go to last cursor position when opening a file
vim.api.nvim_create_autocmd("BufReadPost", {
callback = function()
local ft = vim.bo.filetype
if ft ~= "commit" and ft ~= "rebase" then
local last_pos = vim.fn.line("'\"")
if last_pos > 1 and last_pos <= vim.fn.line("$") then
vim.cmd('normal! g`"')
end
end
end,
})
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('my.lsp', {}),
callback = function(args)
local client = assert(vim.lsp.get_client_by_id(args.data.client_id))
-- Usually not needed if server supports "textDocument/willSaveWaitUntil".
if not client:supports_method('textDocument/willSaveWaitUntil')
and client:supports_method('textDocument/formatting') then
vim.api.nvim_create_autocmd('BufWritePre', {
group = vim.api.nvim_create_augroup('my.lsp', { clear = false }),
buffer = args.buf,
callback = function()
vim.lsp.buf.format({ bufnr = args.buf, id = client.id, timeout_ms = 1000 })
end,
})
end
end,
})

View File

@ -1,43 +0,0 @@
-- Clear highlights on search when pressing <Esc> in normal mode
-- See `:help hlsearch`
vim.keymap.set("n", "<Esc>", "<cmd>nohlsearch<CR>")
-- Diagnostic keymaps
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" })
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
-- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which
-- is not what someone will guess without a bit more experience.
--
-- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping
-- or just use <C-\><C-n> to exit terminal mode
vim.keymap.set("t", "<Esc><Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode" })
-- TIP: Disable arrow keys in normal mode
-- 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>')
-- Keybinds to make split navigation easier.
-- Use CTRL+<hjkl> to switch between windows
--
-- See `:help wincmd` for a list of all window commands
vim.keymap.set("n", "<C-h>", "<C-w><C-h>", { desc = "Move focus to the left window" })
vim.keymap.set("n", "<C-l>", "<C-w><C-l>", { desc = "Move focus to the right window" })
vim.keymap.set("n", "<C-j>", "<C-w><C-j>", { desc = "Move focus to the lower window" })
vim.keymap.set("n", "<C-k>", "<C-w><C-k>", { desc = "Move focus to the upper window" })
-- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes
-- vim.keymap.set("n", "<C-S-h>", "<C-w>H", { desc = "Move window to the left" })
-- vim.keymap.set("n", "<C-S-l>", "<C-w>L", { desc = "Move window to the right" })
-- vim.keymap.set("n", "<C-S-j>", "<C-w>J", { desc = "Move window to the lower" })
-- vim.keymap.set("n", "<C-S-k>", "<C-w>K", { desc = "Move window to the upper" })
-- DAP keymaps
vim.keymap.set("n", "<leader>db", "<cmd>lua require'dap'.toggle_breakpoint()<CR>", { desc = "Toggle [B]reakpoint" })
vim.keymap.set("n", "<leader>dc", "<cmd>lua require'dap'.continue()<CR>", { desc = "[C]ontinue" })
vim.keymap.set("n", "<leader>di", "<cmd>lua require'dap'.step_into()<CR>", { desc = "Step [I]nto" })
vim.keymap.set("n", "<leader>do", "<cmd>lua require'dap'.step_over()<CR>", { desc = "Step [O]ver" })
vim.keymap.set("n", "<leader>dO", "<cmd>lua require'dap'.step_out()<CR>", { desc = "Step [O]ut" })
vim.keymap.set("n", "<leader>dr", "<cmd>lua require'dap'.repl.open()<CR>", { desc = "Open [R]EPL" })

View File

@ -1,18 +0,0 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup("kanopo.plugins")

View File

@ -1,94 +0,0 @@
-- Leader keys (set early)
vim.g.mapleader = " "
vim.g.maplocalleader = " "
-- UI and appearance
vim.o.termguicolors = true -- 24-bit colors in TUI
vim.o.cursorline = true -- highlight current line
vim.o.number = true -- absolute line numbers
vim.o.relativenumber = true -- relative line numbers
vim.o.signcolumn = "yes" -- always show signcolumn
vim.o.colorcolumn = "100" -- visual column guide
vim.o.winborder = "rounded" -- default floating window border
vim.o.cmdheight = 0 -- minimal command-line height (NVIM 0.10+)
vim.o.conceallevel = 2 -- conceal in Markdown/jsonc when appropriate
vim.o.foldlevel = 0 -- start with folds closed (Treesitter can open)
-- Splits
vim.o.splitright = true -- open vertical splits to the right
vim.o.splitbelow = true -- open horizontal splits below
-- Editing behavior
vim.o.wrap = false -- do not wrap lines by default
vim.o.breakindent = true -- keep indentation on wrapped lines (if wrap is enabled later)
-- Sync clipboard between OS and Neovim.
-- Schedule the setting after `UiEnter` because it can increase startup-time.
-- Remove this option if you want your OS clipboard to remain independent.
-- See `:help 'clipboard'`
vim.schedule(function()
vim.o.clipboard = "unnamedplus"
end)
vim.o.swapfile = false -- no swapfiles
vim.o.undofile = true -- persistent undo
vim.o.writebackup = false -- do not keep backup around
-- Tabs and indentation (2-space default; override per-filetype with autocmds)
vim.o.expandtab = true
vim.o.tabstop = 2
vim.o.softtabstop = 2
vim.o.shiftwidth = 2
-- Search
vim.o.ignorecase = true -- case-insensitive
vim.o.smartcase = true -- unless uppercase is used
-- Completion UX (good defaults for omni and popup behavior)
vim.o.completeopt = "menu,menuone,noinsert,noselect"
vim.o.shortmess = (vim.o.shortmess or "") .. "c" -- reduce completion messages
-- Performance and input timing
vim.o.timeoutlen = 300 -- mapped sequence timeout
vim.o.updatetime = 250 -- faster CursorHold/diagnostic updates
vim.o.scrolloff = 10 -- context lines around cursor
-- Fonts/icons (used by statuslines/UIs)
vim.g.have_nerd_font = true
-- Providers (disable unused for faster startup)
vim.g.loaded_perl_provider = 0
vim.g.loaded_ruby_provider = 0
-- If you don't use Python providers via :CheckHealth, consider disabling too:
-- vim.g.loaded_python_provider = 0
-- vim.g.loaded_python3_provider = 0
-- Netrw (disable if using an explorer plugin like oil.nvim; enable if you rely on netrw)
vim.g.loaded_netrw = 0
vim.g.loaded_netrwPlugin = 0
-- If you need netrw again, set both back to nil or 0 and restart:
-- vim.g.loaded_netrw = nil; vim.g.loaded_netrwPlugin = nil
-- Filetype-specific indentation overrides (examples)
local ft_augroup = vim.api.nvim_create_augroup("FileTypeSettings", { clear = true })
-- C-like and web files: 2 spaces (adjust as needed)
vim.api.nvim_create_autocmd("FileType", {
group = ft_augroup,
pattern = { "c", "cpp", "objc", "objcpp", "javascript", "typescript", "tsx", "jsx" },
callback = function()
vim.bo.tabstop = 2
vim.bo.shiftwidth = 2
vim.bo.expandtab = true
end,
})
vim.o.mouse = "a"
vim.o.showmode = false
vim.o.list = true
vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "" }
-- Preview substitutions live, as you type!
vim.o.inccommand = "split"
vim.o.confirm = true

View File

@ -1,9 +0,0 @@
return {
"windwp/nvim-autopairs",
event = "InsertEnter",
config = function()
require("nvim-autopairs").setup({
disable_filetype = { "TelescopePrompt", "vim" },
})
end,
}

View File

@ -1,12 +0,0 @@
return {
"nvim-lualine/lualine.nvim",
dependencies = {
"ellisonleao/gruvbox.nvim",
},
config = function()
local theme = require("gruvbox")
require("lualine").setup({
theme = theme,
})
end,
}

View File

@ -1,84 +0,0 @@
return { -- Autocompletion
"saghen/blink.cmp",
event = "VimEnter",
version = "1.*",
dependencies = {
{
"L3MON4D3/LuaSnip",
version = "2.*",
build = (function()
if vim.fn.has("win32") == 1 or vim.fn.executable("make") == 0 then
return
end
return "make install_jsregexp"
end)(),
dependencies = {
-- `friendly-snippets` contains a variety of premade snippets.
-- See the README about individual language/framework/plugin snippets:
-- https://github.com/rafamadriz/friendly-snippets
{
"rafamadriz/friendly-snippets",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
},
},
opts = {},
},
"folke/lazydev.nvim",
},
--- @module 'blink.cmp'
--- @type blink.cmp.Config
opts = {
keymap = {
-- set to 'none' to disable the 'default' preset
preset = "none",
["<C-k>"] = { "select_prev", "fallback" },
["<C-j>"] = { "select_next", "fallback" },
["<C-b>"] = { "scroll_documentation_up", "fallback" },
["<C-f>"] = { "scroll_documentation_down", "fallback" },
["<Tab>"] = { "snippet_forward", "fallback" },
["<S-Tab>"] = { "snippet_backward", "fallback" },
-- ["<S-Tab>"] = { "select_prev", "fallback" },
-- ["<Tab>"] = { "select_next", "fallback" },
["<C-space>"] = { "show", "show_documentation", "hide_documentation" },
["<CR>"] = { "select_and_accept", "fallback" },
["<C-e>"] = { "hide", "fallback" },
["<C-s>"] = { "show_signature", "hide_signature", "fallback" },
},
appearance = {
nerd_font_variant = "mono",
},
completion = {
-- By default, you may press `<c-space>` to show the documentation.
-- Optionally, set `auto_show = true` to show the documentation after a delay.
documentation = { auto_show = false, auto_show_delay_ms = 500 },
},
sources = {
default = { "lsp", "path", "snippets", "lazydev" },
providers = {
lazydev = { module = "lazydev.integrations.blink", score_offset = 100 },
},
},
snippets = { preset = "luasnip" },
-- Blink.cmp includes an optional, recommended rust fuzzy matcher,
-- which automatically downloads a prebuilt binary when enabled.
--
-- By default, we use the Lua implementation instead, but you may enable
-- the rust implementation via `'prefer_rust_with_warning'`
--
-- See :h blink-cmp-config-fuzzy for more information
fuzzy = { implementation = "lua" },
-- Shows a signature help window while you type arguments for a function
signature = { enabled = true },
},
}

View File

@ -1,12 +0,0 @@
return {
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {
signs = true,
keywords = {
TODO = { icon = "🤨", color = "info" },
WIP = { icon = "🥵", color = "warning" },
ERR = { icon = "🤬", color = "error" },
},
}
}

View File

@ -1,8 +0,0 @@
return {
"stevearc/dressing.nvim",
opts = {
inputs = {
enable = true,
}
},
}

View File

@ -1,41 +0,0 @@
return { -- Autoformat
"stevearc/conform.nvim",
event = { "BufWritePre" },
cmd = { "ConformInfo" },
keys = {
{
"<leader>f",
function()
require("conform").format({ async = true, lsp_format = "fallback" })
end,
mode = "",
desc = "[F]ormat buffer",
},
},
opts = {
notify_on_error = false,
format_on_save = function(bufnr)
-- Disable "format_on_save lsp_fallback" for languages that don't
-- have a well standardized coding style. You can add additional
-- languages here or re-enable it for the disabled ones.
local disable_filetypes = { c = true, cpp = true }
if disable_filetypes[vim.bo[bufnr].filetype] then
return nil
else
return {
timeout_ms = 500,
lsp_format = "fallback",
}
end
end,
formatters_by_ft = {
lua = { "stylua" },
-- Conform can also run multiple formatters sequentially
-- python = { "isort", "black" },
--
-- You can use 'stop_after_first' to run the first available formatter from the list
-- javascript = { "prettierd", "prettier", stop_after_first = true },
},
},
}

View File

@ -1,16 +0,0 @@
return {
"NeogitOrg/neogit",
dependencies = {
"nvim-lua/plenary.nvim",
"sindrets/diffview.nvim",
"nvim-telescope/telescope.nvim",
},
-- config = function()
-- require("neogit").setup()
-- vim.keymap.set("n", "<leader>gg", "<cmd>Neogit<cr>", { desc = "Neogit" })
-- end,
opts = true,
keys = {
{ "<leader>gg", "<cmd>Neogit<cr>", desc = "Neogit" },
},
}

View File

@ -1,6 +0,0 @@
return {
"lewis6991/gitsigns.nvim",
event = "BufRead",
opts = {},
}

View File

@ -1,29 +0,0 @@
return {
"mfussenegger/nvim-jdtls",
ft = "java",
config = function()
local lombok_dir = vim.fn.stdpath("data") .. "/lombok"
local lombok_path = lombok_dir .. "/lombok.jar"
if not vim.loop.fs_stat(lombok_path) then
vim.fn.mkdir(lombok_dir, "p")
print("Downloading lombok.jar...")
local lombok_url = "https://projectlombok.org/downloads/lombok.jar"
vim.fn.system({ "curl", "-L", "-o", lombok_path, lombok_url })
print("lombok.jar downloaded to " .. lombok_path)
end
local capabilities = require("blink.cmp").get_lsp_capabilities()
local config = {
cmd = {
"jdtls",
"--jvm-arg=-javaagent:" .. lombok_path,
},
root_dir = vim.fs.root(0, { ".git", "mvnw", "gradlew" }) or vim.fn.getcwd(),
capabilities = capabilities,
}
require("jdtls").start_or_attach(config)
end,
}

View File

@ -1,13 +0,0 @@
return {
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
-- used for completion, annotations and signatures of Neovim apis
"folke/lazydev.nvim",
ft = "lua",
opts = {
library = {
-- Load luvit types when the `vim.uv` word is found
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
},
},
}

View File

@ -1,173 +0,0 @@
return {
"neovim/nvim-lspconfig",
dependencies = {
{ "mason-org/mason.nvim", opts = {} },
"mason-org/mason-lspconfig.nvim",
"WhoIsSethDaniel/mason-tool-installer.nvim",
{ "j-hui/fidget.nvim", opts = {} },
"saghen/blink.cmp",
},
config = function()
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }),
callback = function(event)
local map = function(keys, func, desc, mode)
mode = mode or "n"
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = "LSP: " .. desc })
end
-- Rename the variable under your cursor.
-- Most Language Servers support renaming across files, etc.
map("<leader>rn", vim.lsp.buf.rename, "[R]e[n]ame")
-- Execute a code action, usually your cursor needs to be on top of an error
-- or a suggestion from your LSP for this to activate.
map("<leader>ca", vim.lsp.buf.code_action, "[G]oto Code [A]ction", { "n", "x" })
-- Find references for the word under your cursor.
map("<leader>gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences")
-- Jump to the implementation of the word under your cursor.
-- Useful when your language has ways of declaring types without an actual implementation.
map("<leader>gi", require("telescope.builtin").lsp_implementations, "[G]oto [I]mplementation")
-- Jump to the definition of the word under your cursor.
-- This is where a variable was first declared, or where a function is defined, etc.
-- To jump back, press <C-t>.
map("<leader>gd", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition")
-- WARN: This is not Goto Definition, this is Goto Declaration.
-- For example, in C this would take you to the header.
map("<leader>gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
-- -- Fuzzy find all the symbols in your current document.
-- -- Symbols are things like variables, functions, types, etc.
-- map("gO", require("telescope.builtin").lsp_document_symbols, "Open Document Symbols")
--
-- -- Fuzzy find all the symbols in your current workspace.
-- -- Similar to document symbols, except searches over your entire project.
-- map("gW", require("telescope.builtin").lsp_dynamic_workspace_symbols, "Open Workspace Symbols")
--
-- -- Jump to the type of the word under your cursor.
-- -- Useful when you're not sure what type a variable is and you want to see
-- -- the definition of its *type*, not where it was *defined*.
-- map("grt", require("telescope.builtin").lsp_type_definitions, "[G]oto [T]ype Definition")
map("<leader>e", vim.diagnostic.open_float, "Line Diagnostics")
-- The following code creates a keymap to toggle inlay hints in your
-- code, if the language server you are using supports them
--
-- This may be unwanted, since they displace some of your code
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then
map("<leader>th", function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf }))
end, "[T]oggle Inlay [H]ints")
end
end,
})
-- Diagnostic Config
-- See :help vim.diagnostic.Opts
vim.diagnostic.config({
severity_sort = true,
float = { border = "rounded", source = "if_many" },
underline = { severity = vim.diagnostic.severity.ERROR },
signs = vim.g.have_nerd_font and {
text = {
[vim.diagnostic.severity.ERROR] = "󰅚 ",
[vim.diagnostic.severity.WARN] = "󰀪 ",
[vim.diagnostic.severity.INFO] = "󰋽 ",
[vim.diagnostic.severity.HINT] = "󰌶 ",
},
} or {},
virtual_text = {
source = "if_many",
spacing = 2,
format = function(diagnostic)
local diagnostic_message = {
[vim.diagnostic.severity.ERROR] = diagnostic.message,
[vim.diagnostic.severity.WARN] = diagnostic.message,
[vim.diagnostic.severity.INFO] = diagnostic.message,
[vim.diagnostic.severity.HINT] = diagnostic.message,
}
return diagnostic_message[diagnostic.severity]
end,
},
})
-- LSP servers and clients are able to communicate to each other what features they support.
-- By default, Neovim doesn't support everything that is in the LSP specification.
-- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities.
-- So, we create new capabilities with blink.cmp, and then broadcast that to the servers.
local capabilities = require("blink.cmp").get_lsp_capabilities()
-- Enable the following language servers
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
--
-- Add any additional override configuration in the following tables. Available keys are:
-- - cmd (table): Override the default command used to start the server
-- - filetypes (table): Override the default list of associated filetypes for the server
-- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features.
-- - settings (table): Override the default settings passed when initializing the server.
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
local servers = {
texlab = {},
rust_analyzer = {},
cssls = {},
astro = {},
tailwindcss = {},
pylsp = {},
ts_ls = {},
gopls = {},
postgres_lsp = {},
lua_ls = {
settings = {
Lua = {
completion = {
callSnippet = "Replace",
},
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
-- diagnostics = { disable = { 'missing-fields' } },
},
},
},
}
-- Ensure the servers and tools above are installed
--
-- To check the current status of installed tools and/or manually install
-- other tools, you can run
-- :Mason
--
-- You can press `g?` for help in this menu.
--
-- `mason` had to be setup earlier: to configure its options see the
-- `dependencies` table for `nvim-lspconfig` above.
--
-- You can add other tools here that you want Mason to install
-- for you, so that they are available from within Neovim.
local ensure_installed = vim.tbl_keys(servers or {})
vim.list_extend(ensure_installed, {
"stylua", -- Used to format Lua code
})
require("mason-tool-installer").setup({ ensure_installed = ensure_installed })
require("mason-lspconfig").setup({
ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer)
automatic_installation = true,
handlers = {
function(server_name)
local server = servers[server_name] or {}
-- This handles overriding only values explicitly passed
-- by the server configuration above. Useful when disabling
-- certain features of an LSP (for example, turning off formatting for ts_ls)
server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {})
require("lspconfig")[server_name].setup(server)
end,
},
})
end,
}

View File

@ -1,9 +0,0 @@
return {
'stevearc/oil.nvim',
opts = {},
dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if prefer nvim-web-devicons
config = function()
require("oil").setup()
vim.keymap.set('n', '<leader>fe', "<cmd>:Oil<cr>")
end
}

View File

@ -1,112 +0,0 @@
return { -- Fuzzy Finder (files, lsp, etc)
"nvim-telescope/telescope.nvim",
event = "VimEnter",
dependencies = {
"nvim-lua/plenary.nvim",
{ -- If encountering errors, see telescope-fzf-native README for installation instructions
"nvim-telescope/telescope-fzf-native.nvim",
-- `build` is used to run some command when the plugin is installed/updated.
-- This is only run then, not every time Neovim starts up.
build = "make",
-- `cond` is a condition used to determine whether this plugin should be
-- installed and loaded.
cond = function()
return vim.fn.executable("make") == 1
end,
},
{ "nvim-telescope/telescope-ui-select.nvim" },
-- Useful for getting pretty icons, but requires a Nerd Font.
{ "nvim-tree/nvim-web-devicons", enabled = vim.g.have_nerd_font },
},
config = function()
-- Telescope is a fuzzy finder that comes with a lot of different things that
-- it can fuzzy find! It's more than just a "file finder", it can search
-- many different aspects of Neovim, your workspace, LSP, and more!
--
-- The easiest way to use Telescope, is to start by doing something like:
-- :Telescope help_tags
--
-- After running this command, a window will open up and you're able to
-- type in the prompt window. You'll see a list of `help_tags` options and
-- a corresponding preview of the help.
--
-- Two important keymaps to use while in Telescope are:
-- - Insert mode: <c-/>
-- - Normal mode: ?
--
-- This opens a window that shows you all of the keymaps for the current
-- Telescope picker. This is really useful to discover what Telescope can
-- do as well as how to actually do it!
-- [[ Configure Telescope ]]
-- See `:help telescope` and `:help telescope.setup()`
require("telescope").setup({
pickers = {
find_files = {
theme = "ivy",
hidden = true,
prompt_prefix = "🔍 ",
},
live_grep = {
theme = "ivy",
hidden = true,
prompt_prefix = "🔍 ",
},
},
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown(),
},
fzf = {
fuzzy = true,
override_generic_sorter = true,
override_file_sorter = true,
case_mode = "ignore_case",
},
},
})
-- Enable Telescope extensions if they are installed
pcall(require("telescope").load_extension, "fzf")
pcall(require("telescope").load_extension, "ui-select")
-- See `:help telescope.builtin`
local builtin = require("telescope.builtin")
vim.keymap.set("n", "<leader>sh", builtin.help_tags, { desc = "[S]earch [H]elp" })
vim.keymap.set("n", "<leader>sk", builtin.keymaps, { desc = "[S]earch [K]eymaps" })
vim.keymap.set("n", "<leader>sf", builtin.find_files, { desc = "[S]earch [F]iles" })
vim.keymap.set("n", "<leader>ss", builtin.builtin, { desc = "[S]earch [S]elect Telescope" })
vim.keymap.set("n", "<leader>sw", builtin.grep_string, { desc = "[S]earch current [W]ord" })
vim.keymap.set("n", "<leader>sg", builtin.live_grep, { desc = "[S]earch by [G]rep" })
vim.keymap.set("n", "<leader>sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" })
vim.keymap.set("n", "<leader>sr", builtin.resume, { desc = "[S]earch [R]esume" })
vim.keymap.set("n", "<leader>s.", builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
vim.keymap.set("n", "<leader><leader>", builtin.buffers, { desc = "[ ] Find existing buffers" })
-- Slightly advanced example of overriding default behavior and theme
vim.keymap.set("n", "<leader>/", function()
-- You can pass additional configuration to Telescope to change the theme, layout, etc.
builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
winblend = 10,
previewer = false,
}))
end, { desc = "[/] Fuzzily search in current buffer" })
-- It's also possible to pass additional configuration options.
-- See `:help telescope.builtin.live_grep()` for information about particular keys
vim.keymap.set("n", "<leader>s/", function()
builtin.live_grep({
grep_open_files = true,
prompt_title = "Live Grep in Open Files",
})
end, { desc = "[S]earch [/] in Open Files" })
-- Shortcut for searching your Neovim configuration files
vim.keymap.set("n", "<leader>sn", function()
builtin.find_files({ cwd = vim.fn.stdpath("config") })
end, { desc = "[S]earch [N]eovim files" })
end,
}

View File

@ -1,9 +0,0 @@
return {
"ellisonleao/gruvbox.nvim",
priority = 1000 ,
config = function()
vim.o.background = "dark" -- or "light" for light mode
vim.cmd([[colorscheme gruvbox]])
end
}

View File

@ -1,5 +0,0 @@
return {
"nvim-treesitter/nvim-treesitter",
lazy = false,
build = ":TSUpdate",
}

View File

@ -1,52 +0,0 @@
return { -- Useful plugin to show you pending keybinds.
"folke/which-key.nvim",
event = "VimEnter", -- Sets the loading event to 'VimEnter'
opts = {
-- delay between pressing a key and opening which-key (milliseconds)
-- this setting is independent of vim.o.timeoutlen
delay = 0,
icons = {
-- set icon mappings to true if you have a Nerd Font
mappings = vim.g.have_nerd_font,
-- If you are using a Nerd Font: set icons.keys to an empty table which will use the
-- default which-key.nvim defined Nerd Font icons, otherwise define a string table
keys = vim.g.have_nerd_font and {} or {
Up = "<Up> ",
Down = "<Down> ",
Left = "<Left> ",
Right = "<Right> ",
C = "<C-…> ",
M = "<M-…> ",
D = "<D-…> ",
S = "<S-…> ",
CR = "<CR> ",
Esc = "<Esc> ",
ScrollWheelDown = "<ScrollWheelDown> ",
ScrollWheelUp = "<ScrollWheelUp> ",
NL = "<NL> ",
BS = "<BS> ",
Space = "<Space> ",
Tab = "<Tab> ",
F1 = "<F1>",
F2 = "<F2>",
F3 = "<F3>",
F4 = "<F4>",
F5 = "<F5>",
F6 = "<F6>",
F7 = "<F7>",
F8 = "<F8>",
F9 = "<F9>",
F10 = "<F10>",
F11 = "<F11>",
F12 = "<F12>",
},
},
-- Document existing key chains
spec = {
{ "<leader>s", group = "[S]earch" },
{ "<leader>t", group = "[T]oggle" },
{ "<leader>h", group = "Git [H]unk", mode = { "n", "v" } },
},
},
}

25
nvim/nvim-pack-lock.json Normal file
View File

@ -0,0 +1,25 @@
{
"plugins": {
"gruvbox.nvim": {
"rev": "154eb5ff5b96d0641307113fa385eaf0d36d9796",
"src": "https://github.com/ellisonleao/gruvbox.nvim"
},
"mason-tool-installer.nvim": {
"rev": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc",
"src": "https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim"
},
"mason.nvim": {
"rev": "b03fb0f20bc1d43daf558cda981a2be22e73ac42",
"src": "https://github.com/mason-org/mason.nvim"
},
"nvim-lspconfig": {
"rev": "4b7fbaa239c5db6b36f424a4521ca9f1a401be33",
"src": "https://github.com/neovim/nvim-lspconfig"
},
"nvim-treesitter": {
"rev": "4916d6592ede8c07973490d9322f187e07dfefac",
"src": "https://github.com/nvim-treesitter/nvim-treesitter",
"version": "'main'"
}
}
}