Updated and fixed neovim config
parent
9d1cc2fb39
commit
cb351d4aac
@ -1,167 +1,167 @@
|
|||||||
local status_ok, bufferline = pcall(require, "bufferline")
|
local status_ok, bufferline = pcall(require, "bufferline")
|
||||||
if not status_ok then
|
if not status_ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
bufferline.setup {
|
bufferline.setup {
|
||||||
options = {
|
options = {
|
||||||
numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string,
|
numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string,
|
||||||
close_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
|
close_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||||
right_mouse_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
|
right_mouse_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||||
left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions"
|
left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions"
|
||||||
middle_mouse_command = nil, -- can be a string | function, see "Mouse actions"
|
middle_mouse_command = nil, -- can be a string | function, see "Mouse actions"
|
||||||
-- NOTE: this plugin is designed with this icon in mind,
|
-- NOTE: this plugin is designed with this icon in mind,
|
||||||
-- and so changing this is NOT recommended, this is intended
|
-- and so changing this is NOT recommended, this is intended
|
||||||
-- as an escape hatch for people who cannot bear it for whatever reason
|
-- as an escape hatch for people who cannot bear it for whatever reason
|
||||||
indicator_icon = "▎",
|
indicator_icon = "▎",
|
||||||
buffer_close_icon = "",
|
buffer_close_icon = "",
|
||||||
-- buffer_close_icon = '',
|
-- buffer_close_icon = '',
|
||||||
modified_icon = "●",
|
modified_icon = "●",
|
||||||
close_icon = "",
|
close_icon = "",
|
||||||
-- close_icon = '',
|
-- close_icon = '',
|
||||||
left_trunc_marker = "",
|
left_trunc_marker = "",
|
||||||
right_trunc_marker = "",
|
right_trunc_marker = "",
|
||||||
--- name_formatter can be used to change the buffer's label in the bufferline.
|
--- name_formatter can be used to change the buffer's label in the bufferline.
|
||||||
--- Please note some names can/will break the
|
--- Please note some names can/will break the
|
||||||
--- bufferline so use this at your discretion knowing that it has
|
--- bufferline so use this at your discretion knowing that it has
|
||||||
--- some limitations that will *NOT* be fixed.
|
--- some limitations that will *NOT* be fixed.
|
||||||
-- name_formatter = function(buf) -- buf contains a "name", "path" and "bufnr"
|
-- name_formatter = function(buf) -- buf contains a "name", "path" and "bufnr"
|
||||||
-- -- remove extension from markdown files for example
|
-- -- remove extension from markdown files for example
|
||||||
-- if buf.name:match('%.md') then
|
-- if buf.name:match('%.md') then
|
||||||
-- return vim.fn.fnamemodify(buf.name, ':t:r')
|
-- return vim.fn.fnamemodify(buf.name, ':t:r')
|
||||||
-- end
|
-- end
|
||||||
-- end,
|
-- end,
|
||||||
max_name_length = 30,
|
max_name_length = 30,
|
||||||
max_prefix_length = 30, -- prefix used when a buffer is de-duplicated
|
max_prefix_length = 30, -- prefix used when a buffer is de-duplicated
|
||||||
tab_size = 21,
|
tab_size = 21,
|
||||||
diagnostics = false, -- | "nvim_lsp" | "coc",
|
diagnostics = false, -- | "nvim_lsp" | "coc",
|
||||||
diagnostics_update_in_insert = false,
|
diagnostics_update_in_insert = false,
|
||||||
-- diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
-- diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
||||||
-- return "("..count..")"
|
-- return "("..count..")"
|
||||||
-- end,
|
-- end,
|
||||||
-- NOTE: this will be called a lot so don't do any heavy processing here
|
-- NOTE: this will be called a lot so don't do any heavy processing here
|
||||||
-- custom_filter = function(buf_number)
|
-- custom_filter = function(buf_number)
|
||||||
-- -- filter out filetypes you don't want to see
|
-- -- filter out filetypes you don't want to see
|
||||||
-- if vim.bo[buf_number].filetype ~= "<i-dont-want-to-see-this>" then
|
-- if vim.bo[buf_number].filetype ~= "<i-dont-want-to-see-this>" then
|
||||||
-- return true
|
-- return true
|
||||||
-- end
|
-- end
|
||||||
-- -- filter out by buffer name
|
-- -- filter out by buffer name
|
||||||
-- if vim.fn.bufname(buf_number) ~= "<buffer-name-I-dont-want>" then
|
-- if vim.fn.bufname(buf_number) ~= "<buffer-name-I-dont-want>" then
|
||||||
-- return true
|
-- return true
|
||||||
-- end
|
-- end
|
||||||
-- -- filter out based on arbitrary rules
|
-- -- filter out based on arbitrary rules
|
||||||
-- -- e.g. filter out vim wiki buffer from tabline in your work repo
|
-- -- e.g. filter out vim wiki buffer from tabline in your work repo
|
||||||
-- if vim.fn.getcwd() == "<work-repo>" and vim.bo[buf_number].filetype ~= "wiki" then
|
-- if vim.fn.getcwd() == "<work-repo>" and vim.bo[buf_number].filetype ~= "wiki" then
|
||||||
-- return true
|
-- return true
|
||||||
-- end
|
-- end
|
||||||
-- end,
|
-- end,
|
||||||
offsets = { { filetype = "NvimTree", text = "", padding = 1 } },
|
offsets = { { filetype = "NvimTree", text = "", padding = 1 } },
|
||||||
show_buffer_icons = true,
|
show_buffer_icons = true,
|
||||||
show_buffer_close_icons = true,
|
show_buffer_close_icons = true,
|
||||||
show_close_icon = true,
|
show_close_icon = true,
|
||||||
show_tab_indicators = true,
|
show_tab_indicators = true,
|
||||||
persist_buffer_sort = true, -- whether or not custom sorted buffers should persist
|
persist_buffer_sort = true, -- whether or not custom sorted buffers should persist
|
||||||
-- can also be a table containing 2 custom separators
|
-- can also be a table containing 2 custom separators
|
||||||
-- [focused and unfocused]. eg: { '|', '|' }
|
-- [focused and unfocused]. eg: { '|', '|' }
|
||||||
separator_style = "thin", -- | "thick" | "thin" | { 'any', 'any' },
|
separator_style = "thin", -- | "thick" | "thin" | { 'any', 'any' },
|
||||||
enforce_regular_tabs = true,
|
enforce_regular_tabs = true,
|
||||||
always_show_bufferline = true,
|
always_show_bufferline = true,
|
||||||
-- sort_by = 'id' | 'extension' | 'relative_directory' | 'directory' | 'tabs' | function(buffer_a, buffer_b)
|
-- sort_by = 'id' | 'extension' | 'relative_directory' | 'directory' | 'tabs' | function(buffer_a, buffer_b)
|
||||||
-- -- add custom logic
|
-- -- add custom logic
|
||||||
-- return buffer_a.modified > buffer_b.modified
|
-- return buffer_a.modified > buffer_b.modified
|
||||||
-- end
|
-- end
|
||||||
},
|
|
||||||
highlights = {
|
|
||||||
fill = {
|
|
||||||
guifg = { attribute = "fg", highlight = "#ff0000" },
|
|
||||||
guibg = { attribute = "bg", highlight = "TabLine" },
|
|
||||||
},
|
|
||||||
background = {
|
|
||||||
guifg = { attribute = "fg", highlight = "TabLine" },
|
|
||||||
guibg = { attribute = "bg", highlight = "TabLine" },
|
|
||||||
},
|
},
|
||||||
|
highlights = {
|
||||||
|
fill = {
|
||||||
|
guifg = { attribute = "fg", highlight = "#ff0000" },
|
||||||
|
guibg = { attribute = "bg", highlight = "TabLine" },
|
||||||
|
},
|
||||||
|
background = {
|
||||||
|
guifg = { attribute = "fg", highlight = "TabLine" },
|
||||||
|
guibg = { attribute = "bg", highlight = "TabLine" },
|
||||||
|
},
|
||||||
|
|
||||||
-- buffer_selected = {
|
-- buffer_selected = {
|
||||||
-- guifg = {attribute='fg',highlight='#ff0000'},
|
-- guifg = {attribute='fg',highlight='#ff0000'},
|
||||||
-- guibg = {attribute='bg',highlight='#0000ff'},
|
-- guibg = {attribute='bg',highlight='#0000ff'},
|
||||||
-- gui = 'none'
|
-- gui = 'none'
|
||||||
-- },
|
-- },
|
||||||
buffer_visible = {
|
buffer_visible = {
|
||||||
guifg = { attribute = "fg", highlight = "TabLine" },
|
guifg = { attribute = "fg", highlight = "TabLine" },
|
||||||
guibg = { attribute = "bg", highlight = "TabLine" },
|
guibg = { attribute = "bg", highlight = "TabLine" },
|
||||||
},
|
},
|
||||||
|
|
||||||
close_button = {
|
close_button = {
|
||||||
guifg = { attribute = "fg", highlight = "TabLine" },
|
guifg = { attribute = "fg", highlight = "TabLine" },
|
||||||
guibg = { attribute = "bg", highlight = "TabLine" },
|
guibg = { attribute = "bg", highlight = "TabLine" },
|
||||||
},
|
},
|
||||||
close_button_visible = {
|
close_button_visible = {
|
||||||
guifg = { attribute = "fg", highlight = "TabLine" },
|
guifg = { attribute = "fg", highlight = "TabLine" },
|
||||||
guibg = { attribute = "bg", highlight = "TabLine" },
|
guibg = { attribute = "bg", highlight = "TabLine" },
|
||||||
},
|
},
|
||||||
-- close_button_selected = {
|
-- close_button_selected = {
|
||||||
-- guifg = {attribute='fg',highlight='TabLineSel'},
|
-- guifg = {attribute='fg',highlight='TabLineSel'},
|
||||||
-- guibg ={attribute='bg',highlight='TabLineSel'}
|
-- guibg ={attribute='bg',highlight='TabLineSel'}
|
||||||
-- },
|
-- },
|
||||||
|
|
||||||
tab_selected = {
|
tab_selected = {
|
||||||
guifg = { attribute = "fg", highlight = "Normal" },
|
guifg = { attribute = "fg", highlight = "Normal" },
|
||||||
guibg = { attribute = "bg", highlight = "Normal" },
|
guibg = { attribute = "bg", highlight = "Normal" },
|
||||||
},
|
},
|
||||||
tab = {
|
tab = {
|
||||||
guifg = { attribute = "fg", highlight = "TabLine" },
|
guifg = { attribute = "fg", highlight = "TabLine" },
|
||||||
guibg = { attribute = "bg", highlight = "TabLine" },
|
guibg = { attribute = "bg", highlight = "TabLine" },
|
||||||
},
|
},
|
||||||
tab_close = {
|
tab_close = {
|
||||||
-- guifg = {attribute='fg',highlight='LspDiagnosticsDefaultError'},
|
-- guifg = {attribute='fg',highlight='LspDiagnosticsDefaultError'},
|
||||||
guifg = { attribute = "fg", highlight = "TabLineSel" },
|
guifg = { attribute = "fg", highlight = "TabLineSel" },
|
||||||
guibg = { attribute = "bg", highlight = "Normal" },
|
guibg = { attribute = "bg", highlight = "Normal" },
|
||||||
},
|
},
|
||||||
|
|
||||||
duplicate_selected = {
|
duplicate_selected = {
|
||||||
guifg = { attribute = "fg", highlight = "TabLineSel" },
|
guifg = { attribute = "fg", highlight = "TabLineSel" },
|
||||||
guibg = { attribute = "bg", highlight = "TabLineSel" },
|
guibg = { attribute = "bg", highlight = "TabLineSel" },
|
||||||
gui = "italic",
|
gui = "italic",
|
||||||
},
|
},
|
||||||
duplicate_visible = {
|
duplicate_visible = {
|
||||||
guifg = { attribute = "fg", highlight = "TabLine" },
|
guifg = { attribute = "fg", highlight = "TabLine" },
|
||||||
guibg = { attribute = "bg", highlight = "TabLine" },
|
guibg = { attribute = "bg", highlight = "TabLine" },
|
||||||
gui = "italic",
|
gui = "italic",
|
||||||
},
|
},
|
||||||
duplicate = {
|
duplicate = {
|
||||||
guifg = { attribute = "fg", highlight = "TabLine" },
|
guifg = { attribute = "fg", highlight = "TabLine" },
|
||||||
guibg = { attribute = "bg", highlight = "TabLine" },
|
guibg = { attribute = "bg", highlight = "TabLine" },
|
||||||
gui = "italic",
|
gui = "italic",
|
||||||
},
|
},
|
||||||
|
|
||||||
modified = {
|
modified = {
|
||||||
guifg = { attribute = "fg", highlight = "TabLine" },
|
guifg = { attribute = "fg", highlight = "TabLine" },
|
||||||
guibg = { attribute = "bg", highlight = "TabLine" },
|
guibg = { attribute = "bg", highlight = "TabLine" },
|
||||||
},
|
},
|
||||||
modified_selected = {
|
modified_selected = {
|
||||||
guifg = { attribute = "fg", highlight = "Normal" },
|
guifg = { attribute = "fg", highlight = "Normal" },
|
||||||
guibg = { attribute = "bg", highlight = "Normal" },
|
guibg = { attribute = "bg", highlight = "Normal" },
|
||||||
},
|
},
|
||||||
modified_visible = {
|
modified_visible = {
|
||||||
guifg = { attribute = "fg", highlight = "TabLine" },
|
guifg = { attribute = "fg", highlight = "TabLine" },
|
||||||
guibg = { attribute = "bg", highlight = "TabLine" },
|
guibg = { attribute = "bg", highlight = "TabLine" },
|
||||||
},
|
},
|
||||||
|
|
||||||
separator = {
|
separator = {
|
||||||
guifg = { attribute = "bg", highlight = "TabLine" },
|
guifg = { attribute = "bg", highlight = "TabLine" },
|
||||||
guibg = { attribute = "bg", highlight = "TabLine" },
|
guibg = { attribute = "bg", highlight = "TabLine" },
|
||||||
|
},
|
||||||
|
separator_selected = {
|
||||||
|
guifg = { attribute = "bg", highlight = "Normal" },
|
||||||
|
guibg = { attribute = "bg", highlight = "Normal" },
|
||||||
|
},
|
||||||
|
-- separator_visible = {
|
||||||
|
-- guifg = {attribute='bg',highlight='TabLine'},
|
||||||
|
-- guibg = {attribute='bg',highlight='TabLine'}
|
||||||
|
-- },
|
||||||
|
indicator_selected = {
|
||||||
|
guifg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" },
|
||||||
|
guibg = { attribute = "bg", highlight = "Normal" },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
separator_selected = {
|
|
||||||
guifg = { attribute = "bg", highlight = "Normal" },
|
|
||||||
guibg = { attribute = "bg", highlight = "Normal" },
|
|
||||||
},
|
|
||||||
-- separator_visible = {
|
|
||||||
-- guifg = {attribute='bg',highlight='TabLine'},
|
|
||||||
-- guibg = {attribute='bg',highlight='TabLine'}
|
|
||||||
-- },
|
|
||||||
indicator_selected = {
|
|
||||||
guifg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" },
|
|
||||||
guibg = { attribute = "bg", highlight = "Normal" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
@ -1,126 +1,126 @@
|
|||||||
local cmp_status_ok, cmp = pcall(require, "cmp")
|
local cmp_status_ok, cmp = pcall(require, "cmp")
|
||||||
if not cmp_status_ok then
|
if not cmp_status_ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local snip_status_ok, luasnip = pcall(require, "luasnip")
|
local snip_status_ok, luasnip = pcall(require, "luasnip")
|
||||||
if not snip_status_ok then
|
if not snip_status_ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
require("luasnip/loaders/from_vscode").lazy_load()
|
require("luasnip/loaders/from_vscode").lazy_load()
|
||||||
|
|
||||||
local check_backspace = function()
|
local check_backspace = function()
|
||||||
local col = vim.fn.col "." - 1
|
local col = vim.fn.col "." - 1
|
||||||
return col == 0 or vim.fn.getline("."):sub(col, col):match "%s"
|
return col == 0 or vim.fn.getline("."):sub(col, col):match "%s"
|
||||||
end
|
end
|
||||||
|
|
||||||
-- פּ ﯟ some other good icons
|
-- פּ ﯟ some other good icons
|
||||||
local kind_icons = {
|
local kind_icons = {
|
||||||
Text = "",
|
Text = "",
|
||||||
Method = "m",
|
Method = "m",
|
||||||
Function = "",
|
Function = "",
|
||||||
Constructor = "",
|
Constructor = "",
|
||||||
Field = "",
|
Field = "",
|
||||||
Variable = "",
|
Variable = "",
|
||||||
Class = "",
|
Class = "",
|
||||||
Interface = "",
|
Interface = "",
|
||||||
Module = "",
|
Module = "",
|
||||||
Property = "",
|
Property = "",
|
||||||
Unit = "",
|
Unit = "",
|
||||||
Value = "",
|
Value = "",
|
||||||
Enum = "",
|
Enum = "",
|
||||||
Keyword = "",
|
Keyword = "",
|
||||||
Snippet = "",
|
Snippet = "",
|
||||||
Color = "",
|
Color = "",
|
||||||
File = "",
|
File = "",
|
||||||
Reference = "",
|
Reference = "",
|
||||||
Folder = "",
|
Folder = "",
|
||||||
EnumMember = "",
|
EnumMember = "",
|
||||||
Constant = "",
|
Constant = "",
|
||||||
Struct = "",
|
Struct = "",
|
||||||
Event = "",
|
Event = "",
|
||||||
Operator = "",
|
Operator = "",
|
||||||
TypeParameter = "",
|
TypeParameter = "",
|
||||||
}
|
}
|
||||||
-- find more here: https://www.nerdfonts.com/cheat-sheet
|
-- find more here: https://www.nerdfonts.com/cheat-sheet
|
||||||
|
|
||||||
cmp.setup {
|
cmp.setup {
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
luasnip.lsp_expand(args.body) -- For `luasnip` users.
|
luasnip.lsp_expand(args.body) -- For `luasnip` users.
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
mapping = {
|
mapping = {
|
||||||
["<C-k>"] = cmp.mapping.select_prev_item(),
|
["<C-k>"] = cmp.mapping.select_prev_item(),
|
||||||
["<C-j>"] = cmp.mapping.select_next_item(),
|
["<C-j>"] = cmp.mapping.select_next_item(),
|
||||||
["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }),
|
["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }),
|
||||||
["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }),
|
["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }),
|
||||||
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
|
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
|
||||||
["<C-y>"] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
|
["<C-y>"] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
|
||||||
["<C-e>"] = cmp.mapping {
|
["<C-e>"] = cmp.mapping {
|
||||||
i = cmp.mapping.abort(),
|
i = cmp.mapping.abort(),
|
||||||
c = cmp.mapping.close(),
|
c = cmp.mapping.close(),
|
||||||
|
},
|
||||||
|
-- Accept currently selected item. If none selected, `select` first item.
|
||||||
|
-- Set `select` to `false` to only confirm explicitly selected items.
|
||||||
|
["<CR>"] = cmp.mapping.confirm { select = true },
|
||||||
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
elseif luasnip.expandable() then
|
||||||
|
luasnip.expand()
|
||||||
|
elseif luasnip.expand_or_jumpable() then
|
||||||
|
luasnip.expand_or_jump()
|
||||||
|
elseif check_backspace() then
|
||||||
|
fallback()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, {
|
||||||
|
"i",
|
||||||
|
"s",
|
||||||
|
}),
|
||||||
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item()
|
||||||
|
elseif luasnip.jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, {
|
||||||
|
"i",
|
||||||
|
"s",
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
formatting = {
|
||||||
|
fields = { "kind", "abbr", "menu" },
|
||||||
|
format = function(entry, vim_item)
|
||||||
|
-- Kind icons
|
||||||
|
vim_item.kind = string.format("%s", kind_icons[vim_item.kind])
|
||||||
|
-- vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind
|
||||||
|
vim_item.menu = ({
|
||||||
|
nvim_lsp = "[LSP]",
|
||||||
|
luasnip = "[Snippet]",
|
||||||
|
buffer = "[Buffer]",
|
||||||
|
path = "[Path]",
|
||||||
|
})[entry.source.name]
|
||||||
|
return vim_item
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
sources = {
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "luasnip" },
|
||||||
|
{ name = "buffer" },
|
||||||
|
{ name = "path" },
|
||||||
|
},
|
||||||
|
confirm_opts = {
|
||||||
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
|
select = false,
|
||||||
|
},
|
||||||
|
experimental = {
|
||||||
|
ghost_text = false,
|
||||||
|
native_menu = false,
|
||||||
},
|
},
|
||||||
-- Accept currently selected item. If none selected, `select` first item.
|
|
||||||
-- Set `select` to `false` to only confirm explicitly selected items.
|
|
||||||
["<CR>"] = cmp.mapping.confirm { select = true },
|
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_next_item()
|
|
||||||
elseif luasnip.expandable() then
|
|
||||||
luasnip.expand()
|
|
||||||
elseif luasnip.expand_or_jumpable() then
|
|
||||||
luasnip.expand_or_jump()
|
|
||||||
elseif check_backspace() then
|
|
||||||
fallback()
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end, {
|
|
||||||
"i",
|
|
||||||
"s",
|
|
||||||
}),
|
|
||||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_prev_item()
|
|
||||||
elseif luasnip.jumpable(-1) then
|
|
||||||
luasnip.jump(-1)
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end, {
|
|
||||||
"i",
|
|
||||||
"s",
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
formatting = {
|
|
||||||
fields = { "kind", "abbr", "menu" },
|
|
||||||
format = function(entry, vim_item)
|
|
||||||
-- Kind icons
|
|
||||||
vim_item.kind = string.format("%s", kind_icons[vim_item.kind])
|
|
||||||
-- vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind
|
|
||||||
vim_item.menu = ({
|
|
||||||
nvim_lsp = "[LSP]",
|
|
||||||
luasnip = "[Snippet]",
|
|
||||||
buffer = "[Buffer]",
|
|
||||||
path = "[Path]",
|
|
||||||
})[entry.source.name]
|
|
||||||
return vim_item
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
sources = {
|
|
||||||
{ name = "nvim_lsp" },
|
|
||||||
{ name = "luasnip" },
|
|
||||||
{ name = "buffer" },
|
|
||||||
{ name = "path" },
|
|
||||||
},
|
|
||||||
confirm_opts = {
|
|
||||||
behavior = cmp.ConfirmBehavior.Replace,
|
|
||||||
select = false,
|
|
||||||
},
|
|
||||||
experimental = {
|
|
||||||
ghost_text = false,
|
|
||||||
native_menu = false,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
@ -1,48 +1,48 @@
|
|||||||
local status_ok, gitsigns = pcall(require, "gitsigns")
|
local status_ok, gitsigns = pcall(require, "gitsigns")
|
||||||
if not status_ok then
|
if not status_ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
gitsigns.setup {
|
gitsigns.setup {
|
||||||
signs = {
|
signs = {
|
||||||
add = {hl = 'GitSignsAdd' , text = '│', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'},
|
add = { hl = 'GitSignsAdd', text = '│', numhl = 'GitSignsAddNr', linehl = 'GitSignsAddLn' },
|
||||||
change = {hl = 'GitSignsChange', text = '│', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},
|
change = { hl = 'GitSignsChange', text = '│', numhl = 'GitSignsChangeNr', linehl = 'GitSignsChangeLn' },
|
||||||
delete = {hl = 'GitSignsDelete', text = '契', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'},
|
delete = { hl = 'GitSignsDelete', text = '契', numhl = 'GitSignsDeleteNr', linehl = 'GitSignsDeleteLn' },
|
||||||
topdelete = {hl = 'GitSignsDelete', text = '契', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'},
|
topdelete = { hl = 'GitSignsDelete', text = '契', numhl = 'GitSignsDeleteNr', linehl = 'GitSignsDeleteLn' },
|
||||||
changedelete = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},
|
changedelete = { hl = 'GitSignsChange', text = '~', numhl = 'GitSignsChangeNr', linehl = 'GitSignsChangeLn' },
|
||||||
},
|
},
|
||||||
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||||
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
||||||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||||
watch_gitdir = {
|
watch_gitdir = {
|
||||||
interval = 1000,
|
interval = 1000,
|
||||||
follow_files = true
|
follow_files = true
|
||||||
},
|
},
|
||||||
attach_to_untracked = true,
|
attach_to_untracked = true,
|
||||||
current_line_blame = true, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
||||||
current_line_blame_opts = {
|
current_line_blame_opts = {
|
||||||
virt_text = true,
|
virt_text = true,
|
||||||
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
|
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
|
||||||
delay = 1000,
|
delay = 1000,
|
||||||
ignore_whitespace = false,
|
ignore_whitespace = false,
|
||||||
},
|
},
|
||||||
current_line_blame_formatter_opts = {
|
current_line_blame_formatter_opts = {
|
||||||
relative_time = false,
|
relative_time = false,
|
||||||
},
|
},
|
||||||
sign_priority = 6,
|
sign_priority = 6,
|
||||||
update_debounce = 100,
|
update_debounce = 100,
|
||||||
status_formatter = nil, -- Use default
|
status_formatter = nil, -- Use default
|
||||||
max_file_length = 40000,
|
max_file_length = 40000,
|
||||||
preview_config = {
|
preview_config = {
|
||||||
-- Options passed to nvim_open_win
|
-- Options passed to nvim_open_win
|
||||||
border = 'single',
|
border = 'single',
|
||||||
style = 'minimal',
|
style = 'minimal',
|
||||||
relative = 'cursor',
|
relative = 'cursor',
|
||||||
row = 0,
|
row = 0,
|
||||||
col = 1
|
col = 1
|
||||||
},
|
},
|
||||||
yadm = {
|
yadm = {
|
||||||
enable = false
|
enable = false
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -1,28 +1,33 @@
|
|||||||
local status_ok, lsp_installer = pcall(require, "nvim-lsp-installer")
|
local status_ok, lsp_installer = pcall(require, "nvim-lsp-installer")
|
||||||
if not status_ok then
|
if not status_ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Register a handler that will be called for all installed servers.
|
-- Register a handler that will be called for all installed servers.
|
||||||
-- Alternatively, you may also register handlers on specific server instances instead (see example below).
|
-- Alternatively, you may also register handlers on specific server instances instead (see example below).
|
||||||
lsp_installer.on_server_ready(function(server)
|
lsp_installer.on_server_ready(function(server)
|
||||||
local opts = {
|
local opts = {
|
||||||
on_attach = require("user.lsp.handlers").on_attach,
|
on_attach = require("user.lsp.handlers").on_attach,
|
||||||
capabilities = require("user.lsp.handlers").capabilities,
|
capabilities = require("user.lsp.handlers").capabilities,
|
||||||
}
|
}
|
||||||
|
|
||||||
if server.name == "jsonls" then
|
if server.name == "jsonls" then
|
||||||
local jsonls_opts = require("user.lsp.settings.jsonls")
|
local jsonls_opts = require("user.lsp.settings.jsonls")
|
||||||
opts = vim.tbl_deep_extend("force", jsonls_opts, opts)
|
opts = vim.tbl_deep_extend("force", jsonls_opts, opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
if server.name == "sumneko_lua" then
|
if server.name == "sumneko_lua" then
|
||||||
local sumneko_opts = require("user.lsp.settings.sumneko_lua")
|
local sumneko_opts = require("user.lsp.settings.sumneko_lua")
|
||||||
opts = vim.tbl_deep_extend("force", sumneko_opts, opts)
|
opts = vim.tbl_deep_extend("force", sumneko_opts, opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- This setup() function is exactly the same as lspconfig's setup function.
|
if server.name == "clangd" then
|
||||||
-- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
local clangd_opts = require("user.lsp.settings.clangd")
|
||||||
server:setup(opts)
|
opts = vim.tbl_deep_extend("force", clangd_opts, opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- This setup() function is exactly the same as lspconfig's setup function.
|
||||||
|
-- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||||
|
server:setup(opts)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
@ -1,182 +1,182 @@
|
|||||||
local schemas = {
|
local schemas = {
|
||||||
{
|
{
|
||||||
description = "TypeScript compiler configuration file",
|
description = "TypeScript compiler configuration file",
|
||||||
fileMatch = {
|
fileMatch = {
|
||||||
"tsconfig.json",
|
"tsconfig.json",
|
||||||
"tsconfig.*.json",
|
"tsconfig.*.json",
|
||||||
|
},
|
||||||
|
url = "https://json.schemastore.org/tsconfig.json",
|
||||||
},
|
},
|
||||||
url = "https://json.schemastore.org/tsconfig.json",
|
{
|
||||||
},
|
description = "Lerna config",
|
||||||
{
|
fileMatch = { "lerna.json" },
|
||||||
description = "Lerna config",
|
url = "https://json.schemastore.org/lerna.json",
|
||||||
fileMatch = { "lerna.json" },
|
|
||||||
url = "https://json.schemastore.org/lerna.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description = "Babel configuration",
|
|
||||||
fileMatch = {
|
|
||||||
".babelrc.json",
|
|
||||||
".babelrc",
|
|
||||||
"babel.config.json",
|
|
||||||
},
|
},
|
||||||
url = "https://json.schemastore.org/babelrc.json",
|
{
|
||||||
},
|
description = "Babel configuration",
|
||||||
{
|
fileMatch = {
|
||||||
description = "ESLint config",
|
".babelrc.json",
|
||||||
fileMatch = {
|
".babelrc",
|
||||||
".eslintrc.json",
|
"babel.config.json",
|
||||||
".eslintrc",
|
},
|
||||||
|
url = "https://json.schemastore.org/babelrc.json",
|
||||||
},
|
},
|
||||||
url = "https://json.schemastore.org/eslintrc.json",
|
{
|
||||||
},
|
description = "ESLint config",
|
||||||
{
|
fileMatch = {
|
||||||
description = "Bucklescript config",
|
".eslintrc.json",
|
||||||
fileMatch = { "bsconfig.json" },
|
".eslintrc",
|
||||||
url = "https://raw.githubusercontent.com/rescript-lang/rescript-compiler/8.2.0/docs/docson/build-schema.json",
|
},
|
||||||
},
|
url = "https://json.schemastore.org/eslintrc.json",
|
||||||
{
|
|
||||||
description = "Prettier config",
|
|
||||||
fileMatch = {
|
|
||||||
".prettierrc",
|
|
||||||
".prettierrc.json",
|
|
||||||
"prettier.config.json",
|
|
||||||
},
|
},
|
||||||
url = "https://json.schemastore.org/prettierrc",
|
{
|
||||||
},
|
description = "Bucklescript config",
|
||||||
{
|
fileMatch = { "bsconfig.json" },
|
||||||
description = "Vercel Now config",
|
url = "https://raw.githubusercontent.com/rescript-lang/rescript-compiler/8.2.0/docs/docson/build-schema.json",
|
||||||
fileMatch = { "now.json" },
|
|
||||||
url = "https://json.schemastore.org/now",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description = "Stylelint config",
|
|
||||||
fileMatch = {
|
|
||||||
".stylelintrc",
|
|
||||||
".stylelintrc.json",
|
|
||||||
"stylelint.config.json",
|
|
||||||
},
|
},
|
||||||
url = "https://json.schemastore.org/stylelintrc",
|
{
|
||||||
},
|
description = "Prettier config",
|
||||||
{
|
fileMatch = {
|
||||||
description = "A JSON schema for the ASP.NET LaunchSettings.json files",
|
".prettierrc",
|
||||||
fileMatch = { "launchsettings.json" },
|
".prettierrc.json",
|
||||||
url = "https://json.schemastore.org/launchsettings.json",
|
"prettier.config.json",
|
||||||
},
|
},
|
||||||
{
|
url = "https://json.schemastore.org/prettierrc",
|
||||||
description = "Schema for CMake Presets",
|
|
||||||
fileMatch = {
|
|
||||||
"CMakePresets.json",
|
|
||||||
"CMakeUserPresets.json",
|
|
||||||
},
|
},
|
||||||
url = "https://raw.githubusercontent.com/Kitware/CMake/master/Help/manual/presets/schema.json",
|
{
|
||||||
},
|
description = "Vercel Now config",
|
||||||
{
|
fileMatch = { "now.json" },
|
||||||
description = "Configuration file as an alternative for configuring your repository in the settings page.",
|
url = "https://json.schemastore.org/now",
|
||||||
fileMatch = {
|
|
||||||
".codeclimate.json",
|
|
||||||
},
|
},
|
||||||
url = "https://json.schemastore.org/codeclimate.json",
|
{
|
||||||
},
|
description = "Stylelint config",
|
||||||
{
|
fileMatch = {
|
||||||
description = "LLVM compilation database",
|
".stylelintrc",
|
||||||
fileMatch = {
|
".stylelintrc.json",
|
||||||
"compile_commands.json",
|
"stylelint.config.json",
|
||||||
|
},
|
||||||
|
url = "https://json.schemastore.org/stylelintrc",
|
||||||
},
|
},
|
||||||
url = "https://json.schemastore.org/compile-commands.json",
|
{
|
||||||
},
|
description = "A JSON schema for the ASP.NET LaunchSettings.json files",
|
||||||
{
|
fileMatch = { "launchsettings.json" },
|
||||||
description = "Config file for Command Task Runner",
|
url = "https://json.schemastore.org/launchsettings.json",
|
||||||
fileMatch = {
|
|
||||||
"commands.json",
|
|
||||||
},
|
},
|
||||||
url = "https://json.schemastore.org/commands.json",
|
{
|
||||||
},
|
description = "Schema for CMake Presets",
|
||||||
{
|
fileMatch = {
|
||||||
description = "AWS CloudFormation provides a common language for you to describe and provision all the infrastructure resources in your cloud environment.",
|
"CMakePresets.json",
|
||||||
fileMatch = {
|
"CMakeUserPresets.json",
|
||||||
"*.cf.json",
|
},
|
||||||
"cloudformation.json",
|
url = "https://raw.githubusercontent.com/Kitware/CMake/master/Help/manual/presets/schema.json",
|
||||||
},
|
},
|
||||||
url = "https://raw.githubusercontent.com/awslabs/goformation/v5.2.9/schema/cloudformation.schema.json",
|
{
|
||||||
},
|
description = "Configuration file as an alternative for configuring your repository in the settings page.",
|
||||||
{
|
fileMatch = {
|
||||||
description = "The AWS Serverless Application Model (AWS SAM, previously known as Project Flourish) extends AWS CloudFormation to provide a simplified way of defining the Amazon API Gateway APIs, AWS Lambda functions, and Amazon DynamoDB tables needed by your serverless application.",
|
".codeclimate.json",
|
||||||
fileMatch = {
|
},
|
||||||
"serverless.template",
|
url = "https://json.schemastore.org/codeclimate.json",
|
||||||
"*.sam.json",
|
|
||||||
"sam.json",
|
|
||||||
},
|
},
|
||||||
url = "https://raw.githubusercontent.com/awslabs/goformation/v5.2.9/schema/sam.schema.json",
|
{
|
||||||
},
|
description = "LLVM compilation database",
|
||||||
{
|
fileMatch = {
|
||||||
description = "Json schema for properties json file for a GitHub Workflow template",
|
"compile_commands.json",
|
||||||
fileMatch = {
|
},
|
||||||
".github/workflow-templates/**.properties.json",
|
url = "https://json.schemastore.org/compile-commands.json",
|
||||||
},
|
},
|
||||||
url = "https://json.schemastore.org/github-workflow-template-properties.json",
|
{
|
||||||
},
|
description = "Config file for Command Task Runner",
|
||||||
{
|
fileMatch = {
|
||||||
description = "golangci-lint configuration file",
|
"commands.json",
|
||||||
fileMatch = {
|
},
|
||||||
".golangci.toml",
|
url = "https://json.schemastore.org/commands.json",
|
||||||
".golangci.json",
|
|
||||||
},
|
},
|
||||||
url = "https://json.schemastore.org/golangci-lint.json",
|
{
|
||||||
},
|
description = "AWS CloudFormation provides a common language for you to describe and provision all the infrastructure resources in your cloud environment.",
|
||||||
{
|
fileMatch = {
|
||||||
description = "JSON schema for the JSON Feed format",
|
"*.cf.json",
|
||||||
fileMatch = {
|
"cloudformation.json",
|
||||||
"feed.json",
|
},
|
||||||
|
url = "https://raw.githubusercontent.com/awslabs/goformation/v5.2.9/schema/cloudformation.schema.json",
|
||||||
},
|
},
|
||||||
url = "https://json.schemastore.org/feed.json",
|
{
|
||||||
versions = {
|
description = "The AWS Serverless Application Model (AWS SAM, previously known as Project Flourish) extends AWS CloudFormation to provide a simplified way of defining the Amazon API Gateway APIs, AWS Lambda functions, and Amazon DynamoDB tables needed by your serverless application.",
|
||||||
["1"] = "https://json.schemastore.org/feed-1.json",
|
fileMatch = {
|
||||||
["1.1"] = "https://json.schemastore.org/feed.json",
|
"serverless.template",
|
||||||
|
"*.sam.json",
|
||||||
|
"sam.json",
|
||||||
|
},
|
||||||
|
url = "https://raw.githubusercontent.com/awslabs/goformation/v5.2.9/schema/sam.schema.json",
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
{
|
description = "Json schema for properties json file for a GitHub Workflow template",
|
||||||
description = "Packer template JSON configuration",
|
fileMatch = {
|
||||||
fileMatch = {
|
".github/workflow-templates/**.properties.json",
|
||||||
"packer.json",
|
},
|
||||||
|
url = "https://json.schemastore.org/github-workflow-template-properties.json",
|
||||||
},
|
},
|
||||||
url = "https://json.schemastore.org/packer.json",
|
{
|
||||||
},
|
description = "golangci-lint configuration file",
|
||||||
{
|
fileMatch = {
|
||||||
description = "NPM configuration file",
|
".golangci.toml",
|
||||||
fileMatch = {
|
".golangci.json",
|
||||||
"package.json",
|
},
|
||||||
|
url = "https://json.schemastore.org/golangci-lint.json",
|
||||||
},
|
},
|
||||||
url = "https://json.schemastore.org/package.json",
|
{
|
||||||
},
|
description = "JSON schema for the JSON Feed format",
|
||||||
{
|
fileMatch = {
|
||||||
description = "JSON schema for Visual Studio component configuration files",
|
"feed.json",
|
||||||
fileMatch = {
|
},
|
||||||
"*.vsconfig",
|
url = "https://json.schemastore.org/feed.json",
|
||||||
|
versions = {
|
||||||
|
["1"] = "https://json.schemastore.org/feed-1.json",
|
||||||
|
["1.1"] = "https://json.schemastore.org/feed.json",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
description = "Packer template JSON configuration",
|
||||||
|
fileMatch = {
|
||||||
|
"packer.json",
|
||||||
|
},
|
||||||
|
url = "https://json.schemastore.org/packer.json",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
description = "NPM configuration file",
|
||||||
|
fileMatch = {
|
||||||
|
"package.json",
|
||||||
|
},
|
||||||
|
url = "https://json.schemastore.org/package.json",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
description = "JSON schema for Visual Studio component configuration files",
|
||||||
|
fileMatch = {
|
||||||
|
"*.vsconfig",
|
||||||
|
},
|
||||||
|
url = "https://json.schemastore.org/vsconfig.json",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
description = "Resume json",
|
||||||
|
fileMatch = { "resume.json" },
|
||||||
|
url = "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
|
||||||
},
|
},
|
||||||
url = "https://json.schemastore.org/vsconfig.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description = "Resume json",
|
|
||||||
fileMatch = { "resume.json" },
|
|
||||||
url = "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
local opts = {
|
local opts = {
|
||||||
settings = {
|
settings = {
|
||||||
json = {
|
json = {
|
||||||
schemas = schemas,
|
schemas = schemas,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
setup = {
|
||||||
setup = {
|
commands = {
|
||||||
commands = {
|
Format = {
|
||||||
Format = {
|
function()
|
||||||
function()
|
vim.lsp.buf.range_formatting({}, { 0, 0 }, { vim.fn.line "$", 0 })
|
||||||
vim.lsp.buf.range_formatting({}, { 0, 0 }, { vim.fn.line "$", 0 })
|
end,
|
||||||
end,
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return opts
|
return opts
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
return {
|
return {
|
||||||
settings = {
|
settings = {
|
||||||
|
|
||||||
Lua = {
|
Lua = {
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
globals = { "vim" },
|
globals = { "vim" },
|
||||||
},
|
},
|
||||||
workspace = {
|
workspace = {
|
||||||
library = {
|
library = {
|
||||||
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
||||||
[vim.fn.stdpath("config") .. "/lua"] = true,
|
[vim.fn.stdpath("config") .. "/lua"] = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -1,83 +1,123 @@
|
|||||||
-- following options are the default
|
-- following options are the default
|
||||||
-- each of these are documented in `:help nvim-tree.OPTION_NAME`
|
-- each of these are documented in `:help nvim-tree.OPTION_NAME`
|
||||||
vim.g.nvim_tree_icons = {
|
|
||||||
default = "",
|
|
||||||
symlink = "",
|
|
||||||
git = {
|
|
||||||
unstaged = "",
|
|
||||||
staged = "S",
|
|
||||||
unmerged = "",
|
|
||||||
renamed = "➜",
|
|
||||||
deleted = "",
|
|
||||||
untracked = "U",
|
|
||||||
ignored = "◌",
|
|
||||||
},
|
|
||||||
folder = {
|
|
||||||
default = "",
|
|
||||||
open = "",
|
|
||||||
empty = "",
|
|
||||||
empty_open = "",
|
|
||||||
symlink = "",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
local status_ok, nvim_tree = pcall(require, "nvim-tree")
|
local status_ok, nvim_tree = pcall(require, "nvim-tree")
|
||||||
if not status_ok then
|
if not status_ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local config_status_ok, nvim_tree_config = pcall(require, "nvim-tree.config")
|
local config_status_ok, nvim_tree_config = pcall(require, "nvim-tree.config")
|
||||||
if not config_status_ok then
|
if not config_status_ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local tree_cb = nvim_tree_config.nvim_tree_callback
|
local tree_cb = nvim_tree_config.nvim_tree_callback
|
||||||
|
|
||||||
nvim_tree.setup {
|
nvim_tree.setup {
|
||||||
disable_netrw = true,
|
renderer = {
|
||||||
hijack_netrw = true,
|
icons = {
|
||||||
open_on_setup = false,
|
webdev_colors = true,
|
||||||
ignore_ft_on_setup = {
|
git_placement = "before",
|
||||||
"startify",
|
padding = " ",
|
||||||
"dashboard",
|
symlink_arrow = " ➛ ",
|
||||||
"alpha",
|
show = {
|
||||||
},
|
file = true,
|
||||||
open_on_tab = false,
|
folder = true,
|
||||||
hijack_cursor = false,
|
folder_arrow = true,
|
||||||
update_cwd = true,
|
git = true,
|
||||||
diagnostics = {
|
},
|
||||||
enable = true,
|
glyphs = {
|
||||||
icons = {
|
default = "",
|
||||||
hint = "",
|
symlink = "",
|
||||||
info = "",
|
git = {
|
||||||
warning = "",
|
unstaged = "",
|
||||||
error = "",
|
staged = "S",
|
||||||
|
unmerged = "",
|
||||||
|
renamed = "➜",
|
||||||
|
deleted = "",
|
||||||
|
untracked = "U",
|
||||||
|
ignored = "◌",
|
||||||
|
},
|
||||||
|
folder = {
|
||||||
|
default = "",
|
||||||
|
open = "",
|
||||||
|
empty = "",
|
||||||
|
empty_open = "",
|
||||||
|
symlink = "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
highlight_git = true,
|
||||||
|
root_folder_modifier = ":t",
|
||||||
},
|
},
|
||||||
},
|
hijack_directories = {
|
||||||
update_focused_file = {
|
enable = true,
|
||||||
enable = true,
|
auto_open = true,
|
||||||
|
},
|
||||||
|
disable_netrw = true,
|
||||||
|
hijack_netrw = true,
|
||||||
|
open_on_setup = false,
|
||||||
|
ignore_ft_on_setup = {
|
||||||
|
"startify",
|
||||||
|
"dashboard",
|
||||||
|
"alpha",
|
||||||
|
},
|
||||||
|
open_on_tab = false,
|
||||||
|
hijack_cursor = false,
|
||||||
update_cwd = true,
|
update_cwd = true,
|
||||||
ignore_list = {},
|
diagnostics = {
|
||||||
},
|
enable = true,
|
||||||
git = {
|
icons = {
|
||||||
enable = true,
|
hint = "",
|
||||||
ignore = true,
|
info = "",
|
||||||
timeout = 500,
|
warning = "",
|
||||||
},
|
error = "",
|
||||||
view = {
|
},
|
||||||
width = 30,
|
},
|
||||||
height = 30,
|
update_focused_file = {
|
||||||
hide_root_folder = false,
|
enable = true,
|
||||||
side = "left",
|
update_cwd = true,
|
||||||
mappings = {
|
ignore_list = {},
|
||||||
custom_only = false,
|
},
|
||||||
list = {
|
system_open = {
|
||||||
{ key = { "l", "<CR>", "o" }, cb = tree_cb "edit" },
|
cmd = nil,
|
||||||
{ key = "h", cb = tree_cb "close_node" },
|
args = {},
|
||||||
{ key = "v", cb = tree_cb "vsplit" },
|
},
|
||||||
},
|
filters = {
|
||||||
|
dotfiles = false,
|
||||||
|
custom = {},
|
||||||
|
},
|
||||||
|
git = {
|
||||||
|
enable = true,
|
||||||
|
ignore = true,
|
||||||
|
timeout = 500,
|
||||||
|
},
|
||||||
|
view = {
|
||||||
|
width = 30,
|
||||||
|
height = 30,
|
||||||
|
hide_root_folder = false,
|
||||||
|
side = "left",
|
||||||
|
mappings = {
|
||||||
|
custom_only = false,
|
||||||
|
list = {
|
||||||
|
{ key = { "l", "<CR>", "o" }, cb = tree_cb "edit" },
|
||||||
|
{ key = "h", cb = tree_cb "close_node" },
|
||||||
|
{ key = "v", cb = tree_cb "vsplit" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
number = false,
|
||||||
|
relativenumber = false,
|
||||||
|
},
|
||||||
|
trash = {
|
||||||
|
cmd = "trash",
|
||||||
|
require_confirm = true,
|
||||||
|
},
|
||||||
|
actions = {
|
||||||
|
open_file = {
|
||||||
|
resize_window = true,
|
||||||
|
quit_on_open = true,
|
||||||
|
window_picker = {
|
||||||
|
enable = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
number = false,
|
|
||||||
relativenumber = false,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
@ -1,47 +1,51 @@
|
|||||||
local options = {
|
local options = {
|
||||||
backup = false, -- creates a backup file
|
backup = false, -- creates a backup file
|
||||||
clipboard = "unnamedplus", -- allows neovim to access the system clipboard
|
clipboard = "unnamedplus", -- allows neovim to access the system clipboard
|
||||||
cmdheight = 2, -- more space in the neovim command line for displaying messages
|
cmdheight = 2, -- more space in the neovim command line for displaying messages
|
||||||
completeopt = { "menuone", "noselect" }, -- mostly just for cmp
|
completeopt = { "menuone", "noselect" }, -- mostly just for cmp
|
||||||
conceallevel = 0, -- so that `` is visible in markdown files
|
conceallevel = 0, -- so that `` is visible in markdown files
|
||||||
fileencoding = "utf-8", -- the encoding written to a file
|
fileencoding = "utf-8", -- the encoding written to a file
|
||||||
hlsearch = true, -- highlight all matches on previous search pattern
|
hlsearch = true, -- highlight all matches on previous search pattern
|
||||||
ignorecase = true, -- ignore case in search patterns
|
ignorecase = true, -- ignore case in search patterns
|
||||||
mouse = "a", -- allow the mouse to be used in neovim
|
mouse = "a", -- allow the mouse to be used in neovim
|
||||||
pumheight = 10, -- pop up menu height
|
pumheight = 10, -- pop up menu height
|
||||||
showmode = false, -- we don't need to see things like -- INSERT -- anymore
|
showmode = false, -- we don't need to see things like -- INSERT -- anymore
|
||||||
showtabline = 2, -- always show tabs
|
showtabline = 2, -- always show tabs
|
||||||
smartcase = true, -- smart case
|
smartcase = true, -- smart case
|
||||||
smartindent = true, -- make indenting smarter again
|
smartindent = true, -- make indenting smarter again
|
||||||
splitbelow = true, -- force all horizontal splits to go below current window
|
splitbelow = true, -- force all horizontal splits to go below current window
|
||||||
splitright = true, -- force all vertical splits to go to the right of current window
|
splitright = true, -- force all vertical splits to go to the right of current window
|
||||||
swapfile = false, -- creates a swapfile
|
swapfile = false, -- creates a swapfile
|
||||||
-- termguicolors = true, -- set term gui colors (most terminals support this)
|
termguicolors = true, -- set term gui colors (most terminals support this)
|
||||||
timeoutlen = 1000, -- time to wait for a mapped sequence to complete (in milliseconds)
|
timeoutlen = 1000, -- time to wait for a mapped sequence to complete (in milliseconds)
|
||||||
undofile = true, -- enable persistent undo
|
undofile = true, -- enable persistent undo
|
||||||
updatetime = 300, -- faster completion (4000ms default)
|
updatetime = 300, -- faster completion (4000ms default)
|
||||||
writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
|
writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
|
||||||
expandtab = true, -- convert tabs to spaces
|
expandtab = true, -- convert tabs to spaces
|
||||||
shiftwidth = 4, -- the number of spaces inserted for each indentation
|
shiftwidth = 4, -- the number of spaces inserted for each indentation
|
||||||
tabstop = 4, -- insert 2 spaces for a tab
|
tabstop = 4, -- insert 2 spaces for a tab
|
||||||
cursorline = true, -- highlight the current line
|
cursorline = true, -- highlight the current line
|
||||||
number = true, -- set numbered lines
|
number = true, -- set numbered lines
|
||||||
relativenumber = false, -- set relative numbered lines
|
relativenumber = false, -- set relative numbered lines
|
||||||
numberwidth = 4, -- set number column width to 2 {default 4}
|
numberwidth = 4, -- set number column width to 2 {default 4}
|
||||||
signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time
|
signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time
|
||||||
wrap = false, -- display lines as one long line
|
wrap = false, -- display lines as one long line
|
||||||
scrolloff = 8, -- is one of my fav
|
scrolloff = 8, -- is one of my fav
|
||||||
sidescrolloff = 8,
|
sidescrolloff = 8,
|
||||||
guifont = "monospace:h17", -- the font used in graphical neovim applications
|
guifont = "monospace:h17", -- the font used in graphical neovim applications
|
||||||
list = true,
|
list = true,
|
||||||
|
foldenable = false,
|
||||||
|
foldmethod = "indent",
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.opt.shortmess:append "c"
|
vim.opt.shortmess:append "c"
|
||||||
|
|
||||||
for k, v in pairs(options) do
|
for k, v in pairs(options) do
|
||||||
vim.opt[k] = v
|
vim.opt[k] = v
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.cmd "set whichwrap+=<,>,[,],h,l"
|
vim.cmd "set whichwrap+=<,>,[,],h,l"
|
||||||
vim.cmd [[set iskeyword+=-]]
|
vim.cmd [[set iskeyword+=-]]
|
||||||
vim.cmd "set listchars=space:·"
|
vim.cmd "set listchars=space:·"
|
||||||
|
--vim.cmd "set term=screen-256color"
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
require('lualine').setup {
|
require('lualine').setup {
|
||||||
options = { theme = 'nord'}
|
options = { theme = 'nord' }
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
local configs = require("nvim-treesitter.configs")
|
local configs = require("nvim-treesitter.configs")
|
||||||
configs.setup {
|
configs.setup {
|
||||||
ensure_installed = {"c", "cpp"},
|
ensure_installed = { "c", "cpp" },
|
||||||
sync_install = false,
|
sync_install = false,
|
||||||
ignore_install = { "" }, -- List of parsers to ignore installing
|
ignore_install = { "" }, -- List of parsers to ignore installing
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true, -- false will disable the whole extension
|
enable = true, -- false will disable the whole extension
|
||||||
disable = { "" }, -- list of language that will be disabled
|
disable = { "" }, -- list of language that will be disabled
|
||||||
additional_vim_regex_highlighting = true,
|
additional_vim_regex_highlighting = true,
|
||||||
|
|
||||||
},
|
},
|
||||||
indent = { enable = true },
|
indent = { enable = true },
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue