Add plugins and config

This commit is contained in:
Saeed Afzal
2023-03-05 20:13:34 +00:00
parent 85cf458908
commit 81725f393f
10 changed files with 220 additions and 9 deletions

View File

@@ -18,7 +18,7 @@ cmp.setup {
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "nvim-lsp" },
{ name = "luasnip" }
}, {
{ name = "buffer" }

View File

@@ -0,0 +1,3 @@
require("illuminate").configure {
}

View File

@@ -0,0 +1,10 @@
local mason = require("mason-lspconfig")
local lsp = require("lspconfig")
mason.setup{}
mason.setup_handlers {
function (server_name)
lsp[server_name].setup{}
end
}

View File

@@ -1,5 +1,13 @@
require("toggleterm").setup {
open_mapping = [[<C-t>]],
size = function(term)
if term.direction == "horizontal" then
return 25
elseif term.direction == "vertical" then
return vim.o.columns * 0.4
end
end,
open_mapping = [[<c-t>]],
direction = "float",
float_opts = {
border = "curved"

View File

@@ -13,6 +13,7 @@ wk.register({
name = "Find",
f = { "<cmd>Telescope fd<CR>", "find file" },
w = { "<cmd>Telescope live_grep<CR>", "live grep" },
s = { "<cmd>Telescope spell_suggest<CR>", "spell suggest" },
b = { "<cmd>Telescope buffers<CR>", "all buffers" },
t = { "<cmd>TodoTelescope<CR>", "todos" },
["."] = { "<cmd>Telescope keymaps<CR>", "keymaps" }
@@ -20,15 +21,18 @@ wk.register({
l = {
name = "LSP",
r = { "<cmd>lua vim.lsp.buf.rename()<CR>", "rename" },
r = { "<cmd>lua require('cosmic-ui').rename()<CR>", "rename" },
d = { "<cmd>Telescope diagnostics<CR>", "diagnostics" },
f = { "<cmd>lua vim.lsp.buf.format { async = true }<CR>", "format" },
a = { "<cmd>lua vim.lsp.buf.code_action()<CR>", "code action" }
a = { "<cmd>CodeActionMenu<CR>", "code action" }
},
b = {
name = "Buffer",
p = { "<cmd>BufferPick<CR>", "pick buffer" }
p = { "<cmd>BufferPick<CR>", "pick buffer" },
q = { "<cmd>BufferMovePrevious<CR>", "move buffer left" },
w = { "<cmd>BufferMoveNext<CR>", "move buffer right" },
x = { "<cmd>BufferCloseAllButCurrent<CR>", "close all but current" }
},
g = {
@@ -42,7 +46,13 @@ wk.register({
x = { "<cmd>BufferClose<CR>", "close buffer" },
r = { "<cmd>NvimTreeRefresh<CR>", "refresh tree" },
c = { "<cmd>Telescope colorscheme<CR>", "colorscheme" },
s = { "<cmd>SymbolsOutline<CR>", "symbols outline" }
s = { "<cmd>SymbolsOutline<CR>", "symbols outline" },
h = { "<cmd>noh<CR>", "no highlight" },
t = {
name = "Terminal",
t = { "<cmd>ToggleTerm direction=horizontal<CR>", "open terminal" }
}
},
t = {
@@ -61,9 +71,12 @@ wk.register({
["<C-k>"] = { "<cmd>lua vim.lsp.buf.signature_help()<CR>", "signature help" },
-- Nvim Tree
["<C-n>"] = { "<cmd>NvimTreeToggle<CR>", "toggle nvimtree" },
["<C-n>"] = { "<cmd>NvimTreeToggle .<CR>", "toggle nvimtree" },
-- Switching Buffers
["<TAB>"] = { "<cmd>BufferNext<CR>", "next buffer" },
["<S-TAB>"] = { "<cmd>BufferPrevious<CR>", "previous buffer" }
["<S-TAB>"] = { "<cmd>BufferPrevious<CR>", "previous buffer" },
-- Find in file
["<C-f>"] = { "<cmd>Telescope current_buffer_fuzzy_find<CR>", "find in file" }
})

View File

@@ -82,4 +82,161 @@ return packer.startup(function(use)
require("plugins.config.blankline")
end
}
use {
"numToStr/Comment.nvim",
config = function()
require("Comment").setup()
end
}
use {
"akinsho/toggleterm.nvim",
tag = "*",
config = function()
require("plugins.config.toggleterm")
end
}
use {
"goolord/alpha-nvim",
requires = "kyazdani42/nvim-web-devicons",
config = function()
require("alpha").setup(require("alpha.themes.dashboard").config)
end
}
-- Teleport
use {
"nvim-telescope/telescope-fzf-native.nvim",
run = "make"
}
use {
"nvim-telescope/telescope.nvim",
tag = "0.1.1",
requires = "nvim-lua/plenary.nvim",
config = function()
require("plugins.config.telescope")
end
}
-- LSP
use {
"williamboman/mason.nvim",
requires = "neovim/nvim-lspconfig",
config = function()
require("mason").setup()
end
}
use {
"williamboman/mason-lspconfig.nvim",
requires = {
"neovim/nvim-lspconfig",
"williamboman/mason.nvim"
},
config = function()
require("plugins.config.mason")
end
}
use {
"hrsh7th/nvim-cmp",
requires = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
"L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip"
},
config = function()
require("plugins.config.cmp")
end
}
use {
"rafamadriz/friendly-snippets",
requires = "L3MON4D3/LuaSnip"
}
use {
"ray-x/lsp_signature.nvim",
after = "nvim-lspconfig",
config = function()
require("lsp_signature").setup()
end
}
use {
"windwp/nvim-autopairs",
config = function()
require("nvim-autopairs").setup()
end
}
use {
"folke/trouble.nvim",
requires = "kyazdani42/nvim-web-devicons",
config = function()
require("trouble").setup()
end
}
use {
"folke/todo-comments.nvim",
requires = "nvim-lua/plenary.nvim",
config = function()
require("todo-comments").setup()
end
}
use {
"simrat39/symbols-outline.nvim",
config = function()
require("symbols-outline").setup()
end
}
use {
"folke/which-key.nvim",
config = function()
require("plugins.config.whichkey")
end
}
use {
"RRethy/vim-illuminate",
requires = "neovim/nvim-lspconfig"
}
use {
"weilbith/nvim-code-action-menu",
requires = "neovim/nvim-lspconfig",
cmd = "CodeActionMenu"
}
use {
"ellisonleao/glow.nvim",
config = function()
require("glow").setup()
end
}
use {
"CosmicNvim/cosmic-ui",
requires = {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim"
},
config = function()
require("cosmic-ui").setup()
end
}
if packer_bootstrap then
require("packer").sync()
end
end)