local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", "https://github.com/folke/lazy.nvim.git", lazypath }) end vim.opt.rtp:prepend(lazypath) require("lazy").setup({ spec = { { "rose-pine/neovim", name = "rose-pine", config = function() -- require("rose-pine").setup({ -- highlight_groups = { -- CurSearch = { fg = "base", bg = "leaf", inherit = false }, -- Search = { fg = "text", bg = "leaf", blend = 20, inherit = false }, -- TelescopeNormal = { bg = "none" }, -- TelescopeBorder = { fg = "highlight_high", bg = "none" }, -- TelescopePromptNormal = { bg = "base" }, -- TelescopeResultsNormal = { fg = "subtle", bg = "none" }, -- TelescopeSelection = { fg = "text", bg = "base" }, -- TelescopeSelectionCaret = { fg = "rose", bg = "rose" }, -- }, -- }) vim.cmd.colorscheme("rose-pine-moon") end }, { "mbbill/undotree" }, { "echasnovski/mini.pairs", version = '*' }, { "ibhagwan/fzf-lua", dependencies = { "nvim-tree/nvim-web-devicons" } }, { 'nvim-telescope/telescope.nvim', dependencies = { 'nvim-lua/plenary.nvim' } }, { "saghen/blink.cmp", version = "v1.*", opts = {} }, { "DarthMooMancer/Polydev", opts = { terminal = { mode = "floating", } } }, { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", config = function() require("nvim-treesitter.configs").setup({ highlight = { enable = true }, indent = { enable = true } }) end }, } }) require('mini.pairs').setup() require("fzf-lua").setup({ "border-fused", fzf_opts = { ["--wrap"] = true }, previewers = { builtin = { syntax_limit_b = -102400, -- 100KB limit on highlighting files }, }, winopts = { height = 0.50, -- window height width = 0.45, -- window width row = 0.35, -- window row position (0=top, 1=bottom) col = 0.50, -- window col position (0=left, 1=right) border = "rounded", -- Backdrop opacity, 0 is fully opaque, 100 is fully transparent (i.e. disabled) backdrop = 0, -- title = "Title", -- title_pos = "center", -- 'left', 'center' or 'right' -- title_flags = false, -- uncomment to disable title flags fullscreen = false, -- start fullscreen? -- enable treesitter highlighting for the main fzf window will only have -- effect where grep like results are present, i.e. "file:line:col:text" -- due to highlight color collisions will also override `fzf_colors` -- set `fzf_colors=false` or `fzf_colors.hl=...` to override treesitter = { enabled = true, fzf_colors = { ["hl"] = "-1:reverse", ["hl+"] = "-1:reverse" } }, preview = { -- default = 'bat', -- override the default previewer? -- default uses the 'builtin' previewer border = "rounded", -- preview border: accepts both `nvim_open_win` -- and fzf values (e.g. "border-top", "none") -- native fzf previewers (bat/cat/git/etc) -- can also be set to `fun(winopts, metadata)` wrap = false, -- preview line wrap (fzf's 'wrap|nowrap') hidden = true, -- start preview hidden vertical = "down:45%", -- up|down:size horizontal = "right:60%", -- right|left:size layout = "flex", -- horizontal|vertical|flex flip_columns = 100, -- #cols to switch to horizontal on flex -- Only used with the builtin previewer: title = true, -- preview border title (file/buf)? title_pos = "center", -- left|center|right, title alignment scrollbar = false, -- `false` or string:'float|border' -- float: in-window floating border -- border: in-border "block" marker scrolloff = -1, -- float scrollbar offset from right -- applies only when scrollbar = 'float' delay = 20, -- delay(ms) displaying the preview -- prevents lag on fast scrolling winopts = { -- builtin previewer window options number = true, relativenumber = false, cursorline = true, cursorlineopt = "both", cursorcolumn = false, signcolumn = "no", list = false, foldenable = false, foldmethod = "manual", }, }, on_create = function() -- called once upon creation of the fzf main window -- can be used to add custom fzf-lua mappings, e.g: -- vim.keymap.set("t", "", "", { silent = true, buffer = true }) end, -- called once _after_ the fzf interface is closed -- on_close = function() ... end }, -- winopts = { -- preview = { -- wrap = true, -- }, -- }, grep = { rg_glob = true, rg_glob_fn = function(query) local regex, flags = query:match("^(.-)%s%-%-(.*)$") return (regex or query), flags end, }, defaults = { formatter = "path.filename_first", }, }) vim.g.mapleader = " " vim.opt.termguicolors = true vim.opt.number = true vim.opt.relativenumber = true vim.opt.wrap = false vim.opt.swapfile = false vim.opt.signcolumn = "yes" vim.opt.scrolloff = 8 vim.opt.sidescrolloff = 8 vim.opt.hlsearch = false vim.opt.completeopt = { "menuone", "noselect", "popup" } vim.g.netrw_browse_split = 0 vim.g.netrw_banner = 0 vim.g.netrw_winsize = 25 vim.lsp.enable({ "lua_ls", "clangd" }) vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) vim.api.nvim_set_hl(0, "StatusLine", { bg = "none" }) vim.api.nvim_set_hl(0, "StatusLineTerm", { bg = "none" }) vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "none" }) -- vim.api.nvim_set_hl(0, "TabLine", { bg = "none" }) -- vim.api.nvim_set_hl(0, "TabLineFill", { bg = "none" }) -- vim.api.nvim_set_hl(0, "TabLineSel", { bg = "none" }) vim.keymap.set("v", "J", ":m '>+1gv=gv") vim.keymap.set("v", "K", ":m '<-2gv=gv") vim.keymap.set("n", "ff", "ggVG=") vim.keymap.set("n", "", "zz") vim.keymap.set("n", "", "zz") vim.keymap.set("x", "p", [["_dP]]) vim.keymap.set('n', '', ":FzfLua files") vim.keymap.set('n', 'gh', ":FzfLua helptags") vim.keymap.set('n', 'gg', ":FzfLua live_grep") vim.keymap.set('n', 'xx', ":FzfLua diagnostics_workspace") vim.keymap.set('n', 'po', ":PolydevOpen") vim.keymap.set('n', 'gd', vim.lsp.buf.definition) vim.keymap.set("n", "gr", vim.lsp.buf.references) vim.keymap.set("n", "gR", vim.lsp.buf.rename) vim.keymap.set("n", "uu", ":UndotreeToggle")