diff --git a/nvim/init.lua b/nvim/init.lua old mode 100755 new mode 100644 index c8117c7..b829ccc --- a/nvim/init.lua +++ b/nvim/init.lua @@ -1,2 +1 @@ -require "enrique.core" -require "enrique.lazy" +require('config.lazy') diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json old mode 100755 new mode 100644 index 9e86897..cc7259b --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,62 +1,34 @@ { - "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "LuaSnip": { "branch": "master", "commit": "45db5addf8d0a201e1cf247cae4cdce605ad3768" }, - "aerial.nvim": { "branch": "master", "commit": "fa75fd0286788c6c5a65ec46aafbfaf7b7826b74" }, - "alpha-nvim": { "branch": "main", "commit": "b6f4129302db197a7249e67a90de3f2b676de13e" }, - "auto-session": { "branch": "main", "commit": "a90aa7730efa60fdcc7e00497a8f36d94a6da709" }, - "barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" }, - "bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" }, - "bufferline.nvim": { "branch": "main", "commit": "0b2fd861eee7595015b6561dade52fb060be10c4" }, - "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" }, - "dart-tools.nvim": { "branch": "main", "commit": "34f4835d42213ab3fb85995296bf25bd0e8712fa" }, - "dracula.nvim": { "branch": "main", "commit": "3426d73411806f73b85f706b9b48123deeb0836c" }, - "dressing.nvim": { "branch": "master", "commit": "c5775a888adbc50652cb370073fcfec963eca93e" }, - "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, - "flutter-tools.nvim": { "branch": "main", "commit": "ea1d398f543a54ba95357c3b8bb9d6f68eaec36c" }, - "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, - "guess-indent.nvim": { "branch": "main", "commit": "6cd61f7a600bb756e558627cd2e740302c58e32d" }, - "indent-blankline.nvim": { "branch": "master", "commit": "18603eb949eba08300799f64027af11ef922283f" }, + "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, + "blink-emoji.nvim": { "branch": "master", "commit": "a77aebc092ebece1eed108f301452ae774d6b67a" }, + "blink.cmp": { "branch": "main", "commit": "cb5e346d9e0efa7a3eee7fd4da0b690c48d2a98e" }, + "conform.nvim": { "branch": "master", "commit": "372fc521f8421b7830ea6db4d6ea3bae1c77548c" }, + "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, + "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, + "flutter-tools.nvim": { "branch": "main", "commit": "6faf2c70bd56f1fe78620591a2bb73f4dc6f4870" }, + "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, + "fzf-lua": { "branch": "main", "commit": "b11467c3fbfe48e4a815e4909f5c4e5b413ce6d0" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, - "lspkind.nvim": { "branch": "master", "commit": "cff4ae321a91ee3473a92ea1a8c637e3a9510aec" }, - "lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, - "mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" }, - "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" }, - "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, - "noice.nvim": { "branch": "main", "commit": "448bb9c524a7601035449210838e374a30153172" }, - "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, - "nvim-autopairs": { "branch": "master", "commit": "fd2badc24e675f947162a16c124d395bde80dbd6" }, - "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, - "nvim-lint": { "branch": "master", "commit": "a7ce9c78a7c710c28bee56dfab10a5c0c80b7fb5" }, - "nvim-lsp-file-operations": { "branch": "master", "commit": "92a673de7ecaa157dd230d0128def10beb56d103" }, - "nvim-lspconfig": { "branch": "master", "commit": "056f569f71e4b726323b799b9cfacc53653bceb3" }, - "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, - "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, - "nvim-osc52": { "branch": "main", "commit": "04cfaba1865ae5c53b6f887c3ca7304973824fb2" }, - "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, - "nvim-treesitter": { "branch": "master", "commit": "6a3c6a42a6e24414bdf337b05a84a0ea013dd155" }, - "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "375c2d86cee6674afd75b4f727ce3a80065552f7" }, - "nvim-web-devicons": { "branch": "master", "commit": "9793801f974bba70e4ac5d7eae6c4f5659993d8e" }, - "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" }, - "quickfixdd": { "branch": "master", "commit": "cc1adb7e7e9f4827cd655f6b1c05fadedaa87f45" }, - "substitute.nvim": { "branch": "main", "commit": "97f49d16f8eea7967d41db4f657dd63af53eeba1" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, - "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, - "todo-comments.nvim": { "branch": "main", "commit": "319c01b99b7a8c9ac2066bf0efd4d6ec68fef444" }, - "tokyonight.nvim": { "branch": "main", "commit": "4b386e66a9599057587c30538d5e6192e3d1c181" }, - "trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" }, - "vim-dadbod": { "branch": "master", "commit": "7888cb7164d69783d3dce4e0283decd26b82538b" }, - "vim-dadbod-completion": { "branch": "master", "commit": "880f7e9f2959e567c718d52550f9fae1aa07aa81" }, - "vim-dadbod-ui": { "branch": "master", "commit": "a5ff8bd69fcaf53cd24827b54492c8ce87806d18" }, - "vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" }, - "vim-maximizer": { "branch": "master", "commit": "2e54952fe91e140a2e69f35f22131219fcd9c5f1" }, - "vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" }, - "which-key.nvim": { "branch": "main", "commit": "bfec3d6bc0a9b0b2cb11644642f78c2c3915eef0" } + "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "1255518cb067e038a4755f5cb3e980f79b6ab89c" }, + "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, + "mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" }, + "mini.notify": { "branch": "main", "commit": "3a06b21dd0b335b95d125eae813276113b5e9ce7" }, + "mini.nvim": { "branch": "main", "commit": "0420076298c4457f200c2de468f65d080597a347" }, + "noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" }, + "nui.nvim": { "branch": "main", "commit": "8d5b0b568517935d3c84f257f272ef004d9f5a59" }, + "nvim-lspconfig": { "branch": "master", "commit": "94d0fec9135719e046903bbbbf8f39e3d3436d4e" }, + "nvim-treesitter": { "branch": "master", "commit": "94ea4f436d2b59c80f02e293466c374584f03b8c" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "ed373482db797bbf71bdff37a15c7555a84dce47" }, + "nvim-web-devicons": { "branch": "master", "commit": "50b5b06bff13a9b4eab946de7c7033649a6618a1" }, + "oil.nvim": { "branch": "master", "commit": "685cdb4ffa74473d75a1b97451f8654ceeab0f4a" }, + "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" }, + "smear-cursor.nvim": { "branch": "main", "commit": "8820b313e49a018c7d56fc309c51363c0e9ae653" }, + "substitute.nvim": { "branch": "main", "commit": "9db749a880e3dd3b0eb57f698aa8f1e1630e1f25" }, + "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, + "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, + "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, + "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } } diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua new file mode 100644 index 0000000..52ebf26 --- /dev/null +++ b/nvim/lua/config/keymaps.lua @@ -0,0 +1,120 @@ +local wk = require("which-key") + +local function wkAdd(keys, func, desc, mode) + mode = mode or "n" + wk.add({ keys, func, desc = desc, mode = mode }) +end + +local function wkGroup(keys, group, modes) + modes = modes or { "n" } + wk.add({ keys, group = group, mode = modes }) +end + +-- NOTE misc keymaps +wkAdd("jj", "", "Exit insert mode", "i") +wkAdd("", "nohl", "Clear search") +wkAdd("n", "o", "Add new line") +wkAdd("N", "O", "Add new line above") +wkAdd("+", "", "Increment number by 1") +wkAdd("-", "", "Decrement number by 1") +wkAdd("W", "ee", "Oil --float", "Open file manager") +vim.keymap.set("t", "", "", { desc = "Exit terminal mode" }) + +-- NOTE Surround +wkGroup("w", "Wrap (quotes, brackets)") + +-- NOTE search +wkGroup("s", "Search") +wkAdd("sf", "FzfLua files", "Search files") +wkAdd("sz", "FzfLua builtin", "Search builtins") +wkAdd("sb", "FzfLua buffers", "Search buffers") +wkAdd("sw", "FzfLua live_grep", "Search word") +wkAdd("s/", "FzfLua grep_curbuf", "Search in current buffer") +wkAdd("ss", "FzfLua lsp_document_symbols", "Search document symbols") +wkAdd("sS", "FzfLua lsp_live_workspace_symbols", "Search workspace symbols") + +-- NOTE files and buffers +wkGroup("b", "Buffers") +wkAdd("bw", "w!", "Save current buffer") +wkAdd("bW", "wa!", "Save all buffers") +wkAdd("bq", "wq!", "Save and close current buffer") +wkAdd("bQ", "wqa!", "Save and close all buffers") +wkAdd("bx", "q!", "Exit current buffer without saving") +wkAdd("bX", "qa!", "Exit session without saving") +wkAdd("bn", "]b", "Go to next buffer") +wkAdd("bp", "[b", "Go to prev buffer") + +-- NOTE Diagnostics +wkGroup("d", "Diagnostics") +wkAdd("dd", function() + vim.diagnostic.open_float() +end, "Show line diagnostics") +wkAdd("dD", "FzfLua diagnostics_document", "Show document diagnostics") +wkAdd("dW", "FzfLua lsp_workspace_diagnostics", "Show workspace diagnostics") +wkAdd("dn", function() + vim.diagnostic.goto_next() +end, "Go to next diagnostic") +wkAdd("dp", function() + vim.diagnostic.goto_prev() +end, "Go to next diagnostic") + +-- NOTE Terminal +wkGroup("t", "Terminal") +wkAdd("tt", "ToggleTerm 1 name='dev' direction='float'", "Toggle terminal") +wkAdd("ta", "ToggleTermToggleAll", "Toggle all terminals") +wkAdd("th", "ToggleTerm 1 name='dev' direction='horizontal'", "Open horizontal terminal") +wkAdd("tv", "ToggleTerm 1 name='dev' direction='vertical'", "Open vertical terminal") +wkAdd("tp", "ToggleTerm 80 name='Posting' direction='float'", "Open Posting CLI") +wkAdd("tP", "TermExec 80 name='Posting' cmd='posting' direction='float'", "Init Posting CLI") + +-- NOTE Substitute +local substitute = require("substitute") +wkAdd("s", substitute.operator, "Substitute with motion") +wkAdd("ss", substitute.line, "Substitute line") +wkAdd("S", substitute.eol, "Substitute to end of line") +wkAdd("s", substitute.visual, "Substitute in visual mode", "x") + +wk.add({ + { -- Flutter + mode = { "n" }, + { "F", group = "Flutter" }, + -- { "Ff", "Telescope flutter commands", desc = "Show flutter commands" }, + { "Fo", "FlutterOutlineToggle", desc = "Show flutter outline" }, + { "Fd", "FlutterDevices", desc = "Show devices" }, + { "Fe", "FlutterEmulators", desc = "Show emulators" }, + { "Fq", "FlutterQuit", desc = "Quit flutter" }, + { "Fr", "FlutterReload", desc = "Hot reload" }, + { "FR", "FlutterRestart", desc = "Hot restart" }, + { "Fg", "FlutterPubGet", desc = "Pub get" }, + { "Fc", "FlutterLogClear", desc = "Clear logs" }, + { "FF", "FlutterRun", desc = "Flutter run!" }, + }, +}) + +-- -- 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 , which +-- -- is not what someone will guess without a bit more experience. +-- key.set('t', '', '', { desc = 'Exit terminal mode' }) +-- +-- -- TIP: Disable arrow keys in normal mode +-- -- vim.keymap.set('n', '', 'echo "Use h to move!!"') +-- -- vim.keymap.set('n', '', 'echo "Use l to move!!"') +-- -- vim.keymap.set('n', '', 'echo "Use k to move!!"') +-- -- vim.keymap.set('n', '', 'echo "Use j to move!!"') +-- +-- -- Keybinds to make split navigation easier. +-- -- Use CTRL+ to switch between windows +-- -- See `:help wincmd` for a list of all window commands +-- vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) +-- vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) +-- vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) +-- vim.keymap.set('n', '', '', { 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", "", "H", { desc = "Move window to the left" }) +-- -- vim.keymap.set("n", "", "L", { desc = "Move window to the right" }) +-- -- vim.keymap.set("n", "", "J", { desc = "Move window to the lower" }) +-- -- vim.keymap.set("n", "", "K", { desc = "Move window to the upper" }) +-- +-- end diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..a27a827 --- /dev/null +++ b/nvim/lua/config/lazy.lua @@ -0,0 +1,33 @@ +-- 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("config.options") + +-- Setup lazy.nvim +require("lazy").setup({ + spec = { + -- import your plugins + { import = "plugins" }, + }, + -- Configure any other settings here. See the documentation for more details. + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "tokyionight" } }, + -- automatically check for plugin updates + checker = { enabled = true }, +}) + +require("config.keymaps") diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua new file mode 100644 index 0000000..2335108 --- /dev/null +++ b/nvim/lua/config/options.lua @@ -0,0 +1,115 @@ +-- [[ Setting options ]] +-- See `:help vim.opt` +-- For more options, you can see `:help option-list` +local opt = vim.opt + +vim.g.mapleader = " " +vim.g.maplocalleader = " " + +-- Tabs +opt.expandtab = true -- Convert tabs to spaces +opt.shiftwidth = 2 -- Amount to indent with << and >> +opt.tabstop = 2 -- How many spaces are shown per Tab +opt.softtabstop = 2 -- How many spaces are applied when pressing Tab +opt.autoindent = true +opt.backspace = "indent,eol,start" + +-- Set to true if you have a Nerd Font installed and selected in the terminal +vim.g.have_nerd_font = true + +-- Make line numbers default +opt.number = true +opt.relativenumber = true + +-- Enable mouse mode, can be useful for resizing splits for example! +opt.mouse = "a" + +-- Don't show the mode, since it's already in the status line +opt.showmode = false + +-- Sync clipboard between OS and Neovim. +vim.schedule(function() + vim.opt.clipboard = "unnamedplus" +end) + +-- Enable break indent +opt.breakindent = true + +-- Save undo history +opt.undofile = true + +-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term +opt.ignorecase = true +opt.smartcase = true + +-- Keep signcolumn on by default +opt.signcolumn = "yes" + +-- Decrease update time +opt.updatetime = 250 + +-- Decrease mapped sequence wait time +-- opt.timeoutlen = 300 + +-- Configure how new splits should be opened +opt.splitright = true +opt.splitbelow = true + +-- Sets how neovim will display certain whitespace characters in the editor. +opt.list = true +opt.listchars = { tab = "» ", trail = "·", nbsp = "␣" } + +-- Preview substitutions live, as you type! +opt.inccommand = "split" + +-- Show which line your cursor is on +opt.cursorline = true + +-- Minimal number of screen lines to keep above and below the cursor. +opt.scrolloff = 10 + +opt.wrap = true +opt.termguicolors = true +vim.diagnostic.config({ + float = { border = "rounded" }, -- add border to diagnostic popups +}) + +-- Consider - as part of keyword +opt.iskeyword:append("-") + +-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`), +-- instead raise a dialog asking if you wish to save the current file(s) +-- opt.confirm = true + +-- [[ Basic Autocommands ]] +-- See `:help lua-guide-autocommands` + +-- Highlight when yanking (copying) text +-- See `:help vim.highlight.on_yank()` +vim.api.nvim_create_autocmd("TextYankPost", { + desc = "Highlight when yanking (copying) text", + group = vim.api.nvim_create_augroup("kickstart-highlight-yank", { clear = true }), + callback = function() + vim.highlight.on_yank() + end, +}) + +-- -- Open directories with oil floating window +-- vim.api.nvim_create_autocmd({ "VimEnter" }, { +-- pattern = { "*" }, +-- callback = function() +-- args = vim.v.argv +-- for i, arg in ipairs(args) do +-- print(arg) +-- isDirectory = vim.fn.isdirectory(arg) +-- +-- if isDirectory == 1 then +-- vim.cmd("bd") +-- vim.cmd("Oil --float " .. arg) +-- break +-- end +-- +-- end +-- +-- end, +-- }) diff --git a/nvim/lua/enrique/core/init.lua b/nvim/lua/enrique/core/init.lua deleted file mode 100755 index e3a865a..0000000 --- a/nvim/lua/enrique/core/init.lua +++ /dev/null @@ -1,2 +0,0 @@ -require("enrique.core.options") --- require("enrique.core.keymaps") diff --git a/nvim/lua/enrique/core/keymaps.lua b/nvim/lua/enrique/core/keymaps.lua deleted file mode 100755 index dfa8fd6..0000000 --- a/nvim/lua/enrique/core/keymaps.lua +++ /dev/null @@ -1,190 +0,0 @@ --- This is a function called from the which-key plugin config -return function () - local keymap = vim.keymap - local wk = require("which-key") - -- { "", "command", desc="decription", mode="n" }, -- single command example - - wk.add({ - -- Miscellaneous - { "ii", "", desc="Exit insert mode with ii", mode="i" }, - { "", "nohl", desc="Clear search highlights", mode="n" }, - { "n", "o", desc="Add new line", mode="n" }, - { "N", "O", desc="Add new line above", mode="n" }, - { "+", "", desc="Increment number by 1", mode="n" }, - { "-", "", desc="Decrement number by 1", mode="n" }, - -- Miscellaneous - - { -- File saves and exits - mode = { "n", "v" }, - { "f", group="Saves and exits" }, - { "fw", "w!", desc = "Save current file"}, - {"fW", "wa!", desc = "Save all files"}, - {"fq", "wq!", desc = "Save and exit current file"}, - {"fQ", "wqa!", desc = "Save and exit all files"}, - {"fx", "q!", desc = "Exit file without saving"}, - {"fX", "q!", desc = "Exit session without saving"}, - }, - - { -- Window management - mode = {"n"}, - { "w", group="Window management" }, - { "wv", "v", desc="Split window vertically" }, - { "wh", "s", desc="Split window horizontally" }, - { "we", "=", desc="Make splits equal size" }, - { "wx", "close", desc="Close current split" }, - { "wt", "+", desc="Make split taller" }, - { "ws", "-", desc="Make split shorter" }, - { "wn", "<", desc="Decrease split width" }, - { "ww", ">", desc="Increase split width" }, - { "w", "", desc="Move to left split" }, - { "w", "", desc="Move to top split" }, - { "w", "", desc="Move to bottom split" }, - { "w", "", desc="Move to right split" }, - { "wm", "MaximizerToggle", desc="Maximize/minimize window" }, - { "wR", "SessionRestore", desc="Restore session" }, - { "wS", "SessionSave", desc="Save session" }, - }, - - { -- Tab management - mode = {"n"}, - { "t", group="Tab management" }, - { "to", "tabnew", desc="Open new tab" }, - { "tx", "tabclose", desc="Close current tab" }, - { "tn", "tabn", desc="Go to next tab" }, - { "tp", "tabp", desc="Go to prev tab" }, - { "tb", "tabnew %", desc="Open currtent buffer in new tab" }, - }, - - { -- Quickfix - mode = {"n"}, - { "q", group="Quickfix" }, - { "qo", "copen", desc="Open quickfix list" }, - { "qf", "cfirst", desc="Jump to first quickfix list item" }, - { "qn", "cnext", desc="Jump to next quickfix list item" }, - { "qp", "cprev", desc="Jump to prev quickfix list item" }, - { "ql", "clast", desc="Jump to last quickfix list item" }, - { "qc", "cclose", desc="Close quickfix list" }, - }, - - { -- Neotree - mode = {"n"}, - { "e", group="File tree" }, - { "ee", "Neotree toggle filesystem reveal left", desc="Toggle file tree" }, - { "ef", "Neotree focus", desc="Focus to file tree" }, - }, - - { -- Telescope - mode = {"n"}, - { "s", group="Search" }, - { "sf", "Telescope find_files", desc="Search files" }, - { "sg", "Telescope live_grep", desc="Search word (livegrep)" }, - { "sb", "Telescope buffers", desc="Search buffers" }, - { "sh", "Telescope help_tags", desc="Search help" }, - { "sk", "Telescope keymaps", desc="Search keymaps" }, - { "sw", "Telescope current_buffer_fuzzy_find", desc="Fuzzy search current buffer" }, - { "ss", "Telescope lsp_document_symbols", desc="Search LSP symbols (current buffer)" }, - { "sp", "Telescope builtin", desc="Select a telescope picker and run it" }, - { "st", function () - require("telescope.builtin").treesitter({ default_text = "" }) - end, desc="Telescope treesitter" }, - { "C", "Telescope colorscheme", desc="Change colorscheme" }, - }, - - { -- Language server - mode = {"n"}, - { "c", group="LSP & Code actions"}, - { "cc", "lua vim.lsp.buf.completion()", desc="Toggle LSP completion" }, - { "ch", "lua vim.lsp.buf.hover()", desc="Toggle LSP hover (documentation)" }, - { "cd", "lua vim.lsp.buf.definition()", desc="Go to definition" }, - { "cD", "lua vim.lsp.buf.declaration()", desc="Go to declaration" }, - { "ci", "Telescope lsp_implementations", desc="Show LSP implementations" }, - { "ct", "Telescope lsp_type_definitions", desc="Show LSP type definitions" }, - { "cy", "AerialToggle", desc="Toggle aerial symbols list" }, - { "cR", "Telescope lsp_references", desc="List all references of symbol" }, - { "cs", "lua vim.lsp.buf.signature_help()", desc="Display signature info under cursor" }, - { "cr", "lua vim.lsp.buf.rename()", desc="Rename" }, - { "cf", "lua vim.lsp.buf.format()", desc="Format current buffer" }, - { "cl", function () require("lint").try_lint() end, desc="Trigger linting for current buffer" }, - { "ca", "lua vim.lsp.buf.code_action()", desc="Code actions" }, - { "cL", "LspRestart", desc="Restart LSP" }, - }, - - { -- Diagnostics - mode = {"n"}, - { "d", group="Diagnostics" }, - { "dD", "Telescope diagnostics bufnr=0", desc="Show buffer diagnostics" }, - { "dd", "lua vim.diagnostic.open_float()", desc="Show diagnostics in floating window" }, - { "dn", "lua vim.diagnostic.goto_next()", desc="Go to next diagnostic" }, - { "dp", "lua vim.diagnostic.goto_prev()", desc="Go to prev diagnostic" }, - }, - - { -- Database - mode = {"n"}, - { "D", group="Dadbod SQL database"}, - { "Db", "DBUIToggle", desc="Toggle dadbod UI"}, - { "Da", "DBUIAddConnection", desc="Add new database connection"}, - }, - - { --Bufferline - mode = {"n"}, - { "b", group="Buffer" }, - { "bp", "BufferLineTogglePin", desc = "Toggle Pin" }, - { "bP", "BufferLineGroupClose ungrouped", desc = "Delete Non-Pinned Buffers" }, - { "bo", "BufferLineCloseOthers", desc = "Delete Other Buffers" }, - { "br", "BufferLineCloseRight", desc = "Delete Buffers to the Right" }, - { "bl", "BufferLineCloseLeft", desc = "Delete Buffers to the Left" }, - { "", "BufferLineCyclePrev", desc = "Prev Buffer" }, - { "", "BufferLineCycleNext", desc = "Next Buffer" }, - { "b", "BufferLineCyclePrev", desc = "Prev Buffer" }, - { "b", "BufferLineCycleNext", desc = "Next Buffer" }, - }, - - { -- TODO comments - mode = {"n"}, - { "t", group="TODO" }, - { "tt", "TodoTelescope", desc = "Show todos" }, - { "tn", function() require("todo-comments").jump_next() end, desc="Next todo comment" }, - { "tp", function() require("todo-comments").jump_prev() end, desc="Previous todo comment" }, - }, - - { -- Trouble - { "x", group="Trouble" }, - { "xx", "Trouble diagnostics toggle", desc = "Open/close trouble list" }, - { "xL", "Trouble loclist toggle", desc = "Open trouble location list diagnostics" }, - { - "xd", - "Trouble diagnostics toggle filter.buf=0", - desc = "Open trouble document diagnostics", - }, - { "xq", "Trouble qflist toggle", desc = "Open trouble quickfix list" }, - { - "xl", - "Trouble lsp toggle focus=false win.position=right", - desc = "LSP Definitions / references (Trouble)", - }, - { "xt", "TodoTrouble", desc = "Open todos in trouble" }, - }, - - { -- Flutter - mode = {"n"}, - { "F", group="Flutter" }, - { "Ff", "Telescope flutter commands", desc="Show flutter commands" }, - { "Fo", "FlutterOutlineToggle", desc="Show flutter outline" }, - { "Fd", "FlutterDevices", desc="Show devices" }, - { "Fe", "FlutterEmulators", desc="Show emulators" }, - { "Fq", "FlutterQuit", desc="Quit flutter" }, - { "Fr", "FlutterReload", desc="Hot reload" }, - { "FR", "FlutterRestart", desc="Hot restart" }, - { "Fg", "FlutterPubGet", desc="Pub get" }, - { "Fc", "FlutterLogClear", desc="Clear logs" }, - { "FF", "FlutterRun", desc="Flutter run!" }, - }, - }) - -- Substitute - local substitute = require("substitute") - vim.keymap.set("n", "s", substitute.operator, { desc = "Substitute with motion" }) - vim.keymap.set("n", "ss", substitute.line, { desc = "Substitute line" }) - vim.keymap.set("n", "S", substitute.eol, { desc = "Substitute to end of line" }) - vim.keymap.set("x", "s", substitute.visual, { desc = "Substitute in visual mode" }) -end - diff --git a/nvim/lua/enrique/core/keymaps.lua.bak b/nvim/lua/enrique/core/keymaps.lua.bak deleted file mode 100755 index 919abc3..0000000 --- a/nvim/lua/enrique/core/keymaps.lua.bak +++ /dev/null @@ -1,106 +0,0 @@ -vim.g.mapleader = " " -local keymap = vim.keymap - --- General keymaps --- keymap.set("i", "jk", "", { desc = "Exit insert mode eith jk" }) --- keymap.set("i", "ii", "", { desc = "exit insert mode with ii" }) -keymap.set("n", "", ":nohl", { desc = "Clear search highlights" }) -keymap.set("n", "n", "o", { desc = "Add new line" }) -keymap.set("n", "N", "O", { desc = "Add new line above" }) - --- File saves and exits --- keymap.set("n", "wq", ":wq", { desc = "save and quit" }) --- keymap.set("n", "wqa", ":wqa", { desc = "save all and quit" }) --- keymap.set("n", "qq", ":q!", { desc = "quit without saving" }) --- keymap.set("n", "ww", ":w", { desc = "save" }) - --- increment/decrement numbers -keymap.set("n", "+", "", { desc = "Incrment number by 1" }) -keymap.set("n", "-", "", { desc = "Decrment number by 1" }) - --- Split window management -keymap.set("n", "sv", "v", { desc = "Split window vertically" }) -keymap.set("n", "sh", "s", { desc = "Split window horizontally" }) -keymap.set("n", "se", "=", { desc = "Make splits equal size" }) -keymap.set("n", "sx", "close", { desc = "Close current split" }) -keymap.set("n", "", "-", { desc = "make split window height shorter" }) -keymap.set("n", "", "+", { desc = "make split windows height taller" }) -keymap.set("n", "", "3>", { desc = "make split windows width bigger" }) -keymap.set("n", "", "3<", { desc = "make split windows width smaller" }) -keymap.set("n", "", "", { desc = "Move to left split" }) -keymap.set("n", "", "", { desc = "Move to right split" }) -keymap.set("n", "", "", { desc = "Move to top split" }) -keymap.set("n", "", "", { desc = "Move to bottom split" }) - --- Tab management -keymap.set("n", "to", "tabnew", { desc = "Open new tab" }) -- open new tab -keymap.set("n", "tx", "tabclose", { desc = "Close current tab" }) -- close current tab -keymap.set("n", "tn", "tabn", { desc = "Go to next tab" }) -- go to next tab -keymap.set("n", "tp", "tabp", { desc = "Go to previous tab" }) -- go to previous tab -keymap.set("n", "tf", "tabnew %", { desc = "Open current buffer in new tab" }) -- move current buffer to new tab -keymap.set("n", "sm", ":MaximizerToggle", { desc = "toggle maximize tab" }) - --- Diff keymaps -keymap.set("n", "cc", ":diffput", { desc = "put diff from current to other during diff" }) -keymap.set("n", "cj", ":diffget 1", { desc = "get diff from left (local) during merge" }) -keymap.set("n", "ck", ":diffget 3", { desc = "get diff from right (remote) during merge" }) -keymap.set("n", "cn", "]c", { desc = "next diff hunk" }) -keymap.set("n", "cp", "[c", { desc = "previous diff hunk" }) - --- Quickfix keymaps -keymap.set("n", "qo", ":copen", { desc = "open quickfix list" }) -keymap.set("n", "qf", ":cfirst", { desc = "jump to first quickfix list item" }) -keymap.set("n", "qn", ":cnext", { desc = "jump to next quickfix list item" }) -keymap.set("n", "qp", ":cprev", { desc = "jump to prev quickfix list item" }) -keymap.set("n", "ql", ":clast", { desc = "jump to last quickfix list item" }) -keymap.set("n", "qc", ":cclose", { desc = "close quickfix list" }) - --- Nvim-tree -keymap.set("n", "ee", ":NvimTreeToggle", { desc = "toggle file explorer" }) -keymap.set("n", "er", ":NvimTreeFocus", { desc = "toggle focus to file explorer" }) -keymap.set("n", "ef", ":NvimTreeFindFile", { desc = "find file in file explorer" }) - --- Telescope -keymap.set("n", "ff", "Telescope find_files", { desc = "Find files" }) -keymap.set("n", "fg", "Telescope live_grep", { desc = "Live grep" }) -keymap.set("n", "fb", "Telescope buffers", { desc = "Find buffers" }) -keymap.set("n", "fh", "Telescope help_tags", { desc = "Help tags" }) -keymap.set("n", "fs", "Telescope current_buffer_fuzzy_find", { desc = "Fuzzy find current buffer" }) -keymap.set("n", "fo", "Telescope lsp_document_symbols", { desc = "Lsp document symbols" }) -keymap.set("n", "fi", "Telescope lsp_incoming_calls", { desc = "Lsp incoming calls" }) -keymap.set("n", "fm", function() - require("telescope.builtin").treesitter({ default_text = "" }) -end, { desc = "Telescope treesitter" }) - --- LSP -keymap.set("n", "gg", "lua vim.lsp.buf.hover()") -keymap.set("n", "gd", "lua vim.lsp.buf.definition()") -keymap.set("n", "gD", "lua vim.lsp.buf.declaration()") -keymap.set("n", "gi", "lua vim.lsp.buf.implementation()") -keymap.set("n", "gt", "lua vim.lsp.buf.type_definition()") -keymap.set("n", "gr", "lua vim.lsp.buf.references()") -keymap.set("n", "gs", "lua vim.lsp.buf.signature_help()") -keymap.set("n", "rr", "lua vim.lsp.buf.rename()") -keymap.set("n", "gf", "lua vim.lsp.buf.format({async = true})") -keymap.set("v", "gf", "lua vim.lsp.buf.format({async = true})") -keymap.set("n", "ga", "lua vim.lsp.buf.code_action()") -keymap.set("n", "gl", "lua vim.diagnostic.open_float()") -keymap.set("n", "gp", "lua vim.diagnostic.goto_prev()") -keymap.set("n", "gn", "lua vim.diagnostic.goto_next()") -keymap.set("n", "tr", "lua vim.lsp.buf.document_symbol()") -keymap.set("i", "", "lua vim.lsp.buf.completion()") - --- Database -keymap.set("n", "db", function() - vim.cmd("tabnew") - vim.cmd("DBUIToggle") -end, { desc = "Open dadbod in new tab" }) -keymap.set("n", "dt", function() - vim.cmd("DBUIToggle") -end, { desc = "Toggle dabase ui" }) -keymap.set("n", "da", function() - vim.cmd("DBUIAddConnection") -end, { desc = "Add new database connection" }) - --- Aerial -keymap.set("n", "a", "AerialToggle!", { desc = "Toggle aerial (symbols)" }) diff --git a/nvim/lua/enrique/core/options.lua b/nvim/lua/enrique/core/options.lua deleted file mode 100755 index 81b6784..0000000 --- a/nvim/lua/enrique/core/options.lua +++ /dev/null @@ -1,49 +0,0 @@ -vim.cmd("let g:netrw_liststyle = 3") -local opt = vim.opt -vim.g.mapleader = " " --- Session Management -opt.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions" -vim.api.nvim_set_keymap('i', '', 'lua print(vim.inspect(require("cmp").config.window))', {noremap = true, silent = true}) --- line nuembers -opt.relativenumber = true -opt.number = true - --- tabs & indentation -opt.tabstop = 2 -opt.shiftwidth = 2 -opt.softtabstop = 2 -opt.expandtab = true -opt.autoindent = true - --- search settings -opt.ignorecase = true -opt.smartcase = true - --- backspace -opt.backspace = "indent,eol,start" - ---clipborad -opt.clipboard:append("unnamedplus") - --- split windows -opt.splitright = true -opt.splitbelow = true - --- other settings -opt.wrap = true -opt.cursorline = true -opt.termguicolors = true -opt.signcolumn = "yes" -opt.scrolloff = 10 -vim.diagnostic.config({ - float = { border = "rounded" }, -- add border to diagnostic popups -}) --- opt.background = "dark" - --- Consider - as part of keyword -opt.iskeyword:append("-") - --- Folding -opt.foldlevel = 25 --- opt.foldmethod = "expr" --- opt.foldexpr = "nvim_treesitter#foldexpr()" -- Utilize Treesitter folds diff --git a/nvim/lua/enrique/lazy.lua b/nvim/lua/enrique/lazy.lua deleted file mode 100755 index 53a8926..0000000 --- a/nvim/lua/enrique/lazy.lua +++ /dev/null @@ -1,22 +0,0 @@ -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not (vim.uv or 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) - -require("lazy").setup({ { import = "enrique.plugins" }, { import = "enrique.plugins.lsp" } }, { - checker = { - enabled = true, - notify = false, - }, - change_detection = { - notify = false, - }, -}) diff --git a/nvim/lua/enrique/plugins/aerial.lua b/nvim/lua/enrique/plugins/aerial.lua deleted file mode 100755 index 3cd5d20..0000000 --- a/nvim/lua/enrique/plugins/aerial.lua +++ /dev/null @@ -1,62 +0,0 @@ -return { - 'stevearc/aerial.nvim', - opts = function () - require("aerial").setup({ - -- optionally use on_attach to set keymaps when aerial has attached to a buffer - on_attach = function(bufnr) - -- Jump forwards/backwards with '{' and '}' - vim.keymap.set("n", "{", "AerialPrev", { buffer = bufnr }) - vim.keymap.set("n", "}", "AerialNext", { buffer = bufnr }) - end, - max_width = { 40, 0.2 }, - backends = { "treesitter", "lsp" }, - default_direction = "float", - float = { - border = "rounded", - - -- Determines location of floating window - -- cursor - Opens float on top of the cursor - -- editor - Opens float centered in the editor - -- win - Opens float centered in the window - relative = "cursor", - - -- These control the height of the floating window. - -- They can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) - -- min_height and max_height can be a list of mixed types. - -- min_height = {8, 0.1} means "the greater of 8 rows or 10% of total" - max_height = 0.9, - height = nil, - min_height = { 8, 0.1 }, - - override = function(conf, source_winid) - -- This is the config that will be passed to nvim_open_win. - -- Change values here to customize the layout - return conf - end, - }, - }) - -- You probably also want to set a keymap to toggle aerial - - -- require("telescope").setup({ - -- extensions = { - -- aerial = { - -- -- How to format the symbols - -- format_symbol = function(symbol_path, filetype) - -- if filetype == "json" or filetype == "yaml" then - -- return table.concat(symbol_path, ".") - -- else - -- return symbol_path[#symbol_path] - -- end - -- end, - -- -- Available modes: symbols, lines, both - -- show_columns = "both", - -- }, - -- }, - -- }) - end, - -- Optional dependencies - dependencies = { - "nvim-treesitter/nvim-treesitter", - "nvim-tree/nvim-web-devicons" - }, -} diff --git a/nvim/lua/enrique/plugins/alpha.lua b/nvim/lua/enrique/plugins/alpha.lua deleted file mode 100755 index 1606092..0000000 --- a/nvim/lua/enrique/plugins/alpha.lua +++ /dev/null @@ -1,36 +0,0 @@ -return { - "goolord/alpha-nvim", - event = "VimEnter", - config = function() - local alpha = require("alpha") - local dashboard = require("alpha.themes.dashboard") - - -- Set header - dashboard.section.header.val = { - " ", - " ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ", - " ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ", - " ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ", - " ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ", - " ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ", - " ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ", - " ", - } - - -- Set menu - dashboard.section.buttons.val = { - dashboard.button("SPC ee", " > Toggle file explorer", ":Neotree toggle filesystem reveal left"), - dashboard.button("SPC ff", "󰱼 > Find File", "Telescope find_files"), - dashboard.button("e", " > New File", "ene"), - dashboard.button("SPC fs", " > Find Word", "Telescope live_grep"), - dashboard.button("SPC wr", "󰁯 > Restore Session For Current Directory", "SessionRestore"), - dashboard.button("q", " > Quit NVIM", "qa"), - } - - -- Send config to alpha - alpha.setup(dashboard.opts) - - -- Disable folding on alpha buffer - vim.cmd([[autocmd FileType alpha setlocal nofoldenable]]) - end, -} diff --git a/nvim/lua/enrique/plugins/auto-session.lua b/nvim/lua/enrique/plugins/auto-session.lua deleted file mode 100755 index d91088b..0000000 --- a/nvim/lua/enrique/plugins/auto-session.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - "rmagatti/auto-session", - config = function() - local auto_session = require("auto-session") - - auto_session.setup({ - auto_restore_enabled = false, - auto_session_suppress_dirs = { "~/", "~/Dev/", "~/Downloads", "~/Documents", "~/Desktop/" }, - }) - - local keymap = vim.keymap - - keymap.set("n", "wr", "SessionRestore", { desc = "Restore session for" }) - keymap.set("n", "ws", "SessionSave", { desc = "Save session for auto session" }) - end, -} diff --git a/nvim/lua/enrique/plugins/autopairs.lua b/nvim/lua/enrique/plugins/autopairs.lua deleted file mode 100755 index 8ee54b3..0000000 --- a/nvim/lua/enrique/plugins/autopairs.lua +++ /dev/null @@ -1,30 +0,0 @@ -return { - "windwp/nvim-autopairs", - event = { "InsertEnter" }, - dependencies = { - "hrsh7th/nvim-cmp", - }, - config = function() - -- import nvim-autopairs - local autopairs = require("nvim-autopairs") - - -- configure autopairs - autopairs.setup({ - check_ts = true, -- enable treesitter - ts_config = { - lua = { "string" }, -- don't add pairs in lua string treesitter nodes - javascript = { "template_string" }, -- don't add pairs in javscript template_string treesitter nodes - java = false, -- don't check treesitter on java - }, - }) - - -- import nvim-autopairs completion functionality - local cmp_autopairs = require("nvim-autopairs.completion.cmp") - - -- import nvim-cmp plugin (completions plugin) - local cmp = require("cmp") - - -- make autopairs and completion work together - cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) - end, -} diff --git a/nvim/lua/enrique/plugins/barbecue.lua b/nvim/lua/enrique/plugins/barbecue.lua deleted file mode 100755 index 6cf61c2..0000000 --- a/nvim/lua/enrique/plugins/barbecue.lua +++ /dev/null @@ -1,31 +0,0 @@ --- Display LSP-based breadcrumbs -return { - -- https://github.com/utilyre/barbecue.nvim - "utilyre/barbecue.nvim", - name = "barbecue", - version = "*", - dependencies = { - -- https://github.com/SmiteshP/nvim-navic - "SmiteshP/nvim-navic", - -- https://github.com/nvim-tree/nvim-web-devicons - "nvim-tree/nvim-web-devicons", -- optional dependency - }, - opts = { - ---@type boolean - show_dirname = false, - ---@type boolean - show_basename = false, - - symbols = { - ---Modification indicator. - ---@type string - modified = "●", - ---Truncation indicator. - ---@type string - ellipsis = "…", - ---Entry separator. - ---@type string - separator = "", - }, - }, -} diff --git a/nvim/lua/enrique/plugins/bigfile.lua b/nvim/lua/enrique/plugins/bigfile.lua deleted file mode 100755 index 2ee8ceb..0000000 --- a/nvim/lua/enrique/plugins/bigfile.lua +++ /dev/null @@ -1,12 +0,0 @@ --- Improve performance of editing big files -return { - -- https://github.com/LunarVim/bigfile.nvim - "LunarVim/bigfile.nvim", - event = "BufReadPre", - opts = { - filesize = 2, -- size of the file in MiB, the plugin round file sizes to the closest MiB - }, - config = function(_, opts) - require("bigfile").setup(opts) - end, -} diff --git a/nvim/lua/enrique/plugins/bufferline.lua b/nvim/lua/enrique/plugins/bufferline.lua deleted file mode 100755 index 6862371..0000000 --- a/nvim/lua/enrique/plugins/bufferline.lua +++ /dev/null @@ -1,28 +0,0 @@ -return { - "akinsho/bufferline.nvim", - event = "VeryLazy", - opts = { - options = { - offsets = { - { - filetype = "neo-tree", - text = "Neo-tree", - highlight = "Directory", - text_align = "left", - }, - }, - indicator = { icon = "  ", style = "icon" }, - }, - }, - config = function(_, opts) - require("bufferline").setup(opts) - -- Fix bufferline when restoring a session - vim.api.nvim_create_autocmd({ "BufAdd", "BufDelete" }, { - callback = function() - vim.schedule(function() - pcall(nvim_bufferline) - end) - end, - }) - end, -} diff --git a/nvim/lua/enrique/plugins/cholorscheme.lua b/nvim/lua/enrique/plugins/cholorscheme.lua deleted file mode 100755 index 7290dc3..0000000 --- a/nvim/lua/enrique/plugins/cholorscheme.lua +++ /dev/null @@ -1,53 +0,0 @@ -return { - { - "binhtran432k/dracula.nvim", - lazy = false, - priority = 1000, - opts = {}, - config = function() - require("dracula").setup({ - style = "default", -- The theme comes in three styles, `default`, a darker variant `soft` and `day` - transparent = true, -- Enable this to disable setting the background color - terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim - styles = { - variables = {}, - -- Background styles. Can be "dark", "transparent" or "normal" - sidebars = "transparent", -- style for sidebars, see below - floats = "normal", -- style for floating windows - }, - dim_inactive = false, -- dims inactive windows - lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold - - }) - -- vim.cmd[[colorscheme dracula]] - end - }, - - { - -- Tokio Night - "folke/tokyonight.nvim", - lazy = false, - priority = 1000, - opts = {}, - config = function() - require ("tokyonight").setup({ - syle = "storm", -- storm, moon, night, day - light_style = "day", - transparent = true, - terminal_colors = true, - -- Background styles. Can be "dark", "transparent" or "normal" - styles = { - sidebars = "transparent", - floats = "normal", - }, - day_brightness = 0.9, -- Adjusts the brightness of the **Day** style - dim_inactive = false, -- dims inactive windows - lualine_bold = true, -- Lualine theme will be bold - }) - vim.cmd[[ - colorscheme tokyonight - hi CocUnusedHighlight cterm=underline gui=underline - ]] - end - } -} diff --git a/nvim/lua/enrique/plugins/comment.lua b/nvim/lua/enrique/plugins/comment.lua deleted file mode 100755 index ecc93c4..0000000 --- a/nvim/lua/enrique/plugins/comment.lua +++ /dev/null @@ -1,19 +0,0 @@ -return { - "numToStr/Comment.nvim", - event = { "BufReadPre", "BufNewFile" }, - dependencies = { - "JoosepAlviste/nvim-ts-context-commentstring", - }, - config = function() - -- import comment plugin safely - local comment = require("Comment") - - local ts_context_commentstring = require("ts_context_commentstring.integrations.comment_nvim") - - -- enable comment - comment.setup({ - -- for commenting tsx, jsx, svelte, html files - pre_hook = ts_context_commentstring.create_pre_hook(), - }) - end, -} diff --git a/nvim/lua/enrique/plugins/dadbod.lua b/nvim/lua/enrique/plugins/dadbod.lua deleted file mode 100755 index 607cdbe..0000000 --- a/nvim/lua/enrique/plugins/dadbod.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - "kristijanhusak/vim-dadbod-ui", - dependencies = { - { "tpope/vim-dadbod" }, - { "kristijanhusak/vim-dadbod-completion", ft = { "sql", "mysql", "plsql" } }, - }, - cmd = { - "DBUI", - "DBUIToggle", - "DBUIAddConnection", - "DBUIFindBuffer", - }, -} diff --git a/nvim/lua/enrique/plugins/dressing.lua b/nvim/lua/enrique/plugins/dressing.lua deleted file mode 100755 index 105f7e5..0000000 --- a/nvim/lua/enrique/plugins/dressing.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "stevearc/dressing.nvim", - event = "VeryLazy", -} diff --git a/nvim/lua/enrique/plugins/flutter-tools.lua b/nvim/lua/enrique/plugins/flutter-tools.lua deleted file mode 100755 index 918ffb2..0000000 --- a/nvim/lua/enrique/plugins/flutter-tools.lua +++ /dev/null @@ -1,32 +0,0 @@ -return { - 'akinsho/flutter-tools.nvim', - lazy = false, - dependencies = { - 'nvim-lua/plenary.nvim', - 'stevearc/dressing.nvim', -- optional for vim.ui.select - }, - config = function () - require("flutter-tools").setup { - ui = { - border = "shadow", - }, - decorations = { - statusline = { - device = true, - }, - }, - closing_tags = { - prefix = "••• ", - enabled = true, - }, - lsp = { - color = { - enabled = true, - background = true, - virtual_text = true, - virtual_text_str = "󰝤" - }, - }, - } - end -} diff --git a/nvim/lua/enrique/plugins/guess-indent.lua b/nvim/lua/enrique/plugins/guess-indent.lua deleted file mode 100755 index 4621e39..0000000 --- a/nvim/lua/enrique/plugins/guess-indent.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - 'nmac427/guess-indent.nvim', - config = function() require('guess-indent').setup {} end, -} diff --git a/nvim/lua/enrique/plugins/illuminate.lua b/nvim/lua/enrique/plugins/illuminate.lua deleted file mode 100755 index f0bb2a9..0000000 --- a/nvim/lua/enrique/plugins/illuminate.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "RRethy/vim-illuminate", - config = function(_, opts) require("illuminate").configure(opts) end, -} diff --git a/nvim/lua/enrique/plugins/indent-blankline.lua b/nvim/lua/enrique/plugins/indent-blankline.lua deleted file mode 100755 index 572e0bd..0000000 --- a/nvim/lua/enrique/plugins/indent-blankline.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - "lukas-reineke/indent-blankline.nvim", - event = { "BufReadPre", "BufNewFile" }, - main = "ibl", - opts = { - indent = { char = "┊" }, - }, -} diff --git a/nvim/lua/enrique/plugins/init.lua b/nvim/lua/enrique/plugins/init.lua deleted file mode 100755 index fed56df..0000000 --- a/nvim/lua/enrique/plugins/init.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "nvim-lua/plenary.nvim", -- lua functions that many plugins use - "christoomey/vim-tmux-navigator", -- tmux & split window navigation -} diff --git a/nvim/lua/enrique/plugins/linting.lua b/nvim/lua/enrique/plugins/linting.lua deleted file mode 100755 index 3165e3a..0000000 --- a/nvim/lua/enrique/plugins/linting.lua +++ /dev/null @@ -1,25 +0,0 @@ -return { - "mfussenegger/nvim-lint", - event = { "BufReadPre", "BufNewFile" }, - config = function() - local lint = require("lint") - - lint.linters_by_ft = { - javascript = { "eslint_d" }, - typescript = { "eslint_d" }, - javascriptreact = { "eslint_d" }, - typescriptreact = { "eslint_d" }, - svelte = { "eslint_d" }, - -- python = { "pylint" }, - } - - local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) - - vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, { - group = lint_augroup, - callback = function() - lint.try_lint() - end, - }) - end, -} diff --git a/nvim/lua/enrique/plugins/lsp/lspconfig.lua b/nvim/lua/enrique/plugins/lsp/lspconfig.lua deleted file mode 100755 index fc8dce4..0000000 --- a/nvim/lua/enrique/plugins/lsp/lspconfig.lua +++ /dev/null @@ -1,124 +0,0 @@ -return { - "neovim/nvim-lspconfig", - event = { "BufReadPre", "BufNewFile" }, - dependencies = { - "hrsh7th/cmp-nvim-lsp", - { "antosha417/nvim-lsp-file-operations", config = true }, - { "folke/neodev.nvim", opts = {} }, - { "j-hui/fidget.nvim", tag = "legacy" }, - "RobertBrunhage/dart-tools.nvim", - }, - config = function() - local lspconfig = require("lspconfig") - local mason_lspconfig = require("mason-lspconfig") - local cmp_nvim_lsp = require("cmp_nvim_lsp") - - local keymap = vim.keymap -- for conciseness - - vim.api.nvim_create_autocmd("LspAttach", { - group = vim.api.nvim_create_augroup("UserLspConfig", {}), - callback = function(ev) - -- Buffer local mappings. - -- See `:help vim.lsp.*` for documentation on any of the below functions - local opts = { buffer = ev.buf, silent = true } - - -- set keybinds - opts.desc = "Go to declaration" - keymap.set("n", "gD", "vim.lsp.buf.declaration()", opts) -- go to declaration - - opts.desc = "Show LSP definitions" - keymap.set("n", "gd", "Telescope lsp_definitions", opts) -- show lsp definitions - - opts.desc = "Smart rename" - keymap.set("n", "rn", vim.lsp.buf.rename, opts) -- smart rename - - end, - }) - - -- used to enable autocompletion (assign to every lsp server config) - local capabilities = cmp_nvim_lsp.default_capabilities() - - -- Change the Diagnostic symbols in the sign column (gutter) - local signs = { Error = " ", Warn = " ", Hint = "󰠠 ", Info = " " } - for type, icon in pairs(signs) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) - end - - mason_lspconfig.setup_handlers({ - -- default handler for installed servers - function(server_name) - lspconfig[server_name].setup({ - capabilities = capabilities, - }) - end, - - ["lua_ls"] = function() - -- configure lua server (with special settings) - lspconfig["lua_ls"].setup({ - capabilities = capabilities, - settings = { - Lua = { - -- make the language server recognize "vim" global - diagnostics = { - globals = { "vim" }, - }, - completion = { - callSnippet = "Replace", - }, - }, - }, - }) - end, - }) - - -- lspconfig["dcmls"].setup({ - -- capabilities = capabilities, - -- cmd = { - -- "dcm", - -- "start-server", - -- }, - -- filetypes = { "dart", "yaml" }, - -- }) - - -- lspconfig["dartls"].setup({ - -- capabilities = capabilities, - -- cmd = { - -- "dart", - -- "language-server", - -- "--protocol=lsp", - -- -- "--port=8123", - -- -- "--instrumentation-log-file=/Users/robertbrunhage/Desktop/lsp-log.txt", - -- }, - -- filetypes = { "dart" }, - -- init_options = { - -- onlyAnalyzeProjectsWithOpenFiles = false, - -- suggestFromUnimportedLibraries = true, - -- closingLabels = true, - -- outline = false, - -- flutterOutline = false, - -- }, - -- settings = { - -- dart = { - -- updateImportsOnRename = true, - -- completeFunctionCalls = true, - -- showTodos = true, - -- }, - -- }, - -- }) - - -- Tooltip for the lsp in bottom right - require("fidget").setup({}) - - -- Hot reload :) - require("dart-tools") - - -- Globally configure all LSP floating preview popups (like hover, signature help, etc) - local open_floating_preview = vim.lsp.util.open_floating_preview - function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...) - opts = opts or {} - opts.border = opts.border or "rounded"-- Set border to rounded - return open_floating_preview(contents, syntax, opts, ...) - end - end, -} diff --git a/nvim/lua/enrique/plugins/lsp/lspconfig.lua.bak2 b/nvim/lua/enrique/plugins/lsp/lspconfig.lua.bak2 deleted file mode 100755 index b5cb7ee..0000000 --- a/nvim/lua/enrique/plugins/lsp/lspconfig.lua.bak2 +++ /dev/null @@ -1,76 +0,0 @@ --- LSP Support -return { - -- LSP Configuration - -- https://github.com/neovim/nvim-lspconfig - "neovim/nvim-lspconfig", - event = "VeryLazy", - dependencies = { - -- LSP Management - -- https://github.com/williamboman/mason.nvim - { "williamboman/mason.nvim" }, - -- https://github.com/williamboman/mason-lspconfig.nvim - { "williamboman/mason-lspconfig.nvim" }, - - -- Useful status updates for LSP - -- https://github.com/j-hui/fidget.nvim - { "j-hui/fidget.nvim", opts = {} }, - - -- Additional lua configuration, makes nvim stuff amazing! - -- https://github.com/folke/neodev.nvim - { "folke/neodev.nvim" }, - }, - config = function() - require("mason").setup() - require("mason-lspconfig").setup({ - -- Install these LSPs automatically - ensure_installed = { - -- 'bashls', -- requires npm to be installed - -- 'cssls', -- requires npm to be installed - -- 'html', -- requires npm to be installed - "lua_ls", - -- 'jsonls', -- requires npm to be installed - "lemminx", - "marksman", - "quick_lint_js", - -- 'tsserver', -- requires npm to be installed - -- 'yamlls', -- requires npm to be installed - }, - }) - - local lspconfig = require("lspconfig") - local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities() - local lsp_attach = function(client, bufnr) - -- Create your keybindings here... - end - - -- Call setup on each LSP server - require("mason-lspconfig").setup_handlers({ - function(server_name) - lspconfig[server_name].setup({ - on_attach = lsp_attach, - capabilities = lsp_capabilities, - }) - end, - }) - - -- Lua LSP settings - lspconfig.lua_ls.setup({ - settings = { - Lua = { - diagnostics = { - -- Get the language server to recognize the `vim` global - globals = { "vim" }, - }, - }, - }, - }) - - -- Globally configure all LSP floating preview popups (like hover, signature help, etc) - local open_floating_preview = vim.lsp.util.open_floating_preview - function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...) - opts = opts or {} - opts.border = opts.border or "rounded" -- Set border to rounded - return open_floating_preview(contents, syntax, opts, ...) - end - end, -} diff --git a/nvim/lua/enrique/plugins/lsp/mason.lua b/nvim/lua/enrique/plugins/lsp/mason.lua deleted file mode 100755 index 14803bd..0000000 --- a/nvim/lua/enrique/plugins/lsp/mason.lua +++ /dev/null @@ -1,46 +0,0 @@ -return { - "williamboman/mason.nvim", - dependencies = { - "williamboman/mason-lspconfig.nvim", - "WhoIsSethDaniel/mason-tool-installer.nvim", - }, - config = function() - local mason = require("mason") - local mason_lspconfig = require("mason-lspconfig") - local mason_tool_installer = require("mason-tool-installer") - -- enable mason and configure icons - mason.setup({ - ui = { - icons = { - package_installed = "✓", - package_pending = "➜", - package_uninstalled = "✗", - }, - }, - }) - - mason_lspconfig.setup({ - -- list of servers for mason to install - ensure_installed = { - "html", - "tailwindcss", - "lua_ls", - "pyright", - "sqlls", - "bashls", - "taplo", - }, - }) - mason_tool_installer.setup({ - ensure_installed = { - "prettier", -- prettier formatter - "stylua", -- lua formatter - "isort", -- python formatter - "black", -- python formatter - "sql-formatter", - --"pylint", -- python linter - "eslint_d", -- js linter - }, - }) - end, -} diff --git a/nvim/lua/enrique/plugins/lualine.lua b/nvim/lua/enrique/plugins/lualine.lua deleted file mode 100755 index 734e5d7..0000000 --- a/nvim/lua/enrique/plugins/lualine.lua +++ /dev/null @@ -1,59 +0,0 @@ -return { - "nvim-lualine/lualine.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, - config = function() - local lualine = require("lualine") - local lazy_status = require("lazy.status") -- to configure lazy pending updates count - - lualine.setup({ - options = { - theme = "dracula", - }, - sections = { - lualine_x = { - -- { - -- require("noice").api.status.message.get_hl, - -- cond = require("noice").api.status.message.has, - -- }, - { - require("noice").api.status.command.get, - cond = require("noice").api.status.command.has, - color = { fg = "#ff9e64" }, - }, - { - require("noice").api.status.mode.get, - cond = require("noice").api.status.mode.has, - color = { fg = "#ff9e64" }, - }, - { - require("noice").api.status.search.get, - cond = require("noice").api.status.search.has, - color = { fg = "#ff9e64" }, - }, - { - lazy_status.updates, - cond = lazy_status.has_updates, - color = { fg = "#ff9e64" }, - }, - }, - lualine_c = { - { - -- Customize the filename part of lualine to be parent/filename - "filename", - file_status = true, -- Displays file status (readonly status, modified status) - newfile_status = false, -- Display new file status (new file means no write after created) - path = 4, -- 0: Just the filename - -- 1: Relative path - -- 2: Absolute path - -- 3: Absolute path, with tilde as the home directory - -- 4: Filename and parent dir, with tilde as the home directory - symbols = { - modified = "[+]", -- Text to show when the file is modified. - readonly = "[-]", -- Text to show when the file is non-modifiable or readonly. - }, - }, - }, - }, - }) - end, -} diff --git a/nvim/lua/enrique/plugins/miniicons.lua b/nvim/lua/enrique/plugins/miniicons.lua deleted file mode 100755 index 92615cb..0000000 --- a/nvim/lua/enrique/plugins/miniicons.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - 'echasnovski/mini.icons', - version = false -} diff --git a/nvim/lua/enrique/plugins/neo-tree.lua b/nvim/lua/enrique/plugins/neo-tree.lua deleted file mode 100755 index da2ec86..0000000 --- a/nvim/lua/enrique/plugins/neo-tree.lua +++ /dev/null @@ -1,24 +0,0 @@ -return { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended - "MunifTanjim/nui.nvim", - -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information - }, - config = function() - require("neo-tree").setup({ - filesystem = { - filtered_items = { - visible = true, -- This is what you want: If you set this to `true`, all "hide" just mean "dimmed out" - hide_dotfiles = false, - hide_gitignored = true, - }, - }, - window = { - position = "right", - }, - }) - end, -} diff --git a/nvim/lua/enrique/plugins/noice.lua b/nvim/lua/enrique/plugins/noice.lua deleted file mode 100755 index 387b569..0000000 --- a/nvim/lua/enrique/plugins/noice.lua +++ /dev/null @@ -1,36 +0,0 @@ --- lazy.nvim -return { - "folke/noice.nvim", - event = "VeryLazy", - opts = { - -- add any options here - }, - dependencies = { - -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries - "MunifTanjim/nui.nvim", - -- OPTIONAL: - -- `nvim-notify` is only needed, if you want to use the notification view. - -- If not available, we use `mini` as the fallback - "rcarriga/nvim-notify", - }, - config = function() - require("noice").setup({ - 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, -- requires hrsh7th/nvim-cmp - }, - }, - -- 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 = true, -- add a border to hover docs and signature help - }, - }) - end, -} diff --git a/nvim/lua/enrique/plugins/nvim-cmp.lua b/nvim/lua/enrique/plugins/nvim-cmp.lua deleted file mode 100755 index 092489b..0000000 --- a/nvim/lua/enrique/plugins/nvim-cmp.lua +++ /dev/null @@ -1,147 +0,0 @@ --- Auto-completion / Snippets -return { - -- https://github.com/hrsh7th/nvim-cmp - "hrsh7th/nvim-cmp", - event = "InsertEnter", - dependencies = { - -- Snippet engine & associated nvim-cmp source - -- https://github.com/L3MON4D3/LuaSnip - "L3MON4D3/LuaSnip", - -- https://github.com/saadparwaiz1/cmp_luasnip - "saadparwaiz1/cmp_luasnip", - - -- LSP completion capabilities - -- https://github.com/hrsh7th/cmp-nvim-lsp - "hrsh7th/cmp-nvim-lsp", - - -- Additional user-friendly snippets - -- https://github.com/rafamadriz/friendly-snippets - "rafamadriz/friendly-snippets", - -- https://github.com/hrsh7th/cmp-buffer - "hrsh7th/cmp-buffer", - -- https://github.com/hrsh7th/cmp-path - "hrsh7th/cmp-path", - -- https://github.com/hrsh7th/cmp-cmdline - "hrsh7th/cmp-cmdline", - -- sql completion - "kristijanhusak/vim-dadbod-completion", - {"onsails/lspkind.nvim", lazy = true}, - }, - config = function() - local cmp = require("cmp") - local luasnip = require("luasnip") - local lspkind = require('lspkind') - require("luasnip.loaders.from_vscode").lazy_load() - luasnip.config.setup({}) - - cmp.setup({ - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - completion = { - completeopt = "menu,menuone,noinsert", - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.select_next_item(), -- next suggestion - [""] = cmp.mapping.select_prev_item(), -- previous suggestion - [""] = cmp.mapping.scroll_docs(-4), -- scroll backward - [""] = cmp.mapping.scroll_docs(4), -- scroll forward - [""] = cmp.mapping.complete({}), -- show completion suggestions - [""] = cmp.mapping.confirm({ - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }), - -- Tab through suggestions or when a snippet is active, tab to the next argument - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - -- cmp.select_next_item() - cmp.confirm({ - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }) - elseif luasnip.expand_or_locally_jumpable() then - luasnip.expand_or_jump() - else - fallback() - end - end, { "i", "s" }), - -- Tab backwards through suggestions or when a snippet is active, tab to the next argument - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.locally_jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - }), - sources = cmp.config.sources({ - { name = "vim-dadbod-completion" }, -- sql - { name = "nvim_lsp" }, -- lsp - { name = "luasnip" }, -- snippets - { name = "buffer" }, -- text within current buffer - { name = "path" }, -- file system paths - }), - window = { - completion = { - width = 23, - max_height = 13, - border = "rounded", - winhighlight = "Normal:CmpPmenu,CursorLine:PmenuSel,Search:None", - -- winhighlight = "Normal:CmpPmenu,FloatBorder:CmpPmenuBorder,CursorLine:PmenuSel,Search:None", - }, - documentation = { - max_width = 72, - max_height = 23, - border = "rounded", - winhighlight = "Normal:CmpDoc", - }, - }, - formatting = { - fields = { "kind", "abbr", "menu" }, - format = function(entry, vim_item) - local kind = require("lspkind").cmp_format({ - mode = "symbol_text", - maxwidth = 42, - ellipsis_char = "··", - -- show_labelDetails = true, - menu = ({ - buffer = "Bfr", - nvim_lsp = "LSP", - luasnip = "Snp", - nvim_lua = "Lua", - latex_symbols = "Ltx", - }) - })(entry, vim_item) - local strings = vim.split(kind.kind, "%s", { trimempty = true }) - local men = kind.menu - kind.kind = (strings[1] or "") .. " " - kind.menu = (men or "") .. " | " .. (strings[2] or "") - - return kind - end, - }, - -- formatting = { - -- format = lspkind.cmp_format({ - -- mode = "symbol_text", -- text_symbol or symbol_text - -- maxwidth = 23, - -- ellipsis_char = '..', - -- show_labelDetails = true, - -- menu = ({ - -- buffer = "[Buffer]", - -- nvim_lsp = "[LSP]", - -- luasnip = "[LuaSnip]", - -- nvim_lua = "[Lua]", - -- latex_symbols = "[Latex]", - -- }) - -- }), - -- }, - view = { - entries = {name = 'custom', selection_order = 'near_cursor' } - }, - }) - end, -} diff --git a/nvim/lua/enrique/plugins/osc52.lua b/nvim/lua/enrique/plugins/osc52.lua deleted file mode 100755 index 1def210..0000000 --- a/nvim/lua/enrique/plugins/osc52.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - "ojroques/nvim-osc52", - config = function() - require('osc52').setup { - max_length = 0, -- Maximum length of selection (0 for no limit) - silent = false, -- Show message when copied - trim = false, -- Trim surrounding whitespaces before copy - } - - -- Key mappings - vim.keymap.set('n', 'y', require('osc52').copy_operator, {expr = true}) -vim.keymap.set('n', 'yy', 'y_', {remap = true}) -vim.keymap.set('v', 'y', require('osc52').copy_visual) - end, -} - diff --git a/nvim/lua/enrique/plugins/quickfixdd.lua b/nvim/lua/enrique/plugins/quickfixdd.lua deleted file mode 100755 index 471e608..0000000 --- a/nvim/lua/enrique/plugins/quickfixdd.lua +++ /dev/null @@ -1,6 +0,0 @@ --- Adds delete functionality to quickfix list (keymap dd) -return { - -- https://github.com/TamaMcGlinn/quickfixdd - "TamaMcGlinn/quickfixdd", - event = "VeryLazy", -} diff --git a/nvim/lua/enrique/plugins/substitute.lua b/nvim/lua/enrique/plugins/substitute.lua deleted file mode 100755 index 2a36240..0000000 --- a/nvim/lua/enrique/plugins/substitute.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - "gbprod/substitute.nvim", - event = { "BufReadPre", "BufNewFile" }, - config = function() - local substitute = require("substitute") - substitute.setup() - end, -} diff --git a/nvim/lua/enrique/plugins/surround.lua b/nvim/lua/enrique/plugins/surround.lua deleted file mode 100755 index 77f5073..0000000 --- a/nvim/lua/enrique/plugins/surround.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - "kylechui/nvim-surround", - event = { "BufReadPre", "BufNewFile" }, - version = "*", -- Use for stability; omit to use `main` branch for the latest features - config = true, -} diff --git a/nvim/lua/enrique/plugins/telescope.lua b/nvim/lua/enrique/plugins/telescope.lua deleted file mode 100755 index 2767010..0000000 --- a/nvim/lua/enrique/plugins/telescope.lua +++ /dev/null @@ -1,38 +0,0 @@ -return { - "nvim-telescope/telescope.nvim", - branch = "0.1.x", - dependencies = { - "nvim-lua/plenary.nvim", - { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, - "nvim-tree/nvim-web-devicons", - "folke/todo-comments.nvim", - }, - lazy = true, - config = function() - local telescope = require("telescope") - local actions = require("telescope.actions") - require("telescope").load_extension("flutter") - telescope.setup({ - defaults = { - layout_strategy = "flex", - layout_config = { - height = 0.72, - width = 0.65, - prompt_position = "bottom", - horizontal = {preview_width=0.65}, - vertical = {preview_height=0.65}, - }, - path_display = { "smart" }, - mappings = { - i = { - [""] = actions.move_selection_previous, -- move to prev result - [""] = actions.move_selection_next, -- move to next result - [""] = actions.send_selected_to_qflist + actions.open_qflist, - }, - }, - }, - }) - telescope.load_extension("fzf") - end, -} - diff --git a/nvim/lua/enrique/plugins/todo-comments.lua b/nvim/lua/enrique/plugins/todo-comments.lua deleted file mode 100755 index 6d36d72..0000000 --- a/nvim/lua/enrique/plugins/todo-comments.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - "folke/todo-comments.nvim", - event = { "BufReadPre", "BufNewFile" }, - dependencies = { "nvim-lua/plenary.nvim" }, - config = function() - local todo_comments = require("todo-comments") - todo_comments.setup() - end, -} diff --git a/nvim/lua/enrique/plugins/treesitter.lua b/nvim/lua/enrique/plugins/treesitter.lua deleted file mode 100755 index 8bfd297..0000000 --- a/nvim/lua/enrique/plugins/treesitter.lua +++ /dev/null @@ -1,49 +0,0 @@ -return { - "nvim-treesitter/nvim-treesitter", - event = { "BufReadPre", "BufNewFile" }, - build = ":TSUpdate", - dependencies = { - "windwp/nvim-ts-autotag", - }, - config = function() - -- import nvim-treesitter plugin - local treesitter = require("nvim-treesitter.configs") - - -- configure treesitter - treesitter.setup({ -- enable syntax highlighting - highlight = { - enable = true, - }, - -- enable indentation - indent = { enable = true }, - -- enable autotagging (w/ nvim-ts-autotag plugin) - autotag = { - enable = true, - }, - -- ensure these language parsers are installed - auto_install = true, - ensure_installed = { - "html", - "css", - "markdown", - "markdown_inline", - "bash", - "lua", - "dockerfile", - "query", - "c", - "python", - "sql", - }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "", - node_incremental = "", - scope_incremental = false, - node_decremental = "", - }, - }, - }) - end, -} diff --git a/nvim/lua/enrique/plugins/trouble.lua b/nvim/lua/enrique/plugins/trouble.lua deleted file mode 100755 index 8dc8255..0000000 --- a/nvim/lua/enrique/plugins/trouble.lua +++ /dev/null @@ -1,22 +0,0 @@ -return { - "folke/trouble.nvim", - opts = {}, - cmd = "Trouble", - -- dependencies = { "nvim-tree/nvim-web-devicons", "folke/todo-comments.nvim" }, - keys = { - { "xx", "Trouble diagnostics toggle", desc = "Open/close trouble list" }, - { "xL", "Trouble loclist toggle", desc = "Open trouble location list diagnostics" }, - { - "xd", - "Trouble diagnostics toggle filter.buf=0", - desc = "Open trouble document diagnostics", - }, - { "xq", "Trouble qflist toggle", desc = "Open trouble quickfix list" }, - { - "xl", - "Trouble lsp toggle focus=false win.position=right", - desc = "LSP Definitions / references (Trouble)", - }, - { "xt", "TodoTrouble", desc = "Open todos in trouble" }, - }, -} diff --git a/nvim/lua/enrique/plugins/vim-maximizer.lua b/nvim/lua/enrique/plugins/vim-maximizer.lua deleted file mode 100755 index 2ec30f6..0000000 --- a/nvim/lua/enrique/plugins/vim-maximizer.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - "szw/vim-maximizer", -} diff --git a/nvim/lua/enrique/plugins/which-key.lua b/nvim/lua/enrique/plugins/which-key.lua deleted file mode 100755 index 97b8cb3..0000000 --- a/nvim/lua/enrique/plugins/which-key.lua +++ /dev/null @@ -1,23 +0,0 @@ -return { - "folke/which-key.nvim", - event = "VeryLazy", - opts = { - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - }, - keys = { - { - "?", - function() - require("which-key").show({ global = false }) - end, - desc = "Buffer Local Keymaps (which-key)", - }, - }, - config = function(...) require "enrique.core.keymaps" (...) end -} - - - - diff --git a/nvim/lua/plugins/blink-cmp.lua b/nvim/lua/plugins/blink-cmp.lua new file mode 100644 index 0000000..cc06ec4 --- /dev/null +++ b/nvim/lua/plugins/blink-cmp.lua @@ -0,0 +1,98 @@ +return { -- Autowcompletion + "saghen/blink.cmp", + event = "VimEnter", + version = "1.*", + dependencies = { + -- Snippet Engine + { + "L3MON4D3/LuaSnip", + version = "2.*", + build = (function() + -- Build Step is needed for regex support in snippets. + -- This step is not supported in many windows environments. + if vim.fn.has("win32") == 1 or vim.fn.executable("make") == 0 then + return + end + return "make install_jsregexp" + end)(), + dependencies = { + -- https://github.com/rafamadriz/friendly-snippets + { + "rafamadriz/friendly-snippets", + config = function() + require("luasnip.loaders.from_vscode").lazy_load() + end, + }, + }, + opts = {}, + }, + "folke/lazydev.nvim", + "moyiz/blink-emoji.nvim", + }, + --- @module 'blink.cmp' + --- @type blink.cmp.Config + opts = { + keymap = { + -- 'default' (recommended) for mappings similar to built-in completions + -- to accept ([y]es) the completion. + -- This will auto-import if your LSP supports it. + -- This will expand snippets if the LSP sent a snippet. + -- 'super-tab' for tab to accept + -- 'enter' for enter to accept + -- 'none' for no mappings + -- + -- All presets have the following mappings: + -- /: move to right/left of your snippet expansion + -- : Open menu or open docs if already open + -- / or /: Select next/previous item + -- : Hide menu + -- : Toggle signature help + -- See :h blink-cmp-config-keymap for defining your own keymap + preset = "super-tab", + }, + + appearance = { + -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' + nerd_font_variant = "mono", + }, + + completion = { + -- By default, you may press `` to show the documentation. + documentation = { auto_show = true, auto_show_delay_ms = 500 }, + menu = { + border = "rounded", + }, + ghost_text = { + enabled = true, + }, + }, + + -- Shows a signature help window while you type arguments for a function + signature = { enabled = true }, + + sources = { + default = { "lsp", "path", "snippets", "lazydev" }, + providers = { + lazydev = { module = "lazydev.integrations.blink", score_offset = 100 }, + emoji = { + module = "blink-emoji", + name = "Emoji", + score_offset = 15, -- Tune by preference + opts = { insert = true }, -- Insert emoji (default) or complete its name + -- should_show_items = function() + -- return vim.tbl_contains( + -- -- Enable emoji completion only for git commits and markdown. + -- -- By default, enabled for all file-types. + -- { "gitcommit", "markdown" }, + -- vim.o.filetype + -- ) + -- end, + }, + }, + }, + + -- snippets = { preset = "luasnip" }, + + fuzzy = { implementation = "prefer_rust_with_warning" }, + }, +} diff --git a/nvim/lua/plugins/colorscheme.lua b/nvim/lua/plugins/colorscheme.lua new file mode 100644 index 0000000..2996685 --- /dev/null +++ b/nvim/lua/plugins/colorscheme.lua @@ -0,0 +1,12 @@ +return { + "folke/tokyonight.nvim", + lazy = false, + priority = 1000, + config = function() + require("tokyonight").setup { + style = "storm", + transparent = true, + } + vim.cmd("colorscheme tokyonight") + end +} diff --git a/nvim/lua/plugins/conform.lua b/nvim/lua/plugins/conform.lua new file mode 100644 index 0000000..a2e5a14 --- /dev/null +++ b/nvim/lua/plugins/conform.lua @@ -0,0 +1,15 @@ +return { + "stevearc/conform.nvim", + opts = { + formatters_by_ft = { + go = { "goimports", "gofumpt", lsp_format = "fallback" }, + lua = { "stylua" }, + python = { "isort", "black" }, + bash = { "beautysh" }, + }, + format_on_save = { + timeout_ms = 500, + lsp_format = "falback", + }, + }, +} diff --git a/nvim/lua/plugins/dressing.lua b/nvim/lua/plugins/dressing.lua new file mode 100644 index 0000000..65d7987 --- /dev/null +++ b/nvim/lua/plugins/dressing.lua @@ -0,0 +1,4 @@ +return { + 'stevearc/dressing.nvim', + opts = {}, +} diff --git a/nvim/lua/plugins/flutter-tools.lua b/nvim/lua/plugins/flutter-tools.lua new file mode 100644 index 0000000..0bd1503 --- /dev/null +++ b/nvim/lua/plugins/flutter-tools.lua @@ -0,0 +1,32 @@ +return { + "akinsho/flutter-tools.nvim", + lazy = false, + dependencies = { + "nvim-lua/plenary.nvim", + "stevearc/dressing.nvim", -- optional for vim.ui.select + }, + config = function() + require("flutter-tools").setup({ + ui = { + border = "shadow", + }, + decorations = { + statusline = { + device = true, + }, + }, + closing_tags = { + prefix = "••• ", + enabled = true, + }, + lsp = { + color = { + enabled = true, + background = true, + virtual_text = true, + virtual_text_str = "󰝤", + }, + }, + }) + end, +} diff --git a/nvim/lua/plugins/fzf.lua b/nvim/lua/plugins/fzf.lua new file mode 100644 index 0000000..458679c --- /dev/null +++ b/nvim/lua/plugins/fzf.lua @@ -0,0 +1,8 @@ +return { + "ibhagwan/fzf-lua", + -- optional for icon support + dependencies = { "nvim-tree/nvim-web-devicons" }, + -- or if using mini.icons/mini.nvim + -- dependencies = { "echasnovski/mini.icons" }, + opts = {} +} diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..d2cc99f --- /dev/null +++ b/nvim/lua/plugins/lsp.lua @@ -0,0 +1,236 @@ +return { + -- LSP Plugins + { + "folke/lazydev.nvim", + ft = "lua", + opts = { + library = { + -- Load luvit types when the `vim.uv` word is found + { path = "${3rd}/luv/library", words = { "vim%.uv" } }, + }, + }, + }, + { + -- Main LSP Configuration + "neovim/nvim-lspconfig", + dependencies = { + { "williamboman/mason.nvim", opts = {} }, + "williamboman/mason-lspconfig.nvim", + "WhoIsSethDaniel/mason-tool-installer.nvim", + + -- Useful status updates for LSP. + { "j-hui/fidget.nvim", opts = {} }, + + -- Allows extra capabilities provided by blink.cmp + "saghen/blink.cmp", + }, + config = function() + vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("lsp-attach", { clear = true }), + callback = function(event) + local wk = require("which-key") + + local function wkAdd(keys, func, desc, mode) + mode = mode or "n" + wk.add({ keys, func, desc = desc, mode = mode }) + end + + local function wkGroup(keys, group, modes) + modes = modes or { "n" } + wk.add({ keys, group = group, mode = modes }) + end + + wkGroup("c", "LSP & code actions") + wkAdd("cr", vim.lsp.buf.rename, "[C]ode [R]ename") + wkAdd("cf", function() + require("conform").format() + end, "[C]ode [F]ormat") + wkAdd("ca", vim.lsp.buf.code_action, "[C]ode [A]ction", { "n", "x" }) + wkAdd("cgr", require("fzf-lua").lsp_references, "[G]oto [R]eferences") + wkAdd("cgi", require("fzf-lua").lsp_implementations, "[G]oto [I]mplementation") + -- To jump back, press . + wkAdd("cgd", require("fzf-lua").lsp_definitions, "[G]oto [D]efinition") + wkAdd("cgD", vim.lsp.buf.declaration, "[G]oto [D]eclaration") + wkAdd("cO", require("fzf-lua").lsp_document_symbols, "Open Document Symbols") + wkAdd("cW", require("fzf-lua").lsp_live_workspace_symbols, "Open Workspace Symbols") + wkAdd("cgt", require("fzf-lua").lsp_typedefs, "[G]oto [T]ype Definition") + wkAdd("ch", vim.lsp.buf.hover, "Toggle LSP hover (documantation)") + wkAdd("clr", "LspRestart", "Restart LSP") + wkAdd("cI", "LspInfo", "Show LSP Info") + + -- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10) + ---@param client vim.lsp.Client + ---@param method vim.lsp.protocol.Method + ---@param bufnr? integer some lsp support methods only in specific files + ---@return boolean + local function client_supports_method(client, method, bufnr) + if vim.fn.has("nvim-0.11") == 1 then + return client:supports_method(method, bufnr) + else + return client.supports_method(method, { bufnr = bufnr }) + end + end + + -- The following two autocommands are used to highlight references of the + -- word under your cursor when your cursor rests there for a little while. + -- See `:help CursorHold` for information about when this is executed + -- + -- When you move your cursor, the highlights will be cleared (the second autocommand). + local client = vim.lsp.get_client_by_id(event.data.client_id) + if + client + and client_supports_method( + client, + vim.lsp.protocol.Methods.textDocument_documentHighlight, + event.buf + ) + then + local highlight_augroup = vim.api.nvim_create_augroup("lsp-highlight", { clear = false }) + vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, { + buffer = event.buf, + group = highlight_augroup, + callback = vim.lsp.buf.document_highlight, + }) + + vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, { + buffer = event.buf, + group = highlight_augroup, + callback = vim.lsp.buf.clear_references, + }) + + vim.api.nvim_create_autocmd("LspDetach", { + group = vim.api.nvim_create_augroup("lsp-detach", { clear = true }), + callback = function(event2) + vim.lsp.buf.clear_references() + vim.api.nvim_clear_autocmds({ group = "lsp-highlight", buffer = event2.buf }) + end, + }) + end + + -- The following code creates a keymap to toggle inlay hints + if + client + and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) + then + wkAdd("cH", 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, + }, + }) + + -- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities. + local original_capabilities = vim.lsp.protocol.make_client_capabilities() + local capabilities = require("blink.cmp").get_lsp_capabilities(original_capabilities) + + -- Add any additional override configuration in the following tables. Available keys: + -- - 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 = { + gopls = { + settings = { + gopls = { + gofumpt = true, + codelenses = { + gc_details = false, + generate = true, + regenerate_cgo = true, + run_govulncheck = true, + test = true, + tidy = true, + upgrade_dependency = true, + vendor = true, + }, + hints = { + assignVariableTypes = true, + compositeLiteralFields = true, + compositeLiteralTypes = true, + constantValues = true, + functionTypeParameters = true, + parameterNames = true, + rangeVariableTypes = true, + }, + analyses = { + nilness = true, + unusedparams = true, + unusedwrite = true, + useany = true, + }, + usePlaceholders = true, + completeUnimported = true, + staticcheck = true, + semanticTokens = true, + }, + }, + }, + pyright = {}, + lua_ls = {}, + bashls = {}, + marksman = {}, + } + + -- 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, { + "goimports", + "gofumpt", + "gomodifytags", + "impl", + "stylua", -- Used to format Lua code + "isort", + "black", + "black", + "beautysh", + }) + require("mason-tool-installer").setup({ ensure_installed = ensure_installed }) + + require("mason-lspconfig").setup({ + ensure_installed = {}, + automatic_installation = false, + 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, + }, +} diff --git a/nvim/lua/plugins/mini-files.lua.bak b/nvim/lua/plugins/mini-files.lua.bak new file mode 100644 index 0000000..c1ef333 --- /dev/null +++ b/nvim/lua/plugins/mini-files.lua.bak @@ -0,0 +1,17 @@ +return { + 'echasnovski/mini.files', + version = '*', + opts = { + options = { + permanent_delete = false, + use_as_default_explorer = true, + }, + windows = { + preview = true, + width_focus = 50, + width_nofocus = 15, + -- Width of preview window + width_preview = 72, + }, + } +} diff --git a/nvim/lua/plugins/mini-nvim.lua b/nvim/lua/plugins/mini-nvim.lua new file mode 100644 index 0000000..9b8bf4e --- /dev/null +++ b/nvim/lua/plugins/mini-nvim.lua @@ -0,0 +1,59 @@ +return { + "echasnovski/mini.nvim", + version = "*", + config = function() + require("mini.ai").setup() + require("mini.comment").setup() + require("mini.move").setup() + require("mini.operators").setup() + require("mini.pairs").setup() + require("mini.splitjoin").setup() + require("mini.bracketed").setup() + require("mini.jump").setup() + require("mini.tabline").setup() + require("mini.statusline").setup() + require("mini.cursorword").setup() + + require("mini.notify").setup({ + lsp_progress = { + enable = false, + }, + }) + + require("mini.surround").setup({ + mappings = { + add = "w+", + delete = "w-", + find = "wf", + find_left = "wF", + highlight = "wh", + replace = "wr", + update_n_lines = "", + }, + }) + + require("mini.indentscope").setup({ + delay = 50, + animation = 5, + }) + + require("mini.jump2d").setup({ + mappings = { + start_jumping = "", + }, + }) + + require("mini.hipatterns").setup({ + highlighters = { + -- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE' + fixme = { pattern = "%f[%w]()FIXME()%f[%W]", group = "MiniHipatternsFixme" }, + hack = { pattern = "%f[%w]()HACK()%f[%W]", group = "MiniHipatternsHack" }, + todo = { pattern = "%f[%w]()TODO()%f[%W]", group = "MiniHipatternsTodo" }, + note = { pattern = "%f[%w]()NOTE()%f[%W]", group = "MiniHipatternsNote" }, + + -- Highlight hex color strings (`#rrggbb`) using that color + hex_color = require("mini.hipatterns").gen_highlighter.hex_color(), + }, + }) + end, +} diff --git a/nvim/lua/plugins/noice.lua b/nvim/lua/plugins/noice.lua new file mode 100644 index 0000000..a2d0133 --- /dev/null +++ b/nvim/lua/plugins/noice.lua @@ -0,0 +1,15 @@ +return { + "folke/noice.nvim", + event = "VeryLazy", + opts = { + -- add any options here + }, + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries + "MunifTanjim/nui.nvim", + -- OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + -- "rcarriga/nvim-notify", + }, +} diff --git a/nvim/lua/plugins/oil-fm.lua b/nvim/lua/plugins/oil-fm.lua new file mode 100644 index 0000000..5ec956e --- /dev/null +++ b/nvim/lua/plugins/oil-fm.lua @@ -0,0 +1,82 @@ +return { + "stevearc/oil.nvim", + ---@module 'oil' + ---@type oil.SetupOpts + opts = { + default_view = "float", + columns = { + "icon", + -- "permissions", + -- "size", + -- "mtime", + }, + delete_to_trash = true, + skip_confirm_for_simple_edits = false, + prompt_save_on_select_new_entry = true, + -- Set to `false` to disable, or "name" to keep it on the file names + constrain_cursor = "name", + -- Set to `false` to remove a keymap + keymaps = { + ["g?"] = { "actions.show_help", mode = "n" }, + [""] = "actions.select", + [""] = { "actions.select", opts = { vertical = true } }, + [""] = { "actions.select", opts = { horizontal = true } }, + [""] = { "actions.select", opts = { tab = true } }, + [""] = "actions.preview", + ["q"] = { "actions.close", mode = "n" }, + ["R"] = "actions.refresh", + [""] = { "actions.parent", mode = "n" }, + ["_"] = { "actions.open_cwd", mode = "n" }, + ["`"] = { "actions.cd", mode = "n" }, + ["~"] = { "actions.cd", opts = { scope = "tab" }, mode = "n" }, + ["gs"] = { "actions.change_sort", mode = "n" }, + ["gx"] = "actions.open_external", + ["g."] = { "actions.toggle_hidden", mode = "n" }, + ["g\\"] = { "actions.toggle_trash", mode = "n" }, + }, + -- Set to false to disable all of the above keymaps + use_default_keymaps = true, + view_options = { + show_hidden = false, + -- Can be "fast", true, or false. "fast" will turn it off for large directories. + natural_order = "fast", + case_insensitive = false, + }, + -- Configuration for the floating window in oil.open_float + float = { + padding = 13, + max_width = 0.8, + max_height = 0.8, + border = "rounded", + win_options = { + winblend = 0, + }, + preview_split = "auto", + }, + -- Configuration for the floating action confirmation window + confirmation = { + -- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total" + max_width = 0.9, + min_width = { 40, 0.4 }, + max_height = 0.9, + min_height = { 5, 0.1 }, + border = "rounded", + win_options = { + winblend = 0, + }, + }, + -- Configuration for the floating progress window + progress = { + max_width = 0.9, + min_width = { 40, 0.4 }, + max_height = { 10, 0.9 }, + min_height = { 5, 0.1 }, + border = "rounded", + win_options = { + winblend = 0, + }, + }, + }, + dependencies = { { "echasnovski/mini.icons", opts = {} } }, + lazy = false, +} diff --git a/nvim/lua/plugins/project-nvim.lua b/nvim/lua/plugins/project-nvim.lua new file mode 100644 index 0000000..80cf230 --- /dev/null +++ b/nvim/lua/plugins/project-nvim.lua @@ -0,0 +1,6 @@ +return { + "ahmedkhalf/project.nvim", + init = function() + require("project_nvim").setup {} + end +} diff --git a/nvim/lua/plugins/sleuth.lua b/nvim/lua/plugins/sleuth.lua new file mode 100644 index 0000000..d04ea94 --- /dev/null +++ b/nvim/lua/plugins/sleuth.lua @@ -0,0 +1,5 @@ +return { + "tpope/vim-sleuth", + -- No further initialization needed, as this is a real "vim" not a lua + -- plugin. +} diff --git a/nvim/lua/plugins/smear-cursor.lua b/nvim/lua/plugins/smear-cursor.lua new file mode 100644 index 0000000..69fd054 --- /dev/null +++ b/nvim/lua/plugins/smear-cursor.lua @@ -0,0 +1,4 @@ +return { + "sphamba/smear-cursor.nvim", + opts = {}, +} diff --git a/nvim/lua/plugins/substitue.lua b/nvim/lua/plugins/substitue.lua new file mode 100644 index 0000000..54d40fc --- /dev/null +++ b/nvim/lua/plugins/substitue.lua @@ -0,0 +1,8 @@ +return { + "gbprod/substitute.nvim", + event = { "BufReadPre", "BufNewFile" }, + config = function() + local substitute = require("substitute") + substitute.setup() + end, +} diff --git a/nvim/lua/plugins/toggleterm.lua b/nvim/lua/plugins/toggleterm.lua new file mode 100644 index 0000000..1116d79 --- /dev/null +++ b/nvim/lua/plugins/toggleterm.lua @@ -0,0 +1,30 @@ +return { + "akinsho/toggleterm.nvim", + version = "*", + opts = { + size = function(term) + if term.direction == "horizontal" then + return 15 + elseif term.direction == "vertical" then + return vim.o.columns * 0.4 + end + end, + open_mapping = "tt", + start_in_insert = true, + insert_mappings = false, + persist_size = false, + direction = "float", + float_opts = { + border = "curved", + width = function() + return math.floor(vim.o.columns * 0.75) + end, + height = function() + return math.floor(vim.o.lines * 0.75) + end, + }, + + -- Check if 'fish' is executable, otherwise use Neovim's default shell + shell = vim.fn.executable("fish") == 1 and "fish" or vim.o.shell, + }, +} diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..434cfc5 --- /dev/null +++ b/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,79 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function() + local configs = require("nvim-treesitter.configs") + configs.setup({ + ensure_installed = { + "go", + "gomod", + "gowork", + "gosum", + "lua", + "vim", + "vimdoc", + "query", + "markdown", + "markdown_inline", + "dart", + "python", + }, + auto_install = true, + highlight = { + enable = true, + disable = function(lang, buf) + local max_filesize = 200 * 1024 -- 100 KB + local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) + if ok and stats and stats.size > max_filesize then + return true + end + end, + }, + indent = { enable = true, disable = { "ruby" } }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "", + node_incremental = "", + scope_incremental = false, + node_decremental = "", + }, + }, + }) + end, + }, + { + "nvim-treesitter/nvim-treesitter-textobjects", + dependencies = { + "nvim-treesitter/nvim-treesitter", + }, + init = function() + local config = require("nvim-treesitter.configs") + config.setup({ + textobjects = { + select = { + enable = true, + -- Automatically jump forward to textobj, similar to targets.vim + lookahead = true, + selection_modes = { + ["@parameter.outer"] = "v", -- charwise + ["@function.outer"] = "V", -- linewise + ["@class.outer"] = "", -- blockwise + }, + include_surrounding_whitespace = true, + }, + swap = { + enable = true, + swap_next = { + ["csa"] = { query = "@parameter.inner", desc = "Swap with next parameter" }, + }, + swap_previous = { + ["csA"] = "@parameter.inner", + }, + }, + }, + }) + end, + }, +} diff --git a/nvim/lua/plugins/whichkey.lua b/nvim/lua/plugins/whichkey.lua new file mode 100644 index 0000000..b24fcd0 --- /dev/null +++ b/nvim/lua/plugins/whichkey.lua @@ -0,0 +1,58 @@ +return { + "folke/which-key.nvim", + event = "VeryLazy", + opts = { + delay = 0, + icons = { + 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 = " ", + Down = " ", + Left = " ", + Right = " ", + C = " ", + M = " ", + D = " ", + S = " ", + CR = " ", + Esc = " ", + ScrollWheelDown = " ", + ScrollWheelUp = " ", + NL = " ", + BS = " ", + Space = " ", + Tab = " ", + F1 = "", + F2 = "", + F3 = "", + F4 = "", + F5 = "", + F6 = "", + F7 = "", + F8 = "", + F9 = "", + F10 = "", + F11 = "", + F12 = "", + }, + }, + + -- Document existing key chains + -- spec = { + -- { 's', group = '[S]earch' }, + -- { 't', group = '[T]oggle' }, + -- { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, + -- }, + }, + keys = { + { + "??", + function() + require("which-key").show({ global = false }) + end, + desc = "Buffer Local Keymaps (which-key)", + }, + }, +} diff --git a/nvim/test.go b/nvim/test.go new file mode 100644 index 0000000..70a7fe5 --- /dev/null +++ b/nvim/test.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Println("Hello world!") +}