diff --git a/nvim/after/plugin/barbar.lua b/nvim/after/plugin/barbar.lua index ebbb2f8..387dee3 100644 --- a/nvim/after/plugin/barbar.lua +++ b/nvim/after/plugin/barbar.lua @@ -2,8 +2,8 @@ local map = vim.api.nvim_set_keymap local opts = { noremap = true, silent = true } -- Move to previous/next -map('n', '', 'BufferPrevious', opts) -map('n', '', 'BufferNext', opts) +map('n', '', 'BufferPrevious', opts) +map('n', '', 'BufferNext', opts) -- Re-order to previous/next map('n', '', 'BufferMovePrevious', opts) map('n', '>', 'BufferMoveNext', opts) diff --git a/nvim/after/plugin/lsp.lua b/nvim/after/plugin/lsp.lua index ec4bd6e..b0f055a 100644 --- a/nvim/after/plugin/lsp.lua +++ b/nvim/after/plugin/lsp.lua @@ -29,6 +29,8 @@ local cmp_mappings = lsp.defaults.cmp_mappings({ [''] = cmp.mapping.select_next_item(cmp_select), [''] = cmp.mapping.confirm({ select = true }), [""] = cmp.mapping.complete(), + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), }) cmp_mappings[''] = nil diff --git a/nvim/after/plugin/neovim-tasks.lua b/nvim/after/plugin/neovim-tasks.lua new file mode 100644 index 0000000..c0965c4 --- /dev/null +++ b/nvim/after/plugin/neovim-tasks.lua @@ -0,0 +1,21 @@ +local Path = require('plenary.path') +require('tasks').setup({ + default_params = { -- Default module parameters with which `neovim.json` will be created. + cmake = { + cmd = 'cmake', -- CMake executable to use, can be changed using `:Task set_module_param cmake cmd`. + build_dir = tostring(Path:new('{cwd}', 'build', '{os}-{build_type}')), -- Build directory. The expressions `{cwd}`, `{os}` and `{build_type}` will be expanded with the corresponding text values. Could be a function that return the path to the build directory. + build_type = 'Debug', -- Build type, can be changed using `:Task set_module_param cmake build_type`. + dap_name = 'lldb', -- DAP configuration name from `require('dap').configurations`. If there is no such configuration, a new one with this name as `type` will be created. + args = { -- Task default arguments. + configure = { '-D', 'CMAKE_EXPORT_COMPILE_COMMANDS=1', '-G', 'Ninja' }, + }, + }, + }, + save_before_run = true, -- If true, all files will be saved before executing a task. + params_file = 'neovim.json', -- JSON file to store module and task parameters. + quickfix = { + pos = 'botright', -- Default quickfix position. + height = 12, -- Default height. + }, + dap_open_command = function() return require('dap').repl.open() end -- Command to run after starting DAP session. You can set it to `false` if you don't want to open anything or `require('dapui').open` if you are using https://github.com/rcarriga/nvim-dap-ui +}) diff --git a/nvim/init.lua b/nvim/init.lua index c5f80c3..478a70f 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -2,6 +2,6 @@ require("xcoder") --print("Neovide is", vim.g.neovide) if vim.g.neovide then - vim.opt.guifont = { "Fira Code:h11" } + vim.opt.guifont = { "Fira Code:h10.5" } end diff --git a/nvim/lua/xcoder/packer.lua b/nvim/lua/xcoder/packer.lua index 7d72a2a..37f9210 100644 --- a/nvim/lua/xcoder/packer.lua +++ b/nvim/lua/xcoder/packer.lua @@ -53,8 +53,6 @@ return require('packer').startup(function(use) } use("folke/zen-mode.nvim") - use("github/copilot.vim") - use("eandrju/cellular-automaton.nvim") use("laytan/cloak.nvim") use { "windwp/nvim-autopairs", @@ -63,5 +61,9 @@ return require('packer').startup(function(use) use 'nvim-tree/nvim-web-devicons' use {'romgrk/barbar.nvim', requires = 'nvim-web-devicons'} + + -- tasks and debuging + use ("Shatur/neovim-tasks") + use ("mfussenegger/nvim-dap") end) diff --git a/nvim/lua/xcoder/remap.lua b/nvim/lua/xcoder/remap.lua index e165d1a..d5f38ca 100644 --- a/nvim/lua/xcoder/remap.lua +++ b/nvim/lua/xcoder/remap.lua @@ -11,19 +11,13 @@ vim.keymap.set("n", "", "zz") vim.keymap.set("n", "n", "nzzzv") vim.keymap.set("n", "N", "Nzzzv") -vim.keymap.set("n", "vwm", function() - require("vim-with-me").StartVimWithMe() -end) -vim.keymap.set("n", "svwm", function() - require("vim-with-me").StopVimWithMe() -end) - -- greatest remap ever vim.keymap.set("x", "p", [["_dP]]) -- next greatest remap ever : asbjornHaland -vim.keymap.set({"n", "v"}, "y", [["+y]]) -vim.keymap.set("n", "Y", [["+Y]]) +vim.keymap.set({"n", "v"}, "", [["+y]]) + +vim.keymap.set({"n", "v"}, "", [["+p]]) vim.keymap.set({"n", "v"}, "d", [["_d]]) @@ -49,3 +43,9 @@ vim.keymap.set("n", "", function() vim.cmd("so") end) +-- close buffer +vim.keymap.set("n", "q", "bw") +vim.keymap.set("n", "Q", "bw!") + +-- rename vaiable +vim.api.nvim_set_keymap("n", "rn", "lua vim.lsp.buf.rename()", { noremap = true }) diff --git a/nvim/plugin/packer_compiled.lua b/nvim/plugin/packer_compiled.lua index 4fcd0ef..856185f 100644 --- a/nvim/plugin/packer_compiled.lua +++ b/nvim/plugin/packer_compiled.lua @@ -84,11 +84,6 @@ _G.packer_plugins = { path = "/home/piyush/.local/share/nvim/site/pack/packer/start/barbar.nvim", url = "https://github.com/romgrk/barbar.nvim" }, - ["cellular-automaton.nvim"] = { - loaded = true, - path = "/home/piyush/.local/share/nvim/site/pack/packer/start/cellular-automaton.nvim", - url = "https://github.com/eandrju/cellular-automaton.nvim" - }, ["cloak.nvim"] = { loaded = true, path = "/home/piyush/.local/share/nvim/site/pack/packer/start/cloak.nvim", @@ -119,11 +114,6 @@ _G.packer_plugins = { path = "/home/piyush/.local/share/nvim/site/pack/packer/start/cmp_luasnip", url = "https://github.com/saadparwaiz1/cmp_luasnip" }, - ["copilot.vim"] = { - loaded = true, - path = "/home/piyush/.local/share/nvim/site/pack/packer/start/copilot.vim", - url = "https://github.com/github/copilot.vim" - }, ["friendly-snippets"] = { loaded = true, path = "/home/piyush/.local/share/nvim/site/pack/packer/start/friendly-snippets", @@ -149,6 +139,11 @@ _G.packer_plugins = { path = "/home/piyush/.local/share/nvim/site/pack/packer/start/mason.nvim", url = "https://github.com/williamboman/mason.nvim" }, + ["neovim-tasks"] = { + loaded = true, + path = "/home/piyush/.local/share/nvim/site/pack/packer/start/neovim-tasks", + url = "https://github.com/Shatur/neovim-tasks" + }, ["nvim-autopairs"] = { config = { "\27LJ\2\n@\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\19nvim-autopairs\frequire\0" }, loaded = true, @@ -160,6 +155,11 @@ _G.packer_plugins = { path = "/home/piyush/.local/share/nvim/site/pack/packer/start/nvim-cmp", url = "https://github.com/hrsh7th/nvim-cmp" }, + ["nvim-dap"] = { + loaded = true, + path = "/home/piyush/.local/share/nvim/site/pack/packer/start/nvim-dap", + url = "https://github.com/mfussenegger/nvim-dap" + }, ["nvim-lspconfig"] = { loaded = true, path = "/home/piyush/.local/share/nvim/site/pack/packer/start/nvim-lspconfig", @@ -229,14 +229,14 @@ _G.packer_plugins = { } time([[Defining packer_plugins]], false) --- Config for: rose-pine -time([[Config for rose-pine]], true) -try_loadstring("\27LJ\2\n9\0\0\3\0\3\0\0056\0\0\0009\0\1\0'\2\2\0B\0\2\1K\0\1\0\26colorscheme rose-pine\bcmd\bvim\0", "config", "rose-pine") -time([[Config for rose-pine]], false) -- Config for: nvim-autopairs time([[Config for nvim-autopairs]], true) try_loadstring("\27LJ\2\n@\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\19nvim-autopairs\frequire\0", "config", "nvim-autopairs") time([[Config for nvim-autopairs]], false) +-- Config for: rose-pine +time([[Config for rose-pine]], true) +try_loadstring("\27LJ\2\n9\0\0\3\0\3\0\0056\0\0\0009\0\1\0'\2\2\0B\0\2\1K\0\1\0\26colorscheme rose-pine\bcmd\bvim\0", "config", "rose-pine") +time([[Config for rose-pine]], false) _G._packer.inside_compile = false if _G._packer.needs_bufread == true then