172 lines
4.7 KiB
Lua
172 lines
4.7 KiB
Lua
vim.g.mapleader = ","
|
|
|
|
-- 4 space tabs
|
|
vim.o.expandtab = true
|
|
vim.o.shiftwidth = 4
|
|
vim.o.tabstop = 4
|
|
vim.o.smartindent = true
|
|
|
|
vim.o.clipboard = "unnamedplus"
|
|
vim.o.termguicolors = true
|
|
vim.o.ignorecase = true
|
|
vim.o.smartcase = true
|
|
vim.o.lazyredraw = true
|
|
vim.o.timeoutlen = 100
|
|
|
|
vim.wo.number = true
|
|
vim.wo.relativenumber = true
|
|
|
|
require("gruvbox").setup()
|
|
vim.cmd("colorscheme gruvbox")
|
|
|
|
require("lualine").setup({
|
|
options = {
|
|
theme = "gruvbox"
|
|
}
|
|
})
|
|
|
|
require("bufferline").setup({
|
|
options = {
|
|
show_tab_indicators = true,
|
|
separator_style = { "", "" },
|
|
},
|
|
})
|
|
|
|
require("colorizer").setup()
|
|
require("nvim-autopairs").setup()
|
|
require("Comment").setup()
|
|
|
|
require("neo-tree").setup({
|
|
default_component_configs = {
|
|
icon = {
|
|
folder_empty = "",
|
|
folder_empty_open = "",
|
|
},
|
|
git_status = {
|
|
symbols = {
|
|
renamed = "",
|
|
unstaged = "",
|
|
},
|
|
},
|
|
},
|
|
document_symbols = {
|
|
kinds = {
|
|
File = { icon = "", hl = "Tag" },
|
|
Namespace = { icon = "", hl = "Include" },
|
|
Package = { icon = "", hl = "Label" },
|
|
Class = { icon = "", hl = "Include" },
|
|
Property = { icon = "", hl = "@property" },
|
|
Enum = { icon = "", hl = "@number" },
|
|
Function = { icon = "", hl = "Function" },
|
|
String = { icon = "", hl = "String" },
|
|
Number = { icon = "", hl = "Number" },
|
|
Array = { icon = "", hl = "Type" },
|
|
Object = { icon = "", hl = "Type" },
|
|
Key = { icon = "", hl = "" },
|
|
Struct = { icon = "", hl = "Type" },
|
|
Operator = { icon = "", hl = "Operator" },
|
|
TypeParameter = { icon = "", hl = "Type" },
|
|
StaticMethod = { icon = ' ', hl = 'Function' },
|
|
}
|
|
},
|
|
})
|
|
vim.keymap.set("n", "<C-n>", "<cmd>NeoTreeFocusToggle<CR>")
|
|
|
|
require("nvim-treesitter.configs").setup({
|
|
highlight = { enable = true, },
|
|
})
|
|
|
|
require("which-key").setup()
|
|
|
|
local builtin = require("telescope.builtin")
|
|
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = "Find Files" })
|
|
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = "Live Grep" })
|
|
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = "List Buffers" })
|
|
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = "Help Tags" })
|
|
vim.keymap.set('n', '<leader>fc', builtin.git_files, { desc = "Find Files (Git)" })
|
|
|
|
require("telescope").load_extension("fzf")
|
|
|
|
local cmp = require("cmp")
|
|
local lspkind = require("lspkind")
|
|
cmp.setup({
|
|
preselect = cmp.PreselectMode.None,
|
|
formatting = {
|
|
format = lspkind.cmp_format ({
|
|
mode = "symbol",
|
|
maxwidth = 50,
|
|
ellipsis_char = "...",
|
|
|
|
symbol_map = {
|
|
Text = "",
|
|
Method = "",
|
|
Function = "",
|
|
Constructor = "",
|
|
Field = "",
|
|
Variable = "",
|
|
Class = "",
|
|
Interface = "",
|
|
Module = "",
|
|
Property = "",
|
|
Unit = "",
|
|
Value = "",
|
|
Enum = "",
|
|
Keyword = "",
|
|
Snippet = "",
|
|
Color = "",
|
|
File = "",
|
|
Reference = "",
|
|
Folder = "",
|
|
EnumMember = "",
|
|
Constant = "",
|
|
Struct = "",
|
|
Event = "",
|
|
Operator = "",
|
|
TypeParameter = ""
|
|
},
|
|
|
|
}),
|
|
},
|
|
|
|
window = {
|
|
completion = cmp.config.window.bordered(),
|
|
documentation = cmp.config.window.bordered(),
|
|
},
|
|
|
|
sources = cmp.config.sources ({
|
|
{ name = "buffer" },
|
|
{ name = "path" },
|
|
{ name = "nvim_lsp" },
|
|
}),
|
|
|
|
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 = false }),
|
|
}),
|
|
})
|
|
|
|
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
|
|
cmp.event:on(
|
|
'confirm_done',
|
|
cmp_autopairs.on_confirm_done()
|
|
)
|
|
|
|
cmp.setup.cmdline(":", {
|
|
mapping = cmp.mapping.preset.cmdline(),
|
|
sources = cmp.config.sources({
|
|
{ name = "path" },
|
|
{ name = "cmdline" },
|
|
})
|
|
})
|
|
|
|
cmp.setup.cmdline("/", {
|
|
mapping = cmp.mapping.preset.cmdline(),
|
|
sources = cmp.config.sources({
|
|
{ name = "buffer" },
|
|
})
|
|
})
|
|
|