diff --git a/nvim b/nvim deleted file mode 160000 index a3aec3b..0000000 --- a/nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a3aec3b4338bcc3d4ec3d4e460a54f075367274c diff --git a/nvim/.gitignore b/nvim/.gitignore new file mode 100644 index 0000000..8b55343 --- /dev/null +++ b/nvim/.gitignore @@ -0,0 +1,2 @@ +lazy-lock.json + diff --git a/nvim/colors/molokai.vim b/nvim/colors/molokai.vim new file mode 100644 index 0000000..9f12052 --- /dev/null +++ b/nvim/colors/molokai.vim @@ -0,0 +1,130 @@ +" Vim color file +" +" Author: Jim Perry +" https://github.com/tamelion/neovim-molokai +" +" Author: Tomas Restrepo +" https://github.com/tomasr/molokai +" +" Note: Based on the Monokai theme for TextMate +" by Wimer Hazenberg and its darker variant +" by Hamish Stuart Macpherson +" + +hi clear + +let g:colors_name="molokai" + +hi Boolean guifg=#AE81FF +hi Character guifg=#E6DB74 +hi Number guifg=#AE81FF +hi String guifg=#E6DB74 +hi Conditional guifg=#F92672 gui=bold +hi Constant guifg=#AE81FF gui=bold +hi Cursor guifg=#000000 guibg=#F8F8F0 +hi iCursor guifg=#000000 guibg=#F8F8F0 +hi Debug guifg=#BCA3A3 gui=bold +hi Define guifg=#66D9EF +hi Delimiter guifg=#8F8F8F +hi DiffAdd guibg=#13354A +hi DiffChange guifg=#89807D guibg=#4C4745 +hi DiffDelete guifg=#960050 guibg=#1E0010 +hi DiffText guibg=#4C4745 gui=italic,bold + +hi Directory guifg=#A6E22E gui=bold +hi Error guifg=#E6DB74 guibg=#1E0010 +hi ErrorMsg guifg=#F92672 guibg=#232526 gui=bold +hi Exception guifg=#A6E22E gui=bold +hi Float guifg=#AE81FF +hi FoldColumn guifg=#465457 guibg=#000000 +hi Folded guifg=#465457 guibg=#000000 +hi Function guifg=#A6E22E +hi Identifier guifg=#FD971F +hi Ignore guifg=#808080 guibg=bg +hi IncSearch guifg=#C4BE89 guibg=#000000 + +hi Keyword guifg=#F92672 gui=bold +hi Label guifg=#E6DB74 gui=none +hi Macro guifg=#C4BE89 gui=italic +hi SpecialKey guifg=#66D9EF gui=italic + +hi MatchParen guifg=#000000 guibg=#FD971F gui=bold +hi ModeMsg guifg=#E6DB74 +hi MoreMsg guifg=#E6DB74 +hi Operator guifg=#F92672 + +" complete menu +hi Pmenu guifg=#66D9EF guibg=#000000 +hi PmenuSel guibg=#808080 +hi PmenuSbar guibg=#080808 +hi PmenuThumb guifg=#66D9EF + +hi PreCondit guifg=#A6E22E gui=bold +hi PreProc guifg=#A6E22E +hi Question guifg=#66D9EF +hi Repeat guifg=#F92672 gui=bold +hi Search guifg=#000000 guibg=#FFE792 +" marks +hi SignColumn guifg=#A6E22E guibg=#101010 +hi SpecialChar guifg=#F92672 gui=bold +hi SpecialComment guifg=#7E8E91 gui=bold +hi Special guifg=#66D9EF guibg=bg gui=italic +if has("spell") + hi SpellBad guisp=#FF0000 gui=undercurl + hi SpellCap guisp=#7070F0 gui=undercurl + hi SpellLocal guisp=#70F0F0 gui=undercurl + hi SpellRare guisp=#FFFFFF gui=undercurl +endif +hi Statement guifg=#F92672 gui=bold +hi StatusLine guifg=#455354 guibg=fg +hi StatusLineNC guifg=#808080 guibg=#080808 +hi StorageClass guifg=#FD971F gui=italic +hi Structure guifg=#66D9EF +hi Tag guifg=#F92672 gui=italic +hi Title guifg=#ef5939 +hi Todo guifg=#FFFFFF guibg=bg gui=bold + +hi Typedef guifg=#66D9EF +hi Type guifg=#66D9EF gui=none +hi Underlined guifg=#808080 gui=underline + +hi VertSplit guifg=#808080 guibg=#080808 gui=bold +hi VisualNOS guibg=#403D3D +hi Visual guibg=#403D3D +hi WarningMsg guifg=#FFFFFF guibg=#333333 gui=bold +hi WildMenu guifg=#66D9EF guibg=#000000 + +hi TabLineFill guifg=#1B1D1E guibg=#1B1D1E +hi TabLine guibg=#1B1D1E guifg=#808080 gui=none + +hi Normal guifg=#F8F8F2 guibg=#101010 +hi Comment guifg=#7E8E91 gui=italic +hi CursorLine guibg=#232526 +hi CursorLineNr guifg=#FD971F gui=none +hi CursorColumn guibg=#293739 +hi ColorColumn guibg=#000000 +hi LineNr guifg=#465457 guibg=#101010 +hi NonText guifg=#465457 +hi SpecialKey guifg=#465457 + +hi MsgArea guibg=#101010 guifg=#F8F8F2 + +" Set neovim's build-in terminal colours +let g:terminal_color_0 = '#272822' +let g:terminal_color_1 = '#F92672' +let g:terminal_color_2 = '#A6E22E' +let g:terminal_color_3 = '#E6DB74' +let g:terminal_color_4 = '#66D9EF' +let g:terminal_color_5 = '#AE81FF' +let g:terminal_color_6 = '#70F0F0' +let g:terminal_color_7 = '#F8F8F2' +let g:terminal_color_8 = '#75715E' +let g:terminal_color_9 = '#F92672' +let g:terminal_color_10 = '#A6E22E' +let g:terminal_color_11 = '#E6DB74' +let g:terminal_color_12 = '#66D9EF' +let g:terminal_color_13 = '#AE81FF' +let g:terminal_color_14 = '#70F0F0' +let g:terminal_color_15 = '#FFFFFF' + +set background=dark diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..cb260ea --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,105 @@ +require("config.lazy") + +vim.opt.number = true +vim.opt.wrap = false + +vim.api.nvim_create_autocmd( + { "InsertEnter", "FocusLost", "BufLeave" }, + { + callback = function() + vim.opt.relativenumber = false + end, + } +) + +vim.api.nvim_create_autocmd( + { "InsertLeave", "FocusGained", "BufEnter" }, + { + callback = function() + vim.opt.relativenumber = true + end, + } +) + +vim.opt.tabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true +vim.opt.pumheight = 10 +vim.opt.pumwidth = 80 +vim.opt.cursorline = true +vim.opt.ignorecase = true +vim.opt.smartcase = true + +vim.o.updatetime = 100 + +vim.keymap.set("n", "", ":noh", { silent = true }) +vim.keymap.set("v", "ga", ":EasyAlign") + +-- COLORSCHEME +-- vim.cmd.colorscheme "habamax.nvim" +-- vim.cmd.colorscheme "catppuccin-mocha" +vim.cmd.colorscheme "kanagawa-wave" +vim.cmd.colorscheme "molokai" +-- vim.g.molokai_original = 1 + +vim.lsp.enable("gopls") + +-- TELESCOPE +local builtin = require("telescope.builtin") +vim.keymap.set("n", "ff", builtin.find_files, { desc = "Telescope find files" }) +vim.keymap.set("n", "fg", builtin.live_grep, { desc = "Telescope live grep" }) +vim.keymap.set("n", "fb", builtin.buffers, { desc = "Telescope buffers" }) +vim.api.nvim_set_hl(0, "TelescopeSelection", { bg = "#2a2a2a", fg ="#ffffff" } ) + +vim.opt.termguicolors = true + +-- LSP config +require("lspconfig").clangd.setup({ + cmd = { "clangd", "--background-index", "--compile-commands-dir=.", "--header-insertion=never" }, + root_dir = require("lspconfig.util").root_pattern("compile_commands.json", ".git"), + capabilities = require("cmp_nvim_lsp").default_capabilities(), +}) + +vim.lsp.enable('gopls') + +vim.diagnostic.config({ + virtual_text = false, + float = { + border = "rounded", + focusable = false, + source = "always", + scope = "line", + }, +}) + +vim.api.nvim_create_autocmd("CursorHold", { + callback = function() + vim.diagnostic.open_float(nil, { + focusable = false, + close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" }, + border = "rounded", + source = "always", + scope = "line", + }) + end, +}) + +vim.keymap.set("n", "ca", function() + vim.lsp.buf.code_action() +end, { desc = "Lsp code action" }) + +function open_remote(url) + local ext = "." .. vim.fn.fnamemodify(url, ":e") + local fname = vim.fn.tempname() .. ext; + local cmd = string.format("curl -s -o \"%s\" \"%s\"", fname, url) + vim.fn.system(cmd) + vim.cmd("Oil " .. fname) +end + +-- OPEN REMOTE FILE +vim.api.nvim_create_user_command( + "Ropen", + function (opts) open_remote(opts.args) end, + { nargs = 1, desc = "Open remote URL" } +) + diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json new file mode 100644 index 0000000..fc5e237 --- /dev/null +++ b/nvim/lazy-lock.json @@ -0,0 +1,33 @@ +{ + "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, + "alpha-nvim": { "branch": "main", "commit": "a35468cd72645dbd52c0624ceead5f301c566dff" }, + "auto-save.nvim": { "branch": "main", "commit": "979b6c82f60cfa80f4cf437d77446d0ded0addf0" }, + "catppuccin": { "branch": "main", "commit": "30fa4d122d9b22ad8b2e0ab1b533c8c26c4dde86" }, + "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, + "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" }, + "conform.nvim": { "branch": "master", "commit": "b4aab989db276993ea5dcb78872be494ce546521" }, + "habamax.nvim": { "branch": "master", "commit": "4a4105aea429fca3cb5ebcca584e21b9af2ae265" }, + "kanagawa.nvim": { "branch": "master", "commit": "debe91547d7fb1eef34ce26a5106f277fbfdd109" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" }, + "lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" }, + "lush.nvim": { "branch": "main", "commit": "45a79ec4acb5af783a6a29673a999ce37f00497e" }, + "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, + "mini.icons": { "branch": "main", "commit": "94848dad1589a199f876539bd79befb0c5e3abf0" }, + "multicursor.nvim": { "branch": "1.0", "commit": "9eedebdd395bbbc4711081e33b0606c079e054c3" }, + "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, + "nvim-lspconfig": { "branch": "master", "commit": "2d0ca00368742c0c7af802b9b2a920c4cd02303a" }, + "nvim-treesitter": { "branch": "main", "commit": "98459ffcf7dfbeea83081166a2d732a8083a91c2" }, + "nvim-web-devicons": { "branch": "master", "commit": "19d6211c78169e78bab372b585b6fb17ad974e82" }, + "oil.nvim": { "branch": "master", "commit": "08c2bce8b00fd780fb7999dbffdf7cd174e896fb" }, + "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, + "themery.nvim": { "branch": "main", "commit": "bfa58f4b279d21cb515b28023e1b68ec908584b2" }, + "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, + "vim-easy-align": { "branch": "master", "commit": "9815a55dbcd817784458df7a18acacc6f82b1241" }, + "vim-illuminate": { "branch": "master", "commit": "0d1e93684da00ab7c057410fecfc24f434698898" }, + "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }, + "wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" } +} diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..f0241d9 --- /dev/null +++ b/nvim/lua/config/lazy.lua @@ -0,0 +1,31 @@ +-- 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) + +-- Make sure to setup `mapleader` and `maplocalleader` before +-- loading lazy.nvim so that mappings are correct. +-- This is also a good place to setup other settings (vim.opt) +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" + +require("lazy").setup({ + spec = { + -- import plugins + { import = "plugins" }, + }, + install = { colorscheme = { "habamax" } }, + checker = { enabled = false }, +}) diff --git a/nvim/lua/plugins/alpha.lua b/nvim/lua/plugins/alpha.lua new file mode 100644 index 0000000..6224e0e --- /dev/null +++ b/nvim/lua/plugins/alpha.lua @@ -0,0 +1,16 @@ +return { + "goolord/alpha-nvim", + dependencies = { + 'nvim-tree/nvim-web-devicons', + "nvim-lua/plenary.nvim", + }, + config = function() + local theta = require("alpha.themes.theta") + theta.config.layout[1].val = math.floor(vim.fn.winheight(0) * 0.2) + theta.file_icons.provider = "devicons" + theta.header.opts.hl = "CursorLineNr" + require("alpha").setup( + theta.config + ) + end, +} diff --git a/nvim/lua/plugins/kanagawa.lua b/nvim/lua/plugins/kanagawa.lua new file mode 100644 index 0000000..788ac2f --- /dev/null +++ b/nvim/lua/plugins/kanagawa.lua @@ -0,0 +1,22 @@ +return { + "rebelot/kanagawa.nvim", + opts = { + colors = { + theme = { + all = { + ui = { + bg_gutter = "none", + }, + }, + }, + }, + overrides = function (colors) + local theme = colors.theme + return { + NormalFloat = { bg = "none" }, + FloatBorder = { bg = "none" }, + FloatTitle = { bg = "none" }, + } + end + }, + } diff --git a/nvim/lua/plugins/lualine.lua b/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..4f148ae --- /dev/null +++ b/nvim/lua/plugins/lualine.lua @@ -0,0 +1,51 @@ +return { + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function() + local molokai = require "lualine.themes.molokai" + + molokai.normal.c.bg = "#0A0A0A" + molokai.normal.c.fg = "#FD971F" + + require("lualine").setup({ + options = { + icons_enabled = true, + theme = molokai, + component_separators = { left = '', right = ''}, + section_separators = { left = '', right = ''}, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + globalstatus = false, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + } + }, + sections = { + lualine_a = {'mode'}, + lualine_b = {'branch', 'diff', 'diagnostics'}, + lualine_c = { 'filename', }, + lualine_x = { 'searchcount', 'selectioncount', 'filetype', }, + lualine_y = {'progress'}, + lualine_z = {'location'} + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {'filename'}, + lualine_x = {'location'}, + lualine_y = {}, + lualine_z = {} + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {} + }) + end, +} diff --git a/nvim/lua/plugins/main.lua b/nvim/lua/plugins/main.lua new file mode 100644 index 0000000..7d20e60 --- /dev/null +++ b/nvim/lua/plugins/main.lua @@ -0,0 +1,53 @@ +return { + -- themes + { "ntk148v/habamax.nvim", dependencies={ "rktjmp/lush.nvim" } }, + { "catppuccin/nvim", name = "catppuccin", }, + -- { "tamelion/neovim-molokai" }, + -- end themes + "folke/which-key.nvim", + "Pocco81/auto-save.nvim", + "neovim/nvim-lspconfig", + { + "L3MON4D3/LuaSnip", + version = "v2.*", + }, + { + "mason-org/mason.nvim", + opts={ + + ui = { + icons = { + package_installed = "✓", + package_pending = "➜", + package_uninstalled = "✗" + } + } + } + }, + "RRethy/vim-illuminate", + "stevearc/conform.nvim", + "norcalli/nvim-colorizer.lua", + { + "gelguy/wilder.nvim", + opts = function() + local wilder = require("wilder") + wilder.set_option("renderer", wilder.popupmenu_renderer({ + pumblend = 20, + })) + return { + modes = { ':', '/', '?' } + } + end + }, + { + "zaldih/themery.nvim", + lazy = false, + config = function() + require("themery").setup({ + themes = vim.fn.getcompletion("", "color"), + livePreview = true, + }) + end + }, + { "junegunn/vim-easy-align" }, +} diff --git a/nvim/lua/plugins/multicursor.lua b/nvim/lua/plugins/multicursor.lua new file mode 100644 index 0000000..b63b186 --- /dev/null +++ b/nvim/lua/plugins/multicursor.lua @@ -0,0 +1,61 @@ +return { + "jake-stewart/multicursor.nvim", + branch = "1.0", + config = function() + local mc = require("multicursor-nvim") + mc.setup() + + local set = vim.keymap.set + + -- Add or skip cursor above/below the main cursor. + set({"n", "x"}, "", function() mc.lineAddCursor(-1) end) + set({"n", "x"}, "", function() mc.lineAddCursor(1) end) + set({"n", "x"}, "k", function() mc.lineSkipCursor(-1) end) + set({"n", "x"}, "j", function() mc.lineSkipCursor(1) end) + + -- Add or skip adding a new cursor by matching word/selection + set({"n", "x"}, "n", function() mc.matchAddCursor(1) end) + set({"n", "x"}, "s", function() mc.matchSkipCursor(1) end) + set({"n", "x"}, "N", function() mc.matchAddCursor(-1) end) + set({"n", "x"}, "S", function() mc.matchSkipCursor(-1) end) + + -- Add and remove cursors with control + left click. + set("n", "", mc.handleMouse) + set("n", "", mc.handleMouseDrag) + set("n", "", mc.handleMouseRelease) + + -- Disable and enable cursors. + set({"n", "x"}, "", mc.toggleCursor) + + -- Mappings defined in a keymap layer only apply when there are + -- multiple cursors. This lets you have overlapping mappings. + mc.addKeymapLayer(function(layerSet) + + -- Select a different cursor as the main one. + layerSet({"n", "x"}, "", mc.prevCursor) + layerSet({"n", "x"}, "", mc.nextCursor) + + -- Delete the main cursor. + layerSet({"n", "x"}, "x", mc.deleteCursor) + + -- Enable and clear cursors using escape. + layerSet("n", "", function() + if not mc.cursorsEnabled() then + mc.enableCursors() + else + mc.clearCursors() + end + end) + end) + + -- Customize how cursors look. + local hl = vim.api.nvim_set_hl + hl(0, "MultiCursorCursor", { reverse = true }) + hl(0, "MultiCursorVisual", { link = "Visual" }) + hl(0, "MultiCursorSign", { link = "SignColumn"}) + hl(0, "MultiCursorMatchPreview", { link = "Search" }) + hl(0, "MultiCursorDisabledCursor", { reverse = true }) + hl(0, "MultiCursorDisabledVisual", { link = "Visual" }) + hl(0, "MultiCursorDisabledSign", { link = "SignColumn"}) + end +} diff --git a/nvim/lua/plugins/nvim-cmp.lua b/nvim/lua/plugins/nvim-cmp.lua new file mode 100644 index 0000000..c88ce7e --- /dev/null +++ b/nvim/lua/plugins/nvim-cmp.lua @@ -0,0 +1,146 @@ +return { + "hrsh7th/nvim-cmp", + version = false, -- last release is way too old + event = "InsertEnter", + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "onsails/lspkind.nvim", + }, + opts = function() + local cmp = require("cmp") + local defaults = require("cmp.config.default")() + local auto_select = true + return { + auto_brackets = {}, + completion = { + completeopt = "menu,menuone,noinsert" .. (auto_select and "" or ",noselect"), + }, + preselect = auto_select and cmp.PreselectMode.Item or cmp.PreselectMode.none, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), + [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.confirm({ select = auto_select }), + [""] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + [""] = function(fallback) + cmp.abort() + fallback() + end, + [""] = function(fallback) + local luasnip = require("luasnip") + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, + }), + sources = cmp.config.sources( + { + { name = "lazydev" }, + { name = "nvim_lsp" }, + { name = "path" }, + }, + { + { name = "buffer" }, + { name = "cmdline" }, + } + ), + sorting = defaults.sorting, + } + end + -- opts = { + -- completion = { + -- winhighlight = "Normal:Pmenu,FloatBordeer:Pmenu,Search:None", + -- col_offset = -3, + -- side_padding = 0, + -- completeopt = "menu,menuone,noinsert,noselect", + -- }, + -- formatting = { + -- fields = { "kind", "abbr", "menu" }, + -- format = function(entry, vim_item) + -- local lspkind = require("lspkind") + -- local kind = lspkind.cmp_format({ + -- mode = "symbol_text", + -- max_width = 50, + -- })(entry, vim_item) + -- local strings = vim.split(kind.kind, "%s", { trimempty = true }) + -- kind.kind = " " .. (strings[1] or "") .. " " + -- kind.menu = " (" .. (strings[2] or "") .. ")" + -- + -- return vim_item + -- -- return kind + -- end + -- }, + -- }, +} + + -- opts = function() + -- vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true }) + -- local cmp = require("cmp") + -- local defaults = require("cmp.config.default")() + -- local auto_select = true + -- return { + -- auto_brackets = {}, -- configure any filetype to auto add brackets + -- completion = { + -- completeopt = "menu,menuone,noinsert" .. (auto_select and "" or ",noselect"), + -- max_height = 10, + -- max_width = 80, + -- }, + -- preselect = auto_select and cmp.PreselectMode.Item or cmp.PreselectMode.None, + -- mapping = cmp.mapping.preset.insert({ + -- [""] = cmp.mapping.scroll_docs(-4), + -- [""] = cmp.mapping.scroll_docs(4), + -- [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), + -- [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), + -- [""] = cmp.mapping.complete(), + -- [""] = cmp.mapping.confirm({ select = auto_select }), + -- [""] = cmp.mapping.confirm({ select = true }), + -- [""] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + -- [""] = function(fallback) + -- cmp.abort() + -- fallback() + -- end, + -- [""] = function(fallback) + -- local luasnip = require("luasnip") + -- if cmp.visible() then + -- cmp.select_next_item() + -- elseif luasnip.expand_or_jumpable() then + -- luasnip.expand_or_jump() + -- else + -- fallback() + -- end + -- end, + -- }), + -- sources = cmp.config.sources({ + -- { name = "lazydev" }, + -- { name = "nvim_lsp", }, + -- { name = "path" }, + -- }, { + -- { name = "buffer" }, + -- }), + -- sorting = defaults.sorting, + -- formatting = { + -- format = function(entry, vim_item) + -- local label = vim_item.abbr + -- local truncated_label = vim.fn.strcharpart(label, 0, 20) + -- if truncated_label ~= label then + -- vim_item.abbr = truncated_label .. "..." + -- elseif string.len(label) < 20 then + -- local padding = string.rep(" ", 20 - string.len(label)) + -- vim_item.abbr = label .. padding + -- end + -- return vim_item + -- end, + -- } + -- } + -- end, + -- main = "lazyvim.util.cmp", +-- } diff --git a/nvim/lua/plugins/oil.lua b/nvim/lua/plugins/oil.lua new file mode 100644 index 0000000..044ccfa --- /dev/null +++ b/nvim/lua/plugins/oil.lua @@ -0,0 +1,22 @@ +return { + 'stevearc/oil.nvim', + opts = { + float = { + max_width = 80, + max_height = 20, + border = "rounded", + }, + preview_win = { + update_on_cursor_moved = true, + preview_method = "fast_scratch", + }, + delete_to_trash = true, + watch_for_changes = true, + }, + dependencies = { { "echasnovski/mini.icons", opts = {} } }, + lazy = false, + keys = { + { "do", "Oil --float", desc = "Open floating Oil" }, + }, +} + diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..c7fc00b --- /dev/null +++ b/nvim/lua/plugins/telescope.lua @@ -0,0 +1,26 @@ +return { + 'nvim-telescope/telescope.nvim', + version = false, + dependencies = { 'nvim-lua/plenary.nvim' }, + opts = { + defaults = { + path_display = { "smart" }, + }, + pickers = { + buffers = { + path_display = "short", + sort_mru = true, + ignore_current_buffer = true, + previewer = false, + layout_config = { + width = 80, + height = 10, + prompt_position = "top", + }, + prompt_title = false, + results_title = false, + preview_title = false, + }, + }, + }, +} diff --git a/nvim/lua/plugins/toggleterm.lua b/nvim/lua/plugins/toggleterm.lua new file mode 100644 index 0000000..50d230e --- /dev/null +++ b/nvim/lua/plugins/toggleterm.lua @@ -0,0 +1,15 @@ +return { + "akinsho/toggleterm.nvim", + version = "*", + opts = { + direction = "float", + open_mapping = [[]], + float_opts = { + border = "curved", + width = 80, + height = 20, + }, + hide_numbers = true, + }, + config = true, +} diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..e2e64c6 --- /dev/null +++ b/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,14 @@ +return { + 'nvim-treesitter/nvim-treesitter', + lazy = false, + branch = 'main', + build = ':TSUpdate', + opts = { + ensure_installed = { "lua", "vim", "json" }, + highlight = { enable = true }, + indent = { enable = true }, + config = function(_, opts) + require("nvim-treesitter.configs").setup(opts) + end, + }, +}