diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 2ad4d31d..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - - - -## Describe the bug - - -## To Reproduce - -1. ... - -## Desktop - -- OS: -- Terminal: - -## Neovim Version - - -``` -``` diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index f401c9ff..00000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,8 +0,0 @@ -*************************************************************************** -**NOTE** -Please verify that the `base repository` above has the intended destination! -Github by default opens Pull Requests against the parent of a forked repository. -If this is your personal fork and you didn't intend to open a PR for contribution -to the original project then adjust the `base repository` accordingly. -************************************************************************** - diff --git a/.github/workflows/stylua.yml b/.github/workflows/stylua.yml deleted file mode 100644 index 75db6c33..00000000 --- a/.github/workflows/stylua.yml +++ /dev/null @@ -1,21 +0,0 @@ -# Check Lua Formatting -name: Check Lua Formatting -on: pull_request_target - -jobs: - stylua-check: - if: github.repository == 'nvim-lua/kickstart.nvim' - name: Stylua Check - runs-on: ubuntu-latest - steps: - - name: Checkout Code - uses: actions/checkout@v2 - with: - ref: ${{ github.event.pull_request.head.sha }} - - name: Stylua Check - uses: JohnnyMorganz/stylua-action@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: latest - args: --check . - diff --git a/Saved/snacks.lua b/Saved/snacks.lua index 0a340740..e2adc87a 100644 --- a/Saved/snacks.lua +++ b/Saved/snacks.lua @@ -2,7 +2,6 @@ return { "folke/snacks.nvim", priority = 1000, lazy = false, - ---@type snacks.Config opts = { -- your configuration comes here -- or leave it empty to use the default settings @@ -21,8 +20,6 @@ return { ███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║ ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ]], - -- stylua: ignore - ---@type snacks.dashboard.Item[] keys = { -- { icon = " ", key = "f", desc = "Find File", action = ":lua Snacks.dashboard.pick('files')" }, { icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" }, diff --git a/doc/kickstart.txt b/doc/kickstart.txt deleted file mode 100644 index cb87ac3f..00000000 --- a/doc/kickstart.txt +++ /dev/null @@ -1,24 +0,0 @@ -================================================================================ -INTRODUCTION *kickstart.nvim* - -Kickstart.nvim is a project to help you get started on your neovim journey. - - *kickstart-is-not* -It is not: -- Complete framework for every plugin under the sun -- Place to add every plugin that could ever be useful - - *kickstart-is* -It is: -- Somewhere that has a good start for the most common "IDE" type features: - - autocompletion - - goto-definition - - find references - - fuzzy finding - - and hinting at what more can be done :) -- A place to _kickstart_ your journey. - - You should fork this project and use/modify it so that it matches your - style and preferences. If you don't want to do that, there are probably - other projects that would fit much better for you (and that's great!)! - - vim:tw=78:ts=8:ft=help:norl: diff --git a/doc/tags b/doc/tags deleted file mode 100644 index 687ae772..00000000 --- a/doc/tags +++ /dev/null @@ -1,3 +0,0 @@ -kickstart-is kickstart.txt /*kickstart-is* -kickstart-is-not kickstart.txt /*kickstart-is-not* -kickstart.nvim kickstart.txt /*kickstart.nvim* diff --git a/init.lua b/init.lua index 70948602..ef3b323c 100644 --- a/init.lua +++ b/init.lua @@ -16,11 +16,10 @@ if not vim.loop.fs_stat(lazypath) then end vim.opt.rtp:prepend(lazypath) -require('lazy').setup('plugins', { - change_detection = { - notify = false, - }, -}) +require('lazy').setup { + { import = 'plugins' }, + { import = 'plugins.lsp' }, +} require 'user.options' require 'user.keymaps' @@ -30,3 +29,6 @@ require 'user.autocmds' -- require 'user.lsp' -- require 'user.treesitter' -- require 'user.autopairs' + +vim.lsp.enable('pyright') +vim.lsp.enable('lua_ls') diff --git a/lazyvim.json b/lazyvim.json new file mode 100644 index 00000000..6206f7ed --- /dev/null +++ b/lazyvim.json @@ -0,0 +1,10 @@ +{ + "extras": [ + + ], + "install_version": 8, + "news": { + "NEWS.md": "10960" + }, + "version": 8 +} \ No newline at end of file diff --git a/learn/learning.lua b/learn/learning.lua index 91e502a1..39d56a2b 100644 --- a/learn/learning.lua +++ b/learn/learning.lua @@ -1,2 +1,4 @@ local names = { "Norsh", "Dan", "Bisc", "Ella"} -return names +local text = 'yuhhh' +return names, text + diff --git a/learn/main.lua b/learn/main.lua index ccd410ab..01a3968e 100644 --- a/learn/main.lua +++ b/learn/main.lua @@ -1,5 +1,6 @@ -local fam = require('learn.learning') +local fam, text = require('learn.learning') print(fam[1]) + -- for i, v in ipairs(fam) do -- print(i, v) -- end diff --git a/lua/plugins.lua b/lua/plugins.lua index 28c1b624..9a9ff67f 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -23,9 +23,9 @@ return { { "rafamadriz/friendly-snippets" }, -- a bunch of snippets to use -- LSP - { "neovim/nvim-lspconfig" }, -- enable LSP - { "williamboman/mason.nvim" }, -- simple to use language server installer - { "williamboman/mason-lspconfig.nvim" }, -- simple to use language server installer + -- { "neovim/nvim-lspconfig" }, -- enable LSP + -- { "williamboman/mason.nvim" }, -- simple to use language server installer + -- { "williamboman/mason-lspconfig.nvim" }, -- simple to use language server installer -- Telescope { "nvim-telescope/telescope-media-files.nvim" }, diff --git a/lua/plugins/dashboard.lua b/lua/plugins/dashboard.lua index 2c05299c..39dac2ef 100644 --- a/lua/plugins/dashboard.lua +++ b/lua/plugins/dashboard.lua @@ -5,7 +5,6 @@ return { dashboard = { preset = { pick = nil, - ---@type snacks.dashboard.Item[] keys = { { icon = " ", key = "f", desc = "Find File", action = ":lua Snacks.dashboard.pick('files')" }, { icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" }, diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua new file mode 100644 index 00000000..6f1b581c --- /dev/null +++ b/lua/plugins/lsp.lua @@ -0,0 +1,130 @@ +-- return { +-- "mason-org/mason-lspconfig.nvim", +-- opts = { +-- ensure_installed = { "lua_ls", "rust_analyzer", "pyright" }, +-- }, +-- dependencies = { +-- { "mason-org/mason.nvim", opts = {} }, +-- "neovim/nvim-lspconfig", +-- }, +-- } +return { + "VonHeikemen/lsp-zero.nvim", + branch = "v2.x", + dependencies = { + -- LSP Support + { "neovim/nvim-lspconfig" }, -- Required + { -- Optional + "williamboman/mason.nvim", + build = function() + pcall(vim.cmd, "MasonUpdate") + end, + }, + { "williamboman/mason-lspconfig.nvim" }, -- Optional + + -- Autocompletion + { "hrsh7th/nvim-cmp" }, -- Required + { "hrsh7th/cmp-nvim-lsp" }, -- Required + { "L3MON4D3/LuaSnip" }, -- Required + { "rafamadriz/friendly-snippets" }, + { "hrsh7th/cmp-buffer" }, + { "hrsh7th/cmp-path" }, + { "hrsh7th/cmp-cmdline" }, + { "saadparwaiz1/cmp_luasnip" }, + }, + config = function() + local lsp = require("lsp-zero") + + lsp.on_attach(function(client, bufnr) + local opts = { buffer = bufnr, remap = false } + + vim.keymap.set("n", "gr", function() vim.lsp.buf.references() end, vim.tbl_deep_extend("force", opts, { desc = "LSP Goto Reference" })) + vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, vim.tbl_deep_extend("force", opts, { desc = "LSP Goto Definition" })) + vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, vim.tbl_deep_extend("force", opts, { desc = "LSP Hover" })) + vim.keymap.set("n", "vws", function() vim.lsp.buf.workspace_symbol() end, vim.tbl_deep_extend("force", opts, { desc = "LSP Workspace Symbol" })) + vim.keymap.set("n", "vd", function() vim.diagnostic.setloclist() end, vim.tbl_deep_extend("force", opts, { desc = "LSP Show Diagnostics" })) + vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, vim.tbl_deep_extend("force", opts, { desc = "Next Diagnostic" })) + vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, vim.tbl_deep_extend("force", opts, { desc = "Previous Diagnostic" })) + vim.keymap.set("n", "vca", function() vim.lsp.buf.code_action() end, vim.tbl_deep_extend("force", opts, { desc = "LSP Code Action" })) + vim.keymap.set("n", "vrr", function() vim.lsp.buf.references() end, vim.tbl_deep_extend("force", opts, { desc = "LSP References" })) + vim.keymap.set("n", "vrn", function() vim.lsp.buf.rename() end, vim.tbl_deep_extend("force", opts, { desc = "LSP Rename" })) + vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, vim.tbl_deep_extend("force", opts, { desc = "LSP Signature Help" })) + end) + + require("mason").setup({}) + require("mason-lspconfig").setup({ + ensure_installed = { + "eslint", + "lua_ls", + "jsonls", + "html", + "tailwindcss", + -- "pylsp", + "dockerls", + "bashls", + "gopls", + "pyright", + }, + handlers = { + lsp.default_setup, + lua_ls = function() + local lua_opts = lsp.nvim_lua_ls() + require("lspconfig").lua_ls.setup(lua_opts) + end, + }, + }) + + local cmp_action = require("lsp-zero").cmp_action() + local cmp = require("cmp") + local cmp_select = { behavior = cmp.SelectBehavior.Select } + + require("luasnip.loaders.from_vscode").lazy_load() + + -- `/` cmdline setup. + cmp.setup.cmdline("/", { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = "buffer" }, + }, + }) + + -- `:` cmdline setup. + cmp.setup.cmdline(":", { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = "path" }, + }, { + { + name = "cmdline", + option = { + ignore_cmds = { "Man", "!" }, + }, + }, + }), + }) + + cmp.setup({ + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + sources = { + { name = "nvim_lsp" }, + { name = "luasnip", keyword_length = 2 }, + { name = "buffer", keyword_length = 3 }, + { name = "path" }, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.select_prev_item(cmp_select), + [""] = cmp.mapping.select_next_item(cmp_select), + [""] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping.complete(), + [""] = cmp_action.luasnip_jump_forward(), + [""] = cmp_action.luasnip_jump_backward(), + [""] = cmp_action.luasnip_supertab(), + [""] = cmp_action.luasnip_shift_supertab(), + }), + }) + end, +} diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua deleted file mode 100644 index 1473d15f..00000000 --- a/lua/plugins/lspconfig.lua +++ /dev/null @@ -1,24 +0,0 @@ --- ~/.config/nvim/lua/plugins/lspconfig.lua -return { - "neovim/nvim-lspconfig", - event = { "BufReadPre", "BufNewFile", "BufWritePre" }, - config = function() - local lspconfig = require("lspconfig") - local capabilities = require("cmp_nvim_lsp").default_capabilities() - - -- Example: Python - lspconfig.pyright.setup({ - capabilities = capabilities - }) - - -- Example: Lua - lspconfig.lua_ls.setup({ - capabilities = capabilities, - settings = { - Lua = { - diagnostics = { globals = { "vim" } }, - }, - }, - }) - end, -} diff --git a/lua/plugins/nvim-cmp.lua b/lua/plugins/nvim-cmp.lua index b72654e5..8002641e 100644 --- a/lua/plugins/nvim-cmp.lua +++ b/lua/plugins/nvim-cmp.lua @@ -1,68 +1,61 @@ return { - "hrsh7th/nvim-cmp", - event = "InsertEnter", - dependencies = { - -- Completion sources - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - "saadparwaiz1/cmp_luasnip", + "hrsh7th/nvim-cmp", + event = "InsertEnter", + dependencies = { + "hrsh7th/cmp-buffer", -- Source for text in buffer + "hrsh7th/cmp-path", -- Source for file system paths + { + "L3MON4D3/LuaSnip", -- Snippet Engine + version = "v2.*", + build = "make install_jsregexp", -- Allow lsp-snippet-transformations + }, + "rafamadriz/friendly-snippets", -- Preconfigured snippets for different languages + "onsails/lspkind.nvim", -- VS-Code like pictograms + }, + config = function() + local cmp = require("cmp") + local lspkind = require("lspkind") + local luasnip = require("luasnip") - -- Snippet engine - "L3MON4D3/LuaSnip", + require("luasnip.loaders.from_vscode").lazy_load() -- Required for friendly-snippets to work - -- Optional: VSCode-style icons - "onsails/lspkind.nvim", - }, - config = function() - local cmp = require("cmp") - local luasnip = require("luasnip") - local lspkind = require("lspkind") + -- Settings for the appearance of the completion window + vim.api.nvim_set_hl(0, "CmpNormal", { bg = "#000000", fg = "#ffffff" }) + vim.api.nvim_set_hl(0, "CmpSelect", { bg = "#000000", fg = "#b5010f" }) + vim.api.nvim_set_hl(0, "CmpBorder", { bg = "#000000", fg = "#b5010f" }) - cmp.setup({ - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.close(), - [""] = cmp.mapping.complete(), - }), - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "luasnip" }, - { name = "path" }, - { name = "buffer" }, - }), - formatting = { - format = lspkind.cmp_format({ - mode = "symbol_text", -- "text", "symbol", or "symbol_text" - maxwidth = 50, - ellipsis_char = "...", - }), - }, - }) - - -- Cmdline completion (optional) - cmp.setup.cmdline("/", { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = "buffer" } - } - }) - - cmp.setup.cmdline(":", { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = "path" } - }, { - { name = "cmdline" } - }) - }) - end, + cmp.setup({ + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.close(), + [""] = cmp.mapping.confirm({ + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }), + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "buffer" }, + { name = "path" }, + }), + window = { + completion = { + border = "rounded", + winhighlight = "Normal:CmpNormal,CursorLine:CmpSelect,FloatBorder:CmpBorder", + } + }, + }) + vim.cmd([[ + set completeopt=menuone,noinsert,noselect + highlight! default link CmpItemKind CmpItemMenuDefault + ]]) + end, } diff --git a/lua/plugins/nvim-tree.lua b/lua/plugins/nvim-tree.lua index 29078ac4..e13a9518 100644 --- a/lua/plugins/nvim-tree.lua +++ b/lua/plugins/nvim-tree.lua @@ -13,17 +13,14 @@ return { }, opts = function() local api = require("nvim-tree.api") - return { view = { width = 35, - side = "right", + side = "left", preserve_window_proportions = true, - }, - hijack_cursor = true, - view = { adaptive_size = true, }, + hijack_cursor = true, renderer = { highlight_git = true, highlight_opened_files = "name", diff --git a/lua/plugins/trouble.lua b/lua/plugins/trouble.lua new file mode 100644 index 00000000..3741f30a --- /dev/null +++ b/lua/plugins/trouble.lua @@ -0,0 +1,37 @@ +return { + "folke/trouble.nvim", + opts = {}, -- for default options, refer to the configuration section for custom setup. + cmd = "Trouble", + keys = { + { + "xx", + "Trouble diagnostics toggle", + desc = "Diagnostics (Trouble)", + }, + { + "xX", + "Trouble diagnostics toggle filter.buf=0", + desc = "Buffer Diagnostics (Trouble)", + }, + { + "cs", + "Trouble symbols toggle focus=false", + desc = "Symbols (Trouble)", + }, + { + "cl", + "Trouble lsp toggle focus=false win.position=right", + desc = "LSP Definitions / references / ... (Trouble)", + }, + { + "xL", + "Trouble loclist toggle", + desc = "Location List (Trouble)", + }, + { + "xQ", + "Trouble qflist toggle", + desc = "Quickfix List (Trouble)", + }, + }, +} diff --git a/tester.py b/tester.py index 7c30a2c7..d6a2c41a 100644 --- a/tester.py +++ b/tester.py @@ -1,15 +1,20 @@ items = [1, 2, 3] - print([x**2 for x in items]) print([x**3 for x in items]) for i in items: print(i) -def myfunc(): - print("this is my func") + +def myfunc(x: int) -> str: + 'this is a docstring yuhhh' + return f"this is my num {x}" + def myfunc2(): - pass + pass + +print(myfunc(2)) +print(myfunc(3)) -myfunc() +print(myfunc(5))