From 04e75b253f4e3f3849aaeb2082cd494e7a6b6496 Mon Sep 17 00:00:00 2001 From: Snoweuph Date: Mon, 13 May 2024 20:43:31 +0200 Subject: [PATCH] Add neovim --- .config/nvim/dependencies.dnf.txt | 1 + .config/nvim/init.lua | 1 + .config/nvim/lua/core/editor.lua | 8 + .config/nvim/lua/core/init.lua | 3 + .config/nvim/lua/core/keymap.lua | 9 + .config/nvim/lua/core/package_manager.lua | 15 ++ .config/nvim/lua/plugins/dashboard.lua | 32 ++++ .config/nvim/lua/plugins/editor.lua | 8 + .../plugins/editor/editor_auto_brackets.lua | 6 + .../editor/editor_code_highlighting.lua | 19 ++ .../plugins/editor/editor_code_snippets.lua | 74 ++++++++ .../lua/plugins/editor/editor_debugging.lua | 57 ++++++ .../plugins/editor/editor_language_server.lua | 5 + .../editor/editor_markdown_preview.lua | 30 ++++ .../language_server/language_server.lua | 170 ++++++++++++++++++ .../language_server/language_server_extra.lua | 40 +++++ .../language_server_nvim_configuration.lua | 16 ++ .config/nvim/lua/plugins/file_tree.lua | 61 +++++++ .config/nvim/lua/plugins/git.lua | 17 ++ .config/nvim/lua/plugins/key_list.lua | 10 ++ .config/nvim/lua/plugins/search.lua | 60 +++++++ .config/nvim/lua/plugins/status_bar.lua | 60 +++++++ .config/nvim/lua/plugins/terminal.lua | 39 ++++ .config/nvim/lua/plugins/theme.lua | 9 + 24 files changed, 750 insertions(+) create mode 100644 .config/nvim/dependencies.dnf.txt create mode 100644 .config/nvim/init.lua create mode 100644 .config/nvim/lua/core/editor.lua create mode 100644 .config/nvim/lua/core/init.lua create mode 100644 .config/nvim/lua/core/keymap.lua create mode 100644 .config/nvim/lua/core/package_manager.lua create mode 100644 .config/nvim/lua/plugins/dashboard.lua create mode 100644 .config/nvim/lua/plugins/editor.lua create mode 100644 .config/nvim/lua/plugins/editor/editor_auto_brackets.lua create mode 100644 .config/nvim/lua/plugins/editor/editor_code_highlighting.lua create mode 100644 .config/nvim/lua/plugins/editor/editor_code_snippets.lua create mode 100644 .config/nvim/lua/plugins/editor/editor_debugging.lua create mode 100644 .config/nvim/lua/plugins/editor/editor_language_server.lua create mode 100644 .config/nvim/lua/plugins/editor/editor_markdown_preview.lua create mode 100644 .config/nvim/lua/plugins/editor/language_server/language_server.lua create mode 100644 .config/nvim/lua/plugins/editor/language_server/language_server_extra.lua create mode 100644 .config/nvim/lua/plugins/editor/language_server/language_server_nvim_configuration.lua create mode 100644 .config/nvim/lua/plugins/file_tree.lua create mode 100644 .config/nvim/lua/plugins/git.lua create mode 100644 .config/nvim/lua/plugins/key_list.lua create mode 100644 .config/nvim/lua/plugins/search.lua create mode 100644 .config/nvim/lua/plugins/status_bar.lua create mode 100644 .config/nvim/lua/plugins/terminal.lua create mode 100644 .config/nvim/lua/plugins/theme.lua diff --git a/.config/nvim/dependencies.dnf.txt b/.config/nvim/dependencies.dnf.txt new file mode 100644 index 0000000..121b303 --- /dev/null +++ b/.config/nvim/dependencies.dnf.txt @@ -0,0 +1 @@ +neovim lua gcc curl wget git unzip tar gzip ripgrep php composer go nodejs npm \ No newline at end of file diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 0000000..d9a3b72 --- /dev/null +++ b/.config/nvim/init.lua @@ -0,0 +1 @@ +require("core") diff --git a/.config/nvim/lua/core/editor.lua b/.config/nvim/lua/core/editor.lua new file mode 100644 index 0000000..3781ab5 --- /dev/null +++ b/.config/nvim/lua/core/editor.lua @@ -0,0 +1,8 @@ +-- Use 2 Spaces Instead of Tabs -- +vim.cmd("set expandtab") +vim.cmd("set tabstop=4") +vim.cmd("set softtabstop=4") +vim.cmd("set shiftwidth=4") + +-- Enable Line Number -- +vim.cmd("set number") \ No newline at end of file diff --git a/.config/nvim/lua/core/init.lua b/.config/nvim/lua/core/init.lua new file mode 100644 index 0000000..39ba678 --- /dev/null +++ b/.config/nvim/lua/core/init.lua @@ -0,0 +1,3 @@ +require("core.keymap") +require("core.editor") +require("core.package_manager") diff --git a/.config/nvim/lua/core/keymap.lua b/.config/nvim/lua/core/keymap.lua new file mode 100644 index 0000000..a5aae9c --- /dev/null +++ b/.config/nvim/lua/core/keymap.lua @@ -0,0 +1,9 @@ +vim.g.mapleader = " " + +--[[ Indentation ]]-- +vim.keymap.set("n", "", " >>") +vim.keymap.set("n", "", " <<") + +--[[ Navigating Panels ]]-- +-- TODO: Normal, Insert, Terminal Mode + diff --git a/.config/nvim/lua/core/package_manager.lua b/.config/nvim/lua/core/package_manager.lua new file mode 100644 index 0000000..0bcad8a --- /dev/null +++ b/.config/nvim/lua/core/package_manager.lua @@ -0,0 +1,15 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +local opts = {} +require("lazy").setup("plugins", opts) diff --git a/.config/nvim/lua/plugins/dashboard.lua b/.config/nvim/lua/plugins/dashboard.lua new file mode 100644 index 0000000..0a08d22 --- /dev/null +++ b/.config/nvim/lua/plugins/dashboard.lua @@ -0,0 +1,32 @@ +return { + "goolord/alpha-nvim", + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + config = function() + -- Setup -- + local alpha = require("alpha") + local dashboard = require("alpha.themes.startify") + + -- Header -- + dashboard.section.header.val = { + [[ ]], + [[ ]], + [[ ]], + [[ ]], + [[  ]], + [[ ████ ██████ █████ ██ ]], + [[ ███████████ █████  ]], + [[ █████████ ███████████████████ ███ ███████████ ]], + [[ █████████ ███ █████████████ █████ ██████████████ ]], + [[ █████████ ██████████ █████████ █████ █████ ████ █████ ]], + [[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]], + [[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]], + [[ ]], + [[ ]], + [[ ]], + } + + alpha.setup(dashboard.opts) + end, +} diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua new file mode 100644 index 0000000..ee1bbf0 --- /dev/null +++ b/.config/nvim/lua/plugins/editor.lua @@ -0,0 +1,8 @@ +return { + require("plugins.editor.editor_auto_brackets"), + require("plugins.editor.editor_code_highlighting"), + require("plugins.editor.editor_code_snippets"), + require("plugins.editor.editor_debugging"), + require("plugins.editor.editor_language_server"), + require("plugins.editor.editor_markdown_preview") +} \ No newline at end of file diff --git a/.config/nvim/lua/plugins/editor/editor_auto_brackets.lua b/.config/nvim/lua/plugins/editor/editor_auto_brackets.lua new file mode 100644 index 0000000..366c2a7 --- /dev/null +++ b/.config/nvim/lua/plugins/editor/editor_auto_brackets.lua @@ -0,0 +1,6 @@ +return { + 'm4xshen/autoclose.nvim', + config = function() + require("autoclose").setup() + end +} diff --git a/.config/nvim/lua/plugins/editor/editor_code_highlighting.lua b/.config/nvim/lua/plugins/editor/editor_code_highlighting.lua new file mode 100644 index 0000000..44e0579 --- /dev/null +++ b/.config/nvim/lua/plugins/editor/editor_code_highlighting.lua @@ -0,0 +1,19 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function() + -- Setup -- + local config = require("nvim-treesitter.configs") + config.setup({ + auto_install = true, + highlight = { enable = true }, + indent = { enable = true }, + }) + end, + }, + { + "NoahTheDuke/vim-just", + ft = { "just" }, + }, +} diff --git a/.config/nvim/lua/plugins/editor/editor_code_snippets.lua b/.config/nvim/lua/plugins/editor/editor_code_snippets.lua new file mode 100644 index 0000000..07e29b4 --- /dev/null +++ b/.config/nvim/lua/plugins/editor/editor_code_snippets.lua @@ -0,0 +1,74 @@ +return { + { + "L3MON4D3/LuaSnip", + version = "2.*", + dependencies = { + "rafamadriz/friendly-snippets", + "mireq/luasnip-snippets", + }, + build = "make install_jsregexp", + config = function() + -- Setup -- + require("luasnip.loaders.from_vscode").lazy_load() + require("luasnip.loaders.from_snipmate").lazy_load() + require("luasnip_snippets.common.snip_utils").setup() + end, + }, + { + "hrsh7th/nvim-cmp", + dependencies = { + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", + "hrsh7th/cmp-nvim-lsp", + }, + config = function() + -- Setup -- + local cmp = require("cmp") + local luasnip = require("luasnip") + luasnip.setup({ + load_ft_func = require("luasnip_snippets.common.snip_utils").load_ft_func, + ft_func = require("luasnip_snippets.common.snip_utils").ft_func, + enable_autosnippets = true, + }) + + -- Keybinding -- + vim.keymap.set({ "i", "s" }, "", function() + if luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + else + vim.api.nvim_input("") + end + end, { silent = true }) + + vim.keymap.set({ "i", "s" }, "", function() + luasnip.jump(-1) + end, { silent = true }) + + local doc_keybindings = { + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), + } + + -- Setup -- + cmp.setup({ + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert(doc_keybindings), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, + }, { { name = "buffer" } }), + }) + end, + }, +} diff --git a/.config/nvim/lua/plugins/editor/editor_debugging.lua b/.config/nvim/lua/plugins/editor/editor_debugging.lua new file mode 100644 index 0000000..b286ae0 --- /dev/null +++ b/.config/nvim/lua/plugins/editor/editor_debugging.lua @@ -0,0 +1,57 @@ +return { + "mfussenegger/nvim-dap", + dependencies = { + "rcarriga/nvim-dap-ui", + "nvim-neotest/nvim-nio", + }, + config = function() + -- Setup Debugging -- + local dap = require("dap") + + -- Open UI on Debugging -- + local dapui = require("dapui").setup() + dap.listeners.before.attach.dapui_config = function() + dapui.open() + end + dap.listeners.before.launch.dapui_config = function() + dapui.open() + end + dap.listeners.before.event_terminated.dapui_config = function() + dapui.close() + end + dap.listeners.before.event_exited.dapui_config = function() + dapui.close() + end + + -- Keybinding -- + vim.keymap.set("n", "db", dap.toggle_breakpoint, { desc = "Toggle Breakpoint" }) + vim.keymap.set("n", "dc", dap.continue, { desc = "Debugger Continue" }) + vim.keymap.set("n", "dx", dap.terminate, { desc = "Debugger Terminate" }) + vim.keymap.set("n", "ds", dap.step_over, { desc = "Debugger Step Over" }) + + -- Breakpoints -- + vim.api.nvim_set_hl(0, "DapBreakpoint", { ctermbg = 0, fg = "#993939", bg = "#31353f" }) + vim.api.nvim_set_hl(0, "DapLogPoint", { ctermbg = 0, fg = "#61afef", bg = "#31353f" }) + vim.api.nvim_set_hl(0, "DapStopped", { ctermbg = 0, fg = "#98c379", bg = "#31353f" }) + vim.fn.sign_define( + "DapBreakpoint", + { text = "", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" } + ) + vim.fn.sign_define( + "DapBreakpointCondition", + { text = "󰣏", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" } + ) + vim.fn.sign_define( + "DapBreakpointRejected", + { text = "", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" } + ) + vim.fn.sign_define( + "DapLogPoint", + { text = "", texthl = "DapLogPoint", linehl = "DapLogPoint", numhl = "DapLogPoint" } + ) + vim.fn.sign_define( + "DapStopped", + { text = "", texthl = "DapStopped", linehl = "DapStopped", numhl = "DapStopped" } + ) + end, +} diff --git a/.config/nvim/lua/plugins/editor/editor_language_server.lua b/.config/nvim/lua/plugins/editor/editor_language_server.lua new file mode 100644 index 0000000..37bc374 --- /dev/null +++ b/.config/nvim/lua/plugins/editor/editor_language_server.lua @@ -0,0 +1,5 @@ +return { + require("plugins.editor.language_server.language_server"), + require("plugins.editor.language_server.language_server_extra"), + require("plugins.editor.language_server.language_server_nvim_configuration"), +} \ No newline at end of file diff --git a/.config/nvim/lua/plugins/editor/editor_markdown_preview.lua b/.config/nvim/lua/plugins/editor/editor_markdown_preview.lua new file mode 100644 index 0000000..f1bca7a --- /dev/null +++ b/.config/nvim/lua/plugins/editor/editor_markdown_preview.lua @@ -0,0 +1,30 @@ +return { + "mrjones2014/mdpreview.nvim", + ft = "markdown", + dependencies = { + "norcalli/nvim-terminal.lua", + config = true, + }, + config = function() + require("mdpreview").setup({ + cli_args = { + "glow", + "-s", + "~/.config/glow/catppuccin-macchiato.json", + "-w", + "1", + "--local", + }, + renderer = { + opts = { + win_opts = { + number = true, + wrap = false, + }, + }, + }, + }) + + vim.keymap.set("n", "mp", ":Mdpreview", { desc = "Show Markdown Preview" }) + end, +} diff --git a/.config/nvim/lua/plugins/editor/language_server/language_server.lua b/.config/nvim/lua/plugins/editor/language_server/language_server.lua new file mode 100644 index 0000000..5075583 --- /dev/null +++ b/.config/nvim/lua/plugins/editor/language_server/language_server.lua @@ -0,0 +1,170 @@ +return { + { + "williamboman/mason.nvim", + lazy = false, + config = function() + require("mason").setup() + end, + }, + { + "williamboman/mason-lspconfig.nvim", + lazy = false, + opts = { + auto_install = true, + }, + config = function() + require("mason-lspconfig").setup({ + ensure_installed = { + "lua_ls", + "bashls", + "dotls", + "jsonls", + "sqlls", + "lemminx", + "yamlls", + "marksman", + "html", + "emmet_ls", + "cssls", + "tailwindcss", + "tsserver", + "stimulus_ls", + "svelte", + "volar", + "eslint", + "phpactor", + "gopls", + "rust_analyzer", + "jdtls", + "kotlin_language_server", + "pylsp", + }, + }) + end, + }, + { + "neovim/nvim-lspconfig", + lazy = false, + config = function() + -- Setup -- + local capabilities = require("cmp_nvim_lsp").default_capabilities() + local lspconfig = require("lspconfig") + + -- Lua support -- + lspconfig.lua_ls.setup({ + capabilities = capabilities, + settings = { + Lua = { + diagnostics = { + globals = { "vim" }, + } + } + } + }) + + -- Bash support -- + lspconfig.bashls.setup({ + capabilities = capabilities, + }) + -- Dotenv support -- + lspconfig.dotls.setup({ + capabilities = capabilities, + }) + + -- JSON support -- + lspconfig.jsonls.setup({ + capabilities = capabilities, + }) + -- SQL support -- + lspconfig.sqlls.setup({ + capabilities = capabilities, + }) + -- XML support -- + lspconfig.lemminx.setup({ + capabilities = capabilities, + }) + -- YAML support -- + lspconfig.yamlls.setup({ + capabilities = capabilities, + }) + + -- Markdown support -- + lspconfig.marksman.setup({ + capabilities = capabilities, + }) + + -- HTML support -- + lspconfig.html.setup({ + capabilities = capabilities, + }) + -- Emmet support -- + lspconfig.emmet_ls.setup({ + capabilities = capabilities, + }) + -- PHP support -- + lspconfig.phpactor.setup({ + capabilities = capabilities, + }) + -- CSS & SCSS support --$response + lspconfig.cssls.setup({ + capabilities = capabilities, + }) + -- Tailwind support -- + lspconfig.tailwindcss.setup({ + capabilities = capabilities, + }) + -- JavaScript & TypeScript support -- + lspconfig.tsserver.setup({ + capabilities = capabilities, + }) + -- Stimulus support -- + lspconfig.stimulus_ls.setup({ + capabilities = capabilities, + }) + -- Svelte support -- + lspconfig.svelte.setup({ + capabilities = capabilities, + }) + -- Vue support -- + lspconfig.volar.setup({ + capabilities = capabilities, + }) + + -- Go support -- + lspconfig.gopls.setup({ + capabilities = capabilities, + }) + + -- Rust support -- + lspconfig.rust_analyzer.setup({ + capabilities = capabilities, + }) + + -- Java support -- + lspconfig.jdtls.setup({ + capabilities = capabilities, + }) + -- Kotlin support -- + lspconfig.kotlin_language_server.setup({ + capabilities = capabilities, + }) + + -- Python support -- + lspconfig.pylsp.setup({ + capabilities = capabilities, + }) + + -- Eslint support -- + lspconfig.eslint.setup({ + capabilities = capabilities, + }) + + -- Keybinding -- + + vim.keymap.set("n", "cd", vim.lsp.buf.hover, { desc = "Show Code Definition" }) + vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "Go to Definition" }) + vim.keymap.set("n", "gr", vim.lsp.buf.references, { desc = "Go to References" }) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { desc = "Do Code Actions" }) + end, + } +} diff --git a/.config/nvim/lua/plugins/editor/language_server/language_server_extra.lua b/.config/nvim/lua/plugins/editor/language_server/language_server_extra.lua new file mode 100644 index 0000000..44974e8 --- /dev/null +++ b/.config/nvim/lua/plugins/editor/language_server/language_server_extra.lua @@ -0,0 +1,40 @@ +return { + "nvimtools/none-ls.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + }, + config = function() + -- Setup -- + local null_ls = require("null-ls") + null_ls.setup({ + sources = { + -- Prettier -- + null_ls.builtins.formatting.prettier, + + -- Php -- + null_ls.builtins.diagnostics.phpstan, + null_ls.builtins.formatting.phpcsfixer.with({ + prefer_local = "vendor/bin/php-cs-fixer", + args = { "fix", "--allow-risky=yes", "$FILENAME" } + }), + + -- Twig -- + null_ls.builtins.diagnostics.twigcs, + + -- JavaScript & Typescript + null_ls.builtins.formatting.eslint_d, + + -- Lua -- + null_ls.builtins.formatting.stylua, + + -- Go -- + null_ls.builtins.formatting.gofumpt, + null_ls.builtins.code_actions.gomodifytags, + null_ls.builtins.code_actions.impl + }, + }) + + -- Keybinding -- + vim.keymap.set("n", "gf", vim.lsp.buf.format, { desc = "Format Code" }) + end, +} diff --git a/.config/nvim/lua/plugins/editor/language_server/language_server_nvim_configuration.lua b/.config/nvim/lua/plugins/editor/language_server/language_server_nvim_configuration.lua new file mode 100644 index 0000000..c01cf0e --- /dev/null +++ b/.config/nvim/lua/plugins/editor/language_server/language_server_nvim_configuration.lua @@ -0,0 +1,16 @@ +return { + "folke/neodev.nvim", + dependencies = { + "rcarriga/nvim-dap-ui", + }, + config = function() + require("neodev").setup({ + library = { + plugins = { + "nvim-dap-ui", + }, + types = true, + }, + }) + end, +} \ No newline at end of file diff --git a/.config/nvim/lua/plugins/file_tree.lua b/.config/nvim/lua/plugins/file_tree.lua new file mode 100644 index 0000000..0b550a9 --- /dev/null +++ b/.config/nvim/lua/plugins/file_tree.lua @@ -0,0 +1,61 @@ +return { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + }, + config = function() + -- Setup -- + require("neo-tree").setup({ + close_if_last_window = false, + enable_git_status = true, + enable_diagnostics = true, + name = { + trailing_slash = false, + use_git_status_colors = true, + highlight = "NeoTreeFileName", + }, + git_status = { + symbols = { + -- Git Change type Icon -- + added = "✚", + modified = "", + deleted = "✖", + renamed = "󰁕", + -- Git Status type Icon -- + untracked = "", + ignored = "", + unstaged = "󰄱", + staged = "", + conflict = "", + } + }, + symlink_target = { + enabled = false, + }, + filesystem = { + hijack_netrw_behavior = "open_default" + } + }) + + -- Dignostic Icons -- + vim.fn.sign_define("DiagnosticSignError", { + text = " ", texthl = "DiagnosticSignError" + }) + vim.fn.sign_define("DiagnosticSignWarn", { + text = " ", texthl = "DiagnosticSignWarn" + }) + vim.fn.sign_define("DiagnosticSignInfo", { + text = " ", texthl = "DiagnosticSignInfo" + }) + vim.fn.sign_define("DiagnosticSignHint", { + text = "󰌵", texthl = "DiagnosticSignHint" + }) + + -- Keybinding -- + vim.keymap.set("n", "", ":Neotree toggle reveal left", { desc = "Toggle File Tree" }) + vim.keymap.set("n", "bf", ":Neotree buffers reveal float", { desc = "Show Open Files" }) + end, +} diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua new file mode 100644 index 0000000..545643b --- /dev/null +++ b/.config/nvim/lua/plugins/git.lua @@ -0,0 +1,17 @@ +return { + { + "tpope/vim-fugitive", + }, + { + "lewis6991/gitsigns.nvim", + config = function() + -- Setup -- + require("gitsigns").setup() + + -- Keybinding -- + vim.keymap.set("n", "gh", ":Gitsigns preview_hunk_inline", { desc = "Toggle Inline Git Diff" }) + vim.keymap.set("n", "gb", ":Gitsigns toggle_current_line_blame", { desc = "Toggle Inline Git Blame" }) + vim.keymap.set("n", "go", ":Git ", { desc = "Open Git" }) + end, + }, +} \ No newline at end of file diff --git a/.config/nvim/lua/plugins/key_list.lua b/.config/nvim/lua/plugins/key_list.lua new file mode 100644 index 0000000..db3615a --- /dev/null +++ b/.config/nvim/lua/plugins/key_list.lua @@ -0,0 +1,10 @@ +return { + "folke/which-key.nvim", + config = function() + vim.o.timeout = true; + vim.o.timeoutlen = 300 + require("which-key").setup({ + + }) + end +} diff --git a/.config/nvim/lua/plugins/search.lua b/.config/nvim/lua/plugins/search.lua new file mode 100644 index 0000000..4a8bc28 --- /dev/null +++ b/.config/nvim/lua/plugins/search.lua @@ -0,0 +1,60 @@ +return { + "nvim-telescope/telescope.nvim", + tag = "0.1.5", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope-ui-select.nvim" + }, + config = function() + -- Setup -- + require("telescope").setup({ + extensions = { + ["ui-select"] = { + require("telescope.themes").get_dropdown({}), + }, + }, + }) + require("telescope").load_extension("ui-select") + + -- Keybinding -- + vim.keymap.set( + "n", + "ff", + function() + local telescope = require("telescope.builtin") + local state = require("neo-tree.sources.manager").get_state("filesystem") + telescope.find_files({ search_dirs = { state.path } }) + end, + { desc = "Find File" } + ) + vim.keymap.set( + "n", + "fz", + function() + local telescope = require("telescope.builtin") + local state = require("neo-tree.sources.manager").get_state("filesystem") + telescope.live_grep({ search_dirs = { state.path } }) + end, + { desc = "Fuzzy Find" } + ) + vim.keymap.set( + "n", + "gff", + function() + local telescope = require("telescope.builtin") + telescope.find_files({ search_dirs = { "~" } }) + end, + { desc = "Global Find File" } + ) + vim.keymap.set( + "n", + "gfz", + function() + local telescope = require("telescope.builtin") + telescope.live_grep({ search_dirs = { "~" } }) + end, + { desc = "Global Fuzzy Find" } + ) + + end +} diff --git a/.config/nvim/lua/plugins/status_bar.lua b/.config/nvim/lua/plugins/status_bar.lua new file mode 100644 index 0000000..ee22a70 --- /dev/null +++ b/.config/nvim/lua/plugins/status_bar.lua @@ -0,0 +1,60 @@ +return { + { + "nvim-lualine/lualine.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + -- Setup -- + require("lualine").setup({ + options = { + component_separators = { left = "", right = "" }, + section_separators = { left = "", right = "" }, + disabled_filetypes = { + "neo-tree", + "fugitive", + "help", + }, + ignore_focus = {}, + always_divide_middle = true, + globalstatus = false, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + }, + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch", "diff", "diagnostics" }, + lualine_x = { "location" }, + lualine_y = { "encoding" }, + lualine_z = { "filetype" }, + }, + inactive_sections = { + lualine_a = { "mode" }, + lualine_b = { "branch", "diff", "diagnostics" }, + lualine_x = { "location" }, + lualine_y = { "encoding" }, + lualine_z = { "filetype" }, + }, + tabline = {}, + winbar = { + lualine_a = { "filename" }, + }, + inactive_winbar = { + lualine_a = { "filename" }, + }, + extensions = {}, + }) + end, + }, + { + "romgrk/barbar.nvim", + dependencies = { + "lewis6991/gitsigns.nvim", + "nvim-tree/nvim-web-devicons", + }, + config = function() + require("barbar").setup() + end, + }, +} diff --git a/.config/nvim/lua/plugins/terminal.lua b/.config/nvim/lua/plugins/terminal.lua new file mode 100644 index 0000000..4db9a9e --- /dev/null +++ b/.config/nvim/lua/plugins/terminal.lua @@ -0,0 +1,39 @@ +return { + "caenrique/buffer-term.nvim", + config = function() + local buffer_term = require("buffer-term") + buffer_term.setup() + + vim.keymap.set({ "n", "t" }, "", buffer_term.toggle_last) + vim.keymap.set({ "n", "t" }, "0", function() + buffer_term.toggle("0") + end) + vim.keymap.set({ "n", "t" }, "1", function() + buffer_term.toggle("1") + end) + vim.keymap.set({ "n", "t" }, "2", function() + buffer_term.toggle("2") + end) + vim.keymap.set({ "n", "t" }, "3", function() + buffer_term.toggle("3") + end) + vim.keymap.set({ "n", "t" }, "4", function() + buffer_term.toggle("4") + end) + vim.keymap.set({ "n", "t" }, "5", function() + buffer_term.toggle("5") + end) + vim.keymap.set({ "n", "t" }, "6", function() + buffer_term.toggle("6") + end) + vim.keymap.set({ "n", "t" }, "7", function() + buffer_term.toggle("7") + end) + vim.keymap.set({ "n", "t" }, "8", function() + buffer_term.toggle("8") + end) + vim.keymap.set({ "n", "t" }, "9", function() + buffer_term.toggle("9") + end) + end, +} diff --git a/.config/nvim/lua/plugins/theme.lua b/.config/nvim/lua/plugins/theme.lua new file mode 100644 index 0000000..0cdc73b --- /dev/null +++ b/.config/nvim/lua/plugins/theme.lua @@ -0,0 +1,9 @@ +return { + "catppuccin/nvim", + name = "catppuccin", + priority = 1000, + config = function() + -- Set Theme -- + vim.cmd("colorscheme catppuccin") + end +} \ No newline at end of file