Initial commit
This commit is contained in:
30
after/plugin/bufferline.lua
Normal file
30
after/plugin/bufferline.lua
Normal file
@@ -0,0 +1,30 @@
|
||||
local bufferline = require("bufferline")
|
||||
|
||||
bufferline.setup {
|
||||
options = {
|
||||
mode = "buffers",
|
||||
style_preset = bufferline.style_preset.default,
|
||||
themable = true,
|
||||
numbers = "none",
|
||||
close_command = "bdelete! %d",
|
||||
indicator = {
|
||||
icon = "▎",
|
||||
style = "icon"
|
||||
},
|
||||
max_name_length = 18,
|
||||
max_prefix_length = 15,
|
||||
truncate_names = true,
|
||||
tab_size = 18,
|
||||
offsets = {
|
||||
{
|
||||
filetype = "NvimTree",
|
||||
}
|
||||
},
|
||||
color_icons = true,
|
||||
get_element_icon = function(element)
|
||||
local icon, hl = require('nvim-web-devicons').get_icon_by_filetype(element.filetype, { default = false })
|
||||
return icon, hl
|
||||
end,
|
||||
always_show_bufferline = true,
|
||||
}
|
||||
}
|
||||
40
after/plugin/lsp.lua
Normal file
40
after/plugin/lsp.lua
Normal file
@@ -0,0 +1,40 @@
|
||||
local lsp = require('lsp-zero').preset({})
|
||||
|
||||
lsp.on_attach(function(client, bufnr)
|
||||
lsp.default_keymaps({buffer = bufnr})
|
||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
|
||||
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
|
||||
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
|
||||
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts)
|
||||
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
|
||||
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
|
||||
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
|
||||
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
|
||||
end)
|
||||
|
||||
local cmp = require('cmp')
|
||||
local cmp_select = {behavior = cmp.SelectBehavior.Select}
|
||||
local cmp_mappings = lsp.defaults.cmp_mappings({
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
|
||||
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
})
|
||||
|
||||
cmp_mappings['<Tab>'] = nil
|
||||
cmp_mappings['<S-Tab>'] = nil
|
||||
|
||||
lsp.setup_nvim_cmp({
|
||||
mapping = cmp_mappings
|
||||
})
|
||||
|
||||
lsp.ensure_installed({
|
||||
'lua_ls',
|
||||
'tsserver',
|
||||
'rust_analyzer',
|
||||
})
|
||||
require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls())
|
||||
|
||||
lsp.setup()
|
||||
40
after/plugin/lualine.lua
Normal file
40
after/plugin/lualine.lua
Normal file
@@ -0,0 +1,40 @@
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'auto',
|
||||
component_separators = { left = '', right = ''},
|
||||
section_separators = { left = '', right = ''},
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
globalstatus = false,
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
}
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {'mode'},
|
||||
lualine_b = {'branch', 'diff', 'diagnostics'},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'encoding', 'fileformat', 'filetype'},
|
||||
lualine_y = {'progress'},
|
||||
lualine_z = {'location'}
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'location'},
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {}
|
||||
}
|
||||
9
after/plugin/nvimtree.lua
Normal file
9
after/plugin/nvimtree.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
local nvimtree = require("nvim-tree")
|
||||
|
||||
nvimtree.setup({
|
||||
|
||||
view = {
|
||||
width = 30,
|
||||
}
|
||||
|
||||
})
|
||||
5
after/plugin/telescope.lua
Normal file
5
after/plugin/telescope.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
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 = "Find buffers" })
|
||||
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = "Help tags" })
|
||||
10
after/plugin/treesitter.lua
Normal file
10
after/plugin/treesitter.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
ensure_installed = { "lua", "vim", "vimdoc", "javascript", "java" },
|
||||
sync_install = false,
|
||||
auto_install = true,
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user