Use lazy.nvim

This commit is contained in:
Saeed Afzal
2023-04-29 12:34:36 +01:00
parent 17ab6018fb
commit 86cc9b52ec
28 changed files with 308 additions and 493 deletions

View File

@@ -1,8 +0,0 @@
require("indent_blankline").setup {
indentLine_enabled = 1,
char = "",
filetype_exclude = {"help", "terminal", "alpha"},
buftype_exclude = {"terminal"},
show_trailing_blankline_indent = false,
show_first_indent_level = false
}

View File

@@ -1,26 +0,0 @@
local cmp = require("cmp")
cmp.setup {
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end
},
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = true }),
["<Tab>"] = cmp.mapping.select_next_item(),
["<S-Tab>"] = cmp.mapping.select_prev_item()
}),
sources = cmp.config.sources({
{ name = "nvim-lsp" },
{ name = "luasnip" }
}, {
{ name = "buffer" }
})
}

View File

@@ -1,11 +0,0 @@
require("colorizer").setup {
user_default_options = {
RRGGBBAA = true,
AARRGGBB = true,
rgb_fn = true,
hsl_fn = true,
css = true,
css_fn = true,
sass = { enable = true }
}
}

View File

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

View File

@@ -1,14 +0,0 @@
require("lualine").setup {
options = {
theme = "tokyonight"
},
extensions = {
"fzf",
"nvim-dap-ui",
"nvim-tree",
"quickfix",
"symbols-outline",
"toggleterm"
}
}

View File

@@ -1,10 +0,0 @@
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,28 +0,0 @@
require("nvim-tree").setup {
view = {
hide_root_folder = true
},
renderer = {
group_empty = true,
highlight_git = true,
indent_markers = {
enable = true
}
},
update_focused_file = {
enable = true,
update_root = true
},
diagnostics = {
enable = true,
show_on_dirs = true
},
filters = {
custom = { ".git" }
}
}

View File

@@ -1,7 +0,0 @@
local telescope = require("telescope")
telescope.setup {
file_ignore_patterns = { "node_modules" }
}
telescope.load_extension("fzf")

View File

@@ -1,15 +0,0 @@
require("toggleterm").setup {
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

@@ -1,12 +0,0 @@
require("tokyonight").setup {
style = "night",
styles = {
comments = { italic = true },
keywords = { italic = true, bold = true },
functions = { italic = true, bold = true },
variables = { italic = true, bold = true }
},
lualine_bold = true
}
vim.cmd [[colorscheme tokyonight]]

View File

@@ -1,9 +0,0 @@
require("nvim-treesitter.configs").setup {
ensure_installed = { "vim", "lua", "typescript" },
auto_install = false,
highlight = {
enable = true,
additional_vim_regex_highlighting = false
}
}

View File

@@ -1,82 +0,0 @@
local wk = require("which-key")
wk.setup {
ignore_missing = true,
key_labels = {
["<space>"] = "SPC"
}
}
wk.register({
["<leader>"] = {
f = {
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" }
},
l = {
name = "LSP",
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>CodeActionMenu<CR>", "code action" }
},
b = {
name = "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 = {
name = "Git",
b = { "<cmd>Gitsigns blame_line<CR>", "blame line" },
d = { "<cmd>Gitsigns diffthis<CR>", "diff" },
s = { "<cmd>Telescope git_status<CR>", "git status" },
c = { "<cmd>Telescope git_commits<CR>", "commits" }
},
x = { "<cmd>BufferClose<CR>", "close buffer" },
r = { "<cmd>NvimTreeRefresh<CR>", "refresh tree" },
c = { "<cmd>Telescope colorscheme<CR>", "colorscheme" },
s = { "<cmd>SymbolsOutline<CR>", "symbols outline" },
h = { "<cmd>noh<CR>", "no highlight" },
t = {
name = "Terminal",
t = { "<cmd>ToggleTerm direction=horizontal<CR>", "open terminal" }
}
},
t = {
name = "Trouble",
t = { "<cmd>TroubleToggle<CR>", "toggle trouble" }
},
g = {
d = { "<cmd>lua vim.lsp.buf.definition()<CR>", "definition" },
D = { "<cmd>lua vim.lsp.buf.declaration()<CR>", "declaration" },
i = { "<cmd>lua vim.lsp.buf.implementation()<CR>", "implementation" },
t = { "<cmd>lua vim.lsp.buf.type_definition()<CR>", "type definition" }
},
K = { "<cmd>lua vim.lsp.buf.hover()<CR>", "hover" },
["<C-k>"] = { "<cmd>lua vim.lsp.buf.signature_help()<CR>", "signature help" },
-- Nvim Tree
["<C-n>"] = { "<cmd>NvimTreeToggle .<CR>", "toggle nvimtree" },
-- Switching Buffers
["<TAB>"] = { "<cmd>BufferNext<CR>", "next buffer" },
["<S-TAB>"] = { "<cmd>BufferPrevious<CR>", "previous buffer" },
-- Find in file
["<C-f>"] = { "<cmd>Telescope current_buffer_fuzzy_find<CR>", "find in file" }
})