Added barbar and some remaps and other changes

This commit is contained in:
Piyush मिश्रः 2023-02-16 21:04:22 +05:30
parent 3754a46ba2
commit 759b021266
7 changed files with 53 additions and 28 deletions

View File

@ -2,8 +2,8 @@ local map = vim.api.nvim_set_keymap
local opts = { noremap = true, silent = true }
-- Move to previous/next
map('n', '<A-,>', '<Cmd>BufferPrevious<CR>', opts)
map('n', '<A-.>', '<Cmd>BufferNext<CR>', opts)
map('n', '<C-PageUp>', '<Cmd>BufferPrevious<CR>', opts)
map('n', '<C-PageDown>', '<Cmd>BufferNext<CR>', opts)
-- Re-order to previous/next
map('n', '<A-<>', '<Cmd>BufferMovePrevious<CR>', opts)
map('n', '<A->>', '<Cmd>BufferMoveNext<CR>', opts)

View File

@ -29,6 +29,8 @@ local cmp_mappings = lsp.defaults.cmp_mappings({
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
['<C-y>'] = cmp.mapping.confirm({ select = true }),
["<C-Space>"] = cmp.mapping.complete(),
['<C-Up>'] = cmp.mapping.scroll_docs(-4),
['<C-Down>'] = cmp.mapping.scroll_docs(4),
})
cmp_mappings['<Tab>'] = nil

View File

@ -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
})

View File

@ -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

View File

@ -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)

View File

@ -11,19 +11,13 @@ vim.keymap.set("n", "<C-u>", "<C-u>zz")
vim.keymap.set("n", "n", "nzzzv")
vim.keymap.set("n", "N", "Nzzzv")
vim.keymap.set("n", "<leader>vwm", function()
require("vim-with-me").StartVimWithMe()
end)
vim.keymap.set("n", "<leader>svwm", function()
require("vim-with-me").StopVimWithMe()
end)
-- greatest remap ever
vim.keymap.set("x", "<leader>p", [["_dP]])
-- next greatest remap ever : asbjornHaland
vim.keymap.set({"n", "v"}, "<leader>y", [["+y]])
vim.keymap.set("n", "<leader>Y", [["+Y]])
vim.keymap.set({"n", "v"}, "<C-S-C>", [["+y]])
vim.keymap.set({"n", "v"}, "<C-S-V>", [["+p]])
vim.keymap.set({"n", "v"}, "<leader>d", [["_d]])
@ -49,3 +43,9 @@ vim.keymap.set("n", "<leader><leader>", function()
vim.cmd("so")
end)
-- close buffer
vim.keymap.set("n", "<leader>q", "<cmd>bw<CR>")
vim.keymap.set("n", "<leader>Q", "<cmd>bw!<CR>")
-- rename vaiable
vim.api.nvim_set_keymap("n", "<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", { noremap = true })

View File

@ -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