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