diff options
| author | ozpv <39195175+ozpv@users.noreply.github.com> | 2024-07-27 21:41:38 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-27 21:41:38 +0000 |
| commit | ef3c406c013d8b751a02a5335a771cba87d1d3a3 (patch) | |
| tree | 2aea477261284cd19d735fd008425b13374dbf9e | |
| parent | 280b23cb2a649c9af01befabab86d910c54085fc (diff) | |
Delete nvim directory
| -rw-r--r-- | nvim/init.lua | 3 | ||||
| -rw-r--r-- | nvim/lua/config/keymapping.lua | 16 | ||||
| -rw-r--r-- | nvim/lua/config/lsp.lua | 0 | ||||
| -rw-r--r-- | nvim/lua/config/options.lua | 19 | ||||
| -rw-r--r-- | nvim/lua/config/telescope.lua | 30 | ||||
| -rw-r--r-- | nvim/lua/config/treesitter.lua | 14 | ||||
| -rw-r--r-- | nvim/lua/keymapping.lua | 1 | ||||
| -rw-r--r-- | nvim/lua/lazy.lua | 495 | ||||
| -rw-r--r-- | nvim/lua/options.lua | 19 | ||||
| -rw-r--r-- | nvim/lua/plugins/lazy.lua | 46 | ||||
| -rw-r--r-- | nvim/lua/plugins/lsp.lua | 0 | ||||
| -rw-r--r-- | nvim/lua/plugins/telescope.lua | 30 | ||||
| -rw-r--r-- | nvim/lua/plugins/treesitter.lua | 14 |
13 files changed, 0 insertions, 687 deletions
diff --git a/nvim/init.lua b/nvim/init.lua deleted file mode 100644 index dc268d2..0000000 --- a/nvim/init.lua +++ /dev/null @@ -1,3 +0,0 @@ -require("plugins.lazy") -require("config.options") -require("config.keymapping") diff --git a/nvim/lua/config/keymapping.lua b/nvim/lua/config/keymapping.lua deleted file mode 100644 index cebb621..0000000 --- a/nvim/lua/config/keymapping.lua +++ /dev/null @@ -1,16 +0,0 @@ --- clipboard -- -vim.keymap.set({"n", "v"}, "<leader>y", [["+y]], { desc = "Copy to clipboard" }) -vim.keymap.set({"n", "v"}, "<leader>y", [["+p]], { desc = "Paste from clipboard" }) - --- splits -- -vim.keymap.set("n", "<leader>sv", [[<C-w>v]], { desc = "Split window vertically" }) -vim.keymap.set("n", "<leader>sh", [[<C-w>s]], { desc = "Split window horizontally" }) -vim.keymap.set("n", "<leader>se", [[<C-w>=]], { desc = "Reset split size to default" }) -vim.keymap.set("n", "<leader>sw", [[close]], { desc = "Close current split" }) - --- tabs -- -vim.keymap.set("n", "<leader>to", [[tabnew]], { desc = "Open new tab" }) -vim.keymap.set("n", "<leader>tw", [[tabclose]], { desc = "Close current tab" }) -vim.keymap.set("n", "<leader>tl", [[tabn]], { desc = "Go to next tab" }) -vim.keymap.set("n", "<leader>th", [[tabp]], { desc = "Go to previous tab" }) -vim.keymap.set("n", "<leader>t%", [[tabnew %]], { desc = "Open current buffer in new tab" }) diff --git a/nvim/lua/config/lsp.lua b/nvim/lua/config/lsp.lua deleted file mode 100644 index e69de29..0000000 --- a/nvim/lua/config/lsp.lua +++ /dev/null diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua deleted file mode 100644 index 994ed77..0000000 --- a/nvim/lua/config/options.lua +++ /dev/null @@ -1,19 +0,0 @@ -vim.g.mapleader = " " - -vim.o.clipboard = "unnamedplus" - -vim.o.number = true - -vim.o.expandtab = true - -vim.o.shiftwidth = 2 - -vim.o.smartindent = true - -vim.o.tabstop = 2 - -vim.o.softtabstop = 2 - -vim.opt.shortmess:append "sI" - -vim.opt.whichwrap:append "<>[]hl" diff --git a/nvim/lua/config/telescope.lua b/nvim/lua/config/telescope.lua deleted file mode 100644 index 0cadb4e..0000000 --- a/nvim/lua/config/telescope.lua +++ /dev/null @@ -1,30 +0,0 @@ -return { - defaults = { - -- Default configuration for telescope goes here: - -- config_key = value, - mappings = { - i = { - -- map actions.which_key to <C-h> (default: <C-/>) - -- actions.which_key shows the mappings for your picker, - -- e.g. git_{create, delete, ...}_branch for the git_branches picker - ["<C-h>"] = "which_key" - } - } - }, - pickers = { - -- Default configuration for builtin pickers goes here: - -- picker_name = { - -- picker_config_key = value, - -- ... - -- } - -- Now the picker_config_key will be applied every time you call this - -- builtin picker - }, - extensions = { - -- Your extension configuration goes here: - -- extension_name = { - -- extension_config_key = value, - -- } - -- please take a look at the readme of the extension you want to configure - } -} diff --git a/nvim/lua/config/treesitter.lua b/nvim/lua/config/treesitter.lua deleted file mode 100644 index 4b0360f..0000000 --- a/nvim/lua/config/treesitter.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - ensure_installed = { - "lua", - "vim", - "vimdoc", - }, - - highlight = { - enable = true, - use_languagetree = true, - }, - - indent.enable = true, -} diff --git a/nvim/lua/keymapping.lua b/nvim/lua/keymapping.lua deleted file mode 100644 index f91b333..0000000 --- a/nvim/lua/keymapping.lua +++ /dev/null @@ -1 +0,0 @@ -vim.keymap.set({"n", "v"}, "<leader>y", [["+y]]) diff --git a/nvim/lua/lazy.lua b/nvim/lua/lazy.lua deleted file mode 100644 index 9d5e4aa..0000000 --- a/nvim/lua/lazy.lua +++ /dev/null @@ -1,495 +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({ - -- lazy options - checker = { - enabled = true, - notify = false, - }, - change_detection = { - notify = false, - }, - -- lualine - { - "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 - - local colors = { - blue = "#65D1FF", - green = "#3EFFDC", - violet = "#FF61EF", - yellow = "#FFDA7B", - red = "#FF4A4A", - fg = "#c3ccdc", - bg = "#112638", - inactive_bg = "#2c3043", - } - - local my_lualine_theme = { - normal = { - a = { bg = colors.blue, fg = colors.bg, gui = "bold" }, - b = { bg = colors.bg, fg = colors.fg }, - c = { bg = colors.bg, fg = colors.fg }, - }, - insert = { - a = { bg = colors.green, fg = colors.bg, gui = "bold" }, - b = { bg = colors.bg, fg = colors.fg }, - c = { bg = colors.bg, fg = colors.fg }, - }, - visual = { - a = { bg = colors.violet, fg = colors.bg, gui = "bold" }, - b = { bg = colors.bg, fg = colors.fg }, - c = { bg = colors.bg, fg = colors.fg }, - }, - command = { - a = { bg = colors.yellow, fg = colors.bg, gui = "bold" }, - b = { bg = colors.bg, fg = colors.fg }, - c = { bg = colors.bg, fg = colors.fg }, - }, - replace = { - a = { bg = colors.red, fg = colors.bg, gui = "bold" }, - b = { bg = colors.bg, fg = colors.fg }, - c = { bg = colors.bg, fg = colors.fg }, - }, - inactive = { - a = { bg = colors.inactive_bg, fg = colors.semilightgray, gui = "bold" }, - b = { bg = colors.inactive_bg, fg = colors.semilightgray }, - c = { bg = colors.inactive_bg, fg = colors.semilightgray }, - }, - } - - -- configure lualine with modified theme - lualine.setup({ - options = { - theme = my_lualine_theme, - }, - sections = { - lualine_x = { - { - lazy_status.updates, - cond = lazy_status.has_updates, - color = { fg = "#ff9e64" }, - }, - { "encoding" }, - { "fileformat" }, - { "filetype" }, - }, - }, - }) - end, - }, - -- bufferline - { - "akinsho/bufferline.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, - version = "*", - opts = { - options = { - mode = "tabs", - separator_style = "slant", - }, - }, - }, - -- telescope - { - "nvim-telescope/telescope.nvim", - branch = "0.1.x", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, - }, - config = function() - local telescope = require("telescope") - local actions = require("telescope.actions") - - telescope.setup({ - defaults = { - path_display = { "smart" }, - mappings = { - i = { - ["<C-k>"] = actions.move_selection_previous, -- move to prev result - ["<C-j>"] = actions.move_selection_next, -- move to next result - ["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist, - }, - }, - }, - }) - - telescope.load_extension("fzf") - - vim.keymap.set("n", "<leader>ff", [[Telescope find_files]], { desc = "Fuzzy find files in cwd" }) - vim.keymap.set("n", "<leader>fr", [[Telescope oldfiles]], { desc = "Fuzzy find recent files" }) - vim.keymap.set("n", "<leader>fs", [[Telescope live_grep]], { desc = "Find string in cwd" }) - vim.keymap.set("n", "<leader>fc", [[Telescope grep_string]], { desc = "Find string under cursor in cwd" }) - end, - }, - -- which key - { - "folke/which-key.nvim", - event = "VeryLazy", - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 500 - end, - opts = { - }, - }, - -- treesitter - { - "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 - ensure_installed = { - "json", - "javascript", - "typescript", - "tsx", - "html", - "css", - "prisma", - "markdown", - "markdown_inline", - "svelte", - "graphql", - "bash", - "lua", - "vim", - "dockerfile", - "gitignore", - "query", - "vimdoc", - "c", - "cpp", - "rust", - }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "<C-space>", - node_incremental = "<C-space>", - scope_incremental = false, - node_decremental = "<bs>", - }, - }, - }) - end, - }, - -- nvim cmp - { - "hrsh7th/nvim-cmp", - event = "InsertEnter", - dependencies = { - "hrsh7th/cmp-buffer", -- source for text in buffer - "hrsh7th/cmp-path", -- source for file system paths - { - "L3MON4D3/LuaSnip", - -- follow latest release. - version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release) - -- install jsregexp (optional!). - build = "make install_jsregexp", - }, - "saadparwaiz1/cmp_luasnip", -- for autocompletion - "rafamadriz/friendly-snippets", -- useful snippets - "onsails/lspkind.nvim", -- vs-code like pictograms - }, - config = function() - local cmp = require("cmp") - - local luasnip = require("luasnip") - - local lspkind = require("lspkind") - - -- loads vscode style snippets from installed plugins (e.g. friendly-snippets) - require("luasnip.loaders.from_vscode").lazy_load() - - cmp.setup({ - completion = { - completeopt = "menu,menuone,preview,noselect", - }, - snippet = { -- configure how nvim-cmp interacts with snippet engine - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - mapping = cmp.mapping.preset.insert({ - ["<C-k>"] = cmp.mapping.select_prev_item(), -- previous suggestion - ["<C-j>"] = cmp.mapping.select_next_item(), -- next suggestion - ["<C-b>"] = cmp.mapping.scroll_docs(-4), - ["<C-f>"] = cmp.mapping.scroll_docs(4), - ["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions - ["<C-e>"] = cmp.mapping.abort(), -- close completion window - ["<CR>"] = cmp.mapping.confirm({ select = false }), - }), - -- sources for autocompletion - sources = cmp.config.sources({ - { name = "luasnip" }, -- snippets - { name = "buffer" }, -- text within current buffer - { name = "path" }, -- file system paths - { name = "nvim_lsp" }, -- lsp - }), - - -- configure lspkind for vs-code like pictograms in completion menu - formatting = { - format = lspkind.cmp_format({ - maxwidth = 50, - ellipsis_char = "...", - }), - }, - }) - end, - }, - -- nvim-autopairs - { - "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, - }, - -- gruvbox colorscheme - { - "ellisonleao/gruvbox.nvim", - name = "gruvbox", - priority = 1000, - lazy = false, - config = function() - vim.cmd([[colorscheme gruvbox]]) - end, - }, - -- mason.nvim - { - "williamboman/mason.nvim", - dependencies = { - "williamboman/mason-lspconfig.nvim", - }, - config = function() - -- import mason - local mason = require("mason") - - -- import mason-lspconfig - local mason_lspconfig = require("mason-lspconfig") - - -- 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 = { - "tsserver", - "html", - "cssls", - "tailwindcss", - "svelte", - "lua_ls", - "graphql", - "emmet_ls", - "prismals", - "pyright", - }, - }) - end, - }, - -- nvim-lspconfig - { - "neovim/nvim-lspconfig", - event = { "BufReadPre", "BufNewFile" }, - dependencies = { - "hrsh7th/cmp-nvim-lsp", - { "antosha417/nvim-lsp-file-operations", config = true }, - { "folke/neodev.nvim", opts = {} }, - }, - config = function() - -- import lspconfig plugin - local lspconfig = require("lspconfig") - - -- import mason_lspconfig plugin - local mason_lspconfig = require("mason-lspconfig") - - -- import cmp-nvim-lsp plugin - local cmp_nvim_lsp = require("cmp_nvim_lsp") - - 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 = "Show LSP references" - vim.keymap.set("n", "gR", "<cmd>Telescope lsp_references<CR>", opts) -- show definition, references - - opts.desc = "Go to declaration" - vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts) -- go to declaration - - opts.desc = "Show LSP definitions" - vim.keymap.set("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts) -- show lsp definitions - - opts.desc = "Show LSP implementations" - vim.keymap.set("n", "gi", "<cmd>Telescope lsp_implementations<CR>", opts) -- show lsp implementations - - opts.desc = "Show LSP type definitions" - vim.keymap.set("n", "gt", "<cmd>Telescope lsp_type_definitions<CR>", opts) -- show lsp type definitions - - opts.desc = "See available code actions" - vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection - - opts.desc = "Smart rename" - vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts) -- smart rename - - opts.desc = "Show buffer diagnostics" - vim.keymap.set("n", "<leader>D", "<cmd>Telescope diagnostics bufnr=0<CR>", opts) -- show diagnostics for file - - opts.desc = "Show line diagnostics" - vim.keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts) -- show diagnostics for line - - opts.desc = "Go to previous diagnostic" - vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) -- jump to previous diagnostic in buffer - - opts.desc = "Go to next diagnostic" - vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts) -- jump to next diagnostic in buffer - - opts.desc = "Show documentation for what is under cursor" - vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) -- show documentation for what is under cursor - - opts.desc = "Restart LSP" - vim.keymap.set("n", "<leader>rs", ":LspRestart<CR>", opts) -- mapping to restart lsp if necessary - 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) - -- (not in youtube nvim video) - 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, - ["svelte"] = function() - -- configure svelte server - lspconfig["svelte"].setup({ - capabilities = capabilities, - on_attach = function(client, bufnr) - vim.api.nvim_create_autocmd("BufWritePost", { - pattern = { "*.js", "*.ts" }, - callback = function(ctx) - -- Here use ctx.match instead of ctx.file - client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.match }) - end, - }) - end, - }) - end, - ["graphql"] = function() - -- configure graphql language server - lspconfig["graphql"].setup({ - capabilities = capabilities, - filetypes = { "graphql", "gql", "svelte", "typescriptreact", "javascriptreact" }, - }) - end, - ["emmet_ls"] = function() - -- configure emmet language server - lspconfig["emmet_ls"].setup({ - capabilities = capabilities, - filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "svelte" }, - }) - 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, - }) - end, - }, - { - - }, -}) diff --git a/nvim/lua/options.lua b/nvim/lua/options.lua deleted file mode 100644 index 994ed77..0000000 --- a/nvim/lua/options.lua +++ /dev/null @@ -1,19 +0,0 @@ -vim.g.mapleader = " " - -vim.o.clipboard = "unnamedplus" - -vim.o.number = true - -vim.o.expandtab = true - -vim.o.shiftwidth = 2 - -vim.o.smartindent = true - -vim.o.tabstop = 2 - -vim.o.softtabstop = 2 - -vim.opt.shortmess:append "sI" - -vim.opt.whichwrap:append "<>[]hl" diff --git a/nvim/lua/plugins/lazy.lua b/nvim/lua/plugins/lazy.lua deleted file mode 100644 index 2e99dce..0000000 --- a/nvim/lua/plugins/lazy.lua +++ /dev/null @@ -1,46 +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({ - "nvim-telescope/telescope.nvim", - "nvim-treesitter/treesitter.nvim", - -- gruvbox colorscheme - { - "ellisonleao/gruvbox.nvim", - name = "gruvbox", - priority = 1000, - lazy = false, - config = function() - vim.cmd([[colorscheme gruvbox]]) - end, - }, - -- LSP - { - "neovim/nvim-lspconfig", - dependencies = { - "williamboman/mason.nvim", - }, - config = function() - local lspconfig = require("lspconfig") - local mason = require("mason") - mason.setup() - lspconfig.pyright.setup {} - lspconfig.tsserver.setup {} - lspconfig.rust_analyzer.setup { - settings = { - ['rust-analyzer'] = {}, - }, - } - end, - } -}) diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua deleted file mode 100644 index e69de29..0000000 --- a/nvim/lua/plugins/lsp.lua +++ /dev/null diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua deleted file mode 100644 index 0cadb4e..0000000 --- a/nvim/lua/plugins/telescope.lua +++ /dev/null @@ -1,30 +0,0 @@ -return { - defaults = { - -- Default configuration for telescope goes here: - -- config_key = value, - mappings = { - i = { - -- map actions.which_key to <C-h> (default: <C-/>) - -- actions.which_key shows the mappings for your picker, - -- e.g. git_{create, delete, ...}_branch for the git_branches picker - ["<C-h>"] = "which_key" - } - } - }, - pickers = { - -- Default configuration for builtin pickers goes here: - -- picker_name = { - -- picker_config_key = value, - -- ... - -- } - -- Now the picker_config_key will be applied every time you call this - -- builtin picker - }, - extensions = { - -- Your extension configuration goes here: - -- extension_name = { - -- extension_config_key = value, - -- } - -- please take a look at the readme of the extension you want to configure - } -} diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua deleted file mode 100644 index 4b0360f..0000000 --- a/nvim/lua/plugins/treesitter.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - ensure_installed = { - "lua", - "vim", - "vimdoc", - }, - - highlight = { - enable = true, - use_languagetree = true, - }, - - indent.enable = true, -} |
