feat: some shit

This commit is contained in:
2022-09-19 20:32:50 +02:00
parent 3857fb86af
commit d7f36e407c
11 changed files with 156 additions and 91 deletions

View File

@@ -1,12 +1,16 @@
local map = vim.api.nvim_set_keymap
-- local map = vim.api.nvim_set_keymap
local map = vim.keymap.set
local g = vim.g
local saga = require("lspsaga")
saga.init_lsp_saga()
local options = { noremap = true, silent = true }
local remap = { noremap = false }
g.mapleader = " "
map("n", "<C-o>", ":Telescope git_files<CR>", options)
map("n", "<C-o>", ":Telescope find_files<CR>", options)
map("n", "<C-f>", ":lua require'telescope.builtin'.live_grep{ cwd = vim.fn.getcwd() }<CR>", options)
map("n", "<C-p>", ":Telescope command_center<CR>", options)
map("n", "<Leader><Leader>", "za", remap)
@@ -16,17 +20,24 @@ map("n", "<Leader>n", ":lua vim.diagnostic.goto_next()<CR>", options)
map("n", "<Leader>p", ":lua vim.diagnostic.goto_prev()<CR>", options)
map("n", "gD", "<Cmd>lua vim.lsp.buf.declaration()<CR>", options)
map("n", "gd", "<Cmd>lua vim.lsp.buf.definition()<CR>", options)
map("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", options)
map("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", options)
map("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", options)
map("n", "<Leader>e", "<cmd>lua vim.diagnostic.open_float()<CR>", options)
map("n", "<Leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", options)
map("n", "<Leader>c", "<cmd>lua vim.lsp.buf.code_action()<CR>", options)
map("n", "K", "<cmd>Lspsaga hover_doc<CR>", { silent = true })
map("n", "<leader>o", "<cmd>LSoutlineToggle<CR>", { silent = true })
map("n", "<leader>e", "<cmd>Lspsaga show_cursor_diagnostics<CR>", { silent = true })
map("n", "<Leader>rn", "<cmd>Lspsaga rename<CR>", options)
map({ "n", "v" }, "<leader>c", "<cmd>Lspsaga code_action<CR>", { silent = true })
map({ "n", "v" }, "gr", "Lspsaga lsp_finder<CR>", options)
map("n", "<leader>t", ":TroubleToggle<CR>", remap)
-- DAP Functionality
map("n", "<Leader>b", ":lua require('dap').toggle_breakpoint()", options)
-- Test Functionality
map("n", "tt", ":lua require('neotest').run.run()<CR>", options)
map("n", "to", ":lua require('neotest').summary.open()<CR>", options)
-- Navigate Buffers
map("n", "<C-h>", "<C-w>h", options)
map("n", "<C-j>", "<C-w>j", options)
@@ -39,7 +50,7 @@ map("n", "<Leader>3", "3gt", options)
map("n", "<Leader>4", "4gt", options)
map("n", "<Leader>0", ":tablast<CR>", options)
map("n", "<C-t>", ":lua require('harpoon.mark').add_file()<CR>", options)
map("n", "m", ":lua require('harpoon.mark').add_file()<CR>", options)
-- Navigate Files
map("n", "<S-t>", ":Telescope harpoon marks<CR>", options)

View File

@@ -50,13 +50,8 @@ return packer.startup(function(use)
require("nvim_comment").setup()
end,
})
use({
"windwp/nvim-autopairs",
config = function()
require("nvim-autopairs").setup()
end,
})
use("gfeiyou/command-center.nvim")
use("glepnir/lspsaga.nvim")
-- Code Navigation
use("junegunn/fzf")
@@ -84,8 +79,12 @@ return packer.startup(function(use)
use("neovim/nvim-lspconfig")
use("hrsh7th/nvim-cmp")
use("onsails/lspkind.nvim")
use({ "tzachar/cmp-tabnine", run = "./install.sh", requires = "hrsh7th/nvim-cmp" })
-- use({ "hrsh7th/cmp-copilot", requires = "github/copilot.vim" })
use({
"windwp/nvim-autopairs",
config = function()
require("nvim-autopairs").setup()
end,
})
use("hrsh7th/cmp-nvim-lsp")
use("hrsh7th/cmp-path")
use("hrsh7th/cmp-calc")
@@ -125,6 +124,8 @@ return packer.startup(function(use)
use({
"nvim-neotest/neotest",
requires = {
"haydenmeade/neotest-jest",
"KaiSpencer/neotest-vitest",
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
"antoinemadec/FixCursorHold.nvim",