Skip to content

Instantly share code, notes, and snippets.

@simonoff
Created July 19, 2024 07:44
Show Gist options
  • Save simonoff/52efeca07656092330796ae610c466d1 to your computer and use it in GitHub Desktop.
Save simonoff/52efeca07656092330796ae610c466d1 to your computer and use it in GitHub Desktop.
nvim indent highlight
vim.o.background = 'dark'
local c = require('vscode.colors').get_colors()
require('vscode').setup({})
require('vscode').load()
require('nvim-web-devicons').setup {}
require("bufferline").setup({
options = {
buffer_close_icon = "",
close_command = "bdelete %d",
close_icon = "",
indicator = {
style = "icon",
icon = " ",
},
left_trunc_marker = "",
modified_icon = "●",
offsets = { { filetype = "NvimTree", text = "EXPLORER", text_align = "center" } },
right_mouse_command = "bdelete! %d",
right_trunc_marker = "",
show_close_icon = false,
show_tab_indicators = true,
},
highlights = {
fill = {
fg = { attribute = "fg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "StatusLineNC" },
},
background = {
fg = { attribute = "fg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "StatusLine" },
},
buffer_visible = {
fg = { attribute = "fg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "Normal" },
},
buffer_selected = {
fg = { attribute = "fg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "Normal" },
},
separator = {
fg = { attribute = "bg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "StatusLine" },
},
separator_selected = {
fg = { attribute = "fg", highlight = "Special" },
bg = { attribute = "bg", highlight = "Normal" },
},
separator_visible = {
fg = { attribute = "fg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "StatusLineNC" },
},
close_button = {
fg = { attribute = "fg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "StatusLine" },
},
close_button_selected = {
fg = { attribute = "fg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "Normal" },
},
close_button_visible = {
fg = { attribute = "fg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "Normal" },
},
},
})
require('lualine').setup {
options = {
icons_enabled = true,
theme = 'vscode',
component_separators = { left = '', right = ''},
section_separators = { left = '', right = ''},
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
globalstatus = true,
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 = {}
}
require('gitsigns').setup {
signs = {
add = { text = '│' },
change = { text = '│' },
delete = { text = '_' },
topdelete = { text = '‾' },
changedelete = { text = '~' },
untracked = { text = '┆' },
},
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
watch_gitdir = {
follow_files = true
},
attach_to_untracked = true,
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = {
virt_text = true,
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
delay = 1000,
ignore_whitespace = false,
},
current_line_blame_formatter = '<author>, <author_time:%Y-%m-%d> - <summary>',
sign_priority = 6,
update_debounce = 100,
status_formatter = nil, -- Use default
max_file_length = 40000, -- Disable if file is longer than this (in lines)
preview_config = {
-- Options passed to nvim_open_win
border = 'single',
style = 'minimal',
relative = 'cursor',
row = 0,
col = 1
},
yadm = {
enable = false
},
}
vim.opt.termguicolors = true
local highlight = {
"IndentBlanklineIndent1",
"IndentBlanklineIndent2",
"IndentBlanklineIndent3",
"IndentBlanklineIndent4",
"IndentBlanklineIndent5",
"IndentBlanklineIndent6",
}
local hooks = require "ibl.hooks"
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
vim.api.nvim_set_hl(0, "IndentBlanklineIndent1", {fg = "#E06C75"})
vim.api.nvim_set_hl(0, "IndentBlanklineIndent2", {fg = "#E5C07B"})
vim.api.nvim_set_hl(0, "IndentBlanklineIndent3", {fg = "#98C379"})
vim.api.nvim_set_hl(0, "IndentBlanklineIndent4", {fg = "#56B6C2"})
vim.api.nvim_set_hl(0, "IndentBlanklineIndent5", {fg = "#61AFEF"})
vim.api.nvim_set_hl(0, "IndentBlanklineIndent6", {fg = "#C678DD"})
end)
require("ibl").setup { indent = { highlight = highlight } }
require('telescope').setup {
extensions = {
fzf = {
fuzzy = true, -- false will only do exact matching
override_generic_sorter = true, -- override the generic sorter
override_file_sorter = true, -- override the file sorter
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
-- the default case_mode is "smart_case"
}
}
}
-- To get fzf loaded and working with telescope, you need to call
-- load_extension, somewhere after setup function:
require('telescope').load_extension('fzf')
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment